이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include<fstream>
using namespace std;
#define sz(a) (int)a.size()
#define ALL(v) v.begin(), v.end()
#define ALLR(v) v.rbegin(), v.rend()
#define ll long long
#define pb push_back
#define forr(i, a, b) for(int i = a; i < b; i++)
#define dorr(i, a, b) for(int i = a; i >= b; i--)
#define ld double
#define vt vector
#include<fstream>
#define fi first
#define se second
#define pll pair<ll, ll>
#define pii pair<int, int>
#define mpp make_pair
#include "coins.h"
std::vector<int> coin_flips(std::vector<int> b, int c) {
int xo = 0;
for(int i = 0; i < sz(b); i++){
if(b[i] == 1)xo ^= i;
}
vt<int>flips; flips.pb(xo ^ c);
return flips;
}
int find_coin(std::vector<int> b) {
int xo = 0;
for(int i = 0; i < sz(b); i++){
if(b[i] == 1)xo ^= i;
}
return(xo);
}
/*
#include <iostream>
#include <vector>
#include <string>
using namespace std;
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 |
---|
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... |