結果
| 問題 | No.499 7進数変換 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-11-24 17:44:18 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 368 bytes |
| 記録 | |
| コンパイル時間 | 1,913 ms |
| コンパイル使用メモリ | 194,264 KB |
| 最終ジャッジ日時 | 2025-02-25 06:07:08 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 WA * 1 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:23:28: warning: ignoring return value of ‘int system(const char*)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
23 | int main() { solve();system("pause"); }
| ~~~~~~^~~~~~~~~
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef int64_t ll;
vector<ll> numeral_7(ll n){
vector<ll> answer;
while(n>0){
answer.push_back(n%7);
n/=7;
}
return answer;
}
void solve() {
ll n;
cin>>n;
vector<ll> a=numeral_7(n);
for(ll i=a.size()-1;i>=0;i--){
cout<<a.at(i)<<(i==0?"\n":"");
}
}
int main() { solve();system("pause"); }