2012-02-03から1日間の記事一覧
解法 かかる時間が小さいほうから並べて足していくだけでいい。 カンニングしたら、signed int型だとオーバーフローするケースが あるらしいと分かったので、long longを使う。 コード #include <cstdio> #include <algorithm> using namespace std; const int MAX_N = 50000; i</algorithm></cstdio>…
解法 かかる時間が小さいほうから並べて足していくだけでいい。 カンニングしたら、signed int型だとオーバーフローするケースが あるらしいと分かったので、long longを使う。 コード #include <cstdio> #include <algorithm> using namespace std; const int MAX_N = 50000; i</algorithm></cstdio>…