题目链接:http://bailian.openjudge.cn/practice/1005/ 思路 一个半圆面积每年增长50,已知一个点坐标,求第几年点在半圆内. #include <stdio.h> #include <math.h> #define pai 3.1415926 int main() { int n; double x,y; scanf("%d",&n); for(int i=0;i<n;i++) { scanf("%…
杭电OJ [1005](http://acm.hdu.edu.cn/showproblem.php?pid=1005): #####Problem Description > A number sequence is defined as follows: f(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. Given A, B, and n, you are to calculate the value of f(n)…
POJ. 1005 I Think I Need a Houseboat(水 ) 代码总览 #include <cstdio> #include <cstring> #include <cmath> #include <queue> #include <stack> #include <vector> #define nmax using namespace std; const double pi = acos(-1); int m…
http://www.lightoj.com/volume_showproblem.php?problem=1005        PDF (English) Statistics Forum Time Limit: 1 second(s) Memory Limit: 32 MB A rook is a piece used in the game of chess which is played on a board of square grids. A rook can only move…
题目链接:http://www.lightoj.com/volume_showproblem.php?problem=1005 纸上画一下,找了一下规律,Ank*Cnk. //#pragma comment(linker, "/STACK:102400000, 102400000") #include <algorithm> #include <iostream> #include <cstdlib> #include <cstring>…
时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:5646 解决:1632 题目描述: It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you could write a program to automate the admission p…
题目1005:Graduate Admission 时间限制:1 秒 内存限制:32 兆 特殊判题:否 提交:6182 解决:1791 题目描述:                        It is said that in 2011, there are about 100 graduate schools ready to proceed over 40,000 applications in Zhejiang Province. It would help a lot if you…
题目大意: 给你一个N和K要求确定有多少种放法,使得没有两个车在一条线上. N*N的矩阵, 有K个棋子. 题目分析: 我是用DP来写的,关于子结构的考虑是这样的. 假设第n*n的矩阵放k个棋子那么,这个推导过程如下.   当我们们第n*n的矩阵的时候可以考虑第(n-1)*(n-1)的矩阵经过哪些变换可以变成n*n的. 如上图蓝色方格.我们加入蓝色方格之后,矩阵就会增大一圈. 1.加入我们蓝色方格不放置棋子. dp[n-1][k] 2.加入蓝色方格放置一枚棋子,那么我们其实有三种位置可以放置:(1…
题意: 从 n*n 的棋盘中放置 K 个 行和列不冲突的棋子 思路: 组合数学, 先选 k 个 行, k 个列, 就是 C(n,k) ^ 2; 然后 K 个棋子不相同, K ! 全排列 #include<bits/stdc++.h> using namespace std; typedef long long LL; LL Num[40][40]; void Init() { Num[0][0] = 1; for(int i = 1; i <= 30; ++i) { Num[i][0]…
版权声明:本文作者靖心.靖空间地址:http://blog.csdn.net/kenden23/,未经本作者同意不得转载. https://blog.csdn.net/kenden23/article/details/31760795 A rook is a piece used in the game of chess which is played on a board of square grids. A rook can only move vertically or horizonta…
sky同学在努力地刷题..,在这题卡住了,于是一起研究了一下... 这题本身挺简单的,(1) = 1, f(2) = 1, f(n) = (A * f(n - 1) + B * f(n - 2)) mod 7. 递推公式本身是mod7的...所以f(n-1)和f(n-2)最多只有49种状态,根据鸽巢原理在50以内必定循环. 只要推导出周期和循环的起始位置就行了.一开始只算了周期,没考虑从哪里开始循环,但竟然神奇地AC了...后来想了想觉得不对,应该加入循环的起始位置. 经过手动验证 7 7 49…
http://bailian.openjudge.cn/practice/2767/ #include<iostream> #include <cmath> #include <math.h> #include <vector> #include <algorithm> #include <map> #include <string> //#include <string.h> #include <uno…
http://bailian.openjudge.cn/ss2017/A/ #include<iostream> #include <cmath> #include <math.h> #include <vector> #include <algorithm> struct Student { int num; int chinese; int math; int english; int getAllGrade() { return chine…
题目链接:http://bailian.openjudge.cn/practice/1007 #include<stdio.h> #include<algorithm> using namespace std; typedef struct number{ char s[51]; int num; }; int n,len; number myn[101]; bool cmp( number a, number b ) { return a.num < b.num; } in…
题目链接:http://bailian.openjudge.cn/practice/1004/ 思路 求和取平均... #include <stdio.h> int main() { float sum=0,a; for(int i=0;i<12;i++) { scanf("%f",&a); sum += a; } printf("$%.2f\n",sum/12); return 0; }…
题目链接 思路 求一个数列的前n项和(1/2, 1/3, ...., 1/n)大于所给数所需的项数. #include<stdio.h> int main() { float a; while( scanf("%f",&a) ) { if( a == 0.0 ) break; int n=2; float sum =0; while( sum < a ) { sum += 1.0/n; n++; } printf("%d card(s)\n"…
题目链接 思路 开个一千万的数组计数,最后遍历即可. #include<stdio.h> #include<string.h> #include<algorithm> using namespace std; int num=0; int mymap[10000000] = {0}; int change(char a[201]) { int j=0, result=0; for(int i=0;i<strlen(a);i++) { if(a[i] == '-')…
题目链接 哇一遍AC的感觉也太爽了吧:) #include <stdio.h> #include <string.h> int times=0; char *myCalc(char source[1000], char s[1000], int times) { if( times == 0 ) return s; int last=0,a=strlen(source),b=strlen(s); char res[1000]={0}; for(int i=0;i<(a+b-1…
1.链接地址: http://bailian.openjudge.cn/practice/1005/ http://poj.org/problem?id=1005 2.题目: I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 82376   Accepted: 35628 Description Fred Mapper is considering purchasing…
I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 85149   Accepted: 36857 Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land,…
#include <iostream> using namespace std; const double pi = 3.1415926535; int main() { ;; double x,y; cin >> t; while(t--) { ++time; cin >> x >> y; double area = pi*(x*x + y*y); ; cout<<"Property "<<time<<…
一. 题目 I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 97512   Accepted: 42430 Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the…
    I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 81874   Accepted: 35368 Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the la…
I Think I Need a Houseboat Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 105186   Accepted: 45827 Description Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land,…
1005:I Think I Need a Houseboat 总时间限制:  1000ms 内存限制:  65536kB 描述 Fred Mapper is considering purchasing some land in Louisiana to build his house on. In the process of investigating the land, he learned that the state of Louisiana is actually shrinkin…
Cow Laundry Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 1376 Accepted: 886 Description The cows have erected clothes lines with N (1 <= N <= 1000) wires upon which they can dry their clothes after washing them. Having no opposable thu…
POJ 排序的思想就是根据选取范围的题目的totalSubmittedNumber和totalAcceptedNumber计算一个avgAcceptRate. 每一道题都有一个value,value = acceptedNumber / avgAcceptRate + submittedNumber. 这里用到avgAcceptedRate的原因是考虑到通过的数量站的权重可能比提交的数量占更大的权重,所以给acceptedNumber乘上了一个因子. 当然计算value还有别的方法,比如POJ上…
以下是poj百道水题,新手可以考虑从这里刷起 搜索1002 Fire Net1004 Anagrams by Stack1005 Jugs1008 Gnome Tetravex1091 Knight Moves1101 Gamblers1204 Additive equations 1221 Risk1230 Legendary Pokemon1249 Pushing Boxes 1364 Machine Schedule1368 BOAT1406 Jungle Roads1411 Annive…
Description zyf不小心得了一种怪病,为了维持一天的精力他必须不停跳动.于是他买了一条跳舞毯,每天跳上几小时.众所周知,跳舞毯是给定一个序列,让你在指定时间踏指定的按钮,但zyf似乎不怎么擅长,为此他写了个外挂,以修改它的输入序列,得到满分! 这个外挂的厉害之处在于它能等到zyf跳完.输入序列后再进行修改,修改的方式有三种,在任意位置插入.删除或替换一个指令,每次插入需要a时间,删除需要b时间,替换需要c时间,现在zyf想用最短时间去修改他输入的序列得到满分(即与给定序列一样),但这…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1005 Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 85249    Accepted Submission(s): 20209 Problem Description A number sequence…