結果

問題 No.1624 三角形の反射
ユーザー kakel-san
提出日時 2021-07-23 22:12:15
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 718 bytes
コンパイル時間 884 ms
コンパイル使用メモリ 115,024 KB
実行使用メモリ 26,132 KB
最終ジャッジ日時 2024-07-02 09:51:27
合計ジャッジ時間 2,491 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 22
権限があれば一括ダウンロードができます
コンパイルメッセージ
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.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