# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
865296 |
2023-10-24T07:14:57 Z |
vjudge1 |
Meteors (POI11_met) |
C++ |
|
6000 ms |
36404 KB |
#include <bits/stdc++.h>
#include <sstream>
#include <fstream>
///////////////////////////////////
///////////////////////////////////
///////////////////////////////////
///////////////////////////////////
///////////////////////////////////
//WAS CREAtED BY BAISYN MUKHAMMED//
///////////////////////////////////
///////////////////////////////////
///////////////////////////////////
///////////////////////////////////
///////////////////////////////////
#define et "\n"
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define ioi ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using namespace std;
const ll M = 1000000007;
ll n,m,k,a[511111],b[311111],c[311111],p[311111];
map <ll,ll> mp,ans,mp1;
vector <ll> v[311111];
void solve() {
cin >> m >> n;
for (int i = 1;i <= n;i++) {
cin >> a[i];
}
for (int i = 1;i <= m;i++) {
cin >> b[i];
mp1[i] = b[i];
ans[i] = -1;
}
cin >> k;
for (int i = 1;i <= k;i++) {
ll l,r,x;
cin >> l >> r >> x;
if (l <= r) {
for (int j = l;j <= r;j++) {
mp[a[j]] += x;
if (mp1[a[j]] <= mp[a[j]] && ans[a[j]] == -1) {
ans[a[j]] = i;
}
}
}
else {
for (int j = 1;j <= r;j++) {
mp[a[j]] += x;
if (mp1[a[j]] <= mp[a[j]] && ans[a[j]] == -1) {
ans[a[j]] = i;
}
}
for (int j = l;j <= n;j++) {
mp[a[j]] += x;
if (mp1[a[j]] <= mp[a[j]] && ans[a[j]] == -1) {
ans[a[j]] = i;
}
}
}
// cout << et;
}
for (int i = 1;i <= m;i++) {
// cout << mp[i] << et;
if (ans[i] == -1) {
cout << "NIE" << et;
}
else {
cout << ans[i] << et;
}
}
}
int main () {
ioi;
// freopen("promote.in","r",stdin);
// freopen("promote.out","w",stdout);
ll t = 1;
// cin >> t;
while (t--) {
// cout << "Case " << t1 << ':' << et;
solve();
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
14 ms |
12892 KB |
Output is correct |
2 |
Correct |
49 ms |
12892 KB |
Output is correct |
3 |
Correct |
41 ms |
12892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
12888 KB |
Output is correct |
2 |
Correct |
57 ms |
12888 KB |
Output is correct |
3 |
Correct |
58 ms |
12892 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6018 ms |
13884 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6030 ms |
15084 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6028 ms |
14348 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6034 ms |
13148 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6095 ms |
36404 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6066 ms |
33696 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |