# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
829590 | Essa2006 | Coins (IOI17_coins) | C++14 | 9 ms | 1472 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "coins.h"
#include <iostream>
#include <vector>
#include <string>
using namespace std;
vector<int> coin_flips(vector<int> b, int c) {
int cur=0;
for(int i=0;i<b.size();i++){
cur=cur^(i*b[i]);
}
vector<int>flibs;
flibs.push_back(cur^c);
return flibs;
}
int find_coin(vector<int> b) {
int ans=0;
for(int i=0;i<b.size();i++){
ans^=i*b[i];
}
return ans;
}
//
//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;
//}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |