結果

問題 No.1047 Zero (Novice)
ユーザー keymoonkeymoon
提出日時 2020-05-08 21:24:28
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 54 ms / 2,000 ms
コード長 708 bytes
コンパイル時間 4,360 ms
コンパイル使用メモリ 101,944 KB
実行使用メモリ 24,000 KB
最終ジャッジ日時 2023-09-17 01:24:00
合計ジャッジ時間 6,628 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
21,936 KB
testcase_01 AC 53 ms
21,912 KB
testcase_02 AC 52 ms
21,932 KB
testcase_03 AC 52 ms
24,000 KB
testcase_04 AC 54 ms
23,984 KB
testcase_05 AC 51 ms
21,764 KB
testcase_06 AC 51 ms
21,852 KB
testcase_07 AC 51 ms
21,836 KB
testcase_08 AC 50 ms
23,924 KB
testcase_09 AC 50 ms
21,924 KB
testcase_10 AC 50 ms
21,832 KB
testcase_11 AC 54 ms
21,904 KB
testcase_12 AC 54 ms
21,796 KB
testcase_13 AC 52 ms
21,788 KB
testcase_14 AC 52 ms
21,816 KB
testcase_15 AC 52 ms
23,876 KB
testcase_16 AC 51 ms
21,972 KB
testcase_17 AC 51 ms
21,896 KB
testcase_18 AC 53 ms
21,996 KB
testcase_19 AC 52 ms
21,848 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        var ab = Console.ReadLine().Split().Select(long.Parse).ToArray();
        var a = ab[0];
        var b = ab[1];
        long n = 0;
        for (int i = 1; i <= 2; i++)
        {
            n = n * a + b;
            if (n == 0)
            {
                Console.WriteLine(i);
                return;
            }
        }
        Console.WriteLine(-1);
    }
}
0