记录编号 598557 评测结果 AAAAAAAAAA
题目名称 异或加密 最终得分 100
用户昵称 GravatarIMZ 是否通过 通过
代码语言 C++ 运行时间 1.096 s
提交时间 2025-01-25 16:30:34 内存使用 6.12 MiB
显示代码纯文本
#include <bits/stdc++.h>
using namespace std;
int a[1000010],b[1000010];
int main(){
    freopen("XORcipher.in","r",stdin);
    freopen("XORcipher.out","w",stdout);
    int n;
    scanf("%d",&n);
    int ret;
    for(int i=1;i<=n;i++){
        scanf("%d",&a[i]);
        if(i==1){
            ret=a[i];
            continue;
        }
        ret=a[i]^ret; 
    }
    for(int i=1;i<=n;i++){
        scanf("%d",&b[i]);
        ret=b[i]^ret;
    }
    cout<<ret;
    return 0;
}