結果

問題 No.338 アンケート機能
ユーザー tsuchinagatsuchinaga
提出日時 2019-03-22 16:41:39
言語 Go
(1.22.1)
結果
TLE  
実行時間 -
コード長 437 bytes
コンパイル時間 11,241 ms
コンパイル使用メモリ 209,904 KB
実行使用メモリ 8,696 KB
最終ジャッジ日時 2023-10-19 06:08:18
合計ジャッジ時間 15,134 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
8,696 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 AC 1 ms
4,348 KB
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 2 ms
4,348 KB
testcase_08 AC 1 ms
4,348 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 TLE -
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)
		return
	}

	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