QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#684614#8934. Challenge NPCreal_sigma_team#AC ✓21ms9044kbC++23768b2024-10-28 14:46:392024-10-28 14:46:41

Judging History

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

  • [2024-10-28 14:46:41]
  • 评测
  • 测评结果:AC
  • 用时:21ms
  • 内存:9044kb
  • [2024-10-28 14:46:39]
  • 提交

answer

#include<bits/stdc++.h>

using namespace std;

typedef long long ll;

int main() {
	// std::cin.tie(nullptr)->sync_with_stdio(false);

	ll k;
	cin >> k;
	vector<ll> lst, lst2;
	ll nxt = 2;
	vector<pair<ll, ll>> all;
	lst.push_back(1);
	for (ll i = 0; i <= k; i++) {
		for (ll j = 0; j + 1 < lst.size(); j++) {
			all.emplace_back(lst[j], nxt);
		}
		all.emplace_back(nxt, nxt + 1);
		lst2.push_back(nxt);
		nxt++;
		for (ll j = 0; j + 1 < lst2.size(); j++) {
			all.emplace_back(lst2[j], nxt);
		}
		lst.push_back(nxt);
		nxt++;
	}
	cout << nxt - 1 << ' ' << all.size() << ' ' << 2 << '\n';
	for (ll i = 1; i < nxt; i++) {
		cout << i % 2 + 1 << ' ';
	}
	cout << '\n';
	for (auto[a, b] : all) {
		cout << a << ' ' << b << '\n';
	}
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3588kb

input:

1

output:

5 4 2
2 1 2 1 2 
2 3
1 4
4 5
2 5

result:

ok ok

Test #2:

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

input:

2

output:

7 9 2
2 1 2 1 2 1 2 
2 3
1 4
4 5
2 5
1 6
3 6
6 7
2 7
4 7

result:

ok ok

Test #3:

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

input:

3

output:

9 16 2
2 1 2 1 2 1 2 1 2 
2 3
1 4
4 5
2 5
1 6
3 6
6 7
2 7
4 7
1 8
3 8
5 8
8 9
2 9
4 9
6 9

result:

ok ok

Test #4:

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

input:

4

output:

11 25 2
2 1 2 1 2 1 2 1 2 1 2 
2 3
1 4
4 5
2 5
1 6
3 6
6 7
2 7
4 7
1 8
3 8
5 8
8 9
2 9
4 9
6 9
1 10
3 10
5 10
7 10
10 11
2 11
4 11
6 11
8 11

result:

ok ok

Test #5:

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

input:

5

output:

13 36 2
2 1 2 1 2 1 2 1 2 1 2 1 2 
2 3
1 4
4 5
2 5
1 6
3 6
6 7
2 7
4 7
1 8
3 8
5 8
8 9
2 9
4 9
6 9
1 10
3 10
5 10
7 10
10 11
2 11
4 11
6 11
8 11
1 12
3 12
5 12
7 12
9 12
12 13
2 13
4 13
6 13
8 13
10 13

result:

ok ok

Test #6:

score: 0
Accepted
time: 12ms
memory: 8356kb

input:

433

output:

869 188356 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1...

result:

ok ok

Test #7:

score: 0
Accepted
time: 21ms
memory: 8092kb

input:

500

output:

1003 251001 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...

result:

ok ok

Test #8:

score: 0
Accepted
time: 21ms
memory: 7588kb

input:

499

output:

1001 250000 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 ...

result:

ok ok

Test #9:

score: 0
Accepted
time: 14ms
memory: 9044kb

input:

457

output:

917 209764 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1...

result:

ok ok

Test #10:

score: 0
Accepted
time: 21ms
memory: 8784kb

input:

497

output:

997 248004 2
2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1 2 1...

result:

ok ok

Extra Test:

score: 0
Extra Test Passed