제출 #631215

#제출 시각아이디문제언어결과실행 시간메모리
631215typRack (eJOI19_rack)C++14
100 / 100
10 ms1236 KiB
#include<bits/stdc++.h> using namespace std; const long long MOD = 1e9+7; long long n, k, pom=1, liczba=1; main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n>>k; k--; stack<bool> bin; for(int i=0;i<n;i++) { bin.push(k%2); k/=2; } while(n--) { if(bin.top()) liczba = (liczba+pom)%MOD; bin.pop(); pom = (2*pom)%MOD; } cout<<liczba; return 0; }

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

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