2005-12-01から1ヶ月間の記事一覧

#126 http://acm.uva.es/p/v1/126.html

UVa

Sample Outputを見ただけでやる気がなくなる。で、頑張ってみたけどPresentation Error.もう無理。

#124 http://acm.uva.es/p/v1/124.html

UVa

Lexicographical orderに気をつけろ

#122 http://acm.uva.es/p/v1/122.html

UVa

Binary Heapを作るだけ…のはずが入力で不手際があったらしくRuntime Errorとかでてこずった。

帰省。ネットに繋げなかった。

#129 http://acm.uva.es/p/v1/129.html

UVa

(Presentation Error) 未だにコーディング速度遅いなぁ。

構造体のコンストラクタ

C++

struct card { char rank; char suit; card(char r, char s): rank(r), suit(s) { } }; card c = card('K', 'H');便利。

UVaつながらねー

(ずっと)

DrSchemeで2.2.4 Example: A Picture Languageの演習

Windows. [File]->[Install .plt File...]->[Web]->[URL]に"http://www-pu.informatik.uni-tuebingen.de/users/sperber/software/picture.plt"を指定する。 [Language]->[Add Teachpack...]から"C:\Documents and Settings\Username\Application Data\PLT Sc…

#125 http://online-judge.uva.es/p/v1/125.html

UVa

最初はPresentation Error. PEは無視する方針だけど、なんとなくOutputから行末のスペース削除したらAcceptされた。面倒だなぁ。

メタマジック・ゲームが届いた

メタマジック・ゲーム―科学と芸術のジグソーパズル作者: ダグラス・R.ホフスタッター,Douglas R. Hofstadter,竹内郁雄,片桐恭弘,斉藤康己出版社/メーカー: 白揚社発売日: 2005/10/01メディア: 単行本購入: 5人 クリック: 47回この商品を含むブログ (41件) を…

最大公約数を求める

C++

頻出 int gcd(int a, int b) { if (b == 0) return a; else return gcd(b, a % b); }

#101 http://online-judge.uva.es/p/v1/101.html

UVa

#110 http://online-judge.uva.es/p/v1/110.html

UVa

頭痛い。

#121 http://online-judge.uva.es/p/v1/121.html

UVa

"適当な"inputを自分で考えられるようにならなきゃ。

Exerciseとか全然やってないよ

やった方がいいよなぁ…

2.1 Introduction to Data Abstraction

ここまで読んだ。 眠い… Extended Exerciseは後で(気が向いたら)。 Exercise 2.6(チャーチ数) ;; Exercise 2.6 ;; Church Numeral (define zero (lambda (f) (lambda (x) x))) (define (add-1 n) (lambda (f) (lambda (x) (f ((n f) x))))) ; (add-1 zero) ;…

#123 http://online-judge.uva.es/p/v1/123.html

UVa

(Presentation Error) #122がRuntime Error起こしてどうにも分からないので息抜き。

2.2.3 Sequences as Conventional Interfaces

ここまで読んだ。map, filter, fold, append-map.

#120 http://online-judge.uva.es/p/v1/120.html

UVa

break忘れ。

#119 http://online-judge.uva.es/p/v1/119.html

UVa

(Presentation Error)

#118 http://online-judge.uva.es/p/v1/118.html

UVa

MingWのg++は #include <string>と書かなくてもstringが使えてしまってCompile Errorではまる。今回は使わなかったけどINT_MAX,INT_MINを使うような場合はclimitsをインクルードする。</string>

#116 http://online-judge.uva.es/p/v1/116.html

UVa

lexicographically smallestな解が求められてるのに気付くまで時間がかかった。

#107 http://online-judge.uva.es/p/v1/107.html

UVa

問題の検討が致命的に足りない。

UVaの問題にクイックサーチを設定

以下のURLをブックマークして、 javascript:location.href=('%s'>0?'http://online-judge.uva.es/p/v'+Math.floor('%s'/100)+'/'+'%s'+'.html':'http://acm.uva.es/problemset/submit.php')"uva"みたいなキーワードを設定する。ロケーションバーで uva 111と…

iostream

C++

#include <iostream> using namespace std; int main() { int n; char c; cout << "Expecting int: "; cin >> n; cout << "Expecting char: "; cin >> c; cout << "int: " << n << " char: " << c << endl; }これをBorland C++ Compilerでコンパイル、実行する。 Expec</iostream>…

#112 http://acm.uva.es/p/v1/112.html

UVa

iostreamで50分くらい躓いてた。要勉強。

#108 http://acm.uva.es/p/v1/108.html, #111 http://acm.uva.es/p/v1/111.html

UVa

初の一発Accept達成。

1.3 Formulating Abstractions with Higher-Order Procedures

この章まで読んだ。

#115 http://acm.uva.es/p/v1/115.html

UVa

アルゴリズムとか要らないやつ解いても糧にならんのじゃないか?…と思う。

1.2.1 Linear Recursion and Iteration

ここまで読んだ