結果
| 問題 |
No.338 アンケート機能
|
| コンテスト | |
| ユーザー |
y_mazun
|
| 提出日時 | 2016-01-29 22:31:33 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 511 ms / 2,000 ms |
| コード長 | 490 bytes |
| コンパイル時間 | 866 ms |
| コンパイル使用メモリ | 42,112 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-08 02:48:03 |
| 合計ジャッジ時間 | 17,660 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 |
コンパイルメッセージ
main.cpp: In function ‘int getInt()’:
main.cpp:5:34: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | inline int getInt(){ int s; scanf("%d", &s); return s; }
| ~~~~~^~~~~~~~~~
ソースコード
#include <cmath>
#define REP(i,n) for(int i=0; i<(int)(n); i++)
#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }
#include <set>
using namespace std;
int main(){
const int a = getInt();
const int b = getInt();
int ans = 10000000;
REP(i,10001) REP(j,10001) if(i + j){
if((int)floor(0.5 + (100. * i) / (i + j)) == a &&
(int)floor(0.5 + (100. * j) / (i + j)) == b){
ans = min(ans, i + j);
}
}
printf("%d\n", ans);
return 0;
}
y_mazun