제출 #781991

#제출 시각아이디문제언어결과실행 시간메모리
781991Dan4LifeData Transfer (IOI19_transfer)C++17
0 / 100
4 ms2488 KiB
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define sz(a) (int)a.size()

vi get_attachment(vi v) {
	int x = 0, y = 0, m = sz(v)<99?6:8; vi ans;
	for(int i = 0; i < sz(v); i++) if(v[i]) x^=i+1;
	for(int i = 0; i < m; i++) 
		ans.push_back((x>>i)&1), y^=ans.back();
	ans.push_back(y); return ans;
}

vi retrieve(vi v){
	int x = 0, xx = 0, y = 0, m = sz(v)<99?6:8, n=sz(v)<99?63:255;
	for(int i = 0; i < n; i++) if(v[i]) x^=i+1;
	for(int i = 0; i < m; i++) if(v[n+i]) xx^=1<<i, y^=1;
	if(v.back()==y and x!=xx) v[(x^xx)-1]^=1; return v;
}

컴파일 시 표준 에러 (stderr) 메시지

transfer.cpp: In function 'vi retrieve(vi)':
transfer.cpp:18:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   18 |  if(v.back()==y and x!=xx) v[(x^xx)-1]^=1; return v;
      |  ^~
transfer.cpp:18:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   18 |  if(v.back()==y and x!=xx) v[(x^xx)-1]^=1; return v;
      |                                            ^~~~~~
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…