Submission #90865

#TimeUsernameProblemLanguageResultExecution timeMemory
90865YottaByteTrading (IZhO13_trading)C++14
0 / 100
2060 ms7300 KiB
#include <iostream>
using namespace std;

#define pb push_back
#define fr first
#define endl '\n'
#define sc second

const int N = 3e5 + 1;
int a[N], n, m;

void fill(int l, int r, int x)
{
	for(int i = l; i <= r; i++)
	{
		a[i] = max(a[i], x++);
	}
}

main()
{
	cin >> n >> m;
	for(int i = 1; i <= m; i++)
	{
		int l, r, x;
		cin >> l >> r >> x;
		fill(l, r, x);
	}
	
	for(int i = 1; i <= n; i++)
		cout << a[i] << " ";
}
/**
5 2
1 3 2
2 4 6
**/

Compilation message (stderr)

trading.cpp:20:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
#Verdict Execution timeMemoryGrader output
Fetching results...