akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<stdlib.h>
#include<string>
#define f first
#define s second
using namespace std;

int T(string s){
  int time=0;
  string s1=s.substr(0,2);
  string s2=s.substr(3,2);
  time+=(60)*atoi(s1.c_str());
  time+=atoi(s2.c_str());
  return time;
}

int main()
{
  int N,n;
  string s1,s2;
  char c;

  while(1){
    cin>>N;
    if(N==0)break;
    int S[1000]={};
    vector<vector<pair<string,pair<int,int> > > > V(1000);
    for(int i=0;i<N;i++){
      cin>>s1>>s2>>c>>n;
      if(c=='I')S[n]=T(s2);
      else {
	V[n].push_back(make_pair(s1,make_pair(S[n],T(s2))));
	S[n]=0;
      }
    }
    for(int i=0;i<1000;i++)S[i]=0;
    for(int k=1;k<1000;k++){
      if(V[k].empty())continue;
      for(int i=0;i<V[0].size();i++){
	for(int j=0;j<V[k].size();j++){
	  if(V[0][i].f!=V[k][j].f)continue;
	  //0 1 1 0
	  if(V[0][i].s.f<=V[k][j].s.f && V[k][j].s.s<=V[0][i].s.s){
	    S[k]+=(V[k][j].s.s-V[k][j].s.f);
	  }
	  //1 0 0 1
	  else if(V[k][j].s.f<=V[0][i].s.f && V[0][i].s.s<=V[k][j].s.s){
	    S[k]+=(V[0][i].s.s-V[0][i].s.f);
	  }
	  //0 1 0 1
	  else if(V[0][i].s.f<=V[k][j].s.f && V[k][j].s.f <=V[0][i].s.s){
	    S[k]+=(V[0][i].s.s-V[k][j].s.f);
	  }
	  //1 0 1 0
	  else if(V[0][i].s.f<=V[k][j].s.s && V[k][j].s.s <=V[0][i].s.s){
	    S[k]+=(V[k][j].s.s-V[0][i].s.f);
	  }
	}
      }
    }
    int ans=0;
    for(int i=1;i<1000;i++)ans=max(ans,S[i]);
    cout<<ans<<endl;
/*
    for(int k=0;k<5;k++){
      for(int i=0;i<V[k].size();i++)cout<<V[k][i].f<<" "<<V[k][i].s.f<<" "<<V[k][i].s.s<<" "<<k<<endl;
      }*/
  }
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> data(N);
  for (int i = 0;i <N; i++){
	  cin >> data.at(i);
  }
  
  int res =0;
  
  for (int i = 0;i <N; i++){
	  res += data.at(i)-1;
  }

  cout << res << endl ;
}



Measured memory_bytes: 256
#include<stdio.h>
#define MAX 500000
#define SENTINEL 2000000000

int L[MAX/2+2], R[MAX/2+2];
int c;

void merge(int e[], int n, int left, int mid, int right){
  int i, j, k;

  int x = mid - left;
  int y = right - mid;
  for ( i = 0; i < x; i++ ) L[i] = e[left + i];
  for ( i = 0; i < y; i++ ) R[i] = e[mid + i];
  L[x] = R[y] = SENTINEL;
  i = j = 0;
  for ( k = left; k < right; k++ ){
    c++;
    if ( L[i] <= R[j] ){
      e[k] = L[i++];
    } else {
      e[k] = R[j++];
    }
  }
}

void mergeSort(int e[], int n, int left, int right ){
  int mid;
  if ( left+1 < right ){
    mid = (left + right)/2;
    mergeSort(e, n, left, mid);
    mergeSort(e, n, mid, right);
    merge(e, n, left, mid, right);
  }
}

main(){
  int e[MAX], n, i;
  scanf("%d", &n);
  c = 0;
  for ( i = 0; i < n; i++ ) {
    scanf("%d", &e[i]);
    if (e[i] >= SENTINEL ){
      return 1;
    }
  }
  mergeSort(e, n, 0, n);

  for ( i = 0; i < n; i++ ) {
    if ( i!=0 ) printf(" ");
    printf("%d", e[i]);
    }
  printf("\n");

  printf("%d\n", c);

  return 0;
}


Measured memory_bytes: 5636
#include<bits/stdc++.h>
#define rep(i, x) for(ll i = 0; i < x; i++)
#define rep2(i, x) for(ll i = 1; i <= x; i++)
#define all(a) (a).begin(),(a).end()
using ll = long long;
using ld = long double;
using namespace std;
const ll INF = 1000000000000000000;
const ll mod = 1000000007;
const ld pi = 3.141592653589793238;

ll modpow(ll x, ll y) {
	ll res = 1;
	while (y) {
		if (y % 2) { res *= x; res %= mod; }
		x = x * x % mod; y /= 2;
	}
	return res;
}

ll inx[123456], iny[123456];
signed main() {
	ll n, m; cin >> n >> m;
	vector<ll> x, y;
	rep(i, n) {
		cin >> inx[i];
		if (i != 0) {
			x.push_back(inx[i] - inx[i - 1]);
		}
	}
	rep(i, m) {
		cin >> iny[i];
		if (i != 0) {
			y.push_back(iny[i] - iny[i - 1]);
		}
	}
	ll ans1 = 0, ans2 = 0;
	ll cnt = 1; reverse(all(x));
	rep(i, n - 1) {
		x[i] = (x[i] * cnt) % mod; cnt++;
	}
	cnt = 1; reverse(all(x));
	rep(i, n - 1) {
		ans1 += (x[i] * cnt) % mod; cnt++; ans1 %= mod;
	}

	cnt = 1; reverse(all(y));
	rep(i, m - 1) {
		y[i] = (y[i] * cnt) % mod; cnt++;
	}
	cnt = 1; reverse(all(y));
	rep(i, m - 1) {
		ans2 += (y[i] * cnt) % mod; cnt++; ans2 %= mod;
	}

	cout << (ans1 * ans2) % mod << endl;
	return 0;
}

