UESTC--1272--Final Pan's prime numbers(水题)
Time Limit: 1000MS | Memory Limit: 65535KB | 64bit IO Format: %lld & %llu |
Description
Final Pan likes prime numbers very much.
One day, he want to find the super prime numbers.A prime numbers $n$($n$>4) is a super prime number only if $n$-4 and $n$+4 are both prime numbers,too.
Your task is really easy:Give $N$,find the maximum super prime number $n$ that $n$<=$N$.
Input
Only one integer $N.( 4<N<10^{12} )$
Output
If there is no such interger $n$,print'$-1$',otherwise print $n$.
Sample Input
8
Sample Output
7
Hint
Source
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
long long n;
while(scanf("%lld",&n)!=EOF)
{
if(n<7)
printf("-1\n");
else
printf("7\n");
}
return 0;
}
UESTC--1272--Final Pan's prime numbers(水题)的更多相关文章
- UESTC 1272 Final Pan's prime numbers(乱搞)
题目链接 Description Final Pan likes prime numbers very much. One day, he want to find the super prime n ...
- CDOJ 1272 Final Pan's prime numbers
有些问题,不做实践与猜测,可能一辈子也想不出答案,例如这题. #include<stdio.h> #include<math.h> long long x; int main( ...
- POJ.2739 Sum of Consecutive Prime Numbers(水)
POJ.2739 Sum of Consecutive Prime Numbers(水) 代码总览 #include <cstdio> #include <cstring> # ...
- VK Cup 2016 - Qualification Round 2 A. Home Numbers 水题
A. Home Numbers 题目连接: http://www.codeforces.com/contest/638/problem/A Description The main street of ...
- Codeforces Round #310 (Div. 2) B. Case of Fake Numbers 水题
B. Case of Fake Numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/5 ...
- hdu 5272 Dylans loves numbers 水题
Dylans loves numbers Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem. ...
- Codeforces Round #358 (Div. 2) A. Alyona and Numbers 水题
A. Alyona and Numbers 题目连接: http://www.codeforces.com/contest/682/problem/A Description After finish ...
- Educational Codeforces Round 13 A. Johny Likes Numbers 水题
A. Johny Likes Numbers 题目连接: http://www.codeforces.com/contest/678/problem/A Description Johny likes ...
- Codeforces Round #356 (Div. 2) C. Bear and Prime 100 水题
C. Bear and Prime 100 题目连接: http://www.codeforces.com/contest/680/problem/C Description This is an i ...
随机推荐
- os.clock()导致的bug
os.clock () 功能:返回一个程序使用CPU时间的一个近似值 最近做了一个功能,这个功能需要统计时间间隔,例如每隔0.5秒做一次调用. 我用了os.clock()去统计时间,结果在pc机上都没 ...
- 原生js做h5小游戏之打砖块
前言 首先,先说明一下做这个系列的目的:其实主要源于博主希望熟练使用 canvas 的相关 api ,同时对小游戏的实现逻辑比较感兴趣,所以希望通过这一系列的小游戏来提升自身编程能力:关于 es6 语 ...
- 利用a链接发送电子邮件
实例代码: <a href="mailto:name1@rapidtables.com?cc=name2@rapidtables.com&subject=你好%20我是&quo ...
- (转)19 个 JavaScript 有用的简写技术
1.三元操作符 当想写if...else语句时,使用三元操作符来代替. const x = 20; let answer; if (x > 10) { answer = 'is greater' ...
- LeetCode 42. Trapping Rain Water 【两种解法】(python排序遍历,C++ STL map存索引,时间复杂度O(nlogn))
LeetCode 42. Trapping Rain Water Python解法 解题思路: 本思路需找到最高点左右遍历,时间复杂度O(nlogn),以下为向左遍历的过程. 将每一个点的高度和索引存 ...
- 学习SQL笔记
SQL 语句 语法 AND / OR SELECT column_name(s)FROM table_nameWHERE conditionAND|OR condition ALTER TABLE A ...
- spring的四种数据源配置
DriverManagerDataSource spring自带的数据源,配置如下: <bean id="dataSource" class="org.spr ...
- js页面传值,cookie
// 获取页面穿值 function GetQueryString(name) { var reg = new RegExp("(^|&)" + name + " ...
- Jquery 研究 入口
<script type="text/javascript"> //var jQuery = function () { // console.log(jQuery.f ...
- openlayers5学习笔记-001
tmp.initPoint = function (items) { //初始化所有农户点坐标,聚合 var count = items.length; var features = new Arra ...