結果
問題 | No.499 7進数変換 |
ユーザー |
![]() |
提出日時 | 2018-06-22 17:07:43 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 507 bytes |
コンパイル時間 | 1,363 ms |
コンパイル使用メモリ | 159,396 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-30 18:00:31 |
合計ジャッジ時間 | 2,413 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 31 |
ソースコード
#include <bits/stdc++.h>using namespace std;int main() {long long n; cin >> n;int sep[11]={0};int index=0;for(int i=1; i<=10; ++i){if(n<pow(7, i)){index = i-1;break;}}if(n >= pow(7, 10)) index = 10;for(int i=index; i>=0; --i){long long num = pow(7, i);while(n/num){sep[i]++;n -= num;}}for(int i=index; i>=0; --i) cout << sep[i];return 0;}