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

void inc(string &s, int pos){
    s[pos]++;
    if(pos == 0)return;
    for(int i = 0; i < pos; i++){
        if(s[i] + 1 >= s[pos])return;
    }
    s[pos] = 'a';
    inc(s, pos - 1);
}

int main(){

    int N;
    cin >> N;
    string ans(N, 'a');
    while(ans[0] == 'a'){
        cout << ans << endl;
        inc(ans, N - 1);
    }

    return 0;
}

Measured memory_bytes: 1536
fun main(args : Array<String>) {
  val (sx, sy, tx, ty) = readLine()!!.split(" ").map {x -> x.toInt()} 
  println( "U".repeat(ty - sy) + "R".repeat(tx - sx) + "D".repeat( ty - sy ) + "L".repeat(tx - sx) + 
            "L" + "U".repeat(ty - sy + 1) + "R".repeat(tx - sx + 1)  + "D" + 
            "R" + "D".repeat(ty - sy + 1) + "L".repeat(tx - sx + 1)  + "U")
}

Measured memory_bytes: 36024
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#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 srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define svec(v) cout<<#v<<":";rep(kbrni,v.size())cout<<" "<<v[kbrni];cout<<endl
#define sset(s) cout<<#s<<":";each(kbrni,s)cout<<" "<<kbrni;cout<<endl
#define smap(m) cout<<#m<<":";each(kbrni,m)cout<<" {"<<kbrni.first<<":"<<kbrni.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100005;

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    multiset<int> st;
    rep(i,n){
        int a;
        cin >> a;
        st.insert(a);
    }
    int mx = *(--st.end());
    if(mx > n){
        cout << "Impossible\n";
        return 0;
    }
    if(mx % 2){
        srep(i,(mx+1)/2,mx+1){
            rep(j,2){
                auto it = st.find(i);
                if(it == st.end()){
                    cout << "Impossible\n";
                    return 0;
                }else{
                    st.erase(it);
                }
            }
        }
        each(it,st){
            if(it <= (mx+1)/2 || it > mx){
                cout << "Impossible\n";
                return 0;
            }
        }
        cout << "Possible\n";
    }else{
        srep(i,mx/2,mx+1){
            auto it = st.find(i);
            if(it == st.end()){
                cout << "Impossible\n";
                return 0;
            }else{
                st.erase(it);
            }
        }
        srep(i,mx/2+1,mx+1){
            auto it = st.find(i);
            if(it == st.end()){
                cout << "Impossible\n";
                return 0;
            }else{
                st.erase(it);
            }
        }
        each(it,st){
            if(it <= mx/2 || it > mx){
                cout << "Impossible\n";
                return 0;
            }
        }
        cout << "Possible\n";
    }
    return 0;
}


Measured memory_bytes: 256
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors
n, m  = map(int, input().split())
divs = make_divisors(m)
divs.sort()
ans = 0
for d in divs:
    if m // d >= n:
        ans = d
print(ans)

Measured memory_bytes: 63904
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  int a, b;
  cin >> a >> b;
  if (a % 2 != b % 2) {
    cout << "IMPOSSIBLE" << endl;
  } else {
    cout << (a + b) / 2 << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b;
  cin >> a >> b;
  int x=a+b;
  int y=a-b;
  int z=a*b;
  if (x>=y && x>=z){
    cout << x << endl;
  }
  else if (y>=x && y>=z){
    cout << y << endl;
  }
  else{
    cout << z << endl;
  }
}

Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, const char * argv[]) {
    int a, b, c, i, n=0;
    
    scanf("%d %d %d", &a, &b, &c);
    
    for(i=a; i<=b; i++){
        if(c%i == 0){
            n++;
        }
    }
    printf("%d\n", n);
    return 0;
}


Measured memory_bytes: 2108
#include <iostream>
using namespace std;
int main()
{
	long int a,b,z;
	
	cin>>a>>b;
	
	z=a-b;
	
	if(z<0){
		z=0;
	}else{
		z=a-b;
	}
	
	cout<<z<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <iostream>
#include <tuple>
#include <vector>
using namespace std;
#define REP(i, n) for (int i = 0; i < static_cast<int>(n); ++i)
const int INF = 1 << 30;

int main() {
  int N, ma, mb;
  cin >> N >> ma >> mb;
  int mincost = INF;
  vector<tuple<int, int>> x_minus, x_plus;
  int xmax = 0;
  REP(i, N) {
    int a, b, c;
    cin >> a >> b >> c;
    int x = a * mb - ma * b;
    if (x == 0) {
      mincost = min(mincost, c);
    } else if (x < 0) {
      x_minus.emplace_back(c, -x);
    } else {
      x_plus.emplace_back(c, x);
    }
    xmax = max(xmax, abs(x));
  }
  vector<int> dp_plus(xmax + 1, INF), dp_minus(xmax + 1, INF);
  dp_plus[0] = dp_minus[0] = 0;
  for (auto& cx : x_plus) {
    int ci = get<0>(cx), xi = get<1>(cx);
    for (int w = xmax - xi; w >= 0; --w) {
      dp_plus[w + xi] = min(dp_plus[w + xi], dp_plus[w] + ci);
    }
  }
  for (auto& cx : x_minus) {
    int ci = get<0>(cx), xi = get<1>(cx);
    for (int w = xmax - xi; w >= 0; --w) {
      dp_minus[w + xi] = min(dp_minus[w + xi], dp_minus[w] + ci);
    }
  }
  for (int w = 1; w <= xmax; ++w) {
    int wp = dp_plus[w], wm = dp_minus[w];
    if (wp != INF && wm != INF && mincost > wp + wm) {
      mincost = wp + wm;
    }
  }
  cout << (mincost == INF ? -1 : mincost) << endl;
}


Measured memory_bytes: 256
# @author 

import sys

class ICoins:
    def solve(self):
        n = int(input())
        p = [float(_) for _ in input().split()]
        dp = [0.0] * (n + 1)
        # dp[i][j] probability of having i heads after j tosses
        dp[0] = 1
        for j in range(1, n + 1):
            for i in range(j, 0, -1):
                dp[i] = dp[i] * (1 - p[j - 1]) + dp[i - 1] * p[j - 1]
            dp[0] = dp[0] * (1 - p[j - 1])
        ans = 0
        for i in range(n + 1):
            if i > n - i:
                ans += dp[i]
        print(ans)


solver = ICoins()
input = sys.stdin.readline

solver.solve()


Measured memory_bytes: 41324
#include<stdio.h>
int main()
{
  char S[4];
  char T[4] ;
  gets(S);
  gets(T);
 int count=0;
  for(int i=0;i<3;i++)
  {
   if (S[i]==T[i])
              count++;
  }

printf("%d",count);











}


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

#define ff first
#define ss second
#define PI acos(-1)
#define pb push_back
#define int long long
#define ld long double
#define sp fixed<<setprecision
#define bp __builtin_popcountll
#define all(x) x.begin(),x.end()
#define pii pair<long long,long long>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

int MOD = (1e9)+7;
const int N = 1e6+5;

signed main()
{
    FAST
    int tc=1;
    //cin>>tc;
    for(int ti=1;ti<=tc;ti++)
    {
        string s;
        cin>>s;
        if(s[1] == 'B')s[1]='R';
        else s[1]='B';
        cout<<s;
    }
    return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define repk(i,m,n) for(ll i=m;i<n;i++)
#define IOS ios::sync_with_stdio(false);cin.tie(0);
#define F first
#define S second
typedef long long ll;
typedef long double ld;
using namespace std;
const int MOD1=1e9+7;
const int MOD2=998244353;
const int INF=2*1e9;
ll n;
void dfs(string s,ll k)
{
    if(s.size()==n) cout<<s<<"\n";
    else
    {
        char c='a';
        rep(i,k+1)
        {
            char t=c+i;
            string sp=s;
            sp.insert(sp.end(),1,t);
            if(i==k) dfs(sp,k+1);
            else dfs(sp,k);
        }
    }
}
int main()
{
    cin>>n;
    dfs("",0);
}


Measured memory_bytes: 1536
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int dp[1000][1000];

int main() {
    int n, x;
    cin >> n >> x;
    int cnt = 0;
    map<string, int> mp;
    vector<string> a;
    for (int i = 0; i < n; ++i) {
        vector<int> v;
        int m;
        cin >> m;
        for (int j = 0; j < m; ++j) {
            string s;
            cin >> s;
            if(!mp.count(s)){
                v.emplace_back(cnt);
                a.emplace_back(s);
                mp[s] = cnt++;
            }else {
                v.emplace_back(mp[s]);
            }
        }
        for (int j = 0; j < m; ++j) {
            for (int k = 0; k < m; ++k) {
                if(j != k){
                    dp[v[j]][v[k]]++;
                }
            }
        }
    }
    vector<pair<string, string>> ans;
    for (int j = 0; j < cnt; ++j) {
        for (int k = 0; k < cnt; ++k) {
            if(a[j] < a[k] && dp[j][k] >= x){
                ans.emplace_back(a[j], a[k]);
            }
        }
    }
    cout << ans.size() << "\n";
    sort(ans.begin(),ans.end());
    for (auto &&l : ans) {
        cout << l.first << " " << l.second << "\n";
    }
    return 0;
}


Measured memory_bytes: 7208
"use strict";
const Main = (input) =>{
	let xs = input.trim().split(' '); 
    let a = xs[0].charAt(0).toUpperCase();
    let b = xs[1].charAt(0).toUpperCase();
    let c = xs[2].charAt(0).toUpperCase();
    console.log(a+b+c);        
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, ll>;

using namespace std;

string S;
ll k;
int N;
P memo[2002][2002];

P dfs(int l, int r){
	if(l == r){
		return P(1, 1);
	}else if(r < l){
		return P(0, 1);
	}
	if(memo[l][r].first != -1) return memo[l][r];
	P ret;
	if(S[l] == S[r]){
		P res = dfs(l + 1, r - 1);
		ret = P(res.first + 2, res.second);
	}else{
		P resl = dfs(l + 1, r);
		P resr = dfs(l, r - 1);
		if(resl.first == resr.first){
			ret = P(resl.first + 2, min(k + 1, resl.second + resr.second));
		}else{
			ret = min(resl, resr);
			ret.first += 2;
		}
	}
	memo[l][r] = ret;
	return ret;
}

string ans;
int ansl, ansr;
ll cnt;

void build_ans(int l, int r, ll cur){
	if(l == r){
		ans[ansl] = S[l];
		return;
	}else if(r < l){
		return;
	}
	if(S[l] == S[r]){
		ans[ansl++] = S[l];
		ans[ansr--] = S[l];
		build_ans(l + 1, r - 1, cur);
	}else{
		P resl = dfs(l + 1, r);
		P resr = dfs(l, r - 1);

		if(resl.first == resr.first){
			if(S[l] < S[r]){
				if(k <= cur + resl.second){
					ans[ansl++] = S[l];
					ans[ansr--] = S[l];
					build_ans(l + 1, r, cur);
				}else{
					ans[ansl++] = S[r];
					ans[ansr--] = S[r];
					build_ans(l, r - 1, cur + resl.second);
				}
			}else{
				if(k <= cur + resr.second){
					ans[ansl++] = S[r];
					ans[ansr--] = S[r];
					build_ans(l, r - 1, cur);
				}else{
					ans[ansl++] = S[l];
					ans[ansr--] = S[l];
					build_ans(l + 1, r, cur + resr.second);
				}
			}
		}else if(resl.first < resr.first){
			ans[ansl++] = S[l];
			ans[ansr--] = S[l];
			build_ans(l + 1, r, cur);
		}else{
			ans[ansl++] = S[r];
			ans[ansr--] = S[r];
			build_ans(l, r - 1, cur);
		}
	}
}

int main() {
	cin >> S >> k;
	N = S.size();

	for(int i=0;i<=N;i++){
		for(int j=0;j<=N;j++){
			memo[i][j] = P(-1, -1);
		}
	}
	P res = dfs(0, N - 1);
	if(res.second < k){
		cout << "NONE" << endl;
	}else{
		ans.assign(res.first, '.');
		ansl = 0;
		ansr = res.first - 1;
		build_ans(0, N - 1, 0);
		cout << ans << endl;
	}

	return 0;
}

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

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


Measured memory_bytes: 1664
#include<bits/stdc++.h>
#define ll long long
#define debug(a) cout<<a<<endl
#define pii pair<int,int>
#define maxn 100009
#define MOD 1000000007
using namespace std;
ll dp[maxn];
ll n,m;
ll vet[maxn];
ll solve(int id){
    if(id>n)return 0;
    if(vet[id]==1)return 0;
    if(id==n)return 1;
    if(dp[id]!=-1)return dp[id];
    dp[id]=((solve(id+1)%MOD)+(solve(id+2)%MOD))%MOD;
    return dp[id];
}
int main(){
    ios::sync_with_stdio(false);
    cin>>n>>m;
    memset(vet,0,sizeof vet);
    memset(dp,-1,sizeof dp);
    for(int i=0;i<m;i++){
        int a;
        cin>>a;
        vet[a]=1;
    }
    cout<<solve(0)<<'\n';
    return 0;
}
///usar double sempre ou long double
///pensar em casos que coisas dao negativas
///N esquecer de limpar as coisas em quest de varios testes
///OLHAR A COMPLEXIDADE PRA VER SE N PASSA POR BRUTE FORCE OU BRUTE FORCE COM ALGUMAS OTIMIZACOES

Measured memory_bytes: 4992
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s;
    int k,l;
    cin>>s;
    k = s.size();

    set<char>s1;
    for(int i = 0; i < k; i++)
    {
        s1.insert(s[i]);
    }
    if(s1.size()==k)
    {
        cout<<"yes\n";
    }
    else
    {
        cout<<"no\n";
    }

}


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

int main()
{
    int N, S = 0;
    cin >> N;
    vector<int> A(N + 2);
    A[0] = 0;
    A[N + 1] = 0;
    rep(i, N)
    {
        cin >> A[i];
    }
    for (int i = 0; i < N + 1; i++)
    {
        S += abs(A[i] - A[i + 1]);
    }
    for (int i = 1; i < N + 1; i++)
    {
        cout << S + abs(A[i - 1] - A[i + 1]) - abs(A[i - 1] - A[i]) - abs(A[i] - A[i + 1]) << endl;
    }
}

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

int main() {
  int K, A, B;
  cin >> K >> A >> B;
  for (int i = A; i <= B; i++) {
    if (i % K == 0) {
      cout << "OK" << endl;
      return 0;
    }
  }
  cout << "NG" << endl;
}

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

// clang-format off
template <typename T> T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); }
template <typename T> T lcm(T a, T b) { return a * b / gcd(a, b); }
template <typename T> T clamp(T val, T min, T max) { return val < min ? min : (max < val ? max : val); }
template <typename T> size_t max_index(T begin, T end) { return distance(begin, max_element(begin, end)); }
template <typename T> size_t min_index(T begin, T end) { return distance(begin, min_element(begin, end)); }
// clang-format on

