CF833A The Meaningless Game 鎬濈淮
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了CF833A The Meaningless Game 鎬濈淮相关的知识,希望对你有一定的参考价值。
鏍囩锛?a href='http://www.mamicode.com/so/1/%e9%aa%8c%e8%af%81' title='楠岃瘉'>楠岃瘉
lse pac 8 8 The names 鐜板湪 sla else棰樼洰
Slastyona鍜屽ス鐨勫繝瀹炵嫍鐙楁櫘浠€鍏嬫鍦ㄧ帺涓€涓鏃犳剰涔変絾鏄緢鏈夎叮鐨勬父鎴忋€傛父鎴忓寘鎷涓洖鍚堛€?/p>
瀹冪殑瑙勫垯闈炲父绠€鍗曪細鍏堥€夋嫨涓€涓嚜鐒舵暟k銆傜劧鍚庯紝璋佽锛堟垨鍚狅級鐨勬瘮鍙︿竴涓揩灏变細璧㈠緱涓€灞€銆傝儨鍒╄€呯殑寰楀垎鍦ㄩ偅涔嬪悗浼氫箻浠鐨勫钩鏂癸紝鑰岃緭浜嗙殑浜虹殑寰楀垎灏卞彧鑳戒箻浠銆傛瘮璧涘紑濮嬫椂锛孲lastyona鍜孭urSok閮芥湁涓€涓垵濮嬪垎鏁般€備笉骞哥殑鏄紝Slastyona涓㈠け浜嗚浜嬫湰锛岄偅閲岃褰曚簡浠栦滑鐜╄繃鐨凬涓父鎴忕殑鍘嗗彶銆傚ス璁炬硶鍥炲繂浜嗘瘡涓€鍦烘瘮璧涚殑鏈€缁堢粨鏋滐紝浣嗘槸璁板繂閮藉緢妯$硦銆傚府鍔㏒lastyona楠岃瘉瀹冧滑鐨勬纭€э紝鎴栬€咃紝鎹㈠彞璇濊锛屽浜庢瘡涓€瀵圭粰瀹氱殑鍒嗘暟锛岀‘瀹氭父鎴忔槸鍚﹁兘澶熷畬鎴愯繖鏍风殑缁撴灉銆?/p>
杈撳叆杈撳嚭鏍蜂緥
杈撳叆 #1
6
2 4
75 45
8 8
16 16
247 994
1000000000 1000000
杈撳嚭 #1
Yes
Yes
Yes
No
No
Yes
棰樻剰
? 鐜板湪涓や釜浜哄仛娓告垙锛屾瘡涓汉鍒氬紑濮嬮兘鏄暟瀛?锛岃皝璧簡灏辫兘涔樹互k^2锛岃緭鐨勪箻浠锛岀幇鍦ㄧ粰浣犳渶缁堣繖涓や釜浜虹殑寰楀垎a,b锛岃浣犲垽鏂槸鍚︽湁杩欎釜鍙兘锛屾湁鍙兘鐨勮瘽Yes锛屽惁鍒橬o銆?/p>
鍒嗘瀽
鐢变簬姣忔閮芥槸涓€涓暟涔榢锛屼竴涓暟涔?k2$,閭d箞**姣忔杩欎袱涓暟閮戒箻$k3$**,濡傛灉鍙互婊¤冻鏉′欢锛岄偅涔堢粰鍑虹殑涓暟鐨勪箻绉竴瀹氭槸涓€涓暣鏁扮殑涓夋鏂?/p>
鐢变簬c++娌℃湁寮€绔嬫柟鐨勫嚱鏁帮紝鎴戜滑鍙互鐢╬ow(x, $frac{1}{3}$)鏉ヨ〃绀簒鐨勭珛鏂规牴銆?/p>
鐢变簬pow杩斿洖鐨勬槸double绫诲瀷锛屽鏋滃垽鏂瓁鐨勭珛鏂规牴鏄惁鏄暣鏁颁細鏈夌簿搴︽崯澶憋紝鎵€浠ュ彲浠ュ皢x鐨勭珛鏂规牴鍥涜垗浜斿叆鍚庡啀涔樹互瀹冪殑绔嬫柟鍒ゆ柇鏄惁绛変簬x銆?/p>
鍚屾椂杩橀渶瑕佸垽鏂瓁鐨勭珛鏂规牴鏄惁鏄痑锛宐鐨勫洜鏁般€傘€?/p>
浠g爜
/*************************************************************************
> File Name: v.cpp
> Author: LiuGeXian
> Mail: 1019630230@qq.com
> Created Time: 2020/4/22 11:01:25
************************************************************************/
#include <bits/stdc++.h>
using namespace std;
int T;
int main(){
scanf("%d", &T);
while (T--){
long long a, b;
scanf("%lld %lld", &a, &b);
long long x = a * b;
long long y = pow(x, 1 / 3.0) + 0.5;
if (y * y * y != x || a % y || b % y) printf("No
");
else printf("Yes
");
}
return 0;
}
以上是关于CF833A The Meaningless Game 鎬濈淮的主要内容,如果未能解决你的问题,请参考以下文章
Codeforces 833A The Meaningless Game - 数论 - 牛顿迭代法 - 二分法
CF1110C Meaningless Operations
CF - 1110 C Meaningless Operations
CF-1110C-Meaningless Operations
Codeforces Round #426 (Div. 2) C. The Meaningless Game (二分 or pow函数)