QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#403577 | #2774. Scenery | zhouhuanyi | AC ✓ | 664ms | 4996kb | C++23 | 2.2kb | 2024-05-02 15:05:04 | 2024-05-02 15:05:04 |
Judging History
answer
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#define N 20002
using namespace std;
const int inf=(int)(1e9);
int read()
{
char c=0;
int sum=0;
while (c<'0'||c>'9') c=getchar();
while ('0'<=c&&c<='9') sum=sum*10+c-'0',c=getchar();
return sum;
}
struct reads
{
int num,data;
bool operator < (const reads &t)const
{
return data!=t.data?data<t.data:num>t.num;
}
};
int n,m,k,tong[N+1],length,a[N+1],b[N+1],X[N+1],Y[N+1],C[N+1],rt[N+1],l[N+1],delta[N+1],dis[N+1],dis2[N+1];
bool used[N+1];
vector<int>p[N+1];
int find(int x)
{
if (rt[x]==x) return x;
return rt[x]=find(rt[x]);
}
void unionn(int x,int y)
{
delta[y]+=delta[x],l[y]=l[x],rt[x]=y;
return;
}
int main()
{
bool op;
reads res;
n=read(),k=read(),tong[++length]=-1,tong[++length]=inf;
for (int i=1;i<=n;++i) a[i]=read()-1,b[i]=read()-k,tong[++length]=a[i],tong[++length]=b[i];
sort(tong+1,tong+length+1),length=unique(tong+1,tong+length+1)-tong-1;
for (int i=1;i<=n;++i) a[i]=lower_bound(tong+1,tong+length+1,a[i])-tong,b[i]=lower_bound(tong+1,tong+length+1,b[i])-tong,p[a[i]].push_back(b[i]);
for (int i=2;i<=length;++i) dis2[i]=dis[i]=inf;
for (int i=1;i<=length;++i)
{
dis[length]=min(dis[length],dis[1]+n);
for (int j=length-1;j>=1;--j) dis[j]=min(dis[j],dis[j+1]);
res=(reads){inf,inf};
for (int j=1;j<=length;++j) dis[j]=min(dis[j],res.data+(tong[j]+1)/k+(res.num<(tong[j]+1)%k)),res=min(res,(reads){(tong[j]+1)%k,dis[j]-(tong[j]+1)/k});
for (int j=1;j<=length;++j) rt[j]=l[j]=j;
for (int j=length;j>=1;--j)
{
if (j+1<=length)
{
for (int k=0;k<p[j].size();++k)
{
delta[find(p[j][k])]--;
while (l[find(p[j][k])]!=j+1&&delta[find(p[j][k])]<0) unionn(l[find(p[j][k])]-1,find(p[j][k]));
}
dis[j]=min(dis[j],delta[find(j+1)]);
}
delta[j]=dis[j];
if (j+1<=length)
{
delta[find(j+1)]-=dis[j];
while (l[find(j+1)]&&delta[find(j+1)]<0) unionn(l[find(j+1)]-1,find(j+1));
}
}
op=1;
for (int j=1;j<=length;++j) op&=(dis[j]==dis2[j]),dis2[j]=dis[j];
if (op)
{
puts("yes");
return 0;
}
if (dis[1]<0)
{
puts("no");
return 0;
}
}
puts("no");
return 0;
}
詳細信息
Test #1:
score: 100
Accepted
time: 1ms
memory: 3696kb
input:
2 10 0 15 5 20
output:
yes
result:
ok single line: 'yes'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3624kb
input:
2 10 1 15 0 20
output:
no
result:
ok single line: 'no'
Test #3:
score: 0
Accepted
time: 1ms
memory: 3536kb
input:
2 10 5 30 10 20
output:
yes
result:
ok single line: 'yes'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
11 6 0 74 2 60 4 34 10 36 21 46 26 40 28 38 30 48 50 68 52 68 54 62
output:
yes
result:
ok single line: 'yes'
Test #5:
score: 0
Accepted
time: 1ms
memory: 3596kb
input:
11 6 0 74 2 60 4 34 10 36 21 46 26 40 28 38 30 48 50 68 52 67 54 62
output:
no
result:
ok single line: 'no'
Test #6:
score: 0
Accepted
time: 528ms
memory: 4664kb
input:
9695 10 1 146 0 68 1 30 10 20 39 68 48 58 77 145 78 107 88 98 116 145 125 135 147 292 146 214 147 176 157 167 185 214 194 204 223 291 224 253 233 243 262 291 271 281 293 438 292 360 293 322 303 313 331 360 341 351 369 437 370 399 380 390 408 437 418 428 439 584 438 506 439 468 448 458 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #7:
score: 0
Accepted
time: 530ms
memory: 4660kb
input:
9696 10 1 146 0 68 1 30 10 20 39 68 48 58 77 145 78 107 88 98 116 145 125 135 147 292 146 214 147 176 157 167 185 214 194 204 223 291 224 253 233 243 262 291 271 281 293 438 292 360 293 322 303 313 331 360 341 351 369 437 370 399 380 390 408 437 418 428 439 584 438 506 439 468 448 458 477 506 487 49...
output:
no
result:
ok single line: 'no'
Test #8:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
2 42 10 90 10 90
output:
no
result:
ok single line: 'no'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
2 42 6 90 6 90
output:
yes
result:
ok single line: 'yes'
Test #10:
score: 0
Accepted
time: 1ms
memory: 3564kb
input:
3 1 0 2 0 1 0 2
output:
no
result:
ok single line: 'no'
Test #11:
score: 0
Accepted
time: 1ms
memory: 3672kb
input:
3 1 0 1000000000 0 1 0 2
output:
yes
result:
ok single line: 'yes'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3620kb
input:
5 5 0 29 1 24 3 14 2 19 4 9
output:
yes
result:
ok single line: 'yes'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3492kb
input:
5 5 3 15 1 25 4 10 2 20 0 28
output:
yes
result:
ok single line: 'yes'
Test #14:
score: 0
Accepted
time: 0ms
memory: 3692kb
input:
5 5 2 19 3 14 0 28 4 9 1 24
output:
no
result:
ok single line: 'no'
Test #15:
score: 0
Accepted
time: 0ms
memory: 3532kb
input:
5 10 31 41 1 11 11 21 21 31 41 51
output:
yes
result:
ok single line: 'yes'
Test #16:
score: 0
Accepted
time: 1ms
memory: 3532kb
input:
5 10 11 21 32 43 1 11 41 51 21 31
output:
no
result:
ok single line: 'no'
Test #17:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
10 2 9 11 0 20 0 20 0 20 0 20 0 20 0 20 0 20 0 20 0 20
output:
no
result:
ok single line: 'no'
Test #18:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
10 2 10 12 0 20 0 20 0 20 0 20 0 20 0 20 0 20 0 20 0 20
output:
yes
result:
ok single line: 'yes'
Test #19:
score: 0
Accepted
time: 0ms
memory: 3676kb
input:
11 3 12 15 17 20 1 38 2 38 3 35 4 33 5 32 6 29 7 27 8 26 9 23
output:
yes
result:
ok single line: 'yes'
Test #20:
score: 0
Accepted
time: 0ms
memory: 3672kb
input:
11 3 12 15 17 20 1 37 2 37 3 35 4 33 5 32 6 29 7 27 8 26 9 23
output:
no
result:
ok single line: 'no'
Test #21:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
11 3 12 15 17 20 1 38 2 35 3 32 4 32 5 29 6 27 7 26 8 23 9 21
output:
yes
result:
ok single line: 'yes'
Test #22:
score: 0
Accepted
time: 0ms
memory: 3536kb
input:
11 3 12 15 17 20 1 37 2 35 3 32 4 32 5 29 6 27 7 26 8 23 9 21
output:
no
result:
ok single line: 'no'
Test #23:
score: 0
Accepted
time: 0ms
memory: 3556kb
input:
1 42 9 52
output:
yes
result:
ok single line: 'yes'
Test #24:
score: 0
Accepted
time: 1ms
memory: 3604kb
input:
1 42 11 53
output:
yes
result:
ok single line: 'yes'
Test #25:
score: 0
Accepted
time: 0ms
memory: 3612kb
input:
11 6 12 20 6 22 6 24 26 44 36 46 34 48 28 53 38 64 40 70 14 72 0 74
output:
yes
result:
ok single line: 'yes'
Test #26:
score: 0
Accepted
time: 1ms
memory: 3612kb
input:
11 6 12 20 7 22 6 24 26 44 36 46 34 48 28 53 38 64 40 70 14 72 0 74
output:
no
result:
ok single line: 'no'
Test #27:
score: 0
Accepted
time: 1ms
memory: 3748kb
input:
1000 10 2531 2541 7171 7181 8601 8611 5681 5691 8271 8281 6031 6041 7481 7491 7141 7151 2841 2851 9651 9661 901 911 8101 8111 4581 4591 781 791 9481 9491 1351 1361 4211 4221 8631 8641 7611 7621 2811 2821 7561 7571 2341 2351 3511 3521 2161 2171 931 941 2361 2371 3261 3271 7471 7481 7591 7601 9701 971...
output:
yes
result:
ok single line: 'yes'
Test #28:
score: 0
Accepted
time: 1ms
memory: 3728kb
input:
1000 10 5391 5401 8741 8751 4491 4501 771 781 4081 4091 4981 4991 8631 8641 7921 7931 8601 8611 4671 4681 671 681 3601 3611 9671 9681 7241 7251 31 41 7471 7481 6981 6991 9581 9591 9521 9531 311 321 571 581 5651 5661 8121 8131 2121 2131 9051 9061 4051 4061 411 421 5851 5861 3421 3431 2181 2191 301 31...
output:
no
result:
ok single line: 'no'
Test #29:
score: 0
Accepted
time: 3ms
memory: 4752kb
input:
9998 100000 0 100000 100000 200000 200000 300000 300000 400000 400000 500000 500000 600000 600000 700000 700000 800000 800000 900000 900000 1000000 1000000 1100000 1100000 1200000 1200000 1300000 1300000 1400000 1400000 1500000 1500000 1600000 1600000 1700000 1700000 1800000 1800000 1900000 1900000 ...
output:
yes
result:
ok single line: 'yes'
Test #30:
score: 0
Accepted
time: 0ms
memory: 4868kb
input:
9998 100000 0 500090002 1 500090003 2 500090004 3 500090005 4 500090006 5 500090007 6 500090008 7 500090009 8 500090010 9 500090011 10 500090012 11 500090013 12 500090014 13 500090015 14 500090016 15 500090017 16 500090018 17 500090019 18 500090020 19 500090021 20 500090022 21 500090023 22 500090024...
output:
yes
result:
ok single line: 'yes'
Test #31:
score: 0
Accepted
time: 0ms
memory: 3872kb
input:
9999 2 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998 0 9998...
output:
yes
result:
ok single line: 'yes'
Test #32:
score: 0
Accepted
time: 664ms
memory: 4372kb
input:
9999 2 0 24998 3 5 0 24998 8 10 0 24998 13 15 0 24998 18 20 0 24998 23 25 0 24998 28 30 0 24998 33 35 0 24998 38 40 0 24998 43 45 0 24998 48 50 0 24998 53 55 0 24998 58 60 0 24998 63 65 0 24998 68 70 0 24998 73 75 0 24998 78 80 0 24998 83 85 0 24998 88 90 0 24998 93 95 0 24998 98 100 0 24998 103 105...
output:
yes
result:
ok single line: 'yes'
Test #33:
score: 0
Accepted
time: 191ms
memory: 4104kb
input:
9998 2 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998 0 4998...
output:
yes
result:
ok single line: 'yes'
Test #34:
score: 0
Accepted
time: 0ms
memory: 3752kb
input:
1000 100000 234294286 234427116 161692120 161858166 192115615 192281661 249806722 249914914 151576139 151708909 114641576 114757960 104548340 104713878 164209630 164310142 157794261 157894325 162645705 162782567 246941564 247041566 239320500 239420503 114930600 115163718 242154008 242254022 16044404...
output:
yes
result:
ok single line: 'yes'
Test #35:
score: 0
Accepted
time: 1ms
memory: 3872kb
input:
10000 2 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20000 0 20...
output:
yes
result:
ok single line: 'yes'
Test #36:
score: 0
Accepted
time: 4ms
memory: 4044kb
input:
10000 2 0 17555 0 19254 0 15037 0 18199 0 11173 0 10572 0 18184 0 15762 0 17553 0 11675 0 13815 0 19695 0 15674 0 12854 0 19852 0 16035 0 15579 0 12043 0 15226 0 19883 0 14158 0 18568 0 12265 0 17070 0 18408 0 13094 0 15787 0 18251 1215 1219 0 12175 0 10628 0 13125 0 17721 0 16106 0 12383 0 14188 0 ...
output:
yes
result:
ok single line: 'yes'
Test #37:
score: 0
Accepted
time: 4ms
memory: 4148kb
input:
10000 2 0 12749 0 12156 0 12589 0 15646 0 17003 0 11243 0 14684 0 17499 0 11267 0 11779 0 18800 0 13045 0 16460 0 18119 0 16146 3110 3114 0 13235 0 19449 0 14430 0 17160 0 19845 4245 4249 0 17029 0 18804 0 15165 0 16667 0 19672 0 14830 0 13756 0 13679 0 16430 0 12714 0 13757 0 16290 0 18071 0 12074 ...
output:
no
result:
ok single line: 'no'
Test #38:
score: 0
Accepted
time: 12ms
memory: 4904kb
input:
10000 1000 17837225 17838736 13835975 13837485 10147097 10148191 16541494 16546596 22964403 22969753 24876001 24877017 16970577 16980791 13614888 13620046 20608929 20634503 11601939 11603005 22725453 22726484 17440772 17445994 12747736 12749886 19430111 19431112 12502813 12507915 18530376 18537518 1...
output:
yes
result:
ok single line: 'yes'
Test #39:
score: 0
Accepted
time: 6ms
memory: 4912kb
input:
10000 10000 56933425 57126261 56912552 57110895 56909805 57109504 56918462 57108860 56933012 57117951 76156016 76408259 76164566 76408515 76169547 76398813 76165933 76422619 76156961 76410693 31273183 31423711 31274071 31443006 31295851 31433414 31290019 31445862 31271894 31436748 124134097 12428280...
output:
yes
result:
ok single line: 'yes'
Test #40:
score: 0
Accepted
time: 5ms
memory: 4928kb
input:
10000 10000 2077289 2271938 2066887 2264909 2079933 2277871 2057852 2258918 2079173 2262030 140653393 140757341 140650251 140762746 140649667 140753296 140646497 140754025 140645838 140769611 63566316 63828615 63569276 63813477 63565213 63825681 63574900 63827490 63574016 63835497 166313963 16641066...
output:
no
result:
ok single line: 'no'
Test #41:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
1000 1000 788 212999 586 414999 509 491999 42 958999 59 941999 359 641999 654 346999 488 512999 109 891999 877 123999 950 50999 250 750999 361 639999 524 476999 931 69999 697 303999 143 857999 12 988999 588 412999 930 70999 649 351999 236 764999 459 541999 214 786999 800 200999 303 697999 592 408999...
output:
yes
result:
ok single line: 'yes'
Test #42:
score: 0
Accepted
time: 1ms
memory: 3720kb
input:
1000 1000 478 522999 30 970999 797 203999 831 169999 277 723999 534 466999 157 843999 143 857999 804 196999 13 987999 285 715999 849 151999 233 767999 465 535999 481 519999 337 663999 773 227999 311 689999 583 417999 604 396999 76 924999 204 796999 140 860999 751 249999 618 382999 779 221999 400 600...
output:
no
result:
ok single line: 'no'
Test #43:
score: 0
Accepted
time: 1ms
memory: 3640kb
input:
1000 1000 532 469000 416 585000 449 552000 762 239000 916 85000 634 367000 409 592000 951 50000 363 638000 260 741000 354 647000 482 519000 158 843000 119 882000 28 973000 630 371000 124 877000 558 443000 955 46000 509 492000 502 499000 302 699000 277 724000 495 506000 445 556000 889 112000 346 6550...
output:
yes
result:
ok single line: 'yes'
Test #44:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
1000 100 157059 157627 29890 30888 13163 14118 49967 50327 199881 200699 80049 81011 83519 84066 181284 181798 93169 93484 159141 159529 23085 23419 94414 94860 58868 59244 28172 28491 139369 140303 182687 183106 11541 12253 131950 132734 43029 43936 188677 189434 37409 38320 164140 164629 176377 17...
output:
yes
result:
ok single line: 'yes'
Test #45:
score: 0
Accepted
time: 1ms
memory: 3608kb
input:
100 10000 1599258 1610590 2145036 2158436 1950098 1960098 1408001 1418348 1750966 1761335 1965445 1975769 1377949 1387949 1435949 1445949 1329363 1344801 1468249 1481637 1854074 1864074 1035322 1048857 1089370 1099370 2163537 2176944 1280153 1291535 1705736 1715736 1097141 1110567 1012442 1022442 18...
output:
no
result:
ok single line: 'no'
Test #46:
score: 0
Accepted
time: 1ms
memory: 3628kb
input:
100 10000 1598906 1610953 2144691 2158786 1949964 1960226 1407662 1418685 1750607 1761693 1965100 1976126 1377934 1387965 1435822 1446092 1329011 1345153 1467859 1481985 1853941 1864199 1035008 1049166 1089243 1099499 2163188 2177282 1279818 1291880 1705581 1715899 1096786 1110896 1012247 1022629 18...
output:
yes
result:
ok single line: 'yes'
Test #47:
score: 0
Accepted
time: 1ms
memory: 3492kb
input:
100 10000 1599258 1610590 2145036 2158436 1950098 1960098 1408001 1418348 1750966 1761335 1965445 1975769 1377949 1387949 1435949 1445949 1329363 1344801 1468249 1481637 1854074 1864074 1035322 1048857 1089370 1099370 2163537 2176944 1280153 1291535 1705736 1715736 1097141 1110567 1012442 1022442 18...
output:
yes
result:
ok single line: 'yes'
Test #48:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
1000 100 124051 125187 171191 171336 224596 226225 123199 123391 245459 245589 213369 214010 102337 103456 247766 248024 240201 240587 124332 124717 200470 200696 240898 241509 188213 189342 109849 110972 135910 136023 193319 193453 220894 222030 229948 230572 120484 121733 159506 159761 171587 1717...
output:
yes
result:
ok single line: 'yes'
Test #49:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
1000 200 407844 408545 380918 383214 262738 262993 366274 366474 302376 303614 374077 374518 242960 243160 295619 295937 423975 424235 264694 264895 407770 407970 341001 342223 286896 287215 428628 428959 448025 452306 227232 228189 456731 456931 305555 305803 382512 384757 478767 478988 427795 4300...
output:
yes
result:
ok single line: 'yes'
Test #50:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
1000 200 202524 202959 427270 427958 258576 260808 460543 461749 276291 276491 203871 204071 212076 212771 402569 404023 440754 441005 482397 482597 342791 343015 332002 334256 324392 324667 378344 379030 266128 266358 309793 311028 356102 356600 256510 257844 431366 431566 379132 379565 387531 3887...
output:
yes
result:
ok single line: 'yes'
Test #51:
score: 0
Accepted
time: 480ms
memory: 4768kb
input:
9996 10 1 146 0 68 1 30 10 20 39 68 49 59 77 145 78 107 88 98 116 145 125 135 147 292 146 214 147 176 156 166 185 214 194 204 223 291 224 253 233 243 262 291 271 281 293 438 292 360 293 322 303 313 331 360 341 351 369 437 370 399 379 389 408 437 417 427 439 584 438 506 439 468 449 459 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #52:
score: 0
Accepted
time: 473ms
memory: 4712kb
input:
9996 10 1 146 0 68 1 30 11 21 39 68 48 58 77 145 78 107 88 98 116 145 126 136 147 292 146 214 147 176 156 166 185 214 195 205 223 291 224 253 233 243 262 291 271 281 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 380 390 408 437 418 428 439 584 438 506 439 468 449 459 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #53:
score: 0
Accepted
time: 485ms
memory: 4768kb
input:
9996 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 88 98 116 145 126 136 147 292 146 214 147 176 157 167 185 214 194 204 223 291 224 253 233 243 262 291 271 281 293 438 292 360 293 322 303 313 331 360 340 350 369 437 370 399 380 390 408 437 418 428 439 584 438 506 439 468 448 458 477 506 486 49...
output:
yes
result:
ok single line: 'yes'
Test #54:
score: 0
Accepted
time: 487ms
memory: 4632kb
input:
9996 10 1 146 0 68 1 30 10 20 39 68 48 58 77 145 78 107 88 98 116 145 125 135 147 292 146 214 147 176 156 166 185 214 194 204 223 291 224 253 233 243 262 291 272 282 293 438 292 360 293 322 302 312 331 360 340 350 369 437 370 399 380 390 408 437 418 428 439 584 438 506 439 468 448 458 477 506 486 49...
output:
yes
result:
ok single line: 'yes'
Test #55:
score: 0
Accepted
time: 486ms
memory: 4792kb
input:
9996 10 1 146 0 68 1 30 11 21 39 68 48 58 77 145 78 107 87 97 116 145 126 136 147 292 146 214 147 176 156 166 185 214 194 204 223 291 224 253 233 243 262 291 271 281 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 379 389 408 437 418 428 439 584 438 506 439 468 448 458 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #56:
score: 0
Accepted
time: 469ms
memory: 4648kb
input:
9996 10 1 146 0 68 1 30 11 21 39 68 48 58 77 145 78 107 87 97 116 145 126 136 147 292 146 214 147 176 156 166 185 214 195 205 223 291 224 253 234 244 262 291 271 281 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 379 389 408 437 418 428 439 584 438 506 439 468 448 458 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #57:
score: 0
Accepted
time: 498ms
memory: 4796kb
input:
9996 10 1 146 0 68 1 30 11 21 39 68 48 58 77 145 78 107 87 97 116 145 126 136 147 292 146 214 147 176 156 166 185 214 195 205 223 291 224 253 233 243 262 291 272 282 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 379 389 408 437 417 427 439 584 438 506 439 468 449 459 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #58:
score: 0
Accepted
time: 479ms
memory: 4636kb
input:
9996 10 1 146 0 68 1 30 10 20 39 68 49 59 77 145 78 107 87 97 116 145 126 136 147 292 146 214 147 176 157 167 185 214 195 205 223 291 224 253 234 244 262 291 271 281 293 438 292 360 293 322 302 312 331 360 340 350 369 437 370 399 379 389 408 437 418 428 439 584 438 506 439 468 449 459 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #59:
score: 0
Accepted
time: 466ms
memory: 4716kb
input:
9996 10 1 146 0 68 1 30 11 21 39 68 48 58 77 145 78 107 88 98 116 145 126 136 147 292 146 214 147 176 157 167 185 214 194 204 223 291 224 253 234 244 262 291 271 281 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 379 389 408 437 418 428 439 584 438 506 439 468 449 459 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #60:
score: 0
Accepted
time: 484ms
memory: 4704kb
input:
9996 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 88 98 116 145 126 136 147 292 146 214 147 176 157 167 185 214 195 205 223 291 224 253 233 243 262 291 272 282 293 438 292 360 293 322 302 312 331 360 340 350 369 437 370 399 380 390 408 437 417 427 439 584 438 506 439 468 448 458 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #61:
score: 0
Accepted
time: 480ms
memory: 4664kb
input:
10000 10 1 146 0 68 1 30 10 20 39 68 49 59 77 145 78 107 88 98 116 145 125 135 147 292 146 214 147 176 156 166 185 214 194 204 223 291 224 253 233 243 262 291 271 281 293 438 292 360 293 322 303 313 331 360 341 351 369 437 370 399 379 389 408 437 417 427 439 584 438 506 439 468 449 459 477 506 487 4...
output:
yes
result:
ok single line: 'yes'
Test #62:
score: 0
Accepted
time: 564ms
memory: 4744kb
input:
9990 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 87 97 116 145 125 135 147 292 146 214 147 176 156 166 185 214 195 205 223 291 224 253 233 243 262 291 271 281 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 380 390 408 437 417 427 439 584 438 506 439 468 448 458 477 506 486 49...
output:
yes
result:
ok single line: 'yes'
Test #63:
score: 0
Accepted
time: 568ms
memory: 4688kb
input:
9991 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 87 97 116 145 125 135 147 292 146 214 147 176 156 166 185 214 195 205 223 291 224 253 233 243 262 291 271 281 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 380 390 408 437 417 427 439 584 438 506 439 468 448 458 477 506 486 49...
output:
no
result:
ok single line: 'no'
Test #64:
score: 0
Accepted
time: 537ms
memory: 4664kb
input:
9796 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 87 97 116 145 125 135 147 292 146 214 147 176 156 166 185 214 194 204 223 291 224 253 234 244 262 291 271 281 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 379 389 408 437 417 427 439 584 438 506 439 468 448 458 477 506 486 49...
output:
yes
result:
ok single line: 'yes'
Test #65:
score: 0
Accepted
time: 549ms
memory: 4732kb
input:
9797 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 87 97 116 145 125 135 147 292 146 214 147 176 156 166 185 214 194 204 223 291 224 253 234 244 262 291 271 281 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 379 389 408 437 417 427 439 584 438 506 439 468 448 458 477 506 486 49...
output:
no
result:
ok single line: 'no'
Test #66:
score: 0
Accepted
time: 1ms
memory: 3740kb
input:
1000 100 184988 185906 159867 160525 40302 41276 84622 85590 84833 85746 9444 9871 2143 2588 1394 1976 189078 189750 71221 71800 154921 155295 48176 48633 23542 24316 122048 122746 111620 112225 5021 5559 73353 74021 88047 88903 187222 187808 29002 29684 14688 15555 14920 15494 94892 95890 32386 330...
output:
yes
result:
ok single line: 'yes'
Test #67:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
1000 100 136209 136629 10824 11295 172673 173124 182592 182897 85242 86232 135475 135796 134857 135305 117647 118267 54536 55530 99025 99769 27152 27798 109699 110118 88955 89585 15830 16312 14100 14683 43032 43630 82270 82745 48401 49109 136445 137147 45888 46686 129797 130731 66477 67366 197854 19...
output:
yes
result:
ok single line: 'yes'
Test #68:
score: 0
Accepted
time: 534ms
memory: 4688kb
input:
9825 10 1 146 0 68 1 30 10 20 39 68 48 58 77 145 78 107 87 97 116 145 125 135 147 292 146 214 147 176 157 167 185 214 194 204 223 291 224 253 234 244 262 291 271 281 293 438 292 360 293 322 302 312 331 360 340 350 369 437 370 399 379 389 408 437 418 428 439 584 438 506 439 468 449 459 477 506 486 49...
output:
yes
result:
ok single line: 'yes'
Test #69:
score: 0
Accepted
time: 533ms
memory: 4616kb
input:
9826 10 1 146 0 68 1 30 10 20 39 68 48 58 77 145 78 107 87 97 116 145 125 135 147 292 146 214 147 176 157 167 185 214 194 204 223 291 224 253 234 244 262 291 271 281 293 438 292 360 293 322 302 312 331 360 340 350 369 437 370 399 379 389 408 437 418 428 439 584 438 506 439 468 449 459 477 506 486 49...
output:
no
result:
ok single line: 'no'
Test #70:
score: 0
Accepted
time: 546ms
memory: 4732kb
input:
9785 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 87 97 116 145 125 135 147 292 146 214 147 176 156 166 185 214 195 205 223 291 224 253 233 243 262 291 272 282 293 438 292 360 293 322 303 313 331 360 340 350 369 437 370 399 380 390 408 437 417 427 439 584 438 506 439 468 449 459 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #71:
score: 0
Accepted
time: 544ms
memory: 4584kb
input:
9786 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 87 97 116 145 125 135 147 292 146 214 147 176 156 166 185 214 195 205 223 291 224 253 233 243 262 291 272 282 293 438 292 360 293 322 303 313 331 360 340 350 369 437 370 399 380 390 408 437 417 427 439 584 438 506 439 468 449 459 477 506 487 49...
output:
no
result:
ok single line: 'no'
Test #72:
score: 0
Accepted
time: 1ms
memory: 3804kb
input:
1000 50 56634 57224 71129 71944 78229 78317 103015 103086 109310 109424 62748 62956 70101 70160 58540 58606 72591 73152 91730 91783 92782 92866 86744 87320 77766 78073 121938 122370 52602 52652 118448 118625 85118 85182 68525 69087 66414 66542 109470 109777 73345 73401 62677 62761 110273 110400 1123...
output:
no
result:
ok single line: 'no'
Test #73:
score: 0
Accepted
time: 1ms
memory: 3664kb
input:
1000 5 6482 6488 7357 7369 10367 10394 5451 5474 10032 10051 5644 5715 8549 8620 11662 11682 7069 7152 9933 9946 9722 9853 8111 8180 11581 11624 7344 7364 5602 5623 7537 7604 8216 8299 5160 5292 8529 8535 8364 8385 11547 11553 6338 6533 7152 7158 6920 7003 11121 11133 11438 11585 7836 7968 9570 9583...
output:
yes
result:
ok single line: 'yes'
Test #74:
score: 0
Accepted
time: 1ms
memory: 3736kb
input:
1000 50 56634 57224 71129 71944 78229 78317 103015 103086 109310 109424 62748 62956 70101 70160 58540 58606 72591 73152 91730 91783 92782 92866 86744 87320 77766 78073 121938 122370 52602 52652 118448 118625 85118 85182 68525 69087 66414 66542 109470 109777 73345 73401 62677 62761 110273 110400 1123...
output:
yes
result:
ok single line: 'yes'
Test #75:
score: 0
Accepted
time: 1ms
memory: 3720kb
input:
1000 5 11791 11924 10413 10435 6713 6725 5994 5999 5109 5189 9921 10053 11654 11659 6796 6958 8062 8073 11909 11931 11998 12017 10418 10549 8819 8857 9064 9086 9014 9065 6344 6477 11155 11160 10506 10581 7396 7463 9279 9418 11271 11418 11525 11534 10034 10041 11352 11513 7655 7667 9360 9428 9478 960...
output:
no
result:
ok single line: 'no'
Test #76:
score: 0
Accepted
time: 2ms
memory: 3672kb
input:
1000 5 11791 11926 10413 10436 6713 6725 5994 5999 5108 5191 9921 10053 11653 11659 6795 6958 8062 8074 11909 11932 11998 12017 10418 10550 8818 8857 9064 9087 9014 9065 6344 6477 11154 11160 10506 10581 7396 7463 9279 9418 11271 11418 11523 11534 10034 10043 11351 11514 7655 7667 9360 9428 9477 960...
output:
yes
result:
ok single line: 'yes'
Test #77:
score: 0
Accepted
time: 1ms
memory: 3652kb
input:
1000 5 11791 11924 10413 10435 6713 6725 5994 5999 5109 5189 9921 10053 11654 11659 6796 6958 8062 8073 11909 11931 11998 12017 10418 10549 8819 8857 9064 9086 9014 9065 6344 6477 11155 11160 10506 10581 7396 7463 9279 9418 11271 11418 11525 11534 10034 10041 11352 11513 7655 7667 9360 9428 9478 960...
output:
yes
result:
ok single line: 'yes'
Test #78:
score: 0
Accepted
time: 10ms
memory: 4920kb
input:
10000 100 1777459 1777590 2334722 2334867 2067706 2067834 2323226 2329467 1867290 1867658 1204711 1204818 1642513 1642644 1407837 1408013 1928337 1930610 1189059 1189671 2409463 2411610 2329617 2333827 2482384 2482547 1807885 1809135 2031327 2031681 1875095 1875260 1980750 1980911 2298696 2302887 19...
output:
no
result:
ok single line: 'no'
Test #79:
score: 0
Accepted
time: 13ms
memory: 4888kb
input:
10000 100 1777458 1777592 2334721 2334867 2067703 2067834 2323225 2329467 1867288 1867658 1204711 1204818 1642512 1642644 1407835 1408013 1928337 1930611 1189059 1189673 2409463 2411610 2329617 2333827 2482384 2482548 1807885 1809135 2031326 2031681 1875095 1875261 1980748 1980912 2298693 2302889 19...
output:
yes
result:
ok single line: 'yes'
Test #80:
score: 0
Accepted
time: 10ms
memory: 4996kb
input:
10000 100 1777459 1777590 2334722 2334867 2067706 2067834 2323226 2329467 1867290 1867658 1204711 1204818 1642513 1642644 1407837 1408013 1928337 1930610 1189059 1189671 2409463 2411610 2329617 2333827 2482384 2482547 1807885 1809135 2031327 2031681 1875095 1875260 1980750 1980911 2298696 2302887 19...
output:
yes
result:
ok single line: 'yes'
Test #81:
score: 0
Accepted
time: 536ms
memory: 4684kb
input:
9804 10 1 146 0 68 1 30 10 20 39 68 48 58 77 145 78 107 88 98 116 145 125 135 147 292 146 214 147 176 156 166 185 214 194 204 223 291 224 253 233 243 262 291 272 282 293 438 292 360 293 322 302 312 331 360 340 350 369 437 370 399 379 389 408 437 417 427 439 584 438 506 439 468 448 458 477 506 486 49...
output:
no
result:
ok single line: 'no'
Test #82:
score: 0
Accepted
time: 543ms
memory: 4756kb
input:
9803 10 1 146 0 68 1 30 10 20 39 68 48 58 77 145 78 107 88 98 116 145 125 135 147 292 146 214 147 176 156 166 185 214 194 204 223 291 224 253 233 243 262 291 272 282 293 438 292 360 293 322 302 312 331 360 340 350 369 437 370 399 379 389 408 437 417 427 439 584 438 506 439 468 448 458 477 506 486 49...
output:
yes
result:
ok single line: 'yes'
Test #83:
score: 0
Accepted
time: 548ms
memory: 4664kb
input:
9790 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 87 97 116 145 126 136 147 292 146 214 147 176 157 167 185 214 195 205 223 291 224 253 233 243 262 291 272 282 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 379 389 408 437 417 427 439 584 438 506 439 468 448 458 477 506 487 49...
output:
no
result:
ok single line: 'no'
Test #84:
score: 0
Accepted
time: 542ms
memory: 4732kb
input:
9789 10 1 146 0 68 1 30 11 21 39 68 49 59 77 145 78 107 87 97 116 145 126 136 147 292 146 214 147 176 157 167 185 214 195 205 223 291 224 253 233 243 262 291 272 282 293 438 292 360 293 322 302 312 331 360 341 351 369 437 370 399 379 389 408 437 417 427 439 584 438 506 439 468 448 458 477 506 487 49...
output:
yes
result:
ok single line: 'yes'
Test #85:
score: 0
Accepted
time: 546ms
memory: 4748kb
input:
9799 10 1 146 0 68 1 30 10 20 39 68 49 59 77 145 78 107 88 98 116 145 126 136 147 292 146 214 147 176 157 167 185 214 195 205 223 291 224 253 234 244 262 291 272 282 293 438 292 360 293 322 303 313 331 360 340 350 369 437 370 399 380 390 408 437 418 428 439 584 438 506 439 468 448 458 477 506 486 49...
output:
no
result:
ok single line: 'no'
Test #86:
score: 0
Accepted
time: 543ms
memory: 4680kb
input:
9798 10 1 146 0 68 1 30 10 20 39 68 49 59 77 145 78 107 88 98 116 145 126 136 147 292 146 214 147 176 157 167 185 214 195 205 223 291 224 253 234 244 262 291 272 282 293 438 292 360 293 322 303 313 331 360 340 350 369 437 370 399 380 390 408 437 418 428 439 584 438 506 439 468 448 458 477 506 486 49...
output:
yes
result:
ok single line: 'yes'