akhauriyash/Code-Regression huggingface dataset:
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

  private int[] memoF;

  public static void main(String[] args) {
    
    new Main().run();
  }

  public void run() {

    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      memoF = new int[n+1];

      System.out.println( fibonacci(n) );
    }
    catch (IOException e) {
      System.out.println("IOException!");
    }
  }

  private int fibonacci(int n) {
    if( (n == 0) || (n== 1) ) return memoF[n] = 1;
    if( memoF[n] != 0 ) return memoF[n];

    return memoF[n] = fibonacci(n-2) + fibonacci(n-1);
  } 
}


Measured memory_bytes: 24044
#include <stdio.h>
using namespace std;
int main()
{
	int A,B,C,X;
	scanf("%d%d%d%d",&A,&B,&C,&X);
	//A-500    B-100     C-50
	int count=0;
	for(int i=0;i<=A;i++)
	{
		for(int j=0;j<=B;j++)
		{
			for(int k=0;k<=C;k++)
			{
				if(i*500+j*100+k*50==X)
				{
					count++;
				}
			}
		}
	}
	printf("%d",count);
	return 0;
}


Measured memory_bytes: 256
import sys
input = sys.stdin.readline
k, t = map(int,input().split())
A = list(map(int,input().split()))

A.sort(reverse=True)
if t == 1:
    print(A[0] - 1)
else:
    a = A[0]
    b = sum(A[1:])
    print(max(0,a-b-1))

Measured memory_bytes: 38384
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

K=int(input())
S=len(input())

def COMinit(n,MOD):
    fac,finv,inv=[0]*max(2,n+1),[0]*max(2,n+1),[0]*max(2,n+1)
    fac[0]=fac[1]=1
    finv[0]=finv[1]=1
    inv[1]=1
    for i in range(2,(n+1)):
        fac[i]=fac[i-1]*i%MOD
        inv[i]=MOD-inv[MOD%i]*(MOD//i)%MOD
        finv[i]=finv[i-1]*inv[i]%MOD
    return fac,finv,inv

fac,finv,inv=COMinit(K+S,MOD)

def COM(n, k, MOD=MOD):
    if n<k or n<0 or k<0:
        return 0
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD


ans=0
for i in range(K+1):
    ans+=pow(26,i,MOD)*pow(25,K-i,MOD)*COM(K+S-i-1,S-1)
    ans%=MOD
print(ans)

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

int main() {
    string s;
    cin >> s;
    for (int i = 0; i < s.length()%2; i++) {
        if (s[i] != s[s.length() - 1 - i]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include <iostream>
int main() {
	int X,A=1;
	std::cin >> X;
	while(A==1){
		A = 0;
		for (int i = 2; i < X; i++) {
			if (X % i == 0) {
				A = 1;
			}
		}
		X++;
	}
	std::cout << X-1;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
 
  public static void main(String[] args) { 
      Scanner sc = new Scanner(System.in);
      int n = sc.nextInt();
      int[] arr = new int[n];
      int xor = 0;
      for(int i = 0; i < n; i++) {
        arr[i] = sc.nextInt();
        xor ^= arr[i];
      }
      StringBuilder sb = new StringBuilder();
      for(int i = 0; i < n; i++) {
        if(i == n - 1)
          sb.append(xor ^ arr[i]);
        else
          sb.append((xor ^ arr[i]) + " ");
      }
      System.out.println(sb.toString());
  }
}

Measured memory_bytes: 61772
#include<stdio.h>

int main(void){
  long long n , m;
  scanf("%lld %lld",&n ,&m);
    long long ans = n*m - 2*(n+m-2);
  
  
  if(n == 1 || m == 1){
    if(n != 1 || m != 1){
      ans *= -1;
  	}
  }

  printf("%lld\n",ans);

  return 0;
}

Measured memory_bytes: 1696
#include <iostream>
#include <vector>
#include <set>
using namespace std;

int main(){
    int N;
    while(cin>>N){
        if(N == 0) break;
        int M[110][110] = {-1};
        
        for(int i=0; i<N; i++){
            int m;
            cin>>m;
            for(int j=0; j<m; j++){
                cin>>M[i][j];
            }
        }

        int K;
        cin>>K;
        vector<int> L(K);
        for(int i=0; i<K; i++) cin>>L[i];

        vector<int> cnt(N,0);
        bool flag = true;
        bool found = false;
        int ans;

        for(int i=0; i<K; i++){
            for(int j=0; j<N; j++){
                for(int k=0; k<110; k++){
                    if(M[j][k] == -1) break;
                    if(L[i] == M[j][k]){
                        cnt[j]++;
                    }                           
                }
            }
        }

        for(int i=0; i<N; i++){
            if(cnt[i] == K){
                if(found) flag = false;
                if(!found){
                    ans = i+1;
                    found = true;
                }
            }
        }

        if(!found || !flag) ans = -1;

        cout<<ans<<endl;
    }

    return 0;
}


Measured memory_bytes: 3132
using System;

public class Hello
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine().Trim());
        for (int i = 0; i < n; i++)
        {
            string[] line = Console.ReadLine().Trim().Split(' ');
            var a = long.Parse(line[0]);
            var b = long.Parse(line[1]);
            var w = (long)Math.Sqrt(a * b);
            long ret;
            if (w * (w + 1) < a * b) ret = 2 * w - 1;
            else if (w * w == a * b && w != a) ret = 2 * w - 3;
            else ret = 2 * w - 2;
            Console.WriteLine(ret);
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

// 二項係数を用いる
const int MAX = 1000100;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

  // テーブルを作る前処理
  /* facが普通の階乗を求めている。invが逆数を求めている。finvが逆数の階乗を求めている。*/
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < MAX; i++) {
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD/i) % MOD;
        finv[i] = finv[i-1] * inv[i] % MOD;
    }
}

  // 二項係数を計算する
long long COM(int n, int k) {
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n-k] % MOD) % MOD;
}

long long n, m;

struct yakudata {
    long long no; long long cnt;
};

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

    // 取り敢えず因数分解
    vector<yakudata> sosuu;
    long long check = m;

    int ilimit = sqrt(check)+1;
    for(int i = 2; i <= ilimit; ++i) {
        if(check % i == 0) {
            yakudata indata;
            indata.no = i;
            long long icnt = 0;
            while(check % i == 0) {
                icnt++;
                check /= i;
            }
            indata.cnt = icnt;
            sosuu.emplace_back(indata);
        }
    }
    if(check != 1) {
        yakudata pdata;
        pdata.no = check; pdata.cnt = 1;
        sosuu.emplace_back(pdata);
    }

    long long ans = 1;
    for(int i = 0; i < sosuu.size(); ++i) {
        int ccnt = sosuu.at(i).cnt;
        // cout << sosuu.at(i).no << " " << ccnt << endl;
        ans *= COM(ccnt+(n-1), ccnt);
        ans %= MOD;
    }

    cout << ans << endl;
}

Measured memory_bytes: 23680
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors
n = inp()
a = inpl()
now = a[0]
for i in range(1,n):
    now = math.gcd(now,a[i])
if now != 1:
    print('not coprime')
    quit()
se = set()
for x in a:
    for y in make_divisors(x):
        if y == 1: continue
        if y in se:
            print('setwise coprime')
            quit()
        se.add(y)
print('pairwise coprime')

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

int main() {
  int64_t a;
  string b;
  cin>>a>>b;

  int b2 = ((int)(b[0])-48)*100 + ((int)(b[2])-48)*10 + (int)(b[3])-48;

  cout<<(a*b2)/100<<endl;

  return 0;
}

Measured memory_bytes: 3628
#include<cmath>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
#define ALL(a) a.begin(), a.end()
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.sise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
typedef pair<int, int> P;

//int use[250];
vector<pair<int,int>> L;
int visited[55];
vector<int> to[51];

void dfs(int u){
    visited[u]=1;
    for(int v:to[u]){
        if(visited[v]==0){
            dfs(v);
        }
    }
    visited[u]=2;
    return;
}

int main(){
    int n,m;
    int ans=0;
    cin >> n>> m;
    rep(i,m){
        int a,b;
        cin >> a>> b;
        a--;b--;
        L.push_back(mp(a,b));
    }
    rep(i,m){
        rep(j,n){
            visited[j]=0;
            to[j].clear();
        }
        for(int j=0;j<m;j++){
            if(j!=i){
                int a=L[j].fi;
                int b=L[j].se;
                to[a].push_back(b);
                to[b].push_back(a);
            }
        }
        dfs(0);
        bool connect=1;
        rep(j,n){
            //cerr<<visited[j]<<' ';
            if(visited[j]==0){
                connect=0;
            }
        }
        //cerr<<endl;
        if(connect!=1){
            //cerr<<L[i].fi+1<<' '<<L[i].se+1<<endl;
            ans++;
        }
        //cerr<<endl;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;

int main(){
    int a;
    string s;

    cin >> a;
    cin >> s;

    if(a >= 3200) cout << s << endl;
    else cout << "red" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <limits.h>
#include <vector>
#include <algorithm>
#include <cstring>
using namespace std;

int main() {
    int n, sum, m, l;
    cin >> n;
    m = n;
    l = n / 10;
    for (int i = 0; i < 10; i++) {
        sum = sum + m - l * 10;
        m = m / 10;
        l = l / 10;
    }
    if (n % sum == 0) cout << "Yes";
  	else cout << "No";
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define pb push_back
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)(x).size()
using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<ll, int> plli;
typedef vector<pii> vpii;
typedef tree<pii, null_type, less<pii>, rb_tree_tag,
    tree_order_statistics_node_update> ost;

const int N=1<<18;
const ll P=924844033;
const ll R=452640358;

ll w[N], fact[N], rpv[N], rpc[N];

ll pw(ll x, ll n) {
    ll ans=1;
    while(n) {
        if(n&1) ans=ans*x%P, n--;
        x=x*x%P, n/=2;
    }
    return ans;
}

ll mpw(ll a11, ll a12, ll a21, ll a22, ll n) {
    ll u1=1, u2=1, v1, v2, v11, v12, v21, v22;
    while(n) {
        if(n&1) {
            v1=(a11*u1+a12*u2)%P;
            v2=(a21*u1+a22*u2)%P;
            u1=v1, u2=v2;
            n--;
        }
        v11=(a11*a11+a12*a21)%P;
        v12=(a11*a12+a12*a22)%P;
        v21=(a21*a11+a22*a21)%P;
        v22=(a21*a12+a22*a22)%P;
        a11=v11, a12=v12, a21=v21, a22=v22;
        n/=2;
    }
    return u1;
}

void FFT(ll x, int d0, int dn, int s0, int ss) {
    int i, dh=dn/2;
    ll u, v, y=1;
    if(dn==1) {
        rpc[d0]=rpv[s0];
        return;
    }
    FFT(x*x%P, d0, dh, s0, 2*ss);
    FFT(x*x%P, d0+dh, dh, s0+ss, 2*ss);
    for(i=0; i<dh; i++) {
        u=rpc[d0+i], v=rpc[d0+i+dh]*y%P;
        rpc[d0+i]=(u+v)%P;
        rpc[d0+i+dh]=(u+P-v)%P;
        y=y*x%P;
    }
}

int main() {
    int i, n, k, b, n1, n2, m1, m2;
    ll invN=pw(N, P-2), t, ans;
    scanf("%d%d", &n, &k);

    b=n/(2*k);
    if(n%(2*k)<=k) n1=2*b, m1=n%(2*k);
    else n1=2*b+1, m1=n%(2*k)-k;
    n2=n1-1; m2=k-m1;
    m1*=2, m2*=2;

    for(fact[0]=w[0]=1, i=1; i<N; i++) {
        w[i]=w[i-1]*R%P;
        fact[i]=fact[i-1]*i%P;
    }

    for(i=0; i<N; i++) {
        rpv[i]=invN;
        t=mpw(1, w[i], 1, 0, n1);
        rpv[i]=rpv[i]*pw(t, m1)%P;
        t=mpw(1, w[i], 1, 0, n2);
        rpv[i]=rpv[i]*pw(t, m2)%P;
    }
    FFT(w[N-1], 0, N, 0, 1);

    ans=0;
    for(i=0; i<=n; i++) {
        if(i&1) ans=(ans+P-fact[n-i]*rpc[i]%P)%P;
        else ans=(ans+fact[n-i]*rpc[i])%P;
    }
    printf("%lld\n", ans);
    return 0;
}

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

#define INF 1.1e9
#define LINF 1.1e18
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(), (v).end()

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

vector<int> v[100100];
ll n,m;
int color[100100];

bool dfs(int g,int c) {
	color[g]=c;
	for(auto i:v[g]) {
		if(color[i]==c) return false;
		if(color[i]==0&&!dfs(i,-c)) return false;
	}
	return true;
}

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

	cin>>n>>m;
	REP(i,m) {
		int a,b; cin>>a>>b; a--;b--;
		v[a].push_back(b); v[b].push_back(a);
	}
	REP(i,n) {
		if(color[i]==0) {
			if(!dfs(i,1)) {
				cout<<n*(n-1)/2-m<<endl;
				return 0;
			}
		}
	}
	ll b=0,w=0;
	REP(i,n) {
		if(color[i]==1) b++;
		else w++;
	}
	cout<<b*w-m<<endl;

	return 0;
}


Measured memory_bytes: 6528
import Control.Monad
import Control.Applicative
import Data.List
import qualified Data.Map as Map
import Data.Array
import qualified Data.ByteString.Char8 as BC
import Data.Maybe
import qualified Data.Set as Set
import qualified Data.Sequence as Sq
import qualified Data.IntMap as IMap
import qualified Data.Vector as V
import Data.Sequence (ViewL(..),ViewR(..),(><),(<|),(|>),Seq)

bsreadInt :: BC.ByteString -> Int
bsreadInt = fst . fromJust . BC.readInt

sqleft :: Seq a -> a
sqleft q = sqleft_(Sq.viewl q)
sqleft_ :: ViewL a -> a
sqleft_ (x :< xs) = x
sqright :: Seq a -> a
sqright q = sqright_(Sq.viewr q)
sqright_ :: ViewR a -> a
sqright_ (xs :> x) = x

-----------------------------------------------------------
stepa :: Int -> Int -> [V.Vector Int] -> Int
stepa t i csfs = head [s + f * j + c | j <- [0..] , s + f * j >= t]
                 where csf = (csfs !! (i-1))
                       c = (V.!) csf 0
                       s = (V.!) csf 1
                       f = (V.!) csf 2

step :: Int -> Int -> Int -> [V.Vector Int] -> Int
step i n t csfs = if (i==n)
                  then t
                  else step (i+1) n (stepa t i csfs) csfs

main = do
    n <- readLn :: IO Int
    csfin <- map ((map bsreadInt . BC.words)) <$> replicateM (n-1) BC.getLine
    let csfs = map (V.fromList) csfin
    mapM_ print $ [step i n 0 csfs | i <- [1..(n-1)]] ++ [0]

Measured memory_bytes: 11516
eval"H,W,*A="+`dd`.split*?,
t=7**5
i=0
A.pop(H*W).zip(A){|a,b|a=(a-b).abs
i%W<1&&N=0
N|=$*[-W]||0**i<<t
$*<<N=N<<a|N>>a
i+=1}
p (0..t).find{|i|N[t+i]+N[t-i]>0}

Measured memory_bytes: 47360
n=int(input())
a=map(int,input().split())
c=[0]*n
col=0
mx=0
for i in a:
	if c[i]==0:
		col+=1
	c[i]+=1
	mx=max(mx,i)
if col>2:
	print("No")
elif col==1:
	if mx==n-1 or 2*mx<=n:
		print("Yes")
	else:
		print("No")
else:
	x,y=c[mx-1],c[mx]
	if x+1<=mx and mx<=x+y/2:
		print("Yes")
	else:
		print("No")

Measured memory_bytes: 10664
#include <iostream>
#include <algorithm>

using namespace std;

int bubbleSort(int A[], int N) {
    bool bContinue = true;
    int ex = 0;
    int sorted = 0;
    while (bContinue) {
        bContinue = false;
        for (int j = N - 1; j >= sorted +1; j--) {
            if (A[j] < A[j - 1]) {
                swap(A[j - 1], A[j]);
                bContinue = true;
                ex++;
            }
        }
        sorted++;
    }
    return ex;
}

int main()
{
    int N{ 0 };
    cin >> N;

    if (N < 1 || N>100) return 1;

    int A[100];
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    int ex = bubbleSort(A, N);

    for (int i = 0; i < N; i++) {
        if (i != 0) cout << ' ';
        cout << A[i];
    }
    cout << endl;

    cout << ex << endl;

}


Measured memory_bytes: 3084
s = input()
ans = 0
cntA = 0
for i in range(0, len(s) - 1):
    if s[i] == 'A':
        cntA += 1
    elif s[i: i + 2] == "BC":
        ans += cntA
    elif i > 0 and s[i - 1: i + 1] == "BC":
        continue
    else:
        cntA = 0
print(ans)

Measured memory_bytes: 3500
/*
                                Author: Ankit Kaul
**********************Code Belongs to Respective Author Only************************************
*/
 
/*#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")*/

#include <bits/stdc++.h>

#define endl       '\n'
#define PI          3.141592653589
#define jaldi       ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define M           1000000007
#define int         long long int
#define inf         INT_MAX
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
using namespace std;
 
int gcd(int a,int b) { return b == 0 ? a : gcd(b, a % b); }
int power(int x,int n){
    int result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x) % M;
        x=(x*x)% M;
        n=n/2;
    }
    return result % M;
}
signed main()
{   jaldi
	int n;
	cin>>n;
	int a[n],i;
	double sum=0;
	for(i=0;i<n;i++)
	{	cin>>a[i];
		sum+=(double)1/a[i];
	}
	cout<<(double)1/sum;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
    int a,b,x,y,tmp,amari,i;
    
    while(1)
    {
        scanf("%d %d",&a,&b);
        if(a==0 && b==0) break;
        else
        {
            i=0;
            x=a; y=b;
            if(x<y) {tmp=x; x=y; y=tmp;}
            while(1)
            {
                if(y==0) break;
                else
                {
                amari=x%y;
                x=amari;
                tmp=x; x=y; y=tmp;
                i++;
                }
            }
            printf("%d %d\n",x,i);
        }
    }
    return 0;
}


