Codeforce 补题 Good Bye 2019 C

http://codeforces.com/contest/1270

Good Bye 2019 C 
#include <stdio.h>
#include <math.h>
#include <string.h>
 typedef long long ll;
int n;
 
void test()
{
    scanf("%d", &n);
    ll s=0;
    ll x=0;
    for (int i=1; i<=n; i++)
    {
        ll p;
        scanf("%lld", &p);
        s+=p;
        x^=p;
    }
    printf("2\n%lld %lld\n", (x), (s+x));
}
 
int main()
{
    int t;
    scanf("%d", &t);
    while(t--)
        test();
    return 0;
}

发布了289 篇原创文章 · 获赞 112 · 访问量 2万+

猜你喜欢

转载自blog.csdn.net/king9666/article/details/103812916
今日推荐