2015-01-08から1日間の記事一覧

0105 - Book Index

#include <algorithm> #include <iostream> #include <map> #include <string> #include <vector> using namespace std; void Slove(void) { string word; int page; map<string,vector<int> > index; index.clear(); while (cin >> word >> page) { index[word].push_back(page); sort( index[word].begin(),index[word].e…</string,vector<int></vector></string></map></iostream></algorithm>

0104 - Magical Tiles

#include <iostream> #include <string> using namespace std; void Slove(int H, int W) { string figure[H]; bool flg[H][W]; for (int i=0; i<H; ++i) { cin >> figure[i]; for (int j=0; j</h;></string></iostream>

0103 - Baseball Simulation

#include <iostream> #include <string> using namespace std; void Slove(int inning) { int out=0, point=0, count=0; string event; while (inning != 0) { cin >> event; if (event == "HOMERUN") { point+=count+1; count=0; } else if (event == "HIT" ) { if (++count ></string></iostream>…