いろいろがんばりたいブログ

情報科学科の人がいろいろ書きます。

2013-03-01から1ヶ月間の記事一覧

POJ 1258,2031

どちらも最小全域木を求める。 なんとなく、クラスカル法のほうが簡単な気がするのでそちらを採用することにする。1258 #include <iostream> #include <cstdio> #include <iomanip> #include <vector> #include <map> #include <set> #include <queue> #include <bitset> #include <stack> #include <utility> #include <numeric> #include <algorithm> #includ</algorithm></numeric></utility></stack></bitset></queue></set></map></vector></iomanip></cstdio></iostream>…

20歳になったので

これからのことについて考える。 ついでに3年生になってからのことについても考える。まぁ色々やることはあるんだけど、きちんと大学にいって勉強する。 今の自分の一番のタスクは競技プログラミングになってるんだけど、そっちのことは今年に入るときに書い…

SRM 442 UnderPrimes

A →問題についてはこちらの方のブログを見てください。 http://topcoder.g.hatena.ne.jp/namakemono_srm/20111017/1318834809高速な解法 まず素数をふるって求める。 その後DPで素因数の数を数える。 最悪ケースでも4ms const int M = 100010; bool isPrime[…

佐々政孝先生の最終講義

東工大の佐々政孝先生の最終講義に行ってきました。 佐々先生はコンパイラの最適化周りの先生です。 http://www.is.titech.ac.jp/~sassa/lab/index-j.html最終講義の内容としては、今までの論文についての紹介という感じで、 CoinsにおけるSSAの最適化、最適…

Codeforces 172 Div2

A Word Capitalization http://www.codeforces.com/problemset/problem/281/A ほんとにやるだけ。 これはtoupper(char)を知っているかどうかで割とはやくかけるかどうか決まる。 toupperはcctypeにはいっていて、簡単に小文字から大文字に変換する関数。。 c…

Twitterやめたい。

Twitterばっかりやってるのすごく時間を無駄にしているので止めたい。 というわけでこっちをがりがり書くことにして、Twitterは見ないことにする。

ディスプレイの話

ディスプレイの好みについてのお話。ぼくは4:3ディスプレイが好きだ。 XGA,UXGAといった、最近あまり見ない解像度のモニターが好きだ。 最近は16:10だったり、16:9がはやっていて、事実、家にいくらかそういうモニタがある。 でも、なんだかんだいって4:3が…

CodeForces 159D Palindrome pairs

string s が与えられる。 この中に、互いに素な回文、a,bのペアはいくつあるか。想定解法はDPらしいけど、ごり押しで通った。計算量的にはO(n^2)かO(n^2logn)くらい? #include <iostream> #include <vector> #include <string> using namespace std; typedef long long ll; int main()</string></vector></iostream>…

TopCoder 2013 Open Round 1 C

250 なんかこう、バランスよく上に上げていけばいいかなって思った。 class TheArray { public: int find(int n, int d, int first, int last) { n -= 2; if(first > last) swap(first,last); int retval = last; int due = 0; if(first < last){ for(due=1;…

Priority_queue

めも。 #include <queue> #include <iostream> using namespace std; typedef pair<int,int> pii; struct Comp{ bool operator()(pii left,pii right){ if(left.second < right.second) return true; else if(left.second == right.second and left.first > right.first) return true; </int,int></iostream></queue>…

TopCoder SRM 572 NextOrPrev

本番ではiとjの間違いで死んだ。条件がすごい厄介 class NextOrPrev { public: int getMinimum(int nextCost, int prevCost, string start, string goal) { vector<pair<char,char> > up; vector<pair<char,char> > down; vector<char> non; for(int i=0;i</char></pair<char,char></pair<char,char>

CodeForces 4B Before an Exam

http://codeforces.com/problemset/problem/4/BTable[i][j] = i日目まで(i日目も含め)に勉強した量がjに等しくなるか でDPします。 経路復元はがんばってやれば大丈夫。練習あるのみ。 #include <iostream> #include <vector> #include <algorithm> using namespace std; #define all(c) c</algorithm></vector></iostream>…

ArchLinuxでこまったこと

なんかvimとか文字化けしてる。 > /etc/locale.conf かきわすれてた。 Evinceがなんか日本語表示してくれない。 > poppler-dataインストールしてなかった。

デスクトップを買った

ついカッっとなって買った。 まぁ色々理由はあるんだけど。アキバで買ってきました。かえるのがつらかったです。 ThinkCentre M91p というやつです。35000円くらいでした。 ついでにDisplayPort -> DVIケーブルも。これは1200円くらい。 今はあまってたIntel…