제출 #288453

#제출 시각아이디문제언어결과실행 시간메모리
288453topovikRack (eJOI19_rack)C++14
100 / 100
19 ms8684 KiB
#include <bits/stdc++.h> #define f first #define s second #define pb push_back #define INF 1000000000 using namespace std; typedef long long ll; typedef long double ld; const ll oo = 1e9+7; const ll N = 1e6; int main() { ll n,k; cin>>n>>k; vector <ll> steps; for (ll i=0; i<n; i++) { if (!(k&1)) { k>>=1; steps.pb(1); } else {steps.pb(0);k=(k+1)/2;} } ll ans=0; for (ll i=0; i<steps.size(); i++) ans=(ans*2+steps[i])%oo; cout<<1+ans; }

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

rack.cpp: In function 'int main()':
rack.cpp:31:19: warning: comparison of integer expressions of different signedness: 'll' {aka 'long long int'} and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   31 |     for (ll i=0; i<steps.size(); i++) ans=(ans*2+steps[i])%oo;
      |                  ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...