結果

問題 No.499 7進数変換
ユーザー Lapis_NU
提出日時 2019-08-25 19:27:18
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 313 bytes
コンパイル時間 1,443 ms
コンパイル使用メモリ 158,952 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-11-06 22:34:21
合計ジャッジ時間 2,494 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
  int64_t n;
  cin>>n;
  int a=n;
  int count=0;
  while(a>0){
  a/=7;
  count++;
  }
  vector<int> ans(count);
  for(int i=0;i<count;i++){
    int t=pow(7,count-i-1)/1;
  ans.at(i)+=n/t;
  n=n%t;
  }
  for(int i=0;i<count;i++){
  cout<<ans.at(i);
  }
}
0