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

GCJ 2016 Round 1B A: Getting the Digits

問題 Dashboard - Round 1B 2016 - Google Code Jam 解法 一意に定まる。 コード #include <bits/stdc++.h> using namespace std; string solve(const string &S) { map<int, int> cnt; for (int i = 0; i < S.size(); ++i) cnt[S[i]]++; vector<int> ans(10, 0); ans[0] = cnt['Z']; ans[2</int></int,></bits/stdc++.h>…

GCJ 2016 Round 1B B: Close Match

問題 Dashboard - Round 1B 2016 - Google Code Jam 解法 幅優先 コード #include <bits/stdc++.h> using namespace std; string solve(const string &S, const string &T) { int N = S.size(); queue<tuple<int, int64_t, int64_t>> que; que.emplace(0, 0, 0); vector<tuple<int64_t, int64_t, int64_t>> ans; while (!que.empty())…</tuple<int64_t,></tuple<int,></bits/stdc++.h>