QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#277225#4282. IntervalsPetroTarnavskyi#WA 62ms7844kbC++201.7kb2023-12-06 16:46:122023-12-06 16:46:13

Judging History

你现在查看的是最新测评结果

  • [2023-12-06 16:46:13]
  • 评测
  • 测评结果:WA
  • 用时:62ms
  • 内存:7844kb
  • [2023-12-06 16:46:12]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define RFOR(i, a, b) for(int i = (a) - 1; i >= (b); i--)
#define SZ(a) int(a.size())
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair
#define F first
#define S second

typedef long long LL;
typedef vector<int> VI;
typedef pair<int, int> PII;
typedef double db;

const int L = 1'000'000;

int main()
{
	ios::sync_with_stdio(0); 
	cin.tie(0);
	int n;
	cin >> n;
	vector a(n, VI(n));
	for (VI& ai : a)
		for (int& aij : ai)
			cin >> aij;
	unordered_set<int> unused;
	FOR(i, 0, n)
		unused.insert(i);
	VI can(n), x(n);
	while (!unused.empty())
	{
		int i = *unused.begin();
		can[i] = 1;
		VI vec;
		while (true)
		{
			int j = -1;
			for (int k : unused)
				if (can[k])
					j = k;
			if (j == -1)
				break;
			unused.erase(j);
			if (j != i)
			{
				unordered_map<int, int> mp;
				int cntNonZero = 0;
				for (int k : vec)
				{
					if (a[j][k] != 0)
					{
						mp[x[k] + L - a[j][k]]++;
						mp[x[k] + a[j][k] - L]++;
						cntNonZero++;
					}
				}
				assert(cntNonZero != 0);
				bool ok = false;
				for (auto [cand, cntCand] : mp)
				{
					if (!ok && cntCand == cntNonZero)
					{
						ok = true;
						x[j] = cand;
						for (int k : vec)
						{
							if (max(0, min(x[k], x[j]) + L - max(x[k], x[j])) != a[k][j])
							{
								ok = false;
							}
						}
					}
				}
				if (!ok)
				{
					cout << "No\n";
					return 0;
				}
			}
			vec.PB(j);
			FOR(k, 0, n)
			{
				if (a[j][k] != 0)
					can[k] = 1;
			}
		}
	}
	cout << "Yes\n";
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3536kb

input:

3
1000000 500000 0
500000 1000000 500000
0 500000 1000000

output:

Yes

result:

ok answer is YES

Test #2:

score: 0
Accepted
time: 0ms
memory: 3564kb

input:

3
1000000 500000 500000
500000 1000000 500000
500000 500000 1000000

output:

No

result:

ok answer is NO

Test #3:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

10
1000000 0 0 0 451708 0 0 0 0 0
0 1000000 123857 854215 0 789032 115663 874764 0 0
0 123857 1000000 269642 0 334825 0 249093 0 0
0 854215 269642 1000000 0 934817 0 979451 0 0
451708 0 0 0 1000000 0 0 0 0 0
0 789032 334825 934817 0 1000000 0 914268 0 0
0 115663 0 0 0 0 1000000 0 0 0
0 874764 249093...

output:

Yes

result:

ok answer is YES

Test #4:

score: 0
Accepted
time: 0ms
memory: 3820kb

input:

10
1000000 0 333783 645285 0 0 0 0 91417 0
0 1000000 0 0 0 0 107222 0 0 461671
333783 0 1000000 688498 0 0 0 0 0 0
645285 0 688498 1000000 0 0 0 0 0 0
0 0 0 0 1000000 0 0 0 0 0
0 0 0 0 0 1000000 0 0 0 21662
0 107222 0 0 0 0 1000000 0 0 0
0 0 0 0 0 0 0 1000000 750265 0
91417 0 0 0 0 0 0 750265 100000...

output:

Yes

result:

ok answer is YES

Test #5:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

10
1000000 0 0 0 0 0 0 0 83267 0
0 1000000 0 0 0 0 0 0 0 979288
0 0 1000000 511234 0 0 0 0 0 0
0 0 511234 1000000 0 0 0 0 0 0
0 0 0 0 1000000 0 0 0 853421 0
0 0 0 0 0 1000000 0 592583 0 0
0 0 0 0 0 0 1000000 0 0 0
0 0 0 0 0 592583 0 1000000 0 0
83267 0 0 0 853421 0 0 0 1000000 0
0 979288 0 0 0 0 0 0...

output:

Yes

result:

ok answer is YES

Test #6:

score: 0
Accepted
time: 0ms
memory: 3488kb

input:

10
1000000 0 662921 128153 0 0 0 530784 0 0
0 1000000 0 0 454596 0 90389 0 0 0
662921 0 1000000 0 0 0 0 193705 0 0
128153 0 0 1000000 0 0 0 597369 0 0
0 454596 0 0 1000000 0 635793 0 0 0
0 0 0 0 0 1000000 0 0 0 0
0 90389 0 0 635793 0 1000000 0 0 0
530784 0 193705 597369 0 0 0 1000000 0 0
0 0 0 0 0 0...

output:

Yes

result:

ok answer is YES

Test #7:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

10
1000000 194114 0 372890 0 303429 0 0 0 0
194114 1000000 0 821224 0 0 0 0 0 514397
0 0 1000000 0 399458 0 0 0 0 425383
372890 821224 0 1000000 0 0 0 0 0 335621
0 0 399458 0 1000000 0 0 0 0 0
303429 0 0 0 0 1000000 0 0 0 0
0 0 0 0 0 0 1000000 372945 0 0
0 0 0 0 0 0 372945 1000000 0 0
0 0 0 0 0 0 0 ...

output:

Yes

result:

ok answer is YES

Test #8:

score: 0
Accepted
time: 0ms
memory: 3600kb

input:

10
1000000 0 0 218418 0 0 144052 0 0 0
0 1000000 0 0 0 0 0 953348 0 0
0 0 1000000 0 0 0 844845 0 0 0
218418 0 0 1000000 0 0 0 0 39414 0
0 0 0 0 1000000 0 0 0 91667 0
0 0 0 0 0 1000000 0 0 0 0
144052 0 844845 0 0 0 1000000 0 0 0
0 953348 0 0 0 0 0 1000000 0 466707
0 0 0 39414 91667 0 0 0 1000000 0
0 ...

output:

No

result:

ok answer is NO

Test #9:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

10
1000000 0 822517 0 108497 0 198138 0 0 0
0 1000000 0 295159 0 135120 0 237123 0 0
822517 0 1000000 0 0 0 754233 0 0 514160
0 295159 0 1000000 0 839961 0 0 72400 0
108497 0 0 0 1000000 0 0 713961 0 0
0 135120 0 839961 0 1000000 0 0 232439 0
198138 0 754233 0 0 0 1000000 194654 0 0
0 237123 0 0 713...

output:

No

result:

ok answer is NO

Test #10:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

10
1000000 23577 0 391540 504254 0 165590 0 0 0
23577 1000000 0 632037 284655 313974 857987 0 0 0
0 0 1000000 547423 0 244360 0 0 0 0
391540 632037 547423 1000000 0 0 774050 0 0 0
504254 284655 0 0 1000000 0 0 0 245437 0
0 313974 244360 0 0 1000000 0 0 0 0
165590 857987 0 774050 0 0 1000000 0 0 0
0 ...

output:

No

result:

ok answer is NO

Test #11:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

10
1000000 0 0 0 0 0 0 0 0 0
0 1000000 0 0 548064 0 966074 0 0 702626
0 0 1000000 0 0 0 0 0 790754 0
0 0 0 1000000 0 0 0 135631 0 0
0 548064 0 0 1000000 0 514138 0 0 845438
0 0 0 0 0 1000000 0 0 0 0
0 966074 0 0 514138 0 1000000 0 0 668700
0 0 0 135631 0 0 0 1000000 0 0
0 0 790754 0 0 0 0 0 1000000 ...

output:

Yes

result:

ok answer is YES

Test #12:

score: 0
Accepted
time: 1ms
memory: 3632kb

input:

50
1000000 0 0 0 0 0 0 0 705313 601630 0 0 0 0 0 0 0 0 0 0 221699 0 382296 0 0 0 0 0 0 0 0 0 0 0 0 494153 723823 0 0 926430 0 463234 0 0 89810 0 819025 0 0 31904
0 1000000 0 0 793294 0 0 0 0 0 357689 0 0 0 521632 0 0 0 0 717758 0 0 0 0 0 0 0 157312 0 714587 0 0 0 994646 0 0 0 212828 232466 0 0 0 440...

output:

No

result:

ok answer is NO

Test #13:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

50
1000000 0 0 0 0 698054 0 0 0 451951 0 0 908096 0 0 0 0 0 0 479284 0 0 0 0 0 0 0 0 0 0 0 0 585679 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1000000 0 165584 0 0 0 0 0 0 0 0 0 0 0 19293 0 0 368718 0 0 0 0 0 0 0 0 0 0 0 158049 0 0 0 0 0 0 0 0 0 0 0 0 550716 0 0 0 0 0 0
0 0 1000000 0 0 237035 0 0 0 483138 ...

output:

Yes

result:

ok answer is YES

Test #14:

score: 0
Accepted
time: 0ms
memory: 3628kb

input:

50
1000000 0 0 646213 0 0 0 0 0 0 999707 0 419281 0 0 0 0 0 440419 0 0 181407 0 0 0 0 659369 0 629820 886373 0 64024 0 256513 0 182306 0 0 0 0 0 627011 0 899370 0 0 0 0 0 0
0 1000000 700775 0 0 0 0 0 0 0 0 0 0 0 65916 930248 0 0 0 0 683136 0 0 0 0 0 0 0 0 0 134577 0 0 0 0 0 500799 309674 712583 4855...

output:

No

result:

ok answer is NO

Test #15:

score: 0
Accepted
time: 1ms
memory: 3616kb

input:

50
1000000 703181 0 0 486328 0 0 0 0 0 0 0 0 0 0 0 0 0 10990 93545 651273 878428 0 0 0 0 0 75466 0 0 0 0 0 0 65291 0 0 0 0 0 921501 870717 0 0 682617 656755 0 0 0 0
703181 1000000 0 0 189509 0 0 0 0 0 0 0 0 0 0 0 0 0 0 390364 354454 824753 0 0 0 0 0 0 0 0 0 0 0 0 0 0 148141 0 0 0 624682 573898 24382...

output:

Yes

result:

ok answer is YES

Test #16:

score: 0
Accepted
time: 1ms
memory: 3544kb

input:

50
1000000 0 0 0 0 0 0 86860 416934 0 0 751701 405344 326798 0 629660 0 0 0 0 0 0 713023 0 0 0 54749 0 0 0 0 344293 807623 0 0 0 0 0 741291 0 0 434760 0 0 0 0 788731 348859 658898 0
0 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 180621 0 853155 0 0 0 0 0 0 0 0 0 93009 379038 0 0 0 0 0 0 0 0 0 0...

output:

No

result:

ok answer is NO

Test #17:

score: 0
Accepted
time: 0ms
memory: 3632kb

input:

50
1000000 0 0 0 0 0 0 0 0 0 0 0 861085 0 796899 351383 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1000000 0 0 261151 0 0 887073 0 0 0 0 0 315805 0 0 0 0 0 0 0 0 0 0 0 781970 0 651003 0 290367 822155 874704 0 0 0 0 0 0 0 207704 0 0 0 0 436316 0 0 0 0 0
0 0 1000000 0 0 0 79...

output:

Yes

result:

ok answer is YES

Test #18:

score: 0
Accepted
time: 0ms
memory: 3548kb

input:

50
1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 560293 0 0 0
0 0 1000000 0 0 0 0 0 0 0 0 0 0 797237 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Yes

result:

ok answer is YES

Test #19:

score: 0
Accepted
time: 0ms
memory: 3608kb

input:

50
1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1000000 0 194381 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 698384 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1000000 0 0 0 0 0 0 0 948028 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

No

result:

ok answer is NO

Test #20:

score: 0
Accepted
time: 0ms
memory: 3772kb

input:

50
1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 999068 0 0 0 0 0 0 387746 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Yes

result:

ok answer is YES

Test #21:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

50
1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

No

result:

ok answer is NO

Test #22:

score: 0
Accepted
time: 0ms
memory: 3612kb

input:

50
1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 128067 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1000000 0 0 0 786551 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 187577 0 635342 0 0 0 0 0 0 0 0 0 0 0 0 0 204049 0 0 0 0 0 0 0 0 0
0 0 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

Yes

result:

ok answer is YES

Test #23:

score: 0
Accepted
time: 0ms
memory: 3572kb

input:

100
1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

output:

No

result:

ok answer is NO

Test #24:

score: 0
Accepted
time: 1ms
memory: 3804kb

input:

100
1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 181414 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0...

output:

Yes

result:

ok answer is YES

Test #25:

score: 0
Accepted
time: 46ms
memory: 7532kb

input:

1000
1000000 523088 859457 338422 0 219008 0 0 0 0 0 0 0 434091 0 0 0 192374 0 0 0 0 0 0 0 475366 0 0 0 380666 31983 223567 0 0 234288 0 982859 0 0 0 0 0 220031 0 0 0 953850 0 559605 0 286166 0 0 0 0 0 0 0 0 0 0 0 0 0 179048 324365 0 0 0 0 0 0 0 0 0 917560 0 0 0 0 0 0 0 671156 0 0 0 0 0 0 0 0 591960...

output:

Yes

result:

ok answer is YES

Test #26:

score: 0
Accepted
time: 43ms
memory: 7756kb

input:

1000
1000000 0 819429 0 0 12791 0 0 0 0 0 0 0 0 0 0 0 77508 0 0 0 991954 0 0 221752 0 0 0 0 0 0 0 0 146590 0 0 0 0 0 0 642091 0 0 0 0 0 0 747720 0 0 0 0 0 553583 0 943385 0 0 0 0 0 0 0 0 0 0 0 979119 263822 549871 0 654001 0 0 0 0 543644 0 0 842264 0 767697 0 0 0 0 0 0 0 0 0 0 199590 0 810252 949138...

output:

Yes

result:

ok answer is YES

Test #27:

score: 0
Accepted
time: 37ms
memory: 7820kb

input:

1000
1000000 952377 0 0 0 0 0 0 0 322746 0 0 0 0 0 0 0 675841 0 0 0 0 0 666600 0 248941 0 0 0 0 0 0 0 0 865524 0 692229 0 0 0 127694 0 0 0 0 396844 788486 477464 0 0 738648 0 0 0 0 479092 0 0 0 0 253587 0 0 0 0 0 314789 0 0 0 0 0 0 0 0 0 0 0 0 160610 0 0 0 0 778853 0 845566 0 875415 0 0 0 532998 0 8...

output:

No

result:

ok answer is NO

Test #28:

score: 0
Accepted
time: 40ms
memory: 7620kb

input:

1000
1000000 941027 0 0 0 0 0 0 0 0 500828 0 0 0 0 0 0 0 0 0 0 557974 0 0 0 0 183615 0 994774 663237 0 0 818030 0 533020 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 290433 0 316138 0 0 0 0 0 0 0 0 0 0 239489 0 0 0 0 0 0 0 311386 262324 207621 889854 0 629306 337081 546698 0 0 0 496526 0 824160 0 9...

output:

No

result:

ok answer is NO

Test #29:

score: 0
Accepted
time: 41ms
memory: 7828kb

input:

1000
1000000 0 0 0 0 0 0 0 948678 416590 0 0 0 0 0 0 30385 90444 0 0 0 738574 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 924011 0 0 0 741559 0 619646 0 0 117923 0 332882 0 0 0 0 903938 0 244723 0 0 0 0 0 0 538772 0 553680 0 0 0 0 980784 0 0 0 0 0 739865 546971 88565 0 0 0 0 0 225737 984575 431615 0 0 844693 0 72...

output:

No

result:

ok answer is NO

Test #30:

score: 0
Accepted
time: 43ms
memory: 7556kb

input:

1000
1000000 0 927348 0 0 0 0 0 297068 0 531467 0 0 0 522948 0 0 479316 0 83783 0 0 0 0 588653 0 0 653998 0 0 0 0 0 0 0 0 960188 0 853537 0 0 302934 0 0 0 0 317317 0 0 0 953053 0 287548 0 0 0 0 0 0 28979 0 0 823377 0 0 977153 890034 0 63500 749593 0 0 0 0 816251 0 0 620104 0 130562 531 0 154643 0 12...

output:

Yes

result:

ok answer is YES

Test #31:

score: 0
Accepted
time: 47ms
memory: 7540kb

input:

1000
1000000 624819 0 0 0 0 0 0 0 0 0 646932 0 0 695099 0 0 0 0 0 0 488466 886886 0 567805 0 0 0 0 0 0 0 0 0 784133 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 604608 564028 0 0 0 0 180797 0 0 735250 0 0 0 0 822772 0 971987 0 0 0 0 0 0 0 0 0 885508 0 201866 0 0 0 0 0 0 0 0 0 0 0 864844 0 0 0 0 0 0 0 0 0 0 0...

output:

Yes

result:

ok answer is YES

Test #32:

score: 0
Accepted
time: 38ms
memory: 7520kb

input:

1000
1000000 0 0 0 0 0 0 0 42797 0 0 0 0 112905 22063 608475 0 0 0 0 0 0 27145 0 222520 0 0 0 164905 0 863508 0 0 636155 0 0 0 0 0 0 0 0 0 0 462425 50084 747956 0 0 0 0 0 0 0 0 0 0 850271 0 0 0 0 0 557116 0 642302 801066 0 340584 0 0 0 0 0 475987 0 0 0 741981 0 0 0 0 0 938357 0 0 0 0 918206 122867 0...

output:

No

result:

ok answer is NO

Test #33:

score: 0
Accepted
time: 38ms
memory: 7844kb

input:

1000
1000000 0 0 0 0 688321 0 0 0 0 0 950446 0 0 0 465350 0 0 0 0 0 0 0 0 0 110243 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 184060 0 0 0 0 379463 0 0 0 0 0 818199 0 0 0 0 0 0 773378 0 0 985660 0 395075 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 322337 0 0 0 0 0 0 0 0 893702 0 510507 0 0 0 0 670537 0 0 0 72836 0 0 0 457...

output:

No

result:

ok answer is NO

Test #34:

score: 0
Accepted
time: 47ms
memory: 7540kb

input:

1000
1000000 0 0 233780 0 0 302550 0 0 0 0 0 0 598873 0 0 128746 0 293395 0 0 0 0 0 0 224187 0 0 0 0 0 4275 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 462013 0 0 0 0 0 0 0 832954 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 665995 0 840913 0 17018 0 0 0 0 826039 0 278394 0 0 0 0 0 0 0 701866 0 269947 ...

output:

Yes

result:

ok answer is YES

Test #35:

score: 0
Accepted
time: 39ms
memory: 7532kb

input:

1000
1000000 0 0 0 0 0 0 260914 0 0 88054 0 0 0 0 0 0 0 0 0 0 0 0 0 638927 0 0 0 0 0 0 510690 0 0 0 344947 0 0 0 0 0 0 0 0 0 0 721650 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 945503 0 974253 0 0 0 494825 174349 0 281075 651818 0 0 399440 0 29368 0 535654 0 0 268040 0 0 0 172574 0 0 0 0 940025 789983 0 0 ...

output:

No

result:

ok answer is NO

Test #36:

score: 0
Accepted
time: 48ms
memory: 7752kb

input:

1000
1000000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 514068 0 269931 0 0 0 682898 0 0 0 0 0 633282 0 0 0 0 0 0 0 0 0 0 0 0 0 942499 82146 519449 0 0 0 0 0 0 0 312587 0 700806 0 0 0 615254 0 0 0 0 0 371181 0 0 0 0 394954 0 0 724323 0 831603 0 0 0 369347 901984 0 0 951789 0 0 0 0 0 0 0 0 0 0 674120 0 0 ...

output:

Yes

result:

ok answer is YES

Test #37:

score: 0
Accepted
time: 35ms
memory: 7600kb

input:

1000
1000000 0 0 0 0 718352 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 689359 0 0 0 0 0 0 0 0 0 0 0 0 0 902252 871281 0 0 0 0 0 0 0 0 0 100715 941429 0 0 0 0 0 0 0 0 0 270407 512642 0 867587 0 0 0 0 0 474190 0 675255 0 397267 0 0 0 0 0 0 0 0 472994 0 0 0 605403 0 0 0 821581 0 0 0 0 0 274286 0 0 400403 ...

output:

No

result:

ok answer is NO

Test #38:

score: 0
Accepted
time: 62ms
memory: 7792kb

input:

1000
1000000 0 0 356191 27863 609825 0 572958 0 0 0 153423 0 962002 0 342353 107000 844669 0 865334 0 0 0 0 0 0 0 225646 221057 0 0 750790 0 0 0 545226 0 337019 0 0 864324 0 0 0 499460 219648 0 88449 0 969701 0 0 0 0 0 0 518241 400495 619352 58524 263536 0 0 0 905505 0 0 0 459429 0 0 0 700211 658436...

output:

Yes

result:

ok answer is YES

Test #39:

score: 0
Accepted
time: 48ms
memory: 7556kb

input:

1000
1000000 0 50257 842303 0 138743 898371 869344 674695 29430 0 955885 0 882260 0 972126 207268 920879 736762 0 0 0 0 0 436898 0 466166 0 0 298088 0 315156 0 243934 0 452736 552342 54488 0 0 456476 0 0 0 0 0 0 0 432996 0 0 0 0 0 0 0 614643 0 0 0 0 0 928874 0 0 571714 0 0 826484 731314 0 0 0 0 0 49...

output:

No

result:

ok answer is NO

Test #40:

score: 0
Accepted
time: 31ms
memory: 7620kb

input:

1000
1000000 0 0 0 0 0 915348 0 597101 0 0 993023 38016 530857 0 0 429483 64748 0 0 26316 0 0 0 0 0 257525 993506 0 0 40045 0 0 0 0 459166 812234 0 0 387481 0 0 902830 234032 0 0 0 138558 0 810532 0 271665 891093 0 0 565222 0 348565 0 972359 465944 569058 954738 425378 449466 0 0 0 0 0 749826 0 0 97...

output:

No

result:

ok answer is NO

Test #41:

score: 0
Accepted
time: 58ms
memory: 7620kb

input:

1000
1000000 0 0 976733 529009 0 678111 0 921967 0 604065 700899 97120 0 0 0 0 0 848746 459436 0 0 963369 0 0 0 242151 10742 319394 0 0 421068 0 488205 214145 51413 0 0 897027 0 986969 0 0 205105 0 0 761949 0 0 0 0 671025 0 0 0 476040 944282 0 535354 365664 786090 526901 0 0 0 889609 78704 0 0 0 0 7...

output:

Yes

result:

ok answer is YES

Test #42:

score: 0
Accepted
time: 44ms
memory: 7788kb

input:

1000
1000000 0 0 0 887520 0 0 0 0 185476 0 992384 378233 0 981976 0 942999 0 0 0 995192 0 0 805843 757247 522434 0 675606 540990 495638 0 0 0 0 0 185479 997166 0 0 0 0 0 0 0 0 0 0 0 0 260340 0 0 70713 0 0 0 0 720713 0 0 0 0 0 0 0 0 818379 377270 0 0 611663 0 0 0 0 0 0 999665 0 0 0 0 0 0 0 0 448547 9...

output:

No

result:

ok answer is NO

Test #43:

score: 0
Accepted
time: 45ms
memory: 7628kb

input:

1000
1000000 0 0 965575 206101 0 0 0 0 0 703433 0 589857 0 0 0 0 0 0 0 913258 0 727865 475100 0 0 266776 0 885946 909815 0 0 811186 0 0 489719 0 0 0 986341 0 0 445591 0 0 0 0 595570 369301 0 378439 0 0 661677 686552 0 377273 0 0 0 433399 280292 0 642356 0 0 0 0 0 0 677172 0 0 782961 0 0 0 0 0 80473 ...

output:

No

result:

ok answer is NO

Test #44:

score: 0
Accepted
time: 50ms
memory: 7536kb

input:

1000
1000000 0 532796 825997 0 0 0 91746 609646 0 0 370910 0 0 0 42608 881836 0 668766 0 335489 0 0 0 0 723917 0 0 0 0 0 0 24307 0 0 123086 0 0 7225 624253 0 0 9629 0 0 0 987815 544450 0 0 516067 0 0 874259 299635 0 387667 540334 0 601223 0 777997 0 0 0 0 0 0 892585 0 799228 845283 178398 0 821134 1...

output:

No

result:

ok answer is NO

Test #45:

score: -100
Wrong Answer
time: 58ms
memory: 7632kb

input:

1000
1000000 0 0 45136 0 0 466499 0 967144 0 0 0 789698 0 0 0 0 599209 0 0 0 236930 0 0 700508 226308 0 532096 177644 402059 0 0 0 0 0 0 0 596963 0 0 629019 566935 0 738383 0 0 0 29591 0 397576 0 0 429402 0 229305 0 235072 0 0 705608 691964 433693 594766 621512 184541 0 121273 0 0 0 767071 413908 0 ...

output:

No

result:

wrong answer expected YES, found NO