結果
問題 | No.499 7進数変換 |
ユーザー |
![]() |
提出日時 | 2017-04-07 22:24:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 324 bytes |
コンパイル時間 | 693 ms |
コンパイル使用メモリ | 68,264 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-07-16 00:50:28 |
合計ジャッジ時間 | 1,450 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#include <iostream>#include <string>#include <algorithm>int main(){long long n;std::cin >> n;std::string ans;if(n == 0){std::cout << 0 << std::endl;return 0;}while(n != 0){ans += std::to_string(n % 7 );n /=7;}std::reverse(ans.begin(), ans.end());std::cout << ans << std::endl;return 0;}