제출 #437997

#제출 시각아이디문제언어결과실행 시간메모리
437997Apiram던전 (IOI21_dungeons)C++17
컴파일 에러
0 ms0 KiB
#include "dungeons.h" #include <bits/stdc++.h> using namespace std; int nnn; vector<int>sss,ppp,www,lll; vector<long long >winning_path(400001,INT_MAX); vector<int>adj[400001]; void gen(void); void init(int nn, vector<int> ss, vector<int> pp, vector<int> ww, vector<int> ll) { nnn=nn; sss=ss,ppp=pp,www=ww,lll=ll; for(int i = 0 ; i < nnn ; i++) { adj[www[i]].push_back(i); } gen(); } void gen(void) { vector<bool>vis(nnn+1,false); winning_path.resize(nnn+1); winning_path[nnn]=0; queue<int>q; q.push(nnn);    long long cnt=0; while(!q.empty()) { int sz = q.size(); while(sz--) { int node = q.front(); q.pop(); vis[node]=true; winning_path[node]=cnt; for(auto z : adj[node]) { if(!vis[z]) { q.push(z); } } } cnt++; } } long long simulate(int x, int zz) { long long z=zz; while(true) { if(x==nnn) return z; if(z >= sss[x] && winning_path[x]!=INT_MAX) { long long mul = sss[x]*winning_path[x]; return z+mul; } z+=ppp[x]; x=lll[x]; } }

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

dungeons.cpp:25:2: error: extended character   is not valid in an identifier
   25 |     long long cnt=0;
      |  ^
dungeons.cpp:25:5: error: extended character   is not valid in an identifier
   25 |     long long cnt=0;
      |    ^
dungeons.cpp: In function 'void gen()':
dungeons.cpp:25:2: error: '\U000000a0' was not declared in this scope
   25 |     long long cnt=0;
      |  ^
dungeons.cpp:32:32: error: 'cnt' was not declared in this scope; did you mean 'int'?
   32 |             winning_path[node]=cnt;
      |                                ^~~
      |                                int
dungeons.cpp:39:9: error: 'cnt' was not declared in this scope; did you mean 'int'?
   39 |         cnt++;
      |         ^~~
      |         int