답안 #151058

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
151058 2019-09-01T16:14:47 Z neki Data Transfer (IOI19_transfer) C++14
0 / 100
19 ms 5604 KB
#include "transfer.h"
#include <bits/stdc++.h>
#define loop(i, a, b) for(int i=a;i<b;i++)
using namespace std;
 
vector<int> get_attachment(vector<int> s) {
    int n=s.size();
    vector<int> ans(n+9, 0);
    loop(i, 0, n){
        int t=i;
        loop(j, 0, 8) ans[n+j]^=ans[i]&& (t&1), t>>=1;
    }
    loop(i, n, n+8) ans[n+9]^=ans[i];
    return ans;
}
 
vector<int> retrieve(vector<int> d) {
    int n=d.size()-9, te=0, wr=0, fl=1;
    vector<int> ans, check(8, 0);loop(i, 0, n) ans[i]=d[i];
    loop(i, n, n+8) te^=ans[i];
    if(te!=ans[n+9]) return ans;
    loop(i, 0, n){
        int t=i;
        loop(j, 0, 8) check[j]^=d[i]&& (t&1), t<<=1;
    }
    loop(i, 0, 8) if(check[i]!=ans[n+i]) wr+=(1<<i), fl=0;
    if(fl) return ans;
    ans[wr]=(!ans[wr]);
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 6 ms 1648 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 19 ms 5604 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -