2012-04-06から1日間の記事一覧
なんかWAして悩んだけどよく考えたら確保した配列の要素が一個足りなかっただけだった(泣) 普通にやるとTLEするのでSをsortして配達先に最も近いSを2分探索で決めて足していくだけ #include <cstdio> #include <algorithm> #include <cmath> using namespace std; int d, n, m, ans, t</cmath></algorithm></cstdio>…
なんかWAして悩んだけどよく考えたら確保した配列の要素が一個足りなかっただけだった(泣) 普通にやるとTLEするのでSをsortして配達先に最も近いSを2分探索で決めて足していくだけ #include <cstdio> #include <algorithm> #include <cmath> using namespace std; int d, n, m, ans, t</cmath></algorithm></cstdio>…