結果
| 問題 |
No.782 マイナス進数
|
| コンテスト | |
| ユーザー |
le_panda_noir
|
| 提出日時 | 2020-06-13 21:00:56 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 530 bytes |
| コンパイル時間 | 824 ms |
| コンパイル使用メモリ | 74,280 KB |
| 最終ジャッジ日時 | 2025-01-11 03:59:50 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 27 WA * 9 |
ソースコード
#include <iostream>
#include <stack>
using namespace std;
void ins() {}
template<class T,class... Rest>void ins(T& v,Rest&... rest){cin>>v;ins(rest...);}
#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
int main() {
int T, B;
ins(T, B);
stack<int> st;
rep(i, T) {
int a; cin >> a;
while (a != 0) {
int r = a % (-B);
if (r < 0)
r -= B;
st.push(r);
a -= r;
a /= B;
}
while (!st.empty()) {
cout << st.top();
st.pop();
}
cout << endl;
}
return 0;
}
le_panda_noir