1132 Cut Integer(17行代码)

news/2024/10/23 12:38:51/

分数 20

全屏浏览题目

切换布局

作者 CHEN, Yue

单位 浙江大学

Cutting an integer means to cut a K digits lone integer Z into two integers of (K/2) digits long integers A and B. For example, after cutting Z = 167334, we have A = 167 and B = 334. It is interesting to see that Z can be devided by the product of A and B, as 167334 / (167 × 334) = 3. Given an integer Z, you are supposed to test if it is such an integer.

Input Specification:

Each input file contains one test case. For each case, the first line gives a positive integer N (≤ 20). Then N lines follow, each gives an integer Z (10 ≤ Z <231). It is guaranteed that the number of digits of Z is an even number.

Output Specification:

For each case, print a single line Yes if it is such a number, or No if not.

Sample Input:

3
167334
2333
12345678

Sample Output:

Yes
No
No

代码长度限制

16 KB

时间限制

400 ms

内存限制

64 MB

#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    string s;
    for(int i=0;i<n;i++){
        cin>>s;
        int len=s.size();
        int a=stoi(s.substr(0,len/2));
        int b=stoi(s.substr(len/2));
        int c=a*b;
        if(c!=0&&stoi(s)%c==0)puts("Yes");
        else puts("No");
    } 
    return 0;
}


http://www.ppmy.cn/news/212918.html

相关文章

金立S8 线刷

由于金立s8广告太多&#xff0c;想通过线刷刷回以前版本&#xff0c;记录关键内容&#xff1a; 1.进REC方式&#xff1a;按电源键音量上键&#xff0c;选择REC&#xff0c;进入机器人倒地界面&#xff0c;按电源键音量下键五秒后按电源上键&#xff0c;进入REC 2. 线刷方式&a…

金立android在哪里设置密码,金立s5.5手机怎么设置锁屏密码 金立s5.5屏幕密码设置教程...

金立s5.5怎么设置屏幕密码&#xff1f;手机里有隐私&#xff0c;不想让别人看到如何设置屏幕密码呢&#xff1f;下面脚本之家小编为大家介绍下s5.5设置屏幕密码教程&#xff01;不知道的赶快来看下吧&#xff01; 1.在手机界面点击“设置”&#xff0c;之后会出现“滑动”、“图…

联发科6758_搭载MTK MT6758!金立M7现身跑分网站

随着流行趋势的变化&#xff0c;当前众手机厂商的目光都盯紧了全面屏领域&#xff0c;已上市的全面屏产品之外&#xff0c;另有多家厂商明确表态下半年会有全面屏新品面世&#xff0c;其中就包括金立手机&#xff0c;金立官方早早便宣布&#xff0c;下半年重点发力全面屏领域&a…

金立(Gionee)金立M7 Power root 大金刚 GN5007 刷机TWRP 面具 XP框架 线刷包

刷机 免解锁BL 刷精简官方系统&#xff0c;如果需要售后刷机软件 请联系获取免费获取 成功安装框架、 成功 root 金立(Gionee)金立M7 Power root 大金刚 GN5007 刷机TWRP 面具 XP框架,手机root刷机包 柒叁伍叁玖肆零零陆 &#xff08; 转换成小写数字&#xff09; 远程ro…

金立android手机怎么截图,金立M6手机怎么截图 金立M6截屏/截图方法(两种)

昨天下午&#xff0c;国产老牌手机厂商金立发布了M6安全长续航手机&#xff0c;这款手机主要有两大亮点&#xff0c;一是超级续航&#xff0c;而是内置安全加密芯片。注重续航和安全的用户可能会更加看中这点准备入手。如今就有网友开始咨询金立M6怎么截图&#xff0c;为此脚本…

金立卒于 16 岁

金立的没落&#xff0c;是技术更迭浪潮里守旧者的残酷结局&#xff0c;是企业难以把控资金流向的失控之殇&#xff0c;也可能是董事长个人行为酿下的苦果。 作者 | Yesse& Yorke 责编 | 胡巍巍 一家2017年上半年还有7.6亿元盈利的公司&#xff0c;如何会在一年内迅速走向…

RTMPose关键点检测实战——笔记3

文章目录 摘要安装MMPose安装虚拟环境安装pytorch安装MMCV安装其他的安装包下载 MMPose下载预训练模型权重文件和视频素材 安装MMDetection安装Pytorch安装MMCV安装其它工具包下载 MMDetection安装MMDetection下载预训练模型权重文件和视频素材 MMPose预训练模型预测命令行的方…

GIONEE A1 金立A1 root 刷机包 GIONEE SWW1609_0201 mt6755

金立A1 手机root 精简刷机包 ro.build.dateThu Dec 29 18:14:54 CST 2016 ro.build.date.utc1483006494 ro.build.descriptionfull_gnsz6755_66_n-user 7.0 NRD90M 1483006497 release-keys ro.build.display.idwww.aialbb.com ro.build.fingerprintGIONEE/A1/GIONEE_SWW1609:…