Submission #1224033


Source Code Expand

Copy


#if 1
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <array>
#include <deque>
#include <algorithm>
#include <utility>
#include <cstdint>
#include <functional>
#include <iomanip>
#include <numeric>
#include <assert.h>

auto& in = std::cin;
auto& out = std::cout;

int64_t N,L,T;
int64_t POS[100000];
int32_t D[100000];
int64_t POS0; int32_t d0;
std::set<int64_t>
R_DIST, L_DIST;//0がR/L方向に進むとき、0からの距離*2
int64_t R_DIST_bace, L_DIST_bace;
int main()
{
	using std::endl;
	in.sync_with_stdio(false);
	out.sync_with_stdio(false);

	in >> N>>L>>T;
	for (int32_t i = 0; i < N; ++i)
	{
		in >> POS[i] >> D[i];
	}
	
	//POS0 = POS[0]*2;
	//d0 = D[0];
	//for (int32_t i = 1; i < N; ++i)
	//{
	//	if (D[i] == 1) {
	//		L_DIST.insert((L - POS[i])*2);
	//	}
	//	else {
	//		R_DIST.insert(POS[i]*2);
	//	}
	//}
	//int64_t T2=0;
	//for (;;)
	//{
	//	if (d0==1) {
	//		R_DIST.upper_bound(POS0);
	//	}
	//}

	const int a = -5 / 2;


	int32_t beg = 0;
	for (int32_t i = 0; i < N; ++i)
	{
		if (D[i] == 1) {
			POS[i] += T;
			beg+=POS[i]/L;
			POS[i] %= L;
		}
		else {
			POS[i] -= T;
			beg += POS[i] / L;
			POS[i] %= L;
			POS[i] += L;
			POS[i] %= L;
		}
	}
	std::sort(POS,POS+N);
	beg %= L;
	beg += L;
	beg %= L;
	for (int32_t i = beg; i < N; ++i)
	{
		out << POS[i] << endl;
	}
	for (int32_t i = 0; i < beg; ++i)
	{
		out << POS[i] << endl;
	}

	return 0;
}
#endif

Submission Info

Submission Time
Task C - Ants on a Circle
User eiya
Language C++14 (GCC 5.4.1)
Score 0
Code Size 1635 Byte
Status
Exec Time 174 ms
Memory 2432 KB

Test Cases

Set Name Score / Max Score Test Cases
Sample 0 / 0 sample_01.txt, sample_02.txt
All 0 / 700 sample_01.txt, sample_02.txt, sample_01.txt, sample_02.txt, subtask_1_01.txt, subtask_1_02.txt, subtask_1_03.txt, subtask_1_04.txt, subtask_1_05.txt, subtask_1_06.txt, subtask_1_07.txt, subtask_1_08.txt, subtask_1_09.txt, subtask_1_10.txt, subtask_1_11.txt, subtask_1_12.txt, subtask_1_13.txt, subtask_1_14.txt, subtask_1_15.txt, subtask_1_16.txt
Case Name Status Exec Time Memory
sample_01.txt 1 ms 256 KB
sample_02.txt 1 ms 256 KB
subtask_1_01.txt 104 ms 1536 KB
subtask_1_02.txt 87 ms 1280 KB
subtask_1_03.txt 169 ms 2432 KB
subtask_1_04.txt 174 ms 2432 KB
subtask_1_05.txt 39 ms 512 KB
subtask_1_06.txt 41 ms 640 KB
subtask_1_07.txt 169 ms 2048 KB
subtask_1_08.txt 168 ms 2048 KB
subtask_1_09.txt 110 ms 1408 KB
subtask_1_10.txt 96 ms 1280 KB
subtask_1_11.txt 28 ms 512 KB
subtask_1_12.txt 151 ms 2176 KB
subtask_1_13.txt 112 ms 1664 KB
subtask_1_14.txt 101 ms 1536 KB
subtask_1_15.txt 1 ms 256 KB
subtask_1_16.txt 1 ms 256 KB