結果
| 問題 |
No.338 アンケート機能
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-06 09:45:39 |
| 言語 | C#(csc) (csc 3.9.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,053 bytes |
| コンパイル時間 | 2,256 ms |
| コンパイル使用メモリ | 110,912 KB |
| 実行使用メモリ | 29,300 KB |
| 最終ジャッジ日時 | 2024-07-20 00:43:55 |
| 合計ジャッジ時間 | 4,324 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 9 |
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc) Copyright (C) Microsoft Corporation. All rights reserved.
ソースコード
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(int.Parse).ToArray();
var A = n[0];
var 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;
}
}
}
}
}