제출 #1280294

#제출 시각아이디문제언어결과실행 시간메모리
1280294KerimRack (eJOI19_rack)C++17
100 / 100
5 ms592 KiB
#include "bits/stdc++.h" using namespace std; const int MOD = 1e9+7; int mod(int x){ if (x >= MOD) x -= MOD; return x; } int main(){ int n, a = 0, pw = 1; long long k; scanf("%d%lld", &n, &k); k -= 1; for (int i = 0; i < n; i++){ if (n-i < 61 and k>>(n-i-1)&1) a = mod(a + pw); pw = mod(pw+pw); } printf("%d\n", mod(a+1)); }

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

rack.cpp: In function 'int main()':
rack.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         scanf("%d%lld", &n, &k);
      |         ~~~~~^~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...