QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#22342#2351. Lost in Transfer1145141919810#0 0ms0kbC++203.0kb2022-03-09 15:40:062023-01-17 09:31:13

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-01-17 09:31:13]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2022-03-09 15:40:06]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef double db;
#define int long long
#define fi first
#define se second
#define mk make_pair
#define pb emplace_back
#define poly vector<int>
#define Bt(a) bitset<a>
#define bc __builtin_popcount
#define pc putchar
#define ci const int&
const int mod = 998244353;
const db eps = 1e-10;
inline int Max(ci x, ci y) {return x > y ? x : y;}
inline int Min(ci x, ci y) {return x < y ? x : y;}
inline db Max(db x, db y) {return x - y > eps ? x : y;}
inline db Min(db x, db y) {return x - y < eps ? x : y;}
inline int Add(ci x, ci y, ci M = mod) {return (x + y) % M;}
inline int Mul(ci x, ci y, ci M = mod) {return 1ll * x * y % M;}
inline int Dec(ci x, ci y, ci M = mod) {return (x - y + M) % M;}
typedef pair<int, int> pii;
inline int Abs(int x) {return x < 0 ? -x : x;}
//char buf[1<<21],*p1=buf,*p2=buf;
//#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<21,stdin),p1==p2)?EOF:*p1++)
char Obuf[105000],*O=Obuf;//Siz shoule be the size of Out File
int pst[30],ptop;
inline void Fprint(){fwrite(Obuf,1,O-Obuf,stdout);}
inline void Fwrite(int x){
  if(x==0){*O++='0';if(O-Obuf>100000)Fprint(),O=Obuf;return;}
  if(x<0)*O++='-',x=-x;ptop=0;
  while(x)pst[++ptop]=x%10,x/=10;
  while(ptop)*O++=pst[ptop--]+'0';
  if(O-Obuf>100000)Fprint(),O=Obuf;
}
inline int read() {
    int s = 0, w = 1;
    char ch = getchar();
    while (!isdigit(ch)) {if (ch == '-') w = -1;ch = getchar();}
    while (isdigit(ch)) {s = s * 10 + ch - '0';ch = getchar();}
    return s * w;
}
inline void write(int x) {
    if (x < 0)putchar('-'), x = -x;
    if (x > 9)write(x / 10);
	pc(x % 10 + '0');
}
inline int qpow(int x, int y) {
    int res = 1;
    while (y) {if (y & 1)res = Mul(res, x);x = Mul(x, x);y >>= 1;}
    return res;
}
inline void cadd(int &x, int y) {x += y;}
inline void cmul(int &x, int y) {x *= y;}
inline void cmax(int &x, int y) {x = Max(x, y);}
inline void cmin(int &x, int y) {x = Min(x, y);}
const int N = 3e5 + 10;
namespace Refined_heart{
	char s[1000];
	int T;
	int b[N],a[N];
	int c[N];
	void transmit(int now){
		int n=read();
		int v=0;
		for(int i=1;i<=n;++i)a[i]=read();
		for(int i=1;i<=n;++i)v^=a[i];
		for(int i=1;i<=n;++i){
			a[i]<<=10;
			a[i]|=v;
		}
		for(int i=1;i<=n;++i)cout<<a[i]<<" ";
		pc('\n');
	}
	void recover(int now){
		int n=read();
		for(int i=1;i<=n;++i)b[i]=read();
		for(int i=1;i<=n;++i){c[i]=b[i]>>10;}
		int v=0;
		for(int i=1;i<=n;++i)v^=c[i];
		int num=b[1]&((1<<10)-1);
		if(num==v){
			sort(c+1,c+n+1);
			for(int i=1;i<=n;++i)cout<<c[i]<<" ";
			pc('\n');
			return;
		}
		int rest=num^v;
		++n;
		c[n]=rest;
		sort(c+1,c+n+1);
		for(int i=1;i<=n;++i)cout<<c[i]<<' ';
		pc('\n');
	}
	void solve(){
		int fg=0;
		cin>>s;
		if(s[0]=='t')fg=1;
		else fg=0;
		T=read();
		for(int i=1;i<=T;++i){
			for(int k=1;k<=1000;++k)a[i]=b[i]=c[i]=0;
			if(fg)transmit(i);
			else recover(i);
		}
	}
}
signed main(){
	Refined_heart::solve();
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer

input:

transmit
2
20 97 388 459 467 32 99 98 296 403 325 330 271 87 333 378 267 405 58 426 374
20 125 481 451 150 495 136 444 192 118 26 68 281 120 61 494 339 86 292 100 32

output:

99455 397439 470143 478335 32895 101503 100479 303231 412799 332927 338047 277631 89215 341119 387199 273535 414847 59519 436351 383103 
128045 492589 461869 153645 506925 139309 454701 196653 120877 26669 69677 287789 122925 62509 505901 347181 88109 299053 102445 32813 

input:


output:


result:

wrong answer The sequence your program outputs on the first run is invalid. (test case 1)