QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#426489#6320. Parallel Processing (Hard)Kevin5307AC ✓2ms3896kbC++231.9kb2024-05-31 12:42:132024-05-31 12:42:15

Judging History

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

  • [2024-05-31 12:42:15]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3896kb
  • [2024-05-31 12:42:13]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
int main()
{
	int id,n;
	cin>>n;
	int s=(int)(ceil(0.4*(n-1)));
	cout<<s<<endl;
	vector<array<int,3>> vec;
	auto print=[&](int a,int b,int c=-1)
	{
		if(c==-1) c=b;
		vec.push_back({c,a,b});
	};
	for(int i=1;i<n;i+=10)
	{
		if(n==5||n==6||n==7||n==8)
		{
			print(i,i+1,i+1);
			print(i+2,i+3,i+3);
			print(i+4,i+5,i+5);
			print(i+6,i+7,i+7);
			print(i+1,i+2,i+2);
			print(i+1,i+3,i+3);
			print(i+5,i+6,i+6);
			print(i+5,i+7,i+7);
			print(i+3,i+4,i+4);
			print(i+3,i+5,i+5);
			print(i+3,i+6,i+6);
			print(i+3,i+7,i+7);
			break;
		}
		if(n==i+7)
		{
			print(i,i+1,i+1);
			print(i+2,i+3,i+3);
			print(i+4,i+5,i+5);
			print(i+6,i+7,i+7);
			print(i+1,i+2,i+2);
			print(i+1,i+3,i+3);
			print(i+5,i+6,i+6);
			print(i+5,i+7,i+7);
			print(i+3,i+4,i+4);
			print(i+3,i+5,i+5);
			print(i+3,i+6,i+6);
			print(i+3,i+7,i+7);
			break;
		}
		if(n==i+14||n==i+15)
		{
			print(i,i+1);
			print(i+2,i+3);
			print(i+4,i+5);
			print(i+6,i+7);
			print(i+1,i+2);
			print(i+1,i+3);
			print(i+5,i+7);
			print(i+8,i+9);
			print(i+3,i+4);
			print(i+3,i+5);
			print(i+3,i+7);
			print(i+9,i+10);
			print(i+5,i+6);
			print(i+7,i+10);
			print(i+11,i+12);
			print(i+13,i+14);
			print(i+7,i+8);
			print(i+7,i+9);
			print(i+10,i+12);
			print(i+14,i+15);
			print(i+10,i+11);
			print(i+12,i+13);
			print(i+12,i+14);
			print(i+12,i+15);
			break;
		}
		print(i,i+1,i+1);
		print(i+2,i+3,i+3);
		print(i+4,i+5,i+5);
		print(i+7,i+8,i+8);
		print(i+1,i+2,i+2);
		print(i+1,i+3,i+3);
		print(i+5,i+6,i+6);
		print(i+8,i+9,i+9);
		print(i+3,i+4,i+4);
		print(i+3,i+5,i+5);
		print(i+3,i+6,i+6);
		print(i+9,i+10,i+10);
		print(i+6,i+7,i+7);
		print(i+6,i+8,i+8);
		print(i+6,i+9,i+9);
		print(i+6,i+10,i+10);
	}
	for(int i=0;i<s*4;i++)
		cout<<vec[i][0]<<" "<<vec[i][1]<<" "<<vec[i][2]<<endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

17

output:

7
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21

result:

ok AC

Test #2:

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

input:

18

output:

7
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
18 17 18
13 12 13
14 12 14
17 16 17
18 16 18
15 14 15
16 14 16
17 14 17
18 14 18

result:

ok AC

Test #3:

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

input:

19

output:

8
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21

result:

ok AC

Test #4:

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

input:

20

output:

8
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21

result:

ok AC

Test #5:

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

input:

21

output:

8
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21

result:

ok AC

Test #6:

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

input:

120

output:

48
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24 ...

result:

ok AC

Test #7:

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

input:

421

output:

168
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24...

result:

ok AC

Test #8:

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

input:

464

output:

186
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24...

result:

ok AC

Test #9:

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

input:

812

output:

325
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24...

result:

ok AC

Test #10:

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

input:

862

output:

345
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24...

result:

ok AC

Test #11:

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

input:

996

output:

398
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24...

result:

ok AC

Test #12:

score: 0
Accepted
time: 2ms
memory: 3652kb

input:

997

output:

399
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24...

result:

ok AC

Test #13:

score: 0
Accepted
time: 2ms
memory: 3660kb

input:

998

output:

399
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24...

result:

ok AC

Test #14:

score: 0
Accepted
time: 2ms
memory: 3688kb

input:

999

output:

400
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24...

result:

ok AC

Test #15:

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

input:

1000

output:

400
2 1 2
4 3 4
6 5 6
9 8 9
3 2 3
4 2 4
7 6 7
10 9 10
5 4 5
6 4 6
7 4 7
11 10 11
8 7 8
9 7 9
10 7 10
11 7 11
12 11 12
14 13 14
16 15 16
19 18 19
13 12 13
14 12 14
17 16 17
20 19 20
15 14 15
16 14 16
17 14 17
21 20 21
18 17 18
19 17 19
20 17 20
21 17 21
22 21 22
24 23 24
26 25 26
29 28 29
23 22 23
24...

result:

ok AC