結果
問題 |
No.338 アンケート機能
|
ユーザー |
![]() |
提出日時 | 2025-02-27 23:40:29 |
言語 | Nim (2.2.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 356 bytes |
コンパイル時間 | 3,256 ms |
コンパイル使用メモリ | 65,040 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-27 23:40:34 |
合計ジャッジ時間 | 4,676 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
import strscans func calc(x, y: int): (int, int) = let v1 = 100 * x / (x + y) v2 = 100 * y / (x + y) (v1.toInt, v2.toInt) var (_, a, b) = stdin.readLine.scanTuple "$i $i" x = 1 y = 0 if a < b: swap(a, b) while true: let (c, d) = calc(x, y) if (c, d) == (a, b): break if d < b: inc y else: inc x y = 1 echo x + y