2008-12-24から1日間の記事一覧

JOI2008-2009をC++で解いてみた2問目

c++

#include <iostream> #include <fstream> #include <stdlib.h> #include <algorithm> #include <vector> using namespace std; class Result{ vector<int> scores; public: Result(){ for(int i=0; i<4; i++){ scores.push_back(0); } } void append(int n){ scores.pop_back(); scores.push_back(n); sort(scores.</int></vector></algorithm></stdlib.h></fstream></iostream>…

JOI2008-2009をC++で解いてみた1問目

c++

#include <iostream> #include <fstream> #include <stdlib.h> using namespace std; class Man{ private: int m_arrival[3]; int m_leave[3]; public: Man(string* data_){ int times[6] = {-1, -1, -1, -1, -1, -1}; decode(times, data_); m_arrival[0] = times[0]; m_arrival[1] = tim</stdlib.h></fstream></iostream>…

PythonからC++への乗り換えを余儀なくされる予定のある人に役立つかもしれない情報

http://oshiete1.goo.ne.jp/qa3673750.html listとvectorの違いについてhttp://www.cppll.jp/cppreference/index.html c++標準リファレンスについてstringにはsplitがないので要自作