結果
問題 |
No.499 7進数変換
|
ユーザー |
![]() |
提出日時 | 2018-04-01 22:35:06 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 667 bytes |
コンパイル時間 | 545 ms |
コンパイル使用メモリ | 69,292 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 05:57:38 |
合計ジャッジ時間 | 1,609 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 WA * 5 |
ソースコード
#include <iostream> #include <vector> #include <algorithm> #include <string> #include <map> #include <stack> using namespace std; int n, m; int x, y; int field[20][20]; int main() { cin >> n; vector<int> v; long long divisor=7; do{ divisor*=7; } while(divisor<1000000000); bool flag = false; while(true){ if(n/divisor!=0) flag = true; if(flag){ v.push_back(n/divisor); n = n%divisor; } divisor/=7; if(n<7){ v.push_back(n); break; } } for(int i=0; i<v.size(); ++i){ cout << v[i]; } cout << endl; return 0; }