2014年1月10日

uva 11044 - Searching for Nessy

摘要: 水题中的水题。。。。#includeusing namespace std;int main(){ int n,m; int t; cin>>t; while(t--){ cin>>n>>m; int temp1=n/3; int temp2=m/3; cout<<temp1*temp2<<endl; }} 阅读全文

posted @ 2014-01-10 21:33 云在心 阅读(98) 评论(0) 推荐(0)

uva 10790 - How Many Points of Intersection?

摘要: 这题方法很简单,但是要注意数据类型要用longlong,题目中给出了是64bit的 1 #include 2 using namespace std; 3 int main(){ 4 long a,b,temp=1; 5 while(cin>>a>>b){ 6 if(!a&&!b) 7 break; 8 long long sum=1; 9 if(a<2||b<2){10 cout<<"Case "<<temp++<<": 0"<<endl;11 cont 阅读全文

posted @ 2014-01-10 21:16 云在心 阅读(145) 评论(0) 推荐(0)

uva 10499 - The Land of Justice

摘要: 感觉很简单的一题,但是wa了两次,还是看了网上的代码才知道,虽然N是int型的,但是25*n就不一定是了,改成long就行了#includeusing namespace std;int main(){ long n; while(cin>>n){ if(n<0) break; if(n==1){ cout<<"0%"<<endl; continue; } cout<<n*25<<"%"<<endl; }} 阅读全文

posted @ 2014-01-10 20:18 云在心 阅读(135) 评论(0) 推荐(0)

uva 846 - Steps

摘要: wa了两次才纠正,虽然想法对了,还是要自己先多测几组数据#include#includeusing namespace std;int main(){ int x,y; int n; cin>>n; while(n--){ cin>>x>>y; if(x==y){ cout<<"0"<<endl; continue; } int n = (int)sqrt((double)(y-x)); if(n==1) cout<<y-x<<endl... 阅读全文

posted @ 2014-01-10 17:20 云在心 阅读(150) 评论(0) 推荐(0)

uva 573 - The Snail

摘要: 很简单,不过还是wa了几次,才做对#includeusing namespace std;int main(){ int h,speed,slide,per; while(cin>>h>>speed>>slide>>per){ if(!h&&!speed&&!slide&&!per) break; h*=100; speed*=100; slide*=100; int d=speed*per/100; int height=0; for(int i=0;;... 阅读全文

posted @ 2014-01-10 14:44 云在心 阅读(125) 评论(0) 推荐(0)

导航