# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
619701 | Icebear16 | Memory (IOI10_memory) | C++14 | 0 ms | 0 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 "grader.h"
#include "memory.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1e18//change to const int INF=1e18 if causing problem
const ll MOD=998244353;
const ll alt=1e10;
const ll inf=1e9+7;//Precalc is not a bad idea
//#define int ll
#define pb push_back
#define pf push_front
#define mp make_pair
#define fi first
#define se second
#define mod(a) (a+inf)%inf
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define sz(a) a.size()
void play() {
map<char,int> m;
map<char,int> mm;
m.clear(),mm.clear();
for(int i=1;i<50;i+=2){
char a=faceup(v[i]);
char b=faceup(v[i+1]);
if(a==b){
m[a]=i;
mm[b]=i+1;
}else{
if(m[a]==0) m[a]=i;
else mm[a]=i;
if(m[b]==0) m[b]=i+1;
else mm[b]=i+1;
}
}
vector<int> a,b;
a.clear(),b.clear();
for(auto u : m) a.pb(u.se);
for(auto u : mm) b.pb(u.se);
for(int i=0;i<sz(a);i++){
int x=a[i];
int y=b[i];
faceup(x);
faceup(y);
}
}
//Icebear16