QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#664688 | #7155. Padel Prize Pursuit | Newtonabc# | 0 | 81ms | 8376kb | C++14 | 1005b | 2024-10-21 21:45:10 | 2024-10-21 21:45:10 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+10;
const int MIDX=2e5;
int a[N],b[N];
struct fenwick{
long long fw[N];
void init(){
for(int i=0;i<N;i++) fw[i]=0;
}
void update(int idx,int val){
idx++;
while(idx<=MIDX){
fw[idx]+=val;
idx+=idx & -idx;
}
}
int read(int idx){
idx++;
int sum=0;
while(idx>0){
sum+=fw[idx];
idx-=idx & -idx;
}
return sum;
}
}fa,fb;
int main(){
int n,m;
cin>>n >>m;
fa.init(),fb.init();
for(int i=0;i<m;i++){
cin>>a[i] >>b[i];
if(a[i]==0){
fa.update(0,1);
fa.update(i+1,-1);
}
else{
fb.update(0,1);
fb.update(i+1,-1);
}
}
int a=0,b=0;
for(int i=0;i<n;i++){
if(fb.read(i)>fa.read(i)) b++;
else a++;
}
cout<<a <<" " <<b;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 44ms
memory: 8376kb
input:
2 200000 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 0 1 1 0 0 1...
output:
2 0
result:
wrong answer 1st lines differ - expected: '114418 85582', found: '2 0'
Subtask #2:
score: 0
Wrong Answer
Test #5:
score: 0
Wrong Answer
time: 2ms
memory: 7696kb
input:
2000 2000 741 1153 839 1048 1159 445 196 1042 404 1319 638 766 1373 621 736 705 1579 1696 454 1566 1794 474 993 858 424 380 1971 210 1729 861 1450 1275 986 535 964 431 1371 1176 658 378 708 1669 1049 1236 832 533 16 450 675 1324 1680 1598 1936 885 579 307 987 1497 996 1589 1087 843 1303 222 105 1692...
output:
0 2000
result:
wrong answer 1st lines differ - expected: '0 2 0 4 1 0 5 0 2 2 1 0 0 1 0 ...2 0 2 4 0 1 3 2 1 0 2 1 2 2 3 0', found: '0 2000'
Subtask #3:
score: 0
Wrong Answer
Test #21:
score: 0
Wrong Answer
time: 39ms
memory: 8372kb
input:
2 200000 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 0 0 1 0 1 1 0 0 1 0 1 1 0 0 1 1 0 0 1 0 1 0 1 1 0 0 1 0 1 1 0 1 0 0 1 1 0 1 0 1 0 1 0 0 1 1 0 0 1 0 1 0 1 0 1 0 1 0 1 1 0 0 1 1 0 0 1 1 0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 1 0 1 0 0 1 1 0 1 0 0 1 0 1 0 1 1 0 0 1 1 0 1 0 1 0 1 0 0 1 0 1 1 0 1 0 0 1 0 1 0 1 1 0 0 1...
output:
2 0
result:
wrong answer 1st lines differ - expected: '114418 85582', found: '2 0'
Subtask #4:
score: 0
Wrong Answer
Test #31:
score: 0
Wrong Answer
time: 81ms
memory: 8300kb
input:
200000 200000 33870 101688 1598 78943 23260 47952 84769 196360 104405 172552 58448 113260 76500 80767 95836 53662 58671 55746 167974 83639 176177 32272 45361 115076 152875 160216 33361 176768 162031 181989 134541 80064 21681 167447 96707 196846 16036 34620 166990 179451 45201 65888 89903 93145 13742...
output:
0 200000
result:
wrong answer 1st lines differ - expected: '0 2 0 1 1 0 0 0 1 0 0 1 0 1 1 ...5 0 0 0 0 0 3 0 1 0 2 2 0 0 2 0', found: '0 200000'
Subtask #5:
score: 0
Wrong Answer
Test #45:
score: 0
Wrong Answer
time: 78ms
memory: 8308kb
input:
200000 199999 38963 164177 50862 38963 161216 50862 40786 161216 101295 40786 95756 101295 172936 95756 194407 172936 106240 194407 155843 106240 82989 155843 46308 82989 35380 46308 180666 35380 62373 180666 100648 62373 22679 100648 23941 22679 57908 23941 195841 57908 30559 195841 123952 30559 68...
output:
1 199999
result:
wrong answer 1st lines differ - expected: '99029 0 0 58510 0 17566 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0', found: '1 199999'
Subtask #6:
score: 0
Skipped
Dependency #1:
0%