2010-08-06から1日間の記事一覧

AOJ 0066 Tic Tac Toe

404 Not Found #include <cstdio> int main(){ char b[10], a[3][3]; while(~scanf("%9s\n", b)){ char r = 0; for(int i = 0; i < 9; i++) a[i%3][i/3] = b[i]; for(int i = 0, j, f; i < 3; i++){ if(a[i][0] == 's') continue; for(j = 0, f = 1; j < 3; j++) if(</cstdio>…

AOJ 0018 Sorting Five Numbers

404 Not Found #include <cstdio> #include <vector> #include <algorithm> using namespace std; int main(){ vector<int> v(5); for(int i = 0; i < 5; i++) scanf("%d", &v[i]); sort(v.rbegin(), v.rend()); for(int i = 0; i < 5; i++) printf("%d%c", v[i], i-4?' ':'\n'); return 0; }</int></algorithm></vector></cstdio>

AOJ 0025 Hit and Blow

#include <cstdio> int main(){ int a[4], b[4]; while(~scanf("%d %d %d %d\n%d %d %d %d\n", &a[0], &a[1], &a[2], &a[3], &b[0], &b[1], &b[2], &b[3])){ int hit = 0, blow = 0; for(int i = 0; i < 4; i++) for(int j = 0; j < 4; j++) if(a[i] == b[j]) if(i =</cstdio>…

AOJ 0029 English Sentence

#include <iostream> #include <string> #include <map> using namespace std; int main(){ string s, max(""); map<string, int> w; map<int, string> x; while(cin>>s){ if(s.size() > max.size()) max = s; w[s]++; } for(map<string, int>::iterator it = w.begin(); it != w.end(); it++) x[(*it).second] = (*it).fir…</string,></int,></string,></map></string></iostream>

AOJ 0026 Dropping Ink

#include <cstdio> int main(){ int x, y, sz, max = 0, cnt = 0; char si[3][3] = {{0, 1, 0}, {1, 1, 1}, {0, 1, 0}}, mi[3][3] = {{1,1,1},{1,1,1},{1,1,1}}, li[5][5] = {{0, 0, 1, 0, 0}, {0, 1, 1, 1, 0}, {1, 1, 1, 1, 1}, {0, 1, 1, 1, 0}, {0, 0, 1, 0, 0}}</cstdio>…

AOJ 0036 A Figure on Surface

404 Not Found #include <cstdio> int main(){ char m[12][12]; char fgr[7][4][4] = { {{1, 1, 0, 0}, {1, 1, 0, 0}, {0, 0, 0, 0}, {0, 0, 0, 0}}, {{1, 0, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 0}, {1, 0, 0, 0}}, {{1, 1, 1, 1}, {0, 0, 0, 0}, {0, 0, 0, 0}, {0, 0,</cstdio>…

AOJ 0033 Ball

404 Not Found #include <cstdio> #include <list> using namespace std; int main(){ int n; scanf("%d\n", &n); for(int i = 0, tmp; i < n; i++){ list<int> a, b, c; for(int j = 0; j < 10; a.push_back(tmp), j++) scanf("%d", &tmp); while(!a.empty()){ if(a.front() > </int></list></cstdio>…