Measured memory_bytes: 2072
package main

import "fmt"

func main() {
	var A, B, C, D int
	fmt.Scan(&A, &B, &C, &D)

	ans := f(B, C, D) - f(A-1, C, D)
	fmt.Println(ans)
}

func f(x, C, D int) int {
	return x - (x / C) - (x / D) + (x / lcm(C, D))
}

func gcd(A, B int) int {
	if B == 0 {
		return A
	}
	return gcd(B, A%B)
}

func lcm(A, B int) int {
	return (A * B) / gcd(A, B)
}


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

using namespace std;

#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back

template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    string a, b, c;
    cin >> a >> b >> c;
    cout << string{a[0], b[1], c[2]} << endl;
}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#define GRAY  2 
#define WHITE 1
#define BLACK 3 
#define INF -1
int n,color[110],d[110],Q[110],adj[110][110];
int head=0,tail=0;


void enQ(int s){
  Q[tail]=s;
  if(tail==110)tail=0;
  else tail++;
}
int deQ(){
  int a;
  a=Q[head];
  if(head==100)head==0;
  else head++;

  return a;
}

void bfs(int s){
  int i,j,u;
  for(i=2;i<=n;i++){
    color[i]=WHITE;
    d[i]=INF;
  }

  color[s]=GRAY;
  d[s]=0;
 
  enQ(s);

  while(tail!=head){
 
    u = deQ();
 
    for( j = 1; j <= n; j++ ){
      if(color[j]==WHITE&&adj[u][j]==1){
 
	color[j] = GRAY;
 
	d[j] = d[u] + 1;
 
	enQ(j);
      }
    }
    color[u]=BLACK;
  }

}


int main(){

  int u,k,v,i,j;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d%d",&u,&k);
    for(j=0;j<k;j++){
      scanf("%d",&v);
      adj[u][v]=1;
    }
  } 
  bfs(1);

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



}

Measured memory_bytes: 644
#include <iostream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <sstream>

using namespace std;

int main() {
    int flag = 0;
    string a;

    cin >> a;

    int len = a.length();

    for(int i = 0;i < len;i++){
        for(int j = 0;j < len;j++){
            if(i == j){
                break;
            }
            if(a[i] == a[j]){
                flag = 1;
            }
        }
    }

    if(flag){
        cout << "no" << endl;
    }
    else{
        cout << "yes" << endl;
    }
    
    return 0;
}




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

int d[5555][5555];

int main(){
    int n;
    std::string s;
    std::cin >> n >> s;
    int res = 0;
    for (int i = s.size() - 1; i >= 0; i -- )
        for (int j = s.size() - 1; j > i; j -- ){
            d[i][j] = s[i] == s[j] ? d[i + 1][j + 1] + 1 : 0;
            d[i][j] = std::min(d[i][j], j - i);
            res = std::max(d[i][j], res);
        }
    std::cout << res;
}

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