#define int long long
#define YES "YES"
#define NO  "NO"

using namespace std;

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

  bool flag = true;
  int num = 0;

  int n; cin >> n;
  int a; cin >> a;

  cout << n * n - a << endl;
  
  // cout << num << endl;
  // cout << (flag ? YES : NO) << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int N;
    scanf("%d",&N);
    ll sum = 0;
    unordered_map<ll,ll> mp;
    rep(i,0,N){
        int X;
        scanf("%d",&X);
        sum += X;
        mp[sum]++;
    }
    ll ans = 0;
    for(auto p:mp){
        if(p.first == 0)ans += p.second;
        ans += (p.second * (p.second - 1) ) / 2;
    }
    cout << ans << endl;
}


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

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
    
    int n,a,b;
    cin>>n>>a>>b;int x[n];
    for(int i=0;i<n;i++)
        cin>>x[i];
    sort(x,x+n);
    int t1=lower_bound(x,x+n,a+1)-x;
    int t2=lower_bound(x,x+n,b+1)-x;
    cout<<min((n-t2),min((t1),(t2-t1)));
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <map>
#include <cstdio>
#include <string>
#include <cstdlib>
#include <cstring>
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
const long double EPS = 1e-9;
const ll mod = 1e9 + 7;
const ll INF = 1e9;

#define rep(i, n) for(ll i = 0; i < n ; i++ )
#define For(i, a, b) for(ll i = (a); i < (b) ; i++ )
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()

const ll MAX_N = 100000;

int main(void){
    ll D,N;
    ll answer = 1;
    
    cin >>D>> N;
    
    rep(i, D) answer *= 100; 
    if (N < 100) cout << answer * N << endl;
    else cout << answer * 101 << endl;

    return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define rint register int 
#define ll long long 
using namespace std;
const int mod = 1e9+7;
ll ksm(ll x,ll y){
	ll res=1;
	while(y){
		if(y&1) res=res*x%mod;
		x=x*x%mod;y>>=1;
	}return res;
}
ll fac[3000100],Ifac[3010000];
inline ll C(ll x,ll y){
	return fac[x]*Ifac[y]%mod*Ifac[x-y]%mod;
}
int n;
int main(){
	cin>>n;
	fac[0]=Ifac[0]=1;
	for(rint i=1;i<=2*n;++i) fac[i]=fac[i-1]*i%mod;
	Ifac[2*n]=ksm(fac[2*n],mod-2);
	for(rint i=2*n-1;i;--i) Ifac[i]=Ifac[i+1]*(i+1)%mod;
	ll ans=0,las=0;
	for(rint i=(n+1)/2;i<=n-1;++i) {
		ll tmp=1ll*C(i-1,n-i-1)*fac[i]%mod*fac[n-1-i]%mod;
		ans=ans+(tmp-las)*i%mod+mod;
		ans%=mod;
		las=tmp; 
	}cout<<ans;
	return 0;
} 

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

using namespace std;
typedef long long ll;

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

Measured memory_bytes: 3712
import java.util.Scanner;

public class Main {
	void run() {
		Scanner scan = new Scanner(System.in);
		char[] alphabet = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};
		int[] count = new int[27];

		while (scan.hasNext()) {
			String str = scan.next();
			char[] schar = str.toCharArray();
			for (char c : schar) {
				if (Character.isUpperCase(c))
					c = Character.toLowerCase(c);
				for (int i = 0; i < alphabet.length; i++)
					if (c == alphabet[i]) count[i] += 1;
			}
		}
		for (int i = 0; i < count.length - 1; i++)
			System.out.printf("%c : %d\n", alphabet[i], count[i]);
	}
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 26224
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i ,n) for(int i = 0 ; i < (n) ; i ++ )
#define all(x) (x).begin(),(x).end()
using ll = long long;
using namespace std;

int main() {
  int n;
  cin>>n;
  vector<int> a(n);
  rep(i,n) cin>>a[i];
  int count=0;
  rep(i,n){
    if(a[i]<0) count++;
      
  }
  ll ans=0;
  rep(i,n){
         a[i]=abs(a[i]);
      ans+=a[i];
  }
  
  if(count%2==0){
       cout<<ans<<endl;
  }
  else{
    sort(all(a));
    cout<<ans-2*a[0]<<endl;
    
  }
}




Measured memory_bytes: 640
let odd n = if n mod 2 = 0 then 0 else 1

let f n = (odd ((n + 1) / 2)) lxor (if (n + 1) mod 2 = 0 then 0 else n)

let f a b = f (a - 1) lxor f b

let _ =
  let a, b = Scanf.scanf "%d %d\n" (fun a b -> (a, b)) in
  f a b |> print_int

Measured memory_bytes: 384
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.LinkedList;
import java.util.function.DoubleToIntFunction;

public class Main {
    public static void main(String[] args) {

        // Listに標準入力の値を取得
        LinkedList<String> scList = new LinkedList<>();
        try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
            while (br.ready()) {
                String[] lineArray = br.readLine().split(" ");
                Arrays.<String>stream(lineArray).forEach(s -> scList.add(s.trim()));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }

        int n = Integer.parseInt(scList.pop());
        scList.pop();

        for (String day :
                scList) {
            n = n - Integer.parseInt(day);
        }

        if (n >= 0) {
            System.out.println(n);
        } else {
            System.out.println(-1);
        }
    }
}

Measured memory_bytes: 35840
#include <bits/stdc++.h>
typedef long long int ll;
const ll N=2*1e5+10;
using namespace std;
ll a[N];


int main() {
	// your code goes here
	// ios_base::sync_with_stdio(false);
	// cin.tie(NULL);
	// cout.tie(NULL);
	ll n,k;
    cin>>n>>k;
   
    for(int i=1;i<=n;i++)
    cin>>a[i];
    vector<ll>c;
    vector<int>vis(n+1,0);
    int next=1;
    while(!vis[a[next]])
    {
    	vis[a[next]]=1;
    	c.push_back(a[next]);
    	next=a[next];
    }
    ll z=c.size();
    // for(auto i:c)
    // cout<<i<<"\n";
    if(k<=z)
    {
    	cout<<c[k-1];
    	return 0;
    }
   
    ll idx=0;
    for(int i=0;i<z;i++)
    {
    	if(c[i]==a[c[z-1]])
    	{
    		idx=i;
    		break;
    	}
    }
    ll size=k-idx;
  
    	ll r=size%(z-idx);
    	//cout<<r<<"\n";
    	
    	if(r==0)
    	cout<<c[z-1];
    	else
    	cout<<c[idx+r-1];
    
   
	
	
	return 0;
}

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


