2013-10-01から1ヶ月間の記事一覧

SRM 595 div 1

1299 -> 1357 easyだけ解けたeasy 2^(最終的な色に関係ある区間の数)を計算すればいい #include <cstdio> #include <algorithm> #include <vector> #include <string> #include <queue> using namespace std; class LittleElephantAndIntervalsDiv1{ public: long long getNumber(int M, vector <int> L, vec</int></queue></string></vector></algorithm></cstdio>…

POJ 1089

POJ

いもす法をする [a,a]みたいな区間を忘れないようにする #include <cstdio> #include <algorithm> using namespace std; int s[1000002]; int single[1000002]; int main(){ int N; int mi = 1000002, ma = 0; scanf("%d", &N); for(int i = 0; i < N; i++){ int a, b; scanf("%</algorithm></cstdio>…

POJ 2002

正方形の2つの頂点を決めてしまってから、残りの2頂点が存在するかを二分探索する #include <cstdio> #include <algorithm> using namespace std; #define X first #define Y second typedef pair<int, int> P; int N; P stars[1000]; int main(){ while(scanf("%d", &N) && N != 0){ int </int,></algorithm></cstdio>…