Submission #143439

# Submission time Handle Problem Language Result Execution time Memory
143439 2019-08-14T05:22:01 Z model_code Data Transfer (IOI19_transfer) C++17
0 / 100
6 ms 1296 KB
// incorrect/2n_1.cpp

#include "transfer.h"
using namespace std;

//Author: Kian Mirjalali
//K = 2*N+1

typedef vector<int> VI;

VI get_attachment(VI source) {
	const int N = source.size();
	VI attachment = source;
	attachment.insert(attachment.end(), source.begin(), source.end());
	attachment.push_back(0);
	return attachment;
}

VI retrieve(VI data) {
	const int N = (data.size()-1)/3;
	VI result(N, 0);
	for (int i=0; i<N; i++)
		if (data[i]+data[N+i]+data[2*N+i] > 1)
			result[i] = 1;
	return result;
}

Compilation message

transfer.cpp: In function 'VI get_attachment(VI)':
transfer.cpp:12:12: warning: unused variable 'N' [-Wunused-variable]
  const int N = source.size();
            ^
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 1040 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 6 ms 1296 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -