2016-05-16から1日間の記事一覧

A - 高橋くんの研修 / AtCoderBeginnerContest#015

abc015.contest.atcoder.jp #include <iostream> #include <string> using namespace std; void Solve(string a, string b) { cout << (a.length()>b.length()? a : b); } int main(void) { string a, b; cin >> a >> b; Solve(a,b); return 0; } 文字数が長い文字列を出力。 </string></iostream>…

C - 高橋くんのバグ探し / AtCoderBeginnerContest#015

abc015.contest.atcoder.jp #include <iostream> using namespace std; int n, k; int t[5][5]; bool dfs(int query, int value) { if (query == n) return (!value? true : false); for (int j=0; j</iostream>

B - 高橋くんの集計 / AtCoderBeginnerContest#015

abc015.contest.atcoder.jp #include <iostream> using namespace std; void Solve(int n) { int a, count=0; double sum=0.0; for (int i=0; i<n; ++i) { cin >> a; if (a == 0) ++count; sum+=a; } cout << (int)(sum/(n-count)+0.9) << endl; } int main(void) { int n; cin >> n; S</n;></iostream>…