結果

問題 No.1624 三角形の反射
ユーザー 👑 kakel-sankakel-san
提出日時 2021-07-23 22:12:15
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 57 ms / 2,000 ms
コード長 718 bytes
コンパイル時間 1,162 ms
コンパイル使用メモリ 68,252 KB
実行使用メモリ 23,020 KB
最終ジャッジ日時 2023-09-15 04:46:49
合計ジャッジ時間 3,641 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 57 ms
20,776 KB
testcase_01 AC 57 ms
18,772 KB
testcase_02 AC 55 ms
20,736 KB
testcase_03 AC 56 ms
20,784 KB
testcase_04 AC 57 ms
22,872 KB
testcase_05 AC 56 ms
20,964 KB
testcase_06 AC 56 ms
20,772 KB
testcase_07 AC 57 ms
22,812 KB
testcase_08 AC 56 ms
22,808 KB
testcase_09 AC 57 ms
23,020 KB
testcase_10 AC 57 ms
20,824 KB
testcase_11 AC 56 ms
20,772 KB
testcase_12 AC 57 ms
20,888 KB
testcase_13 AC 57 ms
20,828 KB
testcase_14 AC 57 ms
20,776 KB
testcase_15 AC 57 ms
22,864 KB
testcase_16 AC 56 ms
22,820 KB
testcase_17 AC 56 ms
20,772 KB
testcase_18 AC 56 ms
20,700 KB
testcase_19 AC 57 ms
22,872 KB
testcase_20 AC 56 ms
20,784 KB
testcase_21 AC 56 ms
20,888 KB
testcase_22 AC 57 ms
20,860 KB
testcase_23 AC 57 ms
20,820 KB
testcase_24 AC 57 ms
22,756 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

using System;
using System.Collections.Generic;
using static System.Console;
using System.Linq;

class yuki
{
    static int NN => int.Parse(ReadLine());
    static int[] NList => ReadLine().Split().Select(int.Parse).ToArray();
    static void Main()
    {
        var a = int.Parse(ReadLine().Replace(".", ""));
        var p = 1000;

        var gcd = GCD(a, p);
        var x = p / gcd;
        var y = a / gcd;
        var pt = (x + y) % 2 == 0 ? "A" : x % 2 == 1 ? "B" : "C";
        WriteLine(pt + " " + (x - 1 + y - 1 + (x + y) / 2 + Math.Abs(x - y) / 2));
    }
    static int GCD(int a, int b)
    {
        if (a < b) return GCD(b, a);
        if (a % b == 0) return b;
        return GCD(b, a % b);
    }
}
0