2011-11-01から1ヶ月間の記事一覧

AOJ 0029

#include <iostream> #include <string> #include <map> using namespace std; int main(){ map<string, int> words; char s[32]; while(scanf("%s",s) != EOF) { if ('A' <= s[0] && s[0] <= 'Z') s[0]=s[0]+'a'-'A'; string word = s; map<string, int>::iterator p = words.find(word); if (p != words.end(</string,></string,></map></string></iostream>…

AOJ 0011

#include <iostream> #include <vector> using namespace std; struct line { int begin; int end; }; int main(){ int w=0,n=0; int b,e; char comma; cin >> w >> n; vector<line> hlines; int answers[31]; for (int i=0; i<n; i++) { cin >> b >> comma >> e; line yoko = {b,e}; hlines.push_bac</n;></line></vector></iostream>…