結果
問題 |
No.1176 少ない質問
|
ユーザー |
|
提出日時 | 2020-08-21 22:11:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 365 bytes |
コンパイル時間 | 279 ms |
コンパイル使用メモリ | 30,976 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 05:44:14 |
合計ジャッジ時間 | 955 ms |
ジャッジサーバーID (参考情報) |
judge5 / 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; if(org==3) cnt = 3; while(org!=0) org /= 3, next += 3; if(next<cnt) cnt = next; printf("%d\n",cnt); return 0; }