akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.HashMap;

public class Main {

	static HashMap<String, String> map = new HashMap<String, String>();
	static HashMap<String, String> key = new HashMap<String, String>();
	static String[] keys = {
		"101",
		"000000",
		"000011",
		"10010001",
		"010001",
		"000001",
		"100101",
		"10011010",
		"0101",
		"0001",
		"110",
		"01001",
		"10011011",
		"010000",
		"0111",
		"10011000",
		"0110",
		"00100",
		"10011001",
		"10011110",
		"00101",
		"111",
		"10011111",
		"1000",
		"00110",
		"00111",
		"10011100",
		"10011101",
		"000010",
		"10010010",
		"10010011",
		"10010000"
	};
	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		a();
		while(true){
			String s = br.readLine();
			if(s==null){
				break;
			}
			String hugou="";
			for(int i = 0; i < s.length();i++){
				hugou += key.get(s.substring(i,i+1));
				//System.out.print(key.get(s.substring(i,i+1))+" ");
			}
			int len=hugou.length()%5;
			
			if(len!=0){
				for(int i=0;i<5-len;i++){
					hugou=hugou+"0";
				}
			}
			
			String ans="";
			//System.out.println(ans);
			for(int i = 0;i<hugou.length();i+=5){
				ans+=map.get(hugou.substring(i,i+5));
				//System.out.print(hugou.substring(i,i+5)+" ");
			}
			System.out.println(ans);
		}
	}
	static void a(){
		map.put("00000", "A");
		map.put("00001", "B");
		map.put("00010", "C");
		map.put("00011", "D");
		map.put("00100", "E");
		map.put("00101", "F");
		map.put("00110", "G");
		map.put("00111","H");
		map.put("01000","I");
		map.put("01001","J");
		map.put("01010","K");
		map.put("01011","L");
		map.put("01100","M");
		map.put("01101","N");
		map.put("01110","O");
		map.put("01111","P");
		map.put("10000","Q");
		map.put("10001","R");
		map.put("10010","S");
		map.put("10011","T");
		map.put("10100","U");
		map.put("10101","V");
		map.put("10110","W");
		map.put("10111","X");
		map.put("11000","Y");
		map.put("11001","Z");
		map.put("11010"," ");
		map.put("11011",".");
		map.put("11100",",");
		map.put("11101","-");
		map.put("11110","'");
		map.put("11111","?");
		key.put(" ","101");
		key.put("'","000000");
		key.put(",","000011");
		key.put("-","10010001");
		key.put(".","010001");
		key.put("?","000001");
		key.put("A","100101");
		key.put("B","10011010");
		key.put("C","0101");
		key.put("D","0001");
		key.put("E","110");
		key.put("F","01001");
		key.put("G","10011011");
		key.put("H","010000");
		key.put("I","0111");
		key.put("J","10011000");
		key.put("K","0110");
		key.put("L","00100");
		key.put("M","10011001");
		key.put("N","10011110");
		key.put("O","00101");
		key.put("P","111");
		key.put("Q","10011111");
		key.put("R","1000");
		key.put("S","00110");
		key.put("T","00111");
		key.put("U","10011100");
		key.put("V","10011101");
		key.put("W","000010");
		key.put("X","10010010");
		key.put("Y","10010011");
		key.put("Z","10010000");

	}
}

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

#define LL long long int
#define mp make_pair
#define FOR(i, n) for(i = 0; i < n; ++i)
typedef vector <int> vi;
typedef vector <LL> vll;
typedef pair<LL, LL> iPair;
const int MOD = 1e9+7;

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

    LL t = 1;
    LL i,j;
    // cin>>t;
    
    while(t--)
    {
        string s, q;
        cin >> s >> q;
        int m = s.length();
        int n = q.length();
        
        int dp[m+1][n+1];

        for(int i = 0; i <= m; ++i) dp[i][0] = 0;
        for(int i = 0; i <= n; ++i) dp[0][i] = 0;

        for(int i = 1; i <= m; ++i)
        {
            for(int j = 1; j <= n; ++j)
            {
                if(s[i-1] == q[j-1]) dp[i][j] = max({dp[i-1][j], dp[i][j-1], 1 + dp[i-1][j-1]});
                else dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            }
        }

        // cout<<dp[m][n];
        // for(int i = 0; i <= m; ++i)
        // {
        //     for(int j = 0; j <= n; ++j)
        //     {
        //         cout<<dp[i][j]<<" ";
        //     }
        //     cout<<endl;
        // }
        string temp;
        i = m;
        j = n;
        while (i > 0  && j > 0)
        {
            if(s[i-1] == q[j-1])
            {
                temp = s[i-1] + temp;
                i--;
                j--;
            }
            else if(dp[i-1][j] > dp[i][j-1])
            {
                i--;
            }
            else j--;
        }
        cout<<temp;
        
    }

	return 0;
}


Measured memory_bytes: 35456
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
//using namespace __gnu_pbds;

#define ll  long long
#define PR  pair<int, int>

const int N = 1e6 + 10;
const int MOD = 1e9 + 7;
const long long INF = 5e18;
const double PI = 2 * acos(0.0);
//template<typename T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

int cnt[N];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, g = 0;
    cin >> n;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        g = __gcd(x, g);
        cnt[x]++;
    }
    for (int i = 2; i < N; i++) {
        int tmp = 0;
        for (int j = i; j < N; j += i) {
            tmp += cnt[j];
        }
        if (tmp > 1) {
            cout << (g == 1 ? "setwise coprime" : "not coprime") << '\n';
            return 0;
        }
    }
    cout << "pairwise coprime" << '\n';
    return 0;
}


