Submission #904332

# Submission time Handle Problem Language Result Execution time Memory
904332 2024-01-12T03:56:05 Z Jawad_Akbar_JJ Ljeto (COCI21_ljeto) C++17
Compilation error
0 ms 0 KB
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>

using namespace std;
const int N = 1e6 +10;

int a[N];
int b[N];
int tm[N];

int main() {
	int n;
	cin>>n;

	int t[3] = {0};
	tm[0] = -1e8;
	for (int i=1;i<=n;i++){
		cin>>tm[i]>>a[i]>>b[i];

		if (a[i]<5)
			d[i] = 1;
		else
			d[i] = 2;
	}

	for (int i=1;i<=n;i++){
		t[d[i]] += 100;
		if (a[i]==a[i-1] and tm[i] - tm[i-1] <= 10)
			t[d[i]] += 50;
	}
	cout<<t[1]<<" "<<t[2]<<endl;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:23:4: error: 'd' was not declared in this scope
   23 |    d[i] = 1;
      |    ^
Main.cpp:25:4: error: 'd' was not declared in this scope
   25 |    d[i] = 2;
      |    ^
Main.cpp:29:5: error: 'd' was not declared in this scope
   29 |   t[d[i]] += 100;
      |     ^