QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#97676#6319. Parallel Processing (Easy)whatever#AC ✓2ms3472kbC++142.0kb2023-04-17 21:17:282023-04-17 21:17:30

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-04-17 21:17:30]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3472kb
  • [2023-04-17 21:17:28]
  • 提交

answer

#include <bits/stdc++.h>
#define int long long
#define mod 998244353
using namespace std;
vector<vector<vector<int> > > ans;
bitset<2005> s[2005];
void op(vector<vector<int> > v)
{
	bitset<2005> A,B,C,D;
	A=(s[v[0][1]]^s[v[0][2]]);
	B=(s[v[1][1]]^s[v[1][2]]);
	C=(s[v[2][1]]^s[v[2][2]]);
	D=(s[v[3][1]]^s[v[3][2]]);
	s[v[0][0]]=A;
	s[v[1][0]]=B;
	s[v[2][0]]=C;
	s[v[3][0]]=D;
	ans.push_back(v);
}
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	for(int i=1;i<=n;i++) s[i][i]=1;
	if(n<=2)
	{
		op({{2,1,2},{2000,2000,2000},{2000,2000,2000},{2000,2000,2000}});
	}
	else if(n<=4)
	{
		op({{2,1,2},{4,3,4},{2000,2000,2000},{2000,2000,2000}});
		op({{3,2,3},{4,2,4},{2000,2000,2000},{2000,2000,2000}});
	}
	else if(n<=8)
	{
		op({{2,1,2},{4,3,4},{6,5,6},{8,7,8}});
		op({{3,2,3},{4,2,4},{7,6,7},{8,6,8}});
		op({{5,4,5},{6,4,6},{7,4,7},{8,4,8}});
	}
	else if(n<=11)
	{
		op({{2,1,2},{4,3,4},{6,5,6},{8,7,8}});
		op({{3,2,3},{4,2,4},{8,6,8},{10,9,10}});
		op({{5,4,5},{6,4,6},{8,4,8},{11,10,11}});
		op({{7,6,7},{9,8,9},{10,8,10},{11,8,11}});
	}
	else if(n<=13)
	{
		op({{2,1,2},{4,3,4},{6,5,6},{8,7,8}});
		op({{3,2,3},{4,2,4},{8,6,8},{10,9,10}});
		op({{5,4,5},{6,4,6},{8,4,8},{11,10,11}});
		op({{7,6,7},{13,12,13},{10,8,10},{11,8,11}});
		op({{12,11,12},{9,8,9},{13,11,13},{2000,2000,2000}});
	}
	else if(n<=16)
	{
		op({{2,1,2},{4,3,4},{6,5,6},{8,7,8}});
		op({{4,2,4},{8,6,8},{12,11,12},{10,9,10}});
		op({{6,4,6},{8,4,8},{14,13,14},{16,15,16}});
		op({{3,2,3},{5,4,5},{10,8,10},{14,12,14}});
		op({{7,6,7},{9,8,9},{12,10,12},{14,10,14}});
		op({{11,10,11},{13,12,13},{15,14,15},{16,14,16}});
	}
	cout << ans.size() << "\n";
	for(auto t:ans)
	{
		for(auto y:t)
		{
			for(auto x:y) cout << x << " ";
			cout << "\n";
		}
	}
/*	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			cout << s[i][j];
		}
		cout << "\n";
	}*/
	return 0;
	for(int i=1;i<=n;i++)
	{
		for(int j=1;j<=n;j++)
		{
			assert(s[i][j]==(j<=i));
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

2

output:

1
2 1 2 
2000 2000 2000 
2000 2000 2000 
2000 2000 2000 

result:

ok AC

Test #2:

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

input:

4

output:

2
2 1 2 
4 3 4 
2000 2000 2000 
2000 2000 2000 
3 2 3 
4 2 4 
2000 2000 2000 
2000 2000 2000 

result:

ok AC

Test #3:

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

input:

3

output:

2
2 1 2 
4 3 4 
2000 2000 2000 
2000 2000 2000 
3 2 3 
4 2 4 
2000 2000 2000 
2000 2000 2000 

result:

ok AC

Test #4:

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

input:

5

output:

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

result:

ok AC

Test #5:

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

input:

6

output:

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

result:

ok AC

Test #6:

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

input:

7

output:

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

result:

ok AC

Test #7:

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

input:

8

output:

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

result:

ok AC

Test #8:

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

input:

9

output:

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

result:

ok AC

Test #9:

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

input:

10

output:

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

result:

ok AC

Test #10:

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

input:

11

output:

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

result:

ok AC

Test #11:

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

input:

12

output:

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

result:

ok AC

Test #12:

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

input:

13

output:

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

result:

ok AC

Test #13:

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

input:

14

output:

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

result:

ok AC

Test #14:

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

input:

15

output:

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

result:

ok AC

Test #15:

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

input:

16

output:

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

result:

ok AC