# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1045041 | Okassa | 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 "cluedo.h"
#include "grader.h"
#include <vector>
#define ll long long
using namespace std ;
void play() {
ll t=0,x,y,l=0,m=0 ;
vector<ll> sel(50,0);
vector<ll> s(50,0) ;
for (int w=0 ; w<50 ; w++) {
s[w]=w+1 ;
}
while (t<25) {
ll z=0 ;
faceup(s[z]) ;
x=faceup(s[z]) ;
faceup(s[z+1]) ;
y=faceup(s[z+1]) ;
if (y==x){
t++ ;
}else {
for (ll i=0 ; i<50 ; i++) {
if (x==sel[i]) {
faceup(z) ;
faceup(i) ;
s.erase(s.begin(),s.begin()+s[z]-1) ;
s.erase(s.begin(),s.begin()+i-1) ;
l++ ;
t++ ;
}
}
for (ll i=0 ; i<50 ; i++) {
if (y==sel[i]) {
faceup(s[z+1]) ;
faceup(i) ;
s.erase(s.begin(),s.begin()+s[z+1]-1) ;
s.erase(s.begin(),s.begin()+i-1) ;
m++ ;
t++ ;
}
}
if (l==0) {
sel[s[z]]=x ;
}else if (m==0){
sel[s[z+1]]=y ;
}else {
l=0 ;
m=0 ;
}
}
z++ ;
}
}