結果

問題 No.499 7進数変換
ユーザー nksk38nksk38
提出日時 2017-06-25 22:53:39
言語 C++11
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 496 bytes
コンパイル時間 614 ms
コンパイル使用メモリ 73,476 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-04 05:31:40
合計ジャッジ時間 1,731 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<cstdio>
#include <iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<vector>
#include<functional>
#include<cmath>
#include<map>
#include<stack>
#include<set>
#include<numeric>

#define mod (ll)(1e9+7);

using namespace std;
typedef long long ll;
typedef pair<ll, ll> Pr;

int N;
int a[100];

int main()
{
	cin >> N;
	int i = 0;
	while (N >= 7) {
		a[i] = N % 7;
		N /= 7;
		i++;
	}
	a[i] = N;
	for (int j = i; j >= 0; j--)
		cout << a[j];
	cout << endl;
	return 0;
}
0