답안 #1048333

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1048333 2024-08-08T06:50:31 Z TahirAliyev Data Transfer (IOI19_transfer) C++17
80 / 100
60 ms 2940 KB
#include "transfer.h"
#include <bits/stdc++.h>
using namespace std;


vector<int> get_attachment(vector<int> source) {
	int x = 0;
	int n = source.size();
	for(int i = 1; i <= n; i++){
		if(source[i - 1]) x ^= i;
	}
	vector<int> v;
	int l = 0;
	if(n == 63) l = 6;
	else l = 8;
	for(int i = 0; i < l; i++){
		v.push_back(bool(x & (1 << i)));
	}
	for(int i = 0; i < l; i++){
		v.push_back(bool(x & (1 << i)));
	}
	return v;
}

vector<int> retrieve(vector<int> data) {
	int n, l;
	if(data.size() == 63 + 6 + 6) n = 63, l = 6;
	else n = 255, l = 8;
	int x = 0;
	for(int i = 1; i <= n; i++){
		if(data[i - 1]) x ^= i;
	}
	int x1 = 0, x2 = 0;
	for(int i = 0; i < l; i++){
		if(data[n + i]){
			x1 |= (1 << i);
		}
	}
	for(int i = 0; i < l; i++){
		if(data[n + l + i]){
			x2 |= (1 << i);
		}
	}
	if(x1 == x2){
		if(x != x1) data[(x ^ x1) - 1] ^= 1;
	}
	vector<int> v;
	for(int i = 0; i < n; i++) v.push_back(data[i]);
	return v;
}
# 결과 실행 시간 메모리 Grader output
1 Partially correct 1 ms 780 KB Partially correct
2 Partially correct 2 ms 1100 KB Partially correct
3 Partially correct 1 ms 1000 KB Partially correct
4 Partially correct 1 ms 800 KB Partially correct
5 Partially correct 1 ms 788 KB Partially correct
6 Partially correct 2 ms 1016 KB Partially correct
7 Partially correct 2 ms 792 KB Partially correct
8 Partially correct 2 ms 792 KB Partially correct
9 Partially correct 2 ms 800 KB Partially correct
10 Partially correct 2 ms 800 KB Partially correct
11 Partially correct 2 ms 800 KB Partially correct
12 Partially correct 1 ms 800 KB Partially correct
13 Partially correct 1 ms 800 KB Partially correct
14 Partially correct 1 ms 800 KB Partially correct
15 Partially correct 1 ms 800 KB Partially correct
16 Partially correct 2 ms 800 KB Partially correct
17 Partially correct 2 ms 792 KB Partially correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 46 ms 2516 KB Partially correct
2 Partially correct 53 ms 2520 KB Partially correct
3 Partially correct 48 ms 2516 KB Partially correct
4 Partially correct 60 ms 2520 KB Partially correct
5 Partially correct 54 ms 2512 KB Partially correct
6 Partially correct 50 ms 2524 KB Partially correct
7 Partially correct 48 ms 2516 KB Partially correct
8 Partially correct 53 ms 2512 KB Partially correct
9 Partially correct 43 ms 2512 KB Partially correct
10 Partially correct 45 ms 2508 KB Partially correct
11 Partially correct 43 ms 2516 KB Partially correct
12 Partially correct 54 ms 2512 KB Partially correct
13 Partially correct 49 ms 2520 KB Partially correct
14 Partially correct 48 ms 2592 KB Partially correct
15 Partially correct 45 ms 2520 KB Partially correct
16 Partially correct 48 ms 2516 KB Partially correct
17 Partially correct 51 ms 2520 KB Partially correct
18 Partially correct 48 ms 2516 KB Partially correct
19 Partially correct 47 ms 2940 KB Partially correct