제출 #751973

#제출 시각아이디문제언어결과실행 시간메모리
751973minhcool크레이피쉬 글쓰는 기계 (IOI12_scrivener)C++17
컴파일 에러
0 ms0 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; void init(){} int cnt; int lst[N][25], len[N]; char cc[N]; 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 = 0; i <= 20; i++) lst[cnt][i] = lst[cnt - x - 1][i]; } 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;
      |                ~~~~~^~~
/usr/bin/ld: /tmp/ccXutmh8.o: in function `main':
grader.cpp:(.text.startup+0x63): undefined reference to `Init()'
/usr/bin/ld: grader.cpp:(.text.startup+0xff): undefined reference to `TypeLetter(char)'
/usr/bin/ld: grader.cpp:(.text.startup+0x18b): undefined reference to `GetLetter(int)'
collect2: error: ld returned 1 exit status