結果

問題 No.499 7進数変換
ユーザー cokerich
提出日時 2025-03-04 14:55:13
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 255 bytes
コンパイル時間 1,701 ms
コンパイル使用メモリ 159,896 KB
実行使用メモリ 8,604 KB
最終ジャッジ日時 2025-03-04 14:55:16
合計ジャッジ時間 2,428 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
  int x,a,t=0;
  cin >> x;
  if(x==0){cout<< 0 << endl;return(0);}
for (int i=282475249;i>0;i=i/7){
	a=x/i;
  if (((t==0)&&(a > 0))||(t==1)){cout << a;t=1;}
  x=x-i*a;
}
cout<< endl;
return(0);
}
0