QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#838103 | #9947. King of Karaoke | jiangzhihui# | AC ✓ | 62ms | 6612kb | C++14 | 639b | 2024-12-30 20:59:04 | 2024-12-30 20:59:04 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T;
cin>>T;
while(T--){
int n;
cin>>n;
vector<int> a(n+1);
vector<int> b(n+1);
map<int,int> cnt;
for(int i=1;i<=n;i++){
cin>>a[i];
}
for(int i=1;i<=n;i++){
cin>>b[i];
}
for(int i=1;i<=n;i++){
cnt[a[i]-b[i]]++;
}
int ans=0;
for(auto v:cnt){
ans=max(ans,v.second);
}
cout<<ans<<'\n';
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3532kb
input:
2 4 1 2 3 4 2 3 4 6 5 -5 -4 -3 -2 -1 5 4 3 2 1
output:
3 1
result:
ok 2 lines
Test #2:
score: 0
Accepted
time: 62ms
memory: 6612kb
input:
20 3 1 4 -5 -3 1 5 1 0 3 8 -1 -3 -4 3 -4 1 2 3 5 0 -5 -4 -5 3 3 -4 8 3 -3 1 1 -2 3 2 -1 3 2 -2 5 1 -1 2 4 8 -2 -5 1 2 -5 2 2 -4 -3 4 4 -2 -3 5 2 -2 59 4 -9 7 5 9 -9 2 10 7 -5 -3 -2 -7 1 -5 -8 4 1 10 3 8 -10 3 -8 4 9 -3 -1 -4 8 -8 -2 -10 9 7 -5 -10 -3 -7 -5 -1 -8 5 4 -9 10 -7 10 -9 -9 -7 -5 8 -4 -9 -...
output:
1 1 2 2 2 4 6 7 6 5 61 49 43 47 46 78568 78533 11 81114 50000
result:
ok 20 lines
Extra Test:
score: 0
Extra Test Passed