akhauriyash/Code-Regression huggingface dataset:
//Nihal Mittal - nihal_47
//Strike First , Strike Hard , No Mercy !!

/**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀
⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀
⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀
⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀
⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀
⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀
⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀
⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀
⠀⠀⠀⣼⣿⣿⣿⣿⠀⡿⠭⠭⠭⠭⢿⠀⣿⢻⣿⣿⠃⠀⠀⠀
⠀⠀⠀⠙⠛⣿⢻⠹⣿⠐⠙⠛⠟⠉⢀⣴⡟⢿⣿⡏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡟⠀⠀⠻⣦⣤⣶⠾⠋⠀⠀⠁⡦⢄⢀⠀⠀⠀
⠀⠀⠀⠀⡠⠁⡇⠑⢄⠀⠀⠀⠀⠀⠀⠔⠀⠀⠁⠀⠀⠀⠉⠁
⠀⠔⠊⠁⠀⠀⣇⠀⠀⠀⠑⡤⠤⢎⠁⠀⠀⡘⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢢⠠⠀⡠⢆⠀⠀⡠⠙⢄⠀⡸⠀
**/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define mk make_pair
#define pb push_back
#define in insert
#define se second
#define fi first
#define mod 1000000007
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define all(v) (v).begin(),(v).end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define pii pair<ll,ll>
#define vi(x) vector<x>
#define maxn 100005
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
using namespace std;
using namespace __gnu_pbds;

signed main()
{
    fast;
   
    ll n,i,j;
    cin>>n;
    ll a[n+2],ans=0;
    for(i=0;i<n;i++)
    {
    	cin>>a[i];
    }
    for(i=1;i<n;i++) {
    	if(a[i]<a[i-1]) ans += a[i-1] - a[i],a[i]=a[i-1];
    }
    cout<<ans;

}

Measured memory_bytes: 5148
#include <stdio.h>
#include <stdlib.h>
#include <vector>

using namespace std;

struct node{
	// parent, children はエッジを示す.
	int parent;
	vector<int> children;
};

int main()
{
	int N;
	node nodes[100000];
	int edges[100000][3];
	
	scanf("%d", &N);
	for(int i = 0; i < N-1; i++){
		int a,b;
		scanf("%d %d", &a, &b);
		edges[i][0] = a;
		edges[i][1] = b;
	}
	
	for(int i = 0; i < N-1; i++){
		node* na = &nodes[edges[i][0]];
		node* nb = &nodes[edges[i][1]];
		na->children.push_back(i);
		nb->parent = i;
	}
	int countmax = 0;
	
	for(int i = 0; i < N; i++){
		node* n = &nodes[i];
		int counter = 1;
		if(i == 0){
			for(int j = 0; j < n->children.size(); j++){
				edges[n->children[j]][2] = counter;
				counter++;
			}
		}
		else{
			int forbid = edges[n->parent][2];
			for(int j = 0; j < n->children.size(); j++){
				if(counter == forbid){
					counter++;
				}
				edges[n->children[j]][2] = counter;
				counter++;
			}
		}
		if(countmax < counter - 1){
			countmax = counter - 1;
		}
	}
	
	printf("%d\n", countmax);
	for(int i = 0; i < N-1; i++){
		printf("%d\n", edges[i][2]);
	}
	
	return 0;
}

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

int main()
{
    unsigned long long int x, y;
    cin >> x >> y;
    bitset<32> a(x);
    bitset<32> b(y);

    cout << (a & b) << endl
         << (a | b) << endl
         << (a ^ b) << endl;
    return 0;
}


Measured memory_bytes: 3152
import java.util.*;
public class Main{
 public static void main(String[] args){
   Scanner sc = new Scanner(System.in);
   int N = sc.nextInt();
   int[] a = new int[N];
   for(int i=0;i<N;i++) a[i] = sc.nextInt();
   Arrays.sort(a);
   int ans=0;
   int count =1;
   int tmp = a[0];
   for(int i=1;i<N;i++)
   {
     if(tmp==a[i]) count++;
     else
     {
       if(count%2==1) ans++;
       count=1;
       tmp=a[i];
     }
   }
   if(count%2==1) ans++;
   System.out.println(ans);
 }
}

Measured memory_bytes: 48692
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define FOR(i,l,r) for(i=l;i<r;i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define P pair<ll,ll>
#define F first
#define S second
signed main(){
  ll N,K,ans;cin>>N>>K;
  ans=N/K;ans*=ans*ans;
  if(K%2==0){
    K/=2;ll x=(N+K)/(2*K);
    ans+=x*x*x;
  }
  cout<<ans<<endl;
  return 0;
}

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define FOR(i,n,j) for(int i=(j);i<(n);++i)
#define ssort(n) sort((n).begin(),(n).end())
#define rsort(n) sort((n).begin(),(n).end(),greater<int>())
#define mp make_pair
using ll=long long;
using ld=long double;
typedef pair<int,int> P;
typedef pair<P,int> COST;
#define repl(i,n) for(ll i=0;i<(n);++i)
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define YES cout << "YES" << endl
#define NO cout << "NO" << endl
using Graf=vector<vector<int>>;
#define MAX 1000000007

int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    vector<int> count_char(26,0);
    vector<int> count_char2(26,0);
    int num=0;
    int ans=0;
    rep(i,n){
        count_char[s[i]-'a']++;
    }

    for(int i=0;i<n-1;++i){
        count_char[s[i]-'a']--;
        count_char2[s[i]-'a']++;

        if(count_char[s[i]-'a']>0&&count_char2[s[i]-'a']==1){
            num++;
        }else if(count_char[s[i]-'a']==0&&(count_char[s[i]-'a']+count_char2[s[i]-'a'])>1){
            num--;
        }
        ans=max(ans,num);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3584
def main():
    n = int(input())
    a = list(map(int,input().split()))

    four = 0
    two = 0

    for i in a:
        if i %4 ==0:
            four +=1
        elif i %2==0:
            two +=1


    if two > 0:
        if (n-two)/2 <= four:
            print("Yes")
        else:
            print("No")
    else:
        if n//2 <= four:
            print("Yes")
        else:
            print("No")


if __name__ == "__main__":
        main()


Measured memory_bytes: 14252
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
	int a[4];
	for(int i=0;i<4;i++)
		cin>>a[i];
	sort(a,a+4);
	if(a[0]==1&&a[1]==4&&a[2]==7&&a[3]==9)
		cout<<"YES"<<endl;
	else
		cout<<"NO"<<endl;
	return 0;
}

Measured memory_bytes: 256
N = input() 
a=0
b=0

d=[1,2,3]
for i in range(1,4):
		if N[i] == N[0]:
			a+=1
			b=i			
if a==1:
	d.pop(b-1)
	if N[d[0]] == N[d[1]]:
		print("Yes")
	else:
		print("No")

else:
	print("No")


Measured memory_bytes: 3060
#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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, 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")
    };
}
use std::cmp::Ordering;

#[derive(Eq, PartialEq, Clone, Debug)]
pub struct Rev<T>(pub T);

impl<T: PartialOrd> PartialOrd for Rev<T> {
    fn partial_cmp(&self, other: &Rev<T>) -> Option<Ordering> {
        other.0.partial_cmp(&self.0)
    }
}
impl<T: Ord> Ord for Rev<T> {
    fn cmp(&self, other: &Rev<T>) -> Ordering {
        other.0.cmp(&self.0)
    }
}

fn main() {
    input! {
        n: i32,
        a: i32
    }
    println!("{}", n * n - a);
} 


Measured memory_bytes: 4352
import sys
 
stdin = sys.stdin

mod = 1000000007
inf = 1 << 60
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()
nas = lambda: stdin.readline().split()

n = ni()
a = na()

ans = 0
for i in range(n):
    if a[i] % 2 == 0:
        while a[i] % 2 == 0:
            a[i] //= 2
            ans += 1

print(ans)

Measured memory_bytes: 40560
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const long long LINF=8931145141919364364,LMOD=998244353;
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    int n,m; cin>>n>>m;
    pair<int,pair<int,int>> state[m];
    rep(i,m){
        cin>>state[i].second.first>>state[i].first;
        state[i].second.second=i+1;
    }
    sort(state,state+m);
    int cnt[n+1]={};
    priority_queue<pair<int,string>,vector<pair<int,string>>,greater<pair<int,string>>> pq;
    rep(i,m){
        int pre=state[i].second.first,num=state[i].second.second;
        int cnt0=0,pre1=pre,cnt1=++cnt[pre];
        int cnt2=cnt1;
        // cout<<pre1<<" "<<cnt1<<endl;
        while(pre1>0) {pre1/=10,cnt0++;}
        string tmp;
        rep(j,6-cnt0) tmp=tmp+"0";
        string ss;
        while(pre>0) {ss+=(pre%10+'0');pre/=10;}
        reverse(all(ss));
        tmp+=ss;
        cnt0=0;
        while(cnt1>0) {cnt1/=10,cnt0++;}
        rep(j,6-cnt0) tmp=tmp+"0";
        string sss;
        // cout<<cnt2<<endl;
        while(cnt2>0) {sss+=(cnt2%10+'0');cnt2/=10;}
        // cout<<sss<<endl;
        reverse(all(sss));
        tmp+=sss;
        // cout<<tmp<<endl;
        pq.push({num,tmp});
    }
    while(pq.size()){
        auto i=pq.top(); pq.pop();
        cout<<i.second<<endl;
    }
    return 0;
}


Measured memory_bytes: 10864
//package AtCoder.Panasonic2020;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {
        long h = in.NI(); long w = in.NI();
        if (h==1) {
            out.println(1); out.close(); return;
        }
        if (w==1) {
            out.println(1); out.close(); return;
        }
        if (h%2==0) {
            out.println(w*(h/2));
        } else {
            long t1 = h/2+1; long t2 = h/2;
            if (w%2==0) {
                out.println(w/2*(t1+t2));
            } else {
                long var = (w/2*(t1+t2)) + t1;
                out.println(var);
            }
        }
        out.close();
    }

    static InputStream inputStream = System.in;
    static OutputStream outputStream = System.out;
    static InputReader in = new InputReader(inputStream);
    static PrintWriter out = new PrintWriter(outputStream);

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int NI() {
            return Integer.parseInt(next());
        }

        public long NL() {
            return Long.parseLong(next());
        }

    }
}

Measured memory_bytes: 21076
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

const int N=500005;

typedef long long LL;

int n,q,d[N],p[N];

LL f[N];

