結果
問題 |
No.338 アンケート機能
|
ユーザー |
![]() |
提出日時 | 2016-01-29 23:14:03 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 1,648 bytes |
コンパイル時間 | 1,442 ms |
コンパイル使用メモリ | 157,408 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-08 02:53:46 |
合計ジャッジ時間 | 2,371 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 28 |
ソースコード
#include <bits/stdc++.h> using namespace std; #undef _P #define _P(...) (void)printf(__VA_ARGS__) #define FOR(i,a,b) for (int i = (a); i < (b); i++) #define RFOR(i,a,b) for (int i = (b)-1; i >= (a); i--) #define REP(i,n) for (int i = 0; i < (n); i++) #define RREP(i,n) for (int i = (n)-1; i >= 0; i--) #define ALL(x) (x).begin(), (x).end() #define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++) #define RITR(x,c) for(__typeof(c.rbegin()) x=c.rbegin();x!=c.rend();x++) #define MIN(a,b) (a < b ? a : b) #define MAX(a,b) (a > b ? a : b) #define BIT(n) (1LL<<(n)) #define SZ(x) ((int)(x).size()) #define ZERO(a) memset(a,0,sizeof(a)) #define MINUS(a) memset(a,0xff,sizeof(a)) #define FILL(a,v) memset(a,v,sizeof(a)) #define bitcount(b) __builtin_popcount(b) #define GCD(a,b) (__gcd(a,b)) #define GCD3(a,b,c) (GCD(GCD(a,b), c)) #define LCM(a,b) (a/GCD(a,b)*b) #define LCM3(a,b,c) LCM(LCM(a,b),c) #define MOD 1000000007 template<class T> inline bool amax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; } template<class T> inline bool amin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; } typedef long long ll; // ------------------------------------- int A, B; int main() { cin >> A >> B; if (A == 0 || B == 0) { cout << "1\n"; return 0; } int ans = 1; while (1) { REP(j, ans + 1) { int k = ans - j; int c = (int) (100.0 * j / ans + 0.5); int d = (int) (100.0 * k / ans + 0.5); //_P("%d -> %d,%d, %d,%d\n", ans, j, k, c, d); if (c == A && d == B) { cout << ans << '\n'; return 0; } } ans++; } return 0; }