Author: | draftcode |
---|---|
Date: | 2011-11-11T13:18:07+09:00 |
ID: | 289a0136-0c1c-11e1-a06b-040ccee352e6 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <sys/time.h> | |
#include <unistd.h> | |
#include <stdarg.h> | |
using namespace std; | |
struct __bench__ { | |
double start; | |
char msg[100]; | |
__bench__(const char* format, ...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* IOI2010 アルゴリズム以外の周辺まとめ by qnighy | |
あくまでqnighyの習慣にあわせたまとめであることに注意。 | |
** RunCについて | |
RunCを用いたprintfデバッグは困難である。 | |
デバッガはgdbとdddのみが用意されているが、これらは使いづらい。Emacs使いなら何とかなるかもしれないが、僕はEmacs使いではない。 | |
そのため、開発中は自前でコンパイルし、提出前にRunCで動作確認するのが良いと考えられる。(開発用とRunC用のディレクトリを分けたほうがいいかもしれない) | |
以下はMakefileのサンプルである。 | |
CXXFLAGS = -O2 -Wall -Wextra -Wno-unused-result -g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libraryDependencies += "net.liftweb" %% "lift-json" % "2.4" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
libraryDependencies += "org.scala-tools.testing" %% "scalacheck" % "1.9" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def index(id:String) = Action { | |
getFirstData(id) | |
} | |
private def getFirstData(id:String) = { | |
Cache.get(id) match { | |
case Some(id2) => getSecondData(id2) | |
case None => NotFound | |
} | |
} | |
private def getSecondData(id2:String) = { |
OlderNewer