USACO-Ride
USACO的第一题
我遇到的问题:
1.语言障碍.............全英文的啊,nocow挂了啊,找了一个翻译网站,text没翻译啊!
2.提交问题.............就感觉那A+B的题目提交代码诡异啊.居然用文件,后悔没看文件的内容了,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
好吧,一点点的搞,我注意到了fout和fin两个奇怪的东西,f是神马......终于想到应该是file..然后提交问题就解决了........
3.9999999..............因为艾神讲的MAP,害的我脑子就想到MAP,用MAP<A>=1,,,居然脑残的没想到用减法..........
第一个代码:用MAP和char数组了....
4.宇宙惯例:入门了以后就发武功秘籍.可惜这武功秘籍是洋文的,看不懂,,,,,,没人翻译一下吗!
武功秘籍:
Hal Burch conducted an analysis over spring break of 1999 and made an amazing discovery: there are only 16 types of programming contest problems! Furthermore, the top several comprise almost 80% of the problems seen at the IOI. Here they are:
- Dynamic Programming
- Greedy
- Complete Search
- Flood Fill
- Shortest Path
- Recursive Search Techniques
- Minimum Spanning Tree
- Knapsack
- Computational Geometry
- Network Flow
- Eulerian Path
- Two-Dimensional Convex Hull
- BigNums
- Heuristic Search
- Approximate Search
- Ad Hoc Problems
The most challenging problems are Combination Problems which involve a loop (combinations, subsets, etc.) around one of the above algorithms - or even a loop of one algorithm with another inside it. These seem extraordinarily tricky to get right, even though conceptually they are ``obvious''.
If you can master solving just 40% of these problem types, you can almost guarantee a silver medal at the IOI. Mastering 80% moves you into the gold range almost for sure. Of course, `mastery' is a tough nut to crack! We'll be supplying a plethora of problems so that you can hone your skills in the quest for international fame.
/* ID: Cvid Kal PROG: ride LANG: C++ */ #include <iostream> #include <fstream> #include<string> using namespace std; int main() { ofstream fout ("ride.out"); ifstream fin ("ride.in"); string s1,s2; int i,sum1,sum2; fin >> s1 >> s2; int len1=s1.length(),len2=s2.length();//这句是从别人那里看来的 for(i=0,sum1=1;i<len1;i++) sum1*=(s1[i]-'A'+1); for(i=0,sum2=1;i<len2;i++) sum2*=(s2[i]-'A'+1); if(sum1%47==sum2%47) fout<<"GO"<<endl; else fout<<"STAY"<<endl; return 0; }