제출 #693219

#제출 시각아이디문제언어결과실행 시간메모리
693219testtttRack (eJOI19_rack)C++14
0 / 100
1083 ms212 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long const ll mod = 1e9 + 7; long long exp(long long x, long long y, long long p) { long long res = 1; x %= p; while (y) { if (y & 1) { res *= x; res %= p; } x *= x; x %= p; y >>= 1; } return res; } main(){ ll n , k;cin >> n >> k; -- k; ll ans = 1; for(int i = 0;i < 63;i ++){ if((1 << i) & k){ ans += exp(2 , n - i - 1 , mod); ans%=mod; } } cout << ans << endl; }

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

rack.cpp:21:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   21 |  main(){
      |  ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...