2016-12-01から1ヶ月間の記事一覧

AOJ 0072 Carden Lantern

灯篭 | Aizu Online Judge 最小全域木問題、114514810は何の関係もない #include <iostream> #include <numeric> #include <algorithm> using namespace std; int ma[100][100]; int main() { int n, m, a, b, d; char t; while (cin >> n) { if (n == 0) break; cin >> m; fill(ma[0], ma[</algorithm></numeric></iostream>…

AOJ 0071 Bombs Chain

爆弾の連鎖 | Aizu Online Judge (´・ω・`) #include <iostream> #include <string> using namespace std; bool map[8][8] = { 0 }; int siz[3] = { 1,2,3 }, dir[2][4] = { {1,0, -1,0},{0,1,0,-1} }; void bomb(int x, int y) { if (x < 0 || y < 0 || x >= 8 || y >= 8 || </string></iostream>…

AOJ 0070 Combination of Number Sequences

組み合わせの個数 | Aizu Online Judge 先に計算をしておく、s > 330 の場合はないので0個にしてしまう (最大の数1*0+2*1+3*2+4*3+5*4+6*5+7*6+8*7+9*8*10*9=330であるため) #include <iostream> using namespace std; int n, s, res[10][330] = { 0 }; bool num[10] =</iostream>…

AOJ 0069 Drawing Lots II

あみだくじ | Aizu Online Judge 各階層の両側に線がない('1000'の3つ目4つ目みたいな)とこに線があった場合のあみだくじを一番上の一番左から順に解いていった #include <iostream> #include <string> #include <numeric> #include <vector> using namespace std; #define PAIR pair<int, int> int lot[30</int,></vector></numeric></string></iostream>…