結果

問題 No.499 7進数変換
ユーザー troro_kelp
提出日時 2018-06-22 17:04:27
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 462 bytes
コンパイル時間 1,221 ms
コンパイル使用メモリ 159,168 KB
実行使用メモリ 13,756 KB
最終ジャッジ日時 2024-06-30 18:00:35
合計ジャッジ時間 4,194 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 1 TLE * 1 -- * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int sep[11];
int main() {
    long long n; cin >> n;
    int index=0;
    for(int i=0; i<=10; ++i){
        if(n<pow(7, i)){
            index = i-1;
            break;
        }
    }
    for(int i=index; i>=0; --i){
        long long num = pow(7, i);
            while(n/num){
                sep[i]++;
                n -= num;
            }
    }
    for(int i=index; i>=0; --i) cout << sep[i];
    return 0;
}
0