結果

問題 No.338 アンケート機能
ユーザー tsuchinagatsuchinaga
提出日時 2019-03-22 16:40:25
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 428 bytes
コンパイル時間 12,947 ms
コンパイル使用メモリ 211,712 KB
実行使用メモリ 4,348 KB
最終ジャッジ日時 2023-10-19 06:08:00
合計ジャッジ時間 16,609 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 1 ms
4,348 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,348 KB
testcase_06 TLE -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"fmt"
	"math"
)

func main() {
	var A, B int
	_, _ = fmt.Scan(&A, &B)

	if A == 0 || B == 0 {
		fmt.Println(1)
	}

	a, b := 1, 1
	for {
		ta := int(math.Round(float64(a*100) / float64(a+b)))
		tb := int(math.Round(float64(b*100) / float64(a+b)))

		// fmt.Println(a, ta, b, tb)
		if A == ta && B == tb {
			fmt.Println(a + b)
			return
		} else {
			if A > ta {
				a++
			} else {
				b++
			}
		}
	}
}
0