QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#291477 | #7741. Counter | ucup-team963# | AC ✓ | 83ms | 4392kb | C++14 | 726b | 2023-12-26 19:26:35 | 2023-12-26 19:26:35 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
const int N = 1e5+100;
int t;
struct Node{
int x,y;
}a[N];
bool cmp(Node X,Node Y){
return X.x<Y.x;
}
int n,m;
string Work(){
scanf("%d %d",&n,&m);
for (int i = 1; i <= m; i++) scanf("%d %d",&a[i].x,&a[i].y);
sort(a+1,a+m+1,cmp);
for (int i = 1; i <= m; i++){
int de = a[i].x-a[i-1].x;
if (a[i].y >= a[i-1].y){
if (a[i].y-a[i-1].y > de) return "No";
if (a[i].y-a[i-1].y == de) continue;
if (a[i].y >= de) return "No";
continue;
}
if (a[i].y >= de) return "No";
}
return "Yes";
}
int main(){
scanf("%d",&t);
while (t--) cout<<Work()<<endl;
return 0;
}
/*
3
7 4
4 0
2 2
7 1
5 1
3 2
2 2
3 1
3 1
3 100
*/
这程序好像有点Bug,我给组数据试试?
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 3548kb
input:
3 7 4 4 0 2 2 7 1 5 1 3 2 2 2 3 1 3 1 3 100
output:
Yes No No
result:
ok 3 lines
Test #2:
score: 0
Accepted
time: 45ms
memory: 3628kb
input:
5610 1000000000 9 21408920 21408920 639702953 5628375 678176260 35373514 675909632 33106886 763056067 22659772 634660067 585489 674936674 762263554 637415497 3340919 638759931 4685353 1000000000 9 181850524 41335018 199253466 58737960 991953096 345115785 151207006 10691500 478549434 191746502 105653...
output:
No No Yes Yes Yes Yes No No Yes No Yes Yes Yes Yes No No Yes Yes Yes No No Yes No Yes No Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes Yes Yes Yes Yes No Yes Yes No Yes Yes Yes Yes Yes Yes No Yes Yes Yes Yes Yes No Yes No Yes Yes Yes No Yes No No No Yes No Yes Yes No Yes No Yes Yes Yes No Yes Yes Y...
result:
ok 5610 lines
Test #3:
score: 0
Accepted
time: 83ms
memory: 4392kb
input:
5 1000000000 100000 547678834 188839 397793147 14792 506016255 13227 221799665 127754 599008356 363144 229750198 51359 745400902 120196 199424849 134343 92319760 53188 854824512 110112 836744522 662 731417576 4991 727726496 91833 806187140 65275 106499884 83482 101812456 46836 253971728 117747 27026...
output:
Yes No No Yes No
result:
ok 5 lines
Test #4:
score: 0
Accepted
time: 82ms
memory: 3924kb
input:
10 1000000000 50000 325131690 27870 495358119 14916 483083615 20903 350409066 752 267334729 567 797038342 21566 985946898 25128 531325143 294 372615334 145 734411884 1455 42395178 3150 55651126 21677 836937065 37580 337422910 9351 716061322 15805 384110398 10055 609169805 574 910889923 49427 3940241...
output:
Yes No Yes Yes No No No No Yes Yes
result:
ok 10 lines
Extra Test:
score: 0
Extra Test Passed