intさわだんのBlack History

刹那的レジェンドになりたい。

2014-12-07から1日間の記事一覧

第13回日本情報オリンピック 予選 問題5 タクシー (Taxis) AOJ0596

深さ優先探索+ダイクストラ幅優先探索使ったほうがいいことにACしたあと気がついた。 まあ通れば勝ちでしょ...(震え声 #include <bits/stdc++.h> using namespace std; const int INF = 1000000000; const int MAX_V = 5003; int cost[MAX_V][MAX_V]; int cosn[5003][5003</bits/stdc++.h>…

第9回日本情報オリンピック 予選 問題5 通勤経路

DPショートコーディング大会みたいになった。 #include <bits/stdc++.h> using namespace std; const int mod = 100000; int w,h,dp[102][102][4]; int main(){ cin >> w >> h; dp[1][1][0] = 1;dp[1][1][3] = 1; for(int i = 1;i <= h;i++){ for(int j = 1;j <= w;j++){ if</bits/stdc++.h>…

POJ 2387 Til the Cows Come Home

ダイクストラ二分ぐらいで瞬殺。 #include <cstdio> #include <queue> #include <iostream> using namespace std; const int INF = 100000000; const int MAX_V = 1002; struct edge{ int to,cost;}; typedef pair<int,int> P; int V; vector<edge> G[MAX_V]; int d[MAX_V]; void dijkstra(int s){ pr</edge></int,int></iostream></queue></cstdio>…