結果
問題 |
No.782 マイナス進数
|
ユーザー |
|
提出日時 | 2019-01-13 18:02:42 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 296 bytes |
コンパイル時間 | 2,267 ms |
コンパイル使用メモリ | 159,696 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-26 00:37:27 |
合計ジャッジ時間 | 3,054 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 WA * 9 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main(){ int a,b,k[10005]; cin>>a>>b; for(int i=0;i<a;++i){ cin>>k[i]; string ans=""; while(k[i]){ int mon=k[i]%b,mmon=k[i]/b; if(mon<0){mon-=b;++mmon;} ans+=to_string(mon); k[i]=mmon; } reverse(ans.begin(),ans.end()); cout<<ans<<endl; } }