제출 #1012791

#제출 시각아이디문제언어결과실행 시간메모리
1012791Ivo_12길고양이 (JOI20_stray)C++17
컴파일 에러
0 ms0 KiB
vector < int > Mark( int n, int m, int a, int b, vector < int > t1, vector < int > t2 ) { vector < pii > edges[N]; vector < int > oznake; int dis[N]; queue < int > q; for(int i = 0; i < m; i++) { edges[t1[i]].pb(mp(t2[i], i)); edges[t2[i]].pb(mp(t1[i], i)); oznake.pb(0); } dis[0] = 1; q.push(0); int cur; int sus; while(!q.empty()) { cur = q.front(); q.pop(); for(int i = 0; i < (int) edges[cur].size(); i++) { sus = edges[cur][i].F; if(dis[sus] == 0) { q.push(sus); dis[sus] = dis[cur]+1; } } } if(a>=3) { q.push(0); while(!q.empty()) { cur = q.front(); q.pop(); for(int i = 0; i < (int) edges[cur].size(); i++) { sus = edges[cur][i].F; if(dis[sus] >= dis[cur]) { q.push(sus); oznake[edges[cur][i].S] = (dis[cur] - 1) % 3; } } } } else { } return oznake; }
void Init( int a, int b ) { ga = a; gb = b; } int move( vector < int > v ) { if(ga>=3) { if(v[0] && v[1]) return 0; if(v[2] && v[0]) return 2; if(v[1] && v[2]) return 1; if(!(v[0] || v[1])) return 2; if(!(v[2] || v[0])) return 1; if(!(v[1] || v[2])) return 0; } else return -1; }

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

Anthony.cpp:1:1: error: 'vector' does not name a type
    1 | vector < int > Mark( int n, int m, int a, int b, vector < int > t1, vector < int > t2 ) {
      | ^~~~~~

Catherine.cpp: In function 'void Init(int, int)':
Catherine.cpp:2:2: error: 'ga' was not declared in this scope; did you mean 'a'?
    2 |  ga = a;
      |  ^~
      |  a
Catherine.cpp:3:2: error: 'gb' was not declared in this scope; did you mean 'b'?
    3 |  gb = b;
      |  ^~
      |  b
Catherine.cpp: At global scope:
Catherine.cpp:6:11: error: 'vector' was not declared in this scope
    6 | int move( vector < int > v ) {
      |           ^~~~~~
Catherine.cpp:6:20: error: expected primary-expression before 'int'
    6 | int move( vector < int > v ) {
      |                    ^~~