(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.

제출 #1112743

#제출 시각아이디문제언어결과실행 시간메모리
1112743julia_08Coins (IOI17_coins)C++17
25 / 100
8 ms1828 KiB
#include "coins.h" #include <bits/stdc++.h> using namespace std; vector<int> coin_flips(vector<int> b, int c){ vector<int> flips; int cnt[2] = {0, 0}; cnt[0] += (b[0] == 0); cnt[0] += (b[1] == 0); cnt[0] += (b[2] == 0); cnt[1] += (b[0] == 1); cnt[1] += (b[1] == 1); cnt[1] += (b[2] == 1); int x = 0; if(cnt[1] > cnt[0]) x = 1; if(b[c] == x){ if(cnt[x] == 3) flips.push_back(c); else if(c != 0 && b[0] == x) flips.push_back(0); else if(c != 1 && b[1] == x) flips.push_back(1); else if(c != 2 && b[2] == x) flips.push_back(2); } else{ flips.push_back(3); } return flips; } int find_coin(vector<int> b){ int coin = 0; if(b[0] == b[2]) coin = 1; if(b[0] == b[1]) coin = 2; return coin; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...