Submission #199169

# Submission time Handle Problem Language Result Execution time Memory
199169 2020-01-29T18:53:46 Z ivandasfs Memory (IOI10_memory) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>

using namespace std;

#define x first
#define y second
#define mp make_pair
#define pb push_back

typedef long long ll;

const ll MOD = 1e9+7;
const ll INF = 1e9+5;

int gdje[150];
char ch[150];

void play() {
	for (int i=1 ; i<=50 ; i+=2) {
		char a = faceup(i);
		char b = faceup(i+1);
		ch[i] = a;
		ch[i+1] = b;
		gdje[a] = i;
		gdje[b] = i+1;
	}
	for (int i=1 ; i<=50 ; i++) {
		if (gdje[ch[i]] == i) continue;
		faceup(i);
		faceup(gdje[i]);
	}
}

Compilation message

memory.cpp: In function 'void play()':
memory.cpp:20:12: error: 'faceup' was not declared in this scope
   char a = faceup(i);
            ^~~~~~
memory.cpp:20:12: note: suggested alternative: 'frexp'
   char a = faceup(i);
            ^~~~~~
            frexp
memory.cpp:24:9: warning: array subscript has type 'char' [-Wchar-subscripts]
   gdje[a] = i;
         ^
memory.cpp:25:9: warning: array subscript has type 'char' [-Wchar-subscripts]
   gdje[b] = i+1;
         ^
memory.cpp:28:17: warning: array subscript has type 'char' [-Wchar-subscripts]
   if (gdje[ch[i]] == i) continue;
                 ^
memory.cpp:29:3: error: 'faceup' was not declared in this scope
   faceup(i);
   ^~~~~~
memory.cpp:29:3: note: suggested alternative: 'frexp'
   faceup(i);
   ^~~~~~
   frexp