Measured memory_bytes: 6940
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
int a[2700000], b[2700000], d[2700000]; long long c, bit1[2700000], bit2[2700000], size_;
void add(int l, int r, long long x) {
	int R1 = l; while (R1 < size_) { bit1[R1] += (-1LL * x*(l - 1)); R1 += (R1&-R1); }
	int R2 = r + 1; while (R2 < size_) { bit1[R2] += x*r; R2 += (R2&-R2); }
	int R3 = l; while (R3 < size_) { bit2[R3] += x; R3 += (R3&-R3); }
	int R4 = r + 1; while (R4 < size_) { bit2[R4] += -x; R4 += (R4&-R4); }
}
long long sums(long long r) {
	long long R1 = 0, S1 = r; while (S1 >= 1) { R1 += bit1[S1]; S1 -= (S1&-S1); }
	long long R2 = 0, S2 = r; while (S2 >= 1) { R2 += bit2[S2]; S2 -= (S2&-S2); }
	return R1 + R2*r;
}
long long sum(long long l, long long r) {
	return sums(r) - sums(l - 1);
}
int main() {
	long long n, m, p1, p2, p3, p4; cin >> n >> m >> p1 >> p2 >> p3 >> p4;
	a[0] = p1; for (int i = 1; i < n; i++) { a[i] = (a[i - 1] * 58 + p2) % (m + 1); }
	b[0] = p3; for (int i = 1; i < m; i++) { b[i] = (b[i - 1] * 58 + p4) % (n + 1); }
	sort(a, a + n); sort(b, b + m);
	size_ = m + 3;
	for (int i = 1; i <= m; i++) { if (b[i - 1] >= 1)add(i, i, b[i - 1]); }
	add(m + 1, m + 1, 1145141919); add(m + 2, m + 2, 1145141919);
	for (int i = 0; i < n; i++) {
		int pos1 = m - a[i] + 1;
		int L = 1, R = pos1 + 2, M;
		while (true) {
			M = (L + R) / 2;
			long long T1 = sum(pos1, pos1) - sum(M - 1, M - 1);
			long long T2 = sum(pos1, pos1) - sum(M, M);
			if ((T1 >= 1 && T2 <= 0) || (M == 1 && T1 <= 0)) { break; }
			if (T1 <= 0)R = M;
			if (T2 >= 1)L = M;
		}
		L = pos1 - 1, R = m + 1; int M2;
		while (true) {
			M2 = (L + R) / 2;
			long long T1 = sum(M2, M2) - sum(pos1, pos1);
			long long T2 = sum(M2 + 1, M2 + 1) - sum(pos1, pos1);
			if ((T1 <= 0 && T2 >= 1) || (M2 == m && T2 <= 0)) { break; }
			if (T2 <= 0)L = M2;
			if (T1 >= 1)R = M2;
		}
		//for (int i = 1; i <= m; i++)cout << sum(i, i) << ' '; cout << endl;
		add(M2 + 1, m, -1);
		if (sum(pos1, pos1) == 0) { c += (m - M2); }
		else { add(M, M + (a[i] - (m - M2)) - 1, -1); c += a[i]; }
	}
	cout << c << endl;
	return 0;
}

Measured memory_bytes: 61760
#include <iostream>

using namespace std;

int max(int x,int y,int z){
    if(x < y){
        if(y < z)return z;
        else return y;
    }else{
        if(x < z)return z;
        else return x;
    }
}

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

Measured memory_bytes: 256
import numpy as np

class union_find:
    def __init__(self,N):
        self.r = np.ones(N)*-1
    
    def root(self,x):
        if self.r[x]<0:
            return int(x)
        else:
            self.r[x] = self.root(int(self.r[x]))
            return int(self.r[x])
        
    def unite(self,x,y):
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        else:
            self.r[x] += self.r[y]
            self.r[y] = int(x)
            return True
        
    def size(self,x):
        return -self.r[self.root(x)]


N,M = [int(i) for i in input().split()]

Union = union_find(N)
for i in range(M):
    x,y = [int(i) for i in input().split()]
    Union.unite(x-1,y-1)

Y = - min(Union.r)
print(int(Y))

Measured memory_bytes: 28496
import functools
import math

import os

INF = float('inf')


def inp():
    return int(input())


def inpf():
    return float(input())


def inps():
    return input()


def inl():
    return list(map(int, input().split()))


def inlf():
    return list(map(float, input().split()))


def inls():
    return input().split()


def debug(fn):
    if not os.getenv('LOCAL'):
        return fn

    @functools.wraps(fn)
    def wrapper(*args, **kwargs):
        print('DEBUG: {}({}) -> '.format(
            fn.__name__,
            ', '.join(
                list(map(str, args)) +
                ['{}={}'.format(k, str(v)) for k, v in kwargs.items()]
            )
        ), end='')
        ret = fn(*args, **kwargs)
        print(ret)
        return ret

    return wrapper


n = inp()
if n == 1:
    print ("Hello World")
    exit()

a = inp()
b = inp()
print(a+b)


Measured memory_bytes: 3572
def Good_Sequence(n , al):

    count = {}
    ans = 0

    for i in al:
        if i in count:
            count[i] += 1
        else:
            count[i] = 1

    for i in count.keys():
        key = int(i)
        value = int(count[i])
        if key != value:
            ans += value if value < key else abs(key - value)

    return ans

def main():
    n = int(input())
    al = list(map(int , input().split()))
    print(Good_Sequence(n , al))

if __name__ == '__main__':
    main()


Measured memory_bytes: 67112
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for (int i = 0; i < (int)(n); i++)
#define irep(i,a,b) for(typeof(i) i = (a); i < (b); ++i)
#define itrep(it,c) for(auto it = (c).begin(); it != (c).end(); ++it)


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

	int N, M;
	cin >> N >> M;
	vector<ll> H(N, 0);
	for (int i = 0; i < N; i++) {
		ll h;
		cin >> h;
		H.at(i) = h;
	}
	vector<int> F(N, 1);
	for (int i = 0; i < M; i++) {
		int A, B;
		cin >> A >> B;
		if (H.at(A - 1) >= H.at(B - 1)) F.at(B - 1) = 0;
		if (H.at(A - 1) <= H.at(B - 1)) F.at(A - 1) = 0;
	}
	int c = 0;
	for (int i = 0; i < N; i++) {
		c += F.at(i);
	}
	cout << c << endl;
	
	return(0);
}