Measured memory_bytes: 7576
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <set>
#include <algorithm>
#include <array>
#include <complex>
#include <string>
#include <utility>
#include <map>
#include <queue>
#include <list>
int dx[4]={-1,0,1,0};
int dy[4]={0,1,0,-1};
#define INF 1<<21
typedef std::pair<int,int> pii;
int cnt_digits(long long n) {
    int res=0;
    while (n > 0) {
        n = n / 10;
        res++;
    }
    return res;
}
int main(){
    int ans,cur;
    long long N;
    std::cin >> N;
    ans = cnt_digits(N);
    for (long long i = 1LL; i*i <= N; i++) {
        if (N%i == 0) {
            long long B = N / i;
            cur = std::max(cnt_digits(B),cnt_digits(i));
        }
        if (ans > cur) {
            ans = cur;
        }
    }
    std::cout << ans << std::endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define F first
// #define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <b; i++)
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int,int> pi;
#define trace(x) cout<<#x<<"="<<x<<"\n";
#define sz(x) (int)(x.size())
#define mod 1000000007

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "{";
    typename vector< T > :: const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
    os << "[";
    typename set< T > :: const_iterator it;
    for ( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
    os << "[";
    typename map< F , S >::const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << it -> first << " = " << it -> second ;
    }
    return os << "]";
}
#define deb(x) cerr << #x << " = " << x << endl;
string S;
int dp[100005][4];
int power(int a, int b){
    if(b==0){
        return 1;
    }
    else{
        int ans=power(a,b/2);
        ans=(ans*ans)%mod;
        if(b%2){
            ans=((a%mod)*(ans%mod))%mod;
        }
        return ans;
    }
}
int add(int A, int B){
    int res=(A%mod)+(B%mod);
    res=res%mod;
    return res;
}
int mul(int A, int B){
    A=A%mod;
    B=B%mod;
    int res=(A*B)%mod;
    return res;
}
int div(int A, int B){
    int res=A%mod;
    res=(res*(power(B,mod-2)))%mod;
    return res;
}
 
int32_t main(){
    ios::sync_with_stdio(false);
    cin>>S;
    memset(dp,0,sizeof(dp));
    int ct=0;
    for(int i=0;i<S.size();i++){
        if(S[i]=='?')ct++;
    }
    dp[0][0]=1;
    for(int i=0;i<S.size();i++){
        if(S[i]=='?'){
            for(int j=0;j<4;j++){
                dp[i+1][j]=mul(dp[i][j],3);
            }
        }
        else{
            for(int j=0;j<4;j++){
                dp[i+1][j]=dp[i][j];
            }
        }
        if(S[i]=='A' || S[i]=='?'){
            dp[i+1][1]=add(dp[i+1][1],dp[i][0]);
        }
        if(S[i]=='B' || S[i]=='?'){
            dp[i+1][2]=add(dp[i+1][2],dp[i][1]);
        }
        if(S[i]=='C' || S[i]=='?'){
            dp[i+1][3]=add(dp[i+1][3],dp[i][2]);
        }
    }
    cout<<dp[S.size()][3]<<"\n";


    return 0;
}

Measured memory_bytes: 3664
#include <bits/stdc++.h>
#include <ext/hash_map>
#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

#define REP(i,n) for( (i)=0 ; (i)<(n) ; (i)++ )
#define rep(i,x,n) for( (i)=(x) ; (i)<(n) ; (i)++ )
#define REV(i,n) for( (i)=(n) ; (i)>=0 ; (i)-- )
#define FORIT(it,x) for( (it)=(x).begin() ; (it)!=(x).end() ; (it)++ )
#define foreach(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
#define rforeach(it,c) for(__typeof((c).rbegin()) it=(c).rbegin();it!=(c).rend();++it)
#define foreach2d(i, j, v) foreach(i,v) foreach(j,*i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define SZ(x) ((int)(x).size())
#define MMS(x,n) memset(x,n,sizeof(x))
#define mms(x,n,s) memset(x,n,sizeof(x)*s)
#define pb push_back
#define mp make_pair
#define NX next_permutation
#define UN(x) sort(all(x)),x.erase(unique(all(x)),x.end())
#define CV(x,n) count(all(x),(n))
#define FIND(x,n) find(all(x),(n))-(x).begin()
#define ACC(x) accumulate(all(x),0)
#define PPC(x) __builtin_popcountll(x)
#define LZ(x) __builtin_clz(x)
#define TZ(x) __builtin_ctz(x)
#define mxe(x) *max_element(all(x))
#define mne(x) *min_element(all(x))
#define low(x,i) lower_bound(all(x),i)
#define upp(x,i) upper_bound(all(x),i)
#define NXPOW2(x) (1ll << ((int)log2(x)+1))
#define PR(x) cout << #x << " = " << (x) << endl ;

typedef unsigned long long ull;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef pair<int, int> pii;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

const int OO = (int) 2e9;
const double eps = 1e-9;

const int N = 2e5 + 5;

int n;
int a[10][10];

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
#ifndef ONLINE_JUDGE
//	freopen("in.txt", "rt", stdin);
//	freopen("out.txt", "wt", stdout);
#endif
	cin >> n;
	for (int i = 1; i <= n; i++) {
		int lst = i;
		while (lst / 10 > 0)
			lst /= 10;
		a[lst][i % 10]++;
	}
	int res = 0;
	for (int i = 1; i < 10; i++) {
		res += a[i][i] * a[i][i];
		for (int j = i + 1; j < 10; j++) {
			res += 2 * a[i][j] * a[j][i];
		}
	}
	cout << res << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <tuple>
#include <array>
#include <map>

#define ll long long

//#define TEST

using namespace std;

signed main() {
	int n; ll m;
	cin >> n >> m;
	vector<pair<ll, ll>> LRs(n);
	for (int i = 0; i < n; ++i)
		cin >> LRs[i].first >> LRs[i].second;

	// 座標圧縮
	map<ll, int> p;
	p[0] = p[m] = 0;
	for (auto LRi : LRs) {
		p[LRi.first] = p[LRi.second] = 0;
	}
	int t = 0;
	for (auto& pi : p) {
		pi.second = t;
		++t;
	}
	map<int, ll> p_inv;
	for (auto& pi : p) {
		p_inv[pi.second] = pi.first;
	}

	// cover[i] : 地点iを何個区間が覆っているか
	vector<int> cnt(t);
	for (auto LRi : LRs) {
		int l = p[LRi.first];
		int r = p[LRi.second];
		cnt[l]++;
		if (r + 1 < t)
			cnt[r + 1]--;
	}
	ll sum = 0;
	vector<ll> cover;
	for (int i = 0; i < t; ++i) {
		sum += cnt[i];
		cover.push_back(sum);
	}

#ifdef TEST
	for (auto c : cover)
		cout << c << " ";
	cout << endl;
#endif

	// mx : 同一地点の羊羹の最大個数
	ll mx = 0;
	for (auto c : cover)
		mx = max(mx, c);

	// mx個の羊羹のある地点
	vector<int> place;
	for (int i = 0; i < t; ++i)
		if (cover[i] == mx)
			place.push_back(i);

#ifdef TEST
	for (auto pi : place)
		cout << pi << " ";
	cout << endl;
#endif

	if (mx & 1) {
		int lst = place[place.size() - 1];
		ll goal = p_inv[lst];
		cout << ((mx - 1) * m + goal) << endl;
	}
	else {
		int lst = place[0];
		ll goal = p_inv[lst];
		cout << (mx * m - goal) << endl;
	}

	return 0;
}


Measured memory_bytes: 61676
//#define _CRT_SECURE_NO_WARNINGS
//#include <bits/stdc++.h>
#include "bits/stdc++.h"

#define rep(i,n) for(ll (i)=0;(i)<(ll)(n);(i)++)
#define all(x) (x).begin(),(x).end()

#define MOD 1000000007LL
#define INF (1LL<<60LL)
#define int long long
#define MAX_N (100001)
typedef long long ll;

using namespace std;



signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	double k = 6.28318530717958623200;
	double n; cin >> n;
	cout << fixed << setprecision(5) << k*n << endl;
}


Measured memory_bytes: 3800
#include <stdio.h>

int main(int argc, char const *argv[])
{
	/* code */
	int len;
	int p1,p2;
	int c1,c2;
	int k;
	while(1){
		scanf("%d",&len);
		if(len==0){break;}
		p1 = p2 = 0;
		for(k=0;k<len;k++){
			scanf("%d %d",&c1,&c2);
			if(c1==c2){
				p1 += c1;
				p2 += c1;
			}
			if(c1 > c2){
				p1 += c1 + c2;
			}
			if(c2 > c1){
				p2 += c1 + c2;
			}
		}
		printf("%d %d\n",p1,p2);
	}
	return 0;
}

Measured memory_bytes: 600
#include<iostream>
using namespace std;
int main(){
  long long n,i,ans = 0;cin >> n;
  long long a[n+2];a[0] = a[n+1] = 0;
  for(i=1;i<=n;i++) cin >> a[i];
  for(i=1;i<=n;i++){
    if(a[i] != 0 && a[i-1] == 1){
      a[i]--;a[i-1]--;ans++;
    }
    if(a[i]%2==1 && a[i+1]!=0){
      a[i]--;a[i+1]--;ans++;
    }
    ans += a[i]/2;a[i] %= 2;
  }
  cout << ans << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <iomanip>

using namespace std;

int main() {
    int N,K; cin >> N >> K;

    double ans = 0.0;
    double base = 1.0 / N;

    for(int i=1; i<=N; i++) {
        if(i < K) {
            int tmp = 1;
            while(pow(2, tmp) * i < K) {
                tmp++;
            }
            ans += base * pow(0.5, tmp);
        } else {
            ans += base;
        }
    }

    cout << setprecision(12) << ans << endl;

    return 0;
}



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



using namespace std;


int main(){
  int n;
  std::cin >> n;
  int S[10000];
  for(int i=0;i<n;i++){
    std::cin >> S[i];
  }
  int q;
  std::cin >> q;
  int T[500];
  for(int i=0;i<q;i++){
    std::cin >> T[i];
  }

  int count=0;

  for(int i=0;i<q;i++){
    for(int j=0;j<n;j++){
      if(S[j]==T[i]){
        count++;
        break;
      }
    }
  }
  std::cout << count << '\n';
}



Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
int main()
{
	int t;
	t=1;
	while(t--)
	{
     int n;

     cin>>n;
     int arr[n];
     for(int i=0;i<n;i++)
     {
     	cin>>arr[i];
     }
     int count=0;
     for(int i=0;i<n;i++)
     {
       if((i+1)%2==1&&arr[i]%2==1)
       {
       	count++;
       }
     }
     cout<<count;
	}
}

Measured memory_bytes: 3608
/* おまじない　*/
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
typedef long long ll;
typedef long double ld;
using namespace std;
const ll MOD=pow(10,9)+7;
const ll INF=(1LL<<62);
const int dx[4]={0,1,0,-1};
const int dy[4]={1,0,-1,0};
const int ddx[8]={1,0,-1,-1,-1,0,1,1};
const int ddy[8]={1,1,1,0,-1,-1,-1,0};
void init(){
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
}

int main(){
    init();

    ll ans=1;
    ll N;cin>>N;
    while(1){
        ll num=ans*108/100;
        if(num==N){
            cout<<ans<<endl;
            return 0;
        }
        if(num>N+10)break;
        ans++;
    }
    cout<<":("<<endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
  
  while(1){
    int n;
    cin >>n;
    if(n==0)break;
    vector<pair<int,int> >vec;
    for(int i=0 ; i < n ; i++){
      int temp1,temp2;
      cin >>temp1>>temp2;
      vec.push_back(make_pair(temp2,temp1));
    }
    sort(vec.begin(),vec.end());
    
    bool ans=true;
    int sum=0;
    for(int i=0 ; i < (int)vec.size(); i++){
      sum+=vec[i].second;
      if(sum > vec[i].first){
	ans=false;
	break;
      }
    }

    if(ans){
      cout <<"Yes"<<endl;
    }else{
      cout <<"No"<<endl;
    }

  }
  
  return 0;
}

Measured memory_bytes: 1196
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a*b/gcd(a,b);
}


signed main(void) {
    int i,j;
    int n;
    cin >> n;
    int h,w;
    cin >> h >> w;
    cout << (n-h+1)*(n-w+1) << endl;

}


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

int main() {
int n;
cin >> n;
int ans = -n;
rep(i,n){
  int x;
  cin >> x;
  ans += x;
}
cout << ans << endl;

}


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

using namespace std;

