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() {
int i;
vector<int> v;
map<char,int> m;
map<char,int> mm;
v.clear(),m.clear(),mm.clear();
for(int i=1;i<=50;i++){
v.pb(i);
}
for(int i=1;i<sz(v);i+=2){
char a=faceup(v[i-1]);
char b=faceup(v[i]);
if(a==b){
m[a]=i-1;
mm[b]=i;
}else{
if(m[a]==0) m[a]=i-1;
else mm[a]=i-1;
if(m[b]==0) m[b]=i;
else mm[b]=i;
}
}
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++){
faceup(a[i]);
faceup(b[i]);
}
}
//Icebear16
Compilation message (stderr)
memory.cpp: In function 'void play()':
memory.cpp:30:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
30 | for(int i=1;i<sz(v);i+=2){
| ^
memory.cpp:47:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
47 | for(int i=0;i<sz(a);i++){
| ^
memory.cpp:22:8: warning: unused variable 'i' [-Wunused-variable]
22 | int i;
| ^
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |