2014-09-14から1日間の記事一覧

JAG夏合宿2014 3日目 H - Points and Lines

問題文 http://jag2014autumn.contest.atcoder.jp/tasks/icpc2014autumn_h感想 問題文には左優先で計算すると書いてあるが、自分は初めは、順序は任意に決定されるかつ幾何的制約を満たすものが最終的な解になるのでは、と思ってしまった。以下の参考問題の…

JAG夏合宿2014 3日目 A - North North West

#include <bits/stdc++.h> using namespace std; #define REP(i,a,b) for(int i=a; i<(int)b; i++) #define rep(i,n) REP(i,0,n) int main() { string str; while(cin >> str) { if(str == "#") break; vector<int> order; rep(i, str.size()) { if(str[i] == 'n') { order.push_</int></bits/stdc++.h>…