제출 #1364152

#제출 시각아이디문제언어결과실행 시간메모리
1364152Mamikonm1Data Transfer (IOI19_transfer)C++20
0 / 100
2 ms1724 KiB
#include "transfer.h"
#include <iostream>
#include <vector>
#include <cmath>
#include<map>
#include <algorithm>
#include <iomanip>
#include <string>
#include<stack>
#include <set>
#include <queue>
#include <chrono>
#include<array>
#include<bitset>
#include<unordered_map>
#include<random>
#include<cassert>
#include<cstring>
using namespace std;
using ll = long long;
using db = double;
const float pi = 3.14159265359;
#define V vector
#define VI V<int>
#define P pair<int,int>
#define rep(i, a, b, step) for (int i = int(a); i <= int(b); i += step)
#define repl(i,a,b,step) for (int i = int(a); i >= int(b); i -= step)
#define prime(n) [](int x) { for (int i = 2; i *1ll* i <= x; ++i) if (x % i == 0) return false; return x > 1; }(n)
#define printall(container, ch) for (const auto& elem : container) { std::cout << elem << ch; } std::cout << std::endl;
#define sn << '\n'
#define ed << endl
#define sz size()
#define print cout <<
#define debug(x) cerr<< #x << " = " << x sn;
#define mpII map<int,int>   
#define mine min_element    
#define maxe max_element    
#define all(v) begin(v), end(v)
#define txt freopen("snakes.in", "r", stdin); freopen("snakes.out", "w", stdout)    
#define pb push_back    
#define pq priority_queue
#define rev reverse
#define nuyn(a) a.erase(unique(all(a)), end(a))
#define nx next_permutation         
#define pk pop_back()
#define START print "Start" sn
#define END print "End" sn
#define ff first
#define ss second       
#define ts to_string 
#define ub upper_bound       
#define mk make_pair 
#define lb lower_bound               
#define testcase int t;cin>>t;while(t--)solution();
std::vector<int> get_attachment(std::vector<int> sour) {
	int n = sour.sz, x = 0, cnt = 0, mx;
	VI ret;
	if (n == 63)mx = 6;
	else mx = 8;
	rep(i, 0, n - 1, 1)if (sour[i])
		x ^= i;
	rep(i, 0, mx - 1, 1)ret.pb((x & (1 << i)) ? 1 : 0);
	cnt = count(all(ret), 1) % 2;
	ret.pb(cnt);
	//debug("ret");
//	printall(ret, ' ');
	return ret;
}
	
std::vector<int> retrieve(std::vector<int> data) {
	int n = data.sz, x = 0, mx, xr = 0, cnt = 0;
	if (n <= 100)n = 63, mx = 6;
	else n = 255, mx = 8;
	VI ans(n);
	rep(i, n, n + mx, 1)if (data[i])
		x |= (1 << (i - n));
	rep(i, 0, mx - 1, 1)if (x & (1 << i))
		cnt ^= 1;
	rep(i, 0, n - 1, 1)ans[i] = data[i];
	if (cnt == data.back()) {
		rep(i, 0, n - 1, 1)if (data[i])
			xr ^= i;
		//	debug(x);
		ans[xr ^ x] ^= 1;
	}
	return ans;
}

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

grader.cpp: In instantiation of 'void shuffle(std::vector<T>&) [with T = Scenario]':
grader.cpp:200:10:   required from here
grader.cpp:28:23: warning: 'void std::random_shuffle(_RAIter, _RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<Scenario*, vector<Scenario> >]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   28 |         random_shuffle(v.begin(), v.end());
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/algorithm:61,
                 from grader.cpp:8:
/usr/include/c++/13/bits/stl_algo.h:4581:5: note: declared here
 4581 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last)
      |     ^~~~~~~~~~~~~~
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…