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

typedef long long ll;
typedef pair<int, int> pi;
#define F first
#define S second
#define PB push_back

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep_op(a, b) for (int i = a; i < b; i++)

const int MOD = 1000000007;

// int max = *std::max_element(vec.begin(), vec.end());
// int sum = accumulate(list, list + size, 0);

int main()
{
    ll result = 1000000000000;

    int n;
    cin >> n;

    vector<int> x(n);
    rep(i, n) cin >> x[i];

    // 全座標走査
    for (int i = 1; i <= 100; i++)
    {
        ll temp_sum = 0;
        // Xiについて全員分の消費体力を計算

        for (int k = 0; k < n; k++)
        {
            temp_sum += (x[k] - i) * (x[k] - i);
        }

        // temp_sumが現時点での体力消費値の最小値であれば更新
        result = min(temp_sum, result);
    }
    cout << result << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ll mod2 = 998244353;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n; cin >> n;
  ll d, a; cin >>d >> a;
  vector<pair<ll, ll>> P(n);
  rep(i, n) cin >> P[i].first >> P[i].second;
  sort(all(P));
  queue<pair<ll, ll>> q;
  ll sumDamage = 0;
  ll ans = 0;
  rep(i, n) {
    while(!q.empty() && q.front().first < P[i].first) {
      sumDamage -= q.front().second;
      q.pop();
    }
    ll rem = P[i].second - sumDamage;
    if(rem <= 0) continue;
    q.push({P[i].first+2*d, (rem+a-1)/a*a});
    ans += (rem+a-1)/a;
    sumDamage += (rem+a-1)/a*a;
  }
  cout << ans << endk;
  return 0;
}


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

typedef long long ll;
typedef pair<int,int> P;
#define INF 1000000100
#define rep(i,n) for (int i=0;i<n;i++)

int main(){
    int N;
    cin >> N;
    vector<P> v;
    rep(i,N){
        int a;
        cin >> a;
        v.push_back(P(i,a));
    }
    sort(v.begin(),v.end(), [](const P& lhs, const P& rhs){
        return lhs.second < rhs.second;
    });
    rep(i,N){
        cout << v[i].first+1 << " ";
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3816
#include<iostream>
#include<string>
using namespace std;
int sai[100000][6];
int x[100000];
int main() {
	while (true) {
		int y[6] = { 1,5,4,3,2,6 };
		string S; int n;
		cin >> n; if (n == 0)break;
		for (int i = 0; i < 100000; i++) {
			x[i] = 0; for (int j = 0; j < 6; j++)sai[i][j] = 0;
		}
		for (int i = 0; i < n; i++) {
			cin >> S;
			if (S == "north") { x[i + 1] = 0; }
			if (S == "east") { x[i + 1] = 1; }
			if (S == "south") { x[i + 1] = 2; }
			if (S == "west") { x[i + 1] = 3; }
		}
		for (int i = 0; i < 6; i++) { sai[0][i] = y[i]; }
		for (int i = 1; i <= n; i++) {
			if (x[i] == 2) {
				sai[i][0] = sai[i - 1][4]; sai[i][1] = sai[i - 1][0]; sai[i][2] = sai[i - 1][2];
				sai[i][3] = sai[i - 1][3]; sai[i][4] = sai[i - 1][5]; sai[i][5] = sai[i - 1][1];
			}
			if (x[i] == 3) {
				sai[i][0] = sai[i - 1][2]; sai[i][1] = sai[i - 1][1]; sai[i][2] = sai[i - 1][5];
				sai[i][3] = sai[i - 1][0]; sai[i][4] = sai[i - 1][4]; sai[i][5] = sai[i - 1][3];
			}
			if (x[i] == 0) {
				sai[i][0] = sai[i - 1][1]; sai[i][1] = sai[i - 1][5]; sai[i][2] = sai[i - 1][2];
				sai[i][3] = sai[i - 1][3]; sai[i][4] = sai[i - 1][0]; sai[i][5] = sai[i - 1][4];
			}
			if (x[i] == 1) {
				sai[i][0] = sai[i - 1][3]; sai[i][1] = sai[i - 1][1]; sai[i][2] = sai[i - 1][0];
				sai[i][3] = sai[i - 1][5]; sai[i][4] = sai[i - 1][4]; sai[i][5] = sai[i - 1][2];
			}
		}
		cout << sai[n][0] << endl;
	}
	return 0;
}

Measured memory_bytes: 3948
n = int(input())
p = list(map(int, input().split()))
swapcount = 0
for i in range(n):
    if i != n - 1:
        if p[i] == i + 1:
            k = p[i + 1]
            p[i + 1] = p[i]
            p[i] = k
            swapcount += 1
    else:
        if p[i] == i + 1:
            swapcount += 1

print(swapcount)

Measured memory_bytes: 14008
#include <bits/stdc++.h>
using namespace std;
#define N 200005
#define mod 1000000007
#define pp pair<ll,ll>
typedef long long int ll;
typedef long double ld;
typedef vector<pp> vpl;
#define MP make_pair
#define endl "\n"
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<n;i++)
#define rrep(i,n) for(ll i=n-1;i>=0;i--)
#define repb(i,n) for(ll i=1;i<n-1;i++) 
#define trace(i,a) for(auto i=a.begin();i!=a.end();i++)    
void fastIO(void);
 
void decimal(int);
ll modmulti(ll, ll, ll);
ll modadd(ll, ll, ll);
ll modpower(ll, ll, ll);
ll gcd(ll, ll );
ll modinv(ll, ll);
 

int main()
{
   ll a,b;
   cin>>a>>b;
   ll sum=1;
   ll cnt=0;
   for(;sum<b;){
      cnt++;
      sum+=a-1;
   }
   cout<<cnt<<endl;
}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
void fastIO(void)
{  ios_base::sync_with_stdio(false);
   cin.tie(0);
   cout.tie(0);
}
 
void decimal(int n){
   cout<<fixed;
   cout<<setprecision(n);
}
ll modmulti(ll a, ll b, ll m){
   return ((a%m)*(b%m))%m;
}
ll modadd(ll a, ll b, ll m){
   return ((a%m)+(b%m)+m)%m;
}
ll modpower(ll a, ll n, ll m){
   if(n==0)
      return 1;
   ll result = 1;
   while(n>0){
      if(n%2==1)
         result = modmulti(result,a,m);
      a = modmulti(a,a,m);
      n = n/2;
   }
   return result;
}
ll gcd(ll a, ll b){
   if(b==0)
      return a;
   return gcd(b,a%b);
}
ll modinv(ll a, ll m){
   return modpower(a,m-2,m);
}

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

#define REP(i, n, N) for(ll i=(n); i<(N); i++)
#define RREP(i, n, N) for(ll i=(N-1); i>=(n); i--)
#define LREP(lst,itr) for(auto itr = lst.begin(); itr != lst.end(); ++itr)
#define SPACEREP(lst,itr) for(auto itr=lst.begin(); itr!=lst.end();++itr){cout<<*itr<<(++itr!=anslist.end()?" ":"\n");itr--;}
#define CK(n, a, b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define MCP(a, b) memcpy(b,a,sizeof(b))
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
#define v2(T) vector<vector<T>>
typedef long long ll;
using namespace std;
const ll mod = 1e9 + 7;
const ll inf = 1e18;

int main(){
    int n;
    cin >> n;
    vector<int> vec(n+1);

    REP(i,1,n+1){
        cin >> vec[i];
    }
    int count=0;
    REP(i,2,n){
        int check=0;
        if(vec[i-1]<vec[i]){
            check++;
        }else{
            check--;
        }
        if(vec[i+1]<vec[i]){
            check++;
        }else{
            check--;
        }
        if(!check)count++;
    }
    p(count);
}

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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

template<class T>inline bool chmax(T &a, const T &b) { if (b > a) { a = b; return true; } return false; }
template<class T>inline bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;

void solve() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a <= c && c <= b) cout << "Yes" << '\n';
    else cout << "No" << '\n';
}

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

    solve();

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
 
int main(){
    int N;
    cin >> N;
 
    vector<int> A(N), B(N);
    for(int i = 0; i < N; i++)
        cin >> A[i];  
    for(int i = 0; i < N; i++)
        cin >> B[i];
 
 
    int up = 0, down = 0;
    for(int i = 1; i < N; i++)
        up += A[i];
    for(int i = 0; i < N - 1; i++)
        down += B[i];
    
    int ans = A[0] + up, cd = A[0];
    for(int i = 0; i < N - 1; i++){
        if(ans < cd + down)
            ans = cd + down;
        up -= A[i+1];
        down -= B[i];
        cd += A[i+1];
    }   
    cout << ans + B[N-1] << endl;
 
    return 0;    
}


Measured memory_bytes: 256
#include<stdio.h>

int A[1000000], n;

int binarySearch(int key) {
	int left = 0;
	int right = n;
	int mid;
	while (left<right) {
		mid = (right + left) / 2;
		if (key == A[mid])return 1;
		if (key > A[mid])left = mid + 1;
		else if (key < A[mid])right = mid;
	}
	return 0;
}

int main(void) {
	int i, q, k, sum = 0;

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", &A[i]);
	}

	scanf("%d", &q);
	for (i = 0; i < q; i++) {
		scanf("%d", &k);
		if (binarySearch(k))sum++;
	}
	printf("%d\n", sum);

	return 0;
}

Measured memory_bytes: 988
from fractions import gcd
n = int(input())
a = list(map(int, input().split()))
sf = [a[0]] * n
for i in range(1, n):
    sf[i] = gcd(sf[i - 1], a[i])
sb = [a[n - 1]] * n
for i in range(n - 2, -1, -1):
    sb[i] = gcd(sb[i + 1], a[i])
ans = 1
for i in range(n):
    if i == 0:
        ans = max(ans, sb[1])
    elif i == n - 1:
        ans = max(ans, sf[n - 2])
    else:
        ans = max(ans, gcd(sf[i - 1], sb[i + 1]))
print(ans)


Measured memory_bytes: 16156
while True:
    a,op,b=map(str,input().split())
    a=int(a)
    b=int(b)
    if op=="?":
        break
    if op=="+":
        print(a+b)
    elif op=="-":
        print(a-b)
    elif op=="*":
        print(a*b)
    elif op=="/":
        print(a//b)


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

#define PI acos(-1.0)
#define INF 1e18
#define inf 0x3f3f3f3f
#define FAST_IO ios::sync_with_stdio(false)

const int N=123456;
typedef long long LL;
vector <int> E[N];
int w[N],vis[N];
int bestidx,bestval;

void dfs(int x){
    vis[x]=1;
    if(w[x]<bestval){
        bestval=w[x];
        bestidx=x;
    }
    for(auto u:E[x]){
        if(!vis[u]) dfs(u);
    }
}

int main(){
    LL ans=0;
    int n,m,cnt=0;
    scanf("%d %d",&n,&m);
    for(int i=0;i<n;i++) scanf("%d",&w[i]);
    for(int i=1;i<=m;i++){
        int x,y;
        scanf("%d %d",&x,&y);
        E[x].push_back(y);
        E[y].push_back(x);
    }
    for(int i=0;i<n;i++){
        if(!vis[i]){
            bestval=2e9;
            dfs(i);
            ans+=bestval;
            w[bestidx]=2e9;
            cnt++;
        }
    }
    if(cnt==1) {printf("0\n");return 0;}
    sort(w,w+n);
    for(int i=0;i<cnt-2;i++){
        if(w[i]==2e9){
            printf("Impossible\n");
            return 0;
        }
        ans+=w[i];
    }
    printf("%lld\n",ans);
    return 0;
}

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

#define rp(i,n) for(int i=0;i<n;i++)
#define rep(i,m,n) for(int i=m;i<=n;i++)
#define llrp(i,n) for(long long i=0;i<n;i++)
#define llrep(i,m,n) for(long long i=m;i<=n;i++)
#define sort(a) sort(a.begin(),a.end())
#define reverse(a) reverse(a.begin(),a.end())
#define pb push_back
#define elif else if
#define vcin(a); rp(i,a.size()){cin>>a[i];}
#define vcout(a); rp(i,a.size()){cout<<a[i]<<endl;}
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<char> vc;
typedef long long ll;
typedef string S;
typedef pair<int,int> P;

bool isOK(int index, int key,vi a) {
    if (a[index] >= key) return true;
    else return false;
}

int binary_search(int key,vi a) {
    int left = -1;
    int right = (int)a.size();
    while (right - left > 1) {
        int mid = left + (right - left) / 2;
        
        if (isOK(mid, key,a)) right = mid;
        else left = mid;
    }
    return right;
}

int modpow(int a,int b,int p){
    if(b==0){
        return 1;
    }elif(b%2==0){
        return modpow((a*a)%p,b/2,p);
    }else{
        return (a*modpow(a,b-1,p))%p;
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    S s,t;
    cin >> s >> t;
    // sの末尾とtの先頭が何文字一致しているか数える
    int cnt=0;
    int j=0;
    while(j<n){
        bool same=true;
        rp(i,j+1){
            if(s.at(n-1-j+i)!=t.at(i)){// ここを直す
                same=false;
            }
        }
        if(same){
            j++;
            cnt=j;
        }else{
            j++;
        }
    }
    cout << 2*n-cnt << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <utility>
#include <set>
#include <map>
using namespace std;
typedef long long int lli;
typedef pair<int, int> pii;
typedef pair<lli, lli> pll;
const lli inf = 1e18;

void dfs(int v, vector<vector<int> > &adj, vector<int> &c, vector<int> &ans){
	if(ans[v] != -1) return;
	ans[v] = c.back();
	c.pop_back();
	for(int next: adj[v]){
		dfs(next, adj, c, ans);
	}
}

int main(){
	int n;
	cin >> n;
	vector<vector<int> > adj(n);
	for(int i=0; i<n-1; i++){
		int a,b;
		cin >> a >> b;
		a--; b--;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	vector<int> c(n);
	for(int i=0; i<n; i++){
		cin >> c[i];
	}
	sort(c.begin(), c.end());
	vector<int> ans(n, -1);
	dfs(0, adj, c, ans);
	int score = 0;
	for(int i=0; i<n; i++){
		for(int j: adj[i]){
			if(i<j){
				score += min(ans[i], ans[j]);
			}
		}
	}
	cout << score << endl;
	for(int i=0; i<n-1; i++){
		cout << ans[i] << " ";
	}
	cout << ans[n-1] << endl;
	return 0;
}

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

int main(void){
    
    int  K,A,B;
//    string in_str,tmp_str;
    string ans = "NG";
 
//  cin >> in_str;
    cin >> K >> A >> B;  

//    int length = int(in_str.length());
  
    if ((B % K) + A <= B){
        ans = "OK";
    }
    
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

using namespace std;

int main() {
   int a,b;
   cin >> a >> b;
   cout << max({a+a-1,a+b,b+b-1}) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
    ios_base::sync_with_stdio(0);
    int n,m;
    cin >> n >> m;
    int N = (1 << n);
    vector <vector <int> > asd(m);
    for(int i = 0; i < m; ++i){
        int a;
        cin >> a;
        asd[i].resize(a);
        for(int j = 0; j < a; ++j){
            cin >> asd[i][j];
            asd[i][j]--;
        }
    }
    int x = 0;
    vector <int> p(m);
    for(int i = 0; i < m; ++i){
        cin >> p[i];
    }
    for(int i = 0; i < N; ++i){
        vector <int> afd(n);
        for(int j = 0; j < n; ++j){
            if((1 << j) & i){
                afd[j] = 1;
            }
        }
        int ok = 1;
        for(int j = 0; j < m; ++j){
            int h = 0;
            for(int y : asd[j]){
                h += (afd[y]);
            }
            h += p[j];
            h %= 2;
            //cerr << j << ' ' << h <<  ' ' << i << '\n';
            if(h != 0)ok = 0;
        }
        if(ok)++x;
    }
    cout << x << '\n';
}

Measured memory_bytes: 256
const input = require('fs').readFileSync('/dev/stdin', 'utf8');
const lines = input.trim().split('\n');
while (line = lines.shift()) {
	const [n, max] = line.split(' ').map(Number);
	if (n === 0 && max === 0) { break; }
	const prices = lines.shift().split(' ').map(Number);
	let temp = 0;
	for (let i = 0; i <= n; i++) {
		for (let j = 0; j <= n; j++) {
			if (!prices[i] || !prices[j] || i === j) {
				continue;
			}
			const tempCalc = prices[i] + prices[j];

			if (tempCalc <= max && tempCalc > temp) {
				temp = tempCalc;
			}
		}
	}
	console.log(`${temp ? temp : 'NONE'}`)
} 



Measured memory_bytes: 18268
#include <bits/stdc++.h>
using namespace std;
 
typedef long long LL;
typedef pair<int, int> pii;
 
#define fst first
#define snd second
#define pb push_back
#define eb emplace_back
#define REP(i, a, b)  for(int i = (a), i##end = (b); i < i##end; ++i)
#define DREP(i, a, b) for(int i=(a-1), i##end = (b); i >=i##end; --i)
 
template <typename T> bool chkmax(T& a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> bool chkmin(T& a, T b) { return a > b ? a = b, 1 : 0; }
 
const int oo = 0x3f3f3f3f;
const int maxn = 100000 + 5;
 
template<typename T> T read() {
    T n(0), f(1);
    char ch = getchar();
    for( ;!isdigit(ch); ch = getchar()) if(ch == '-') f = -1;
    for( ; isdigit(ch); ch = getchar()) n = n * 10 + ch - 48; 
    return n * f;
}

LL a, b, c;
int main() {

        a = read<LL>();
        b = read<LL>();
        c = read<LL>();

        if(a == b && b == c) { puts((a&1) ? "0" : "-1"); return 0; }

        int res = 0;
        while(1) {
            if(a & 1 || b & 1 || c & 1) break;
            ++ res;
            LL ta = (b + c) / 2;
            LL tb = (a + c) / 2;
            LL tc = (a + b) / 2;

            a = ta, b = tb, c = tc;
        }
        printf("%d\n", res);
   
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) throws Exception {
        int a, b, division, remainder;
        String f;
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder createString = new StringBuilder();
        String line = br.readLine();
        String[] numbers = line.split(" ");
        a = Integer.parseInt(numbers[0]);
        b = Integer.parseInt(numbers[1]);
        division = a / b;
        remainder = a % b;
        f = (String.format("%.5f",((double)a / (double)b)));
        
        createString
            .append(division)
            .append(" ")
            .append(remainder)
            .append(" ")
            .append(f)
            .append("\n");
        System.out.print(createString);
    }
}


Measured memory_bytes: 24812
#include <iostream>                          
#include <string>                            
using namespace std;                         
                                             
int main(){                                  
    string s;                                
    cin >> s;                                
    int ci = s.length() + 1, fi = -1;        
    for(int i = 0;i < s.length();++i){       
        if(s[i] == 'C') ci = ci > i ? i : ci;
        if(s[i] == 'F') fi = fi < i ? i : fi;
    }                                        
    if(ci < fi) cout << "Yes" << endl;       
    else cout << "No" << endl;               
    return 0;                                
}                                            

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

using namespace std;

#define F first
#define S second
#define modulo ll (1e9 + 7)

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

void init(){
    cin.tie(0);
    cin.sync_with_stdio(0);
}

const int N = 1e3 + 9, M = 1e6 + 9, OO = 0x3f3f3f3f;
const ll llOO = 0x3f3f3f3f3f3f3f3f;

int h, w;
char grid[N][N];

int dp[N][N];

void go(int tc){
    cin >> h >> w;
    for(int i = 0;i < h;i++)
        for(int j = 0;j < w;j++)
            cin >> grid[i][j];


    dp[0][0] = 1;
    for(int i = 0;i < h;i++){
        for(int j = 0;j < w;j++){
            if(grid[i][j] == '#')   continue;
            if(i)   dp[i][j] += dp[i - 1][j];
            if(j)   dp[i][j] += dp[i][j - 1];

            dp[i][j] %= modulo;
        }
    }

    cout << dp[h - 1][w - 1];
}

int main(){
    init();

    int t, tc = 1;  t = 1;//cin >> t;
    while(t--)  go(tc++);

}

Measured memory_bytes: 5248
#include<stdio.h>
#include<string.h>


int main(){
  int i,j,k,l,al[]={0,1,3,5,7,9,11,15,17,19,21,23,25},n,clen,alen;
  char ci[1000],ans[1000];
  fgets(ci,1000,stdin);
  n=atoi(ci);
  alen=sizeof(al)/sizeof(int);
  for(i=0;i<n;i++){
    fgets(ci,1000,stdin);
    clen=strlen(ci);
    ans[clen]='\0';
    for(j=0;j<alen;j++){
      for(k=0;k<26;k++){
	for(l=0;l<clen;l++){
	  if(isalpha(ci[l]))
	    ans[l]=(al[j]*((int)ci[l]-(int)'a')+k)%26+'a';
	  else
	    ans[l]=ci[l];
	}
	if(strstr(ans,"that")||strstr(ans,"this")){
	  printf("%s",ans);
	  goto find;
	}
      }
    }
  find:;
  }
  return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;

public class Main {

    public static void main(String[] args){
        Scanner reader = new Scanner(System.in);
    
        int input=reader.nextInt();
         int input2=reader.nextInt();
        if((input >=10) || (input2 >=10))
        {
        System.out.println("-1");
        }
        else
        {
             System.out.println(input*input2);
        }
            
      
    }}

Measured memory_bytes: 35628
#include <bits/stdc++.h>
using namespace std;
int main () {
    int N;
    cin >> N;
    vector<int> A(N), B(N), C(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    for (int i = 0; i < N; i++) {
        cin >> B[i];
    }
    for (int i = 0; i < N; i++) {
        cin >> C[i];
    }
    sort(A.begin(), A.end());
    sort(B.begin(), B.end());
    sort(C.begin(), C.end());
    long long ans = 0;
    for (int i = 0; i < N; i++) {
        int k = B[i];
        long long a = lower_bound(A.begin(), A.end(), k) - A.begin();
        long long c = C.end() - upper_bound(C.begin(), C.end(), k);
        ans += a*c;
    }
    cout << ans << endl;
}

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

typedef long long ll;

const int MAXV = 1e5 + 10;
const int MAXN = 1e3 + 10;
const ll INF = 1e13;

ll dp[MAXV];
int N,W,V,wi[MAXN],vi[MAXN];

int main(){

	cin >> N >> W;
	for(int i = 1;i<=N;i++){
		cin >> wi[i] >> vi[i];
		V += vi[i];
	}

	for(int i = 1;i<=V;i++) dp[i] = INF;
	dp[0] = 0;
	
	for(int item = 1;item<=N;item++){
		int w = wi[item], v = vi[item];
		for(int i = V;i>=v;i--){
			dp[i] = min(dp[i],dp[i - v] + w);
		}
	}

	for(int i = V;i>=0;i--){
		if(dp[i] <= W){
			cout << i << endl;
			break;
		}
	}

	return 0;

}

Measured memory_bytes: 4420
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define rrng(a) a.rbegin(),a.rend()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef tuple<int,int,int> T;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<T> vt;
//inline int in() { int x; scanf("%d",&x); return x;}
inline ll in() { ll x; cin >> x; return x; }
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

int main() {
  int n = in();
  map<string,int> mp;
  rep(i,n){
    string s; cin >> s;
    sort(s.begin(),s.end());
    mp[s]++;
  }
  ll ans = 0;
  for (auto& p : mp) {
    int s = p.second;
    ans += (ll)s*(s-1)/2;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 11136
//Insertion_Sort.cpp
#include<iostream>
using namespace std;

class Score{
private:
  int score;
public:
  Score(){}
  Score(int x):score(x){}
  int get_score(){return score;}
  void set_score(int x){score = x;}
};

int main() {
  int n;
  cin >> n;

  Score A[1000];

  for (size_t i = 0; i < n; i++) {
    int temp;
    cin >> temp;
    A[i].set_score(temp);
  }

  for (size_t k = 0; k < n; k++) {
    if (k) cout << " ";
    cout << A[k].get_score() ;
  }
  cout << endl;

  for (size_t i = 1; i < n; i++) {
    int v = A[i].get_score();
    int j = i - 1;

    while (v < A[j].get_score() && j>= 0) {
      A[j+1].set_score(A[j].get_score());
      j--;
    }
    A[j+1].set_score(v);

    for (size_t k = 0; k < n; k++) {
      if (k) cout << " ";
      cout << A[k].get_score() ;
    }
    cout << endl;
  }

}

Measured memory_bytes: 3084
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
using namespace std;
typedef long long int int64;
typedef unsigned long long uint64;

int main(int argc , char* argv[]){
    string s;
    cin >> s;
    if(s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <stack>
#include <math.h>
#include <vector>
#include <algorithm>

#define rep(i,n) for(int i=0; i < n; i++)
using namespace std;
#define PI 3.14159265358979

int main()
{
    int n;
    cin >> n;
    vector<int> w(n);
    rep(i, n-1)
    {
        int a;
        cin >> a;
        w[a-1]++;
    }
    rep(i, n)
    {
        cout << w[i] << endl;
    }
    return 0;
}

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

main(){
	while(true){
		double x, h;
		cin >> x >> h;
		
		if(x==0){
			break;
		}
		
		double H = sqrt(x*x*0.25+h*h);
		
		printf("%.5f\n",x*x + x*H/2.0*4.0);
	}
}


Measured memory_bytes: 3148
#include<bits/stdc++.h>
#define ll long long
#define vl vector
#define pb push_back
#define ld long double
#define ff first
#define ss second
using namespace std;

ll fact(ll a)
{
    if(a==0) return 1;
    else return a*fact(a-1);
}

int main()
{
    ll i,j,n,k,t,m;
    ld sum=0,ans=0,a,b;
    vl<pair<ld,ld>> v;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>a>>b;
        v.pb({a,b});
    }
    sort(v.begin(),v.end());
    cout<<setprecision(10);
    ld x1,y1,x2,y2;
    do
    {
        sum=0;
        for(i=1;i<n;i++)
        {
            x1=v[i].ff;
            y1=v[i].ss;
            x2=v[i-1].ff;
            y2=v[i-1].ss;
            a=x1-x2;
            a*=a;
            b=y1-y2;
            b*=b;
            sum+=sqrt(a+b);
        }
        ans+=sum;
        
    }while(next_permutation(v.begin(),v.end()));
    n=fact(n);
    ans/=n;
    cout<<setprecision(8)<<fixed<<ans;
}

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


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		long a = sc.nextLong();
		long b = sc.nextLong();
		long x = sc.nextLong();

		long ret1 = b / x;
		long ret2 = (a - 1) / x;

		if (a == 0) {
			pr.println(ret1 + 1);
		} else {
			pr.println(ret1 - ret2);
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}


Measured memory_bytes: 9808
#include<bits/stdc++.h>
using namespace std;
 int main(){
   map<char,char>mp;
   mp['A']='T';
   mp['C']='G';
   mp['G']='C';
   mp['T']='A';
   char m;
   cin>>m;
   cout<<mp[m];
 return 0;
 }

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

int main()
{
    int n;
    std::cin >> n;
    std::vector<int> a(n);
    a[0] = 0;
    for (int i = 1; i < n; ++i)
    {
        std::cin >> a[i];
    }

    std::vector<int> ans(n);
    std::fill(ans.begin(), ans.end(), 0);
    for (int i = 1; i < n; ++i)
    {
        ++ans[a[i] - 1];
    }

    for (int i = 0; i < n; ++i)
    {
        std::cout << ans[i] << '\n';
    }
    return 0;
}

Measured memory_bytes: 4788
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<string>
#include<queue>

using namespace std;

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long

typedef pair<lint, lint> P;
const lint MOD = 1e9+7;
const lint INF = MOD * MOD;

int n;
const int MAX = 205;
vector<int> to[MAX];
int c[MAX]; 

bool is_bipartie(){
    memset(c, 0, sizeof(c)); c[0] = 1;
    queue<int> q; q.push(0);
    while(!q.empty()){
        int s = q.front(); q.pop();
        for(int& t : to[s]){
            if(c[t] == 0){
                c[t] = -c[s]; q.push(t);
            }
            else if(c[t] == c[s]) return false;
        }
    }
    return true;
}

lint d[MAX][MAX];
void warshall_floyd(){
    rep(i, n) rep(j, n) rep(k, n){
        d[j][k] = min(d[j][k], d[j][i]+d[i][k]);
    }
}

int main(){
    cin >> n;
    rep(i, n){
        string s; cin >> s;
        rep(j, n){
            if(s[j] == '1'){
                to[i].push_back(j); d[i][j] = 1;
            }
            else if(i == j) d[i][j] = 0;
            else d[i][j] = MOD;
        }
    }
    if(!is_bipartie()){
        cout << "-1" << endl; return 0;
    }
    warshall_floyd(); lint res = 0;
    rep(i, n) rep(j, n){
        res = max(res, d[i][j]);
    }
    cout << res + 1 << endl;
}

Measured memory_bytes: 768
from collections import Counter

N = int(input())
V = list(map(int, input().split()))

V1 = [V[i] for i in range(0, len(V), 2)]
V2 = [V[i] for i in range(1, len(V), 2)]

x = Counter(V1).most_common(2)
y = Counter(V2).most_common(2)

if x[0][1] < y[0][1]:
    x, y = y, x
elif len(x)>1 and len(y) > 1 and x[0][1] == y[0][1] and x[1][1] > y[1][1]:
    x, y = y, x

l = int(N / 2)
res = l - x[0][1]
if y[0][0] == x[0][0]:
    res += l - (y[1][1] if len(y) > 1 else 0)
else:
    res += l - y[0][1]

print(res)


Measured memory_bytes: 15972
h,w=map(int,input().split())
g=[input() for _ in range(h)]
d=[[-1]*w for _ in range(h)]
d[0][0]=0
q=[(0,0)]
while q:
  tx,ty=q.pop(0)
  for dx,dy in [(1,0),(0,1),(-1,0),(0,-1)]:
    nx,ny=tx+dx,ty+dy
    if 0<=nx<h and 0<=ny<w and g[nx][ny]=='.' and d[nx][ny]<0:
      d[nx][ny]=d[tx][ty]+1
      q+=[(nx,ny)]
print((h*w-sum(s.count('#') for s in g)-d[-1][-1])*(d[-1][-1]>0)-1)

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

int main() {
    ll k,x;
    cin>>k>>x;
    for(ll i=x-k+1;i<x+k;i++){
        cout<<i<<" ";
    }
    cout<<endl;
}


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

typedef long long int llint;

int main()
{
  int n[3];
  int k;

  cin>> n[0] >> n[1] >> n[2] >> k;

  sort(n, n + 3);

  for(int i = 0; i < k; i++) {
    n[2] *= 2;
  }
  

  cout<< n[0] + n[1] + n[2] <<endl;
  

  return 0;
}


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

int main(void) {
  string N;
  cin >> N;
  if((N[0] == N[1] && N[1] == N[2]) || (N[1] == N[2] && N[2] == N[3])) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <functional>
#include <string>
#include <cstdlib>
#include <numeric>
#include <cstdbool>
#include <map> 
typedef long long ll;
using namespace std;

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

const long long INF = 1LL << 60;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
ll n, m;
ll ma = 1000000000 + 7;

vector<bool> used;
int main() {
	int n, q;int res = 0;
	cin >> n >> q;
	string s;
	cin >> s;
	vector<int> l(q);vector<int> r(q);
	for (int i = 0;i < q;i++) {
		cin >> l[i] >> r[i];
	}
	int max = 0;
	vector<int> data(n);
	for (int i = 1; i < n; i++) {
		if (s[i - 1] == 'A' && s[i] == 'C') {
			data[i] += 1;
		}
		data[i] += data[i - 1];
	}
	data[n] += data[n - 1];
	for (int i = 0;i < q;i++) {
		int res = data[r[i]-1] - data[l[i]-1];
		cout << res << endl;
	}
}

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

int main()
{
	int n; cin >> n;
	string s; cin >> s;
	int reds = count(s.begin(), s.end(), 'R');
	if((reds==n) or (reds == 0))
		cout << 0;
	else
	{
		int whites = count(s.begin(), s.begin()+reds, 'W');
		cout << whites;
	}
	return 0;
}

Measured memory_bytes: 3724
from bisect import bisect_left,bisect_right

def check_prime(x):
  p= int(x**0.5)
  for i in range(2,p+1):
    if x%i==0:
      return False
  else:
    return True
  
prime=[2]
like=[]
for i in range(3,100001,2):
  if check_prime(i):
    prime.append(i)
    if (i+1)//2 in prime:
      like.append(i)
      
#print(like)

Q=int(input())
l=[0]*Q
r=[0]*Q
for i in range(Q):
  l[i],r[i]= map(int,input().split())
  s=bisect_left(like,l[i])
  t=bisect_right(like,r[i])  
  print(t-s)

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = (a); i < int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ull << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())

using namespace std;
using i32 = int;
using i64 = long long;
using f64 = double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf64 = vector<f64>;
using vstr = vector<string>;

template<typename T, typename S> void amax(T &x, S y) { if (x < y) x = y; }
template<typename T, typename S> void amin(T &x, S y) { if (y < x) x = y; }

template<int mod> struct modint {
  int x;
  modint(): x(0) {}
  modint(int a) { x = a % mod; if (x < 0) x += mod; }
  modint &operator+=(modint that) { x = (x + that.x) % mod; return *this; }
  modint &operator-=(modint that) { x = (x + mod - that.x) % mod; return *this; }
  modint &operator*=(modint that) { x = (i64) x * that.x % mod; return *this; }
  modint &operator/=(modint that) { return *this *= that.inverse(); }
  modint operator-() { return modint(-this->x); }
  friend ostream& operator<<(ostream &out, modint m) { return out << m.x; }
  modint inverse() {
    int a = x, b = mod, u = 1, v = 0;
    while (b) { int t = a / b; a -= t * b; u -= t * v; swap(a, b); swap(u, v); }
    return modint(u);
  }
  #define op(o, p) modint operator o(modint that) { return modint(*this) p that; }
    op(+, +=) op(-, -=) op(*, *=) op(/, /=)
  #undef op
  #define op(o) bool operator o(modint that) const { return x o that.x; }
    op(==) op(!=) op(<) op(<=) op(>) op(>=)
  #undef op
};

using mint = modint<1000000007>;

mint sums[410][410];
mint g[410][410];
mint dp[410][410];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(16);
  reps(i, 400) sums[0][i] = 1;
  reps(i, 400) rep(j, 400) sums[j + 1][i] = sums[j][i] * i;
  rep(i, 401) rep(j, 400) sums[i][j + 1] += sums[i][j];
  int n, c;
  cin >> n >> c;
  vi32 a(n), b(n);
  rep(i, n) cin >> a[i];
  rep(i, n) cin >> b[i];
  rep(i, n) rep(j, 401) g[i][j] = sums[j][b[i]] - sums[j][a[i] - 1];
  dp[0][0] = 1;
  rep(i, n) rep(j, c + 1) rep(k, c + 1) {
    if (j + k > c) continue;
    dp[i + 1][j + k] += dp[i][j] * g[i][k];
  }
  cout << dp[n][c] << endl;
  return 0;
}


Measured memory_bytes: 2176
/*{{{*/
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#include<assert.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define FOR(I, A, B) for (int I = (A); I <= (B); ++I)
#define FORS(I, S) for (int I = 0; S[I]; ++I)
#define RS(X) scanf("%s", (X))
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define F first
#define S second
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<PII> VPII;
typedef pair<LL,LL> PLL;
typedef vector<PLL> VPLL;
template<class T> void _R(T &x) { cin >> x; }
void _R(int &x) { scanf("%d", &x); }
void _R(LL &x) { scanf("%lld", &x); }
void _R(double &x) { scanf("%lf", &x); }
void _R(char &x) { scanf(" %c", &x); }
void _R(char *x) { scanf("%s", x); }
void R() {}
template<class T, class... U> void R(T &head, U &... tail) { _R(head); R(tail...); }
template<class T> void _W(const T &x) { cout << x; }
void _W(const int &x) { printf("%d", x); }
void _W(const LL &x) { printf("%lld", x); }
void _W(const double &x) { printf("%.16f", x); }
void _W(const char &x) { putchar(x); }
void _W(const char *x) { printf("%s", x); }
template<class T,class U> void _W(const pair<T,U> &x) {_W(x.F); putchar(' '); _W(x.S);}
template<class T> void _W(const vector<T> &x) { for (auto i = x.begin(); i != x.end(); _W(*i++)) if (i != x.cbegin()) putchar(' '); }
void W() {}
template<class T, class... U> void W(const T &head, const U &... tail) { _W(head); putchar(sizeof...(tail) ? ' ' : '\n'); W(tail...); }
#ifdef HOME
 #define DEBUG(...) {printf("# ");printf(__VA_ARGS__);puts("");}
#else
 #define DEBUG(...)
#endif
int MOD = 1e9+7;
void ADD(LL& x,LL v){x=(x+v)%MOD;if(x<0)x+=MOD;}
/*}}}*/
const int SIZE = 1e6+10;
int main(){
    int N;
    R(N);
    W((N-1)/2);
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            String T = in.next();

            int n = S.length();
            for (int i = 0; i <= n; i++) {
                if (S.equals(T)) {
                    System.out.println("Yes");
                    return;
                }

                S = S.substring(n - 1, n) + S.substring(0, n - 1);
            }

            System.out.println("No");
        }
    }

}


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

int main(){
	string s,t;
	cin >> s;
	cin >> t;
	for(char c = 'a'; c <= 'z'; c++){
		string temp = s;
		temp += c;
		if(t == temp) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3608
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String [] sArray = s.split("");
		String num = "";
		int [] numArray = new int [sArray.length - 2];
		int mindif = Integer.MAX_VALUE;
		for(int i = 0; i < sArray.length - 2; i++) {
			num = sArray[i] + sArray[i+1] + sArray[i+2];
			numArray[i] = Integer.parseInt(num);
			
			int dif = 0;
			if(numArray[i] <= 753) dif = 753 - numArray[i];
			else dif = numArray[i] - 753;
			
			if(dif <= mindif) mindif = dif;
		}
		System.out.println(mindif);
		sc.close();
	}

}


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

// #define int long long // intで書いたけど心配なときにlong longに変換する
struct Fast {Fast(){std::cin.tie(0);ios::sync_with_stdio(false);}} fast;

/* short */
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)
#define X real()
#define Y imag()

/* REPmacro */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

/* debug */
#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

/* alias */
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;
using D = double;
using P = complex<D>;
using vs = vector<string>;
template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

/* const */
const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;
const D EPS = 1e-9;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};

/* func */
inline bool inside(int y, int x, int H, int W) {return y >= 0 && x >= 0 && y < H && x < W;}
inline int in() {int x; cin >> x; return x;}
inline ll IN() {ll x; cin >> x; return x;}
inline vs split(const string& t, char c) {vs v; stringstream s(t); string b; while(getline(s, b, c)) v.eb(b); return v;}
template <typename T> inline bool chmin(T& a, const T& b) {if (a > b) a = b; return a > b;}
template <typename T> inline bool chmax(T& a, const T& b) {if (a < b) a = b; return a < b;}
template <typename T, typename S> inline void print(const pair<T, S>& p) {cout << p.first << " " << p.second << endl;}
template <typename T> inline void print(const T& x) {cout << x << endl;}
template <typename T, typename S> inline void print(const vector<pair<T, S>>& v) {for (auto&& p : v) print(p);}
template <typename T> inline void print(const vector<T>& v, string s = " ") {REP(i, v.size()) cout << v[i] << (i != (ll)v.size() - 1 ? s : "\n");}
inline void yesno(bool ok, string yes = "Yes", string no = "No") {cout << (ok?yes:no) << endl;}


signed main() {
    //my-code
    ll A, B, C, K; cin >> A >> B >> C >> K;
    ll ans = 0;
    ans += min(K, A);
    K -= min(K, A);
    if (K > 0) {
        K -= min(K, B);
    }
    if (K > 0) {
        ans -= K;
        K = 0;
    }
    print(ans);

    return 0;
}

// https://github.com/kurokoji/.cpp-Template/wiki テンプレートについて
// http://www.creativ.xyz/dump-cpp-652 dump()について
// https://gist.github.com/rigibun/7905920 色々

Measured memory_bytes: 3660
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
ll x,y;
int main(){
	cin >> x >> y;

	if(abs(x - y) > 1) {
		cout << "Alice" << endl;
	}else {
		cout << "Brown" << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  string O,E;
  cin >> O >> E;
  if (O.size()==E.size()){
    for (int i = 0; i < O.size(); i++){
      cout << O[i] << E[i];
    }
  } else {
    for (int i = 0; i < E.size(); i++){
      cout << O[i] << E[i];
    }
    cout << O[O.size()-1];
  }
}

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

int main(){
  string S,C,T;
  cin >> S;

  for(int i=0;i<S.size()/2;++i)
    C.push_back(S.at(i));
  reverse(S.begin(),S.end());
  for(int i=0;i<S.size()/2;++i)
    T.push_back(S.at(i));
  reverse(T.begin(),T.end());
  if(C==T){
    reverse(C.begin(),C.end());
    if(C==T){
      cout  << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
  else{
    cout << "No" << endl;
  }
}


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

const int MAXN = 305;

int H, W, K, cnt[MAXN], res[MAXN][MAXN];
char s[MAXN][MAXN];

int main(){
	scanf("%d %d %d", &H, &W, &K);
	
	int x = 1;
	for(int i = 0; i < H; i++){
		scanf("%s", s[i]);
		
		cnt[i] = 0;
		for(int j = 0; j < W; j++)
			if(s[i][j] == '#')cnt[i]++;
			
		if(cnt[i] > 0){
			for(int j = 0; j < W; j++){
				res[i][j] = x;
				if(s[i][j] == '#')x++;
			}
			for(int j = W - 1; j >= 0; j--){
				if(s[i][j] == '#')break;
				res[i][j] = x - 1;
			}
		}
	}
	
	for(int i = 1; i < H; i++)if(cnt[i] == 0 && cnt[i - 1] > 0){
		for(int j = 0; j < W; j++)
			res[i][j] = res[i - 1][j];
		cnt[i]++;
	}
	
	for(int i = H - 2; i >= 0; i--)if(cnt[i] == 0 && cnt[i + 1] > 0){
		for(int j = 0; j < W; j++)
			res[i][j] = res[i + 1][j];
		cnt[i]++;
	}
	
	for(int i = 0; i < H; i++){
		for(int j = 0; j < W; j++){
			if(j > 0)printf(" ");
			printf("%d", res[i][j]);
		}
		printf("\n");
	}
	
	return 0;
}


Measured memory_bytes: 1152
#include <iostream>
using namespace std;
 
int MOD = 1000000000 + 7;
 
long long solver(long long N) {
    long long res = N;
    while (N!=1) {
        N--;
        res = res * N;
        res = res % MOD;
    }
    return res;
}
 
int main()
{
    long long N, M, ans;
    cin >> N >> M;
    long long res1 = solver(N);
    long long res2 = solver(M);
    if (N==M) {
        ans = res1 * res2;
        ans %= MOD;
        ans *= 2;
        ans %= MOD;
    } else if (N==M-1 || N-1==M) {
        ans = res1 * res2;
        ans %= MOD;
    } else {
        ans = 0;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3608
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define repp(i,l,r,k)for(ll i=(l);i<(r);i+=(k))
#define INF ((1LL<<62)-(1LL<<31))
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define bit(n,m)(((n)>>(m))&1)
int upll(const void*a, const void*b){return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;}
int downll(const void*a, const void*b){return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;}
void sortup(ll*a,int n){qsort(a,n,sizeof(ll),upll);}
void sortdown(ll*a,int n){qsort(a,n,sizeof(ll),downll);}
ll pom(ll a,ll n,int m){ll x=1;for(a%=m;n;n/=2)n&1?x=x*a%m:0,a=a*a%m;return x;}
ll gcd(ll p,ll q){
	while(q){
		ll t=p%q;
		p=q;
		q=t;
	}
	return p;
}
//#define MOD 998244353
#define MOD 1000000007
#define invp(a,p)pom(a,p-2,p)

ll a[100010];
ll n;
int main(){
	scanf("%lld",&n);
	ll cnt[2]={};
	ll m=INF;
	rep(i,0,n){
		scanf("%lld",a+i);
		if(a[i]<0)cnt[i%2]++;
		m=min(m,llabs(a[i]));
	}
	ll ans=0;
	rep(i,0,n)ans+=llabs(a[i]);
	if(cnt[0]%2!=cnt[1]%2)ans-=2*m;	
	printf("%lld",ans);
}

Measured memory_bytes: 896