結果

問題 No.745 letinopia raoha
コンテスト
ユーザー bluemegane
提出日時 2021-07-04 16:17:06
言語 C#(csc)
(csc 3.9.0)
コンパイル:
csc -langversion:latest -unsafe -warn:0 -o+ /r:System.Numerics.dll _filename_ -out:a.exe
実行:
/usr/bin/mono a.exe
結果
AC  
実行時間 17 ms / 2,000 ms
コード長 1,103 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 695 ms
コンパイル使用メモリ 112,232 KB
実行使用メモリ 26,648 KB
最終ジャッジ日時 2026-03-22 00:26:57
合計ジャッジ時間 1,195 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 8
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #
raw source code

using System;

public class Hello
{
    public static int a, b, c, d;
    static void Main()
    {
        string[] line = Console.ReadLine().Trim().Split(' ');
        a = int.Parse(line[0]);
        b = int.Parse(line[1]);
        c = int.Parse(line[2]);
        d = int.Parse(line[3]);
        getAns();
    }
    static void getAns()
    {
        if (d == 10) { Console.WriteLine("Impossible"); return; }
        Console.WriteLine("Possible");
        var c = 0;
        var p = 1;
        while (true)
        {
            if (b >= 100)
            {
                b -= 100;
                c += p * 50 * 100;
                p *= 2;
            }
            else
            {
                if (a + b >= 100)
                {
                    c += p * 50 * b + p * 100 * (100 - b);
                    a -= 100 - b;
                    b = 0;
                    p *= 2;
                }
                else
                {
                    c += p * 50 * b + p * 100 * a;
                    break;
                }
            }
        }
        Console.WriteLine(c);
    }
}
0