結果
| 問題 |
No.915 Plus Or Multiple Operation
|
| コンテスト | |
| ユーザー |
chocorusk
|
| 提出日時 | 2019-10-25 21:27:21 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 876 bytes |
| コンパイル時間 | 954 ms |
| コンパイル使用メモリ | 109,812 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-11-07 03:20:21 |
| 合計ジャッジ時間 | 1,505 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 10 |
ソースコード
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#include <utility>
#include <functional>
#include <time.h>
#include <stack>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
int main()
{
int q; cin>>q;
for(int i=0; i<q; i++){
ll a, b, c;
cin>>a>>b>>c;
if(c==1){
cout<<-1<<endl;
continue;
}
ll ans=0;
while(a){
if(a%c!=0) ans++;
a/=c;
ans++;
}
ans*=b;
cout<<ans<<endl;
}
return 0;
}
chocorusk