1627

#include<stdio.h>
#include<math.h>
int a[10000];
int prime(int n)
{
 int i;
 if(n==1)
  return 0;
 else if(n==2)
  return 1;
 else
 {
  for(i=2;i<=sqrt(n);i++)
  if(n%i==0) break;
  if(i>sqrt(n))
   return 1;
  else
   return 0;
 }
}
int main()
{
 int j,c=0;
 for(j=1;j<1000000;j++)
 {
  if(prime(j))
   a[c++]=j;
 }
 int n,sum;
 while(scanf("%d",&n)!=EOF)
 {
  sum=0;
  for(i=0;;i++)
  {
   for(j=i;j<10000;j++)
   {
    for(k=i;k<)
   }
  }
 }
}

时间: 2024-07-28 16:09:54

1627的相关文章

FZU 1627 Revival&#39;s road

矩阵快速幂. #pragma comment(linker, "/STACK:1024000000,1024000000") #include<cstdio> #include<cstring> #include<cmath> #include<algorithm> #include<vector> #include<map> #include<set> #include<queue> #i

【暑假】[深入动态规划]UVa 1627 Team them up!

UVa 1627 Team them up! 题目: Team them up! Time Limit: 3000MS   Memory Limit: Unknown   64bit IO Format: %lld & %llu Submit Status Description Your task is to divide a number of persons into two teams, in such a way, that: everyone belongs to one of th

【BZOJ 1627】 [Usaco2007 Dec]穿越泥地

1627: [Usaco2007 Dec]穿越泥地 Time Limit: 5 Sec  Memory Limit: 64 MB Submit: 511  Solved: 332 [Submit][Status] Description 清早6:00,Farmer John就离开了他的屋子,开始了他的例行工作:为贝茜挤奶.前一天晚上,整个农场刚经受过一场瓢泼大雨的洗礼,于是不难想见,FJ 现在面对的是一大片泥泞的土地.FJ的屋子在平面坐标(0, 0)的位置,贝茜所在的牛棚则位于坐标(X,Y) (

hdu - 1627 Krypton Factor (dfs)

http://acm.hdu.edu.cn/showproblem.php?pid=1627 给定 n 和 L 找出第n个范围在0-L之内的字符串,字符串要求没有相邻的子串是相同的. 按照格式输出. 这个题的关键在于判断字符串是否是符合要求的字符串. 枚举字符串所有子串可能的长度,然后判断即可. #include <iostream> #include <cstdio> #include <cmath> #include <vector> #include

1627: [Usaco2007 Dec]穿越泥地

1627: [Usaco2007 Dec]穿越泥地 Time Limit: 5 Sec  Memory Limit: 64 MBSubmit: 504  Solved: 325[Submit][Status] Description 清早6:00,Farmer John就离开了他的屋子,开始了他的例行工作:为贝茜挤奶.前一天晚上,整个农场刚经受过一场瓢泼大雨的洗礼,于是不难想见,FJ 现在面对的是一大片泥泞的土地.FJ的屋子在平面坐标(0, 0)的位置,贝茜所在的牛棚则位于坐标(X,Y) (-5

Problem 2238 Daxia &amp; Wzc&#39;s problem 1627 瞬间移动

http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1627 http://acm.fzu.edu.cn/problem.php?pid=2238 对应的51NOD这个题,先把n--和没m-- 再套公式 #include <cstdio> #include <cstdlib> #include <cstring> #include <cmath> #include <algorit

BZOJ 1627: [Usaco2007 Dec]穿越泥地( BFS )

BFS... --------------------------------------------------------------------------------------- #include<cstdio> #include<algorithm> #include<cstring> #include<queue> #include<iostream> #define rep( i , n ) for( int i = 0 ; i

一本通1627【例 3】最大公约数

1627:[例 3]最大公约数 时间限制: 1000 ms         内存限制: 524288 KB [题目描述] 给出两个正整数 A,B,求它们的最大公约数. [输入] 输入共两行,第一行一个正整数 A,第二行一个正整数 B. [输出] 在第一行输出一个整数,表示 A,B 的最大公约数. [输入样例] 18 24 [输出样例] 6 [提示] 数据范围与提示: 对于 60% 的数据,1≤A,B≤1018: 对于 100% 的数据,1≤A,B≤103000 . sol:Super Gcd,高

UVa 1627 - Team them up!——[0-1背包]

Your task is to divide a number of persons into two teams, in such a way, that: everyone belongs to one of the teams; every team has at least one member; every person in the team knows every other person in his team; teams are as close in their sizes

51nod 1627 瞬间移动

题意: 有一个n * m的矩形,一开始从(1, 1)开始,每次能够到达右下方格子的一个格子,求到达(n, m)的方案数. 题解: 很显然最多走min (n - 2, m - 2) + 1步,枚举步数K,答案为 求和 C(n - 2, K - 1) * C(m - 2, K - 1) 代码: #include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int N = 1e5 + 7; #define L