zoj 1394 Polar Explorer
2013-02-13 16:57
381 查看
Using this information along with how much gasoline is available for your planet-rover (which gets a measley 5 miles per gallon), you have to determine if you can possibly get to the crash site and back without running out of fuel.
注意题目所说的是来回车程,而且所给的角不一定就是车所走的路线对应的角。。还需判断若角度大于180度,则应该选择小于180的角走。。
注意题目所说的是来回车程,而且所给的角不一定就是车所走的路线对应的角。。还需判断若角度大于180度,则应该选择小于180的角走。。
#include<iostream> #include<string.h> using namespace std; #define PI 3.14159 int main() { int r,y,o,v=5; char s[10]; float l; while(cin>>s) { if(strcmp(s,"START")==NULL) { cin>>r>>y>>o>>s; if(o>180)o=360-o; l=o*1.0/360*2*PI*r; if(v*y>=2*l)cout<<"YES "<<(int)(v*y-2*l)/v<<endl; else cout<<"NO "<<v*y<<endl; } else if(strcmp(s,"ENDOFINPUT")==NULL)break; } return 0; }
相关文章推荐
- ZOJ 1394 Polar Explorer
- zoj 1394 Polar Explorer
- ZOJ 1394 Polar Explorer
- ZOJ Problem Set - 1394 Polar Explorer
- ZOJ 1394 Polar Expoler
- ZOJ-1394
- HDU 1394 &amp; ZOJ 1484 Minimum Inversion Number
- ZOJ 1484 HDU 1394 Minimum Inversion Number / 线段树单点更新
- zoj 1484 || hdu 1394 Minimum Inversion Number
- 1394_Polar Explorer
- hdu 1394 zoj 1484 求旋转序列的逆序数(并归排序)
- ZOJ 1394 外星人探索
- hdu 1394 zoj 1484 求旋转序列的逆序数(并归排序)
- HDU 1394 & ZOJ 1484 Minimum Inversion Number
- ZOJ 1092 图论中的Floyd算法简单应用
- ZOJ 1240 IBM Minus One
- ZOJ 3179 Calculate With Abacus(数学啊 )
- ZOJ Saddle Point 数学思维题
- ZOJ Problem Set - 2972 Hurdles of 110m
- ZOJ 3732 2013 ACM/ICPC 长沙赛区现场赛G题 Graph Reconstruction (图论)