QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#201151#7333. DominoeskjhhjkiAC ✓1ms3564kbC++20821b2023-10-05 12:43:162023-10-05 12:43:16

Judging History

This is the latest submission verdict.

  • [2023-10-05 12:43:16]
  • Judged
  • Verdict: AC
  • Time: 1ms
  • Memory: 3564kb
  • [2023-10-05 12:43:16]
  • Submitted

answer

#include <bits/stdc++.h>
#define MAXN 100005
#define For(I,A,B) for(int I = (A), endi = (B); I <= endi; ++I)
#define foR(I,A,B) for(int I = (A), endi = (B); I >= endi; --I)
#define ForE(I,A) for(int I = head[A]; I; I = e[I].nxt)
using namespace std;
typedef long long _ll;
typedef unsigned int ui;

int T,n;
void solve()
{
    cin >> n;
    if(n == 1) cout << "1 1 1 2\n";
    if(n == 2) cout << "1 1 1 2\n1 3 1 4\n1 5 1 6\n";
    if(n == 3) cout << "2 1 2 2\n2 3 2 4\n3 3 3 4\n1 4 1 5\n2 5 2 6\n3 5 3 6\n";
    if(n == 4) cout << "1 1 1 2\n1 3 2 3\n1 4 1 5\n2 1 3 1\n2 2 3 2\n2 4 3 4\n3 3 4 3\n2 5 3 5\n4 5 4 4\n4 1 4 2\n";
    if(n > 4) cout << "impossible\n";
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
    cin >> T;
    while(T--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

1
2

output:

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

result:

ok OK!

Test #2:

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

input:

50
888
171
6
7
8
9
10
1000
1
2
3
4
5
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
71
172
516
669
997

output:

impossible
impossible
impossible
impossible
impossible
impossible
impossible
impossible
1 1 1 2
1 1 1 2
1 3 1 4
1 5 1 6
2 1 2 2
2 3 2 4
3 3 3 4
1 4 1 5
2 5 2 6
3 5 3 6
1 1 1 2
1 3 2 3
1 4 1 5
2 1 3 1
2 2 3 2
2 4 3 4
3 3 4 3
2 5 3 5
4 5 4 4
4 1 4 2
impossible
impossible
impossible
impossible
impossib...

result:

ok OK!