Measured memory_bytes: 4520
#include<bits/stdc++.h>
    using namespace std;
    #define se second
    #define fi first
    #define ll long long
    #define ld long double
    #define pll pair<ll ,ll >
    #define ppll pair<ll, pll>
    #define pii pair<int, int> 
    #define mod 1000000007
    #define pb push_back
    ll power(ll a,ll b){
        ll res=1;
        while(b>0){
            if(b%2!=0) res=(res*a);
            a=(a*a);
            b/=2;
        }
        return res;
    }
    ll ncr(ll n,ll k){
        if(k==0||k==n) return 1ll;
        if(k>n-k) k=n-k;
        ll pro=1;
        for(ll i=0;i<k;i++){
            pro=(pro*(n-i))%mod;
            pro/=(i+1);
        }
        return (pro%mod);
    }
    int main(void){
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        ll a,b;
        cin>>a>>b;
        if(a>=1 && a<=9 && b>=1 && b<=9){
            cout<<a*b;
        }
        else cout<<"-1";
        return 0;
    }


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(m);(i)<(n);++(i))
#define rrep(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr ll INF = (ll)1e9;
constexpr double PI = 3.1415926535897932;
template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int a, b, c; cin >> a >> b >> c;
	cout << c << " " << a << " " << b << "\n";

	return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <algorithm>
#include <set>
#include <stack>
#include <deque>
#include <cmath>
#include <map>
using namespace std;
typedef long long LL;

int main() {
    int s, n=1000000;
    cin >> s;
    int ans, a=s;
    set<int> se;
    se.insert(s);
    for(int i=2; i<=n; i++) {
        if(a % 2 == 0) a = a / 2; 
        else a = 3 * a + 1;
        if(se.count(a) > 0) {
            ans = i;
            cout << ans << endl;
            return 0;
        }
        se.insert(a);
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
string S,T;
cin >> S >> T;
int counter = 0;
for(int i = 0;i < S.size();i++){
if(T.at(i) == S.at(i)){
counter++;}
else counter += 0;}
if(counter == S.size()){
cout << "Yes" << endl;}
if(counter != S.size()){
cout << "No" << endl;}}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
typedef     long long    ll;
typedef     vector<int> vi;
typedef     vector<long long> vl;
typedef     pair<int, int>pi;
typedef     pair<long long, long long>pl;
#define F   first
#define S   second
#define pb  push_back
#define     all(x)      x.begin() , x.end()
#define mp  make_pair
#define       FOR(i,a,b) for(i=a;i<=b;i++)
#define     mem(a)      memset(a , 0 ,sizeof a)
#define     memn(a)     memset(a , -1 ,sizeof a)
int main()
{
  int t = 1;
  //cin>>t;
  while (t--)
  {
    long long n, mx = INT_MIN, i, j, x, y;
    cin >> n;
    int a[n+2],b[n+2];
      for(i=0;i<n;i++)
      {
        cin>>x>>y;
        a[i]=(x+y);
        b[i]=(x-y);

      }
      sort(a,a+n);
      sort(b,b+n);
      cout<<max((a[n-1]-a[0]),(b[n-1]-b[0]))<<endl;
  }
}

Measured memory_bytes: 5120
use proconio::marker::Usize1;
use proconio::{fastout, input};
use std::cmp;

#[fastout]
fn main() {
    input! {
        n: usize,
        k: usize,
        ps: [Usize1; n],
        cs: [isize; n],
    }

    let mut max = std::isize::MIN;
    for start in 0..n {
        let mut i = start;
        let mut count = 0;
        let mut score = 0;
        let mut bit = BIT::new(&vec![0; n + 1]);
        loop {
            let next = ps[i];
            count += 1;
            score += cs[next];
            bit.add(count, cs[next]);

            // one cycle
            if next == start {
                if score > 0 {
                    // good cycle
                    if k % count != 0 {
                        let loop_score = (k / count) as isize * score;
                        let r = bit.max(0, k % count);
                        max = cmp::max(max, loop_score + r);
                    } else {
                        let loop_score = (k / count - 1) as isize * score;
                        let r = bit.max(0, count);
                        max = cmp::max(max, loop_score + r);
                    }
                } else {
                    // bad cycle
                    // don't return no move score
                    let big = bit.max(1, count);
                    max = cmp::max(max, big);
                }
                break;
            }

            i = next;
        }
    }
    println!("{}", max);
}

// BIT
use num_traits::{NumOps, Zero};
use std::cmp::Ord;
use std::marker::Copy;

pub struct BIT<T> {
    pub(crate) tree: Vec<T>,
}

impl<T> BIT<T>
where
    T: Copy + NumOps + Zero + Ord,
{
    pub fn new(data: &[T]) -> Self {
        let size = data.len();
        let mut bit = BIT {
            tree: vec![T::zero(); size],
        };
        for (i, &x) in data.iter().enumerate() {
            bit.add(i, x);
        }
        bit
    }

    pub fn size(&self) -> usize {
        self.tree.len()
    }

    pub fn add(&mut self, i: usize, x: T) {
        let size = self.size();
        let mut i = i;
        while i < size {
            self.tree[i] = self.tree[i] + x;
            i += (i + 1) & (!(i + 1)).wrapping_add(1);
        }
    }

    pub fn sub(&mut self, i: usize, x: T) {
        let size = self.size();
        let mut i = i;
        while i < size {
            self.tree[i] = self.tree[i] - x;
            i += (i + 1) & (!(i + 1)).wrapping_add(1);
        }
    }

    pub fn sum(&self, i: usize) -> T {
        let mut res = T::zero();
        let mut i = i as isize;
        while i >= 0 {
            res = res + self.tree[i as usize];
            i -= (i + 1) & -(i + 1);
        }
        res
    }

    pub fn max(&self, left: usize, right: usize) -> T {
        let mut max = self.sum(left);
        for i in left + 1..right + 1 {
            let now = self.sum(i);
            max = cmp::max(max, now);
        }
        max
    }
}


Measured memory_bytes: 2436
package main

import (
	"fmt"
	"math"
)

type Item struct {
	Value  int
	Weight int
}

func main() {
	var ItemNumber int
	var MaxWeight int
	const maxW = 100000

	sack := []Item{}

	fmt.Scanln(&ItemNumber, &MaxWeight)

	dp := make([]int, maxW+1)
	fill(dp, math.MaxInt64)
	dp[0] = 0

	for i := 0; i < ItemNumber; i++ {
		X := Item{}
		fmt.Scanln(&X.Weight, &X.Value)
		sack = append(sack, X)
	}
	value := Knapsack(sack, dp,ItemNumber,MaxWeight)
	fmt.Print(int64(value))
}

func Knapsack(sacks []Item,dp []int, N int, W int) int{
	const maxW = 100000
	for i := 0; i < N; i++ {
		w := sacks[i].Weight
		v := sacks[i].Value
		for j := maxW - v; j >= 0; j-- {
			if dp[j] == math.MaxInt64  {
				continue
			}

			if dp[j]+w <= W {
				dp[j+v] = min(dp[j+v], dp[j]+w)
			}
		}
	}
	i := maxW
	for dp[i] == math.MaxInt64 {
		i--
	}
	return i
}


func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func fill(a []int, x int) {
	for i := 0; i < len(a); i++ {
		a[i] = x
	}
}


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

int main() {
  int A,B;
  cin >> A >> B;
  int c=-1;
  for(int i=10*B;i<10*B+10;i++){
    int k=i*0.08;
    if(k==A){
      c=i;
      break;
    }
  }
  cout << c << endl;
}


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

using namespace std;

bool check(double mid, double a[], double l, int n){
	if(a[0]>mid || (l - a[n - 1])>mid) return false;

	for(int i = 0; i < n - 1; i++){
		if((a[i+1] - a[i]) > 2*mid) return false;
	}
	return true;
}
void solve(){
	string s, t ; cin>>s>>t;
	int ans = 0;
	for(int i = 0; i < s.length(); i++){
		if(s[i]!=t[i]){
			ans++;
		}
	}
	cout << ans << "\n";
}

int main(){
	#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int t=1;
	while(t--){
		solve();
	}
	return 0;
}


Measured memory_bytes: 3804
N,M=gets.split.map(&:to_i)
ab=[]
M.times do
  ab << gets.split.map(&:to_i).map{|x| x-1}
end
ab.sort_by!{|(a,b)| b}
bridge = -1
ans = 0
ab.each do |(a,b)|
  if bridge < a
    bridge = b-1
    ans += 1
  else
    next
  end
end
p ans

Measured memory_bytes: 12664
import java.util.Scanner;
import java.util.Arrays;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
import java.util.TreeMap;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int P = sc.nextInt();
        int Q = sc.nextInt();
        int R = sc.nextInt();
        sc.close();
        int ans;
        if (P<Q){
            if (Q<R){
                ans = P + Q;
            } else {
                ans = P + R;
            }
        } else {
            if (P<R){
                ans = P + Q;
            } else {
                ans = Q + R;
            }
        }
        System.out.println(ans);
    }
}

