結果

問題 No.499 7進数変換
ユーザー tsuishitsuishi
提出日時 2021-04-12 14:57:36
言語 C
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 749 bytes
コンパイル時間 395 ms
コンパイル使用メモリ 29,824 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-28 12:37:53
合計ジャッジ時間 1,398 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 31
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
extern int getchar_unlocked(void);
extern int putchar_unlocked(int);
#define gc(d)	(d)=getchar_unlocked()
#define	pc(d) putchar_unlocked(d)
#define REP(a,b) for(int a=0;a<(int)(b);++a)
#define lolong long long
#define	ull	unsigned long long
// *********************
ull inl()   // 整数の入力(負数に対応)
{
	ull n = 0ULL;
	int c;
	gc(c);
	do {
		n = 10 * n + (c & 0xf);
		gc(c);
	} while (c >= '0');
	return n;
}
void outl(ull n) {
	int i;
	char b[70];
	if (!n) pc('0');
	else {
		if (n < 0) pc('-'), n = -n;
		i = 0; while (n) b[i++] = n % 7 + '0', n /= 7;
		while (i--) pc(b[i]);
	}
	pc('\n');
}
// *********************
int main( void ) {
	int N;

	N = inl();
	outl( N );
}
0