제출 #918653

#제출 시각아이디문제언어결과실행 시간메모리
918653hasanovrCoins (IOI17_coins)C++14
컴파일 에러
0 ms0 KiB
#include "coins.h" #include <bits/stdc++.h> using namespace std; vector<int> coin_flips(vector<int> a, int c) { vector<int> ans; if(!a[c]) ans.push_back(c); for(int i=0; i<64; i++) if(x!=i and a[i]) ans.push_back(i); if(ans.empty()){ ans.push_back(x); ans.push_back(x); } return ans; } int find_coin(vector<int> a) { for(int i=0; i<64; i++) if(a[i]) return i; return -1; }

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

coins.cpp: In function 'std::vector<int> coin_flips(std::vector<int>, int)':
coins.cpp:10:6: error: 'x' was not declared in this scope
   10 |   if(x!=i and a[i])
      |      ^
coins.cpp:13:17: error: 'x' was not declared in this scope
   13 |   ans.push_back(x);
      |                 ^