int main() {
  int a, b, h;
  cin >> a >> b >> h;
  int ans;
  ans = (a+b)*h/2;
    
  cout << ans << endl;  
  return 0;
  
}

Measured memory_bytes: 256
S=input()
n=0
#print(S)
while S[:]!=S[:n]:
    if S[n:n+7]=="dreamer" and S[n:n+8]!="dreamera":
        n+=7 #dreamer
    elif S[n:n+5]=="dream":
        n+=5 #dream
    elif S[n:n+5]=="erase" and S[n:n+6]!="eraser":
        n+=5 #erase
    elif S[n:n+6]=="eraser":
        n+=6 #eraser
    #elif S[:]==S[:n-1]:
        #print("YES")
        #exit()
    else:
        print("NO")
        exit()
else:
    print("YES")

Measured memory_bytes: 3188
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#include <map>
#include <utility>

using namespace std;

int main(){
  int n;
  cin >> n;
  vector<int> v(n);
  vector<int> v0(n/2);
  vector<int> v1(n/2);
  vector<int> v0x(100001);
  vector<int> v1x(100001);
  for(int i=0;i<n;i++){
    cin >> v.at(i);
    if(i%2==0){
      v0.at(i/2)=v.at(i);
      v0x.at(v.at(i))++;
    }
    else{
      v1.at(i/2)=v.at(i);
      v1x.at(v.at(i))++;
    }
  }

  bool flag=false;
  for(int i=0;i<n;i++){
    if(v.at(0)!=v.at(i))  flag=true;
  }
  if(!flag){
    cout << n/2 << endl;
    return 0;
  }

  int v0max=0,v1max=0;
  int v0maxn=0,v1maxn=0;
  for(int i=0;i<100001;i++){
    if(v0max<v0x.at(i)){
      v0max=v0x.at(i);
      v0maxn=i;
    }
    if(v1max<v1x.at(i)){
      v1max=v1x.at(i);
      v1maxn=i;
    }
  }

  if(v0maxn!=v1maxn){
    cout << (n/2-v0max) + (n/2-v1max) << endl;
  }
  if(v0maxn==v1maxn){
    sort(v0x.begin(),v0x.end());
    sort(v1x.begin(),v1x.end());
    reverse(v0x.begin(),v0x.end());
    reverse(v1x.begin(),v1x.end());
    cout << n-max(v0x.at(0)+v1x.at(1),v0x.at(1)+v1x.at(0)) << endl;
    
  }

  return 0;
}


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

using namespace std;

/* g++ -g -fsanitize=address -lasan -std=c++11 -Dfoo_ */

/* freopen("input.txt", "rt", stdin); */
/* freopen("output.txt", "wt", stdout); */

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

const int inf = 1e9;
const int maxn = 2e5+5;
int n, dist[maxn]; VI G[maxn];

void bfs(const int r)
{
    FOR(i,1,n+1)
        dist[i] = inf;
    dist[r] = 1;
    queue<int> Q; Q.push(r);
    while (Q.size()) {
        const int u = Q.front(); Q.pop();
        FOR_ALL(v,G[u]) {
            const int d = dist[u]+1;
            if (d < dist[*v]) {
                dist[*v] = d;
                Q.push(*v);
            }
        }
    }
}

int main()
{
#ifdef foo_
    freopen("foo", "rt", stdin);
#endif
    ios::sync_with_stdio(false);
    while (cin >> n) {
        FOR(i,1,n+1)
            G[i].clear();
        FOR(i,0,n-1) {
            int a,b; cin >> a >> b;
            G[a].push_back(b);
            G[b].push_back(a);
        }
        int r = 1;
        bfs(r);
        FOR(i,1,n+1) if (dist[i] < inf && dist[r] < dist[i])
            r = i;
        bfs(r);
        int d = 0;
        FOR(i,1,n+1) if (dist[i] < inf)
            d = max(d,dist[i]);
        const string ans = (d == 1)
            ? "First"
            : (d-2)%3 ? "First" : "Second";
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 13556
# A - DDCC Finals
def main():
    X, Y = map(int, input().split())
    prize = 0
    for i in (X, Y):
        if i == 1:
            prize += 300000
        elif i == 2:
            prize += 200000
        elif i == 3:
            prize += 100000
    if X == Y and X == 1:
        prize += 400000
    print(prize)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    char a,b;
    cin>>a>>b;
    char ans;
    if(a=='H')
    {
        ans=b;
    }
    else
    {
        if(b=='H')
            ans='D';
        else
            ans='H';
    }
    cout << ans << endl;
    return 0;
}


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


void solve()
{
	int  n; cin >> n;
	string status;
	int ac = 0,wa = 0,tle = 0,re = 0;
	for(int i=0;i<n;++i){
		cin >> status;
		if (status == "AC"){
			ac++;
		}
		else if (status == "WA"){
			wa++;
		}
		else if (status == "TLE"){
			tle++;
		}
		else if (status == "RE"){
			re++;
		}
	}
	cout << "AC x " <<  ac << '\n';
	cout << "WA x " <<  wa << '\n';
	cout << "TLE x " <<  tle << '\n';
	cout << "RE x " <<  re << '\n';
}

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

Measured memory_bytes: 3536
#include<stdio.h>

int main(){

    int A, B, C;

    scanf("%d %d", &A, &B);

    C = A + B;

    if(C >= 0 && C <= 23){
        printf("%d", C);
    }
    else if(C >= 0 && C >= 23){
        C = C - 24;
        printf("%d", C);
    }

    return 0;
}


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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}

