| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1336030 | wedonttalkanymore | Coins (IOI17_coins) | C++20 | 8 ms | 764 KiB |
#include "coins.h"
#include <bits/stdc++.h>
/*
Chang ki si xuyen man dem
Di lac vao trong giac mong
*/
using namespace std;
using ll = long long;
//#define int long long
#define pii pair<ll, ll>
#define fi first
#define se second
const ll N = 5e5 + 5, inf = 1e18, mod = 1e9 + 7, block = 320, lim = 19;
//void make(int x) {
//// cout << x << ' ';
// string s = "";
// while(x > 0) {
// int t = x % 2;
// s += to_string(t);
// x /= 2;
// }
// reverse(s.begin(), s.end());
// while(s.size() < 6) s = "0" + s;
// cout << "at: " << s << '\n';
//}
vector<int> coin_flips(vector<int> b, int c) {
int flip = 0;
for (int i = 0; i < b.size(); i++) {
if (b[i]) flip ^= i;
}
int pos = flip ^ c;
// cout << pos << '\n';
// make(flip), make(c);
b[pos] ^= 1;
return {pos};
}
int find_coin(vector<int> b) {
int ans = 0;
for (int i = 0; i < b.size(); i++) {
if (b[i]) ans ^= 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);
// cout << "at: " << coin << '\n';
// 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;
//}
/*
3
0
11101101
01000010
01011010
11110101
11000010
01011101
01000110
10111111
7
01110010
11110101
00000100
10110001
00010111
00110101
00001110
10101110
7
10100010
01001011
10110101
10100111
00010110
01000010
00111110
01110100
*/컴파일 시 표준 에러 (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... | ||||
