CSES - Datatähti 2024 alku - Results
Submission details
Task:Lumimyrsky
Sender:andreibe
Submission time:2023-10-30 18:02:33 +0200
Language:C++ (C++11)
Status:COMPILE ERROR

Compiler report

input/code.cpp: In function 'int main()':
input/code.cpp:58:10: error: expected '}' at end of input
   58 |         }
      |          ^
input/code.cpp:32:12: note: to match this '{'
   32 | int main() {
      |            ^

Code

#include <iostream>
#include <string>
#include <math.h>
#include <map>
#include <algorithm>
#include <vector>
#include <fstream>
#include <set>
#include <unordered_map>
#include <queue>
#include <chrono>
#include <climits>
#include <stack>
using namespace std;
using namespace std::chrono;
 
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
#define S second
#define F first
//#define A 999999999999999999LL
#define M 1000000007
#define N 202020
#define REDIR                 \
	ifstream in("input.txt"); \
	cin.rdbuf(in.rdbuf());
 
 
int reitti1[10];
int reitti2[10];
int main() {
	for (size_t i = 0; i < 10; i++)
	{
		cin >> reitti1[i];
	}
	for (size_t i = 0; i < 10; i++)
	{
		cin >> reitti2[i];
	}
	int nousua1 = 0;
	int nousua2 = 0;
	int last1 = 0;
	int last2 = 0;
	for (size_t i = 0; i < 10; i++)
	{
		int r1 = reitti1[i];
		if (r1 > last1) nousua1 += r1 - last1;
		last1 = r1;
		int r2 = reitti2[i];
		if (r2 > last2) nousua2 += r2 - last2;
		last2 = r2;
	}
	if (nousua1 < nousua2) {
		cout << 1 << endl;
	} else {
		cout << 2 << endl;
	}