Submission #1357031
Source Code Expand
using System; using System.IO; using System.Linq; using System.Text; using System.Collections.Generic; using System.Diagnostics; using Enu = System.Linq.Enumerable; public class Program { public void Solve() { int N = Reader.Int(); long L = Reader.Int(), T = Reader.Int(); int[] X = new int[N], Dir = new int[N]; for (int i = 0; i < N; i++) { X[i] = Reader.Int(); Dir[i] = Reader.Int() == 1 ? 1 : -1; } var P = new long[N]; for (int i = 0; i < N; i++) P[i] = ((X[i] + Dir[i] * T) % L + L) % L; long after = 0; for (int i = 1; i < N; i++) if (Dir[0] != Dir[i]) { long len = ((X[i] - X[0]) * Dir[0] + L) % L; long num = T * 2 < len ? 0 : 1 + (T * 2 - len) / L; after += num * Dir[0]; } int skip = N - (int)((after % N + N) % N); Console.WriteLine(string.Join("\n", P.Skip(skip).Concat(P.Take(skip)))); } } class Entry { static void Main() { new Program().Solve(); } } class Reader { static TextReader reader = Console.In; static readonly char[] separator = { ' ' }; static readonly StringSplitOptions op = StringSplitOptions.RemoveEmptyEntries; static string[] A = new string[0]; static int i; static void Init() { Dispose(); A = new string[0]; } public static void Set(TextReader r) { Init(); reader = r; } public static void Set(string file) { Init(); reader = new StreamReader(file); } public static bool HasNext() { return CheckNext(); } public static string String() { return Next(); } public static int Int() { return int.Parse(Next()); } public static long Long() { return long.Parse(Next()); } public static double Double() { return double.Parse(Next()); } public static int[] IntLine() { return Array.ConvertAll(Split(Line()), int.Parse); } public static int[] IntArray(int N) { return Range(N, Int); } public static int[][] IntTable(int H) { return Range(H, IntLine); } public static string[] StringArray(int N) { return Range(N, Next); } public static string[][] StringTable(int N) { return Range(N, () => Split(Line())); } public static string Line() { return reader.ReadLine().Trim(); } public static T[] Range<T>(int N, Func<T> f) { var r = new T[N]; for (int i = 0; i < N; r[i++] = f()) ; return r; } public static void Dispose() { reader.Dispose(); } static string[] Split(string s) { return s.Split(separator, op); } static string Next() { CheckNext(); return A[i++]; } static bool CheckNext() { if (i < A.Length) return true; string line = reader.ReadLine(); if (line == null) return false; if (line == "") return CheckNext(); A = Split(line); i = 0; return true; } }
Submission Info
Submission Time | |
---|---|
Task | C - Ants on a Circle |
User | eitaho |
Language | C# (Mono 4.6.2.0) |
Score | 0 |
Code Size | 2907 Byte |
Status | WA |
Exec Time | 152 ms |
Memory | 21448 KB |
Judge Result
Set Name | Sample | All | ||||||
---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 700 | ||||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | sample_01.txt, sample_02.txt |
All | 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 | AC | 26 ms | 11348 KB |
sample_02.txt | AC | 25 ms | 11348 KB |
subtask_1_01.txt | WA | 107 ms | 20304 KB |
subtask_1_02.txt | WA | 87 ms | 18772 KB |
subtask_1_03.txt | WA | 152 ms | 21448 KB |
subtask_1_04.txt | WA | 152 ms | 21448 KB |
subtask_1_05.txt | WA | 43 ms | 12000 KB |
subtask_1_06.txt | WA | 53 ms | 14428 KB |
subtask_1_07.txt | WA | 141 ms | 20940 KB |
subtask_1_08.txt | WA | 142 ms | 19148 KB |
subtask_1_09.txt | WA | 100 ms | 16852 KB |
subtask_1_10.txt | WA | 91 ms | 16340 KB |
subtask_1_11.txt | AC | 42 ms | 14304 KB |
subtask_1_12.txt | AC | 141 ms | 20556 KB |
subtask_1_13.txt | WA | 110 ms | 20688 KB |
subtask_1_14.txt | WA | 102 ms | 20176 KB |
subtask_1_15.txt | AC | 25 ms | 11348 KB |
subtask_1_16.txt | AC | 25 ms | 13396 KB |