2010-11-08から1日間の記事一覧

PKU 3617 Best Cow Line

3617 -- Best Cow Line #include <iostream> #include <string> #include <algorithm> using namespace std; int main(){ int N; cin>>N; string s; for(int i = 0; i < N; i++){ char c; cin>>c;s += c; } string t, u; while(!s.empty()){ u = s; reverse(u.begin(), u.end()); if(u > s</algorithm></string></iostream>…

PKU 2386 Lake Counting

2386 -- Lake Countingアリ本もう一冊手に入れたので読み進めていく事にした。 #include <iostream> #include <vector> #include <string> using namespace std; bool inline validate(int x, int y, vector<string>& v){ return (0 <= x) && (x < v.size()) && (0 <= y) && (y < v[0].size());</string></string></vector></iostream>…