CSES - Leirikisa 6.3.2017 - Results
Submission details
Task:Karuselli
Sender:ankka22
Submission time:2017-03-06 18:10:19 +0200
Language:C++
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:33:1: error: expected '}' at end of input
 }//:D
 ^

Code

#include <iostream>
#include <vector>
#include <map>
using namespace std;
long n, m, o, p, k, m1[101010], m2[101010];
map<long, int> ma1, ma2;
int main() {
	cin >> n >> k;
	//for (int i = 1; i <= n; i++) {
	if (n == 1) {
		for (int a = 1; a <= k; a++) {
			cin >> o;
			p = max(p, o);
		}
	} else {
		for (int a = 1; a <= k; a++) {
			cin >> m1[a];
		}
		for (int a = 1; a <= k; a++) {
			cin >> m2[a];
		}	
			//v[i].push_back({a, i});
	
		for (int a = 1; a <= k; a++) {
			if (m1[a] + m2[0] < p) break;
			for (int b = 1; b <= k; b++) {
				if (a == b) continue;
				p = max(m1[a] + m2[b], p);
				
			}
		}
	cout << p << endl;
}//:D