# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
465380 |
2021-08-15T19:10:51 Z |
cheetose |
Coins (IOI17_coins) |
C++17 |
|
12 ms |
1524 KB |
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define X first
#define Y second
#define y0 y12
#define y1 y22
#define INF 987654321
#define PI 3.141592653589793238462643383279502884
#define fup(i,a,b,c) for(int (i)=(a);(i)<=(b);(i)+=(c))
#define fdn(i,a,b,c) for(int (i)=(a);(i)>=(b);(i)-=(c))
#define MEM0(a) memset((a),0,sizeof(a))
#define MEM_1(a) memset((a),-1,sizeof(a))
#define ALL(a) a.begin(),a.end()
#define COMPRESS(a) sort(ALL(a));a.resize(unique(ALL(a))-a.begin())
#define SYNC ios_base::sync_with_stdio(false);cin.tie(0)
using namespace std;
typedef long long ll;
typedef long double ld;
typedef double db;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef pair<ld, ld> Pd;
typedef vector<int> Vi;
typedef vector<ll> Vll;
typedef vector<ld> Vd;
typedef vector<Pi> VPi;
typedef vector<Pll> VPll;
typedef vector<Pd> VPd;
typedef tuple<int, int, int> iii;
typedef tuple<int, int, int, int> iiii;
typedef tuple<ll, ll, ll> LLL;
typedef vector<iii> Viii;
typedef vector<LLL> VLLL;
typedef complex<double> base;
const int MOD = 1000000007;
ll POW(ll a, ll b, ll MMM = MOD) { ll ret = 1; for (; b; b >>= 1, a = (a*a) % MMM)if (b & 1)ret = (ret*a) % MMM; return ret; }
int dx[] = { 0,1,0,-1,1,1,-1,-1 }, dy[] = { 1,0,-1,0,1,-1,1,-1 };
int ddx[] = { -1,-2,1,-2,2,-1,2,1 }, ddy[] = { -2,-1,-2,1,-1,2,1,2 };
#include "coins.h"
Vi coin_flips(Vi b,int c){
int r=c;
fup(i,0,63,1){
if(b[i])r^=i;
}
return {r};
}
int find_coin(Vi b) {
int r=0;
fup(i,0,63,1){
if(b[i])r^=i;
}
return r;
}
/*
int main() {
}*/
Compilation message
coins.cpp: In function 'Vi coin_flips(Vi, int)':
coins.cpp:10:30: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
10 | #define fup(i,a,b,c) for(int (i)=(a);(i)<=(b);(i)+=(c))
| ^
coins.cpp:47:2: note: in expansion of macro 'fup'
47 | fup(i,0,63,1){
| ^~~
coins.cpp: In function 'int find_coin(Vi)':
coins.cpp:10:30: warning: unnecessary parentheses in declaration of 'i' [-Wparentheses]
10 | #define fup(i,a,b,c) for(int (i)=(a);(i)<=(b);(i)+=(c))
| ^
coins.cpp:55:2: note: in expansion of macro 'fup'
55 | fup(i,0,63,1){
| ^~~
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
1312 KB |
Output is correct |
2 |
Correct |
9 ms |
1392 KB |
Output is correct |
3 |
Correct |
10 ms |
1416 KB |
Output is correct |
4 |
Correct |
9 ms |
1376 KB |
Output is correct |
5 |
Correct |
8 ms |
1372 KB |
Output is correct |
6 |
Correct |
8 ms |
1392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
1312 KB |
Output is correct |
2 |
Correct |
9 ms |
1392 KB |
Output is correct |
3 |
Correct |
10 ms |
1416 KB |
Output is correct |
4 |
Correct |
9 ms |
1376 KB |
Output is correct |
5 |
Correct |
8 ms |
1372 KB |
Output is correct |
6 |
Correct |
8 ms |
1392 KB |
Output is correct |
7 |
Correct |
10 ms |
1524 KB |
Output is correct |
8 |
Correct |
10 ms |
1392 KB |
Output is correct |
9 |
Correct |
9 ms |
1496 KB |
Output is correct |
10 |
Correct |
12 ms |
1372 KB |
Output is correct |
11 |
Correct |
12 ms |
1376 KB |
Output is correct |
12 |
Correct |
8 ms |
1520 KB |
Output is correct |
13 |
Correct |
8 ms |
1392 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
1328 KB |
Output is correct |
2 |
Correct |
11 ms |
1396 KB |
Output is correct |
3 |
Correct |
9 ms |
1388 KB |
Output is correct |
4 |
Correct |
11 ms |
1368 KB |
Output is correct |
5 |
Correct |
10 ms |
1392 KB |
Output is correct |
6 |
Correct |
9 ms |
1500 KB |
Output is correct |
7 |
Correct |
8 ms |
1500 KB |
Output is correct |
8 |
Correct |
9 ms |
1372 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
8 ms |
1196 KB |
Output is correct |
2 |
Correct |
10 ms |
1500 KB |
Output is correct |
3 |
Correct |
10 ms |
1500 KB |
Output is correct |
4 |
Correct |
10 ms |
1404 KB |
Output is correct |
5 |
Correct |
10 ms |
1376 KB |
Output is correct |
6 |
Correct |
10 ms |
1516 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
1312 KB |
Output is correct |
2 |
Correct |
9 ms |
1392 KB |
Output is correct |
3 |
Correct |
10 ms |
1416 KB |
Output is correct |
4 |
Correct |
9 ms |
1376 KB |
Output is correct |
5 |
Correct |
8 ms |
1372 KB |
Output is correct |
6 |
Correct |
8 ms |
1392 KB |
Output is correct |
7 |
Correct |
10 ms |
1524 KB |
Output is correct |
8 |
Correct |
10 ms |
1392 KB |
Output is correct |
9 |
Correct |
9 ms |
1496 KB |
Output is correct |
10 |
Correct |
12 ms |
1372 KB |
Output is correct |
11 |
Correct |
12 ms |
1376 KB |
Output is correct |
12 |
Correct |
8 ms |
1520 KB |
Output is correct |
13 |
Correct |
8 ms |
1392 KB |
Output is correct |
14 |
Correct |
9 ms |
1400 KB |
Output is correct |
15 |
Correct |
9 ms |
1392 KB |
Output is correct |
16 |
Correct |
9 ms |
1392 KB |
Output is correct |
17 |
Correct |
10 ms |
1392 KB |
Output is correct |
18 |
Correct |
10 ms |
1360 KB |
Output is correct |
19 |
Correct |
11 ms |
1460 KB |
Output is correct |
20 |
Correct |
10 ms |
1520 KB |
Output is correct |
21 |
Correct |
10 ms |
1476 KB |
Output is correct |
22 |
Correct |
9 ms |
1392 KB |
Output is correct |
23 |
Correct |
8 ms |
1396 KB |
Output is correct |
24 |
Correct |
9 ms |
1396 KB |
Output is correct |
25 |
Correct |
10 ms |
1400 KB |
Output is correct |