QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#135087#6641. XOR DiceOrange_JuiCE#AC ✓2ms3900kbC++171.4kb2023-08-05 11:19:352023-08-05 11:19:40

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-08-05 11:19:40]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3900kb
  • [2023-08-05 11:19:35]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;
#define IOS ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr)
#define rep(a, b, c) for(int (a)=(b);(a)<=(c);(a)++)
#define per(a, b, c) for(int (a)=(b);(a)>=(c);(a)--)
#define mset(var, val) memset(var,val,sizeof(var))
#define ll long long
#define int ll
#define fi first
#define se second
#define no "NO\n"
#define yes "YES\n"
#define pb push_back
#define endl "\n"
#define pii pair<int,int>
#define pll pair<ll,ll>
#define dbg(x...) do{cout<<#x<<" -> ";err(x);}while (0)

void err() { cout << '\n'; }

template<class T, class... Ts>
void err(T arg, Ts... args) {
    cout << arg << ' ';
    err(args...);
}

const int N = 2e5 + 5;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int P = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1.0);

int n, d, l, g, a[10];

int get(int x) {
    int cnt=0;
    while(x) {
        x>>=1, cnt++;
    }
    return cnt;
}

void solve() {
    cin >> n >> d;
    l = get(d), g = (1<<l);
    a[0] = 0;
    a[1] = d;
    a[2] = d*g;
    a[3] = a[2]+d;
    a[4] = d*g*g;
    a[5] = a[4]+d;
    for(int i = 1; i <= n; i++) {
        for(int j=0;j<6;j++) printf("%d ", a[j]);
        printf("\n");
    }
}

signed main() {
    IOS;
    int T = 1;
    // cin >> T;
    while (T--) {
        solve();
    }
    return 0;
}

详细

Test #1:

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

input:

3 2

output:

0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 

result:

ok Correct answer

Test #2:

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

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: 2ms
memory: 3684kb

input:

99 2

output:

0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 34 
0 2 8 10 32 ...

result:

ok Correct answer

Test #4:

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

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: 1ms
memory: 3568kb

input:

93 17

output:

0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 17408 17425 
0 17 544 561 1...

result:

ok Correct answer

Test #6:

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

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: 1ms
memory: 3844kb

input:

100 5

output:

0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 325 
0 5 40 45 320 3...

result:

ok Correct answer

Test #8:

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

input:

1 57

output:

0 57 3648 3705 233472 233529 

result:

ok Correct answer

Test #9:

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

input:

1 22

output:

0 22 704 726 22528 22550 

result:

ok Correct answer

Test #10:

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

input:

1 60

output:

0 60 3840 3900 245760 245820 

result:

ok Correct answer

Test #11:

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

input:

1 2

output:

0 2 8 10 32 34 

result:

ok Correct answer

Test #12:

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

input:

10 24

output:

0 24 768 792 24576 24600 
0 24 768 792 24576 24600 
0 24 768 792 24576 24600 
0 24 768 792 24576 24600 
0 24 768 792 24576 24600 
0 24 768 792 24576 24600 
0 24 768 792 24576 24600 
0 24 768 792 24576 24600 
0 24 768 792 24576 24600 
0 24 768 792 24576 24600 

result:

ok Correct answer