2011-04-02から1日間の記事一覧

ubuntu+gVimでgVimからクリップボードにコピー

「"+y」ーーーーー*じゃないって:h clipboardに書いてあった

SRM336 div2 hard

図を書いて1つ1つ考えれば難しくない。 …3回くらいresubmitしたけどね。 #include <algorithm> #include <vector> using namespace std; class MostLikely { public: int likelyRank(vector <int> sc, int low, int high) { vector<int> rank(55,0); sc.push_back(1000000000+1); sc.pus</int></int></vector></algorithm>…

SRM499 div2 hard

点数が高い順にソートして貪欲に取っていけばOK。 pair使うのが面倒だったのでバブルソートしてみた。 #include <algorithm> #include <string> #include <vector> using namespace std; class PalindromeGame { public: int getMaximum(vector <string> front, vector <int> back) { int n=front.siz</int></string></vector></string></algorithm>…

SRM334 div2 hard

難しい。分からん。 if(happiness[now]==-3) return now; でなんで-3なのかの自分なりのイメージ図。 #include <algorithm> #include <cstring> #define LIMIT 5000000 typedef long long LL; using namespace std; class ExtendedHappyNumbers { public: int K; int happiness[L</cstring></algorithm>…

SRM381 div2 hard

ソース31行目以降の説明 if(numbers[j]+numbers[j+1]<numbers[j+1]+numbers[j]) swap(numbers[j],numbers[j+1]); ↑の理由 97799999と999とか前の部分(977と999)が等しくない場合 ーーーーー明らかに999のほうが前 33355555と333とか前の部分(333)が等しい場合 ーーーーー並べ方は2通りしかないんだから試せばいい バブルソートっていうところがミソ分からなかったんだけどTopCoder Statisticsで分かった #include <algorithm> #include </numbers[j+1]+numbers[j])>