제출 #437989

#제출 시각아이디문제언어결과실행 시간메모리
437989Apiram던전 (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<int>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<pair<int,long long>>q;    q.push({nnn,0});    long long cnt=0; while(!q.empty()) {        pair<int,long long> u =q.front();    q.pop();      for(auto x:adj[u.first]){        if(winning_path[x.first]>x.second+1){        winning_path[x.first]=x.second+1;          q.push({x.first,x.second+1}); }}}} 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:20:2: error: extended character   is not valid in an identifier
   20 |   //  vector<bool>vis(nnn+1,false);
      |  ^
dungeons.cpp:21:2: error: extended character   is not valid in an identifier
   21 |     //winning_path.resize(nnn+1);
      |  ^
dungeons.cpp:21:5: error: extended character   is not valid in an identifier
   21 |     //winning_path.resize(nnn+1);
      |    ^
dungeons.cpp:23:2: error: extended character   is not valid in an identifier
   23 |     queue<pair<int,long long>>q;
      |  ^
dungeons.cpp:23:5: error: extended character   is not valid in an identifier
   23 |     queue<pair<int,long long>>q;
      |    ^
dungeons.cpp:24:2: error: extended character   is not valid in an identifier
   24 |     q.push({nnn,0});
      |  ^
dungeons.cpp:24:5: error: extended character   is not valid in an identifier
   24 |     q.push({nnn,0});
      |    ^
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:27:2: error: extended character   is not valid in an identifier
   27 |         pair<int,long long> u =q.front();
      |  ^
dungeons.cpp:27:5: error: extended character   is not valid in an identifier
   27 |         pair<int,long long> u =q.front();
      |    ^
dungeons.cpp:27:8: error: extended character   is not valid in an identifier
   27 |         pair<int,long long> u =q.front();
      |      ^
dungeons.cpp:27:11: error: extended character   is not valid in an identifier
   27 |         pair<int,long long> u =q.front();
      |        ^
dungeons.cpp:28:2: error: extended character   is not valid in an identifier
   28 |     q.pop();
      |  ^
dungeons.cpp:28:5: error: extended character   is not valid in an identifier
   28 |     q.pop();
      |    ^
dungeons.cpp:29:2: error: extended character   is not valid in an identifier
   29 |       for(auto x:adj[u.first]){
      |  ^
dungeons.cpp:29:5: error: extended character   is not valid in an identifier
   29 |       for(auto x:adj[u.first]){
      |    ^
dungeons.cpp:29:8: error: extended character   is not valid in an identifier
   29 |       for(auto x:adj[u.first]){
      |      ^
dungeons.cpp:30:2: error: extended character   is not valid in an identifier
   30 |         if(winning_path[x.first]>x.second+1){
      |  ^
dungeons.cpp:30:5: error: extended character   is not valid in an identifier
   30 |         if(winning_path[x.first]>x.second+1){
      |    ^
dungeons.cpp:30:8: error: extended character   is not valid in an identifier
   30 |         if(winning_path[x.first]>x.second+1){
      |      ^
dungeons.cpp:30:11: error: extended character   is not valid in an identifier
   30 |         if(winning_path[x.first]>x.second+1){
      |        ^
dungeons.cpp:31:2: error: extended character   is not valid in an identifier
   31 |         winning_path[x.first]=x.second+1;
      |  ^
dungeons.cpp:31:5: error: extended character   is not valid in an identifier
   31 |         winning_path[x.first]=x.second+1;
      |    ^
dungeons.cpp:31:8: error: extended character   is not valid in an identifier
   31 |         winning_path[x.first]=x.second+1;
      |      ^
dungeons.cpp:31:11: error: extended character   is not valid in an identifier
   31 |         winning_path[x.first]=x.second+1;
      |        ^
dungeons.cpp:32:2: error: extended character   is not valid in an identifier
   32 |           q.push({x.first,x.second+1});
      |  ^
dungeons.cpp:32:5: error: extended character   is not valid in an identifier
   32 |           q.push({x.first,x.second+1});
      |    ^
dungeons.cpp:32:8: error: extended character   is not valid in an identifier
   32 |           q.push({x.first,x.second+1});
      |      ^
dungeons.cpp:32:11: error: extended character   is not valid in an identifier
   32 |           q.push({x.first,x.second+1});
      |        ^
dungeons.cpp:32:14: error: extended character   is not valid in an identifier
   32 |           q.push({x.first,x.second+1});
      |          ^
dungeons.cpp: In function 'void gen()':
dungeons.cpp:20:2: error: '\U000000a0' was not declared in this scope
   20 |   //  vector<bool>vis(nnn+1,false);
      |  ^
dungeons.cpp:23:4: error: expected ';' before '\U000000a0queue'
   23 |     queue<pair<int,long long>>q;
      |   ^~~~~~~
      |   ;
dungeons.cpp:24:4: error: expected ';' before '\U000000a0q'
   24 |     q.push({nnn,0});
      |   ^~~
      |   ;
dungeons.cpp:24:21: error: expected primary-expression before ')' token
   24 |     q.push({nnn,0});
      |                   ^
dungeons.cpp:25:4: error: expected ';' before '\U000000a0long'
   25 |     long long cnt=0;
      |   ^~~~~~
      |   ;
dungeons.cpp:26:12: error: 'q' was not declared in this scope
   26 |     while(!q.empty()) {
      |            ^
dungeons.cpp:27:4: error: expected ';' before '\U000000a0'
   27 |         pair<int,long long> u =q.front();
      |   ^~
      |   ;
dungeons.cpp:28:4: error: expected ';' before '\U000000a0q'
   28 |     q.pop();
      |   ^~~
      |   ;
dungeons.cpp:29:4: error: expected ';' before '\U000000a0'
   29 |       for(auto x:adj[u.first]){
      |   ^~
      |   ;