int main()
{
	scanf("%d%d",&n,&p[0]);
	for (int i=1;i<=n;i++)
	{
		scanf("%d",&d[i]);
		if (p[i-1]>=d[i]) p[i]=p[i-1]-d[i];
		else if (p[i-1]*2>d[i]) p[i]=d[i]-p[i-1];
		else p[i]=p[i-1];
	}
	f[n+1]=0;
	f[n]=(d[n]==1)?2:1;
	for (int i=n-1;i;i--)
	{
		f[i]=f[i+1]+d[i];
		if (d[i]>f[i+1] && d[i]-f[i+1]>f[i+1]) f[i]=min(f[i],d[i]-f[i+1]);
		if (2*f[i+1]<=d[i]) f[i]=min(f[i],f[i+1]);
	}
	for (scanf("%d",&q);q--;)
	{
		int m;
		scanf("%d",&m);
		if (p[m-1]>0 && p[m-1]>=f[m+1]) printf("YES\n");
		else printf("NO\n");
	}
	return 0;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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




void solve() {
    ll A, B; cin >> A >> B;
	ll res = 0;
	if(A%2 && B%2){
		res = A ^ ((B-A)/2%2);
	}else if(A%2 && B%2 == 0){
		res = A ^ B ^ ((B-A-1)/2%2);
	}else if(A%2 == 0 && B%2){
		res = (B-A+1)/2%2;
	}else{
		res = ((B-A)/2%2) ^ B;
	}

	cout << res << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	if(n%2==0)
	{
		cout<<"-1";
		return 0;
	}
	long long s;
	s=7;
	for(long long i=1;i<=100000000;i++)
	{
		if(s%n==0)
		{
			cout<<i;
			return 0;
		}
		s=s%n;
		s*=10;
		s+=7;
	 }
	 cout<<"-1";
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define pb push_back
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int>pii;
const int maxn=1e5+100;
int n;
int main()
{
    ios_base::sync_with_stdio(false), cin.tie(0);
    cin>>n;
    int f=-1;
    string s;
    while(n)
    {
        if(abs(n)%2==1)
        {
            n+=f;
            s+='1';
        }
        else s+='0';
        f=-f;
        n/=2;
    }
    if(!sz(s))s="0";
    reverse(all(s));
    cout<<s<<"\n";
    return 0;
}


Measured memory_bytes: 256
N, Y = map(int,input().split())
a = -1
b = -1
c = -1
for i in range(Y//10000+1):
    for j in range((Y-10000*i)//5000+1):
        if N-i-j >= 0 and (Y-10000*i-5000*j)//1000 == N-i-j:
            a = i
            b = j
            c = N-i-j
print(a,b,c)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
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 ll INF = 1LL << 60;

int common_divisor(int a, int b, int k) {
    int cnt = 0;
    for (int i = max(a, b); i >= 1; i--) {
        if (a % i == 0 && b % i == 0) {
            cnt++;
            if (cnt == k) return i;
        }
    }
}

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

    int ans = common_divisor(a, b, k);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import itertools
N,A,B,C = map(int,input().split())
L = []
Comb = [] #0:使わない, 1:竹Aの材料 ,2:竹Bの材料 ,3:竹Cの材料

for i in range(N):
  l = int(input())
  L.append(l)
  Comb.append([0,1,2,3])
all_Comb = list(itertools.product(*Comb))

min_MP = float('inf')
for i in range(len(all_Comb)):
 tmp = list(all_Comb[i])
 Non_material = []
 A_material = []
 B_material = []
 C_material = []
 for j in range(N):
   if(tmp[j] == 0): Non_material.append(L[j])
   elif(tmp[j] == 1):  A_material.append(L[j])
   elif(tmp[j] == 2):  B_material.append(L[j])
   elif(tmp[j] == 3):  C_material.append(L[j])
   a,b,c = len(A_material),len(B_material),len(C_material)
   if((a>=1)and(b>=1)and(c>=1)):
    sum_A,sum_B,sum_C = sum(A_material),sum(B_material),sum(C_material)
    MP = abs(A-sum_A) + abs(B-sum_B) + abs(C-sum_C) + 10*(a+b+c-3)
    min_MP = min(MP,min_MP)
 
print(min_MP)


Measured memory_bytes: 12964
import java.io.*;
public class Main{
	public static void main(String[] args)throws Exception{
		BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
		String str=input.readLine();
		String[] str2=str.split(" ");
		int a=Integer.parseInt(str2[0]);
		int b=Integer.parseInt(str2[1]);
		System.out.println(a/b+" "+a%b+" "+(String.format("%.5f",(double)a/(double)b)));
	}
}

Measured memory_bytes: 24528
#include <stdio.h>

int N, a[100];
long long int dp[100][21];

int main(void){
    int x, y;
    scanf("%d", &N);
    for(x = 0; x < N; x++){
        scanf("%d", &a[x]);
    }
    for(x = 0; x < N; x++){
        for(y = 0; y <= 20; y++){
            dp[x][y] = 0;
        }
    }
    dp[0][a[0]] = 1;
    for(x = 1; x < N-1; x++){
        for(y = 0; y <= 20; y++){
            if(y-a[x] >= 0){
                dp[x][y] += dp[x-1][y-a[x]];
            }
            if(y+a[x] <= 20){
                dp[x][y] += dp[x-1][y+a[x]];
            }
        }
    }
    printf("%lld\n", dp[N-2][a[N-1]]);
    return 0;
}

Measured memory_bytes: 616
chk [a,b,c,d] [] = [a,b,c,d]
chk [a,b,c,d] (x:xs)
  | x >= 1.1 = chk [a+1,b,c,d] xs
  | x >= 0.6 = chk [a,b+1,c,d] xs
  | x >= 0.2 = chk [a,b,c+1,d] xs
  | otherwise= chk [a,b,c,d+1] xs

ans i =
  let l  = map (\ [l,r] -> l) i
      r  = map (\ [l,r] -> r) i
      tl = chk [0,0,0,0] l
      tr = chk [0,0,0,0] r
  in
    zip tl tr

main = do
  c <- getContents
  let i = map (map read) $ map words $ lines c :: [[Float]]
      o = ans i
  mapM_ putStrLn $ map unwords $ map (\ (a,b) -> [(show a),(show b)] ) o

Measured memory_bytes: 4348
#include<stdio.h>
#include<stdlib.h>

int main()
{
	unsigned long long int h, w;
	scanf("%llu %llu",&h,&w);
	unsigned long long int s =0;
	unsigned long long int a = h/2;
	unsigned long long int b = w/2;
	if(h == 1 || w == 1)
	{
		printf("1");
		return 0;
	}
	else if(h%2 == 1)
	{
		s = a*w + b;
		if(w%2 ==1)
		{
			s += 1;
		}
	}
	else
	{
		s = a * w;
	}
	printf("%llu", s);
}

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

int n,ans=0;
int a[100005],b[100005],c[100005];

int p[100005][205];

signed main()
{
	cin>>n;
	n++;
	for (int i=1;i<=n;i++)  cin>>a[i];
	
	b[1]=1,c[n]=a[n];
	for (int i=2;i<=n;i++)  b[i]=(b[i-1]-a[i-1])*2;
	for (int i=n-1;i>=1;i--)  c[i]=c[i+1]+a[i];
	for (int i=1;i<=n;i++)  ans+=min(b[i],c[i]);
	for (int i=1;i<=n;i++)
	{
		if (a[i]>b[i])  return cout<<-1<<endl,0;
	}
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 5984
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>
#include <functional>
#include <bitset>
#include <complex>
#include <stack>
#include <cstdint>



#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rrep(i, n) for(ll i = (ll)(n-1); i >= 0; i--)
#define repi(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rrepi(i,a,b) for(ll i=(ll)(b);i>=(ll)(a);i--)

#define all(x) (x).begin(),(x).end()

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

typedef long long ll;

using namespace std;

double memo[301][301][301];

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n;cin>>n;
  vector<ll>cnt(3);
  rep(i,n){
    ll a;cin>>a;
    a--;
    cnt[a]++;
  }


  rep(i,301)rep(j,301)rep(k,301)memo[i][j][k]=-1;

  function<double(ll,ll,ll)>dfs=[&](ll a,ll b,ll c){
    double res=0;
    if(a==0&&b==0&&c==0)return memo[a][b][c]=0;
    if(memo[a][b][c]>=0)return memo[a][b][c];
    double w=(double)n/(a+b+c);
    if(a>0)res+=(dfs(a-1,b,c)+w)/(a+b+c)*a;
    if(b>0)res+=(dfs(a+1,b-1,c)+w)/(a+b+c)*b;
    if(c>0)res+=(dfs(a,b+1,c-1)+w)/(a+b+c)*c;
    return memo[a][b][c]=res;
  };
  cout<<setprecision(13)<<dfs(cnt[0],cnt[1],cnt[2])<<endl;
  return 0;

}


Measured memory_bytes: 213504
/*
Original problem: https://atcoder.jp/contests/abc134/tasks/abc134_e
Author: sammochen
*/

#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

using namespace std;

#define REP(x,l,u) for(ll x = l;x<u;x++)
#define RREP(x,l,u) for(ll x = l;x>=u;x--)

#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef vector<ll> VLL;
typedef vector<int> VI;

const ll mod = 1e9+7;

namespace SOLVE {
    void main() {
        int n, temp;
		cin >> n;
		multiset<int> s;
		multiset<int>::iterator itr; 
		REP(i,0,n) {
			cin >> temp;
			itr = s.lower_bound(temp); // find the first number that is temp, --
			
			if (itr == s.begin()) {
				s.insert(temp);
			} else {
				itr--;
				// cout << i << ' ' << "erase" << *itr << endl;
				s.erase(itr);
				s.insert(temp);
			}
		}
		cout << s.size() << endl;
    }
}


signed main() {
	int t;
	t = 1;
	// cin >> t;
	while (t--) {
		SOLVE::main();
	}

	return 0;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
using ll = long long ;
using P = pair<int,int> ;
using pll = pair<long double,long long>;
constexpr int INF = 1e9;
constexpr long long LINF = 1e17;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979323846;

struct Unionfind{
    vector<int> parents;
    int n;
    Unionfind(int n):n(n),parents(n,-1){ }

    int find(int x){
        if(parents[x] < 0) return x;
        else return parents[x] = find(parents[x]);
    }

    void unite(int x,int y){
        x = find(x);
        y = find(y);

        if(x==y) return;
        if(parents[x] > parents[y]) swap(x,y);
        parents[x] += parents[y];
        parents[y] = x;
    } 
 
    int size(int x){
        return -parents[find(x)];
    }

    bool same(int x,int y){
        return find(x)==find(y);
    }

    vector<int> members(int x){
        int root = find(x);
        vector<int> member;
        for(int i=0;i<n;i++){
            if(find(i)==root ){
                member.push_back(i);
            }
        }
        return member;
    }

    int group_cnt(){
        int c = 0;
        rep(i,n){
            if(parents[i] < 0) ++c;
        }
        return c;
    }
};

int main(){
    int n,q;
    cin >> n >> q;
    Unionfind uf(n);
    rep(i,q){
        int t,u,v;
        cin >> t >> u >> v;
        if(t==0){
            uf.unite(u,v);
        }else{
            cout << (uf.same(u,v)?1:0) << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 3988
#include <iostream>
#include <algorithm>
int main()
{
  const int BASE = 100000;
  int n, debt = BASE;
  std::cin >> n;
  while (n--) {
    debt = (debt * 1.05 + 999) / 1000;
    debt *= 1000;
  }
  std::cout << debt << std::endl;
  return 0;
}

Measured memory_bytes: 1160
import std.stdio, std.string, std.conv, std.algorithm;
import std.range, std.array, std.container, std.math, std.typecons;
import std.ascii, std.getopt;

void main() {
    int Q, N;

    Q = readln.chomp.to!int;

    foreach (qi ; 0 .. Q) {
        N = readln.chomp.to!int;
        solve(N).writeln;
    }
}

int solve(int N) {
    int cnt;

    while (N > 9) {
        int[] made;
        string ns = N.to!string;

        foreach (i ; 1 .. ns.length) {
            int x = ns[0 .. i].to!int, y = ns[i .. $].to!int;
            made ~= x * y;
        }

        N = made.reduce!max;
        cnt++;
    }

    return cnt;
}

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

#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl "\n"

using namespace std;
using ll = long long;

const double PI = 3.14159265358979;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= 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 { return mint(*this) /= a;}
};
istream& operator>>(istream& is, mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

// combination mod prime
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
} c(110000);

void solve()
{
  ll n, m;
  cin >> n >> m;
  if (n == 1 || m == 1)
  {
    cout << 1;
    return;
  }
  map<ll, ll> primes;
  ll factor = 2;
  while(factor * factor <= m)
  {
    if (m % factor == 0)
    {
      primes[factor]++;
      m /= factor;
    }
    else ++factor;
  }
  primes[m]++;

  mint ans = 1;
  for(const auto& p : primes)
  {
    ans *= c(p.second + n - 1, n - 1);
  }
  cout << ans;
}

int main()
{
  fastio;
  solve();

  return 0;
}

Measured memory_bytes: 4920
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
int MOD = 1000000007;
signed main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	int n = s.size();
	vector<int> v(26);
	
	rep(i,n){
		v.at(s.at(i) - 'A')++;
	}
	bool flag = true;
	rep(i,26){
		if(v.at(i) != 2 && v.at(i) != 0){
			flag = false;
		}
	}
	if(flag) cout << "Yes" << endl;
	else cout << "No" << endl;

}


Measured memory_bytes: 256
// ABC153_A
#include <iostream>
#include <string>
#include <vector>
#include <iterator>
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <bitset>  // static_cast<std::bitset<8>>
#include <sstream>  // std::stringstream
#include <cmath>
#include <cstring>  // std::memset
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
#include <iomanip>
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> pll;
#define rep(i, n) for (ll i=0; i < n; i++)  // 0 ~ n-1
#define rep1(i, n) for (ll i=1; i <= n; i++)  // 1 ~ n
#define repr(i, n) for (ll i=n-1; i >= 0; i++)  // n-1 ~ 0
#define all(vec) (vec).begin(), (vec).end()
#define sum(vec) accumulate(all(vec), 0LL)  // 0 は初期値
#define min_vec(vec) min_element(all(vec))  // iterator: * を先頭につける
#define max_vec(vec) max_element(all(vec))  // iterator: * を先頭につける
#define idx(vec, element_iter) distance((vec).begin(), element_iter)
const ll INF = 1LL<<60;  // 10^18（const int inf = 1<<29;）
const double PI = acos(-1);

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    // input(sunippets: inpv, inpn, inps)
    ll N, M;
    cin >> N >> M;
    
    // calculation
    cout << (N+M-1)/M << "\n";
    
    return 0;
}



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

int main (void)
{
    long bcnt=0,sum=0;
    char s[2000001];
    scanf("%s",s);
    for(int i=0;i<strlen(s);i++)
    {
        if(s[i]=='W')
        {
            sum=sum+bcnt;
        }else{
            bcnt++;
        }
    }
    printf("%ld\n",sum);
    return 0;
}


Measured memory_bytes: 1928
#include <bits/stdc++.h>  
#define rep(i, n) for(int i=0; i<(int)(n); ++i)
#define cout(val) cout << (val) << endl
using namespace std;
typedef long long LL;

int main(){
    int w, h, t0, t1, result, temp;
    pair<int, int> cur;
    vector<int> dx = {1, 1, 1, 0, 0, -1, -1, -1};
    vector<int> dy = {1, 0, -1, 1, -1, 1, 0, -1};
    while(true){
        cin >> w >> h;
        if(w == 0 && h == 0) break;
        vector<LL> c(h);
        vector<LL> seen(h);
        vector<pair<int, int>> f;
        rep(i, h) rep(j, w){
            cin >> temp;
            c[i] |= (LL)temp<<j;
            if(temp) f.push_back(make_pair(i, j));
        }
        result = 0;
        stack<pair<int, int>> stk;
        for(auto &&pos : f){
            if(!(seen[pos.first]&1LL<<pos.second)) ++result;
            stk.push(make_pair(pos.first, pos.second));
            while(!stk.empty()){
                cur = stk.top();
                stk.pop();
                rep(i, 8){
                    t0 = cur.first + dy[i];
                    t1 = cur.second + dx[i];
                    if(t0==-1 || t0==h || t1==-1 || t1==w || seen[t0]&1LL<<t1 || !(c[t0]&1LL<<t1)) continue;
                    stk.push(make_pair(t0, t1));
                    seen[t0] |= 1LL<<t1;
                }
            }
        }
        cout(result);
    }
}



Measured memory_bytes: 3216
#include <iostream>
#include <cstdio>
#include <set>
#include <list>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <string>
#include <sstream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cctype>
#include <cmath>
#include <fstream>
#include <iomanip>
//#include <unordered_map>
using namespace std;
#define dbg(x) cerr << #x " = " << x << endl;
typedef pair<int, int> P;
typedef long long ll;
#define FIN freopen("in.txt", "r", stdin);
ll sum = 0;
int k, s;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> k >> s;
    for(int i = 0; i <= k; i++)
    {
        for(int j = 0; j <= k; j++)
        {
            if(s - i - j <= k && s - i - j >= 0) sum++;
        }
    }
    cout << sum <<endl;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
from collections import deque

h, w = [int(item) for item in input().split()]
field = []
field.append("#" * (w + 2))
for i in range(h):
    field.append("#" + input().rstrip() + "#")
field.append("#" * (w + 2))


ans = 0
for i in range(1, h+1):
    for j in range(1, w+1):
        if field[i][j] == "#":
            continue
        dist = [[-1] * (w + 2) for _ in range(h + 2)]
        dist[i][j] = 0
        dq = deque()
        dq.append((i, j, 0))
        while dq:
            x, y, d = dq.popleft()
            if field[x+1][y] == "." and dist[x+1][y] == -1:
                dist[x+1][y] = d+1
                dq.append((x+1, y, d+1))
            if field[x][y+1] == "." and dist[x][y+1] == -1:
                dist[x][y+1] = d+1
                dq.append((x, y+1, d+1))
            if field[x-1][y] == "." and dist[x-1][y] == -1:
                dist[x-1][y] = d+1
                dq.append((x-1, y, d+1))
            if field[x][y-1] == "." and dist[x][y-1] == -1:
                dist[x][y-1] = d+1
                dq.append((x, y-1, d+1))
        for line in dist:
            ans = max(ans, max(line))
        
print(ans)

Measured memory_bytes: 3316
#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD (1000000007)
#define MOD2 (998244353)
#define MOD3 (1000000009)
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("in.txt");ofstream coutt("out.txt");
int poww(const int &a,int b,const int &m=MOD){if(b==0)return 1;int x=poww(a,b/2,m);x=x*x%m;if(b&1)x=x*a%m;return x;}
int ceil(const int &a,const int &b){return (a+b-1)/b;}
////Read:
//Use __builtin_popcountll for ll;
//Check corner cases, n==1;
//
////Some function:
//__builtin_popcountll(), 


signed main(){
    FASTER;
    int n;cin>>n;
    vi v(n);cin>>v;
    int xxor=0;
    for(int i:v)xxor^=i;
    for(int i:v){
        cout<<(xxor^i)<<" ";
    }
}



Measured memory_bytes: 4764
import bisect
s = input()
s_li = list(s)
ma = {}
for i,each_s in enumerate(s_li):
    if each_s not in ma:
        ma[each_s] = [i]
    else:
        ma[each_s].append(i)
t = input()
t_li = list(t)
#print(ma,s_li,t_li)

repeat_count = 0
last_index = -1
for tt in t_li:
    if tt not in ma:
        print(-1)
        exit()
    tmp_li = ma[tt]
    #print(tmp_li)

    lee = len(s_li)
    #add_li = [ii+lee for ii in tmp_li]
    #new_li = tmp_li + add_li
    #bi = bisect.bisect_left(new_li, last_index+1)
    bi = bisect.bisect_left(tmp_li, last_index+1)
    #print(bi,len(tmp_li),'bi',tmp_li,last_index,'last_index')
    if bi>= len(tmp_li):
        repeat_count += 1
        min_index = tmp_li[0]
    else:
        min_index = tmp_li[bi]
    #print(new_li,last_index+1,min_index,'min')
    #if min_index>= lee:
    #    repeat_count += 1
    #    min_index -= lee
    last_index = min_index
    #print(repeat_count,'repeat')
    #print(last_index,'last')
print(lee*(repeat_count)+last_index+1)

Measured memory_bytes: 62728
using System;
using System.Linq;

namespace atcoder.abc167.b
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] inputArray = getIntParams();
            int A = inputArray[0];
            int B = inputArray[1];
            int C = inputArray[2];
            int K = inputArray[3];

            int ret = 0;
            if (K <= A)
            {
                ret = K;
            }
            else
            {
                ret = A;
                K -= A;
                if (K > B)
                {
                    K -= B;
                    if (K <= C)
                    {
                        ret -= K;
                    }
                }
            }
            Console.WriteLine(ret);
        }

        static int getIntParam()
        {
            return int.Parse(Console.ReadLine());
        }
        static int[] getIntParams()
        {
            return Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
        }
        static long getLongParam()
        {
            return long.Parse(Console.ReadLine());
        }
        static long[] getLongParams()
        {
            return Console.ReadLine().Split(' ').Select(i => long.Parse(i)).ToArray();
        }
        static string getStringParam()
        {
            return Console.ReadLine();
        }
        static string[] getStringParams()
        {
            return Console.ReadLine().Split(' ');
        }
        static decimal getDecimalParam()
        {
            return decimal.Parse(Console.ReadLine());
        }
        static decimal[] getDecimalParams()
        {
            return Console.ReadLine().Split(' ').Select(i => decimal.Parse(i)).ToArray();
        }
    }
}


Measured memory_bytes: 28244
import itertools
n = int(input())
p = list(map(int, input().split()))
q = list(map(int, input().split()))

def make_val(suretsu):
    val = 0
    for index in range(n):
        val += suretsu[n - index - 1] * pow(10, index)
    return val

p_val = make_val(p)
q_val = make_val(q)
min_val = min(p_val, q_val)
max_val = max(p_val, q_val)

count = 0
counting = False
p_rank = 0
q_rank = 0
for suretsu in itertools.permutations(range(1, n+1)):
    val = make_val(suretsu)
    if val < p_val:
        p_rank += 1
    if val < q_val:
        q_rank += 1
    p_rank += 1
    q_rank += 1

print(abs(p_rank-q_rank))

Measured memory_bytes: 42476
#include <stdio.h>

int main(){
  int count;
  int a, b, x, w;

  while(scanf("%d %d", &a, &b) != EOF){
    x = a + b;
    count = 0;
    if(x == 0){
      count = 1;
    }else{
      for(w = x; w != 0; w = w/10){
	count += 1;
      }
    }
    printf("%d\n", count);
  }
  return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#define sz size
#define pb push_back
#define mper make_pair
#define PI 3.14159
#define F first
#define S second
#define ll int
//#define forik(i, a, b) for(ll i = a; i <= b; ++i)
#define vl vector<ll>
#define pll pair<ll, ll>
#define mal ios_base::sync_with_stdio(NULL);cin.tie(NULL);cout.tie(NULL);
using namespace std;

ll n, a[211];

int main() {

mal

cin >> n;

n *= 2;

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

sort(a + 1, a + 1 + n);

ll ans = 0;

for(int i = 1; i <= n; i += 2) {
    ans += a[i];
}

cout << ans;

return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#define ll long long
using namespace std;
int a[55];
bool cmp(int x, int y){
	return x > y;
}
int main(){
	int n,k;
	cin>>n>>k;
	for(int i = 0; i < n; i ++)scanf("%d",&a[i]);
	sort(a,a+n,cmp);
	int ans = 0;
	for(int i = 0; i < min(n,k); i ++){
		ans += a[i];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

typedef struct Rule{
  char legal[7],sou[9],des[9];
}rule;

typedef struct Packet{
  char sou[9],des[9],mes[51];
}packet;


int main(void){
  int i,j,k;
  int n,m;
  rule r[1024];
  packet p[1024];
  int ans[1024],count;
  int flag;

  while(1){
    scanf(" %d %d ",&n,&m);
    if(!n && !m)break;

    for(i=0;i<n;i++){
      fscanf(stdin," %s ",r[i].legal);
      fscanf(stdin," %s ",r[i].sou);
      fscanf(stdin," %s ",r[i].des);
    }
    for(i=0;i<m;i++){
      fscanf(stdin," %s ",p[i].sou);
      fscanf(stdin," %s ",p[i].des);
      fscanf(stdin," %s ",p[i].mes);
    }
    
    count = 0;
    for(i=0;i<m;i++){
      for(j=n-1;j>=0;j--){
	flag = 0;
	for(k=0;k<8;k++){
	  if(r[j].sou[k] != '?' && r[j].sou[k] != p[i].sou[k]){
	      flag = 1;
	      break;
	    }
	}
	if(!flag){
	  for(k=0;k<8;k++){
	    if(r[j].des[k] != '?' && r[j].des[k] != p[i].des[k]){
	      flag = 1;
	      break;
	    }
	  }
	}
	if(!flag){
	  if(!strcmp(r[j].legal,"permit")){
	    ans[count] = i;
	    count++;
	    break;
	  }else{
	    break;
	  }
	}
      }
    }
      printf("%d\n",count);
      for(i=0;i<count;i++){
	printf("%s ",p[ans[i]].sou);
	printf("%s ",p[ans[i]].des);
	printf("%s\n",p[ans[i]].mes);
      }

  }
  return 0;
}

Measured memory_bytes: 0
using System;
using System.Collections.Generic;
using System.IO;

class Program
{
    static long answer = 1;

    static void Main()
    {
        string[] Input = Console.ReadLine().Split(' ');
        long N = long.Parse(Input[0]);
        long P = long.Parse(Input[1]);

        long i = 2;
        long tmp = P;
        long count = 0;

//        Console.WriteLine(answer);

        while (i * i <= P) //※i <= √P
        {
            if (tmp % i == 0)
            {
//                Console.WriteLine(answer);

                tmp /= i;
                count++;
                if (count % N == 0) answer *= i;
            }
            else
            {
                i++;
                count = 0;
            }
        }

        if (tmp != 1)
        {
            count++;
            if (count % N == 0) answer *= tmp;
        }

        Console.WriteLine(answer);
    }


}

Measured memory_bytes: 13140
N = int(input())
A = list(map(int,input().split()))

if 1 in A:
    num = 1
    c = 0
    d = len(A)
    for i in range(N):
        if A[i] == num:
            num += 1
            c += 1 
    print(d - c)
else:
    print(-1)

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

int root(int x){
int kijun=0;
for(int i=1;i<=1000;i++)
{if(i*i==x){kijun++;}}
if(kijun>0){return 1;}
else{return 0;}
}


int main()
{
int number=0;
int a,b;
cin>>a>>b;
if(1<=b&&b<=9){number=a*10+b;}
if(10<=b&&100>b){number=a*100+b;}
if(b==100){number=a*1000+b;}

if(root(number)==1){cout<<"Yes"<<endl;}
else{cout<<"No"<<endl;}

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
typedef long long ll;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

vector<int> stone;
int dp[100001];

int solve(int n){
	if(dp[n] > -1){
		return dp[n];
	}
	if(n == 0){
		return dp[n] = 0;
	}
	else{
		if(n >= 2)
			return dp[n] = min(solve(n-1) + abs(stone[n] - stone[n-1]), solve(n-2) + abs(stone[n] - stone[n-2]));
		return dp[n] = solve(n-1) + abs(stone[n] - stone[n-1]);
	}
}
int main()
{
	ios::sync_with_stdio(false);
  	cin.tie(0);
  	int n;
  	cin >> n;
  	stone.resize(n);
  	for(int i = 0; i < n; i++){
  		int k;
  		cin >> k;
  		stone[i] = k;
  	}
  	for(int i = 0; i < 100001; i++) dp[i] = -1;
  	reverse(stone.begin(), stone.end());
  	cout << solve(n-1) << endl;

	return 0;
}


Measured memory_bytes: 3328
#include <iostream>
#include <string>
#define int long long
using namespace std;
string s; int d; bool b[1234];
signed main() {
	cin >> s >> s >> d;
	for (int i = 0; i < s.size() && d>0; i++) {
		if (s[i] == '0') {
			s[i] = '1'; d--; b[i] = 1;
		}
	}
	for (int i = s.size() - 1; i >= 0 && d > 0; i--) {
		if (!b[i]) {
			s[i] = '0'; d--; b[i] = 1;
		}
	}
	cout << s << endl;
}


Measured memory_bytes: 3212
#include <stdio.h>

#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <climits>
#include <cmath>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

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

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

  string n;
  cin >> n;
  for (char c : n) {
    if (c == '7') {
      cout << "Yes";
      return 0;
    }
  }
  cout << "No";
}


Measured memory_bytes: 3128
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef double D;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
 
#define rd(x) scanf("%d",&x)
#define rd2(x,y) scanf("%d %d",&x,&y)
#define rl(x) scanf("%lld",&x)
#define rl2(x,y) scanf("%lld %lld",&x,&y)
#define wd(x) printf("%d" ,x)
#define wd2(x,y) printf("%d %d",x,y)
#define wl(x) printf("%lld",x)
#define wl2(x,y) printf("%lld %lld",x,y)
#define PC(x) putchar(x)
#define GC() getchar()
#define NL printf("\n")
#define SP printf(" ")
 
#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define ITER(it,a) for (__typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a,value) memset(a, value, sizeof(a))

#define F first
#define S second
#define MP make_pair
#define PB push_back

#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL)
#define fr(i,s,e) for(int i=s;i<e;i++)
#define frl(i,s,e) for(ll i=s;i<e;i++)
#define frr(i,s,e) for(int i=s-1;i>=e;i--)
#define frv(i,a) for(int i = 0;i<(int)a.size();i++)
#define frvr(i,a) for(int i = a.size()-1;i>=0;i--)
#define tr(i,a) for(typeof(a.begin()) i = a.begin(); i != a.end();i++)

#define mod 1000000007
#define maxn 100009
#define maxr 100009
int main(){
	//sstd::ios::sync_with_stdio(false); cin.tie(NULL);
	ll n;
	rl(n);
	VL arr(n);
	fr(i,0,n)
	{
		rl(arr[i]);
	}
	ll ct=0;
	sort(ALL(arr));
	fr(i,0,n)
	{
		fr(j,i+1,n)
		{
			fr(k,j+1,n)
			{
				if((arr[i]<arr[j]+arr[k])&&(arr[j]<arr[i]+arr[k])&&(arr[k]<arr[i]+arr[j]))
					ct++;
				else
					break;
			}

		}
	}
	wl(ct);
	NL;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#define INF 10e8
using namespace std;

int main(void){
	int n,MAX=-INF;
	int mat[100][100];
	cin >> n;
	for(int y=0;y<n;y++)
		for(int x=0;x<n;x++)
			cin >> mat[x][y];
	for(int y1=0;y1<n;y1++){
		for(int x1=0;x1<n;x1++){
			for(int y2=y1;y2<n;y2++){
				int tmp=0;
				for(int x2=x1;x2<n;x2++){
					for(int i=y1;i<=y2;i++)
						tmp+=mat[x2][i];
					MAX=max(MAX,tmp);
				}
			}
		}
	}
	cout << MAX << endl;
	return 0;
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
using namespace std;
static const int WHITE = 0;
static const int GRAY = 1;
static const int BLACK = 2;
int N,M;

vector<char> v;


int main() {
  ios::sync_with_stdio(false);
  string in;
  cin >> in;
  int a = 0;
  int f = 0;
  int m = 0;
  for(int i = 0; i < in.size(); i++) {
   if(f == 0 && (in[i] == 'A' || in[i] == 'C' || in[i] == 'G' || in[i] == 'T')) {
      f = 1;
      a++;
      m = max(a,m);
   }
   else if(f == 1 && (in[i] == 'A' || in[i] == 'C' || in[i] == 'G' || in[i] == 'T')) {
     a++;
     m = max(a, m);
   }
   else if(!(in[i] == 'A' || in[i] == 'C' || in[i] == 'G' || in[i] == 'T')) {
     f = 0;
     a = 0;
   }
  }
  cout << m;
  return 0;

}


Measured memory_bytes: 256
import java.util.*;
class Main{
	public static void main(String[] argv){
		//rated();
		accepted();
	}
	static void rated(){
		Scanner sc = new Scanner(System.in);
		int rate = sc.nextInt();
		if (rate<1200){
			System.out.println("ABC");
		}else{
			if(rate<2800){
				System.out.println("ARC");
			}else{
				System.out.println("AGC");
			}
		}
	}
	static void accepted(){
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		String ans = "AC";
		/*
		*先頭がA
		*先頭から三文字目から後ろから二文字目の間にCをちょうどひとつ含む．
		*A，C以外は小文字
		*/
		if(s.charAt(0)!='A'){
			ans = "WA";
		}
		if(Character.isUpperCase(s.charAt(1))){
			ans = "WA";
		}
		
		boolean hasC = false;
		for(int i=2;i<s.length()-1;i++){
			if(Character.isUpperCase(s.charAt(i))){
				if(hasC){
					ans = "WA";
				}
				if(s.charAt(i)=='C'){
					hasC = true;
				}
			}
		}
		if(Character.isUpperCase(s.charAt(s.length()-1))||hasC==false){
			ans = "WA";
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 23764