Submission #886422

# Submission time Handle Problem Language Result Execution time Memory
886422 2023-12-12T06:29:59 Z karimov Trading (IZhO13_trading) C++17
0 / 100
2000 ms 5472 KB
#include <bits/stdc++.h>
using namespace std;
#define FAST ios_base::sync_with_stdio(false); cin.tie(NULL);
#define fio(x) freopen(x".in","r",stdin);freopen(x".out","w",stdout)
void YES(bool t=1){std::cout<<(t?"YES\n":"NO\n");}
void NO(bool t=1){YES(!t);}
const int MOD = 1000000007;
//#define int long long
#define pb push_back
#define ll long long
#define all(x) (x).begin(), (x).end()

void solve() {
	int n,m;
	cin >> n >> m;
	vector<int> v(n+1,0);
	while(m--) {
		int a,b,c;
		cin >> a >>  b >> c;
		for(int i = a; i <= b; i++) {
			v[i] = max(v[i],c);
			c++;
		}
	}
	for(int i = 1; i <= n; i++)cout<<v[i]<<" ";
}

int main() {
	FAST
	solve();
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
6 Correct 2 ms 344 KB Output is correct
7 Correct 1344 ms 4724 KB Output is correct
8 Correct 1975 ms 5320 KB Output is correct
9 Correct 1943 ms 5472 KB Output is correct
10 Execution timed out 2051 ms 4256 KB Time limit exceeded
11 Halted 0 ms 0 KB -