akhauriyash/Code-Regression huggingface dataset:
#define ll long long
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define mp make_pair
#define fo(i , n) for(ll i = 0 ; i < n ; i++)
//#include<bits/stdc++.h>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<utility>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<queue>
#include<set>
#include<stack>
double pi = acos(-1) ;
ll z =  1000000000 ;
ll inf = 6000000000000000000 ;
ll p1 = 37 ;
ll p2 = 53 ;
ll mod1 =  202976689 ;
ll mod2 =  203034253 ;
ll gcd(ll a , ll b){ if(b > a) return gcd(b , a) ; if(b == 0) return a ; return gcd(b , a%b) ;}
ll power(ll a ,ll b , ll p){if(b == 0) return 1 ; ll c = power(a , b/2 , p) ; if(b%2 == 0) return ((c*c)%p) ; else return ((((c*c)%p)*a)%p) ;}
ll inverse(ll a ,ll n){return power(a , n-2 , n) ;}
ll max(ll a , ll b){if(a > b) return a ; return b ;}
ll min(ll a , ll b){if(a < b) return a ; return b ;}
ll left(ll i){return ((2*i)+1) ;}
ll right(ll i){return ((2*i) + 2) ;}
void swap(ll&a , ll&b){ll c = a ; a = b ; b = c ; return ;}
//ios_base::sync_with_stdio(0);
//cin.tie(0); cout.tie(0);
using namespace std ;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// ordered_set s ; s.order_of_key(val)  no. of elements strictly less than val
// s.find_by_order(i)  itertor to ith element (0 indexed)
//__builtin_popcount(n) -> returns number of set bits in n

void solve()
{
	ll n ;
	cin >> n ;
	ll arr[n] ;
	fo(i , n)
	{
		arr[i] = 0 ;
	}
	fo(i , n-1)
	{
		ll u ;
		cin >> u ;
		u-- ;
		arr[u]++ ;
	}
	fo(i , n)
	{
		cout << arr[i] << '\n' ;
	}
	return ;
}
 
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    /*#ifndef ONLINE_JUDGE
    freopen("inputf.txt" , "r" , stdin) ;
    freopen("outputf.txt" , "w" , stdout) ;
    freopen("error.txt" , "w" , stderr) ;
    #endif*/
    
    ll t ;
    //cin >> t ;
    t = 1 ;

    while(t--)
    {
        solve() ;
    }
    //cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
 
    return 0;
}

Measured memory_bytes: 5220
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp
{
    class Program
    {
        static void Main(string[] args)
        {
            var ss = Console.ReadLine().Split();
            var N = int.Parse(ss[0]);
            var M = int.Parse(ss[1]);

            var s = new List<List<int>>();
            for (int i = 0; i < M; i++)
            {
                ss = Console.ReadLine().Split();
                var k = int.Parse(ss[0]);

                var tempS = new List<int>();
                for (int j = 1; j <= k; j++)
                {
                    tempS.Add(int.Parse(ss[j]));
                }
                s.Add(tempS);
            }

            ss = Console.ReadLine().Split();
            var p = new int[M];
            for (int i = 0; i < M; i++)
            {
                p[i] = int.Parse(ss[i]);
            }

            var b = new List<string>();

            BinaryTree(N, "", b);

            var sum = 0;
            foreach (var bItem in b)
            {
                for (int i = 0; i < M; i++)
                {
                    var onNum = 0;
                    foreach (var sItem in s[i])
                    {
                        if (bItem[sItem - 1] == '1')
                            onNum++;
                    }

                    if (onNum % 2 != p[i])
                    {
                        break;
                    }

                    if (i == M - 1)
                        sum++;
                }
            }

            Console.WriteLine(sum);
        }

        static string BinaryTree(int length, string s, List<string> b)
        {
            if (s.Length != length)
            {
                BinaryTree(length, s + "0", b);
                BinaryTree(length, s + "1", b);
            }

            if (s.Length == length)
            {
                b.Add(s);
            }
            return s;
        }
    }
}

Measured memory_bytes: 13248
/*
2018 年 1 月某日、高木さんは書類を書いています。
書類には、その日の日付を yyyy/mm/dd という形式で書き込む欄があります。
例えば、2018 年 1月 23 日は 2018/01/23 となります。

書類を書き終えたあと、高木さんは日付欄の先頭に誤って 2017 と書いてしまっていたことに気がつきました。
高木さんが日付欄に書いた文字列 S を入力すると、
S の先頭の 4 文字を 2018 に修正して出力するプログラムを書いてください。

制約
S は長さ 10 の文字列である。
S の先頭の 8 文字は 2017/01/ である。
S の末尾の 2 文字は数字であり、
1 以上 31 以下の整数を表す。
*/
#include <iostream>
#include <string>
using namespace std;

int main() {
    string s;
    cin >> s;
    cout << "2018" + s.substr(4) << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int a, b, x=0, y=0, z=0;
	scanf("%d %d", &a, &b);
	
	x = a+b;
	y = a-b;
	z = a*b;
	
	if(x>y && x>z)
		printf("%d\n", x);
	else if(y>x && y>z)
		printf("%d\n", y);
	else if(z>x && z>y)
		printf("%d\n", z);
	else
		printf("%d\n", x);
		
		
}




Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main() {
    int r, c;
    cin >> r >> c;
    int a[r+1][c+1];
    for(int i = 0; i < r; i++) {
        for(int j = 0; j < c; j++) {
            cin >> a[i][j];
        }
    }
    for(int i = 0; i < r; i++) {
        int sum = 0;
        for(int j = 0; j < c; j++) {
            sum += a[i][j];
        }
        a[i][c] = sum;
    }
    for(int i = 0; i < c; i++) {
        int sum = 0;
        for(int j = 0; j < r; j++) {
            sum += a[j][i];
        }
        a[r][i] = sum;
    }
    int sum = 0;
    for(int i = 0; i < r; i++) {
        sum += a[i][c];
    }
    a[r][c] = sum;
    for(int i = 0; i <= r; i++) {
        for(int j = 0; j <= c; j++) {
            if(j == 0) cout << a[i][j];
            else cout << " " << a[i][j];
        }
        cout << endl;
    }
}


Measured memory_bytes: 3120
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        if(s.contains("a") && s.contains("b") && s.contains("c")){
            System.out.println("Yes");
            return;
        }
        System.out.println("No");
    }
}


Measured memory_bytes: 24788
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define MOD (int)1e9+7
#define INF (int)1e15
//typedef pair<int, int> P;
#define PP pair<int,tuple<int,int,int>>
int x, y, z, k;
int a[1111], b[1111], c[1111];
map<pair<int, pair<int, int>>, bool>mp;
priority_queue<PP, vector<PP>> q;
signed main() {
	cin >> x >> y >> z >> k;
	rep(i, x)cin >> a[i];
	rep(i, y)cin >> b[i];
	rep(i, z)cin >> c[i];
	sort(a, a + x, greater<int>());
	sort(b, b + y, greater<int>());
	sort(c, c + z, greater<int>());
	a[x] = -INF;
	b[y] = -INF;
	c[z] = -INF;
	q.push({ a[0] + b[0] + c[0],make_tuple(0,0,0) });
	rep(i, k) {
		PP p = q.top();
		q.pop();
		int A = get<0>(p.second);
		int B = get<1>(p.second);
		int C = get<2>(p.second);
		if (mp[{A, { B,C }}]) {
			i--; continue;
		}
		mp[{A, { B,C }}] = true;
		cout << p.first << endl;
		
		q.push({ p.first - a[A] + a[A + 1], make_tuple(A + 1,B,C) });
		q.push({ p.first - b[B] + b[B + 1], make_tuple( A,B + 1,C ) });
		q.push({ p.first - c[C] + c[C + 1], make_tuple( A,B,C + 1 ) });
	}
	return 0;
}

Measured memory_bytes: 768
#include <cstdio>
#include <cstdlib>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define repi(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i,a) repi(i,0,a)
#define repdi(i,a,b) for(ll i=(a)-1;i>=(b);--i)
#define repd(i,a) repdi(i,a,0)
#define itr(it,a) for( auto it = (a).begin(); it != (a).end(); ++it )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

using ll = long long;
using P = std::pair<ll, ll>;

constexpr ll INF = 1ll<<60;

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; }

template<class S, class T>
std::ostream& operator<< ( std::ostream& out, const std::pair<S,T>& a )
{ std::cout << '(' << a.first << ", " << a.second << ')'; return out; }

template<class T>
std::ostream &operator<< ( std::ostream& out, const std::vector<T>& a )
{ std::cout << '['; rep( i, a.size() ){ std::cout << a[i]; if( i != a.size()-1 ) std::cout << ", "; } std::cout << ']'; return out; }

ll X, N;
ll p[110];
ll mi = INF, ans = INF;
std::set<ll> S;

int main() {
  std::cin >> X >> N;

  rep( i, N ) {
    std::cin >> p[i];

    S.emplace( p[i] );
  }

  ll cur = 0;

  while( true ) {
    if( !S.count(X-cur) ) {
      std::cout << X-cur << std::endl;

      return 0;
    }
    if( !S.count(X+cur) ) {
      std::cout << X+cur << std::endl;

      return 0;
    }

    ++cur;
  }

  return 0;
}

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

int main() {
    int N, M;
    cin >> N >> M;
    pair<int, int> itv[M];
    for(int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
        itv[i].first = b;
        itv[i].second = a;
    }
    sort(itv, itv+M);
    int ans = 0;
    int t = 0;
    for(int i = 0; i < M; i++) {
        if(itv[i].second < t) {
            continue;
        }
        t = itv[i].first;
        ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1152
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
typedef long long ll;
const int maxn = 1000 + 10;

int n, cnt = 0;
ll ans[50];
struct anode{
  ll x, y;
  anode() {}
  anode(ll _x, ll _y):x(_x), y(_y) {}
}a[maxn];
char f[maxn][50];

inline void work(ll k) {
  cnt ++; ans[cnt] = k;
  for(int i = 1;i <= n;i ++) {
    if(abs(a[i].x) > abs(a[i].y)) {
      if(a[i].x > 0) a[i].x -= k, f[i][cnt] = 'R';
      else a[i].x += k, f[i][cnt] = 'L';
		}
		else {
		  if(a[i].y > 0) a[i].y -= k, f[i][cnt] = 'U';
		  else a[i].y += k, f[i][cnt] = 'D';
		}
	}
}

int main() {
	scanf("%d", &n);
	for(int i = 1;i <= n;i ++) scanf("%lld%lld", &a[i].x, &a[i].y);
	for(int i = 30;i >= 0;i --)
	  work(1LL << i);
	if(a[1].x || a[1].y) work(1);
	for(int i = 1;i <= n;i ++) {
	  if(a[i].x || a[i].y) {
	    puts("-1");
	    return 0;
		}
	}
	printf("%d\n", cnt);
	for(int i = 1;i <= cnt;i ++) printf("%d ", ans[i]);
	for(int i = 1;i <= n;i ++) {
	  for(int j = 1;j <= cnt;j ++) printf("%c", f[i][j]);
	  puts("");
	}
  return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <cstring>
#include <cstdlib>
using namespace std;

#define REP(i,n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> pint;
template <class T> inline void chmax(T &a, const T b) { a = max(a, b); }
template <class T> inline void chmin(T &a, const T b) { a = min(a, b); }
template <class T> void pp(T v, int n) { REP(i,n) cout<<v[i]<< ' '; cout << endl; }

void inline TorF(bool tf, const string &trueMessage, const string &falseMessage) { 
  cout << (tf ? trueMessage : falseMessage) << endl;
}
void inline YESNO(bool tf) { TorF(tf, "YES", "NO"); }
void inline YesNo(bool tf) { TorF(tf, "Yes", "No"); }

int main() {
  ll N; cin>>N;
  ll x = 1;
  for(ll i = 1; i * i <= N; i++) {
    if(N % i == 0) x = i;
  }
  ll y = N / x;
  ll ans = (x + y) - 2LL;
  cout << ans << endl;
  return 0;
}


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

using namespace std;

int main(){
	string s,t;
	cin>>s>>t;
	int m = s.length();
	int n = t.length();
	int dp[m+1][n+1];
	for(int i=0;i<=m;i++){
		for(int j=0;j<=n;j++){
			dp[i][j] = 0;
		}
	}
	for(int i=1;i<=m;i++){
		for(int j=1;j<=n;j++){
			if(s[i-1] == t[j-1]){
				dp[i][j] = 1+dp[i-1][j-1];
			}
			else{
				dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
			}
		}
	}
	int k = dp[m][n];
	string lcs(k,'.');
	int i=m;
	int j=n;
	int p=k-1;
	while(i>0 && j>0){
		if(s[i-1] == t[j-1]){
			lcs[p] = s[i-1];
			i--;
			j--;
			p--;
		}
		else if(dp[i-1][j] > dp[i][j-1]){
			i--;
		}
		else
		j--;
	}
	cout<<lcs;
}


Measured memory_bytes: 35456
#import
#import math
#import numpy as np
#= int(input())
#= input()
N, W = map(int, input().split())
#= list(map(int, input().split()))
#= [input(), input()]

x = [list(map(int, input().split())) for _ in range(N)]

dp = [[10**10] * (10 ** 5 + 10) for _ in range(N + 1)]

dp[0][0] = 0

#  i:N個目 j:価値

for i, (w, v) in enumerate(x, 1):
    for j in range(10**5 + 1):
        dp[i][j] = dp[i - 1][j]
        if j != 0 and v <= j:
            dp[i][j] = min(dp[i][j], dp[i - 1][j - v] + w)

for i in range(10 ** 5, -1, -1):
    if dp[-1][i] <= W:
        print(i)
        exit()


Measured memory_bytes: 148512
#include<bits/stdc++.h>
using namespace std;
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld ",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define pb push_back
#define f first
#define s second
#define vi vector<int>
#define vl vector<long long>
#define vs vector<string>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define d0(x) cout<<(x)<<" "
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define d5(a,b,c,d,e) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<" "<<(e)<<endl
#define fo(i,a,b) for(long long i=a;i<b;i++)
#define all(c) (c).begin(),(c).end()
#define ll long long
const int M=1e9+7;
#define endl "\n"
const double pyi=3.14159265358979323846;




int main() 
{ 
    int n,m,x;
    sfi(n); sfi(m); sfi(x);

    vector<vector<int>> vvi;
    fo(i,0,n)
    {
    	vi v;
    	fo(j,0,m+1)
    	{
           int a;
           sfi(a);
           v.pb(a);
    	}
    	vvi.pb(v);
    }

    // for(auto it : vvi)
    // {
    // 	for(auto it1 : it)
    // 		d0(it1);
    // 	cout<<endl;
    // }
    
    int ans=1e9;
     for(int mask = 1 ;mask<((1<<n));mask++)
     {
     	int temp=0;
     	vi v1(m,0);
     	int cnt=0,tt=mask;
     //	watch(mask);
        while(tt)
        {
            if(tt&1)
            {
            	//d2(tt,cnt);
            	 temp+=vvi[cnt][0];
            	 fo(i,0,m)
            	 	v1[i]+=vvi[cnt][i+1];
            }
            cnt++;
            tt=tt>>1;
        }
        
        int val=0;
        fo(j,0,m)
        {
           if(v1[j]<x)
           	val=1;
        }

        if(val==0)
        	ans=min(ans,temp);
     }
     
     if(ans!=1e9)
     d1(ans);
     else
 	 d1(-1);


    return(0);
}

Measured memory_bytes: 3700
#include "bits/stdc++.h"
using namespace std;

int main(void) {
    int a, b, c;
    cin >> a >> b >> c;
    if ((100 * a + 10 * b + c) % 4 == 0) {
        cout << "YES";
    }
    else {
        cout << "NO";
    }
    return 0;
}

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

int main() {
    std::string a,b,c;
    cin>>a>>b>>c;
    if(a[a.size()-1]==b[0] && b[b.size()-1]==c[0]){
        cout<<"YES"<<endl;
    }else{
        cout<<"NO"<<endl;
    }
}

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

using namespace std;

/**
 *  Name: Chris M. Perez
 *  University: Interamerican University Metro Campus
 *
**/

#define endl '\n'
#define MOD 1000000007
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define gcd(x , y) __gcd(x , y)
#define all(x) (x).begin() , (x).end()
#define forn(i , a , b) for(int i=(a);i<(b);i++)
#define forrange(j , a , b) for(int j=(a);j<=(b);j++)
#define nestedforn(i , a , b , j , c , d) for(int i=(a);i<=(b);i++) for(int j=(c);j<=(d);j++)
#define sort_all(x) sort(all(x))
#define zeros_at_beginning(x) __builtin_clz(x)
#define zeros_at_end(x) __builtin_ctz(x)
#define ones(x) __builtin_popcount(x)
#define parity_even_or_odd_ones __builtin_parity(x)

typedef vector<int> vi;
typedef pair<int , int> pii;
typedef tuple<int , int , int> tiii;
typedef vector<pii> vpii;
typedef vector<tiii> vtiii;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef long long ll;
typedef long long int lli;

             
inline int input(){
  int n;
  scanf("%d" , &n);
  return n;
}

ll dp[30];
                     
int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.precision(10);
  cout << fixed;  

#ifdef LOCAL_DEFINE
  freopen("input.txt" , "rt" , stdin);
#endif
  
  int n; cin >> n;
  string s; cin >> s;
  for(auto chars: s) dp[chars - 'a']++;
  ll k = 1;
  forn(i , 0 , 26){
    k *= dp[i] + 1;
    k %= (ll) MOD;
  }
  cout << (k + (ll)MOD - 1) % (ll)MOD << endl;
   
            
#ifdef LOCAL_DEFINE
  cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif  
  return 0;
}

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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};


int main()
{
  int d, t, s;
  cin >> d >> t >> s;
  if((int)ceil((double)d/s) <= t) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3612
#include"bits/stdc++.h"

using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<< #str << " " str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7

ll g(const ll x) {
	ll res = 0;
	if ((x + 1) / 2 % 2 == 1)res++;

	FOR(i, 1, 50) if ((x >> i) & 1 == 1 && x % 2 == 0)res += (1ll << i);
	return res;
}

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

	ll res = (A ? g(A - 1) : 0) ^ g(B);
	cout << res << endl;

	return 0;
}


Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy,copy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

def main():
    a, b = MAP()
    if a < 10 and b < 10:
        print(a*b)
    else:
        print(-1)

if  __name__=='__main__':
    main()


Measured memory_bytes: 5760
<?php

$degit = array(
	"I" => 1,
	"V" => 5,
	"X" => 10,
	"L" => 50,
	"C" => 100,
	"D" => 500,
	"M" => 1000
);

while($line = fgets(STDIN)){
    $line = trim($line);
    
    $s = 0;
    $oldd = 0;
    for($i = 0; $i < strlen($line); $i++){
    	$c = $line[$i];
    	$d = $degit[$c];
    	if($oldd < $d){
    		$s -= $oldd;
    	}else{
    		$s += $oldd;
    	}
    	$oldd = $d;
    }
    $s += $oldd;
    
    echo $s."\n";
}

Measured memory_bytes: 15076
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;

public class Main {

	/* several useful subroutines */
	private static BufferedReader brStdin = new BufferedReader(new InputStreamReader(System.in));
	private static String[] readBuf = null;
	private static int readPtr = 0;
	private static String getString() throws IOException {
		while ( readBuf == null || readPtr >= readBuf.length ) {
			readBuf = brStdin.readLine().split(" ");
			readPtr = 0;
		}
		return readBuf[readPtr++];
	}
	private static int getInt() throws IOException {
		return Integer.parseInt(getString());
	}
	private static long getLong() throws IOException {
		return Long.parseLong(getString());
	}
	private static BigDecimal getBD() throws IOException {
		return new BigDecimal(getString());
	}
	@SuppressWarnings("unused")
	private static String[] getStringArray(int size) throws IOException {
		String stringArray[] = new String[size];
		for (int i = 0; i < stringArray.length; i++) {
			stringArray[i] = getString();
		}
		return stringArray;
	}
	@SuppressWarnings("unused")
	private static int[] getIntArray(int size) throws IOException {
		int intArray[] = new int[size];
		for (int i = 0; i < intArray.length; i++) {
			intArray[i] = getInt();
		}
		return intArray;
	}
	@SuppressWarnings("unused")
	private static long[] getLongArray(int size) throws IOException {
		long longArray[] = new long[size];
		for (int i = 0; i < longArray.length; i++) {
			longArray[i] = getLong();
		}
		return longArray;
	}
	@SuppressWarnings("unused")
	private static BigDecimal[] getBDArray(int size) throws IOException {
		BigDecimal bdArray[] = new BigDecimal[size];
		for (int i = 0; i < bdArray.length; i++) {
			bdArray[i] = getBD();
		}
		return bdArray;
	}
	@SuppressWarnings("unused")
	private static long calculateLCM(long a, long b) throws IOException {
		if ( a  < b ) {
			long t = a;
			a = b;
			b = t;
		}
		while ( b > 0 ) {
			long t = b;
			b = a % b;
			a = t;
		}
		return a;
	}

	
	/* main routine */
	
	public static void main(String args[]) throws IOException {
		int n = getInt();
		
		Set<Integer> as = new HashSet<Integer>();

		for ( int i = 1 ; i <= 9 ; i++ ) {
			for ( int j = i ; j <= 9 ; j++ ) {
				as.add(i*j);
			}
		}

		System.out.println( as.contains(n) ? "Yes" : "No" );
		
	}
}


Measured memory_bytes: 21076
#include<bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<string> s;
  for (int i = 0; i < n; i++) {
    string t;
    cin >> t;
	s.insert(t);
  }
  cout << s.size() << endl;
}

Measured memory_bytes: 19128
#include <iostream>
#define rep(i,beg,end) for(int i=(beg);i<(end);i++)
using namespace std;

int main(){
	long long h,nums[100004],n;
	cin>>h>>n;
	long long tot=0;
	rep(i,0,n){
		cin>>nums[i];
		tot+=nums[i];
	}
	if(tot>=h)cout<<"Yes\n";
	else cout<<"No\n";
	return 0;
}


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

int main(){
    int n;
    cin >> n;
    int A[n];
    for(int i = 0; i < n; i++){
        cin >> A[i];
    }
    for(int i = 0; i < n; i++){
        if(A[i] % 2 == 0){
            if(A[i] % 3 == 0 || A[i] % 5 == 0){
                continue;
            }else{
                cout << "DENIED" << endl;
                return 0;
            }
        }
    }
    cout << "APPROVED" << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main{


	static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

	public static int nextInt() throws IOException {
		return Integer.parseInt(br.readLine());
	}

	public static long nextLong() throws IOException {
		return Long.parseLong(br.readLine());
	}

	public static String next() throws IOException {
		return br.readLine();
	}

	public static int[] sortArr(int arr[]) throws IOException {
		ArrayList<Integer> a = new ArrayList<Integer>();
		for (int i : arr)
			a.add(i);

		Collections.sort(a);

		for (int i = 0; i < a.size(); i++)
			arr[i] = a.get(i);
		return arr;
	}

	public static int[] desortArr(int arr[]) throws IOException {
		ArrayList<Integer> a = new ArrayList<Integer>();
		for (int i : arr)
			a.add(i);

		Collections.sort(a, Collections.reverseOrder());

		for (int i = 0; i < a.size(); i++)
			arr[i] = a.get(i);
		return arr;
	}

	public static int[] nextArr() throws IOException {
		String elements[] = br.readLine().split(" ");
		int arr[] = new int[elements.length];
		for (int j = 0; j < elements.length; j++)
			arr[j] = Integer.parseInt(elements[j]);
		return arr;
	}

	public static void printArr(int arr[]) {
		for (int i = 0; i < arr.length; i++)
			System.out.print(arr);
	}

	public static void main(String[] args) throws IOException {

		int T = 1;
	
		while (T-- > 0) {

			int input[] = nextArr();
			int n = input[0];
			int k = input[1];
			ArrayList<Integer> arr = new ArrayList<Integer>();
			int b[] = nextArr();

			for (int i : b)
				arr.add(i);
			Collections.sort(arr);

			int ans = 0;
			for (int i = 0; i < k; i++)
				ans += arr.get(i);
			System.out.println(ans);

		}
	}


}


Measured memory_bytes: 32856
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a,b,c=0;
  cin>>a>>b;
  if(a%3==0||b%3==0||(a+b)%3==0)
  {
  	cout<<"Possible"<<endl;
  	return 0;
	  }	
  else
    cout<<"Impossible"<<endl;
	return 0;	  
}

Measured memory_bytes: 256
struct Read<R: std::io::BufRead> {
    stdin: R,
    v: Vec<String>,
    i: usize,
}
impl<R: std::io::BufRead> Read<R> {
    pub fn new(stdin: R) -> Self {
        Read {
            stdin: stdin,
            v: Vec::new(),
            i: 0,
        }
    }
    pub fn read_line(&mut self) {
        self.i = 0;
        self.v.clear();
        let mut buf = String::new();
        self.stdin.read_line(&mut buf).unwrap();
        let buf = buf.trim().to_owned();
        let mut ws = buf.split_whitespace();
        loop {
            let x = ws.next();
            if x.is_none() {
                break;
            }
            let x = x.unwrap().to_owned();
            self.v.push(x);
        }
    }
    #[allow(dead_code)]
    pub fn read_a<T: std::str::FromStr>(&mut self) -> T {
        if self.i == self.v.len() {
            self.read_line();
        }
        let elem = &self.v[self.i];
        self.i += 1;
        elem.parse().unwrap_or_else(|_| panic!())
    }
}

fn main() {
    use std::io;
    let stdin = io::stdin();
    let stdin = io::BufReader::new(stdin.lock());
    let read = Read::new(stdin);
    solve(read);
}
#[allow(unused_imports)]
use std::cmp;

fn solve<R: std::io::BufRead>(mut r: Read<R>) {
    let n: i32 = r.read_a();
    let m: i32 = r.read_a();
    let x: i32 = r.read_a();
    let mut c: Vec<i32> = Vec::new();
    let mut a: Vec<Vec<i32>> = Vec::new();
    for i in 0..n as usize {
        c.push(r.read_a());
        a.push(Vec::new());
        for j in 0..m {
            a[i].push(r.read_a());
        }
    }

    let mut ans = std::i32::MAX;

    for mut i in 1..1 << n {
        let mut tmp = 0;
        let mut sum = vec![0; m as usize];
        for j in 0..n as usize {
            if i & 1 == 1 {
                tmp += c[j as usize];
                for k in 0..m as usize {
                    sum[k] += a[j as usize][k];
                }
            }
            i >>= 1;
            if i <= 0 {
                break;
            }
        }
        if sum.iter().all(|&a| a >= x) {
            ans = std::cmp::min(ans, tmp)
        }
    }

    println!("{}", if ans != std::i32::MAX { ans } else { -1 });
}


Measured memory_bytes: 2176
/*
welcome to my code           hi from    s_agnik1511 
Don't just copy it.
Analyze it.
coz that's what heroes do.....
*/
#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<numeric>
#include<vector>
#include<math.h>
using namespace std;
#define dude             ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define mesc(number,character)   char f[number];memset(f,character,number);
#define mesi(number,value)   int f[number];memset(f,value,number);
#define fr(i,start,end)  for(i=start;i<=end;i++)
#define rf(i,start,end)  for(i=start;i>=end;i--)
#define tst              int t;cin>>t;while(t--)
#define ppc(num)         __builtin_popcount(num)
#define ai               ll n,i;cin>>n;ll a[n];
#define pi               3.14159265358979323846
#define ctz(num)         __builtin_ctz(num)
#define clz(num)         __builtin_clz(num)
#define ll               long long int
#define ld               long double
#define pb               push_back
#define r0               return 0;
#define pp               pop_back
#define vec              vector
#define S                string
#define D                double
#define len              length
#define br               break;
#define wh               while
#define F                float
#define gcd              __gcd
#define sz               size
#define end              "\n"
#define sp              " "
const ll ifn=-1000000007;
ll power(ll x, ll y, ll p) { 
    ll res = 1;
    x = x % p;  
    while (y > 0) { 
        if (y & 1) 
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p; 
    } 
    return res; 
} 
int bs(int arr[],int l,int r,int x) { 
    while (l <= r) { 
        int m=l+(r-l)/2; 
        if (arr[m]==x) 
            return m;
        if (arr[m]<x) 
            l=m+1;
        else
            r=m-1; 
    }
    return -1; 
}
void swap(int x,int y) {
    int t=x;
    x=y;
    y=t;
}
bool vow(char c) {
    if(c=='a'||c=='e'||c=='i'||c=='o'||c=='u') {
        return true;
    }
    else {
        return false;
    }
}
/*int mmsed() {
    ll f[n];
    memset(f,1,n) {
        
    }
}*/
int fact(ll x) {
    ll i=1,cnt=1;
    fr(i,1,x) {
        cnt*=i;
    }
    return cnt;
}
bool isPrime(ll n) { 
    if (n<=1)  return false; 
    if (n<=3)  return true;
    if (n%2==0||n%3==0) return false; 
  
    for (ll i=5;i*i<=n;i=i+6) 
        if (n%i==0||n%(i+2)==0) 
           return false; 
  
    return true; 
} 
int chek(S s,int i,int j) {
    ll cnt=0,k,a;
    fr(k,i,j) {
        //cnt=(cnt*10)+(int(s[k])-48);
        a=int(s[k])-48;
        cnt=(cnt*10)+(a);
    }
    return cnt;
}
void solve() {
ll x;
cin>>x;
ll p=x%10;
if(p==2||p==4||p==5||p==7||p==9) {
    cout<<"hon";
}
else if(p==3) {
    cout<<"bon";
}
else {
    cout<<"pon";
}
}
int main() {
    dude
    solve();
    
   r0
}


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

const int M=1e5+5;

int main()
{
	int n,m; scanf("%d%d",&n,&m);
	if(!(n&1)) n--;
	int l=1,r=n/2;
	while(m&&l<r)
	{
		printf("%d %d\n",l,r);
		m--;
		l++; r--;
	}
	l=n/2+1; r=n;
	while(m&&l<r)
	{
		printf("%d %d\n",l,r);
		m--;
		l++; r--;
	}
	return 0;
}

Measured memory_bytes: 3800
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define PI acos(-1.0)
#define INF 1000000000
#define pow10 tipa_pow10
using namespace std;
const int mod = 1000 * 1000 * 1000 + 7;

int n;
string s[300];
ll rowHash[300] , colHash[300];
ll pow29[300];
int main()
{
    pow29[0] = 1;
    cin >> n;
    for(int i = 1; i < n; i++)
        pow29[i] = 29 * pow29[i - 1];
   // cout << pow29[n - 1] << endl;
    for(int i = 0; i < n; i++)
        cin >> s[i];
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            rowHash[i] *= 29;
            rowHash[i] += s[i][j] - 'a';
        }
     //   cout << rowHash[i] << endl;
        for(int j = 0; j < n; j++)
        {
            colHash[i] *= 29;
            colHash[i] += s[j][i] - 'a';
        }
        //cout << colHash[i] << endl;
    }
    //cout << endl;

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

            bool good = true;
            for(int k = 0; k < n; k++)
                good &= rowHash[k] == colHash[k];

            ans += good;
            for(int k = 0; k < n; k++)
            {
                rowHash[k] -= (s[(k + i) % n][j] - 'a') * pow29[n - 1];
               // cout << rowHash[k] << endl;
                rowHash[k] *= 29;
                rowHash[k] += (s[(k + i) % n][j] - 'a');
                //cout << rowHash[k] << endl;
            }
            ll zeroHash = colHash[0];
            for(int k = 0; k < n - 1; k++)
            {
                colHash[k] = colHash[k + 1];
             //   cout << colHash[k] << endl;
            }
            //cout << zeroHash << endl;
            colHash[n - 1] = zeroHash;
        }

        for(int k = 0; k < n; k++)
        {
            colHash[k] -= (s[i][k] - 'a') * pow29[n - 1];
            colHash[k] *= 29;
            colHash[k] += (s[i][k] - 'a');
        }
        ll zeroHash = rowHash[0];
        for(int k = 0; k < n - 1; k++)
        {
            rowHash[k] = rowHash[k + 1];
        }
        rowHash[n - 1] = zeroHash;
    }
    cout << ans;
}


Measured memory_bytes: 384
#include <iostream>
#include <string>
#include <stdio.h>
using namespace std;
 
int main(){
  long long int x,m,ans;
  m = 100;
  cin >> x; 
  for (long long int i = 1; i < 1e18; ++i) {
  	m += m*0.01;
   	if (m >= x) break;
    ans = i + 1;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>

int gcd(int,int);
int lcm(int,int);

int main(){
	int a,b;
	while(scanf("%d %d",&a,&b) != EOF){
		printf("%d %d\n",gcd(a,b),lcm(a,b));
	}
	return 0;
}

int gcd(int m, int n){
	if(m == 0 || n == 0) return 0;
	while(n != m){
		if (m > n) m -= n;
		else n -= m;
	}
	return n;
}

int lcm(int m, int n){
	return m / gcd(m, n) * n;
}

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

using namespace std;

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

  const int MOD = 998244353;
  auto mod_pow = [&](int x, int y) {
    long t = 1;
    long u = x;
    while (y) {
      if (y & 1) {
        t *= u;
        t %= MOD;
      }
      u *= u;
      u %= MOD;
      y >>= 1;
    }
    return t;
  };
  auto mod_div = [&](int x) {
    return mod_pow(x, MOD-2);
  };
  const int MAX = 1e6+1;

  int N; cin>>N;
  int ans = 0;
  vector<int> amap(MAX, 0);
  for (int i = 0; i < N; i++) {
    int a; cin>>a;
    amap[a]++;
    ans += MOD - a;
    ans %= MOD;
  }
  vector<int> W(MAX);
  for (int i = 1; i < MAX; i++) {
    W[i] = mod_div(i);
  }
  for (int i = 1; i < MAX; i++) {
    for (int j = i+i; j < MAX; j += i) {
      W[j] += MOD - W[i];
      W[j] %= MOD;
    }
  }
  for (int i = 1; i < MAX; i++) {
    int temp = 0;
    for (int j = i; j < MAX; j += i) {
      temp += (long)j * amap[j] % MOD;
      temp %= MOD;
    }
    ans += (long)temp * temp % MOD * W[i] % MOD;
    ans %= MOD;
  }
  ans = (long)ans * mod_div(2) % MOD;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 8064
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, a[N];

void yes(){
   cout<<"Yes"<<endl;
   //exit (0);
}
void no(){
   cout<<"No"<<endl;
   //exit (0);   
}

int32_t main(){_
      
   int a, b, c;
   cin >> a >> b >> c;

   set<int> s;
   s.insert(a);
   s.insert(b);
   s.insert(c);

   if ((int)(s.size()) == 2){
      yes();
   }
   else{
      no();
   }
   

   return 0;
}

Measured memory_bytes: 256
import logging
from math import factorial

logging.basicConfig(level=logging.INFO, format="%(message)s")
#logging.disable(logging.CRITICAL)

steps_memo =[0 for _ in range(150000)]
def cal_steps(num):
    steps_memo[0] = 1
    steps_memo[1] = 1

    for i in range(2, num):
        steps_memo[i] = steps_memo[i - 1] + steps_memo[i - 2]

    return steps_memo[num - 1]
    
def main():
    N, M = (int(x) for x in input().split())
    a_s = [int(input()) for _ in range(M)]

    logging.info(a_s)
    
    a_s.append(N + 1)
    a_s.insert(0, -1)
    diff_a = [a_s[i + 1] - a_s[i] - 1 for i in range(M + 1)]

    if diff_a[0] == 0:
        diff_a[0] = 1
    
    logging.info(diff_a)

    
    answer = 1
    for i in diff_a:
        answer *= int(cal_steps(i))

    print(answer % (10 ** 9 + 7))
        

if __name__ == "__main__":
    main()


Measured memory_bytes: 461680
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
const int maxn=15;
int main()
{
    string s;
    cin>>s;
    int len=s.size();
    int f=0;
    int a=-1;int b=-1;
    for(int i=0;i<len-1;i++)
    {
        if(s[i]==s[i+1])
        {
            a=i+1;
            b=i+1+1;
            break;
        }
    }
    for(int i=0;i<len-2;i++)
    {
        if(s[i]==s[i+2])
        {
            a=i+1;
            b=i+2+1;
            break;
        }
    }
    printf("%d %d\n",a,b);
}



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

public class Main{
  static int n;
  static int[] a;

  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);

    n = sc.nextInt();
    a = new int[n];
    for(int i = 0; i < n; i++){
      a[i] = sc.nextInt();
    }

    Arrays.sort(a);
    long s = 0, t = 0;
    for(int i = n - 2; i >= 0; i--){
      if(s == 0 && a[i] == a[i + 1]){
        s = a[i];
        --i;
      }
      else if(t == 0 && a[i] == a[i + 1]){
        t = a[i];
        --i;
      }
    }

    System.out.println(s * t);
  }
}


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

using namespace std;

int main() {
  double a, b, h, m;
  cin >> a >> b >> h >> m;

  double l = m * 360 / 60;
  double s = (h * 60 + m) * 360 / (12 * 60);

  double angle = s - l;
  double rad = (angle * M_PI) / 180;
  double ans = a * a + b * b - 2 * a * b * cos(rad);
  ans = sqrt(ans);
  cout << fixed << setprecision(12) << ans << '\n';
  return 0;
}



Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll=long long;
int main(){
    int n;
    cin>>n;
    vector<ll> a(n);
    priority_queue<ll> q;
    map<ll,ll> mp;
    rep(i,n) {
        cin>>a[i];
        q.push(a[i]);
    }
    int num=q.top();
    q.pop();
    mp[num]++;
    while(!q.empty()){
        if(q.top()==num){
            mp[num]++;
            q.pop();
        }else{
            num--;
        }
    }
    ll sum =0;
    for(auto i=mp.begin();i!=mp.end();i++){
            ll sec=i->second;
          //cout << i->first << " " << i->second << "\n";
            sum +=sec*(sec-1)/2;
    }
    for(int k=0;k<n;k++){
        ll ban=mp[a[k]];
        ll ans =sum- (ban-1);
        cout << ans <<" ";
    }

}

Measured memory_bytes: 12784
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    int a,b;
    cin>>a>>b;
    if(n==1) cout<<"Hello World"<<endl;
    else cout<<a+b<<endl;
    
    return 0;
}

Measured memory_bytes: 256
using System;

namespace ABC045_1_Trapezoids
{
    class ABC045_1
    {
        static void Main(string[] args)
        {
            int a = int.Parse(Console.ReadLine());
            int b = int.Parse(Console.ReadLine());
            int h = int.Parse(Console.ReadLine());

            Console.WriteLine((a + b) * h / 2);
        }
    }
}


Measured memory_bytes: 2776
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String [] args) throws IOException {
		BufferedReader br = new BufferedReader (new InputStreamReader(System.in));
		 int n =Integer.valueOf(br.readLine());
	     int z =Integer.valueOf(br.readLine());
		 
		 if(n==1) {
			 if(z==2) {
				 System.out.print("3");
			 }
			 else if(z==3) {
				 System.out.print("2");
			 }
		 }else if(n==2) {
			 if(z==1) {
				 System.out.print("3");
			 }
			 else if(z==3) {
				 System.out.print("1");
			 }
		 }else if(n==3) {
			 if(z==1) {
				 System.out.print("2");
			 }
			 else if(z==2) {
				 System.out.print("1");
			 }
		 }
	}

}


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

int n,m,k;


int main(){
#ifdef WK
	freopen("in.txt","r",stdin);
#endif
	scanf("%d%d",&n,&m);
	int sum=0;
	for(int i=1;i<=m;i++){
		int aa;scanf("%d",&aa);
		sum+=aa;
	}
	printf("%s\n",(sum>=n)?"Yes":"No");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
const int INF = 1LL<<60;
const int MOD = (int)1e9 + 7;

signed main() {
    int n;
    cin >> n;
    vector<int> v;
    v.push_back(0);
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        v.push_back(x);
    }
    v.push_back(0);
    int s = 0;
    for (int i = 0; i < n + 1; i++) {
        s += abs(v[i] - v[i + 1]);
    }

    for (int i = 1; i < n + 1; i++) {
        int ans = s;
        ans -= abs(v[i] - v[i - 1]) + abs(v[i] - v[i + 1]);
        ans += abs(v[i + 1] - v[i - 1]);
        cout << ans << "\n";
    }
}

Measured memory_bytes: 2164
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int N,M,L;
double X[105];
int T[105],V[105];
double C[105][105];
double P[105][55];
double rest[105][55];
double ans[105];
inline void calC()
{
	int i,j;C[0][0]=1;C[1][0]=1;C[1][1]=1;
	for(i=2;i<=50;i++)
	{
		C[i][i]=1;C[i][0]=1;
		for(j=1;j<i;j++)
			C[i][j]=C[i-1][j]+C[i-1][j-1];
	}
}
inline void calR()
{
	int i,j;
	for(i=1;i<=N;i++)
	{
		rest[i][0]=L*1.0/(V[i]*1.0);
		for(j=1;j<=M;j++)
			rest[i][j]=rest[i][j-1]+T[i];
	}
}
inline void calP()
{
	int i,j;
	for(i=1;i<=N;i++)
		for(j=0;j<=M;j++)
			P[i][j]=C[M][j]*pow(X[i],j*1.0)*pow((1-X[i]),(M-j)*1.0);
}
inline double cal(int pos,double MAXN)
{
	int i,j;double temp;
	double ret=1.0;
	for(i=1;i<=N;i++)
	{
		if(i==pos)
			continue;
		temp=0.0;
		for(j=M;j>=0&&rest[i][j]>MAXN;j--)
			temp+=P[i][j];
		ret*=temp;
	}
	return ret;
}
inline void solve()
{
	int i,j;
	calC();calR();calP();
	for(i=1;i<=N;i++)
	{
		ans[i]=0.0;double temp=1.0;
		for(j=0;j<=M;j++)
			ans[i]+=P[i][j]*cal(i,rest[i][j]);
	}
	for(i=1;i<=N;i++)
		printf("%.7lf\n",ans[i]);
}
int main()
{
	int i,a,b,c;
	scanf("%d%d%d",&N,&M,&L);	
	for(i=1;i<=N;i++)
	{
		scanf("%d%d%d",&a,&b,&c);
		X[i]=a*1.0/100;T[i]=b;V[i]=c;
	}
	solve();
	return 0;
}

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

int main()
{
  int n;
  cin >> n;
  map<string, int> m;
  rep(i, n)
  {
    string s;
    cin >> s;
    m[s]++;
  }
  int mx = 0;
  for (auto p : m)
    mx = max(mx, p.second);
  for (auto p : m)
  {
    if (p.second != mx)
      continue;
    cout << p.first << endl;
  }
  return 0;
}

Measured memory_bytes: 25216
#include <bits/stdc++.h>
#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll; 
typedef long double ld;
typedef pair<ll, ll> pll;

const ll N = 2e5 + 30, Mod = 1e9 + 7;
const ll SQ = 330;

int main () {
    ios::sync_with_stdio(0), cin.tie(0);
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    for (int i = 1; i < N; i ++) {
    	if (i & 1) {
    		c -= b;
    		if (c <= 0)
    		   return cout << "Yes", 0;
		}
		else {
			a -= d;
			if (a <= 0)
			   return cout << "No", 0;
		}
	}
    return (0);
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}
#ifdef __LOCAL
#define debug(x) cerr << __LINE__ << ": " << #x << " = " << x << endl
#define debugArray(x, n)                           \
  cerr << __LINE__ << ": " << #x << " = {";        \
  for (long long hoge = 0; (hoge) < (n); ++(hoge)) \
    cerr << ((hoge) ? "," : "") << x[hoge];        \
  cerr << "}" << endl
#else
#define debug(x) (void(0))
#define debugArray(x, n) (void(0))
#endif

template <typename T>
struct BinaryIndexedTree {
  vector<T> dat;
  BinaryIndexedTree(int n) : dat(n + 1, 0) {}
  BinaryIndexedTree(int n, T a) : BinaryIndexedTree(vector<T>(n, a)) {}
  BinaryIndexedTree(vector<T> y) : dat(y.size() + 1) {
    for (int i = 0; i < y.size(); ++i) dat[i + 1] = y[i];
    for (int i = 1; i + (i & -i) < dat.size(); ++i) dat[i + (i & -i)] += dat[i];
  }
  void add(int i, T a = 1) {
    for (++i; i < (int)dat.size(); i += i & -i) dat[i] += a;
  }
  T sum(int i) {  // sum [0,i)
    T s = 0;
    for (; i > 0; i &= i - 1) s += dat[i];
    return s;
  }
  // min { i : sum(i+1) > k } -> kth element(0-indexed)
  int find(T k) const {
    int i = 0;
    for (int p = 1 << (__lg(dat.size() - 1) + 1); p > 0; p >>= 1)
      if (i + p < (int)dat.size() && dat[i + p] <= k) k -= dat[i += p];
    return i + 1 == (int)dat.size() ? -1 : i;  // -1 -> no solutions
  }
};

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  long long A[N + 2];
  A[0] = A[N + 1] = 0;
  long long sum = 0;
  for (int i = 1; i <= N; i++) cin >> A[i], sum += abs(A[i] - A[i - 1]);
  sum += abs(A[N + 1] - A[N]);
  for (int i = 1; i <= N; i++) {
    long long ans = sum;
    ans -= abs(A[i] - A[i - 1]) + abs(A[i + 1] - A[i]);
    ans += abs(A[i + 1] - A[i - 1]);
    cout << ans << '\n';
  }
  return 0;
}


Measured memory_bytes: 4380
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (long i = (s); i < (long)(n); i++)

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

    if(a==1){
        a=14;
    }
    if (b==1) {
        b=14;
    }

    if(a>b){
        cout<<"Alice"<<endl;
    }
    else if(a==b){
        cout<<"Draw"<<endl;
    }
    else {
        cout<<"Bob"<<endl;
    }


}


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

using namespace std;

int main(void)
{
	int n;
	string a;
	string g = "Hoshino";

	cin >> n;
	cin.ignore();
	for (int i = 0; i < n; ++i){
		string::size_type x;
		getline(cin, a);
		while(x = a.find("Hoshino"), x != string::npos)
			a.replace(x, 7, "Hoshina");
		cout << a << endl;
	}
	
	return 0;
}

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

int main () {
  int N, K;
  cin >> N;
  vector <int> h(N);
  vector <int> ans(N);
  for (int i = 0; i < N; i++) cin >> h.at(i);
  for (int i = 0; i < N; i++) ans.at(h.at(i)-1) = i+1;
  for (int i = 0; i < N; i++){
    if (i == N-1) cout << ans.at(i) << endl;
    else cout << ans.at(i) << " ";
  }
}

Measured memory_bytes: 1664
N, M = map(int, input().split())
H = list(map(int, input().split()))
R = list(range(1, N+1))
l = []
for i in range(M):
    A, B = map(int, input().split())
    if H[A-1] < H[B-1]:
        l.append(A)
    elif H[A-1] > H[B-1]:
        l.append(B)
    else:
        l.append(A)
        l.append(B)
ans = set(R) - set(l)
print(len(ans))


Measured memory_bytes: 29660
#include<bits/stdc++.h>
using namespace std;
#define intl long long int 

int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	char c;
	cin>>c;
	if(c>='a'&&c<='z'){
		cout<<"a\n";
	}
	else{
		cout<<"A\n";
	}
}


Measured memory_bytes: 3648