2010-07-26から1日間の記事一覧

PKU 1007 DNA Sorting

#include <vector> #include <string> #include <iostream> #include <algorithm> using namespace std; class dna { public: string seq; int unsortedness; int getuns(){ unsortedness = 0; for(int i = 0, l = seq.size() - 1; i < l; i++){ for(int j = i + 1, m = l + 1; j < m; j++){ if(se</algorithm></iostream></string></vector>…

PKU 1003 Hangover

#include <iostream> using namespace std; int main(){ while(1){ double n; cin>>n; if(n == 0) break; for(int i = 1; ; i++){ n -= (double)1 / (double)(i + 1); if(n <= 0){ cout<</iostream>

.lnkファイルのファイルフォーマット

何かとCVE-2010-2568やらStuxnetやらで話題になっているlnkファイルのファイルフォーマット。 The_Windows_Shortcut_File_Format.pdfお好きな方はどうぞ。