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

0140 - Bus Line

#include <iostream> #include <vector> using namespace std; void Slove(int n) { const int place[25]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; int a, b; for (int i=0; i<n; ++i) { cin >> a >> b; int start=0; while (place[start] != a) ++start</n;></vector></iostream>…

0139 - Snakes

#include <iostream> #include <string> using namespace std; int Check_A(string snake) { int first=0, second=0, i, j; for (i=2; i</string></iostream>