QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#135116#6641. XOR Diceqwerty#WA 2ms3544kbC++14727b2023-08-05 11:39:512023-08-05 11:39:51

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:39:51]
  • 评测
  • 测评结果:WA
  • 用时:2ms
  • 内存:3544kb
  • [2023-08-05 11:39:51]
  • 提交

answer

#include <iostream>
#include <unordered_set>
using namespace std;

int main(){
    int n,d;
    cin >> n >> d;
    int temp = d;
    unordered_set<int> s;
    int cnt = 0;
    while(temp!=0){
        if((temp & 1) == 1){
            s.insert(temp);
        }
        temp >>= 1;
        cnt++;
    }
    int ans[6];

    for(int i=0,pow=0;i<6;pow++){
        if(s.find(pow)!=s.end()){
            continue;
        }
        ans[i] = (2<<pow);
        i++;
    }
    for(int i=0;i<6;i++){
        cout << ans[i]+d << " ";
    }
    cout << endl;
    for(int i=1;i<n;i++){
        for(int i=0;i<6;i++){
            cout << ans[i] << " ";
        }
        cout << endl;
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

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

input:

3 2

output:

4 10 18 34 66 130 
2 8 16 32 64 128 
2 8 16 32 64 128 

result:

ok Correct answer

Test #2:

score: -100
Wrong Answer
time: 2ms
memory: 3436kb

input:

100 60

output:

62 68 92 124 188 572 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 128 512 
2 8 32 64 12...

result:

wrong answer Invalid output