結果
| 問題 | No.915 Plus Or Multiple Operation |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-05-06 23:34:15 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 462 bytes |
| 記録 | |
| コンパイル時間 | 1,162 ms |
| コンパイル使用メモリ | 209,004 KB |
| 実行使用メモリ | 9,728 KB |
| 最終ジャッジ日時 | 2026-06-09 23:54:43 |
| 合計ジャッジ時間 | 7,978 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | -- * 3 |
| other | TLE * 1 -- * 9 |
ソースコード
typedef long long ll;
typedef long double ld;
#include <bits/stdc++.h>
using namespace std;
int main() {
ll q;
std::cin >> q;
for (int i = 0; i < q; i++) {
ll a,b,c;
std::cin >> a>>b>>c;
ll cnt = 0;
while(a%c>0||a/c>0){
if(a%c!=0)cnt++;
if(a/c!=0)cnt++;
if(a%c!=0&&a%c<=c-2&&a/c%c==1)cnt--;
a/=c;
}
std::cout << cnt*b << std::endl;
}
}