#define fcout(d) cout << fixed << setprecision(d)
#define rep(i,n) for(int (i) = 0; (i) < (n); ++(i))
#define rep1(i,n) for(int (i) = 1; (i) <= (n); ++(i))
#define repU(i,bottom,ceiling) for(auto (i) = (bottom); (i) <= (ceiling); ++(i))
#define repD(i,ceiling,bottom) for(auto (i) = (ceiling); (i) >= (bottom); --(i))
#define repV(i,v) for(auto (i) = begin(v); (i) < end(v); ++(i))
#define all(v)  begin(v),end(v)
#define clr(v) fill(all(v),0)
#define l_bnd lower_bound
#define u_bnd upper_bound
#define puf push_front
#define pub push_back
#define pof pop_front
#define pob pop_back
#define mkp make_pair
#define mkt make_tuple
#define fir first
#define sec second
#define q_ceil(n,d) ((n - 1)/(d) + 1)
#define parity(a,b) ((a)^(b) & 1LL ^ 1LL)

typedef long long ll;
typedef unsigned long long ull;
typedef double db;

const pair<int,int> DIR[] = { {1,0},{0,1},{-1,0},{0,-1},{1,1},{-1,1},{-1,-1},{1,-1} };
const int INF_32 = -1 + (1 << 30);
const ll INF_64 = -1 + (1LL << 62);
const int MOD = (int)1e9 + 7;

ull next_subset(ull subset){
	ull tem = subset + (subset & -subset);
	ull btm = (~tem & subset) / (subset & -subset) >> 1;
	return btm | tem;
}

int a,b,c;
ll k;

void solve(){
	
	if(k&1LL) cout<<b-a<<endl;
	else cout<<a-b<<endl;
	
	return;
}

void input(){
	
	cin>>a>>b>>c>>k;
	
	return;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	input();
	solve();
	
	return 0;
}





Measured memory_bytes: 256
import java.math.BigDecimal;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		
		//結果の値
		int ResultTime = 0;

		// 入力値を取得
		Scanner sc = new Scanner(System.in);
		BigDecimal a = new BigDecimal((double) (sc.nextInt()));
		BigDecimal b = new BigDecimal((double) (sc.nextInt()));
		BigDecimal c = new BigDecimal((double) (sc.nextInt()));
		BigDecimal d = new BigDecimal((double) (sc.nextInt()));
		BigDecimal e = new BigDecimal((double) (sc.nextInt()));

		// 入力値の十の位を繰り上げ
		int round_a = (int) (a.setScale(-1, BigDecimal.ROUND_UP).doubleValue());
		int round_b = (int) (b.setScale(-1, BigDecimal.ROUND_UP).doubleValue());
		int round_c = (int) (c.setScale(-1, BigDecimal.ROUND_UP).doubleValue());
		int round_d = (int) (d.setScale(-1, BigDecimal.ROUND_UP).doubleValue());
		int round_e = (int) (e.setScale(-1, BigDecimal.ROUND_UP).doubleValue());

		// 繰り上げ値との差分で一番大きいものを判定
		int[] data = {round_a - a.intValue(), round_b - b.intValue(),
				round_c - c.intValue(), round_d - d.intValue(),
				round_e - e.intValue()};
		int BigDifference = data[0];
		int MenuNo = 0;
		for (int i = 0; i < data.length; i++) {
			int value = data[i];
			if (value > BigDifference) {
				BigDifference = value;
				MenuNo = i;
			}
		}
		
		//時間の差分が大きいものは最初にもっていく
		if(MenuNo ==0) {
			ResultTime = a.intValue()+round_b+round_c+round_d+round_e;
			System.out.println(ResultTime);
		}
		if(MenuNo ==1) {
			ResultTime = round_a+b.intValue()+round_c+round_d+round_e;
			System.out.println(ResultTime);
		}
		if(MenuNo ==2) {
			ResultTime = round_a+round_b+c.intValue()+round_d+round_e;
			System.out.println(ResultTime);
		}
		if(MenuNo ==3) {
			ResultTime = round_a+round_b+round_c+d.intValue()+round_e;
			System.out.println(ResultTime);
		}
		if(MenuNo ==4) {
			ResultTime = round_a+round_b+round_c+round_d+e.intValue();
			System.out.println(ResultTime);
		}
		
		//クローズ
		sc.close();
		
	}
}


Measured memory_bytes: 21972
#include<vector>
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include <iostream>
#include <algorithm>
#define INF 100000000000000
using namespace std;
typedef long long llong;

//int isalpha(char ch): ch がアルファベットなら true を返す
//int isdigit(char ch): ch が数字なら true を返す
//int islower(char ch): ch が小文字なら true を返す
//int isupper(char ch): ch が大文字なら true を返す
//int tolower(char ch): ch の小文字を返す
//int toupper(char ch): ch の大文字を返す

//string型
//size()	文字数を返す
//insert()	（指定した場所に）文字・文字列を挿入する
//erase()	（指定した場所の）文字・文字列を削除する
//clear()	すべての文字を削除する
//substr()	文字列の（指定した）部分文字列を返す
//replace()	（指定した）部分文字列を新しい文字列に置換する
//文字列の比較は、<=や==などを使え
//replace関数を使い、簡単に文字列を置換
//リバース関数：reverse(str.begin(), str.end());

int main(){
    llong N;
    llong d;
    cin >> N;
    vector<llong> Table(100, 0);
    llong ans=0;

    for(int i=0; i<N; i++){
        cin >> d;
        Table[d-1] += 1;
    }
    for(int i=0; i<Table.size(); i++){
        if(Table[i]>=1){
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
    #define INF 1e9
    #define all(v) v.begin(), v.end()
    #define rep(i, n) for(int i = 0; i < n; i++)
    #define pb push_back
    #define eb emplace_back
    #define mp make_pair
    #define max(v) *max_element(v.begin(), v.end())
    #define min(v) *min_element(v.begin(), v.end())
    using namespace std;
     
    int main(void){
        cin.tie(0);
        ios::sync_with_stdio(false);

        int n;
        cin>>n;
        int a[n];
        rep(i, n){
            cin>>a[i];
        }
        int v, i, j, k;
        for(i = 0; i < n; i++){
            v = a[i];
            j = i-1;
            while(j >= 0 && a[j] > v){
                a[j+1] = a[j];
                j--;
            }
            a[j+1] = v;
            rep(k, n){
                if(k==n-1){
                    cout<<a[k];
                }
                else{
                    cout<<a[k]<<" ";
                }
            }
            cout<<endl;
        }


        return 0;
    }


Measured memory_bytes: 3136
#include <stdio.h>
#include <stack>
#include <math.h>

using namespace std;



int main(){

	int gozen,gogo,most_value,most_index;

	while(true){
		scanf("%d %d",&gozen,&gogo);
		if(gozen == 0 && gogo == 0)break;

		most_value = gozen+gogo;
		most_index = 0;

		for(int i=1; i <= 4; i++){
			scanf("%d %d",&gozen,&gogo);

			if(most_value < gozen + gogo){
				most_value = gozen + gogo;
				most_index = i;
			}
		}

		switch(most_index){
		case 0:printf("A ");break;
		case 1:printf("B ");break;
		case 2:printf("C ");break;
		case 3:printf("D ");break;
		case 4:printf("E ");break;
		}

		printf("%d\n",most_value);
	}



    return 0;
}

Measured memory_bytes: 2752
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <climits>
#include <cmath>
#include <utility>
#include <string>
#include <cstring>
#include <functional>

using namespace std;

const int maxn = 102;

int n, m, sum, cnt, d[maxn];

int main() {

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
    cin >> n >> m;
    for (int i = 0; i < n; ++i) {
        cin >> d[i];
        sum += d[i];
    }

    // d[i] >= sum / 4m
    for (int i = 0; i < n; ++i) {
        if (d[i] * 4 * m >= sum)
            ++cnt;
    }

    if (cnt >= m)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>

#if LOCAL
#include <ctime>
#endif

int main(void)
{
    
#if LOCAL
    freopen("_in","r",stdin);
    clock_t startTime=clock();
#endif
    int i,N,x,s=0;
    scanf("%d",&N);

    for(i=0;i<N;i++){
        scanf("%d",&x);
        s+=x;
    }
    printf("%d\n",s-N);
#if LOCAL
    printf("\n\t[Runtime=%3d ms.]\n",clock()-startTime);
#endif
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int main(){
    long double w,h,x,y;
    cin >> w >> h >> x >> y;
    cout << setprecision(30) << w*h/2 << " ";
    if (2*x==w || 2*y==h){
        if(w*y == h*x){
            cout << 1 << endl;
        }
        else{
            cout << 0 << endl;
        }
    }
    else{
        if(x==0 || x == w || y == 0 || y == h){
            cout << 0 << endl;
        }
        else{
            cout << 0 << endl;
        }
    }
}


Measured memory_bytes: 256
#include<iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>

using namespace std;



int main()
{
    int n;
    cin >> n;
    vector<char> c(n);
    int count = 0,out=0;

    for (int i = 0; i < n; i++) {
        cin >> c[i];
        if (c[i] == 'R') count++;
    }

    for (int i = 0; i < count; i++) {
        if (c[i] == 'W') out++;
    }
    
    cout << out;

    return 0;
}



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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()
#define sortAl(v) sort(all(v))
#define sortAlr(v)          \
  sort(v.begin(), v.end()); \
  reverse(v.begin(), v.end())

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

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

  ll n, m;
  cin >> n >> m;

  vector<P> shop(n);

  rep(i, n) {
    cin >> shop[i].first >> shop[i].second;
  }

  sort(all(shop));

  ll ans = 0;

  FORm(it, shop) {
    if (it->second >= m) {
      ans += it->first * m;
      break;
    } else {
      ans += it->first * it->second;
      m -= it->second;
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1792
#define _USE_MATH_DEFINES
#define llint long long
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

int main() {
    int ans = 0;
    for (int i = 0; i < 4; i++) {
        char c;
        cin >> c;
        if (c == '+') ans++; else ans--;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader
import java.io.InputStreamReader
import java.io.PrintWriter
import java.util.*

val br = BufferedReader(InputStreamReader(System.`in`))
val pw = PrintWriter(System.out)
fun main(args : Array<String>) {
    func()
    pw.flush()
}

fun func() {
    // 回答をここに書く
    val s = next()
    val re = if(s.contains("a") && s.contains("b") && s.contains("c")) "Yes" else "No"
    println(re)
}

// 入力取得
fun next() = br.readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun listOfString() = next().split(" ")
fun listOfInt() =listOfString().map { it.toInt() }
fun listOfLong() =listOfString().map { it.toLong() }
fun listOfDouble() =listOfString().map { it.toDouble() }

// 約数のList
fun divisor(value : Long) : List<Long> {
    val max = Math.sqrt(value.toDouble()).toLong()
    return (1..max)
            .filter { value % it == 0L }
            .map { listOf(it, value / it) }
            .flatten()
            .sorted()
}

// 範囲内の素数を取得
// fromだけ指定すると戻り値の個数で素数判定ができる
fun prime(from : Long, to : Long = from) : List<Long> {
    return (from..to).filter { i ->
        val max = Math.sqrt(i.toDouble()).toLong()
        (2..max).all { j ->  i % j != 0L }
    }
}

// 素因数分解
fun decom(value : Long) : List<Long>{
    if (value == 1L) return listOf(1)
    val max = Math.sqrt(value.toDouble()).toLong()
    return prime(2, max).filter { value % it == 0L }
}

// 最大公約数
fun gcd(a : Long, b : Long) : Long {
    return if (a % b == 0L) b else gcd(b, a % b)
}

// 文字列を入れ替え
fun swap(base : String, a : String, b : String) : String {
    return base.map {
        when (it) {
            a.toCharArray()[0] -> b
            b.toCharArray()[0] -> a
            else -> it.toString()
        }
    }.joinToString()
}

fun println(value : Any) {
    pw.println(value)
}

Measured memory_bytes: 29592
object Main extends App {
  val n = scala.io.StdIn.readLine.toInt
  val x = scala.io.StdIn.readLine.split(" ").map(_.toInt).sorted
  val x_max = x.last
  var ans = 99999999

  (0 to x_max).foreach { i =>
    val tmp = x.map { xx =>
      (xx - i) * (xx - i)
    }.sum

    ans = List(ans, tmp).min
  }
  println(ans)
}


Measured memory_bytes: 54984
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mod 1000000007
#define bs binary_search
#define pi 3.1415926535
#define pob pop_back
const ll MAX=INT_MAX;
const ll MIN=INT_MIN;
#define loop(i,s,n) for(ll i=s;i<n;i++)
#define lb lower_bound
#define ub upper_bound
#define memo(a,b) memset(a,b,sizeof(a))
#define loopr(i,s,n) for(ll i=s;i>=n;i--)
#define I first
#define II second
#define mp make_pair
#define mt make_tuple
//for(int x:v ){cout<<x;}
int main()
{	ios::sync_with_stdio(0);
/*freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
*/
cin.tie(NULL);cout.tie(NULL);
	ll i;
 ll a[5];
 loop(i,0,5)
 {
   	cin>>a[i];
   if(a[i]==0)
   {
     cout<<i+1<<endl;
   return 0;
   }
 }
	return 0;
}


Measured memory_bytes: 3492
#include <stdio.h>
#include <math.h>
void minko(int *x, int *y, int arrsize, double p) {
  double a = 0,tmp;
  for (int i = 0; i < arrsize; i++) {
    tmp = x[i] > y[i] ? x[i] - y[i] : y[i] - x[i];
    a += pow(tmp , p);
  }
  a = pow(a, 1.0/p);
  printf("%lf\n", a);
}
int main() {
  int n, x[100]={0}, y[100]={0};
  int a = 0,tmp;
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", &x[i]);
  }
  for (int i = 0; i < n; i++) {
    scanf("%d", &y[i]);
  }
  minko(x,y,n,1.0);
  minko(x,y,n,2.0);
  minko(x,y,n,3.0);
  for (int i = 0; i < n; i++) {
    tmp = x[i] > y[i] ? x[i] - y[i] : y[i] - x[i];
    a = a > tmp ? a : tmp;
  }
  printf("%d\n", a);
  return 0;
}



Measured memory_bytes: 2932
s = input()
answer_1 = answer_2 = -1

for i in range(len(s) - 1):
  if s[i] == s[i+1]:
    answer_1 = i + 1
    answer_2 = i + 2
    break
  
  elif i != len(s) - 2 and s[i] == s[i+2]:
    answer_1 = i + 1
    answer_2 = i + 3
    break

print(str(answer_1) + " " + str(answer_2))

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

#define ll long long
#define endl "\n"
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

//const int MOD = 1e9 + 7;
//typedef unsigned long long u64;
//const double pi = 3.141592653589793238460;

const int MAX = 1e5 + 5;
int arr[MAX];
int freq[102];

int main()
{
	IOS
	int t = 1;
	//cin >> t;
	while(t--)
	{
		int x, n;
		cin >> x >> n;
		if(n == 0)
		{
			cout << x << endl;
			return 0;
		}
		for(int i = 0; i < 101; i++)
			freq[i] = 0;
		for(int i = 1; i <= n; i++)
		{
			cin >> arr[i];
			freq[arr[i]]++;
		}
		int ans = INT_MAX;
		for(int i = 0; i <= 101; i++)
		{
			if(freq[i] == 0)
			{
				int val = abs(x - i);
				ans = min(val, ans);
			}
		}

		if(freq[x - ans] == 0)cout << x - ans << endl;
		else cout << x + ans << endl;
	}
	return 0;
}


Measured memory_bytes: 3648
#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<cmath>
#include<queue>
#include<vector>
#include<map>
#include<set>
#define INF 1099511627776
#define LL long long
#define WY()(putchar('Y'),putchar('e'),putchar('s'),putchar('\n'))
#define WN()(putchar('N'),putchar('o'),putchar('\n'))
#define Max(x,y)(x>y? x:y)
#define Min(x,y)(x<y? x:y)
#define ek()(putchar('\n'))
#define sk()(putchar(' '))
#define MAX 200005
using namespace std;
inline int Read(){
	int X=0,flag=1;char ch=0;
	while (ch<'0'||ch>'9'){
		if (ch=='-') flag=-1;
		ch=getchar();
	}
	while (ch>='0'&&ch<='9')
	  X=(X<<1)+(X<<3)+ch-48,ch=getchar();
	return X*flag;
}
inline void Write(LL x){
	if (x<0) x=-x,putchar('-');
	if (x>9) Write(x/10);
	putchar(x%10+48);
}
int n,q,a,b; 
int x[MAX];
LL sum[MAX];
LL DP[MAX];
struct Node{
	LL Seg[MAX<<2];
	inline void build(int l,int r,int p){
		Seg[p]=INF;
		if (l==r) return;
		int mid=(l+r)>>1;
		build(l,mid,p<<1);build(mid+1,r,p<<1|1);
	}
	inline void update(int l,int r,int p,int pos,LL num){
		if (l==r){
			Seg[p]=min(Seg[p],num);
			return;
		}
		int mid=(l+r)>>1;
		if (pos<=mid) update(l,mid,p<<1,pos,num);
		else update(mid+1,r,p<<1|1,pos,num);
		Seg[p]=min(Seg[p<<1],Seg[p<<1|1]);
	}
	inline LL query(int l,int r,int p,int Aiml,int Aimr){
		if (Aiml<=l&&r<=Aimr) return Seg[p];
		int mid=(l+r)>>1;
		LL ans=INF;
		if (Aiml<=mid) ans=min(ans,query(l,mid,p<<1,Aiml,Aimr));
		if (Aimr>mid) ans=min(ans,query(mid+1,r,p<<1|1,Aiml,Aimr));
		return ans;
	}
} to,tw;
inline void do_DP(){
	to.update(1,n,1,x[0],DP[1]-x[0]-sum[1]);
	tw.update(1,n,1,x[0],DP[1]+x[0]-sum[1]);
	for (int i=2;i<=q;i++){
		DP[i]=min(to.query(1,n,1,1,x[i])+x[i],tw.query(1,n,1,x[i],n)-x[i])+sum[i-1];
		to.update(1,n,1,x[i-1],DP[i]-x[i-1]-sum[i]);
		tw.update(1,n,1,x[i-1],DP[i]+x[i-1]-sum[i]);
	} 
}
int main(){
	n=Read(),q=Read(),a=Read(),b=Read();
	for (int i=1;i<=q;i++) x[i]=Read();
	for (int i=2;i<=q;i++) sum[i]=sum[i-1]+abs(x[i]-x[i-1]);
	DP[1]=abs(a-x[1]);x[0]=b;
	to.build(1,n,1);tw.build(1,n,1);
	do_DP();
	LL ans=INF;
	for (int i=1;i<=q;i++) ans=min(ans,DP[i]+sum[q]-sum[i]);
	DP[1]=abs(b-x[1]);x[0]=a;
	to.build(1,n,1);tw.build(1,n,1);
	do_DP();
	for (int i=1;i<=q;i++) ans=min(ans,DP[i]+sum[q]-sum[i]);
	Write(ans);ek();
    return 0;
}
//DP的意义实际上是到当前的这步换一个人走的最小代价，所以最后还要for一遍得到答案 

Measured memory_bytes: 16640
#include<cstdio>
#include<cstring>
#include<iostream>
using namespace std;
int S[100001], key, n;
int binarySearch(int key){
	int left = 0;
	int right = n;
	int mid;
	while(left < right){
		mid = (left + right) / 2;
		if(key == S[mid]) return 1;
		if(key > S[mid]) left = mid +1;
		else if(key < S[mid]) right = mid;
	}
	return 0;
} 

int main(){
	int m, count;
	scanf("%d",&n);
	for(int i = 0; i < n; i++){
		scanf("%d", &S[i]);
	}
	scanf("%d", &m);
	for(int i = 0; i < m; i++){
		scanf("%d", &key);
		if(binarySearch(key)) count++;
	}
	printf("%d\n",count);
	return 0;
}


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

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

  ll x;
  cin >> x;

  ll now = 100;
  int ans = 0;
  
  while (now < x) {
    now += now / 100;
    ++ans;
  }

  cout << ans << '\n';

  return (0);
}

Measured memory_bytes: 3600
/* ****mittal21**** */
#include<bits/stdc++.h>
#define ll          long long int 
#define ld          long double
#define pb          push_back
#define endl        '\n'
#define pii         pair<long long int,long long int>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll )x.size()
#define hell        1000000007
#define jell        998244353
#define rep(i,a,b)    for(ll int i=a;i<b;i++)
#define repr(i,a,b)   for(ll int i=a;i>=b;i--)
#define lbnd    lower_bound
#define ubnd        upper_bound
#define mp          make_pair
#define DEC(N)  cout << std::fixed; cout << setprecision(N);
using namespace std;
#define N  100005
void solve()
{
   
   ll n;
   cin>>n;
   ll cnt=0;
   ll w=0;
   for(int i=0;i<n;i++)
   {
           ll l,r;
           cin>>l>>r;
           if(l-r==0)
            cnt++;
           else
           {
              if(cnt>=3)
                w=1;
              cnt=0;
           }
   }
   if(cnt>=3)
    w=1;
   if(w)
    cout<<"Yes";
  else
    cout<<"No";
   return;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll testcase=1;
    //cin>>testcase;
    while(testcase--)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()
{
	int ansCount = 0;
	int N = 0;
	cin >> N;

	vector<int> inVec(N);

	for (auto& itr : inVec)
	{
		cin >> itr;
	}

	auto index = inVec.begin();
	while (true)
	{
		if (*index % 2 != 0) break;
		*index /= 2;
		++index;
		if (index == inVec.end())
		{
			++ansCount;
			index = inVec.begin();
		}
	}

	cout << ansCount << endl;


	return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func PrntFrme(H, W int) {
	for i := 0; i < W; i++ {
		fmt.Print("#")
	}

	fmt.Println()

	for i := 1; i < H - 1; i++ {
		fmt.Print("#")

		for j := 1; j < W - 1; j++ {
			fmt.Print(".")
		}

		fmt.Print("#")
		fmt.Println()
	}

	for i := 0; i < W; i++ {
		fmt.Print("#")
	}	

	fmt.Println()
	fmt.Println()
}

func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}

func main() {
	sc.Split(bufio.ScanWords)
	
		for {
			H := nextInt()
			W := nextInt()
				if H == 0 && W == 0 {
					break
				} else {
					PrntFrme(H, W)
				}
		}
	
}


Measured memory_bytes: 1124
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
using namespace std;
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
typedef long long ll;

ll vs[100000+10];
ll xs[100000+10];

int main(void) {
  int n;
  scanf("%d", &n);
  ll X = 0;
  REP(i, n) {
    scanf("%lld", &vs[i]);
    X ^= vs[i];
  }
  ll res = X;
  REP(i, n) {
    vs[i] &= ~X;
    // cerr << "> " << vs[i] << endl;
  }
  int ii = 0;
  for(int j = 59; j >= 0; --j) {
    int idx = -1;
    for(int i = ii; i < n; ++i) {
      if(vs[i] & (1LL << j)) {
        idx = i;
        break;
      }
    }
    if(idx < 0) {
      continue;
    }
    swap(vs[idx], vs[ii]);
    REP(i, n) if(i != ii && (vs[i] & (1LL << j))) {
      vs[i] ^= vs[ii];
    }
    ++ii;
  }
  ll res2 = 0;
  REP(i, ii) {
    res2 ^= vs[i];
  }
  // cerr << res << " " << res2 <<endl;
  cout << res + res2*2 << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n;
    cin >> n;
    vector<int> d(n);
    int result = 0;
    for(int i = 0; i < n; i++){
        cin >> d[i];
    }
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            result += d[i] * d[j];
        }
    }
    cout << result << endl;
}


Measured memory_bytes: 256
#include <array>
#include <climits>
#include <iostream>
using namespace std;

const int N = 1E5, MOD = 1000000007;
array<long long, 4> f;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr); cout.tie(nullptr);
  string s; cin >> s;
  f[0] = 1;
  for (int i = 0; i < s.length(); ++i)
    for (int x = 3; x >= 0; --x) {
      if (s[i] == '?') f[x] = f[x] * 3 % MOD;
      if (x && (s[i] == '?' || s[i] == 'A' + x-1)) f[x] = (f[x] + f[x-1]) % MOD;
    };
  cout << f[3];
  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i) 
#define PI acos(-1)
#define pcnt __builtin_popcountll
#define rng(a) a.begin(), a.end()
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
#define fi first
#define se second

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;

template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
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; }

ll INF = 1001001001;
ll LINF = 1001001001001001001ll;

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

    int n, c;
    cin>>n>>c;
    vvi tsc(n, vi(3));
    rep(i, n) cin>>tsc[i][0]>>tsc[i][1]>>tsc[i][2];

    sort(rng(tsc));
    priority_queue<P, vector<P>, greater<P>> cuse;
    int ans = 0;
    rep(i, n) {
        while (!cuse.empty()) {
            if (cuse.top().fi < tsc[i][0]) cuse.pop();
            else {
                queue<P> temp;
                while (!cuse.empty() && cuse.top().fi == tsc[i][0]) {
                    if (cuse.top().se == tsc[i][2]) {
                        cuse.pop();
                        break;
                    }
                    temp.push(cuse.top()); cuse.pop();
                }
                while (!temp.empty()) {
                    cuse.push(temp.front()); temp.pop();
                }
                break;
            }
        }
        cuse.push(P(tsc[i][1], tsc[i][2]));
        chmax(ans, sz(cuse));
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 5760
var a,b,c,d,e,f : longint ;
function max(x,z:longint ) : longint ;
 begin
  if x>z then
   max:=x
  else
   max:=z
 end;
begin
 readln(a,b,c,d);
 if b>d then
  begin
   e:=max(a,c);
    if d-e >=0 then
   writeln(d-e)
    else
    writeln(0);

  end
 else if b<=d  then
  begin
   e:=max(a,c);
    if b-e >=0 then
    writeln(b-e)
    else
    writeln(0);
  end;

end.


Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
const int N = 1e5 + 5;
int n;
int a[N];
int b[N];
int c[N];
long long ans;
long long dp[N];
int main(){
	scanf("%d" , &n);
	for(int i = 1 ; i <= n ; ++i){
		scanf("%d" , a + i);
	}
	sort(a + 1 , a + 1 + n);
	for(int i = 1 ; i <= n ; ++i){
		scanf("%d" , b + i);
	}
	sort(b + 1 , b + 1 + n);
	for(int i = 1 ; i <= n ; ++i){
		scanf("%d" , c + i);
	}
	sort(c + 1 , c + 1 + n);
	a[n + 1] = 2e9;
	int ptr = 0;
	dp[0] = 0;
	for(int i = 1 ; i <= n ; ++i){
		while(a[ptr + 1] < b[i]){
			++ptr;
		}
		dp[i] = ptr;
		dp[i] += dp[i - 1];
	}
	ans = 0;
	ptr = 0;
	b[n + 1] = 2e9;
	for(int i = 1 ; i <= n ; ++i){
		while(b[ptr + 1] < c[i]){
			++ptr;
		}
		ans += dp[ptr];
	}
	printf("%lld\n" , ans);
}

Measured memory_bytes: 2176
#include <iostream>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <cmath>

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

#define big ((ll)(1e9) + 7)

ll max(ll a, ll b)
{
  if (a > b)
  {
    return a;
  }
  return b;
}

int main()
{
  int n;
  cin >> n;
  vector<int> A(n);
  for (int i = 0; i < n; i++)
  {
    cin >> A[i];
  }
  sort(A.begin(), A.end());
  int cnt = 1;
  int ans = 0;
  for (int i = 0; i < n - 1; i++)
  {
    if (A[i] == A[i + 1])
    {
      cnt++;
    }
    else
    {
      if (cnt % 2 == 1)
      {
        ans++;
      }
      cnt = 1;
    }
  }
  if (cnt % 2 == 1)
  {
    ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int max = a + b;
		if(max < a - b) {
			max = a - b;
		}
		if(max < a * b) {
			max = a * b;
		}
		System.out.println(max);
	}
}

Measured memory_bytes: 21332
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	vector<ll> s,t;
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		ll a,b;
		cin>>a>>b;
		s.push_back(a);
		t.push_back(b);
	}
	for(int i=1;i<n;i++)
	{
		ll k;
		ll a,b;
		a = s[i-1]/s[i];
		if(s[i-1]%s[i])a++;
		b = t[i-1]/t[i];
		if(t[i-1]%t[i])b++;
		k = max(a,b);
		s[i]*=k;
		t[i]*=k;
	}
	ll j=0;
	j = s[n-1]+t[n-1];
	cout<<j<<endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
main()
{int N,L,i,j;
char str[105][105];
char c[105];
memset(c,0,sizeof(c));
scanf("%d %d",&N,&L);
for(int i=0;i<N;i++)
	
		scanf("%s",str[i]);
		
		
	for(int i=0;i<N;i++)
		{for(int j=i;j<N;j++)
			{
		
				if( strcmp (str[i],str[j])>0)
				{	strcpy(c,str[j]);
					strcpy(str[j],str[i]);
					strcpy(str[i],c);
			    } 	
			}
		
		
		

}
		for(int i=0;i<N;i++)
		{printf("%s",str[i]);
		}
printf("\n");	
	
	return 0;
} 

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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define REPV(iter, v) for(auto (iter)=(v).begin(); (iter)!=(v).end();++(iter))
#define ALL(v) (v).begin(),(v).end()

#define MOD 1000000007

using namespace std;

typedef long long ll;

ll modPow(const ll a, const ll n, const ll p)
{
    if (n == 1) return a % p;
    if (n % 2 == 1) return (a * modPow(a, n - 1, p)) % p;
    ll num = modPow(a, n / 2, p);
    return (num * num) % p;
}

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

    vector<ll> modFact(H + W + 1);
    vector<ll> modFactInv(H + W + 1);

    // フェルマーの小定理を用いて、(x!)の逆元を求める
    modFact[0] = 1;
    modFactInv[0] = modPow(modFact[0], MOD - 2, MOD);
    for (ll i = 1; i <= H + W; ++i)
    {
        modFact[i] = (modFact[i - 1] * i) % MOD;
        modFactInv[i] = modPow(modFact[i], MOD - 2, MOD);
    }

    ll ans = 0;
    for (ll i = B; i <= W - 1; ++i)
    {
        ll first, second;
        first = (((modFact[i + H - A - 1] * modFactInv[H - A - 1]) % MOD) * modFactInv[i]) % MOD;
        second = (((modFact[W - i + A - 2] * modFactInv[A - 1]) % MOD) * modFactInv[W - 1 - i]) % MOD;
        ans += (first * second) % MOD;
        ans = ans % MOD;
    }

    cout << ans << endl;
}


Measured memory_bytes: 3328