結果

問題 No.499 7進数変換
ユーザー yansi819
提出日時 2024-03-31 11:33:26
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 339 bytes
コンパイル時間 3,995 ms
コンパイル使用メモリ 251,552 KB
最終ジャッジ日時 2025-02-20 16:11:53
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ld = long double;

ll N;
string ans;

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