| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1141402 | Saul0906 | Coins (IOI17_coins) | C++20 | 5 ms | 580 KiB |
#include "coins.h"
#include <bits/stdc++.h>
#define pii pair<int, int>
#define rep(a,b,c) for(ll a=b; a<c; a++)
#define repr(a,b,c) for(ll a=b-1; a>c-1; a--)
#define repa(a,b) for(auto a:b)
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define mid ((l+r+1)>>1)
#define pb push_back
#define ll long long
#define ull unsigned ll
using namespace std;
using vi = vector<int>;
const unsigned ll y=64;
vi coin_flips(vi b, int c) {
int x=0;
rep(i,0,64) x+=(b[i]*(i+1));
rep(i,0,64){
if(b[i]) x-=((i+1));
else x+=((i+1));
if(x%y==c) return {i};
if(b[i]) x+=((i+1));
else x-=((i+1));
}
return {1};
}
int find_coin(vi b) {
int x=0;
rep(i,0,64) x+=(b[i]*(i+1));
return x%y;
}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... | ||||
