QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#139598#6641. XOR DiceFzArKAC ✓1ms3632kbC++141.7kb2023-08-14 00:55:402023-08-14 00:55:42

Judging History

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

  • [2023-08-14 00:55:42]
  • 评测
  • 测评结果:AC
  • 用时:1ms
  • 内存:3632kb
  • [2023-08-14 00:55:40]
  • 提交

answer

#include<bits/stdc++.h>
#include <stdio.h>
#include <algorithm>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define sc(x) scanf("%d", &x)
#define scl(x) scanf("%lld", &x)
#define clr(x) vector<int>().swap(x);
#define all(x) x.begin(), x.end()
#define endl '\n'
#define pb push_back
#define pf push_front
#define mp make_pair
#define popb pop_back
#define popf pop_front
#define ll long long
#define ld long double
#define ull unsigned long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define random mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define F first
#define S second
const ll INF=1e18;
const ll MN=-2e9;
const ll MX=2e5+9;
const ll MXX=1e9;
const ll SQ=4e2;
const ll MOD=998244353;
const ll PP=1e6+3;
const ld PI=3.141592653589793;
const ld eps=1e-11;
typedef tree<ll, null_type, less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update>
    ordered_set;

int n, d, x;
vector<int> ans;

void solve() {
    cin >> n >> d;
    for (int i=0; i<6; i++) {
        x = 0;
        for (int k=2; k>=0; k--) {
            x *= 64;
            if (i & (1<<k)) x++;
        }
        x *= d;
        ans.pb(x);
    }
    for (int i=0; i<6; i++) {
        for (int j=i; j<6; j++) {
            assert ((ans[i] ^ ans[j]) % d == 0);
        }
    }
    for (int i=0; i<n; i++) {
        for (auto v:ans) cout << v << " "; cout << endl;
    }
}

int main() {
    FAST;
    int t = 1;
//    cin >> t;
    while (t--) {
        solve();
    }
}

/*



*/

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 2

output:

0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 

result:

ok Correct answer

Test #2:

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

input:

100 60

output:

0 60 3840 3900 245760 245820 
0 60 3840 3900 245760 245820 
0 60 3840 3900 245760 245820 
0 60 3840 3900 245760 245820 
0 60 3840 3900 245760 245820 
0 60 3840 3900 245760 245820 
0 60 3840 3900 245760 245820 
0 60 3840 3900 245760 245820 
0 60 3840 3900 245760 245820 
0 60 3840 3900 245760 245820 
...

result:

ok Correct answer

Test #3:

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

input:

99 2

output:

0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0 2 128 130 8192 8194 
0...

result:

ok Correct answer

Test #4:

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

input:

99 59

output:

0 59 3776 3835 241664 241723 
0 59 3776 3835 241664 241723 
0 59 3776 3835 241664 241723 
0 59 3776 3835 241664 241723 
0 59 3776 3835 241664 241723 
0 59 3776 3835 241664 241723 
0 59 3776 3835 241664 241723 
0 59 3776 3835 241664 241723 
0 59 3776 3835 241664 241723 
0 59 3776 3835 241664 241723 
...

result:

ok Correct answer

Test #5:

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

input:

93 17

output:

0 17 1088 1105 69632 69649 
0 17 1088 1105 69632 69649 
0 17 1088 1105 69632 69649 
0 17 1088 1105 69632 69649 
0 17 1088 1105 69632 69649 
0 17 1088 1105 69632 69649 
0 17 1088 1105 69632 69649 
0 17 1088 1105 69632 69649 
0 17 1088 1105 69632 69649 
0 17 1088 1105 69632 69649 
0 17 1088 1105 69632...

result:

ok Correct answer

Test #6:

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

input:

100 49

output:

0 49 3136 3185 200704 200753 
0 49 3136 3185 200704 200753 
0 49 3136 3185 200704 200753 
0 49 3136 3185 200704 200753 
0 49 3136 3185 200704 200753 
0 49 3136 3185 200704 200753 
0 49 3136 3185 200704 200753 
0 49 3136 3185 200704 200753 
0 49 3136 3185 200704 200753 
0 49 3136 3185 200704 200753 
...

result:

ok Correct answer

Test #7:

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

input:

100 5

output:

0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
0 5 320 325 20480 20485 
...

result:

ok Correct answer

Test #8:

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

input:

1 57

output:

0 57 3648 3705 233472 233529 

result:

ok Correct answer

Test #9:

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

input:

1 22

output:

0 22 1408 1430 90112 90134 

result:

ok Correct answer

Test #10:

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

input:

1 60

output:

0 60 3840 3900 245760 245820 

result:

ok Correct answer

Test #11:

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

input:

1 2

output:

0 2 128 130 8192 8194 

result:

ok Correct answer

Test #12:

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

input:

10 24

output:

0 24 1536 1560 98304 98328 
0 24 1536 1560 98304 98328 
0 24 1536 1560 98304 98328 
0 24 1536 1560 98304 98328 
0 24 1536 1560 98304 98328 
0 24 1536 1560 98304 98328 
0 24 1536 1560 98304 98328 
0 24 1536 1560 98304 98328 
0 24 1536 1560 98304 98328 
0 24 1536 1560 98304 98328 

result:

ok Correct answer