結果
問題 | No.338 アンケート機能 |
ユーザー |
![]() |
提出日時 | 2016-01-29 23:50:32 |
言語 | D (dmd 2.109.1) |
結果 |
TLE
|
実行時間 | - |
コード長 | 654 bytes |
コンパイル時間 | 834 ms |
コンパイル使用メモリ | 103,228 KB |
実行使用メモリ | 13,884 KB |
最終ジャッジ日時 | 2024-06-12 02:50:42 |
合計ジャッジ時間 | 4,718 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 TLE * 1 -- * 18 |
ソースコード
import std.stdio, std.conv, std.math, std.string, std.range, std.array, std.algorithm; int calc(int a, int b) { if(a == 0 && b == 0) { return 0; } float t = a.to!float * 100 / (a+b); return (t+0.5).to!int; } void main() { auto buf = readln().strip().split().map!(to!int)().array(); immutable A = buf[0]; immutable B = buf[1]; int a, b, va, vb; while((va = calc(a,b)) != A || (vb = calc(b,a)) != B) { if(va < A) { a ++; } else { if(vb < B) { b ++; } else { a ++; } } } writeln(a + b); }