Submission #133801

# Submission time Handle Problem Language Result Execution time Memory
133801 2019-07-21T11:52:44 Z tdwn Kralj (COCI16_kralj) C++17
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define ll long long 
#define pb push_back
#define mp make_pair
using namespace std;

int main() {
	cin>>n;
	for(int i=1;i<=n;i++) {
		cin>>a[i];
	}
	for(int i=1;i<=n;i++) {
		cin>>d[i];
	}
	for(int i=1;i<=n;i++) {
		cin>>s[i];
	}

	sort(d, d+n);
	sort(s, s+n);

	int i=1, j=1;
	while(i <=n && j<=n) {
		if(s[j] > d[i]) {
			br++;
			j++;
			i++;
		}
		else if(s[j] <= d[i]) {
			j++;
		}
	}
	cout<<br<<"\n";
}

Compilation message

kralj.cpp: In function 'int main()':
kralj.cpp:8:7: error: 'n' was not declared in this scope
  cin>>n;
       ^
kralj.cpp:8:7: note: suggested alternative: 'yn'
  cin>>n;
       ^
       yn
kralj.cpp:10:8: error: 'a' was not declared in this scope
   cin>>a[i];
        ^
kralj.cpp:13:8: error: 'd' was not declared in this scope
   cin>>d[i];
        ^
kralj.cpp:16:8: error: 's' was not declared in this scope
   cin>>s[i];
        ^
kralj.cpp:19:7: error: 'd' was not declared in this scope
  sort(d, d+n);
       ^
kralj.cpp:20:7: error: 's' was not declared in this scope
  sort(s, s+n);
       ^
kralj.cpp:25:4: error: 'br' was not declared in this scope
    br++;
    ^~
kralj.cpp:33:8: error: 'br' was not declared in this scope
  cout<<br<<"\n";
        ^~