# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
655127 |
2022-11-03T07:43:37 Z |
snpmrnhlol |
Meteors (POI11_met) |
C++17 |
|
6000 ms |
22624 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll v[300000],v2[300000],l[300000],r[300000];
ll v3[300000],v4[300000],v5[300000];
vector <ll> v6[300000];
ll v7[300000];
int main(){
ll n,m,i,q,j;
cin>>n>>m;
for(i = 0;i < m;i++)cin>>v[i],v[i]--;
for(i = 0;i < n;i++){
cin>>v2[i];
}
cin>>q;
for(i = 0;i < q;i++){
cin>>v3[i]>>v4[i]>>v5[i];
v3[i]--;
v4[i]--;
}
for(i = 0;i < n;i++)l[i] = 0,r[i] = q;
for(i = 0;i < 30;i++){
for(j = 0;j < q;j++)v6[j].clear();
for(j = 0;j < m;j++)v7[j] = 0;
for(j = 0;j < n;j++){
if(l[j] != r[j]){
v6[(l[j] + r[j])/2].push_back(j);
}
//cout<<l[j]<<' '<<r[j]<<'\n';
}
///simulate
for(j = 0;j < q;j++){
for(int p = v3[j];p != v4[j];p = (p + 1)%m){
//cout<<p<<' '<<v4[j]<<'\n';
v7[v[p]]+=v5[j];
}
v7[v[v4[j]]]+=v5[j];
for(auto p:v6[j]){
if(v7[p] >= v2[p]){
r[p] = (l[p] + r[p])/2;
}else{
l[p] = (l[p] + r[p])/2 + 1;
}
}
}
}
for(i = 0;i < n;i++){
if(l[i] == n)cout<<"NIE";
else cout<<l[i] + 1;
cout<<'\n';
}
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
39 ms |
7380 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
55 ms |
7500 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6046 ms |
9780 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6081 ms |
9936 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6047 ms |
9688 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6058 ms |
9476 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6054 ms |
22624 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
6040 ms |
22448 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |