akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>

using namespace std;
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

typedef long long  ll;
#define endl '\n'




int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};


const int MOD = 1000000007;

//////////////////////////////////////////


int n;
vector<pair<int, int>> v;

void Input() {

    cin >> n;


    for(int i = 0; i < n; i++) {

        int t;
        cin >> t;

        v.push_back(make_pair(t, i+1));
    }

}



void Solve() {


    sort(v.begin(), v.end());

    for(int i = 0; i < n; i++) {

        cout << v[i].second << " ";
    }


}

int main() {

  cin.tie(0);
  ios::sync_with_stdio(false);
  Input();
  Solve();


  return 0;

}


Measured memory_bytes: 1780
#include<bits/stdc++.h>

using namespace std;

#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n)　for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erace(unique(all(v)),v.end())
#define pvec(v)　rep(i,v.size()){cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sezeof(m))
#define mod 1e9 +7;

const double pi = acos(-1.0);

typedef string ss;
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll,ll> P;
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

ll lcm(ll x,ll y)
{
    x /= gcd(x,y);
    y /= gcd(x,y);
    return (x*y);
}

int main()
{
    ll n;
    cin >> n;
    vll t(n),x(n),y(n);
    rep(i,n)cin >> t[i] >> x[i] >> y[i];  
    rep(i,n){
        if(x[i]+y[i] > t[i]){
            cout << "No" << endl;
            return 0;
        }
        else if((t[i]-x[i]-y[i]) % 2 == 1){
            cout << "No" << endl;
            return 0;
        } 
        if(i != 0){
            if(abs(x[i]-x[i-1])+abs(y[i]-y[i-1]) > t[i]-t[i-1]){
                cout << "No" << endl;
                return 0;
            }
            else if((t[i]-t[i-1]-abs(x[i]-x[i-1])-abs(y[i]-y[i-1])) %2 ==1){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 2560
#include <iostream>
#include <string>
using namespace std;

int main(){
    string strt,strh;
    int n,sumt = 0,sumh = 0;
    cin >> n;
    for(int i = 0;i < n;i++){
        cin >> strt >> strh;
        if(strt > strh)
            sumt += 3;
        else if(strt < strh)
            sumh += 3;
        else{
            sumt += 1;
            sumh += 1;
        }
    }
    cout << sumt << ' ' <<  sumh << endl;

    return 0;
}


Measured memory_bytes: 3136
#include <bits/stdc++.h>
using namespace std;
const int MOD=1e9+7;
const int MAXN=10010;
int N,A[MAXN],Cnt[1000010];
void Divide(int x)
{
	for (int i=2;i*i<=x;++i)
		if (x%i==0)
		{
			int c=1;
			x/=i;
			while (x%i==0) ++c,x/=i;
			Cnt[i]=max(Cnt[i],c);
		}
	if (x!=1) Cnt[x]=max(Cnt[x],1);
}
int POW(int x,int k)
{
	int ans=1;
	for (;k;k>>=1,x=1LL*x*x%MOD) if (k&1) ans=1LL*ans*x%MOD;
	return ans;
}
int main()
{
	cin>>N;
	long long Ans=0;
	for (int i=1;i<=N;++i)
	{
		scanf("%d",&A[i]);
		Divide(A[i]);
	}
	for (int i=1;i<=N;++i) Ans+=POW(A[i],MOD-2);
	Ans%=MOD;
	for (int i=1;i<=1000000;++i) Ans=Ans*POW(i,Cnt[i])%MOD;
	cout<<Ans<<endl;
	return 0;
}

Measured memory_bytes: 2816
#include <bits/stdc++.h>
using namespace std;
int n,d;
int a[101][101];
int main(){
    cin>>n>>d;

    int i,j;
    for(i=1 ; i<=n ; i++){
        for(j=1 ; j<=d ; j++){
            cin>>a[i][j];
        }
    }
    int k;
    int ans=0;
    for(i=1 ; i<=n ; i++){

        for(j=i+1 ; j<=n ; j++){
            int s=0;
            for(k=1 ; k<=d ; k++){
                s+=(a[j][k]-a[i][k])*(a[j][k]-a[i][k]);
            }
            int ss=sqrt(s);
            if(s==ss*ss)ans++;
        }

    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n)-1; i >= 0; i--)


int main() {
  cin.tie(0); ios_base::sync_with_stdio(0);

  int w, h, c; cin >> w >> h >> c;
  int g = __gcd(w, h);
  cout << w / g * h / g * c << "\n";
}


Measured memory_bytes: 3232
#include <bits/stdc++.h>
using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> vec(n);
  for(int i=0; i<n; ++i) cin >> vec[i];
  int n1 = vec.size();
  sort(vec.begin(),vec.end());
  vec.erase(unique(vec.begin(),vec.end()),vec.end());
  int n2 = vec.size();
  if((n1-n2)%2 == 1) --n2;
  cout << n2 << endl;
}

Measured memory_bytes: 3788
#include <bits/stdc++.h>
#define int long long
#define pii pair<int,int>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(c) (c).begin(),(c).end()
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
#define MINF(a) memset(a,0x3f,sizeof(a))
#define POW(n) (1LL<<(n))
#define IN(i,a,b) (a <= i && i <= b)
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a>b) { a=b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a<b) { a=b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(ALL(a)); }
template <typename T> inline void REV(T& a) { reverse(ALL(a)); }
template <typename T> inline void UNI(T& a) { sort(ALL(a)); a.erase(unique(ALL(a)),a.end()); }
const int MOD = 1000000007;
const int INF = 0x3f3f3f3f3f3f3f3f;
const double EPS = 1e-10;
/* ---------------------------------------------------------------------------------------------------- */

int N,M;
int S[2010],T[2010];
int dp[2010][2010];

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  cin >> N >> M;
  REP(i,N) cin >> S[i];
  REP(i,M) cin >> T[i];
  REP(i,N+1) dp[i][0] = 1;
  REP(i,M+1) dp[0][i] = 1;
  REP(i,N) REP(j,M) {
    dp[i+1][j+1] = (dp[i+1][j] + dp[i][j+1]) % MOD;
    if (S[i] != T[j]) {
      (dp[i+1][j+1] += MOD - dp[i][j]) %= MOD;
    }
  }
  cout << dp[N][M] << endl;

  return 0;
}

Measured memory_bytes: 31744
import java.util.Scanner;
import java.util.Arrays;

public class Main {
        public static void main(String[] args) {
                Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
                int[] l = new int[n];
                for (int i = 0; i < n; i++) {
                        l[i] = sc.nextInt();
                }
                sc.close();
                int r = 0;
                Arrays.sort(l);
                for (int i = 0; i < n; i++) {
                        for (int j = i + 1; j < n; j++) {
                                int idx = binSearch(l, n, l[i] + l[j]);
                                r += idx - j;
                        }
                }
                System.out.println(r);
        }

        static int binSearch(int[] a, int n, int key) {
                int pl = 0; // 探索範囲先頭のインデックス
                int pr = n - 1; // 探索範囲末尾のインデックス
                int r = -1;
                do {
                        int pc = (pl + pr) / 2; // 中央要素のインデックス
                        if (a[pc] < key) {
                                r = pc;
                                pl = pc + 1; // 探索範囲を後半に絞り込む
                        } 
                        else pr = pc - 1; // 探索範囲を前半に絞り込む
                } while(pl <= pr);
                return r; // 探索結果
        }
}


Measured memory_bytes: 26096
s = input()
res = 0
for i in range(len(s)):
    if((i % 2 == 0 and s[i] == 'L') or (i % 2 == 1 and s[i] == 'R')):
        res = 1
if res == 0:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end());
#define vecmin(A) *min_element(A.begin(),A.end());
#define vecmax(A) *max_element(A.begin(),A.end());
typedef long long ll;
typedef vector<int> vec;

int main(){
  
  vec d(3);
  rep(i,3) cin >> d[i];
  sort(d);
  cout << d[2] - d[0] << endl;
  
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

#define all(a)                      a.begin(), a.end()
#define pb                          push_back
#define ll							long long
#define index(a)            		order_of_key(a)
#define value(a)					find_by_order(a)
#define count_1 					__builtin_popcount
#define mod(x, m)					((((x) % (m)) + (m)) % (m))
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set;
int a[100005][3],dp[100005][3];
int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);cout<<setprecision(12);
	int n;
	cin>>n;
	for(int i=0;i<n;i++)for(int j=0;j<3;j++)cin>>a[i][j];
	for(int i=0;i<n;i++){
		if(i==0){
			dp[i][0]=a[i][0];
			dp[i][1]=a[i][1];
			dp[i][2]=a[i][2];
			continue;
		}
		dp[i][0]=a[i][0]+max(dp[i-1][1],dp[i-1][2]);
		dp[i][1]=a[i][1]+max(dp[i-1][0],dp[i-1][2]);
		dp[i][2]=a[i][2]+max(dp[i-1][0],dp[i-1][1]);
	}
	cout<<max({dp[n-1][0],dp[n-1][1],dp[n-1][2]});
	return 0;
}

Measured memory_bytes: 2560
#include<stdio.h>

int main()
{
  int k;
  char s[101];
  scanf("%d", &k);
  scanf("%s", s);
  
  char ans[101];
  int i = 0, needsDot = 0;
  while (1) {
    if (s[i] == '\0') {
      ans[i] = '\0';
      break;
    }
    
    if (i < k) {
      ans[i] = s[i];
    } else {
      ans[i] = '\0';
      needsDot = 1;
      break;
    }
    i++;
  }
  
  if (needsDot == 1) {
    printf("%s...\n", ans);
  } else {
    printf("%s\n", ans);
  }
  
  return 0;
}

Measured memory_bytes: 1724
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        HashMap<Integer, String> hashmap = new HashMap<>();
        make(hashmap);
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (hashmap.get(a).equals(hashmap.get(b)) ) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
    
    private static void make(HashMap<Integer, String> hashmap) {
        hashmap.put(1, "A");
        hashmap.put(3, "A");
        hashmap.put(5, "A");
        hashmap.put(7, "A");
        hashmap.put(8, "A");
        hashmap.put(10, "A");
        hashmap.put(12, "A");
        hashmap.put(4, "B");
        hashmap.put(6, "B");
        hashmap.put(9, "B");
        hashmap.put(11, "B");
        hashmap.put(2, "C");
    }
}

Measured memory_bytes: 21844
// Problem : B - Minor Change
// Contest : AtCoder - AtCoder Beginner Contest 172
// URL : https://atcoder.jp/contests/abc172/tasks/abc172_b
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
#define int long long
#define db double
#define mod 1000000007
#define pb push_back
#define pp pair<int,int>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repe(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=b;i>=a;i--)
#define maxn 100005
#define ss second
#define ff first
#define all(a) a.begin(),a.end()
#define lb lower_bound
#define ub uppper_bound
using namespace std;
int inv(int a, int b){
 return 1<a ? b - inv(b%a,a)*b/a : 1;
}
void solve()
{
	string s,t;
	cin >> s >> t;
	int ans=0;
	rep(i,0,s.size())
	{
		if(s[i] != t[i])
		ans++;
	}
	cout << ans;
}
signed main()
{
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1;
    //cin >> t;
    while(t--)
    solve();
    return 0;
}


Measured memory_bytes: 3760
#include<stdio.h>
int main()
{
  int n;
  scanf("%d",&n);
  int j = n % 10;
  if(j == 2 || j == 4 || j == 5 || j == 7 || j == 9){
   	printf("hon");
  }
  else if(j == 0 || j == 1 || j == 6 || j == 8){
  	printf("pon");
  }
  else{
  	printf("bon");
  }
  return 0;
}
    

Measured memory_bytes: 1732
#include<stdio.h>
#include<stdlib.h>

int main()
{
  char str[20],x[10],y[10],z[10];
  int m,a,b,c,i=0,j=0,l=0;
  
  fgets(str,sizeof(str),stdin);
    
    for(;;){
      if(str[i]==' '){
	break;
      }
      x[i]=str[i];
      i++;
    }

    i++;

    for(;;){
      if(str[i]==' '){
	break;
      }
      y[j]=str[i];
      i++;
      j++;
    }

    for(;;){
      if(str[i]=='\0'){
	break;
      }
      z[l]=str[i+1];
      i++;
      l++;
    }

    a=atoi(x);
    b=atoi(y);
    c=atoi(z);

    if(a<1 || 10000<a || b<1 || 10000<b || c<1 || 10000<c){
      printf("Error!!\n");
    }else{
      if(a>b){
	m=a;
	a=b;
	b=m;
	
	if(b>c){
	  m=b;
	  b=c;
	  c=m;

	  if(a>b){
	m=a;
	a=b;
	b=m;
	  }
	}
      }else if(b>c){
	m=b;
	b=c;
	c=m;
	if(a>b){
	  m=a;
	a=b;
	b=m;
	}
      }
      printf("%d %d %d\n",a,b,c);	
    }

    return 0;
}

Measured memory_bytes: 528
#include<iostream>
using namespace std;

int main(){
	int x,y;
	int t;
	while(cin>>x>>y)
	{
		if(x==0 && y==0)break;
		if(x>y){t=x;x=y;y=t;}
		cout<<x<<" "<<y<<endl;
	}

    return 0;
}


Measured memory_bytes: 2996
#ifdef DEBUG_IS_VALID
#define DEB 1 
#define _LIBCPP_DEBUG 0
#else
#define DEB 0
#define NDEBUG
#endif

#include <bits/stdc++.h>
using namespace std;

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back
#pragma GCC optimize ("-O3")

using namespace std;

#define DUMPOUT cout
#define dump(...) if(DEB) DUMPOUT<<"  "<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl<<"    "; if(DEB) dump_func(__VA_ARGS__)
template<typename T1,typename T2>ostream& operator << (ostream& os, pair<T1,T2> p){cout << "(" << p.first << ", " << p.second << ")"; return os;}
template<typename T>ostream& operator << (ostream& os, vector<T>& vec) { os << "{"; for (int i = 0; i<vec.size(); i++) os << vec[i] << (i + 1 == vec.size() ? "" : ", "); os << "}"; return os; }
template<typename T>ostream& operator << (ostream& os, set<T>& st){cout << "{"; for(auto itr = st.begin(); itr != st.end(); itr++) cout << *itr << (next(itr)!=st.end() ? ", " : ""); cout << "}"; return os;}
template<typename T1,typename T2>ostream& operator << (ostream& os, map<T1,T2> mp){cout << "{"; for(auto itr = mp.begin(); itr != mp.end(); itr++) cout << "(" << (itr->first) << ", " << (itr->second) << ")" << (next(itr)!=mp.end() ? "," : ""); cout << "}"; return os; }

void dump_func(){DUMPOUT << endl;}
template <class Head, class... Tail>void dump_func(Head&& head, Tail&&... tail){ DUMPOUT << head; if (sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...);}
template<class T> inline bool chmax(T& a,T const& b){if(a>=b) return false; a=b; return true;}
template<class T> inline bool chmin(T& a,T const& b){if(a<=b) return false; a=b; return true;}

using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vp = vector<Pl>;
using vvp = vector<vp>;

const int INF = 1<<29;
const long long LINF=1LL<<59;

const string YES = "Yes";
const string NO = "No";
void yn(bool ok){
  cout << (ok ? YES : NO) << endl;
}

void solve(long long N, std::vector<long long> A, std::vector<long long> B){
  vi idx(N);
  iota(ALL(idx),0);
  sort(ALL(idx),[&](int l,int r){return B[l]<B[r];});
  ll now = 0;
  bool ok = true;
  rep(ii,N){
    int i = idx[ii];
    now += A[i];
    ok &= (now<=B[i]);
  }
  yn(ok);
}

int main(){
  long long N;
  scanf("%lld",&N);
  std::vector<long long> A(N);
  std::vector<long long> B(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&A[i]);
    scanf("%lld",&B[i]);
  }
  solve(N, std::move(A), std::move(B));
  return 0;
}


Measured memory_bytes: 4096
#define _GLIBCXX_DEBUG//TLEの原因になるので注意！！！！！！！！！！！
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.xise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//#define int long long

//cerrはコメントアウトしなくても通る//ただしTLEを引き起こすことがある

ll N,M,H,W,K,Q,A,B;
string S;
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
//const ll INF = 1LL << 60;
//typedef pair<ll,ll> P;
typedef pair<int, int> P;
bool chmx(int &a, int b) {
	if (b > a) {
		a = b;
		return true;
	}
	return false;
}

bool chmn(int &a, int b) {
	if (b < a) {
		a = b;
		return true;
	}
	return false;
}

int main(){
    int n,m;
    cin >> n>>m;
    if(n==m){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}



Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int K = sc.nextInt();
        String S = sc.next();
        if (S.length() <= K) {
            System.out.println(S);
        } else {
            System.out.println(S.substring(0, K)+"...");
        }
    }
}

Measured memory_bytes: 38624
//Om Sree Sai Ram
#include <iostream>
#include <fstream>
#include <bits/stdc++.h>
using namespace std;
vector<int> dp;
int dfs(int i,int ar[],int n)
{
  if(dp[i]!=INT_MAX)
  {
    return dp[i];
  }
 if(i==n-1)
 {
  return 0;
 }
 if(i+1<n)
 {
  int tmp = abs(ar[i+1]-ar[i])+dfs(i+1,ar,n);
  dp[i] = min(dp[i],tmp);
 }

 if(i+2<n)
 {
  int tmp = abs(ar[i+2]-ar[i])+dfs(i+2,ar,n);
  dp[i] = min(dp[i],tmp);
 }
 return dp[i];
}

