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

using namespace std;

typedef long long ll;
typedef vector<ll> vi;
typedef vector<double> vd;
typedef vector<vi> vvi;
typedef pair<ll, ll> pii;
typedef vector<pii> vpii;

int main() {
  ll N;
  cin >> N;

  vpii v1(N), v2(N);

  for (ll i = 0; i < N; i++) {
    cin >> v1[i].first >> v1[i].second;
  }

  for (ll i = 0; i < N; i++) {
    cin >> v2[i].first >> v2[i].second;
  }

  unordered_set<ll> v1_used, v2_used;

  for (ll i = 0; i < N; i++) {
    ll fr;
    {
      pii p = make_pair(-1, -1); // (idx, x)
      for (ll j = 0; j < N; j++) {
        if (v2_used.find(j) == v2_used.end()) {
          if (p.first == -1 || p.second > v2[j].first) {
            p = make_pair(j, v2[j].first);
          }
        }
      }
      fr = p.first;
    }

    ll to;
    {
      pii p = make_pair(-1, -1);
      for (ll j = 0; j < N; j++) {
        if (v1_used.find(j) == v1_used.end()) {
          if (p.first == -1 || p.second < v1[j].second) {
            if (v1[j].first < v2[fr].first && v1[j].second < v2[fr].second) {
              p = make_pair(j, v1[j].second);
            }
          }
        }
      }
      to = p.first;
    }

    v2_used.insert(fr);

    if (to != -1) {
      v1_used.insert(to);
    }
  }

  cout << v1_used.size() << endl;
}

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

using namespace std;

const int OO = 1e9;
const double EPS = 1e-9;

