結果
問題 |
No.1176 少ない質問
|
ユーザー |
|
提出日時 | 2020-08-21 22:08:06 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 341 bytes |
コンパイル時間 | 175 ms |
コンパイル使用メモリ | 31,104 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 05:41:14 |
合計ジャッジ時間 | 816 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 20 WA * 1 |
ソースコード
#include<cstdio> int gcd(int a,int b){ return b?gcd(b,a%b):a; } int main(){ long long n; scanf("%lld",&n); long long org = n; int cnt = 0; while(n!=0) n /= 2, cnt += 2; int next = 0; if(org==2) cnt = 2; while(org!=0) org /= 3, next += 3; if(next<cnt) cnt = next; printf("%d\n",cnt); return 0; }