poj
treble_
这个作者很懒,什么都没留下…
展开
-
poj1005
#includeusing namespace std;int main(void){ int n; cin>>n; double x[n],y[n]; int a[n]; for(int i=0;i<n;i++) { cin>>x[i]>>y[i]; int z=(x[i]*x[i]+y[i]*y[i])*3.原创 2018-01-22 19:23:48 · 150 阅读 · 0 评论 -
poj1007
用二维数组存要输入DNA序列,依次计算其中的反转数个数已经并存入另一个数组中,再每次挑选个数最少的输出DNA序列。select函数为每次找最小值函数,关键在于如何在下一次找最小值时排除之前已经输出的,在此用了结构体,其中有两个数据,一个存反转数个数,一个为标志表示该数值是否已经使用过。#includeusing namespace std;struct number{ int原创 2018-01-24 15:25:31 · 141 阅读 · 0 评论 -
poj1003
HangooverDescriptionHow far can you make a stack of cards overhang a table? If you have one card, you can create a maximum overhang of half a card length. (We're assuming that the cards must be perpen...原创 2018-03-08 21:15:03 · 272 阅读 · 0 评论 -
poj1013
解题思路参照他人,大概为每一枚硬币有两个元素,一为是否为真币,一为被怀疑为假币的程度。初始全为假币,且怀疑程度为0。当两边相等时则可确定为真币,当不相等时轻的一边怀疑程度减一,重的这边怀疑程度加一,当最后未被确定为真币且怀疑程度最大的则为假币,再根据其怀疑程度的正负判断是轻了还是重了。#include<iostream>using namespace std;typedef...原创 2018-02-09 13:56:04 · 149 阅读 · 0 评论 -
poj1004
简单的一个水题不过我之前以为%.2f表示保留两位小数只是取两位而不是四舍五入取两位,现在发现是四舍五入。#include#includeusing namespace std;int main(void){ double a[12]; double sum=0.00; for(int i=0;i<12;i++) { cin>>a[i];原创 2018-01-20 16:09:34 · 156 阅读 · 0 评论 -
poj1008
#include#includeusing namespace std;int main(){ string cale1[] = {"pop", "no", "zip", "zotz", "tzec", "xul", "yoxkin", "mol", "chen", "yax", "zac", "ceh", "mac", "kankin", "muan", "pax", "koyab原创 2018-02-05 21:46:35 · 195 阅读 · 0 评论 -
poj1519
一开始没考虑到大数,wa了,之后改成字符串输入,再一个个转为整型相加#include<iostream>using namespace std;int main(void){ string s; int sum; while(cin>>s&&((int)s[0]-48!=0)) { int m=0; ...原创 2018-03-08 21:13:02 · 213 阅读 · 0 评论 -
poj2017、poj2665
poj2017 #include<iostream>using namespace std;int main(void){ int n; while(cin>>n&&n!=-1) { int miles=0; int a[n],b[n]; cin>>a[0]&...原创 2018-03-09 14:48:53 · 162 阅读 · 0 评论 -
poj2000,poj2390,poj2509
poj2000#include<iostream>using namespace std;int main(void){ int n; while(cin>>n&&n!=0) { int num=0; int i,m; for(i=1;;i++) { ...原创 2018-03-17 16:51:36 · 178 阅读 · 0 评论