Submission #15083314


Source Code Expand

Copy
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using TP = tuple<ll,ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(18);
}
ll dup(ll x,ll y,ll s,ll e){
  ll res = 0;
  if(x <= s){
    if(y < s) res = 0;
    else{
      res = min(y,e)-s;
    }
  }else{
    res = dup(s,e,x,y);
  }
  return res;
}
signed main(){
  init_io();
  ll c,d,ans=0;
  ll x = 140,y=170;
  cin >> c >> d;
  while(x <= d){
    ans += dup(x,y,c,d);
    x *= 2;
    y *= 2;
  }
  cout << ans << endl;
}

Submission Info

Submission Time
Task A - Feel the Beat
User shop_one
Language C++ (GCC 9.2.1)
Score 300
Code Size 761 Byte
Status
Exec Time 10 ms
Memory 3516 KB

Judge Result

Set Name Score / Max Score Test Cases
Sample 0 / 0 a01, a02, a03
All 300 / 300 a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13, b14, b15
Case Name Status Exec Time Memory
a01 10 ms 3488 KB
a02 2 ms 3516 KB
a03 2 ms 3476 KB
b04 2 ms 3476 KB
b05 2 ms 3476 KB
b06 2 ms 3424 KB
b07 1 ms 3480 KB
b08 2 ms 3496 KB
b09 2 ms 3492 KB
b10 2 ms 3480 KB
b11 2 ms 3484 KB
b12 2 ms 3488 KB
b13 2 ms 3504 KB
b14 3 ms 3416 KB
b15 2 ms 3516 KB