結果
問題 |
No.782 マイナス進数
|
ユーザー |
|
提出日時 | 2019-01-11 23:16:27 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 340 bytes |
コンパイル時間 | 1,658 ms |
コンパイル使用メモリ | 169,016 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-30 13:26:25 |
合計ジャッジ時間 | 3,564 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 27 WA * 9 |
ソースコード
#include <bits/stdc++.h> int main(){ int T; int B; std::cin>>T; std::cin>>B; for(int i=0;i<T;++i){ int N; std::cin>>N; std::string ans=""; while(N!=0){ int add=N%B; while(add<0)add-=B; ans=std::to_string(add)+ans; N-=add; N/=B; } std::cout<<ans<<std::endl; } return 0; }