QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#116021#2044. Leaky CryptographyNYCU_gAwr_gurA#100 ✓1ms3384kbC++17674b2023-06-27 23:08:452023-06-27 23:08:48

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-06-27 23:08:48]
  • Judged
  • Verdict: 100
  • Time: 1ms
  • Memory: 3384kb
  • [2023-06-27 23:08:45]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;

signed main() {
    int T;
    cin>>T;
    while(T--)
    {
        unsigned int arr[9], sum=0, ans=0;

        for(int i=0;i<9;i++)
        {
            cin>>hex>>arr[i];
            if(i<8)
                sum+=arr[i];
        }
        for(int i=0;i<32;i++)
        {
            if((((sum^arr[8])>>i)&1)^1)
                continue;
            arr[8]^=1<<i;
            ans^=1<<i;
            for(int j=0;j<8;j++)
            {
                if((arr[j]>>i)&1)
                    sum-=1<<i;
                else
                    sum+=1<<i;
            }
        }
        cout<<hex<<ans<<endl;
    }
    return 0;
}

详细

Test #1:

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

input:

106
1 1 1 1 1 1 1 1 8
3 2 3 2 3 2 3 2 6
3 4 4 7 7 b a 2 2e
e1 13 ce 28 ca 6 ab 46 a6d
b08 49e2 6128 f27 8cf2 bc50 7380 7fe1 723b
4eba eb4 a352 fd14 6ac1 eed1 dd06 bb83 392bc
5a94468a 9d3900b4 7de5df44 31160891 149af012 3901bf31
22493740 a93e7504 61635ba4
82c52036 69805013 d6be61a5 7da393e8 ce68c360 ...

output:

0
2
6
1c6
4924afc7
ffff95c5
1f8dcefe
68832e6a
99dd0764
25b494c6
546991d
bb04afc7
167d95c5
901c4a16
f592a8e5
5fd94b3d
4949929e
e7d39b6b
789a17e4
b8b1a742
a86fa9bc
59fe312
61c4362f
54e81374
47db523
39a6dc18
404b3d28
b55079f0
8924ada3
232bcbf9
87589aa7
33780b46
e1beaeab
f09046c9
a525320a
34b63430
af689...

result:

ok 106 lines