typedef long long ll;
typedef long double R;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

int main() {
  vector<int> a(3); for(int i = 0; i < 3; i++) cin >> a[i];
  sort(a.begin(), a.end());
  if(a[0] + a[1] == a[2]) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}




Measured memory_bytes: 256
import sys
from collections import Counter

N=int(input())
if N==1:
  print(1)
  sys.exit()
  
x=[0]*N
y=[0]*N
for i in range(N):
  x[i],y[i] = map(int, input().split())
a = []
for i in range(N):
  for j in range(N):
    if i==j:
      continue
    else:
      a.append(str(x[j]-x[i])+'&'+str(y[j]-y[i]))
    
a=Counter(a)
common = a.most_common(1)[0][1]
print(N-common)


Measured memory_bytes: 3692
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const int N = 500000;
int n;
int v[N];

vector<int> g(int l, int r)
{
    vector<int> res;
    int st = l;
    while(st<=r)
    {
        int idx = st;
        while(idx<=r && v[idx]) ++idx;
        res.pb(idx-st);
        st = idx+1;
    }
    return res;
}

const int INF = 19191919;
int calc(const vector<int> &a)
{
    int A = a.size();
    if(A<2) return 0;

    // no left right-1 right
    vector<vector<int>> dp(A+1,vector<int>(4,-INF));

    dp[0][0] = 0;
    for(int i=1; i<A; ++i)
    {
        rep(j,4)
        {
            dp[i][0] = max(dp[i][0], dp[i-1][j]);

            if(j==3) break;

            if(a[i-1]>1)
            {
                if(j<2) dp[i][1] = max(dp[i][1], dp[i-1][j]+a[i-1]-(j!=0));
                if(j==2) dp[i][1] = max(dp[i][1], dp[i-1][j]+1);
            }
            else if(a[i-1]==1 && j==0) dp[i][1] = max(dp[i][1], dp[i-1][j]+1);

            if(j==0 || a[i-1]>1) dp[i][2] = max(dp[i][2], dp[i-1][j]+a[i]-1);

            if(j==0 || a[i-1]>1) dp[i][3] = max(dp[i][3], dp[i-1][j]+a[i]);
        }
    }

    int ret = 0;
    rep(i,4) ret = max(ret,dp[A-1][i]);
    return ret;
}

