QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#174115#6641. XOR Dicecada_dia_mas_insanos#AC ✓3ms3856kbC++17601b2023-09-10 04:18:382023-09-10 04:18:39

Judging History

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

  • [2023-09-10 04:18:39]
  • 评测
  • 测评结果:AC
  • 用时:3ms
  • 内存:3856kb
  • [2023-09-10 04:18:38]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0);
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif // LOCAL

    int n, k; cin >> n >> k;
    vector <int> a(6);
    a[0] = 0;
    for (int i = 1, x = 1; i< 6; x++) {
        bool ok = 1;
        for (int j=0; j<i; j++) ok &= (x^a[j])%k == 0;
        if (ok) a[i++] = x;
    }
    for (int i=0; i < n; i++) {
        for (int j=0; j<6; j++) cout << a[j] << ' ';
        cout << endl;
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 2

output:

0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 

result:

ok Correct answer

Test #2:

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

input:

100 60

output:

0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 60 960 1020 15360 15420 
0 6...

result:

ok Correct answer

Test #3:

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

input:

99 2

output:

0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 6 8 10 
0 2 4 ...

result:

ok Correct answer

Test #4:

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

input:

99 59

output:

0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 45312 45371 
0 59 708 767 4...

result:

ok Correct answer

Test #5:

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

input:

93 17

output:

0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 68 85 
0 17 34 51 6...

result:

ok Correct answer

Test #6:

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

input:

100 49

output:

0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245 2058 2107 
0 49 196 245...

result:

ok Correct answer

Test #7:

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

input:

100 5

output:

0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 80 85 
0 5 10 15 8...

result:

ok Correct answer

Test #8:

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

input:

1 57

output:

0 57 1026 1083 2052 2109 

result:

ok Correct answer

Test #9:

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

input:

1 22

output:

0 22 264 286 704 726 

result:

ok Correct answer

Test #10:

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

input:

1 60

output:

0 60 960 1020 15360 15420 

result:

ok Correct answer

Test #11:

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

input:

1 2

output:

0 2 4 6 8 10 

result:

ok Correct answer

Test #12:

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

input:

10 24

output:

0 24 96 120 384 408 
0 24 96 120 384 408 
0 24 96 120 384 408 
0 24 96 120 384 408 
0 24 96 120 384 408 
0 24 96 120 384 408 
0 24 96 120 384 408 
0 24 96 120 384 408 
0 24 96 120 384 408 
0 24 96 120 384 408 

result:

ok Correct answer