Submission #619517

#TimeUsernameProblemLanguageResultExecution timeMemory
619517Icebear16Memory (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() {
   int i;
   char a, b;
   vector<int> v;
   v.clear();
   for(int i=1;i<=50;i++){
   		v.pb(i);
   }
   while(!v.empty()){
   	int y=v[0];
   		char a,b;
   		int y;
   		for(int i=1;i<sz(v);i++){
   			a=faceup(v[0]);
   			b=faceup(v[i]);
   			if(char a==b){
   				y=i;
			}
	   }
	   v.erase(v.begin()+i);
	   v.erase(v.begin());
   }
}
//Icebear16

Compilation message (stderr)

memory.cpp: In function 'void play()':
memory.cpp:32:10: error: redeclaration of 'int y'
   32 |      int y;
      |          ^
memory.cpp:30:9: note: 'int y' previously declared here
   30 |     int y=v[0];
      |         ^
memory.cpp:33:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   33 |      for(int i=1;i<sz(v);i++){
      |                   ^
memory.cpp:36:16: error: expected initializer before '==' token
   36 |       if(char a==b){
      |                ^~
memory.cpp:36:16: error: expected ')' before '==' token
   36 |       if(char a==b){
      |         ~      ^~
      |                )
memory.cpp:36:15: warning: unused variable 'a' [-Wunused-variable]
   36 |       if(char a==b){
      |               ^
memory.cpp:23:9: warning: unused variable 'a' [-Wunused-variable]
   23 |    char a, b;
      |         ^
memory.cpp:23:12: warning: unused variable 'b' [-Wunused-variable]
   23 |    char a, b;
      |            ^