#include typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int (i)=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define RANGE(vec) (vec).begin(),(vec).end() using namespace std; const int Mod = (int)1e9+7; class TrendAndCountermeasures_PineDecorationSequence3 { public: array high; array low; // min{ Set(small) } < max{ Set(big) } // となりかつ Set(small) u Set(big) の要素が全て異なるような組み合わせ ll calc(int small, int big) { // dp[x][S] := x 以下の数字をつかって条件を満たすような S を選ぶ選び方 vector dp(1<<7, 0); dp[0] = 1; // 取りうる x 全てを見る for (int x = 1; x <= 20000; ++x) { // dp の更新が S が小さいもの(前の x までの結果)を使って // 大きい物を更新するので降順 for (int S = (1<<7)-1; S > 0; --S) { bool small_done = ((S & small) == small); bool big_exist = ((S & big) != 0); if ( !small_done && big_exist ) continue; REP(i,7) { if ( !(S & (1<>low[i]>>high[i]; ll res = calc(bdf, aceg) + calc(aceg, bdf); cout<solve(); delete obj; return 0; } #endif