Submission #249944

# Submission time Handle Problem Language Result Execution time Memory
249944 2020-07-16T14:40:49 Z uacoder123 Memory (IOI10_memory) C++14
Compilation error
0 ms 0 KB
#include "grader.h"
#include "memory.h"
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define FOR(i,a,b) for (auto i = (a); i <= (b); ++i)
#define NFOR(i,a,b) for(auto i = (a); i >= (b); --i)
#define all(x) (x).begin(), (x).end()
#define sz(x) int(x.size())
#define mp(i,a) make_pair(i,a)
#define pb(a) push_back(a)
#define bit(x,b) (x&(1LL<<b))

typedef long long int lli;
typedef pair <lli,lli> ii;
typedef pair <lli,ii> iii;
typedef vector <lli> vi;

void play() {
   char a;
   vi arr[25];
   for (int i=1; i<=50; ++i) {
   	a=getchar(i);
   	arr[a-'A'].pb(i);
   }
   for(int i=0;i<25;++i)
   {
   	getchar(arr[i][0]);
   	getchar(arr[i][1]);
   }
   return;
}

Compilation message

memory.cpp: In function 'void play()':
memory.cpp:24:16: error: too many arguments to function 'int getchar()'
     a=getchar(i);
                ^
In file included from /usr/include/stdio.h:933:0,
                 from /usr/include/c++/7/cstdio:42,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:46,
                 from memory.cpp:3:
/usr/include/x86_64-linux-gnu/bits/stdio.h:44:1: note: declared here
 getchar (void)
 ^~~~~~~
memory.cpp:29:22: error: too many arguments to function 'int getchar()'
     getchar(arr[i][0]);
                      ^
In file included from /usr/include/stdio.h:933:0,
                 from /usr/include/c++/7/cstdio:42,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:46,
                 from memory.cpp:3:
/usr/include/x86_64-linux-gnu/bits/stdio.h:44:1: note: declared here
 getchar (void)
 ^~~~~~~
memory.cpp:30:22: error: too many arguments to function 'int getchar()'
     getchar(arr[i][1]);
                      ^
In file included from /usr/include/stdio.h:933:0,
                 from /usr/include/c++/7/cstdio:42,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:46,
                 from memory.cpp:3:
/usr/include/x86_64-linux-gnu/bits/stdio.h:44:1: note: declared here
 getchar (void)
 ^~~~~~~