Submission #90865

# Submission time Handle Problem Language Result Execution time Memory
90865 2018-12-25T03:48:10 Z YottaByte Trading (IZhO13_trading) C++14
0 / 100
2000 ms 7300 KB
#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

trading.cpp:20:6: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
 main()
      ^
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 512 KB Output is correct
3 Correct 2 ms 512 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 4 ms 664 KB Output is correct
6 Correct 5 ms 664 KB Output is correct
7 Correct 1430 ms 4764 KB Output is correct
8 Execution timed out 2060 ms 7300 KB Time limit exceeded
9 Halted 0 ms 0 KB -