結果

問題 No.338 アンケート機能
ユーザー huffman56huffman56
提出日時 2022-11-06 09:57:22
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 1,064 bytes
コンパイル時間 2,508 ms
コンパイル使用メモリ 104,888 KB
実行使用メモリ 24,060 KB
最終ジャッジ日時 2023-09-27 06:40:35
合計ジャッジ時間 5,850 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 60 ms
23,856 KB
testcase_01 AC 57 ms
23,792 KB
testcase_02 AC 64 ms
21,816 KB
testcase_03 AC 57 ms
21,868 KB
testcase_04 AC 59 ms
23,872 KB
testcase_05 AC 57 ms
21,776 KB
testcase_06 AC 58 ms
21,952 KB
testcase_07 AC 58 ms
21,836 KB
testcase_08 AC 56 ms
21,816 KB
testcase_09 AC 56 ms
21,964 KB
testcase_10 AC 57 ms
21,796 KB
testcase_11 AC 60 ms
23,804 KB
testcase_12 AC 60 ms
23,880 KB
testcase_13 AC 58 ms
19,952 KB
testcase_14 AC 60 ms
19,788 KB
testcase_15 AC 61 ms
21,848 KB
testcase_16 AC 58 ms
21,816 KB
testcase_17 AC 60 ms
21,792 KB
testcase_18 AC 58 ms
22,000 KB
testcase_19 AC 58 ms
21,856 KB
testcase_20 AC 61 ms
23,856 KB
testcase_21 AC 57 ms
21,988 KB
testcase_22 AC 57 ms
21,804 KB
testcase_23 AC 59 ms
24,060 KB
testcase_24 AC 60 ms
21,840 KB
testcase_25 AC 60 ms
21,740 KB
testcase_26 AC 59 ms
21,876 KB
testcase_27 AC 59 ms
19,840 KB
testcase_28 AC 59 ms
21,956 KB
testcase_29 AC 59 ms
21,836 KB
testcase_30 AC 59 ms
23,912 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.Generic;
using System.Linq;
using System.Numerics;
using static System.Math;

namespace SortItems
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = Console.ReadLine().Split().Select(double.Parse).ToArray();
            double A = n[0];
            double B = n[1];

            for (var a = 0; a <= 200; a++)
            {
                var chk = false;

                for (var b = 0; a + b <= 200; b++)
                {
                    double x = Math.Round((100 * (double)a) / (a + b) , MidpointRounding.AwayFromZero);
                    double y = Math.Round((100 * (double)b) / (a + b) , MidpointRounding.AwayFromZero);

                    if (x == A && y == B)
                    {
                        chk = true;
                        Console.WriteLine(a + b);
                        break;
                    }
                }

                if (chk)
                {
                    break;
                }

            }

        }
    }
}
0