QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#270655 | #7841. Boat Commuter | Redcrown# | WA | 6ms | 4220kb | C++17 | 824b | 2023-12-01 10:57:52 | 2023-12-01 10:57:53 |
Judging History
answer
#include<bits/stdc++.h>
#define ll long long
#define ssz(x) ((int)x.size())
using namespace std;
const int N=3e5+5;
int n,m,k;
inline int red(){
int data=0;bool w=0;char ch=getchar();
while(ch!='-' && (ch<'0' || ch>'9'))ch=getchar();
if(ch=='-') w=1,ch=getchar();
while(ch>='0' && ch<='9') data=(data<<3)+(data<<1)+ch-'0',ch=getchar();
return w?-data:data;
}
int now[N],ans[N];
void solve(){
n=red();m=red();k=red();
for(int i=1;i<=k;i++){
int p=red(),c=red();
if(now[c]){
ans[c]+=(now[c]==p?100:abs(now[c]-p));
now[c]=0;
}else now[c]=p;
}
for(int i=1;i<=m;i++){
if(now[i])ans[i]+=100;
}
for(int i=1;i<=m;i++)
cout<<ans[i]<<(" \n"[i==n]);
}
int main()
{
//ios::sync_with_stdio(false);
//cin.tie(0);
//cout.tie(0);
int T=1;
while(T--)solve();
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3336kb
input:
3 3 5 1 1 1 2 1 2 3 1 2 3
output:
2 100 100
result:
ok single line: '2 100 100'
Test #2:
score: 0
Accepted
time: 3ms
memory: 3412kb
input:
50 10 100000 16 6 7 1 18 1 39 3 30 3 27 5 27 1 25 8 8 4 30 5 48 10 20 1 25 9 40 1 1 8 15 6 24 5 49 9 46 1 42 8 35 4 47 4 28 6 16 7 46 9 30 9 32 8 8 7 40 5 29 10 48 6 42 2 25 8 16 5 41 6 23 7 40 10 33 9 50 8 13 9 41 3 27 5 38 6 7 3 46 10 26 4 33 5 31 9 27 7 50 10 37 5 9 6 30 2 7 8 27 4 20 9 25 4 47 9...
output:
94844 94854 93814 91551 95910 91226 92395 94770 92170 93178
result:
ok single line: '94844 94854 93814 91551 95910 91226 92395 94770 92170 93178 '
Test #3:
score: -100
Wrong Answer
time: 6ms
memory: 4220kb
input:
50 100000 100000 15 96740 22 10089 40 13683 13 78680 17 23471 40 32221 37 81743 49 39664 10 89736 3 92228 43 44871 22 91538 42 89149 42 31355 37 67861 44 49843 31 16350 35 54987 28 4360 6 20100 21 36548 25 3957 21 55315 47 2666 11 94150 27 79681 35 47527 31 84052 45 98448 48 26415 21 24159 39 84014 ...
output:
0 8 100 0 100 100 28 100 100 100 100 69 200 100 21 20 0 100 100 100 110 27 0 0 0 100 100 100 100 0 0 100 0 100 119 64 0 19 48 0 114 0 0 100 100 0 116 100 0 24 100 0 6 100 0 100 0 126 100 100 100 100 100 100 0 16 0 100 100 6 100 100 100 0 100 0 100 113 0 0 0 100 0 24 0 100 0 100 0 100 100 100 100 11 ...
result:
wrong answer 1st lines differ - expected: '0 8 100 0 100 100 28 100 100 1...0 100 100 0 100 0 100 0 0 0 100', found: '0 8 100 0 100 100 28 100 100 1... 114 0 0 100 100 0 116 100 0 24'