結果
問題 |
No.338 アンケート機能
|
ユーザー |
![]() |
提出日時 | 2025-02-14 00:30:54 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 25 ms / 2,000 ms |
コード長 | 611 bytes |
コンパイル時間 | 3,187 ms |
コンパイル使用メモリ | 274,696 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2025-02-14 00:30:59 |
合計ジャッジ時間 | 5,111 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#include <bits/stdc++.h> using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { int a, b; cin >> a >> b; int ans = 1e9; for (int x = 0; x < 1000; ++x) { for (int y = 0; y < 1000; ++y) { if (x + y == 0) continue; int p = roundl((long double) (100 * x) / (x + y)); int q = roundl((long double) (100 * y) / (x + y)); if (p == a && q == b) ans = min(ans, x + y); } } cout << ans << endl; return 0; }