#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#ifdef LOCAL
#define db(...) ({cout << "> Line " << __LINE__  \
		<< ": "; _db(#__VA_ARGS__, __VA_ARGS__);})
#define RNG() rng()
#else
#define db(...) true
#define RNG() true
#endif

template<class T>
void _db(const char *dbStr, T e) {
	cout << dbStr << " = " << e << endl;
}
template<class T, class... L>
void _db(const char *dbStr, T e, L... r) {
  while(*dbStr != ',') cout << *dbStr++;
  cout << " = " << e << ','; _db(dbStr + 1, r...);
}
template<class S, class T>
ostream& operator<<(ostream& o, const map<S, T>& v) {
	o << "["; int i = 0;
	for (const pair<S, T>& pr : v) o << (!i++ ? "" : ", ") << "{"
	<< pr.fs << " : " << pr.sc << "}"; return o << "]";
}
template<template <class, class...> class S, class T, class... L>
ostream& operator<<(ostream& o, const S<T, L...>& v) {
	o << "["; int i = 0;
	for (const auto& e : v) o << (!i++ ? "" : ", ") << e;
	return o << "]";
}
template<class S, class T>
ostream& operator<<(ostream& o, const pair<S, T>& pr) {
	return o << "(" << pr.fs << ", " << pr.sc << ")";
}
ostream& operator<<(ostream& o, const string& s) {
	for (const char& c : s) o << c;
	return o;
}

template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;
template<class T> using VVV = VV<V<T>>;
using ll = long long;
using pii = pair<int, int>;
using vi = V<int>;
using vii = V<pii>;
using vvi = VV<int>;
using mii = map<int, int>;
using umii = unordered_map<int, int>;
using si = set<int>;
using usi = unordered_set<int>;


string s, t;
int K;


int main() {
	#ifdef LOCAL
	auto stTime = clock();
//	freopen("in.txt", "r", stdin);
	mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
	#endif
	ios::sync_with_stdio(false);
	cout.precision(10);
	cin.tie(0);

	cin >> s >> K;


	vi v;

	for (int i = 0; i < sz(s); ++i) {
		int cnt = 0;
		int j;
		for (j = i; j < sz(s) && s[j] == s[i]; ++j) {
			++cnt;
		}
		v.pb(cnt);
		i = j - 1;
	}


	ll ans = 0;
	db(v);
	for (auto& elem : v) {
		ans += elem / 2;
	}

	if (sz(v) == 1) {
		cout << (sz(s) * 1LL * K) / 2 << '\n';
	} else {
		if ((s[0] != s.back())) {
			cout << ans * K << '\n';
			return 0;
		}
		if (v[0] % 2 == 0 || v.back() % 2 == 0) {
			cout << ans * K << '\n';
			return 0;
		}
		cout << ans * K + (K - 1) << '\n';

	}



	#ifdef LOCAL
	cout << "\n\n\nExecution time: " <<
		(clock() - stTime) * 1e3 / CLOCKS_PER_SEC << " ms" << endl;
	#endif
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main(){
  int n,l;
  cin >> n >> l;
  vector<string> s(n);
  for(int i = 0;i < n;i++)cin >> s[i];
  sort(s.begin(),s.end());
  for(int j = 0;j < n;j++){
    cout << s[j];
  }
  return 0;
}


Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub fn read_n<T: FromStr>(n: usize) -> Vec<T> {
    read_n_logic::<T>(n, vec![])
}

pub fn read_n_logic<T: FromStr>(n: usize, mut a: Vec<T>) -> Vec<T> {
    match n {
        0 => a,
        _ => {
            a.push(read::<T>());
            read_n_logic(n - 1, a)
        }
    }
}
use std::cmp::{max, min};

fn main() {
    let n: i64 = read();
    if n % 10 == 7 || (n / 10) % 10 == 7 || (n / 100) % 10 == 7 {
        println!("{}", "Yes")
    } else {
        println!("{}", "No")
    }

}


Measured memory_bytes: 2128
#include<stdio.h>
int main(void){
	int A,B,C,D,E,F;
	scanf("%d %d %d %d %d",&A,&B,&C,&D,&E);
	if(A<=0){
		F=C*-A+D+B*E;
	}
	else{
		F=(B-A)*E;
	}
	printf("%d\n",F);
	return 0;
}


Measured memory_bytes: 2048
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <algorithm>
#include <set>
#include <unordered_map>
#include <queue>
#include <iomanip>

using namespace std;
long H, W;

int main() {
  cin >> H >> W;
  long ans;
  if (H%3 == 0 || W%3 == 0) {
    ans = 0;
  } else {
    ans = min(H, W);
  }

  for (long i=1; i<=W-1; i++) {
    long a = i*H;
    long b = (W-i)*(H/2);
    long c = H*W - a - b;
    long ma = max(max(a,b),c);
    long mi = min(min(a,b),c);
    ans = min(ans, ma-mi);
  }
  
  long tmp = H;
  H = W;
  W = tmp;

  for (long i=1; i<=W-1; i++) {
    long a = i*H;
    long b = (W-i)*(H/2);
    long c = H*W - a - b;
    long ma = max(max(a,b),c);
    long mi = min(min(a,b),c);
    ans = min(ans, ma-mi);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n = s.nextInt()- 1, a = s.nextInt(), c = 1;
        for(;n-->0;) {
            int b = s.nextInt();
            if (a <= b) {
                ++c;
                a = b;
            }
        }
        System.out.println(c);
    }
}


Measured memory_bytes: 23764
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define lamsort(v,p) sort(v.begin(),v.end(),[](p a, p b){return a.num < b.num;});
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e8
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n; cin >> n;
    vector<int> v(n);
    rep(i,n) cin >> v[i];
    int ans = 0;
    rep(i,n-1) {
        REP(j,i+1,n) {
            ans += v[i]*v[j];
        }
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
A=int(input())
B=int(input())
C=int(input())
X=int(input())

 
counter = 0
 
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      x = 500*i+100*j+50*k
      if X == x:
        counter += 1
print(counter)

Measured memory_bytes: 3060
// AOJ ITP1_11_A Dice I
// 2018.4.29 bal4u

#include <stdio.h>

int rot[5][7] = {
{0,1,2,3,4,5,6},{0,2,6,3,4,1,5},{0,4,2,1,6,5,3},{0,3,2,6,1,5,4},{0,5,1,3,4,6,2}};
int assign[7];		// サイコロの1～6の各面に割り当てる数字
int tr['Z'];

void dice_init(int *a)
{
	int i;
	int t[5] = {0,'N','E','W','S'};
	for (i = 1; i <= 6; i++) assign[i] = a[i];
	for (i = 1; i <= 4; i++) tr[t[i]] = i;
}

char s[102];
int main()
{
	int i, k1, k2;
	int a[7], dice[2][7];
	char *p;

	for (i = 1; i <= 6; i++) scanf("%d", a+i);
	dice_init(a);
	scanf("%s", p=s);
	for (i = 1; i <= 6; i++) dice[0][i] = rot[0][i];
	for (k1 = 0, k2 = 1; *p; k1 = k2, k2 = !k2) {
		for (i = 1; i <= 6; i++) dice[k2][i] = dice[k1][rot[tr[*p]][i]];
		p++;
	}
	printf("%d\n", assign[dice[k1][1]]);
	return 0;
}




Measured memory_bytes: 2100
#include <stdio.h>

int board[105];
int A[105];
 
int main() {

	int N,M,X;

	scanf("%d %d %d",&N,&M,&X);

	int i;

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

	int cost=0;
	int ans;

	for(i=X;i<=N;i++){
	cost+=A[i];
	}
	ans=cost;

	cost=0;
	for(i=X;i>=0;i--){
	cost+=A[i];
	}
	if(cost>ans){
	printf("%d\n",ans);
	}
	else{
	printf("%d\n",cost);
	}

		return 0;
	}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
using namespace std;
int main(){
    int n,k;
    cin >> n>> k;
    int ans =0;
    if(n>k){
        ans +=(n-1)/(k-1);
        if((n-1)%(k-1)>0){
            ans ++;
        }
    }else{
        ans =1;
    }
    
    cout << ans << endl;
}

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

int main() {
    int N;  cin >> N;
    map<string, int> mp;
    for (int i = 0; i < N; ++i) {
        string s;  cin >> s;
        ++mp[s];
    }
    int M;  cin >> M;
    for (int i = 0; i < M; ++i) {
        string s;  cin >> s;
        --mp[s];
    }

    int ans = -1000000;
    for (auto e : mp) {
        ans = max(ans, e.second);
    }
    cout << max(0, ans) << endl;
}


Measured memory_bytes: 3616
H, W = map(int, input().split())
A = [list(map(int, input().split())) for _ in range(H)]

ans = []
for h in range(H - 1):
    for w in range(W):
        if A[h][w] % 2 == 1:
            A[h][w] -= 1
            A[h + 1][w] += 1
            ans.append((h, w, h + 1, w))

for w in range(W - 1):
    if A[H - 1][w] % 2 == 1:
        A[H - 1][w] -= 1
        A[H - 1][w + 1] += 1
        ans.append((H - 1, w, H - 1, w + 1))

print(len(ans))
for h, w, x, y in ans:
    print(h + 1, w + 1, x + 1, y + 1)


Measured memory_bytes: 22808
try:
    while True:
        a,b,c,d,e,f=map(float, input().split())
        x=(c*e-b*f)/(a*e-b*d)
        y=(a*f-c*d)/(a*e-b*d)
        if x==0:
            x=0
        if y==0:
            y=0
        print("{0:.3f}".format(round(x,3)), "{0:.3f}".format(round(y,3)))
except EOFError:
    pass

Measured memory_bytes: 7344
import java.io.*;
import java.util.*;
public class Main {
	static long MOD = 2 << 29;
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		char[] in = sc.next().toCharArray();
		int ans = 0;
		int g = 0;
		for(int i = 0; i < in.length; i++) {
			if(in[i] == 'g') {
				if(g != 0) {
					g--;
					ans++;
				}
				else {
					g++;
				}
			}
			else {
				if(g != 0) {
					g--;
				}
				else {
					g++;
					ans--;
				}
			}
		}
		System.out.println(ans);
	}
	
	
	
	
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        if (!hasNext()) throw new NoSuchElementException();
        int n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
}

Measured memory_bytes: 9428
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (int i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,v) for (int i = 0; i < v.size(); i++)
#define RREPALL(i,v) for (int i = v.size()-1; i >= 0; i--)
#define SORT(v) sort(v.begin(), v.end())
#define MIN_ELEMENT(v) min_element(v.begin(), v.end())
#define MAX_ELEMENT(v) max_element(v.begin(), v.end())
#define COUNT(v,n) count(v.begin(), v.end(), n);
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
typedef long long ll;
typedef unsigned long long ull;
const int INF = 1e7;
const ll MOD = 1e9 + 7;

char c[55][55];
int dx[] = {1,1,0,-1,-1,-1,0,1}, dy[] = {0,1,1,1,0,-1,-1,-1};

int main()
{
    int h, w;
    cin>>h>>w;
    REP(i,h) REP(j,w) {
        cin>>c[i+1][j+1];
    }
    REP(i,h) {
        REP(j,w) {
            if (c[i+1][j+1] == '#') {
                cout<<'#';
            } else {
                int o = 0;
                REP(k,8) {
                    o += c[i+1+dx[k]][j+1+dy[k]] == '#' ? 1 : 0;
                }
                cout<<o;
            }
        }
        cout<<endl;
    }


    return 0;
}


Measured memory_bytes: 256
# B - Coins
A = int(input())
B = int(input())
C = int(input())
X = int(input())

count = 0
for i in range(A+1):
    for j in range(B+1):
        for k in range(C+1):
            if X == 500 * i + 100 * j + 50 * k:
                count += 1

print(count)

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

using namespace std;
int main() {
	int N;
	int L[2000];
	int n=0;
	cin >> N;
	for (int i = 0; i < N; i++)
	{
		cin >> L[i];
	}

	sort(L, L+N);
	for (int i = 0; i < N; i++)
	{
		for (int j = 0; j < i; j++)
		{
			
			for (int k = 0; k < j; k++)
			{
				
				if (L[i]<L[j]+L[k])
				{
					n++;
				}
				
			}
		}
	}
	
	cout << n;
	return 0;

}

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

#define ll long long 
#define all(x) (x).begin(),(x).end()
#define vll vector<ll>
#define vi vector<int>
#define pi pair<int,int>
#define vp vector<pi>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define f(i,x,z) for(ll i=x;i<z;i++)
#define debug(x) cout<<'DEBUG------> '<<x<<endl
#define srt(v) sort(v.begin(), v.end())
#define clr(x) memset(x, 0, sizeof(x)) 
#define mi map<int,int>
#define mod 1000000007
//  for (auto &a : A)
//cin >> a;
//for (auto m : map) {

int main()
{
//   freopen('input.txt', 'r', stdin);
//   freopen('output.txt', 'w', stdout);
    ios::sync_with_stdio(0);// Input and output clearance
    cin.tie(0);
    ll a,co=0;
    bool x=false;
    cin>>a;
    f(i,0,a)
    {
        ll b,c;
        cin>>b>>c;
        if(b==c)
        {
            co++;
        }
        else
        {
            co=0;
        }
        if(co>2)
        {
            x=true;
        }
        
    }
    if(x==true)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    
   return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
using namespace std;

int main()
{
    int x,y,a,b,c;
    vector<int>v1;
    vector<int>v2;
    vector<int>v3;
    cin >> x >>y >> a >> b >> c;
    int delicious;
    while(a--){
        cin >> delicious;
        v1.push_back(delicious);
    }
    while(b--){
        cin >> delicious;
        v2.push_back(delicious);
    }
    while(c--){
        cin >> delicious;
        v3.push_back(delicious);
    }
    sort(v1.begin(),v1.end(),greater<int>());
    sort(v2.begin(),v2.end(),greater<int>());
    //sort(v3.begin(),v3.end(),greater<int>());
    for(int i=0;i<x;i++)
        v3.push_back(v1[i]);
    for(int i=0;i<y;i++)
        v3.push_back(v2[i]);
    sort(v3.begin(),v3.end(),greater<int>());
    long long ans = 0 ;
    for(int i=0;i<x+y;i++)
        ans+=v3[i];
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 6104
#include <stdio.h>
#define MAX 100000

int A[MAX], n;

int partition(int p,int r){
	int x, i, j, t;
	x=A[r];
	i=p-1;
	for(j=p; j<r; j++){
	if(A[j] <= x){
		i++;
		t=A[i]; A[i] = A[j]; A[j]=t;
		}
	}
	t=A[i+1]; A[i+1]=A[r]; A[r]=t;
	return i+1;
}

int main() {
	int i,q;
	
	scanf("%d",&n);
	for( i=0; i<n; i++ ) scanf("%d",&A[i]);
	
	q = partition(0, n-1);
	
	for( i=0; i<n; i++){
	if ( i ) printf(" ");
	if ( i == q ) printf("[");
	printf("%d",A[i]);
	if ( i==q ) printf("]");
	}
	printf("\n");
	
	return 0;
}



Measured memory_bytes: 2128
#include <iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<algorithm>
#include<math.h>
#include<string>
#include <bits/stdc++.h>
using namespace std;

int main()
{unsigned long long x;cin>>x;
if(x<5)
{
    cout<<0;
    return 0;
}
if(x==5)
{
    cout<<5;
    return 0;
}
if(x%500==0)
{
cout<<x*2;
return 0;
}
if(x<500 )
{
    if(x%5==0)
    {cout<<x;
    return 0;}

    while(x--)
    {
        if(x%5==0)
        {
            cout<<x;
            return 0;
        }
    }
}else{
int counter=0;

    while(x--)
    {
        if(x%500==0)
        {
            cout<<x*2+counter;
            return 0;
        }
        if(x%5==0)
        {
        counter+=5;
        }
    }
}



      return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long u_ll;
typedef pair<int, int> pair_;
 
const int INF = 1001001001;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, -1, 0, 1};
int k;
 
int gcd(int a, int b){
    if(b == 0) return a;
 
    return gcd(b, a%b);
}
 
int main(){

    int a,b;
    cin >> a >> b;

    if((a/10 == 0)&&(b/10 == 0)) cout << a*b;
    else cout << "-1";

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define mod 998244353
#include<string.h>
#define inf 1000000000000000000
#define maxn 200006
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
#define endl '\n'
#define mapint_iterator map<int,int> :: iterator
#define mapll_iterator map<ll,ll> :: iterator
#define setint_iterator set<int> :: iterator
#define setll_iterator set<ll> :: iterator
#define setpint_iterator set<pint> :: iterator
#define setpll_iterator set<pll> :: iterator
#define trace(x) cout<<#x<<": "<<x<<" "<<endl
#define trace2(x,y) cout<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x,y,z) cout<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a,b,c,d) cout<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define cout1(a) cout<<a<<endl
#define cout2(a,b) cout<<a<<' '<<b<<endl
#define cout3(a,b,c) cout<<a<<" "<<b<<" "<<c<<endl
#define cout4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<endl
#define vcout(v,i) cout<<v[i].fi<<" "<<v[i].se<<endl
typedef priority_queue<ll,vector<ll>,greater<ll> > pqset;
typedef priority_queue<pint,vector<pint>,greater<pint> > pqset_ll;
#define pb push_back
#define fi first
#define se second
#include<ext/pb_ds/assoc_container.hpp>
ll dxk[]={0,0,1,-1,1,1,-1,-1};
ll dyk[]={1,-1,0,0,1,-1,1,-1};
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> os;
typedef tree<pll,null_type,less<pll>,rb_tree_tag,tree_order_statistics_node_update> os_pair;
#define acc (ios::sync_with_stdio(false),cin.tie(0))
#define rep(i,n) for(ll i=0;i<n;i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define per1(i,n) for(ll i=n;i>0;i--)
#define repeat(i,start,n) for(ll i=start;i<n;i++)
#define print(a,n) for(ll i=0;i<n;i++){ cout<<a[i]<<" ";}
ll ll_max(ll a,ll b,ll c){return max(a,max(b,c));}
int int_max(int a,int b,int c){return max(a,max(b,c));}
ll ll_min(ll a,ll b,ll c){return min(a,min(b,c));}
int int_min(int a,int b,int c){return min(a,min(b,c));}
ll max(int a,ll b){ return max((ll)a,b);}
ll min(int a,ll b){ return min((ll)a,b);} 
ll min(ll a,int b){ return min(a,(ll)b);}
ll max(ll a,int b){ return max(a,(ll)b);}
ll dx[]={0,0,1,-1};
ll dy[]={1,-1,0,0};
ll power(ll a,ll b){
	if(a==1)
		return 1;
	if(b==0)
		return 1;
	ll c=power(a,b/2);
	ll res=1;
	if(b%2){
		res=(c*c)%mod;
		res*=a;
		res%=mod;
	}
	else
		res=((c*c)%mod);
	return res;
}
//ifstream cin("b_read_on.txt"); ofstream cout("output3.txt");
//Chronology: Binary Search,Greedy,dp,dfs and similar
//Use (<<) for multiplication
//Use (>>) for division
// In dp, first try top-down,then bottom-up
//ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);cout<<fixed;cerr.tie(NULL);cout.precision(10);
// find_by_order -> value at index
// order_of_key -> index of value
void solve(int countu){
	int n;
	cin>>n;
	string s;
	set<string> s1;
	rep(i,n){
		cin>>s;
		s1.insert(s);
	}
	cout1(s1.size());
}
int main(){
    int t=1;
	//scanf("%d",&t);
	int countu=1;
    while(t--){
    	solve(countu);
    	countu++;
    }
}


Measured memory_bytes: 19176
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    int  N, K;
    cin >> N >> K;
    vector<int> L(N);

    for (int i = 0; i < N; i ++){
        cin >> L.at(i);
    }
    sort(L.rbegin(), L.rend());

    int answer = 0;
    for (int i = 0; i < K; i++){
        answer += L.at(i);
    }

    cout << answer << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cfenv>
#include <cmath>
#include <string>

using namespace std;

int main(){
  string s;
  cin >> s;
  int len = s.length();

  for(int i=0; i<len; i++){
    cout << "x";
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;


int main() {
string S;
cin >> S;
sort(S.begin(),S.end());
if (S.at(0) == 'a' && S.at(1) == 'b' && S.at(2) == 'c') {
    cout << "Yes" << endl;
} else cout << "No" << endl;



return 0;
}


Measured memory_bytes: 256
N, K = map(int, input().split())
values = list(map(int, input().split()))

# 1<=N<=50
# 1<=K<=100
# 10**8になってしまうので、全探索は無理そう？？？？


# CDは最後に持ってくれば良い。途中でやる必要はない
# A,Bをそれぞれ何回やるか決めれば、価値はわかるのでは。ただし、A,Bの数を合わせてKにならない場合もあり、その場合はリリースしないといけない
ans = 0

for i in range(K + 1):
    for j in range(K - i + 1):
        # 抜き出す動作がNを超えてしまった時、入れて取り出すという作業によって暇つぶしをする必要がある。
        # print(i, j, release_count)
        # i + j + relase_count = K
        for k in range(K - i - j + 1):
            if i + j < N:
                left_nums = values[0:i].copy()
                right_nums = values[N - j:N].copy()
                nums = sorted(left_nums + right_nums)
                ans = max(ans, sum(nums[k:]))
            elif i + j == N:
                nums = sorted(values.copy())
                ans = max(ans, sum(nums[k:]))
            else:
                if k < N - (i + j):
                    continue
                nums = sorted(values.copy())
                ans = max(ans, sum(nums[k - (N - (i + j)):]))


print(ans)


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

int main() {
 int A,B,Max;
  Max=A+B;
  
  cin >> A;
  cin >> B;
  
  if (A+B<A-B && A*B<A-B) Max=A-B;
   else if (A+B<A*B && A-B<A*B) Max=A*B;
   else Max=A+B;
  
  cout << Max;
  cout << endl;
  
  
}

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

using ll = long long;
using ul = unsigned long;
using ull = unsigned long long;
#define vec vector
#define rep(_i,_n) for(ll _i = 0; _i < _n; _i++)
#define rep2(_i,_s,_n) for(ll _i = _s; _i < _n; _i++)
#define elif else if
#define push(_a) push_back(_a)
#define fullSort(_a) sort(_a.begin(), _a.end())
#define inputVecI(_name, _n) vec<int> _name(_n);rep(_i, _n)cin >> _name[_i];
#define inputVecL(_name, _n) vec<long> _name(_n);rep(_i, _n)cin >> _name[_i];
#define inputVecLL(_name, _n) vec<ll> _name(_n);rep(_i, _n)cin >> _name[_i];
#define inputVecS(_name, _n) vec<string> _name(_n);rep(_i, _n)cin >> _name[_i];
#define findMaxIdx(_name) distance(_name.begin(), max_element(_name.begin(), _name.end()))
#define printVec(_vec) cout << "{";rep(i, _vec.size()-1)cout << _vec[i] << ",";cout << _vec[_vec.size()-1];cout << "}\n";
#define append(_x) push_back(_x)
#define mapLoop(_i, _name) for(auto i = _name.begin(); i != _name.end(); i++)

int main()
{
    ull X, a = 100;
    cin >> X;
    ull ans = 0;
    while(1){
      ans++;
      a += a/100;
      if(a >= X){
        break;
      }
    }
    cout << ans << endl;
		return 0;
}


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

public class Main {

	private static void solve(){
		//Implement solution here.
		int n = ni();
		int m = ni();
		long[] a = nal(n);
		
		
		int[] div2 = new int[n];
		long result = 0;
		for(int i = 0; i < n; i++)a[i] /= 2;
		for(int i = 0; i < n; i++) {
			long tmp = a[i];
			while(tmp %2 == 0) {
				div2[i]++;
				tmp /= 2;
			}
			if(i > 0 && div2[i] != div2[i - 1]) {
				System.out.println(0);
				return;
			}
		}
		long lcm = 1;
		for(int i = 0; i < n; i++) {
			lcm = lcm(lcm,a[i]);
		}

		result = m / lcm;
		result = result % 2 == 1 ? result / 2 + 1 : result / 2;
		System.out.println(result);
	}
	
	//Find greatest common divisor
	static long gcd (long a, long b) {
		return b > 0 ? gcd(b, a%b) : a;
	}
	//Find least common multiple
	static long lcm (long a, long b) {
		return a * b / gcd(a, b);
	}


	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		solve();
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

Measured memory_bytes: 40844
import java.util.*;

class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int c[][] = new int[3][3];
		for(int i=0; i<3;i++){
			for(int j=0; j<3;j++){
				c[i][j] = sc.nextInt();
			}
		}

		for(int i=0; i<=100; i++){
			int a = i;
			int b1 = c[0][0] - i;
			int b2 = c[0][1] - i;
			int b3 = c[0][2] - i;

			if(c[1][0] - b1 == c[1][1] - b2 && c[1][1] - b2 == c[1][2] - b3){
				if(c[2][0] - b1 == c[2][1] - b2 && c[2][1] - b2 == c[2][2] - b3){
					System.out.println("Yes");
					return;
				}
			}
		}
		System.out.println("No");

	}
}




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

int main()
{
    uint16_t nn = 0;
    uint32_t pivot = 1;
    uint32_t cur_cost = 0;
    uint32_t pls_cost = 0;
    //uint32_t dis_cost = 0;
    uint32_t next_cost = 0;
    //uint32_t count = 0;
    uint32_t ans = 0;
    std::cin >> nn;

    std::vector<int32_t> vec(nn);
    
    /* entering  */
    for(int i = 0; i < nn; i++){
        std::cin >> vec[i];
    }

    /* とりあえず中間地点に集会所を配置して計算 */
    /*集会所を移動してコストが増えるか減るかで次の移動先を決定 */

    /* 初回の計算 */
    for(int j = 0; j < nn; j++){
        cur_cost += (vec[j] - pivot) * (vec[j] - pivot);
    }

    //std::cout << "first pivot is " << pivot << std::endl;
    //std::cout << "first cur cost is " << cur_cost << std::endl;

    while(1){
        //std::cout << count << " now pivot is " << pivot << std::endl;
        pls_cost = 0;
        for(int j = 0; j < nn; j++){
            pls_cost += (vec[j] - (pivot + 1)) * (vec[j] - (pivot + 1));
        }
        //std::cout << count << " xx cur cost is " << cur_cost << std::endl;
        //std::cout << count << " xx pls cost is " << pls_cost << std::endl;
        
        /* for(int k = 0; k < nn; k++){
            dis_cost += (vec[k] - (pivot - 1)) * (vec[k] - (pivot - 1));
        }
        std::cout << count << "dis cur cost is " << cur_cost << std::endl;
         */
        if(pls_cost < cur_cost){
            pivot++;
            cur_cost = pls_cost;
            //std::cout << "here pls cont" << std::endl;
            continue;
        /* }else if(dis_cost < cur_cost){
            pivot--;
            cur_cost = dis_cost;
            std::cout << "here dis cont" << std::endl;
            continue; */
        }else{
            //std::cout << "here break" << std::endl;
            break;
        }

        //std::cout << count << "cur cost is " << cur_cost << std::endl;
        //count++;
    }

    //std::cout << count << "ans before is " << pivot << std::endl;

    for(int j = 0; j < nn; j++){
        ans += (vec[j] - pivot) * (vec[j] - pivot);
    }
    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
int N,K;
int a[100000];

int main()
{
    while(scanf("%d%d",&N,&K),N!=0||K!=0)
    {
        for(int i=0;i<N;i++)scanf("%d",&a[i]);
        int ma=a[0];
        for(int i=1;i<K;i++)ma+=a[i];
        int sum=ma;
        for(int i=K;i<N;i++)
        {
            sum-=a[i-K];
            sum+=a[i];
            if(sum>ma)ma=sum;
        }
        printf("%d\n",ma);
    }
    return 0;
}

Measured memory_bytes: 1580
a1, b1 = map(int, input().split())
a2, b2 = map(int, input().split())
a3, b3 = map(int, input().split())

all_num = []
all_num.append(a1)
all_num.append(a2)
all_num.append(a3)
all_num.append(b1)
all_num.append(b2)
all_num.append(b3)

for x in range(1, 5):
    if all_num.count(x) >= 3:
        print('NO')
        break
else:
    print('YES')

Measured memory_bytes: 3064
#include<iostream>
using namespace std;
int l[100001];
int r[100001];
int templ[100001];
int tempr[100001];
void margesort(int a[], int a_len, int left, int right);

int main(){
	int n;

	int i;
	cin >> n;
	for (i = 0; i < n; i++) {
		cin >> l[i];
		cin >> r[i];
	}
	margesort(l, n, 0, n - 1);
	int minR, min2R, maxL, max2L;
	minR = 1000000001;
	min2R = 1000000001;
	maxL = 0;
	max2L = 0;
	int maxwidth = 0;
	for (i = 0; i < n; i++) {
		if (r[i] <= minR) {
			min2R = minR;
			minR = r[i];
		}
		else if (r[i] < min2R) {
			min2R = r[i];
		}
		if (l[i] >= maxL) {
			max2L = maxL;
			maxL = l[i];
		}
		else if (l[i] > max2L) {
			max2L = l[i];
		}
	}

	int ll, rr;
	for (i = 0; i < n; i++) {
		if (r[i] == minR) {
			rr = min2R;
		}
		else {
			rr = minR;
		}
		if (l[i] == maxL) {
			ll = max2L;
		}
		else {
			ll = maxL;
		}
		if (rr - ll >= 0) {
			if (rr - ll + r[i] - l[i] + 2 > maxwidth) {
				maxwidth = rr - ll + r[i] - l[i] + 2;
			}
		}
		else {
			if (r[i] - l[i] + 1 > maxwidth) {
				maxwidth = r[i] - l[i] + 1;
			}
		}
	}
	
	min2R = r[n - 1];
	max2L = l[n - 1];
	int j,w1,w2;
	for (i = n-2; i > 0; i--) {
		if (r[i] < min2R) {
			min2R = r[i];
		}
		if (l[i] > max2L) {
			max2L = l[i];
		}
		maxL = l[i - 1];
		if (r[i] == minR) {
			minR = 1000000001;
			for (j = 0; j < i; j++) {
				if (r[j] < minR) {
					minR = r[j];
				}
			}
		}
		if (min2R - max2L >= 0) {
			w2 = min2R - max2L + 1;
		}
		else {
			w2 = 0;
		}
		if (minR - maxL >= 0) {
			w1 = minR - maxL + 1;
		}
		else {
			w1 = 0;
		}
		if (w1 + w2 > maxwidth) {
			maxwidth = w1 + w2;
		}
	}
	cout << maxwidth;
	return 0;

}

void margesort(int a[], int a_len, int left, int right){
	int i, j, mid, L, R;

	if (right <= left)
		return;

	mid = (left + right) / 2;
	margesort(a, mid, left, mid);
	margesort(a, a_len - mid, mid + 1, right);

	for (i = left; i <= mid; i++) {
		templ[i] = a[i];
		tempr[i] = r[i];
	}
	for (i = mid + 1, j = right; i <= right; i++, j--) {
		templ[i] = a[j];
		tempr[i] = r[j];
	}
	L = left;
	R = right;

	for (i = left; i <= right; i++)
	{
		if (templ[L] <= templ[R])
		{
			a[i] = templ[L];
			r[i] = tempr[L];
			L++;
		}
		else
		{
			a[i] = templ[R];
			r[i] = tempr[R];
			R--;
		}
	}
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 4040,mo=998244353;
char s[N];int n,f[N][N],qz1[N],qz2[N];
void add(int &x, int y){x=(x+y)%mo;}
int main() {
	scanf("%s",s+1);n=strlen(s+1);
	rep(i,1,n)qz1[i]=qz1[i-1]+(s[i]=='0'?2:(s[i]=='1'?1:0));
	rep(i,1,n)qz2[i]=qz2[i-1]+(s[i]=='0'?0:(s[i]=='1'?1:2));
	rep(i,1,n)qz1[n+i]=qz1[n],qz2[n+i]=qz2[n];
	f[0][0]=1;
	rep(i,0,n*2-1)rep(j,0,i)if(f[i][j]){
		if(i+1-j<=qz2[i+1])add(f[i+1][j],f[i][j]);
		if(j+1<=qz1[i+1])add(f[i+1][j+1],f[i][j]);
	}
	cout<<f[n*2][qz1[n]];
	return 0;
}


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

using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define inf 1000000100

int main()
{
    int h, w;
    cin >> h >> w;
    while(h--)
    {
        string s;
        cin >> s;
        cout << s << endl;
        cout << s << endl;
    }
}

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

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

    string s;
    cin >> s;
    int ans = 0;

    for (int i = 0; i < 3; i++)
        if (s[i] == 'R') {
            int cnt = 0;
            for (int j = i; j < 3 && s[j] == 'R'; j++)
                cnt++;
            ans = max(ans, cnt);
        }
    cout << ans << '\n';
}

Measured memory_bytes: 3604
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#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 pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int n;
    cin >> n;
    VI a(n);
    map<int,int> M;
    REP(i,n){
        scanf("%d", &a[i]);
        M[a[i]] = i;
    }
    sort(a.begin(),a.end());
    int ans = 0;
    REP(i,n){
        if ((M[a[i]] % 2) != (i % 2)) ans++;
    }

    cout << ans/2 << endl;
    return 0;
}


Measured memory_bytes: 5376
#include<bits/stdc++.h>
using namespace std;
const int MAX_n=200;
const int inf=0x3f3f3f3f;
int n,l;
int sum;
int least=inf,least_b;
int a[MAX_n+10];
int b[MAX_n+10];
int main()
{
    cin>>n>>l;
    for(int i=1;i<=n;i++)
    {
        a[i]=l+i-1;
        sum+=a[i];
        if(a[i]>0)  b[i]=a[i];
        else b[i]=-a[i];
        if(b[i]<least)
        {
            least=b[i];
            least_b=i;
        }
    }
    sum-=a[least_b];
    cout<<sum;
    return 0;
}

Measured memory_bytes: 256
{-# OPTIONS_GHC -O #-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ViewPatterns #-}

import Control.Monad
import Control.Monad.ST
import Data.Char
import Data.List
import qualified Data.ByteString.Char8 as B
import qualified Data.ByteString.Lazy.Char8 as LB
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as MV
import qualified Data.Vector.Storable.Mutable as SMV
import qualified Data.Sequence as SQ
import Data.Sequence ((|>), (<|), ViewL(..), ViewR(..))

solve :: Int -> SQ.Seq Int -> SMV.IOVector Bool -> MV.IOVector (SQ.Seq Int) -> IO (SQ.Seq Int)
solve a p u v = do
    -- aにリンクしているノード
    lv <- MV.unsafeRead v a
    -- 最初のunusedなノード
    n <- fu u lv
    case n of
        Nothing -> return p
        Just nn  -> do
            SMV.unsafeWrite u nn True
            solve nn (nn<|p) u v

fu u s =
    if SQ.null s
        then return Nothing
        else case s of
            (SQ.viewl -> n:<ns) -> do
                f <- SMV.unsafeRead u n
                if f then fu u ns else return $ Just n

solve2 b p u v = do
    -- bにリンクしているノード
    lv <- MV.unsafeRead v b
    -- 最初のunusedなノード
    n <- fu u lv
    case n of
        Nothing -> return p
        Just nn  -> do
            SMV.unsafeWrite u nn True
            solve2 nn (p|>nn) u v

main = do
    [n,m] <- unfoldr (B.readInt.B.dropWhile isSpace) <$> B.getLine
    --
    [a,b] <- unfoldr (B.readInt.B.dropWhile isSpace) <$> B.getLine
    --
    v <- MV.replicate (n+1) SQ.empty
    forM_ [1..m-1] $ \_ -> do
        [x,y] <- unfoldr (B.readInt.B.dropWhile isSpace) <$> B.getLine
        MV.unsafeModify v (|>y) x
        MV.unsafeModify v (|>x) y
    --
    uv <- SMV.replicate (n+1) False
    SMV.unsafeWrite uv a True
    SMV.unsafeWrite uv b True
    --
    p <- solve a (SQ.fromList [a,b]) uv v
    (SQ.viewl -> r:<rs) <- solve2 b p uv v
    --
    print $ (+1) $ SQ.length rs
    --
    LB.putStr $ LB.pack $ show r
    --
    forM_ rs $ do \i -> do LB.putStr " "; LB.putStr $ LB.pack $ show i
    LB.putStrLn ""


Measured memory_bytes: 29052
#include <iostream>
#include <sstream>
#include <string>
#include <cmath>
#include <array>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <utility>
#include <iomanip>
#include <numeric>
#include <climits>
#include <algorithm>
#include <cstdint>
using namespace std;

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

    double res = (double)(a + b) / 2;

    if (res == floor(double(res)))
        cout << fixed << (long long)res;
    else cout << "IMPOSSIBLE";
}

Measured memory_bytes: 3600
//abc132_d.cpp
//Sat Jun 29 20:41:38 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

// ax + by = gcd(a, b) となるような (x, y) を求める
// 多くの場合 a と b は互いに素として ax + by = 1 となる (x, y) を求める
long long extGCD(long long a, long long b, long long &x, long long &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = extGCD(b, a%b, y, x); // 再帰的に解く
    y -= a / b * x;
    return d;
}

// 負の数にも対応した mod (a = -11 とかでも OK) 
inline long long mod(long long a, long long m) {
    return (a % m + m) % m;
}

// 逆元計算 (ここでは a と m が互いに素であることが必要)
long long mod_inv(long long a, long long m) {
    long long x, y;
    extGCD(a, m, x, y);
    return mod(x, m); // 気持ち的には x % m だが、x が負かもしれないので
}

int main(){
	ll n,k;
	cin >> n >> k;

	if (n==k){
		cout << 1 << endl;
		for (int i=1;i<k;i++){
			cout << 0 << endl;
		}
		return 0;
	}

	ll mod = 1000000007;

	ll kaijo[2101];
	kaijo[0] = 1;
	kaijo[1] = 1;
	for (int i=2;i<2100;i++){
		kaijo[i] = kaijo[i-1]*i%mod;
	}

	for (int i=1;i<=k;i++){
		if (i>n-k+1){
			cout << 0 << endl;
		}else{
			ll gyakugen1 = mod_inv(kaijo[n-k+1-i],mod);
			ll gyakugen2 = mod_inv(kaijo[i],mod);
			ll ans = kaijo[n-k+1]*gyakugen1%mod;
			ans = ans*gyakugen2%mod;

			ll aothresh = kaijo[k-1]*mod_inv(kaijo[k-1-i+1],mod)%mod;
			aothresh = aothresh*mod_inv(kaijo[i-1],mod)%mod;

			ll finalans = ans * aothresh % mod;
//			cout << i << " " << kaijo[n-k+1] << " " << aothresh << " " << finalans << endl;
			cout << finalans << endl;
		}
	}

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
    string s,t;
    cin>>s>>t;
    int i,count=0;
    for(i=0;i<3;i++) {
        if(s[i]==t[i]) {
            count++;
        }
    }
    cout<<count<<"\n";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
using namespace std;

template<class T>
void in(vector<T>& V) {
	for (auto itr = V.begin(); itr != V.end(); itr++)cin >> *itr;
	return;
}

template<class T>
void out(vector<T>& V) {
	for (T& itr : V)cout << itr << endl;
	return;
}

int main() {
	int N;
	cin >> N;
	cout << setprecision(12) << (long double)((N+1) / 2) / N << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=((n)-1);(i)>=0;(i)--)
#define itn int
#define all(x) (x).begin(),(x).end()
#define F first
#define S second
using P = pair <int,int>; //to, cost
using WeightedGraph = vector<vector <P>>; //to cost
const long long INF = 1LL << 60;
const int MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//https://www.creativ.xyz/dump-cpp-652/
#define repi(itr, ds) for (auto itr = ds.begin(); itr != ds.end(); itr++)
 
// vector
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec) is >> x;
    return is;
}
// pair
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
// vector
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "{";
    for (int i = 0; i < vec.size(); i++) {
        os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
// map
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
    os << "{";
    repi(itr, map_var) {
        os << *itr;
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
// set
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
    os << "{";
    repi(itr, set_var) {
        os << *itr;
        itr++;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
 
#define DUMPOUT cerr
 
void dump_func() {
    DUMPOUT << endl;
}
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
    DUMPOUT << head;
    if (sizeof...(Tail) > 0) {
        DUMPOUT << ", ";
    }
    dump_func(std::move(tail)...);
}

#ifdef DEBUG_
#define DEB
#define dump(...)                                                              \
    DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
            << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
            << endl                                                            \
            << "    ",                                                         \
        dump_func(__VA_ARGS__)
#else
#define DEB if (false)
#define dump(...)
#endif

signed main(void) { cin.tie(0); ios::sync_with_stdio(false);
    int x,a,b; cin>>x>>a>>b;
    bool isyammy = (a >= b);
    bool issafe = (b - a <= x);
    if(isyammy & issafe) cout<<"delicious"<<endl;
    else if(issafe) cout<<"safe"<<endl;
    else cout<<"dangerous"<<endl;
}


Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        k: i32,
        a: i32,
        b: i32,
    }

    for i in a..b + 1 {
        if i % k == 0 {
            println!("OK");
            return;
        }
    }
    println!("NG")
}


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

#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
#define MOD 1000000007

using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int iy[]={0, 0, 1, -1};
int ix[]={1, -1, 0, 0};

long long int n, m, ans;

int main(){
	cin >> n >> m;
	ans=1;
	if(n==m){
		for(int i=1;i<n+1;i++){
			ans=(ans*i+MOD)%MOD;
		}
		for(int i=1;i<n+1;i++){
			ans=(ans*i+MOD)%MOD;
		}
		ans=(ans*2+MOD)%MOD;
	}else if(n==m-1){
		for(int i=1;i<n+1;i++){
			ans=(ans*i+MOD)%MOD;
		}
		for(int i=1;i<m+1;i++){
			ans=(ans*i+MOD)%MOD;
		}
	}else if(n==m+1){
		for(int i=1;i<n+1;i++){
			ans=(ans*i+MOD)%MOD;
		}
		for(int i=1;i<m+1;i++){
			ans=(ans*i+MOD)%MOD;
		}
	}else{
		ans-=1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#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 ALL(c) (c).begin(), (c).end()
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<double> VD;
typedef vector<VD> VVD;

template<typename T> void chmin(T &a, T b) { if (a > b) a = b; }
template<typename T> void chmax(T &a, T b) { if (a < b) a = b; }

int in() { int x; scanf("%d", &x); return x; }
ll lin() { ll x; scanf("%lld", &x); return x; }

int main() {
    string s;
    cin >> s;
    sort(ALL(s));
    cout << (s[0] == s[1] && s[2] == s[3] && s[1] != s[2] ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 764