結果

問題 No.415 ぴょん
ユーザー wowilsonwowilson
提出日時 2016-11-05 12:48:30
言語 C#(csc)
(csc 3.9.0)
結果
MLE  
実行時間 -
コード長 728 bytes
コンパイル時間 2,891 ms
コンパイル使用メモリ 101,296 KB
実行使用メモリ 553,928 KB
最終ジャッジ日時 2023-08-16 13:51:15
合計ジャッジ時間 5,559 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
22,828 KB
testcase_01 AC 56 ms
18,584 KB
testcase_02 AC 56 ms
20,604 KB
testcase_03 MLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;

namespace Yukicoder
{
    public class Program
    {
        public static void Main()
        {
            var line = Console.ReadLine().Split();
            int n = int.Parse(line[0]);
            int d = int.Parse(line[1]);

            int[] circle = new int[n];
            int cur = 0;
            int cnt = 0;
            circle[0] = -1;

            while (true)
            {
                cur += d;
                cur %= n;
                if (circle[cur] == 0)
                {
                    cnt++;
                    circle[cur] = -1;
                }else
                {
                    break;
                }
            }
            Console.WriteLine(cnt);
        }
    }
}

0