제출 #1274411

#제출 시각아이디문제언어결과실행 시간메모리
1274411hccoderPermutation Game (APIO25_permgame)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; int Bob(std::vector<int> t); int Alice(int m, int e, std::vector<int> u, std::vector<int> v, int n, std::vector<int> p){ if (m==2){ map<int, int> mp; for (int i = 0; i<n; i++) mp[p[i]] = i; for (int i = 0; i<n; i++){ if (p[i]!=i){ int x = mp[i]; Bob({i, x}); mp[p[i]] = x; mp[i] = i; swap(p[i], p[x]); } } return n; } else if (m==3 && e==3){ int res = 0; for (int i = 0; i<n; i++){ if (p[i]==i) res++; } for (int x = 0; x<n; x++){ for (int y = x+1 y<n; y++){ for (int z = y+1; z<n; z++){ if (min({p[x], p[y],p[z]})>-1 && (p[x]==y || p[x]==z) && (p[y]==x || p[y]==z) && (p[z]==x || p[z]==y)){ res++; Bob({x, y, z}); p[x]=p[y]=p[z]=-1; } } } } return res; } }

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

permgame.cpp: In function 'int Alice(int, int, std::vector<int>, std::vector<int>, int, std::vector<int>)':
permgame.cpp:28:29: error: expected ';' before 'y'
   28 |             for (int y = x+1 y<n; y++){
      |                             ^~
      |                             ;
permgame.cpp:40:1: warning: control reaches end of non-void function [-Wreturn-type]
   40 | }
      | ^