제출 #252880

#제출 시각아이디문제언어결과실행 시간메모리
252880Sugardorj무지개나라 (APIO17_rainbow)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; long long b[323567],c[323456],a[323][456],tt,d[334564],e[456744]; long long x,m,n,t,k,l; long long i , j,r,s,y,z; string p; queue<pair<long long,long long>> q,qq; int main(){ init (n,m,l,k,x,y,p); // cin >> n>>m>>l>>k>>x>>y>>p; tt=1456785678; a[x][y]=tt; for (i = 0; i<l; i ++){ if (p[i]=='N') x--; if (p[i]=='S') x++; if (p[i]=='W') y--; if (p[i]=='E') y++; a[x][y]=tt; } for (i = 1; i <=k ; i ++){ colour(x,y,l,r); //cin >> x>>y>>l>>r; s=0; for (j = x; j<=l; j++){ for (z = y; z<=r;z++){ if (a[j][z]>= i){ continue; } s++; q=qq; q.push({j,z}); while(q.size()){ long long xx=q.front().first; long long yy=q.front().second; q.pop(); if (xx+1<=l&&a[xx+1][yy]<i){ q.push({xx+1,yy}); a[xx+1][yy]=i; } if (xx-1>=x&&a[xx-1][yy]<i){ a[xx-1][yy]=i; q.push({xx-1,yy});} if (yy+1<=r&&a[xx][yy+1]<i){ a[xx][yy+1]=i; q.push({xx,yy+1});} if (yy-1>=y&&a[xx][yy-1]<i){ a[xx][yy-1]=i; q.push({xx,yy-1});} } } } return s; //cout <<s<<endl; } }

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

rainbow.cpp: In function 'int main()':
rainbow.cpp:10:5: error: 'init' was not declared in this scope
     init (n,m,l,k,x,y,p);
     ^~~~
rainbow.cpp:10:5: note: suggested alternative: 'int'
     init (n,m,l,k,x,y,p);
     ^~~~
     int
rainbow.cpp:26:9: error: 'colour' was not declared in this scope
         colour(x,y,l,r);
         ^~~~~~
rainbow.cpp:26:9: note: suggested alternative: 'clone'
         colour(x,y,l,r);
         ^~~~~~
         clone