제출 #130271

#제출 시각아이디문제언어결과실행 시간메모리
130271khulegub자동 인형 (IOI18_doll)C++14
컴파일 에러
0 ms0 KiB
#include "doll.h" #include <bits/stdc++.h> #define mp make_pair #define xx first #define yy second #define pb push_back using namespace std; typedef pair<int, int> pii; /**********************/ /* YOU ARE INVITED TO */ /* */ /* SUFFER */ /* */ /* ######## */ /* # JOIN # */ /* ######## */ /* */ /**********************/ void create_circuit(int m, vector<int> a) { a.pb(0); int n = a.size(); vector<int> c(m + 1); vector<int> x, y; c[0] = a[0]; map<int, unordered_set<int> > garalt; garalt[0].insert( a[0] ); for (int i = 0; i < n - 1; i++){ garalt[ a[i] ].insert( a[i + 1] ); } // for (int i = 0; i < n - 1; i++){ // } int s = 0; for (auto gang : garalt){ if(gang.yy.size() == 1){ // cout << *gang.yy.begin(); c[gang.xx] = *gang.yy.begin(); } else{ int gangsz = gang.yy.size(); int gangcnt = 0; for (auto xaxa : gang.yy){ if (gangcnt == gangsz - 1){ y[s - 1] = xaxa; break; } else if (gangcnt == gangsz - 2){ x.pb(0); y.pb(0); c[gang.xx] = -(s + 1); x[s] = xaxa; s++; } else{ x.pb(0); y.pb(0); c[gang.xx] = -(s + 1); x[s] = xaxa; y[s] = -(s + 2); s++; } gangcnt++; } } // cout << gang.xx << ' ' << gang.yy.size() << '\n'; } for (int i = 1; i <= m + 1; i++){ if(c[i] == ) } // answer(c, x, y); } // int main(){ // DRIVER - CHAN // create_circuit(9, {1, 3, 2, 1, 3, 4, 2, 1, 3}); // }

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

doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:78:14: error: expected primary-expression before ')' token
   78 |   if(c[i] == )
      |              ^
doll.cpp:79:2: error: expected primary-expression before '}' token
   79 |  }
      |  ^