(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

제출 #1112809

#제출 시각아이디문제언어결과실행 시간메모리
1112809julia_08Coins (IOI17_coins)C++17
컴파일 에러
0 ms0 KiB
#include "coins.h" #include <bits/stdc++.h> using namespace std; vector<int> coin_flips(vector<int> b, int c){ vector<int> flips; int x = 0; int pos = 0; for(int i=0; i<(int) b.size(); i++){ if(b[i] == 1) x ^= pos; pos ++; } flips.push_back(x ^ c); return flips; } int find_coin(vector<int> b){ int coin = 0; int pos = 0; for(int i=0; i<(int) b.size(); i++){ if(b[i] == 1) x ^= pos; pos ++; } return coin; }

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

coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:30:19: error: 'x' was not declared in this scope
   30 |     if(b[i] == 1) x ^= pos;
      |                   ^