int main()
{
    string s;
    cin >>n >>s;
    rep(i,n) v[i] = s[i]-'0';

    int ans = 0;

    int st = 0;
    while(st<n-1)
    {
        if(v[st]==0) ++st;
        else
        {
            int idx = st;
            while(idx<n-1 && (v[idx]!=0||v[idx+1]!=0)) ++idx;

            vector<int> d = g(st,idx);
            ans += calc(d);

            st = idx;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2820
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        m: usize
    }
    if n == 0 && m == 0 {
        println!("0");
    } else if n == 0 {
        println!("{}", m * (m - 1) / 2);
    } else if m == 0 {
        println!("{}", n * (n - 1) / 2);
    } else {
        println!("{}", n * (n - 1) / 2 + m * (m - 1) / 2);
    }
}


Measured memory_bytes: 4352
while 1:
 H, W = map(int,raw_input().split())
 if H + W == 0:break
 for h in range(H):
  if h % 2 == 0:
   if W % 2 == 0:
    print ('#.'*(W//2))
   else:
    print ('#.'*(W//2)+'#')
  else:
   if W % 2 == 0:
    print ('.#'*(W//2))
   else:
    print ('.#'*(W//2)+'.')
 print ''

Measured memory_bytes: 6348
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (k+k)
#define sag (k+k+1)
#define orta ((bas+son)/2)
#define coc g[node][i]
#define mod 1000000007
#define inf 1000000009
#define N 1000005
using namespace std;
 
typedef long long ll;
typedef pair < int , int > ii;

int n,a[N],l,m,mx,ans,f[N];

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

	f[0] = 0;

	for (int i = 1; i < n; ++i)
	{
		if (a[i] <= a[i-1])
			f[i] = 1;
		else
			f[i] = 0;
	}

	for (int i = 0; i < n; ++i)
	{
		if(f[i] == 1) 
		{
			l++;
			ans = max(ans,l);
		} 
		else
			l = 0;
	}
	
	cout << ans;

	return 0;
}

Measured memory_bytes: 4736
target_x, n = map(int,input().split())
p_ls = list(map(int, input().split()))
p_ls.sort()

min_diff = float('inf')
ans_maybe = []
for i in range(102):
    if min_diff > abs(target_x-i):
        if i not in p_ls:
            min_diff = abs(target_x-i)
            ans_maybe = []
            ans_maybe.append(i)
    elif min_diff == abs(target_x-i):
        if i not in p_ls:
            ans_maybe.append(i)
print(min(ans_maybe))
    


Measured memory_bytes: 9192
from queue import deque

A, B, C = map(int, input().split())
K = int(input())

que = deque([(A, B, C, K)])
visited = set()

while que:
    a, b, c, k = que.pop()
    if (a, b, c, k) in visited or k < 0:
        continue
    visited.add((a, b, c, k))
    if k == 0 and a < b < c:
        print('Yes')
        exit()
    que.append((a*2, b, c, k-1))
    que.append((a, b*2, c, k-1))
    que.append((a, b, c*2, k-1))
print('No')

Measured memory_bytes: 9688
import sys
import math

N = sys.stdin.readline()
H = list(map(int, sys.stdin.readline().split(' ')))

t = list(map(lambda x, y: 1 if x >= y else 0, H[:-1], H[1:]))
m = 0
s = 0
for x in t:
    if x:
        s += 1
        m = max(s, m)
    else:
        s = 0

print(m)


Measured memory_bytes: 14252
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define zero_pad(num) setfill('0') << std::right << setw(num)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n) cin >> a[i];
    int f4 = 0;
    int f2 = 0;
    int f0 = 0;
    rep(i, n){
        if(a[i] % 4 == 0) f4++;
        else if(a[i] % 2 == 0) f2++;
        else f0++;
    }
    if(f2 == 0 && f0 <= f4 + 1) cout << "Yes" << endl;
    else if(f0 <= f4) cout << "Yes" << endl;
    else cout << "No" << endl;
    
}

Measured memory_bytes: 640
from itertools import product

h, w, k = map(int, input().split())
c = [input() for _ in range(h)]
ans = 0
for bh in product([0, 1], repeat=h):
    for bw in product([0, 1], repeat=w):
        cnt = 0
        for i, j in enumerate(bh):
            for x, y in enumerate(bw):
                if j == 1 and y == 1 and c[i][x] == "#":
                    cnt += 1
        if cnt == k:
            ans += 1
print(ans)

Measured memory_bytes: 9076
#include <iostream>
#include <string>
#include <vector>
#include <array>
#include <queue>
#include <algorithm>
#include <functional>
using namespace std;

int main()
{
    int num;
    cin >> num;
    
    int currenta, currentb;
    array<vector<int>,10010> tree;
    for(int i=1;i<num;i++){
        cin >> currenta >> currentb;
        tree[currenta].push_back(currentb);
        tree[currentb].push_back(currenta);
    }


    bool box[10010];
    for(int i=0;i<10010;i++){
        box[i]=true;
    }
    int  boxnum[10010]={};

    vector<int> c;
    long ans = 0;
    int current;
    for(int i=0;i<num;i++){
        cin >> current;
        ans += current;
        c.push_back(current);
    }
    stable_sort(c.begin(),c.end(),greater<int>());
    ans -= c.front();

    queue<int> que;
    que.push(1);
    box[1]=false;
    
    for(int i=0;i<num;i++){
        int fro = que.front();
        boxnum[fro]=c[i];
        que.pop();
        for(int i=0;i<tree[fro].size();i++){
            if(box[tree[fro][i]]==true){
                que.push(tree[fro][i]);
                box[tree[fro][i]]=false;
            }
        }
    }


    cout << ans << endl;
    for(int i=1;i<num;i++){
        cout << boxnum[i] << " ";
    }
    cout << boxnum[num] << endl;


    return 0;
}

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

int main() {
	int N, p[10], count = 0;
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> p[i];
		count += p[i];
	}
	sort(p, p + N, greater<int>());
	cout << count - p[0] / 2 << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main { 
public static void main(String args[]) { 
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int m=sc.nextInt();
int o=sc.nextInt();

if(n<m && m<o){
   System.out.println("Yes"); 
} else{
    System.out.println("No"); 
}
 } }


Measured memory_bytes: 26048
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <math.h>
#include <algorithm>
#include <iomanip>
using namespace std;

int main(){
    int a,b;
    cin >> a >> b;
    if(a <= 8 && b <= 8)cout << "Yay!" << endl;
    else cout << ":(" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
using namespace std;
const int maxn=1000+10;
int main(){
	long long n,a,b,ans=0;
	cin>>n>>a>>b;
	long long c=a+b;
	ans=(n/c)*a;
	if((n%c)<a){
		ans+=(n%c);	
	}
	else ans+=a;
	cout<<ans;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

 
//FUNCTION
 
//SOLVE
void solve(void)
{
  int H,W; cin>>H; cin>>W; 
  vector<vector<char> > vv (H,vector<char>(W,0));
  for (int i = 0; i < H; i++)
  {
    for (int j = 0; j < W; j++)
    {
      cin>>vv[i][j];
    }
    
  }
  set<int> SETW,SETH;
  for (int i = 0; i < H; i++)
  {
    int check = 1;
    for (int j = 0; j < W; j++)
    {
      if(vv[i][j] == '#')check = 0;
    }
    if(check == 1)SETH.insert(i);
    
  }
  for (int j = 0; j < W; j++)
  {
    int check = 1;
    for (int i = 0; i < H; i++)
    {
      if(vv[i][j] == '#')check = 0;
    }
     if(check == 1)SETW.insert(j);
  }
  
  for (int i = 0; i < H; i++)
  {
    if(SETH.find(i) != SETH.end())continue;
    for (int j = 0; j < W; j++)
    {
      if(SETW.find(j) != SETW.end())continue;
      cout<<vv[i][j];
    }
    cout<<endl;
    
  }
  
  
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
// #include <iomanip>
// std::cout << std::fixed << std::setprecision(5);

int main()
{
    int h, a; std::cin >> h >> a;
    
    std::cout << (h+a-1)/a << std::endl;
    return 0;
}

Measured memory_bytes: 256
def get_left_index(A, i):
    if len(A) > 2 * i:
        return 2 * i
    else:
        return None

def get_right_index(A, i):
    if len(A) > 2 * i + 1:
        return 2 * i + 1
    else:
        return None

def max_heapfy(A, i):
    left = get_left_index(A, i)
    right = get_right_index(A, i)
    largest = i
    if left and A[left] > A[i]:
        largest = left
    if right and A[right] > A[largest]:
        largest = right
    if largest != i:
        A[i], A[largest] = A[largest], A[i]
        max_heapfy(A, largest)

H = int(input())
A = [0]
for elem in map(int, input().split()):
    A.append(elem)


def build_max_heap(A):
    for i in range(H//2, 0, -1):
        max_heapfy(A, i)
build_max_heap(A)
print(' ', end='')        
print(*A[1:])


Measured memory_bytes: 64160
import java.io.*;
import java.math.*;
import java.util.*;

public class Main {
    private static boolean debug = false;
    private static boolean elapsed = false;

    private static PrintWriter _out = new PrintWriter(System.out);
    private static PrintWriter _err = new PrintWriter(System.err);

    private void solve(Scanner sc) {
        int N = sc.nextInt();
        int L = sc.nextInt();
        int T = sc.nextInt();
        int[] X = new int[N];
        int[] W = new int[N];
        for (int i = 0; i < N; ++i) {
            X[i] = sc.nextInt();
            W[i] = sc.nextInt();
        }

        int[] p = new int[N];
        int x0 = 0;
        for (int i = 0; i < N; ++i) {
            if (W[i] == 1) {
                p[i] = (X[i] + T) % L;
                x0 += (X[i] + T) / L;
            } else {
                p[i] = (X[i] - T) % L;
                x0 += (X[i] - T) / L;
                if (p[i] < 0) {
                    p[i] += L;
                    --x0;
                }
            }
        }
        Arrays.sort(p);
        x0 %= N;
        if (x0 < 0) {
            x0 += N;
        }
        for (int i = 0; i < N; ++i) {
            _out.println(p[(i + x0) % N]);
        }
    }
    private static BigInteger C(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        for (long i = r; i > 1; --i) {
            res = res.divide(BigInteger.valueOf(i));
        }
        return res;
    }
    private static BigInteger P(long n, long r) {
        BigInteger res = BigInteger.ONE;
        for (long i = n; i > n - r; --i) {
            res = res.multiply(BigInteger.valueOf(i));
        }
        return res;
    }
    /*
     * 10^10 > Integer.MAX_VALUE = 2147483647 > 10^9
     * 10^19 > Long.MAX_VALUE = 9223372036854775807L > 10^18
     */
    public static void main(String[] args) {
        long S = System.currentTimeMillis();

        Scanner sc = new Scanner(System.in);
        new Main().solve(sc);
        _out.flush();

        long G = System.currentTimeMillis();
        if (elapsed) {
            _err.println((G - S) + "ms");
        }
        _err.flush();
    }
}

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

int main()
{
    int N, out;
    cin >> N;
    int A[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

    cout << A[N-1] << endl;

    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
 
/** Template Begins **/

#define ll          long long 
#define IOS         ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl        '\n'
 
const int N = 5e6+7;
template<class L, class R> ostream &operator<<(ostream &os, pair<L,R> P) {
  return os << "(" << P.first << "," << P.second << ")";
} 

template<class T> ostream &operator<<(ostream& os, vector<T> V) {
  os << "["; for (auto vv : V) os << vv << ","; return os << "]";
}
 
template<class TH> void _dbg(const char *sdbg, TH h){ cerr << sdbg << '=' << h << endl; }
 
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',') cerr << *sdbg++;
  cerr<<'='<<h<<','; _dbg(sdbg+1, a...);
}
 
#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#define cerr if(0)cout
#endif
/** Template Ends **/
using pii = pair<int, int>;

ll solve(multiset<pii> lf, multiset<pii> rt, int mv)
{
    int cur = 0;
    ll ans = 0;
    for (; rt.size(); mv++)
    {
        debug(mv);
        if (mv & 1)
        {
            pii p = *rt.rbegin();    rt.erase(rt.find(p));   lf.erase(lf.find({p.second, p.first}));
            debug(p, cur);
            ans += max(0, p.first - cur);
            cur = max(cur, p.first);
        }
        else
        {
            pii p = *lf.begin();    lf.erase(lf.find(p));   rt.erase(rt.find({p.second, p.first}));
            debug(p, cur);
            ans += max(0, cur - p.first);
            cur = min(cur, p.first);
        }
    }
    ans += abs(cur);
    debug(ans);
    return ans;
}

signed main() 
{ 
    IOS;
    int n;  cin >> n;
    multiset<pii> rt, lf;

    for (int i = 0; i < n; i++)
    {
        int x, y;   cin >> x >> y;
        rt.insert({x, y});
        lf.insert({y, x});
    }
    debug(lf.size());
    cout << max(solve(lf, rt, 0), solve(lf, rt, 1)) << endl;

    return 0;
}

Measured memory_bytes: 22392
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		
		int a = in.nextInt();
		int b = in.nextInt();

		if( a <10 && b < 10)System.out.println(a*b);
		else System.out.println(-1);

		in.close();
	}
}

Measured memory_bytes: 23892
#include <iostream>
#include <bits/stdc++.h>
#include<vector>
#include<queue>

using namespace std;

int main()
{
   map<int,int>mapi;
   int n,a;
   cin>>n;
   for(int i =0;i < n-1;i++)
   {
       cin>> a;
       mapi[a]++;
   }
   for(int j=1;j<=n;j++){
    cout<< mapi[j]<<endl;
   }
	return 0;
}

Measured memory_bytes: 13004