Submission #619702

#TimeUsernameProblemLanguageResultExecution timeMemory
619702Icebear16Memory (IOI10_memory)C++14
100 / 100
2 ms304 KiB
#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(i);
		char b=faceup(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

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:42:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   42 |    for(int i=0;i<sz(a);i++){
      |                 ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...