結果

問題 No.1842 Decimal Point
ユーザー bekzhan29bekzhan29
提出日時 2022-02-21 20:47:51
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 107 ms / 2,000 ms
コード長 957 bytes
コンパイル時間 2,163 ms
コンパイル使用メモリ 196,840 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-12 12:21:36
合計ジャッジ時間 3,575 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 40 ms
4,376 KB
testcase_02 AC 107 ms
4,380 KB
testcase_03 AC 91 ms
4,380 KB
testcase_04 AC 73 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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

*/
0