博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Just a Simple Problem
阅读量:2037 次
发布时间:2019-04-28

本文共 1273 字,大约阅读时间需要 4 分钟。

题解:虽然不知道题目在干嘛

但是跑了几分钟的暴力,似乎是素数,就AC了

/**@Author:   STZG*@Language: C++*/#include 
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define DEBUG#define RI register intusing namespace std;typedef long long ll;//typedef __int128 lll;const int N=10000;const int MOD=1e9+7;const double PI = acos(-1.0);const double EXP = 1E-8;const int INF = 0x3f3f3f3f;int t,n,m,k,q;bool prime(int x){ int s=(int)sqrt(x); for(int i = 2; i <=s; i++){ if(x%i==0)return 0; } return 1;}int main(){#ifdef DEBUG //freopen("input.in", "r", stdin); //freopen("output.out", "w", stdout);#endif scanf("%d",&t); while(t--){ scanf("%d",&n);// for(int n = 2; n <=1001; n++){// int flag=0;// for(int i = 1; i <=n; i++){// for(int j = 1; j <=n-i; j++){// for(int k = 1; k <=n-i-j; k++){// for(int l = 1; l <=n-i-j-k; l++)// if(i*j==k*l&&i+j+k+l==n){flag=1;//cout <
<<" "<< i<<" "<
<<" "<
<<" "<
<< endl;// break;// }if(flag)break;// }//// if(flag)break;// }//// if(flag)break;// }//// if(!flag)cout << n << endl;// } if(n<4) cout << "No" << endl; else if(prime(n)) cout << "No" << endl; else cout << "Yes" << endl; } //cout << "Hello world!" << endl; return 0;}

 

转载地址:http://kfzof.baihongyu.com/

你可能感兴趣的文章
linux命令ps aux|grep xxx详解
查看>>
MySQL常见问题
查看>>
Spring Boot 入门之缓存和 NoSQL 篇(四)
查看>>
使用Docker高效搭建开发环境
查看>>
微服务下的数据架构
查看>>
Nginx 容器教程
查看>>
linux下的命令: sudo ln -s 源文件 目标文件
查看>>
关于 Mybatis mapping.xml中的 StatementType 知识点
查看>>
小议“悲观锁和乐观锁”的原理、场景、示例
查看>>
面试中的这些坑,你踩过几个?
查看>>
socket,tcp,http三者之间的区别和原理
查看>>
Spring AOP 最热门面试题及答案
查看>>
Union和Union All到底有什么区别
查看>>
java读取txt文件,使用正则表达式获取信息
查看>>
exists\not exists和in\not in效率
查看>>
SQL删除重复数据只保留一条
查看>>
SonarQube 跳过指定检查
查看>>
java map遍历使用并行流
查看>>
jsp页面中jstl标签详解 包括< c> <c> <c>
查看>>
hibernate hql 同时更新多个字段
查看>>