1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
| #include "bits/stdc++.h" using namespace std; #define fi first #define se second #define vi vector<int> #define pb push_back #define eb emplace_back #define pii pair<int,int> #define mp make_pair #define rep( i , a , b ) for( int i = (a) , i##end = b ; i <= i##end ; ++ i ) #define per( i , a , b ) for( int i = (a) , i##end = b ; i >= i##end ; -- i ) #define mem( a ) memset( a , 0 , sizeof (a) ) #define all( x ) x.begin() , x.end()
typedef long long ll; const int MAXN = 1e6 + 10; const int P = 1e9 + 7;
struct op { int o , a , b , c; }; vector<op> ops;
ll reg[MAXN]; void sum( int i , int j , int k ) { ops.pb( (op) { 0 , i , j , k } ); ll re = reg[i] + reg[j]; reg[k] = re; }
void jud( int i , int j , int k ) { ops.pb( (op) { 1 , i , j , k } ); int re = reg[i] < reg[j]; reg[k] = re; }
void solve() { reg[0] = 13224 , reg[1] = 535342; jud( 2 , 0 , 3 ); int td = 3; rep( i , 1 , 29 ) { sum( td + i - 1 , td + i - 1 , td + i ); } sum( 0 , td , 0 ) , sum( 1 , td , 1 ); int tr = td + 30 + 2 , tp = tr + 30 + 2; int ga = tp + 5; per( k , 29 , 0 ) { sum( tp , td + k , tp + 1 ); jud( tp + 1 , 1 , tr + k ); rep( t , 1 , k ) sum( tr + k , tr + k , tr + k ); sum( tr + k , tp , tp ); sum( tr + k , 10000 , ga + 1 ); jud( ga + 1 , td , ga + 1 ); rep( p , 1 , 30 ) sum( ga + 1 , ga + 1 , ga + 1 ); jud( ga + 3 , ga + 3 , ga + 3 ); per( t , 29 , 0 ) { sum( ga + 3 , td + t , ga + 2 ); sum( ga + 2 , ga + 1 , ga + 2 ); jud( ga + 2 , 0 , ga + 4 ); rep( k , 1 , t ) sum( ga + 4 , ga + 4 , ga + 4 ); sum( ga + 4 , ga + 3 , ga + 3 ); } rep( t , 1 , k ) sum( ga + 3 , ga + 3 , ga + 3 ); sum( ga , ga + 3 , ga ); } sum( ga , 10000 , 2 ); cout << ops.size() << endl; for( auto t : ops ) { if( t.o ) printf("< %d %d %d\n",t.a,t.b,t.c); else printf("+ %d %d %d\n",t.a,t.b,t.c); } }
signed main() {
solve(); }
|