結果
| 問題 |
No.338 アンケート機能
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-02-12 22:03:02 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 408 bytes |
| コンパイル時間 | 1,910 ms |
| コンパイル使用メモリ | 157,940 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 03:01:46 |
| 合計ジャッジ時間 | 2,307 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
コンパイルメッセージ
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 = 0; i < 101; i++)
{
if (i > n + m)
break;
for (int j = 0; 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;
}