結果
問題 |
No.415 ぴょん
|
ユーザー |
![]() |
提出日時 | 2016-08-26 23:20:14 |
言語 | C#(csc) (csc 3.9.0) |
結果 |
MLE
|
実行時間 | - |
コード長 | 1,321 bytes |
コンパイル時間 | 1,231 ms |
コンパイル使用メモリ | 114,912 KB |
実行使用メモリ | 833,164 KB |
最終ジャッジ日時 | 2024-11-08 09:51:11 |
合計ジャッジ時間 | 4,178 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 3 MLE * 1 -- * 23 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; long[] inpt = Reader.ReadLine().Split(' ').Select(a=>long.Parse(a)).ToArray(); Dictionary<long, bool> dic = new Dictionary<long, bool>(); long pos = 0; long ans = 0; dic.Add(0, true); for(long i=0; i<inpt[0]; i++) { pos = (pos + inpt[1]) % inpt[0]; if(dic.ContainsKey(pos)) { break; } dic.Add(pos, true); ans++; } Console.WriteLine(ans); } public class Reader { public static bool IsDebug = true; private static String PlainInput = @" 5 2 "; private static System.IO.StringReader Sr = null; public static string ReadLine() { if (IsDebug) { if (Sr == null) { Sr = new System.IO.StringReader(PlainInput.Trim()); } return Sr.ReadLine(); } else { return Console.ReadLine(); } } } static void Main() { Program prg = new Program(); prg.Proc(); } }