結果

問題 No.1224 I hate Sqrt Inequality
ユーザー Yahiya YusufzaiYahiya Yusufzai
提出日時 2020-09-11 21:39:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 1,062 bytes
コンパイル時間 2,052 ms
コンパイル使用メモリ 207,456 KB
実行使用メモリ 245,212 KB
最終ジャッジ日時 2023-08-27 12:41:07
合計ジャッジ時間 5,716 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
8,768 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,384 KB
testcase_06 AC 2 ms
4,380 KB
testcase_07 AC 2 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 TLE -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,a,n) for(ll i=a;i<n;++i)
#define per(i,n) for(ll i=n-1;i>=1;i--)
#define repk(i,a,n) for(ll i=a;i<=n;++i)
#define mod 1000000007
#define all(v) v.begin(), v.end()
#define pi pair<int,int>
#define pl pair<ll,ll>
#define pld pair<ld,ll>
#define di deque<int>
#define pb push_back
#define mp make_pair
#define pq priority_queue
#define F first
#define S second
int p = 1;
const int mn = 1e5 + 5;

string decimal(ll numr, ll denr)
{
	string res;

	unordered_map <ll, ll> mp;
	mp.clear();


	ll rem = numr % denr;


	while ( (rem != 0) && (mp.find(rem) == mp.end()) )
	{

		mp[rem] = res.length();

		rem = rem * 10;


		ll res_part = rem / denr;
		res += to_string(res_part);


		rem = rem % denr;
	}

	return (rem == 0) ? "" : res.substr(mp[rem]);
}
void sol() {

	ll a, b; cin >> a >> b;
	string s = decimal(a, b);
	if (s == "")
		cout << "No\n";
	else
		cout << "Yes\n";
}





int main() {

	// int _;
	// for (scanf("%d", &_); _; _--)
	sol();


	return 0;
}
0