QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#255296 | #7741. Counter | FHQY_WWW | AC ✓ | 83ms | 4664kb | C++17 | 664b | 2023-11-18 15:25:31 | 2023-11-18 15:25:31 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+10;
pair<int,int> a[N],b[N];
void solve()
{
int n,m;
scanf("%d%d",&n,&m);
for(int i=1;i<=m;i++)
{
scanf("%d%d",&a[i].first,&a[i].second);
}
sort(a+1,a+m+1);
for(int i=1;i<=m;i++){
if(a[i].first-a[i-1].first==a[i].second-a[i-1].second)continue;
if(a[i].second<=a[i].first-a[i-1].first-1)continue;
printf("No\n");
return;
}
printf("Yes\n");
}
signed main()
{
int t=1;
scanf("%d",&t);
while(t--)solve();
}
/*
1
1 1
1 1
1 2
2 1
2 1
1 -1
3 1
2 2
3 -1
2 -1
3 1
3 2
*/
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3756kb
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: 40ms
memory: 3872kb
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: 81ms
memory: 4664kb
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: 83ms
memory: 4196kb
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