結果
| 問題 |
No.1842 Decimal Point
|
| コンテスト | |
| ユーザー |
bekzhan29
|
| 提出日時 | 2022-02-21 20:47:51 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 111 ms / 2,000 ms |
| コード長 | 957 bytes |
| コンパイル時間 | 1,871 ms |
| コンパイル使用メモリ | 192,308 KB |
| 最終ジャッジ日時 | 2025-01-28 01:17:00 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 5 |
ソースコード
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <algorithm>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
#include <stack>
#include <chrono>
#include <random>
using namespace std;
#define pb push_back
#define mp make_pair
#define INF ll(1e18)
#define mod 998244353
#define mod2 1000000007
#define eps 1e-9
#define abs(x) ((x)>=0?(x):-(x))
#define y1 solai
#define fi first
#define se second
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
const ll N=200100;
ll n,a,b,c;
ll bin(ll a, ll n, ll md)
{
ll ans=1;
while(n)
{
if(n&1)
ans*=a,ans%=md;
a*=a,a%=md;
n/=2;
}
return ans%md;
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin>>n;
for(ll i=1;i<=n;i++)
{
cin>>a>>b>>c;
cout<<a*bin(10,c-1,b)%b*10/b<<"\n";
}
}
/*
5
3 2 1
1 6 7
9 2 4
123 456 789
314159265 358979323 846264338
*/
bekzhan29