結果
| 問題 | No.338 アンケート機能 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-12 22:00:56 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 408 bytes |
| 記録 | |
| コンパイル時間 | 1,235 ms |
| コンパイル使用メモリ | 159,716 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-22 04:17:06 |
| 合計ジャッジ時間 | 2,253 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 26 WA * 2 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:6:24: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
6 | int a, b; scanf("%d%d", &a, &b);
| ~~~~~^~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main()
{
int a, b; scanf("%d%d", &a, &b);
int n = 100, m = 100;
for (int i = 1; i < 101; i++)
{
if (i > n + m)
break;
for (int j = 1; j < 101; j++)
{
if (i + j > n + m)
break;
if (round(100.0 * i / (i + j)) == a && round(100.0 * j / (i + j)) == b)
{
n = i;
m = j;
break;
}
}
}
cout << n + m << endl;
return 0;
}