結果
問題 | No.1010 折って重ねて |
ユーザー |
|
提出日時 | 2020-03-20 21:24:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 463 bytes |
コンパイル時間 | 1,565 ms |
コンパイル使用メモリ | 166,996 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-12-15 03:29:13 |
合計ジャッジ時間 | 3,717 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 WA * 3 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; #define rep(i, n) for (int i = 0; i < (n); i++) #define repr(i, n) for (int i = (n) - 1; i >= 0; i--) #define range(a) a.begin(), a.end() int f(ll x, ll y, ll z) { int res = 0; if (x > z) res = max(res, f(x / 2, y, z * 2) + 1); if (y > z) res = max(res, f(x, y / 2, z * 2) + 1); return res; } int main() { ll x, y, z; cin >> x >> y >> z; cout << f(x * 1000, y * 1000, z) << endl; }