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

Submission #116708

#TimeUsernameProblemLanguageResultExecution timeMemory
116708faustaadpCoins (IOI17_coins)C++17
10 / 100
13 ms1464 KiB
#include "coins.h" #include<bits/stdc++.h> typedef long long ll; #define pb push_back #define mp make_pair #define fi first #define se second using namespace std; std::vector<int> coin_flips(std::vector<int> b, int c) { ll i; std::vector<int> flips; for(i=0;i<64;i++) if((b[i]==1&&i!=c)||(i==c&&b[i]==0)) flips.pb(i); //flips.clear(); if(flips.empty()) { flips.clear(); for(i=0;i<64;i++) flips.pb(i); } return flips; } int find_coin(std::vector<int> b) { ll i,sat=0; for(i=0;i<64;i++) if(b[i]==1) sat++; if(sat==1) { for(i=0;i<64;i++) if(b[i]==1) return i; } else { for(i=0;i<64;i++) if(b[i]==0) return i; } }

Compilation message (stderr)

coins.cpp: In function 'int find_coin(std::vector<int>)':
coins.cpp:43:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
#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...