結果
問題 | No.338 アンケート機能 |
ユーザー |
![]() |
提出日時 | 2016-04-06 22:41:55 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 927 bytes |
コンパイル時間 | 746 ms |
コンパイル使用メモリ | 83,124 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 03:07:32 |
合計ジャッジ時間 | 1,661 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
/* -*- coding: utf-8 -*- * * 338.cc: No.338 アンケート機能 - yukicoder */ #include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<iostream> #include<string> #include<vector> #include<map> #include<set> #include<stack> #include<list> #include<queue> #include<deque> #include<algorithm> #include<numeric> #include<utility> #include<complex> #include<functional> using namespace std; /* constant */ const int MAX_A = 200; const int MAX_B = 200; const int INF = 1 << 30; /* typedef */ /* global variables */ /* subroutines */ /* main */ int main() { int la, lb; cin >> la >> lb; int minab = INF; for (int a = 0; a <= MAX_A; a++) for (int b = 0; b <= MAX_B; b++) { int ab = a + b; if (ab == 0) continue; if ((200 * a + ab) / (2 * ab) == la && (200 * b + ab) / (2 * ab) == lb && minab > ab) minab = ab; } printf("%d\n", minab); return 0; }