2014-10-05から1日間の記事一覧

SRM635 Div2Hard LonglongestPathTree

SRM

#include <bits/stdc++.h> using namespace std; // rep #define REP(i,a,b) for(int i=a;i<b;i++) #define rep(i,n) REP(i,0,n) struct Edge { int to, cost; }; // typedef typedef vector<Edge> Edges; typedef long long ll; int N; Edges G[2010]; bool notuse[2010]; typedef ll Weight; typedef pair<Weight, int> R…</weight,></b;i++)></bits/stdc++.h>

SRM635 Div2Med QuadraticLaw

SRM

問題文 本来の授業時間 d が与えられる。授業の開始を t 遅らせるとき、更に t^2 の時間だけ授業時間が少なくなる。授業時間をできるだけ少なくするための t を求めよ。解説 入力が10^18なので普通に線形探索は不可。二分探索しても良いが、整数型で探索範囲…