int main() {
    int n; cin >> n;
    int cnt = 0;
    for (int i = 1; i <= n; i++) {
        if (i <= 9) cnt++;
        else if (i <= 99);
        else if (i <= 999) cnt++;
        else if (i <= 9999);
        else if (i <= 99999) cnt++;
        else if (i <= 999999);
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) begin(x), end(x)
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
  #define debug(x) cout << #x " => " << (x) << endl
#else
  #define debug(x) 0
#endif
using lint = long long;
constexpr int    INF  = 1 << 28;
constexpr lint   INFL = 1LL << 60;
constexpr int    MOD  = (int)1e9 + 7;
constexpr double EPS  = 1e-9;
using namespace std;
namespace { struct INIT { INIT() { cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(15); } } INIT; }

// vector<vector<int>> dp;
int main(void) {
  int n, t;
  cin >> n >> t;
  vector<pair<int, int>> ab(n);
  rep (i, n) cin >> ab[i].first >> ab[i].second;
  auto bcomp =
    [](pair<int, int> &a, pair<int, int> &b) {
      if (a.second != b.second) return a.second > b.second;
      else return a.first < b.first;
    };
  sort(all(ab), bcomp);
  vector<pair<int, unordered_set<int>>> dp(t + 1);
  rep1 (i, t) {
    dp[i] = dp[i - 1];
    rep (j, n) {
      int prev = i - ab[j].first;
      if (prev < 0) continue;
      auto &prevset = dp[prev].second;
      if (prevset.find(j) != prevset.end()) continue;
      if (dp[i].first < dp[prev].first + ab[j].second) {
        dp[i] = dp[prev];
        dp[i].first += ab[j].second;
        dp[i].second.insert(j);
      }
    }
  }
  int maxi = dp[t].first;
  rep (i, t) {
    int  sum = dp[i].first;
    auto &map = dp[i].second;
    int  tmp = 0;
    rep (j, n) {
      if (map.find(j) == map.end()) {
        tmp = max(tmp, ab[j].second);
      }
    }
    sum += tmp;
    maxi = max(maxi, sum);
  }
  cout << maxi << endl;
  return 0;
}

Measured memory_bytes: 196096
//submitted by HimJ
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define pb push_back
#define fi first
#define se second
#define fr(i,s,e) for(i=s;i<e;i++)
#define ms(arr,val) memset(arr,val,sizeof(arr))
using namespace std;
const int mxn=1e5+1;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
  ll t=1;
  //cin>>t;
    while(t--){
            int a,b;
    cin>>a>>b;
    if(a>8)
        cout<<":(";
    else if(b>8)
        cout<<":(";
    else
        cout<<"Yay!";
            

    }
  return 0;
  }



Measured memory_bytes: 896
//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
//-----------------------------------------
#define dcml(n) fixed<<setprecision(n)
using namespace std;
int main(void){
    ll N;cin>>N;
    if(N/100==7||N%100/10==7||N%10==7)cout<<"Yes\n";
    else cout<<"No"<<"\n";
}

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

using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define reps(i, m, n) for (int i = m; i <= n; ++i)

using i64 = long long;
using pii = pair<i64, i64>;

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

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = int(1e9) + 7;

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

  int N;
  string S;
  cin >> N >> S;

  int ans = 0;
  int i = 0;
  while (true) {
    if (S.substr(i, 2) == "OX" || S.substr(i, 2) == "XO") {
      ++ans;
      i += 2;
    }
    else ++i;

    if (i >= N) break;
  }

  cout << ans << "\n";

  return 0;
}


Measured memory_bytes: 3352
n,y = map(int,input().split())

for i in range(n+1):
    for j in range(n+1-i):
        k = n - i - j
        if (10000*i + 5000*j + 1000*k) == y:
            print(i,j,k)
            exit()

print(-1,-1,-1)


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <vector>
#include <algorithm> // sort
#include <map> // pair
#include <queue>
#include<iomanip>
#include <cmath>
#include <set>
#include <unordered_set>

#define ABS(x) ((x)>0?(x):-(x))
#define MIN(x,y) ((x)>(y)?(y):(x))
#define MAX(x,y) ((x)<(y)?(y):(x))

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

#define INF 1000000000

using namespace std;
typedef long long ll;

ll newton(long long int a, long long int  b)
{
	if(a==b)
		return a;
	while(a != 0 && b != 0)
	{
		if(a > b)
		{
			b += a;
			a = b-a;
			b -= a;
		}
		b %= a;
	}
	return a;
}

