제출 #369191

#제출 시각아이디문제언어결과실행 시간메모리
369191iliccmarkoRack (eJOI19_rack)C++14
0 / 100
10 ms8172 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" #define INF 1000000000 #define LINF 1000000000000000LL #define pb push_back #define all(x) x.begin(), x.end() #define len(s) (int)s.size() #define test_case { int t; cin>>t; while(t--)solve(); } #define single_case solve(); #define line cerr<<"----------"<<endl; #define ios { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cerr.tie(NULL); } #define mod 1000000007LL const int N = 1e6 + 60; ll n, k; ll a[N]; int main() { a[0] = 1LL; for(int i = 1;i<N;i++) a[i] = (a[i-1]*2LL)%mod; ios cin>>n>>k; ll stepen = 2; int ind = n-1; ll l = 1LL; while(true) { ll aa = k%(stepen/2); ll b = aa + stepen/2; if(k%stepen==aa) { l = (l+a[ind])%mod; } ind--; if(stepen>=k) break; stepen*=2LL; } cout<<l; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

rack.cpp: In function 'int main()':
rack.cpp:32:12: warning: unused variable 'b' [-Wunused-variable]
   32 |         ll b = aa + stepen/2;
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...