結果
問題 |
No.499 7進数変換
|
ユーザー |
![]() |
提出日時 | 2017-04-07 23:05:31 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 451 bytes |
コンパイル時間 | 538 ms |
コンパイル使用メモリ | 60,304 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-07-16 02:54:09 |
合計ジャッジ時間 | 1,570 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:32:16: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ll’ {aka ‘long long int’} [-Wformat=] 32 | printf("%d", N/num); | ~^ ~~~~~ | | | | int ll {aka long long int} | %lld
ソースコード
#include <iostream> #include <cstdio> #include <algorithm> #include <string> #include <map> typedef long long ll; #define fi first #define se second using namespace std; ll N; ll num; int main(){ cin>>N; num = 1; int cnt = 0; int i; while( N > num ){ num *= 7; } while( num ){ if( cnt || N/num ){ printf("%d", N/num); cnt++; } N %= num; num /= 7; } puts(""); return 0; }