Measured memory_bytes: 23124
import java.lang.*;
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int result = a -b;
        if (result>=c){
            System.out.println(0);
        }else{
            System.out.println((c-result));
        }
        sc.close();
    }
}

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

int main(){
  string S;
  int Q;
  cin >> S >> Q;

  deque<char> ans;
  for(auto c:S){
    ans.push_back(c);
  }

  int query,q1; char c_q;
  bool is_flipped= false;
  for(int i=0; i<Q; i++){
    cin >> query;
    if(query==1){
      is_flipped= !is_flipped;
    }
    else{
      cin >> q1 >> c_q;
      if(q1==1){
        if(!is_flipped) ans.push_front(c_q);
        else            ans.push_back(c_q);
      }
      else{
        if(!is_flipped) ans.push_back(c_q);
        else            ans.push_front(c_q);
      }
    }
  }

  while(!ans.empty()){
    if(!is_flipped){
      cout << ans.front();
      ans.pop_front();
    }
    else{
      cout << ans.back();
      ans.pop_back();
    }
  }
  cout << endl;
}

Measured memory_bytes: 896
#include<iostream>
using namespace std;
int main(){
	int n;
	cin>>n;
	long long int sum=0;
	int a[200000];
	for(int i=0;i<n;i++){
		cin>>a[i];
		sum+=a[i];
	}
	sum-=a[n-1];
	long long int k=a[n-1];
	long long int min=abs(sum-k);
	for(int i=n-2;i>0;i--){
		sum-=a[i];
		k+=a[i];
		if(abs(sum-k)<min){
			min=abs(sum-k);
		}
		
	}
	cout<<min;
	cin>>min;
}

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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  vector<int> dis(3);
  dis[0] = abs(a - b);
  dis[1] = abs(b - c);
  dis[2] = abs(c - a);
  sort(dis.begin(), dis.end());
  cout << dis[0] + dis[1] << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fo(i,a,b) for(int i= a ; i < b ; ++i)
#define rep(i,n) fo(i,0,n)
#define pln(n) printf("%lld",n)
#define sll(n) scanf("%lld",&n)
#define ss(n) scanf("%s",n)
#define vi vector < int >
#define ll long long
#define pii pair < ll , ll >
#define pb push_back
#define mp make_pair
#define ull unsigned long long
#define INF 0x3f3f3f3f
#define dbg(x) { cout<< #x << ": " << (x) << endl; }
#define dbg2(x,y) { cout<< #x << ": " << (x) << " , " << #y << ": " << (y) << endl; }
#define dbg3(x,y,z) { cout<< #x << ": " << (x) << " , " << #y << ": " << (y) <<" , "<< #z <<": "<<(z)<<endl; }
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define vll vector<long long>
#define vvll vector<vector<long long>>
#define vvvll vector<vector<vector<ll>>>
#define si set<int>
#define tr(c, it) \
for(decltype(c.begin()) it = c.begin(); it!= c.end(); it++)
#define pis pair<int,string>
#define present(c, x) (c.find(x) != c.end())
#define cpresent(c, x) (find(all(c),x) != c.end())
#define  ones(x)  __builtin_popcount(x)
using namespace std;
int n, m, q,mx = 0;
int a[50],b[50],c[50],d[50];
vi a1(5000);
void dfs(int i, int index, vi& a1,int a[],int b[] ,int c[] ,int d[]){
    if(index == n + 1){
        // for(int i = 0; i < n; i++)cout << a1[i]<<" ";
        // cout<<endl;
        int curr =0;
        for(int k = 0; k < q; k++){
            //dbg3(a[k],b[i],c[i]);
            if(a1[b[k] - 1] - a1[a[k] - 1] == c[k])curr+=d[k];
        }
        //dbg(curr);
        if(curr > mx)mx = curr;
        return;
    }
    a1[index - 1] = i;
    for(int j = i; j <= m; j++){
        dfs(j, index + 1, a1,a,b,c,d);
    }
    

}

int main(){
    //int n , m;
    cin >> n >> m >> q;
    for(int i = 0; i < q; i++){
        cin >> a[i]>>b[i]>>c[i]>>d[i];
    }
    // for(int i = 0; i < q; i++){
    //     dbg3(a[i],b[i],c[i]);
    // }
    for(int i = 1; i <= m; i++){
        a1.clear();
        dfs(i, 1, a1,a,b,c,d);
    }
    cout << mx;


}

Measured memory_bytes: 3652
import math
import itertools

N = int(input())
P = input()
Q = input()

p_list = [int(i) for i in P.split(" ")]
q_list = [int(i) for i in Q.split(" ")]

n = []
for i in range(N):
    n.append(i+1)

p_num = 1
q_num = 1
for i in itertools.permutations(n):
    if list(i)==p_list:
        a = p_num
    if list(i)==q_list:
        b = q_num
    p_num += 1
    q_num += 1

print(abs(a-b))


Measured memory_bytes: 3064
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#ifndef LOCAL
#define endl '\n'
#endif

const int mod = 1e9 + 7;

int pwr(int a,int b) {
	int ans = 1;
	while(b) {
		if(b & 1) ans = (ans * 1LL * a) % mod;
		a = (a * 1LL * a) % mod;
		b >>= 1;
	}
	return ans;
}

const int N = 2e3 + 5;

int ans[N];

int main() {
	ios :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n, x, y;
	cin >> n >> x >> y;
	for(int i = 1; i <= n; i++) {
		for(int j = i + 1; j <= n; j++) {
			int d = j - i;
			d = min(d, abs(i - x) + 1 + abs(j - y));
			d = min(d, abs(i - y) + 1 + abs(j - x));
			ans[d]++;
		}
	}
	for(int i = 1; i < n; i++) {
		cout << ans[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 256
import qualified Data.ByteString.Lazy.Char8 as B
import Control.Monad
import Data.Maybe
import Data.List

bsReadInts :: B.ByteString -> [Int]
bsReadInts = map (fst . fromJust . B.readInt) . B.words

intersRange :: (Double, Double) -> (Double, Double) -> (Double, Double)
intersRange (arg1, sp1) (arg2, sp2) =
  chooseOne
    (sub (arg1, sp1) (arg2 - 2*pi, sp2))
    (sub (arg1, sp1) (arg2,        sp2))
    (sub (arg1, sp1) (arg2 + 2*pi, sp2))
  where
    sub :: (Double,Double) -> (Double,Double) -> (Double,Double)
    sub (arg1, sp1) (arg2, sp2)
      | left < right = (left, right - left)
      | otherwise    = (0, 0)
      where left = max arg1 arg2
            right = min (arg1 + sp1) (arg2 + sp2)
    chooseOne (arg1,sp1) (arg2,sp2) (arg3,sp3)
      | sp1 > 0 = (arg1,sp1)
      | sp2 > 0 = (arg2,sp2)
      | otherwise = (arg3,sp3)

getRange :: (Int,Int) -> (Int,Int) -> (Double, Double)
getRange (x1,y1) (x2,y2) =
  (arg1, pi)
  where
    arg1 = (atan2 (fromIntegral (y2-y1)) (fromIntegral (x2-x1))) + (pi / 2.0)

solve :: Int -> [[Int]] -> [Double]
solve n iss =
  map calcProb [0..n-1]
  where
    calcProb :: Int -> Double
    calcProb i = (snd $ cpsub (iss !! i) iss) / (2*pi)

    cpsub :: [Int] -> [[Int]] -> (Double, Double)
    cpsub [x0,y0] iss = foldl1' intersRange
                           [getRange (x0,y0) (x1,y1) | [x1,y1] <- iss,
                                                       (x0,y0) /= (x1,y1)]

main :: IO ()
main = do
  conts <- B.getContents
  let [n] : iss = map bsReadInts (B.lines conts)
      answer = solve n iss
  forM_ answer $ \d -> do
    putStrLn (show d)
    


Measured memory_bytes: 1020
use proconio::*;
use std::collections::*;

#[fastout]
fn main() {
    input! {
        n: usize,
    }

    let mut divs = vec![];
    let mut ddivs = vec![];
    for d in 2.. {
        if d * d > n {
            break;
        }
        if n % d == 0 {
            divs.push(d);
            divs.push(n / d);
        }
    }
    divs.push(n);

    for d in 2.. {
        if (n - 1) % d == 0 {
            ddivs.push(d);
            ddivs.push((n - 1) / d);
        }
        if d * d > n - 1 {
            break;
        }
    }
    ddivs.push(n - 1);

    let mut ans = vec![];
    for d in divs {
        let mut N = n;
        while N % d == 0 {
            N /= d;
        }
        if N % d == 1 {
            ans.push(d);
        }
    }

    for d in ddivs {
        if n % d == 1 {
            ans.push(d);
        }
    }

    let uniq: HashSet<usize> = ans.into_iter().collect();

    println!("{}", uniq.len());
}


Measured memory_bytes: 2192
import java.util.*;

public class Main
{
  static int n;
  static int[] h;
  static Integer[] memo;
  public static void main(String[] args)
  {
    Scanner in = new Scanner(System.in);
   	n = in.nextInt();
    h = new int[n];
    for (int i = 0; i < n; i++)
      h[i] = in.nextInt();
    
  	memo = new Integer[n];
    System.out.println(dp(0));
    in.close();
  }
  
  public static int dp(int at)
  {
    if (at > n)
      	return (int)1e9;
    if (at == n-1)
      	return 0;
 	if (at == n-2)
      	return (int)Math.abs(h[n-1]-h[n-2]);
   	if (memo[at] != null)
    	return memo[at];
    
    int one = (int)Math.abs(h[at+1]-h[at])+dp(at+1);
    int two = (int)Math.abs(h[at+2]-h[at])+dp(at+2);
    
    return memo[at] = Math.min(one, two);
  }
}

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

int main(){
    int a, b;
    cin >> a >> b;
    int ans = 0;
    if(a >= b){
        ans += a;
        a -= 1;
        if(a >= b){
            ans += a;
        }
        else{
            ans += b;
        }
    }
    else{
        ans += b;
        b -= 1;
        if(a >= b){
            ans += a;
        }
        else{
            ans += b;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < int(n); ++i)
#define REPE(i, a, b) for (int i = (a); i <= int(b); ++i)
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(), x.end()
#define PB push_back
#define EB emplace_back
using LL = long long;
using PII = pair<int, int>;
#define F first
#define S second

int n;
string s;
int a[100010];
void solve(int aa, int bb) {
  a[0] = aa, a[1] = bb;
  for (int i = 2; i < n; ++i) {
    int t = s[i - 1] == 'o' ? 0 : 1;
    a[i] = a[i-1] ^ a[i-2] ^ t;
  }
  REP(i, n) {
    int sum = a[i] ^ a[i == 0 ? n - 1 : i - 1] ^ a[i == n - 1 ? 0 : i + 1];
    int e = s[i] == 'o' ? 0 : 1;
    if (sum != e) return;
  }
  REP(i, n) putchar(a[i] ? 'W' : 'S');
  puts("");
  exit(0);
}

int main() {
  cin >> n >> s;
  REP(i, 2) REP(j, 2)
    solve(i, j);
  puts("-1");
  return 0;
}



Measured memory_bytes: 896
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(long long)(n);i++)
#define all(a) a.begin(), a.end()
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
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; }
 
const ll MOD=1e9+7;
const ll INF=1e18;
const int MAX=510000;
const double pi=acos(-1);
int dx[8] = {1,0,-1,0,1,1,-1,-1};
int dy[8] = {0,1,0,-1,-1,1,1,-1};
// int d[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false); 
  
  string s;
  cin >> s;
  int n = s.size();
  int ans = 0;
  rep(i,n){
    if(i&1){
      if(s[i]=='g')ans++;
    }
    else{
      if(s[i]=='p')ans--;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3772
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,Q;
  cin >> N >> Q;
  vector<tuple<int,int,int>> v;
  vector<int> d(Q);
  for (int i=0;i<N;i++){
    int S,T,X;
    cin >> S >> T >> X;
    S-=X;
    T-=X;
    v.push_back(make_tuple(S,1,X));
    v.push_back(make_tuple(T,0,X));
  }
  for (int i=0;i<Q;i++){
    cin >> d[i];
  }
  sort(v.begin(),v.end());
  multiset<int> s;
  int last=-1000000007;
  int t=0;
  for (int i=0;i<Q;i++){
    while (last<get<0>(v[t])&&get<0>(v[t])<=d[i]){
      if (get<1>(v[t])==1){
        s.insert(get<2>(v[t]));
      }
      else {
        s.erase(get<2>(v[t]));
      }
      t++;
    }
    if (!s.empty()){
      cout << *begin(s) << endl;
    }
    else {
      cout << -1 << endl;
    }
    last=d[i];
  }
}

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

int main()
{
    int A, B, C, D;

    cin >> A >> B >> C >> D;
    if ((A+B)>(C+D)) cout << "Left\n";
    else if ((A+B)==(C+D))cout << "Balanced\n";
    else cout << "Right\n";

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define MAX_N (123456)
typedef vector<int> VI;
#define pb push_back
#define all(vec) (vec).begin(),(vec).end()

bool prime[MAX_N + 1];

int main()
{
	for (int i = 2; i <= MAX_N; i++) prime[i] = true;
	for (int i = 2; i * i <= MAX_N; i++)
		for (int j = i * i; j <= MAX_N; j += i)
			prime[j] = false;
	
	int n, p;
	while (scanf("%d %d", &n, &p), n != -1){
		VI v;
		for (int i = n + 1, j = 0; j < p; i++){
			if (prime[i]){
				v.pb(i);
				j++;
			}
		}
		VI vv;
		for (int i = 0; i < p; i++){
			for (int j = i; j < p; j++){
				vv.pb(v[i] + v[j]);
			}
		}
		sort(all(vv));
		
		for (int i = 0; i < vv.size(); i++){
			//printf("%d ", vv[i]);
		}
		
		printf("%d\n", vv[p - 1]);
	}
	
	return 0;
}

Measured memory_bytes: 1388
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath> // 変数名にy1が使えなくなるかも…。
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <limits>
#include <functional>
#include <string>

typedef __int128_t int128_t;
std::istream &operator>>(std::istream& input, int128_t& value) { // int128_tの入力。入力が64bitに収まる前提。
    long long tmp; input >> tmp; value = tmp;
    return input;
}
std::ostream &operator<<(std::ostream& output, const int128_t value) { // int128_tの出力。出力が64bitに収まる前提。
    output << (long long)value;
    return output;
}

#define rep(i, begin, end) for(int64_t i = (begin); i <= (end); i++)
#define rev(i, begin, end) for(int64_t i = (begin); (end) <= i; i--)

std::string S;
int64_t K;

int main(int argc, char **argv){
    std::cin >> S;
    std::cin >> K;
    
    rep (i, 1, S.size()) {
        //std::cout << i << " " << S[i-1] << std::endl;
        if (S[i-1] != '1' && i <= K) {
            std::cout << S[i-1] << std::endl;
            return 0;
        }
    }

    std::cout << 1 << std::endl;

    return 0;
}



Measured memory_bytes: 384
package main

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

func wordScanner() *bufio.Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return sc
}

func get_int(sc *bufio.Scanner) int {
	sc.Scan()
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	sc := wordScanner()
	as := make([]int, n)
	bs := make([]int, m)
	cs := make([]int, m)
	for i := range as {
		as[i] = get_int(sc)
	}
	for i := range bs {
		bs[i] = get_int(sc)
		cs[i] = get_int(sc)
	}

	counter := make(map[int]int)
	for _, a := range as {
		counter[a]++
	}
	for i, c := range cs {
		counter[c] += bs[i]
	}

	nums := make([]int, 0)
	for c, _ := range counter {
		nums = append(nums, c)
	}
	sort.Sort(sort.Reverse(sort.IntSlice(nums)))

	sum := 0
	for _, num := range nums {
		if c := counter[num]; c <= n {
			sum += num * counter[num]
			n -= counter[num]
		} else {
			sum += num * n
			break
		}
	}
	fmt.Println(sum)
}


Measured memory_bytes: 18304
#include <bits/stdc++.h>
#include <array>
using namespace std;
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;
#define rep(i, n) for(UL i = 0; i < (n); i++)

struct Forest_Uni {
	vector<UL> v;
	void init(UL n) {
		v.clear();
		rep(i, n) v.push_back(i);
	}
	void add() { v.push_back(v.size()); }
	UL root(UL p) {
		if (v[p] == p) return p;
		return v[p] = root(v[p]);
	}
	void unite(UL a, UL b) {
		UL A = root(a);
		UL B = root(b);
		if (A != B) {
			v[A] = B;
		}
	}
};

struct Problem {

	void Solve() {
		UL N, M; cin >> N >> M;
		LL P; cin >> P;
		vector<vector<UL>> rE(N);
		vector<pair<pair<UL, UL>, LL>> E(M);
		rep(i, M) {
			UL a, b; LL c; cin >> a >> b >> c; a--; b--; c -= P;
			E.push_back({ {a, b}, c });
			rE[b].push_back(a);
		}
		const LL INF = -10000000000000;
		vector<LL> F(N, INF); F[0] = 0;
		vector<UL> R(N);
		{
			queue<UL> Q; Q.push(N - 1);
			while (Q.size()) {
				UL p = Q.front(); Q.pop();
				if (R[p]) continue;
				R[p] = 1;
				for (UL e : rE[p]) Q.push(e);
			}
		}
		rep(i, N - 1) {
			for (auto e : E) {
				UL u = e.first.first, v = e.first.second;
				LL d = e.second;
				if (F[u] == INF) continue;
				F[v] = max(F[v], F[u] + d);
			}
		}
		for (auto e : E) {
			UL u = e.first.first, v = e.first.second;
			LL d = e.second;
			if (F[u] == INF) continue;
			if (!R[v]) continue;
			if (F[v] < F[u] + d) { cout << -1 << endl; return; }
		}
		cout << max(0ll, F[N - 1]) << endl;
	}


	Problem();
};
int main() {
	unique_ptr<Problem> p(new Problem());
	p->Solve();
	return 0;
}
Problem::Problem() {
	cout << fixed << setprecision(10);
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define int long long
#define maxn 100001
using namespace std;
int n, prime[maxn], d[maxn], a[maxn], f[2001][2001], ans, cnt;
int val1[maxn], val2[maxn];
signed main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	 
	for(int i = 2; i <= 10000; i++){
		if(!d[i] && i != 2) prime[++cnt] = i;
		for(int j = i; j <= 10000; j += i) d[j] = 1;
	}
	cin >> n; 
	if (n==2) {
  		puts("4 7");
  		puts("23 10");
  		return 0;
  	}
	  cnt = 0;
	 for(int i = 1; i <= n ; i++)
    for(int j = 1; j <= n; j++)
      if (i + j & 1) {
      	if (!val1[i - j + n]) val1[i-j+n]=prime[++cnt];
      	f[i][j]=val1[i - j + n];
	  }
  for(int i = 1; i <= n; i++)
    for(int j = 1; j <= n ; j++)
      if (i + j & 1) {
      	if (!val2[i + j]) val2[i + j]=prime[++cnt];
      	f[i][j]*=val2[i + j];
	  }
	for(int i = 1; i <= n; i++)
		for(int j = 1; j <= n; j++)
		{
			if(i + j & 1) continue; ans = 1;
			if(f[i - 1][j]) ans = ans / __gcd(f[i - 1][j], ans) * f[i - 1][j];
			if(f[i + 1][j]) ans = ans / __gcd(f[i + 1][j], ans) * f[i + 1][j];
			if(f[i][j + 1]) ans = ans / __gcd(f[i][j + 1], ans) * f[i][j + 1];
			if(f[i][j - 1]) ans = ans / __gcd(f[i][j - 1], ans) * f[i][j - 1];
			f[i][j] = ans + 1;
		}
	for(int i  = 1; i <= n; i++){
		for(int j = 1; j <= n; j++) printf("%lld ", f[i][j]);
		puts("");
	}
	return 0;
}

Measured memory_bytes: 13568
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main(){
    let n = read::<i64>();
    let ans = if n == 3  || n == 5 || n == 7{
        "YES".to_string()
    }  else {
        "NO".to_string()
    };
    println!("{}",ans);
}

Measured memory_bytes: 4352
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>
#include<bitset>
#include<list>

using namespace std;

#define ll long long int

ll const MOD = 1000000007;
ll const INF = (long long int)1 << 61;

ll mypow(ll x,ll n,ll mod = MOD){
    ll ret = 1;
    while(n > 0){
        if(n&1){
            ret = (ret*x)%mod;
        }
        x = (x*x)%mod;
        n >>= 1;
    }
    return ret;
}

ll mygcd(ll a,ll b){
    if(b == 0)return a;
    return mygcd(b,a%b);
}

ll twoPow(ll shiftNum){
    return (1LL << (shiftNum - 1));
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    ll h,w,a,b;
    cin >> h >> w >> a >> b;

    vector<vector<ll>> ans(h,vector<ll>(w,0));

    for(int i = 0; i < b; i++){
        for(int j = 0; j < a; j++){
            ans[i][j] = 1;
        }
    }
    for(int i = b; i < h; i++){
        for(int j = a; j < w; j++){
            ans[i][j] = 1;
        }
    }

    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            cout << ans[i][j];
        }
        cout << endl;
    }

    return 0;
}

Measured memory_bytes: 9088
$num = gets.to_i

$matrix = []
$keisan = []
for i in 1..$num do
	row,column = gets.split.map(&:to_i)
	$matrix.push(row:row,column:column)	
end

for i in 1..$num do
	a = []
	for j in 1..$num do
	a.push(100000000)
	end
	$keisan.push(a)
end
for j in 0..$num -1 do
	$keisan[0][j] = 0
end
for j in 0..$num-2 do
	$keisan[1][j] = $matrix[j][:row]*$matrix[j][:column]*$matrix[j+1][:column]
end

for i in 2..$num-1 do
	for j in 0..$num-i-1 do
		for k in 0..i-1 do
			if $keisan[i][j] >  $keisan[k][j] + $keisan[i-k-1][j+k+1] + $matrix[j][:row] * $matrix[i+j][:column] * $matrix[j+k][:column] 
                $keisan[i][j] = $keisan[k][j] + $keisan[i-k-1][j+k+1] + $matrix[j][:row] * $matrix[i+j][:column] * $matrix[j+k][:column]
		    end
        end
	end
end

puts $keisan[$num-1][0]

Measured memory_bytes: 8936
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
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 int INF = 1000000000+7;

int main(){
    string s;
    cin >> s;
    
    for(int i = 0; i < s.size(); i++){
        s[i] = 'x';
    }

    cout << s << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <iomanip>

using namespace std;
typedef long long unsigned int ll;
typedef pair<int, int> P;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvdi(xs) sort(xs.begin(), xs.end(), std::greater<long>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)

#define rep(i,n) for(auto i=0; i<(n); i++)
#define isValidPoint(x, y, mx, my) x >= 0 && x  < mx && y >= 0 && y < my

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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }
 
  // for prime mod
  mint inv() const {
    return pow(mod-2);
  }
  mint& operator/=(const mint a) {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const {
    mint res(*this);
    return res/=a;
  }
};

struct Pony
{
    long a, b;
 
    Pony(long a_, long b_)
    {
        a = a_;
        b = b_;
    }
 
    bool operator<(const Pony &another) const
    {
        return b < another.b;
    };
};

int fac(int k){
    int sum = 0;
    for (int i = 1; i <= k; ++i)
    {
        sum += i;
    }
    return sum;
}

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

  int n;
  cin >> n;

  cout << (n*n*n) << endl;


}


Measured memory_bytes: 888
#include <bits/stdc++.h>
#define MAX_N 200000
using namespace std;
typedef multiset<int>::iterator IT;
template <class T> inline void read(T &x) {
	x = 0; int c = getchar(), f = 1;
	for (; !isdigit(c); c = getchar()) if (c == 45) f = -1;
	for (; isdigit(c); c = getchar()) (x *= 10) += f*(c-'0');
}
int n, m;
int a[MAX_N+5];
multiset <int> S;
int lft(int x) {
	int k = (int)log2(x);
	return (1<<(k+1))-x;
}
int main() {
	read(n);
	for (int i = 1; i <= n; i++)
		read(a[i]), S.insert(a[i]);
	sort(a+1, a+n+1);
	for (int i = n; i; i--)
		if (S.find(a[i]) != S.end()) {
			IT p = S.find(a[i]); S.erase(p);
			IT q = S.find(lft(a[i]));
			if (q == S.end()) continue;
			m++, S.erase(q);
		}
	return printf("%d\n", m), 0;
}

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


#define li          long long int
#define rep(i,to)   for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)    for(li i=(li)(start);i<((li)(to));i++)
#define pb          push_back
#define sz(v)       ((li)(v).size())
#define bgn(v)      ((v).begin())
#define eend(v)     ((v).end())
#define allof(v)    (v).begin(), (v).end()
#define dodp(v,n)       memset(v,(li)n,sizeof(v))
#define bit(n)      (1ll<<(li)(n))
#define mp(a,b)     make_pair(a,b)
#define rin rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)     idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)       idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)     idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)       idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)        idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)   for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)      idp p2((x).F, (x).S)
#define dump(x,n)   idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)  idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)    idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)   idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)   rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)   rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

string ans = "keyence";

inline bool solve(const string& s) {
    li n = sz(s);

    li erase_num = n - 7;
    if (n == 7) {
        return s == ans;
    }
    rep(i, n - erase_num) {
        string ss = s.substr(0, i) + s.substr(i + erase_num);
        if (ss == ans)return true;
    }
    return false;
}

int main() {
    string s;
    cin >> s;
    cout << (solve(s) ? "YES" : "NO") << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
int A, B;
int main(){
    cin >> A >> B;
    if(A % B == 0) cout << -1 << endl;
    else cout << A << endl;
    
    return 0;
}
          

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); i++)
#define REP1(i,a,b) for(int i=a; i<=(int)(b); i++)
#define ALL(x) begin(x),end(x)
#define PB push_back
using namespace std;
typedef int64_t LL;
typedef vector<int> VI;
typedef pair<int,int> PII;

template<class T> inline bool chmax( T &a, const T &b ) { return b>a ? a=b,true : false; }
template<class T> inline bool chmin( T &a, const T &b ) { return b<a ? a=b,true : false; }
template<class T> using MaxHeap = priority_queue<T>;
template<class T> using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template<class T, class F=less<T>> void sort_uniq( vector<T> &v, F f=F() ) {
    sort(begin(v),end(v),f);
    v.resize(unique(begin(v),end(v))-begin(v));
}

LL n;
int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n;

    LL ans=0;
    vector<LL> v;
    for(LL i=2; i*i<=n; i++) {
    	if ( n%i==0 ) {
    		v.push_back(i);
    		if ( n/i!=i ) v.push_back(n/i);
    	}
    }

    for(LL i:v) {
    	LL m=n;
    	while ( m%i==0 ) m/=i;
    	if ( m%i==1 ) ans++;
    }

    // for(LL i=2; i*i<=n; i++) {
    // 	if ( n%i==0 ) {
    // 		LL m=n;
    // 		while ( m%i==0 ) m/=i;
    // 		if ( m%i==1 )  {
    // 			ans++;
    // 			cout << i << endl;
    // 		}
    // 		if ( m%(n/m)==1 ) {
    // 			ans++;
    // 			cout << n/m << endl;
    // 		}
    // 	}
    // }
    // cout << ans << '\n';
    n--;
    for(LL i=1; i*i<=n; i++) {
    	if ( n%i==0 ) {
    		if (i>1) ans++;
    		if (n/i!=i && n/i>1) ans++;
    	}
    }
    // LL ans1=0;
    // for(LL i=2; i<=n+1; i++) {
    // 	LL m=n+1;
    // 	while ( m>=i ) {
    // 		if ( m%i==0 ) m/=i;
    // 		else m-=i;
    // 	}
    // 	if ( m==1 ) {
    // 		cout << i << endl;
    // 		ans1++;
    // 	}
    // }
    // cout << ans << '\n';

    cout << ans+1 << '\n';
    return 0;
}

Measured memory_bytes: 384