# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
849150 |
2023-09-14T07:22:04 Z |
emad234 |
Coins (IOI17_coins) |
C++17 |
|
2 ms |
1124 KB |
#include <bits/stdc++.h>
#define all(v) ((v).begin(),(v).end())
#define ll long long
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll mxN = 1e5 + 2;
using namespace std;
vector<int> coin_flips(vector<int> b, int c) {
vector<int> flips;
int num = 0;
for(int i = 6; i>=0;i--){
if(num + (1 << i) <= c){
num += (1 << i);
if(!b[i]) flips.push_back(i);
}else{
if(b[i]) flips.push_back(i);
}
}
return flips;
}
int find_coin(vector<int> b) {
int num = 0;
for(int i = 0;i <= 6;i++){
num += (b[i] << i);
}
return num;
}
//
// static string run_test() {
// int c;
// cin >> c;
// vector<int> b(64);
// for (int i = 0; i < 8; i++) {
// string s;
// cin >> s;
// for (int j = 0; j < 8; j++) {
// b[i * 8 + j] = int(s[j] - '0');
// }
// }
// vector<int> flips = coin_flips(b, c);
// if ((int)flips.size() == 0) {
// return "0 turn overs";
// }
// for (int i = 0; i < (int)flips.size(); i++) {
// if (flips[i] < 0 || flips[i] > 63) {
// return "cell number out of range";
// }
// b[flips[i]] = 1 - b[flips[i]];
// }
// int coin = find_coin(b);
// if (coin != c) {
// return "wrong coin";
// }
// return "ok";
// }
//
// int main() {
// int tests;
// cin >> tests;
// for (int t = 1; t <= tests; t++) {
// string result = run_test();
// cout << "test #" << t << ": " << result << endl;
// }
// return 0;
// }
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1112 KB |
WA in grader: invalid flips length |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1112 KB |
WA in grader: invalid flips length |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1124 KB |
WA in grader: invalid flips length |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
1080 KB |
WA in grader: invalid flips length |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
1112 KB |
WA in grader: invalid flips length |
2 |
Halted |
0 ms |
0 KB |
- |