Submission #619701

#TimeUsernameProblemLanguageResultExecution timeMemory
619701Icebear16Memory (IOI10_memory)C++14
Compilation error
0 ms0 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(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

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:26:17: error: 'v' was not declared in this scope
   26 |   char a=faceup(v[i]);
      |                 ^
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++){
      |                 ^