結果
問題 |
No.338 アンケート機能
|
ユーザー |
![]() |
提出日時 | 2016-01-30 00:58:54 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 445 bytes |
コンパイル時間 | 398 ms |
コンパイル使用メモリ | 59,096 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-09-21 18:55:00 |
合計ジャッジ時間 | 1,224 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 12 WA * 16 |
ソースコード
#include<iostream> #include <math.h> using namespace std; int shishagonyu(double x) { return (int)(x < 0.0 ? x - 0.5 : x + 0.5); } int main() { double a, b, A, B,s=1000; double ans; cin >> A >> B; if (A > B) swap(A, B); for (a = 0; a < 100; a++) { for (b = a; b < 200; b++) { ans = (100*b / (a + b)); ans = shishagonyu(ans); if (B == ans) { if (s > a + b) { s = a + b; } } } } cout << s << endl; return 0; }