제출 #751980

#제출 시각아이디문제언어결과실행 시간메모리
751980minhcool크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
5 / 100
435 ms73744 KiB
#include<bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> using namespace __gnu_pbds; using namespace std; #define ll long long #define fi first #define se second #define pb push_back #define mp make_pair typedef pair<int, int> ii; typedef pair<ii, int> iii; typedef pair<ii, ii> iiii; const int N = 1e6 + 5; const int oo = 1e18 + 7, mod = 1e9 + 7; mt19937 rng(1); int n; int cnt; int lst[N][25], len[N]; char cc[N]; void Init(){ cnt = 0; for(int i = 0; i <= 20; i++) lst[0][i] = 0; len[0] = 0; } void TypeLetter(char c){ cnt++; len[cnt] = len[cnt - 1] + 1; cc[cnt] = c; lst[cnt][0] = cnt - 1; for(int i = 1; i <= 20; i++) lst[cnt][i] = lst[lst[cnt][i - 1]][i - 1]; } void UndoCommands(int x){ cnt++; len[cnt] = len[cnt - x - 1]; lst[cnt][0] = lst[cnt - x - 1][0]; cc[cnt] = cc[cnt - x - 1]; for(int i = 1; i <= 20; i++) lst[cnt][i] = lst[lst[cnt][i - 1]][i - 1]; } char GetLetter(int x){ x++; int temp = cnt - x; int pos = cnt; for(int i = 20; i >= 0; i--) if(temp & (1LL << i)) pos = lst[pos][i]; return cc[pos]; }

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

scrivener.cpp:18:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   18 | const int oo = 1e18 + 7, mod = 1e9 + 7;
      |                ~~~~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...