int main() 
{  
 // cout<<" Hello world"<<endl;   
  int n;
  cin>>n;
  int ar[n];
  for(int i=0;i<n;i++)
  {
    cin>>ar[i];
  }
  dp.assign(n,INT_MAX);
  dfs(0,ar,n);
  cout<<dp[0]<<endl;
  return 0;
}


Measured memory_bytes: 7296
#include <iostream>
#include <string>

using namespace std;

int main(){
	int T;
	cin >> T;
	while(T--){
		int N, l = 1, answer = 0;
		string s;
		cin >> N >> s;
		for(int i = 0; i <= 2 * N; i += 2){
			bool upper = (i != 0 && s[i - 1] == 'Y') ||
			             (i != 2 * N && s[i] == 'Y');
			bool lower = (i != 0 && s[i - 1 + 2 * N] == 'Y') ||
			             (i != 2 * N && s[i + 2 * N] == 'Y');
			if(i != 2 * N){ ++answer; }
			if(l == 1){
				if(lower){
					answer += 2;
					l = 2;
				}else if(upper){
					++answer;
					l = 2;
				}
			}else{
				if(upper && lower){
					answer += 2;
					l = 3;
				}else if(upper){
					++answer;
					l = 3;
				}else if(lower){
					++answer;
					l = 2;
				}
			}
		}
		if(l % 2 == 0){
			++answer;
		}
		cout << answer << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include<iostream>
using namespace std;
int main(){
    int n;
    cin>>n;
    if (n<105) cout<<0<<endl;
    else if (n<135) cout<<1<<endl;
    else if (n<165) cout<<2<<endl;
    else if (n<189) cout<<3<<endl;
    else if (n<195) cout<<4<<endl;
    else cout<<5<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
const bool debug=true;
// const bool debug=false;
#define DEBUG if(debug==true)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;

int main(void) {
    ll n,m;
    cin >> n >> m;
    vector<ll> cnt;
    unordered_map<ll, ll> mp;

    mp[0]++;
    ll res=0;
    rep(i,n){
        ll tmp;
        cin >> tmp;
        res+=tmp;
        res%=m;
        mp[res]++;
    }
    res=0;
    for(auto x:mp){
        res+=(x.second*(x.second-1))/2;
    }
    cout <<res << endl;
    return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;

typedef long long int ll;
typedef pair<ll, ll> P;

const ll mod = 1e9+7;
const ll INF = 2e9;
const double PI = 3.1415926535;

int main(void){
    ll n; cin >> n;
    ll ans = 0;
    for(ll i = 1;i*(i+1) < n;i++)if(n%i == 0)ans += n/i-1;
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 764
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <functional>
#include <queue>
#include <string>
#include <cstring>
#include <numeric>
#include <cstdlib>
#include <cmath>
using namespace std;

typedef long long ll;

#define INF 1000000000
#define rep(i,n) for(int i=0; i<n; i++)
#define rep_r(i,n,m) for(int i=m; i<n; i++)
#define MAX 100
#define MOD 1000000007

/* add vars here */

ll N,M;
int a[1000], b[1000], c[1000], dist[1000][1000];

/* add your algorithm here */

void wf() {
  rep(i,N) {
    rep(j,N) {
      rep(k,N) {
        dist[j][k] = min(dist[j][k], dist[j][i] + dist[i][k]);
      }
    }
  }
}

int main() {
  cin >> N >> M;

  rep(i,N) {
    rep(j,N) {
      if (i == j)
        dist[i][j] = 0;
      else
        dist[i][j] = INF;
    }
  }

  rep(i,M) {
    cin >> a[i] >> b[i] >> c[i];
    a[i]--,b[i]--;
    dist[a[i]][b[i]] = c[i];
    dist[b[i]][a[i]] = c[i];
  }

  ll ans = M;
  wf();

  rep(i,M) {
    bool shortest = false;
    for (int j = 0; j < N; ++j) if (dist[j][a[i]] + c[i] == dist[j][b[i]]) shortest = true;
    if (shortest) ans--;
  }

  cout << ans << endl;
}


Measured memory_bytes: 640
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)

	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	plans := make(Plans, n+1)
	plans[0] = Plan{
		t: 0,
		x: 0,
		y: 0,
	}

	for i := 1; i <= n; i++ {
		plans[i].t = getNextInt(scanner)
		plans[i].x = getNextInt(scanner)
		plans[i].y = getNextInt(scanner)
	}

	ans := "Yes"
	for i := 1; i <= n; i++ {
		dt := plans[i].t - plans[i-1].t
		dx := plans[i].x - plans[i-1].x
		if dx < 0 {
			dx = -dx
		}
		dy := plans[i].y - plans[i-1].y
		if dy < 0 {
			dy = -dy
		}
		if dt < dx+dy || (dt%2 != (dx+dy)%2) {
			ans = "No"
			break
		}
	}

	fmt.Fprintln(writer, ans)
	writer.Flush()
}

type Plan struct {
	t, x, y int
}

type Plans []Plan


Measured memory_bytes: 4736
#include <vector>
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;

int main(){
    string S; cin >> S;
        if(S[2] == S[3] && S[4] == S[5]){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

const auto NMAX = 3005;

int dp[NMAX][NMAX];
#define chmax(x, y) x = max(x,y);

signed main() {
    int N, T;
    cin >> N >> T;
    vector<pair<int, int> > vt(N);
    for (int i = 0; i < N; i++) {
        cin >> vt[i].first >> vt[i].second;
    }
    sort(vt.begin(), vt.end());

    int ans = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = 0; j < T; ++j) {
            chmax(dp[i + 1][j], dp[i][j]);
            int nj = j + vt[i].first;
            if (nj < T) {
                chmax(dp[i + 1][nj], dp[i][j] + vt[i].second);
            }
        }
        int now = dp[i][T - 1] + vt[i].second;
        chmax(ans, now);
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 35456
# -*- coding: utf-8 -*-

num_info = int(input())
infos = []
for i in range(num_info):
    temp = input().split(' ')
    a, b = int(temp[0]), int(temp[1])
    infos.append([a, b])

#print(infos)
infos.sort(key = lambda x:x[0])
#print(infos)

info_max = infos[0]
info_min = infos[num_info - 1]
#print(info_max)
#print(info_min)
print(info_min[0]+info_min[1])

Measured memory_bytes: 21360
#include<bits/stdc++.h>

using namespace std;
#define ll long long
const int MOD = (int)1e9 + 7;

ll mult(ll a, ll b){
	return ((ll)(a % MOD) * (b % MOD)) % MOD;
}

ll add(ll a, ll b){
	
	a = ((a % MOD) + (b % MOD)) % MOD;
	return a;
}

int main(){
	ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int n;
    cin >> n;
    vector<ll> a(n);
    ll pd = 0L;

    for(int i = 0; i < n; ++i){
    	cin >> a[i];
    }
    pd = a[n - 1];
    ll ans = 0L;
    for(int i = n - 2; i >= 0; --i){
    	ans = add(ans, mult(a[i], pd));
    	pd = add(a[i], pd);
    }   
    
    cout << ans;
    
	return 0;
}

Measured memory_bytes: 4768
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main() {
    string s; cin >> s;
    s += ' ';
    for (int i = 0; i < s.size() - 1; i++) {
        if (s[i] == s[i+1]) {
            cout << i+1 << ' ' << i+2 << endl;
            return 0;
        } else if (s[i] == s[i+2]) {
            cout << i+1 << ' ' << i+3 << endl;
            return 0;
        }
    }
    puts("-1 -1");
    return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef pair<double,int> P;

int H,W;
string str;

vector <P> u;
char t[600][600];

double change(double x,double y){
  if(x>0.0)return y/x;
  else return 99999999.99999999;
}

char T(int y,int x){
  if(y<0||x<0)return '.';
  if(y>=H||x>=W)return '.';
  return t[y][x];
}

int main(){
  cin>>H>>W;
  for(int i=H-1;i>=0;i--){
    cin>>str;
    for(int j=0;j<W;j++)t[i][j]=str[j];
  }
  
  for(int i=-1;i<H;i++){
    for(int j=-1;j<W;j++){
      if(T(i,j)=='#'&&T(i+1,j)=='#'&&T(i,j+1)=='.'&&T(i+1,j+1)=='#'){
	u.push_back(P(change(j+1,i+1),-1));
      }else if(T(i,j)=='.'&&T(i+1,j)=='#'&&T(i,j+1)=='.'&&T(i+1,j+1)=='.'){
	u.push_back(P(change(j+1,i+1),1));
      }else if(T(i,j)=='#'&&T(i+1,j)=='.'&&T(i,j+1)=='#'&&T(i+1,j+1)=='#'){
	u.push_back(P(change(j+1,i+1),1));
      }else if(T(i,j)=='.'&&T(i+1,j)=='.'&&T(i,j+1)=='#'&&T(i+1,j+1)=='.'){
	u.push_back(P(change(j+1,i+1),-1));
      }
    }
  }

  int cnt=1,ans=1;
  sort(u.begin(),u.end());
  for(int i=0;i<(int)u.size();i++){    
    cnt+=u[i].second;
    ans=max(ans,cnt);
  }
  cout<<ans<<endl;
  
  return 0;
}

Measured memory_bytes: 3472
#!/usr/bin/python2
# -*- coding: utf-8 -*-

import sys

def rl(proc=None):
    if proc is not None:
        return proc(sys.stdin.readline())
    else:
        return sys.stdin.readline().rstrip()

def srl(proc=None):
    if proc is not None:
        return map(proc, rl().split())
    else:
        return rl().split()

def go(a, x, y):
    if a[x][y] != '#':
        return []
    r = [(x, y)]
    while True:
        for tx, ty in ((x+1, y), (x, y+1)):
            if 0 <= tx < len(a) and 0 <= ty < len(a[0]) and a[tx][ty] == '#':
                x = tx
                y = ty
                break
        else:
            break
        r.append((x,y))
    return r


def main():
    R, C = srl(int)
    a = []
    for _ in xrange(R):
        a.append(rl())
    b = go(a, 0, 0)
    if not b or b[-1] != (R-1, C-1):
        print "Impossible"
        return
    s = sum(x.count('#') for x in a)
    print "Impossible" if s != len(b) else "Possible"

if __name__ == '__main__':
    main()


Measured memory_bytes: 2696
#include <bits/stdc++.h>
typedef long long ll;

#define rep(i, a, n) for (ll i = a; i < (ll)n; ++i)
#define INF 10e12
#define MOD 1000000000 + 7
#define MAX 51000
#define all(x) (x).begin(), (x).end()
#define MX(x) *max_element(all(x))
#define MN(x) *min_element(all(x))

using namespace std;
int main(void)
{
    ll n;
    cin >> n;
    vector<string> s(n);
    vector<ll> vmp(5, 0);
    rep(i, 0, n) cin >> s[i];
    rep(i, 0, n)
    {
        if (s[i][0] == 'M')
            vmp[0]++;
        if (s[i][0] == 'A')
            vmp[1]++;
        if (s[i][0] == 'R')
            vmp[2]++;
        if (s[i][0] == 'C')
            vmp[3]++;
        if (s[i][0] == 'H')
            vmp[4]++;
    }
    ll ans = 0;
    rep(i, 0, 3)
    {
        rep(j, i + 1, 4)
        {
            rep(k, j + 1, 5)
            {
                ans += vmp[i] * vmp[j] * vmp[k];
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 6340
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
int main(){
    int n; cin >> n;
    vector<int> ar(n);
    rep(i,n) cin >> ar[i];
    bool t = false;
    int ima = 0;
    int ans = 0;
    rep(i,n){
        if (t && i+1 == ar[i]){
            ima ++;
        }
        else if (t && i+1 != ar[i]){
            ans += (ima+1) / 2;
            t = false;
            ima = 0;
        }
        else if (!t && i+1 == ar[i]){
            t = true;
            ima++;
        }
    }
    if (t) ans += (ima+1) / 2;
    cout << ans << endl;
}

Measured memory_bytes: 3780
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <climits>

using namespace std;

int main()
{
    char a;
    cin >> a;

    if (0x41 <= a && a <= 0x5A) cout << "A" << endl;
    else if (0x61 <= a && a <= 0x7A) cout << "a" << endl;

    return 0;
}

Measured memory_bytes: 3680
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  int64_t N;
  cin >> N;
  // const int64_t L = static_cast<int64_t>(T.length());
  vector<vector<pair<int64_t, bool>>> A(N, vector<pair<int64_t, bool>>());
  for (int64_t i = 0; i < N; ++i) {
    int64_t a;
    cin >> a;
    for (int64_t j = 0; j < a; ++j) {
      int64_t person, y;
      cin >> person >> y;
      A[i].push_back(pair<int64_t, bool>(person - 1, (y == 1)));
    }
  }
  int64_t result = 0;
  for (int32_t b = 0; b < (1 << N); ++b) {
    const bitset<15> bs(b);
    bool is_okay = true;
    for (int64_t person = 0; person < N; ++person) {
      if (bs[person]) {
        for (const auto p : A[person]) {
          if (bs[p.first] != p.second) {
            is_okay = false;
            break;
          }
        }
      }
      if (!is_okay) {
        break;
      }
    }
    if (is_okay) {
      result = max(result, static_cast<int64_t>(bs.count()));
      // cerr << bs << endl;
    }
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 3612
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<sstream>
#include<cmath>
#include<numeric>
#include<map>
#include<stack>
#include<queue>
#include<list>
using namespace std;
int inf = 1000000000;


int main(void) {

  int n;
  cin >> n;
  vector<int> s(n);
  for(int i=0; i<n; i++) cin >> s[i];
  int q;
  cin >> q;
  vector<int> t(q);
  for(int i=0; i<q; i++) cin >> t[i];

  int cnt = 0;
  for(int i=0; i<q; i++){
    for(int j=0; j<n; j++){
      if( s[j] == t[i] ){
        cnt++;
        break;
      }
    }
  }
  cout << cnt << endl;

  return 0;
}

// EOF

Measured memory_bytes: 3064
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
 
int main(){
 
int A[100];
 int N ,v,i;// N 個の要素を含む 0-オリジンの配列 A
 int count = 0;
 bool flag = 1;
 cin >> N;
for(int k = 0; k < N; k++){
  cin >> A[k];
}
   while( flag){
     flag = 0;
     for (int j=N-1; j > 0; j--){
     
       i = j-1;//i<j
       
       if (A[j] < A[i]){
         swap(A[j] , A[i]);
         
         count++;
         flag = 1;
       }//if
       
     i--;
     }//for

   }//while
   
    for(int i = 0; i < N; i++){
    if(i == N-1){
      cout << A[i];
      }else{
        cout << A[i] << " ";
      }
    }cout << endl;
    cout << count << endl;
    
return 0;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;

int main() {
  int A, B, C;
  cin >> A >> B >> C;

  if (A == B) {
    cout << C << endl;
  } else if (B == C) {
    cout << A << endl;
  } else if (A == C) {
    cout << B << endl;
  }
}


Measured memory_bytes: 256
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>

using namespace std;

int main()
{
    int k,a,b,m;
    int s=0;
    cin >>k>>a>>b;
    
    
    for (int i =0; i<=1000; i++){
       m=i*k;
       if (a<=m && m<=b){
           s=1;
       }
       
    }
       if (s==1){
           cout<<"OK"<<endl;
       }
        
        else {
            cout<<"NG"<<endl;
        }
    
    

    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define INF 2000000000
#define MOD 1000000007
#define EPS (1e-10)

using namespace std;


vector<int>  dx = {1,-1,0,0};
vector<int>  dy = {0,0,1,-1};


int func(int n){
	int ret = 0;
	for (int i = 0; i < 5; i++) {
		ret += n % 10;
		n = n / 10;
	}
	return ret;
}

int main() {
	int n,a,b; cin >> n >> a >> b;

	int ans = 0;
	for (int i = 1; i <= n; i++) {
		int sum = func(i);
		if (a <= sum and sum <= b) {
			ans += i;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  vector<vector<int>> f(n + 1, vector<int>(2));
  f[0][1] = 1;
  for (int i = 1; i <= n; i++) {
    int t;
    cin >> t;
    for (int j = t - 1; j <= t + 1; j++) {
      if (j & 1) {
        f[i][1] += f[i - 1][1];
        f[i][0] += f[i - 1][0];
      } else {
        f[i][0] += f[i - 1][1] + f[i - 1][0];
      }
    }
  }
  cout << f[n][0] << endl;
  return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
const int MAX = 700000;
const int MOD = 1000000007;

long long  fac[MAX], finv[MAX], inv[MAX];

// テーブルを作る前処理
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % MOD;
		inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
		finv[i] = finv[i - 1] * inv[i] % MOD;
	}
}

// 二項係数計算
long long COM(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
/*第二引数で第一引数を割ったときの切り上げの計算*/
long long int maxtime(long long int x, long long int y) {
	return(x + y - 1) / y;

}
/*最大公約数*/
long long int lcm(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;

	if (number2 > number1) {
		m = number2;
		n = number1;
	}
	long long int s = -1;
	while (s != 0) {
		s = m % n;
		m = n;
		n = s;
	}
	return m;
}
/*最大公倍数*/
long long int gcd(long long int number1, long long int number2) {
	long long int m = number1;
	long long int n = number2;
	return m / lcm(m, n) * n;
}
/*逆元計算*/
long long int  modinv(long long a, long long m) {
	long long int b = m, u = 1, v = 0;
	while (b) {
		long long int t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
// index が条件を満たすかどうか
vector<long long int >meguru;
bool isOK(int index, int key) {
	if (meguru[index] <= key) return true;
	else return false;
}
// 汎用的な二分探索のテンプレ
int binary_search(int key) {
	int left = -1; //「index = 0」が条件を満たすこともあるので、初期値は -1
	int right = (int)meguru.size(); // 「index = a.size()-1」が条件を満たさないこともあるので、初期値は a.size()
	/* どんな二分探索でもここの書き方を変えずにできる！ */
	while (right - left > 1) {
		int mid = left + (right - left) / 2;

		if (isOK(mid, key)) left = mid;
		else right = mid;
	}
	/* left は条件を満たす最大の値、right は条件を満たさない最小の値になっている */
	return left;
}
long long modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}
int dp[1000] = {};
int main() {
	int n, k;
	cin >> n >> k;
	for (int i = 0; i < k; i++) {
		int d;
		cin >> d;
		for (int i = 0; i < d; i++) {
			int a;
			cin >> a;
			dp[a]++;
		}
	}
	int ans = 0;
	for (int i = 1; i <= n; i++) {
		if (dp[i] == 0) {
			ans++;
		}
	}
	cout << ans;
}

Measured memory_bytes: 3600
h,w,n = map(int,input().split())
d = {1:0,2:h,3:0,4:w}
for _ in range(n):
  x,y,a = map(int,input().split())
  if a %2:
    d[a] = max(d[a],[x,y][a//2]) 
  else:
    d[a] = min(d[a],[x,y][a//2-1])

if d[1] > d[2] or d[3] > d[4]:
  print(0)
else:
  ans = (d[2]-d[1]) * (d[4]-d[3])
  print(ans)



Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define int ll
typedef pair<int,int> pii;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(a) (a).begin(),(a).end()
#define pb emplace_back
#define INF (1e9+1)

const ll MOD = 1e9+7;

signed main(){
    int n;
    cin>>n;
    string s,t;
    cin>>s>>t;
    
    vector<int> v;
    rep(i,n){
        if(s[i]==t[i]){
            v.pb(1);
        }else{
            v.pb(2);
            assert(s[i]==s[i+1] && t[i]==t[i+1]);
            i++;
        }
    }
    
    
    ll ans;
    if(v[0] == 1)ans = 3;
    else ans = 6;
    for(int i=1;i<v.size();i++){
        if(v[i]==v[i-1]){
            if(v[i]==1)ans*=2;
            else ans*=3;
        }
        else if(v[i-1]==1 && v[i]==2){
            ans*=2;
        }
        ans%=MOD;
    }
    cout<<ans<<endl;
    
}

Measured memory_bytes: 256
#define ACPC_PPP
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
#include <cstdint>
using namespace std;
using LL = long long;

#define GEKIHIEEE ~~~

LL mex(LL a, LL b) {
	if (a != 0 && b != 0) {
		return 0;
	}
	if (a != 1 && b != 1) {
		return 1;
	}
	return 2;
}

LL K;
LL grundy(LL R, LL L, LL v1, LL v2, LL N) {
	if (L < N && N <= R) {
		if ((R - N) % 2 == 0) {
			return v1;
		}
		else {
			return v2;
		}
	}
	LL nv1 = mex((R - L) % 2 ? v1 : v2, 
		(R - (R / 2) * 2) == 0 ? v1 : v2);
	LL nv2 = mex(nv1, 
		(R - (R / 2) * 2) == 0 ? v1 : v2);
	return grundy(L, L / 2, nv1, nv2, N);
}
LL solve(LL N, LL M) {
	return grundy(M, M / 2, 0, 1, N);
}

int main() {
	cin >> K;
	LL ans = 0;
	
	for (int i = 0; i < K; ++i) {
		LL N, M;
		cin >> N >> M;
		ans ^= solve(N, M);
		//cout << solve(N, M) << endl;
	}
	


	/*for (int i = 1; i <= 10; ++i) {
		for (int j = i; j <= 10; ++j) {
			cout << solve(i, j) << " ";
		}
		cout << endl;
	}*/
	//cout << endl;
	//for (int i = 1; i <= 21; ++i)cout << solve(i, 21) << " ";
	cout << (ans ? "mo3tthi" : "tubuann") << endl;
	return 0;
}


Measured memory_bytes: 3120
#include<bits/stdc++.h>
using namespace std;
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define REP(i, n) for(int i = 0;i < (n);++i)
#define RREP(i, n) for(int i = (n)-1; i >= 0; --i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define BIG 2000000000
#define VERYBIG 1000000000000000ll
#define PI 3.14159265358979
#define coutdb cout<<fixed<<setprecision(50)

const int dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
const long long MOD = 1e9+7;

#define int long long

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
template<class T> inline bool chmax(T& a, T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a, T b){if(a>b){a=b;return 1;}return 0;}

typedef pair<int, int> INTP;
typedef vector<int> INTV;
struct edge2 {int to, cost;};
struct edge3 {int from, to, cost;};

signed main(void){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int L; cin >> L;
  int V = 0, sum = 0, tmp = 0;
  while(1){
  	tmp |= (1ll<<V);
  	if(tmp > L-1) break;
  	V++;
  }
  V++;
  vector<edge3> edges;
  REP(i, V-1){
  	edges.pb({V-1-i, V-i, (1ll<<i)});
    edges.pb({V-1-i, V-i, 0});
  }
  int left = 0;
  RREP(i, V){
  	if(left + (1ll<<i) > L) continue;
  	if(left > 0 and left < L) edges.pb({1, V-i, left});
    left += (1ll<<i);
  }
  cout << V << ' ' << edges.size() << endl;
  for(auto e : edges){
  	cout << e.from << ' ' << e.to << ' ' << e.cost << endl;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <queue>
#include <bitset>
#include <tuple>
#include <stack>
#include <utility>

using namespace std;
typedef long long ll;

int main(){
    vector<int> ab(6);
    for(int i=0; i<6; i++) cin >> ab[i];
    vector<int> m(4,0);
    for(int i=0; i<6; i++){
        m[ab[i]-1] += 1;
    }
    int max_m = 0;
    for(int i=0; i<4; i++) max_m = max(max_m, m[i]);
    if(max_m == 3) cout << "NO" << endl;
    else cout << "YES" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
int a,b,c;
int main()
{
    scanf("%d%d%d",&a,&b,&c);
    if(a*a+b*b==c*c) printf("%d\n",a*b/2);
    else if(a*a+c*c==b*b) printf("%d\n",a*c/2);
    else printf("%d\n",b*c/2);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    ll n,m; cin >> n >> m;
    vl h(n);
    rep(i,n)cin>>h[i];
    vvl hh(n);
    rep(i,m){
        int a,b;cin>>a >>b;
        a--;b--;
        hh[a].push_back(b);
        hh[b].push_back(a);
    }
    ll res = 0;
    rep(i,n){
        int size = hh[i].size();
        ll num = h[i];
        bool is_res = true;
        rep(j,size){
            ll num1 = hh[i][j];
            //out(num1);
            if(h[i] <= h[num1])is_res = false;
        }
        if(is_res){
            //out(i);
            res++;
        }
    }
    out(res);
}


Measured memory_bytes: 9780
#include<stdio.h>
#include<stdlib.h>
typedef long long ll;
#define max 1000000000000000000
int main(void)
{
  ll n,ans=1,ans_old;
  scanf("%lld",&n);
  ll data[n];
  for(int i=0;i<n;i++){
    scanf("%lld",&data[i]);
    if(data[i]==0){
      printf("0");
      return 0;
    }
  }
  
  for(int i=0;i<n;i++){
    if(ans<=(max/data[i])) ans*=data[i];
    else{
      printf("-1");
      return 0;
    }
  } 
  printf("%lld",ans);
  return 0;
}


Measured memory_bytes: 2508
#include<iostream>
#include<queue>
#include<map>
#include<vector>
using namespace std;
int px[13]={0,1,1,1,2,2,2,2,2,3,3,3,4},py[13]={2,1,2,3,0,1,2,3,4,1,2,3,2};
int xx[12]={0,1,1,1,2,2,2,2,2,3,3,3},yy[12]={0,1,2,3,0,1,2,3,4,1,2,3};
struct board{
	int p[13],a,b;
	bool operator<(const board&a)const
	{
		for(int i=0;i<13;i++)
		{
			if(p[i]!=a.p[i])return p[i]<a.p[i];
		}
		return false;
	}
	int distance()const
	{
		int ret=0;
		for(int i=0;i<13;i++)
		{
			if(p[i]==0)continue;
			ret+=abs(px[i]-xx[p[i]])+abs(py[i]-yy[p[i]]);
		}
		return ret;
	}
};
vector<int>D[13];
main()
{
	D[0].push_back(2);
	D[1].push_back(2);
	D[1].push_back(5);
	D[2].push_back(0);
	D[2].push_back(1);
	D[2].push_back(3);
	D[2].push_back(6);
	D[3].push_back(2);
	D[3].push_back(7);
	D[4].push_back(5);
	D[5].push_back(1);
	D[5].push_back(4);
	D[5].push_back(6);
	D[5].push_back(9);
	D[6].push_back(2);
	D[6].push_back(5);
	D[6].push_back(7);
	D[6].push_back(10);
	D[7].push_back(3);
	D[7].push_back(6);
	D[7].push_back(8);
	D[7].push_back(11);
	D[8].push_back(7);
	D[9].push_back(5);
	D[9].push_back(10);
	D[10].push_back(6);
	D[10].push_back(9);
	D[10].push_back(11);
	D[10].push_back(12);
	D[11].push_back(7);
	D[11].push_back(10);
	D[12].push_back(10);
	while(true)
	{
		board start;
		cin>>start.p[0];
		if(start.p[0]<0)break;
		for(int i=1;i<13;i++)cin>>start.p[i];
		start.a=start.b=-1;
		for(int i=0;i<13;i++)
		{
			if(start.p[i]==0)
			{
				if(start.a<0)start.a=i;
				else start.b=i;
			}
		}
		board goal;
		for(int i=0;i<12;i++)goal.p[i]=i;
		goal.p[12]=0;
		queue<board>P;
		P.push(start);
		map<board,int>M;
		M[start]=0;
		int ans=-1;
		while(!P.empty())
		{
			board now=P.front();P.pop();
			int c=M[now];
			if(c+now.distance()>20)continue;
			if(!(now<goal||goal<now))
			{
				ans=c;
				break;
			}
			for(int v:D[now.a])
			{
				int x=now.a,y=v;
				swap(now.p[x],now.p[y]);
				now.a=y;
				if(M.find(now)==M.end())
				{
					M[now]=c+1;
					P.push(now);
				}
				swap(now.p[x],now.p[y]);
				now.a=x;
			}
			for(int v:D[now.b])
			{
				int x=now.b,y=v;
				swap(now.p[x],now.p[y]);
				now.b=y;
				if(M.find(now)==M.end())
				{
					M[now]=c+1;
					P.push(now);
				}
				swap(now.p[x],now.p[y]);
				now.b=x;
			}
		}
		if(ans<0)cout<<"NA"<<endl;
		else cout<<ans<<endl;
	}
}



Measured memory_bytes: 4516
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define FOR(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define SZ(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define vint vector<int>
#define vvint vector<vector<int>>
#define vstr vector<string>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a*b/gcd(a,b);}
const long long dx[4]={1,0,-1,0};
const long long dy[4]={0,1,0,-1};
const long long INF = 1e12;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    string s,t; cin >> s >>t;
    int res=0;
    rep(i,s.size()){
        if(s[i]!=t[i]) res++;
    }
    cout<<res<<endl;
}

Measured memory_bytes: 3732