struct UnionFind {
	vector<int> p;
	UnionFind(int N):p(N)
	{
		for(int i=0; i< N; i++)
		{
			p[i] = i;
		}
	}
	int root(int x)
	{
		if(p[x] == x)
			return x;
		return p[x] = root(p[x]);
	}
	void unite(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		if(rx == ry) return;
		p[rx] = ry;
	}
	bool issame(int x, int y)
	{
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};

//大きな数に対する割り算をするとき、MODを指定することで掛け算の値に変換できる

ll div2mul_calc(ll a, ll b, ll m)
{
	if (b == 0) {
        return 1;
    } else if (b % 2 == 0) {
        ll d = div2mul_calc(a, b / 2, m);
        return (d * d) % m;
    } else {
        return (a * div2mul_calc(a, b - 1, m)) % m;
    }
}
ll div2mul(ll n, ll mod)
{
	return div2mul_calc(n, mod-2, mod);
}

ll twoRow(ll a, ll b, ll mod)
{
	ll ret = 1;
	for(ll i = 1 ;i <= a+b;++i)
	{
		ret *= i;
		ret %= mod;
	}
	for(ll i = 1 ;i <= a;++i)
	{
		ret *= div2mul(i,mod);
		ret %= mod;
	}
	for(ll i = 1 ;i <= b;++i)
	{
		ret *= div2mul(i,mod);
		ret %= mod;
	}
	return ret;
}

struct edge {
    int from; //出発点
    int to;   //到達点
    int cost; //移動コスト
};

vector< ll > divisor(ll n) {
  vector< ll > ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return (ret);
}
/*
小数の桁数を指定する
	cout << setprecision(8)<< mp[0]-mx << endl;
*/

int main()
{
	ll i,j,k,a,b;
	char c;
	ll N,M,T;
	// vector<ll> mp;
	ll mp[512][512] = {0};
	ll ans[512][512] = {0};
	ll border[512] = {0};
	cin >> N >> M >> T;
	for(i=0;i<N;++i)
	{
		for(j=0;j<M;++j)
		{
			cin >> c;
			if(c=='#')
			{
				mp[i][j]=1;
				border[j] = 1;
			}
		}
	}
	ll l,r;
	l=0;
	ll num = 1;
	ll lr = 0;
	for(r=1;r<=M;++r)
	{
		if(border[r-1]==1)
		{
			j=0;a=0;
			while(!a)
			{
				for(k=l;k<r;++k)
				{
					if(mp[j][k])
					{
						a = 1;
					}
					ans[j][k] = num;
				}
				++j;
			}
			for(;j<N;++j)
			{
				a = 0;
				for(k=l;k<r;++k)
				{
					if(mp[j][k])
					{
						a = 1;
					}
				}
				if(a==1)
				{
					num++;
				}
				for(k=l;k<r;++k)
				{
					ans[j][k] = num;
				}
			}
			l = r;
			num++;
			lr = r;
		}
	}
	for(i=0;i<N;++i)
	{
		for(j=lr;j<M;++j)
		{
			ans[i][j] = ans[i][j-1];
		}
	}
	for(i=0;i<N;++i)
	{
		for(j=0;j<M;++j)
		{
			cout<<ans[i][j];
			if(j != M-1)
				cout<< " ";
		}
		cout << endl;
	}
	return 0;
}




















Measured memory_bytes: 4864
x1, y1, x2, y2 = map(int, input().split())
a = x2 - x1
b = y2 - y1
x3 = x2 - b
y3 = y2 + a
x4 = x1 - b
y4 = y1 + a
print(x3, y3, x4, y4)

Measured memory_bytes: 3060
#include <iostream>
 
using namespace std;
 
int sx;
int sy;
int nx[40];
int ny[40];
int n;
int a,b;
int cnt;
 
int j( int sx , int sy ){
 
  if( sx == a && sy == b ){
    cnt++;
    /* cout << cnt << endl;*/
    return cnt;
  }
  for( int i = 0 ; i < n ; i++ ){
    if( sx == nx[i] && sy == ny[i] ) return cnt;
  }
   
  if( sx + 1 <= a && sy <= b ) j( sx + 1 , sy );
  if( sx <= a && sy + 1 <= b ) j( sx , sy + 1 ); 
   
  return cnt;
}
 
int main(void){
   
  while(1){
     
    cin >> a >> b;
    if( a == 0 && b == 0 )break;
    cin >> n;
     
    for( int i = 0 ; i < n ; i++ ){
      cin >> nx[i] >> ny[i];
    }
     
    sx = 1;
    sy = 1;
    cnt = 0;
 
    cout << j( sx , sy ) << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef ll Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<pii,int,int> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf=sizeof(Def)==sizeof(long long)?2e18:1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	string s,t;
	cin>>s>>t;
	vs out;
	rep(i,s.size()-t.size()+1){
		bool h=true;
		rep(j,t.size())if(s[i+j]!='?'&&s[i+j]!=t[j])h=false;
		if(h){
			string tmp=s;
			rep(j,s.size())if(s[j]=='?')tmp[j]='a';
			rep(j,t.size())tmp[i+j]=t[j];
			out.pb(tmp);
		}
	}
	sort(all(out));
	if(out.size())cout<<out[0]<<endl;
	else cout<<"UNRESTORABLE"<<endl;
}
/*
int main(){
	int n;
	cin>>n;
	vp in(n+2);
	rep(i,n)cin>>in[i+1].first;
	rep(i,n)cin>>in[i+1].second;
	int out=0;
	loop(i,1,n+1){
		int a=in[i].second-in[i-1].first;
		int b=in[i].second-in[i+1].first;
		if(a+b<in[i].first){
			
		}
		int t=min(
		out+=
	}
	cout<<out<<endl;
}
*/









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

public class Main {
	public static void main(String[] args) throws Exception {
		try (BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {
			String S = br.readLine();

			System.out.println(S.lastIndexOf("Z") - S.indexOf("A") + 1);
		}
	}
}

Measured memory_bytes: 23764
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
const ll mod=1e9+7;
const int inf=1<<30;

int main(){
  int n; cin >> n;
  string s; cin >> s;
  int cnt=0;
  int cnt1=0;
  rep(i,n){
    if(s[i]==')') cnt++;
    else cnt--;
    chmax(cnt1,cnt);
  }
  cnt=0;
  int cnt2=0;
  for(int i=n-1;i>=0;i--){
    if(s[i]=='(') cnt++;
    else cnt--;
    chmax(cnt2,cnt);
  }
  string s1;
  string s2;
  rep(i,cnt1){
    s1+='(';
  }
  rep(i,cnt2){
    s2+=')';
  }
  string ans=s1+s+s2;
  cout << ans << endl;
  
}

Measured memory_bytes: 256
H,W = map(int,input().split())
S = [input().strip() for _ in range(H)]
flag = 0
for i in range(H):
    for j in range(W):
        if S[i][j]=="#":
            if (j+1<W and S[i][j+1]=="#") or (j-1>-1 and S[i][j-1]=="#") or (i-1>-1 and S[i-1][j]=="#") or (i+1<H and S[i+1][j]=="#"):
                continue
            else:
                flag = 1
                break
    if flag==1:break
if flag==0:
    print("Yes")
else:
    print("No")


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

int main() {
	string S;
	cin >> S;
	if (S.substr(0, 2) > "00" && S.substr(0, 2) < "13") {
		if (S.substr(2, 2) > "00" && S.substr(2, 2) < "13") cout << "AMBIGUOUS";
		else cout << "MMYY";
	}
	else {
		if (S.substr(2, 2) > "00" && S.substr(2, 2) < "13") cout << "YYMM";
		else cout << "NA";
	}
}

Measured memory_bytes: 256
package main

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

const MAX = 10000

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	num, _ := strconv.Atoi(scanString())
	return num
}

func scanString() string {
	sc.Scan()
	return sc.Text()
}

func init() {
	sc.Split(bufio.ScanWords)
}

func countingSort(A []int, n int) []int {
	C := make([]int, MAX+1)
	for _, e := range A {
		C[e]++
	}
	for i := 1; i < len(C); i++ {
		C[i] = C[i] + C[i-1]
	}
	B := make([]int, n)
	for _, e := range A {
		B[C[e]-1] = e
		C[e]--
	}
	return B
}

func main() {
	n := scanInt()
	A := make([]int, n)
	B := make([]int, n)
	for i := range A {
		A[i] = scanInt()
	}

	B = countingSort(A, n)
	fmt.Println(strings.Trim(fmt.Sprint(B), "[]"))
}



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


int main(){
    int N; cin >> N;
    string S, T;
    cin >> S >> T;
    rep(i,N){
        cout << S[i] << T[i];
    }
}

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

const int mxn = 3001;
const int M = 1e9 + 7;

int n;
double ans;

int main() {
	ans = 0.0;
	cin >> n;
	vector<double> p(n);
	
	for(int i = 0; i < n; i++) {
		cin >> p[i];
	}
	vector<double> dp(n+1);
	dp[0] = 1.0;
	
	for(int i = 1; i <= n; i++) {
		//vector<double> new_dp(n+1);
		//for(int heads = 0; heads <= i; heads++) {
			//if(heads == 0) {
				//new_dp[heads] = dp[heads] * (1 - p[i-1]);
			//}
			//else new_dp[heads] = dp[heads] * (1 - p[i-1]) + dp[heads-1] * p[i-1];
		//}
		//dp = new_dp;
		for(int heads = i; heads >= 0; heads--) {
			if(heads == 0) dp[heads] = dp[heads] * (1 - p[i-1]);
			else dp[heads] = dp[heads] * (1 - p[i-1]) + dp[heads - 1] * p[i-1];
		}
	}
	
	for(int i = 1; i <= n; i++) {
		if(i > (n-i)) {
			ans += dp[i];
		}
	}
	cout << setprecision(10);
	cout << ans << "\n";
}


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

using ll=long long;

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

signed main(){
	//while(1)
	solve();
}

Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

#define ll long long
#define forn(i, n) for (ll i = 0; i < (ll) n; ++i)
#define sz(a) static_cast<int>(a.size())

char buff[(int) 2e6 + 17];
const ll inf = (ll) 1e9 + 7ll;

const int maxn = (int) 2e5 + 17;

int a, b, c;

bool read() {
    if (scanf("%d %d %d", &a, &b, &c) != 3)
        return false;

    return true;
}

void solve() {
    if (a != b && a != c)
        cout << a << endl;
    else if (b != a && b != c)
        cout << b << endl;
    else
        cout << c << endl;
}

int main() {
#if SEREZHKA
    freopen("file.in", "r", stdin);
#endif

    while (read())
        solve();

    return 0;
}

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

#define irep(i,n) for(int i = 0; i < (int)(n); i++)
#define irep2(i,a,n) for(int i = (int)(a); i <= (int)(n); i++)
#define irrep(i,n) for(int i = (int)(n-1); i > -1; i--)
#define irrep2(i,n,a) for(int i = (int)(n); i >= (int)(a); i--)

#define fi first
#define se second

using namespace std;

using ll = long long;
using v_int = vector<int>;
using v2_int = vector<v_int>;
using v_ll = vector<ll>;
using v2_ll = vector<v_ll>;
using v_string = vector<string>;
using v_bool = vector<bool>;
using v2_bool = vector<v_bool>;
using pii = pair<int, int>;
using mii = map<int, int>;

const double PI = 3.1415926535897932;
const int INF = (int)2e9;
const ll LINF = (ll)2e18;
const ll MOD = 1000000007;
const int dc[8] = {1, -1, 0,  0, 1, -1,  1, -1};
const int dr[8] = {0,  0, 1, -1, 1,  1, -1, -1};

template<typename T, typename U> inline
ostream& operator<<(ostream &o, pair<T,U> &p) {
    return o << "{" << p.first << "," << p.second << "}";
}
template<typename T> inline
istream& operator>>(istream &is, vector<T> &vec) {
    for(auto &v : vec) { is >> v; }
    return is;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<T> &vec) {
    for(auto &v : vec) { os << v << ",";}
    return os;
}
template<typename T> inline
ostream& operator<<(ostream &os, vector<vector<T> > &mat) {
    for(auto &row : mat) { os << row << endl; }
    return os;
}
template<typename T> inline
void chmin(T &a, T b) { a = min(a, b); }
template<typename T> inline
void chmax(T &a, T b) { a = max(a, b); }

int main(void)
{
    int n;
    cin >> n;
    v_int a(n);
    cin >> a;
    
    ll mx = a[0];
    ll ans = 0;

    irep2(i, 1, n-1) {
        if(mx > a[i]) {
            ans += mx - a[i];
        }
        chmax(mx,(ll)a[i]);
    }
    cout << ans << endl;
    return 0;
} /*atcoder*/


Measured memory_bytes: 3976
#include<bits/stdc++.h>
using namespace std;
void pre(){}
void solve(){
    long long int n , k ; cin>>n>>k;
    long long int arr[n] ;
    for(long long int i=0;i<n;i++) cin>>arr[i];
    bool dp[100001]{0};
    dp[0] = 0;
    for(long long int i=0;i<=k;i++){
        if(!dp[i]){
            for(auto j:arr){
                if(j+i<=100000){
                    dp[i+j]=1;
                }
            }
        }
    }
    if(dp[k]){
        cout<<"First"<<"\n";
    }else{
        cout<<"Second"<<"\n";
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    pre();
    long long int num = 1;
    //cin>>num;
    for(long long int i=0;i<num;i++){
       	solve();
    }   
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














int D, T, S;
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> D >> T >> S;

	int x = T * S;
	if (D <= x) cout << "Yes" << endl;
	else cout << "No" << endl;
}







Measured memory_bytes: 3620
#include <bits/stdc++.h>
#include <algorithm>
#include <unordered_map>
#define ull unsigned long long
#define int long long
#define ll long long
#define fr(i, n) for (int i = 0; i < n; i++)
#define frf(i, j, n) for (int i = j; i <= n; i++)
#define frd(i, n) for (int i = n; i >= 0; i--)
#define mp(i, j) make_pair(i, j)
#define pb(x) push_back(x)
using namespace std;
// typedef vector<vector<ll>> matrix;
// const ll PRIME = 1e9 + 7;
// typedef pair<int,pair<int,int> >  ppi;

void solve()
{
    int n;
    cin>>n;
    if(n>=30)
    {
        cout<<"Yes";
    }
    else
    {
        cout<<"No";
    }
    

}
int32_t main()
{

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    int t;
    // cin >> t;
    t = 1;
    while (t--)
    {
        solve();
    }
}

Measured memory_bytes: 3644
#include<bits/stdc++.h>
#define betheflash ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define ll long long int
#define ull unsigned long long int
#define ld long double
#define pii pair<int,int>
#define vi vector<int>
#define vs vector<string>
#define vvi vector<vector<int>>
#define mii map<int,int>
#define msi map<string,int>
#define mis map<int,string>
#define pb push_back
#define mod 1000000007
#define PI 3.141592653589793238
using namespace std;
int main()
{
    betheflash
    long double n,ans;
    cin>>n;
	ans=n/3;
	ans=pow(ans,3);
	cout<<fixed<<setprecision(12)<<ans;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String w = sc.next();
        if(judge(w)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
    static boolean judge(String s){
        int [] a = new int [26];
        for(int i=0; i<s.length(); i++){
            int t = s.charAt(i)-'a';
            a[t]++;
        }
        for(int j=0; j<26; j++){
            if(a[j]%2==1){
                return false;
            }
        }
        return true;
    }
}

Measured memory_bytes: 9672
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <cmath>
#include <queue>
#include <set>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define INF int(1e9)
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define REPONE(i, n) for(int i = 1; i <= (int)(n); i++)
#define EACH(i, mp) for(auto i:mp)
#define FOR(i, m, n) for(int i = m;i < n;i++)
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

const int MAX_N = 2 * int(1e5);
ll K, N, A[MAX_N];
unordered_map<ll, ll> mp;

void solve() {
    vector<pair<ll, ll> > v(mp.begin(), mp.end());
    sort(v.begin(), v.end(), [](pair<ll, ll> a, pair<ll, ll> b) { return a.second < b.second; });
    ll ans = 0;
    REP(i, v.size() - K) {
        ans += v[i].second;
    }
    cout << ans << endl;
}

int main() {
    cin >> N >> K;
    REP(i, N) {
        cin >> A[i];
        mp[A[i]]++;
    }
    solve();
    return 0;
}


Measured memory_bytes: 13128
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define ALL(x) x.begin(),x.end()
#define DBG(x) cout<<#x<<":"<<x<<endl
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;
const ll p = 1e9+7;
const ll INF = 1LL << 60;

ll dp[22][1<<22];

int main(){
  int n,a[22][22];
  cin>>n;
  for(int i=0;i<n;i++){
    for(int j=0;j<n;j++){
	 cin>>a[i][j];
    }
  }
  vector<int> stand[22];
  for(int i=0;i<1<<n;i++){
    int cnt=0;
    for(int j=0;j<n;j++){
	 cnt+=(i>>j&1);
    }
    stand[cnt].PB(i);
  }
  dp[0][(1<<n)-1]=1;
  for(int i=0;i<n;i++){
    for(int j=0;j<stand[n-i].size();j++){
	 int nj=stand[n-i][j];
	 // DBG(nj);
	 for(int k=0;k<n;k++){
	   if(a[i][k]==0)continue;
	   if(nj>>k==0)continue;
	   dp[i+1][nj-(1<<k)]+=dp[i][nj];
	   dp[i+1][nj-(1<<k)]%=p;
	 }
    }
  }
  cout<<dp[n][0]<<endl;
  return 0;
}


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

using namespace std;
const int N=2e5+10;
int a[N];
const int MAX=1e9+10;
vector <int> g[N];

int main()
{
    memset(a,0,sizeof(a));
   int n,k;
   cin>>n>>k;
   int ans=n;
   for(int i=1;i<=k;i++){
        int d;
        cin>>d;
        for(int j=1;j<=d;j++){
            int tmp;
            cin>>tmp;
            if(a[tmp]==0) ans--;
            a[tmp]=1;
        }
   }
   cout<<ans<<endl;

}


Measured memory_bytes: 8972
#include<stdio.h>
int main() {
	int a, b,i,j;
	while (scanf("%d %d", &a, &b) && a&&b) {
		for (i = 1; i <= a; ++i) {
			for (j = 1; j <= b; ++j) {
				if ((i+j) % 2==0) printf("#");
				else printf(".");
			}
			printf("\n");
		}
		printf("\n");
	}
	return 0;
}


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

using namespace std;

#define endl "\n"
#define lln long long int
#define IOS ios::sync_with_stdio(0);cin.tie(0);

int main(){
    IOS;

    int x , t;
    cin >> x >> t;
    cout << max(0,x-t) << endl;
    return 0;    
}

Measured memory_bytes: 3588