# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
90884 | YottaByte | Trading (IZhO13_trading) | C++14 | 2065 ms | 1640 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <stdio.h>
#include <stdlib.h>
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++)
{
if(a[i] < x++)
a[i] = x - 1;
}
}
main()
{
scanf("%d %d", &n, &m);
for(int i = 1; i <= m; i++)
{
int l, r, x;
scanf("%d %d %d", &l, &r, &x);
fill(l, r, x);
}
for(int i = 1; i <= n; i++)
printf("%d ", a[i]);
}
/**
5 2
1 3 2
2 4 6
**/
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |