結果

問題 No.499 7進数変換
ユーザー Yug_min_null
提出日時 2021-10-01 22:32:16
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 409 bytes
コンパイル時間 2,040 ms
コンパイル使用メモリ 191,088 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-19 12:22:55
合計ジャッジ時間 2,892 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _GLIBCXX_DEBUG
#define ll long long
#define INF 1000000000;
#define INF_B 1000000000000000000;
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

int main(){
  int N; cin >> N;
  if(N == 0){
    cout << 0 << endl;
    return 0;
  }
  string ans = "";
  while(N != 0){
    ans += to_string(N%7);
    N /= 7;
  }
  reverse(ans.begin(), ans.end());
  cout << ans << endl;
}
0