akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e15;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 400010;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> a(n);
    cins(all(a));
    RSORT(a);
    ll k = a[0],s = INF,ans;
    rep(i,1,n){
        ll c = abs(k/2-a[i]);
        if (k%2) chmin(c,abs(k/2+1-a[i]));
        if (chmin(s,c)){
            ans = a[i];
        }
    }
    cout << k << " " << ans << endl;
}


Measured memory_bytes: 1024
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math,O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define speed                   \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define oprecision    \
  cout.precision(30); \
  cerr.precision(7);
#define ll long long
#define ld long double
#define ss string
#define pii pair<int, int>
#define pll pair<ll, ll>
#define forn(n) for (int i = 1; i <= n; i++)
#define forlr(l, r) \
  for (int i = l; (l > r ? i >= r : i <= r); (l > r ? i-- : i++))
#define pb push_back
#define pc builtin_popcount
#define pcll builtin_popcountll
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define int ll
using namespace std;
const int mod = 1000000007;
int n, dp[100005][3];
vector<int> g[100005];
void dfs(int v = 1, int p = -1) {
  dp[v][1] = dp[v][2] = 1;
  for (auto to : g[v]) {
    if (to == p) continue;
    dfs(to, v);
    dp[v][1] *= (dp[to][1] + dp[to][2]);
    dp[v][2] *= dp[to][1];
    dp[v][1] %= mod;
    dp[v][2] %= mod;
  }
}
main() {
  speed;
  oprecision;
  // code
  cin >> n;
  forn(n - 1) {
    int u, v;
    cin >> u >> v;
    g[u].pb(v);
    g[v].pb(u);
  }
  dfs();
  cout << (dp[1][1] + dp[1][2]) % mod;
  // endl
#ifndef ONLINE_JUDGE
  cerr << "\nTime elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
  return 0;
}

Measured memory_bytes: 11520
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define l long
#define pb push_back
#define mp make_pair
#define mt make_tuple
int main() {
	// your code goes here
	//ifstream cin("input.txt");
	//ofstream cout("output.txt");
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
	
	ll a,b,c; cin>>a>>b>>c;
	cout<<(a*b)/2;
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <string>
#include <cmath>
#include <complex>
#include <numeric>
#include <cassert>

#include <vector>
#include <array>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <utility>

#define int64 long long
#define uint64 unsigned long long
using namespace std;

int main()
{
	string ss;
	cin >> ss;
	for(int64 ii = 1;ii < 4;ii++)
	{
		if(ss[ii] == ss[ii - 1])
		{
			puts("Bad");
			return 0;
		}
	}
	puts("Good");
	return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
int n,m,i,j,dp[2005][2005],pos[2005][2],col[4005],a[4005];
struct BIT
{
	int sum[4005];
	int lowbit(int x)
	{
		return x&(-x);
	}
	void add(int x,int y)
	{
		int i;
		for (i=x;i<=n*2;i+=lowbit(i)) sum[i]+=y;
	}
	int query(int x)
	{
		int i,s=0;
		for (i=x;i>0;i-=lowbit(i)) s+=sum[i];
		return s;
	}
}t;
int main()
{
	cin>>n;
	for (i=1;i<=n+n;i++)
	{
		char c;
		cin>>c>>a[i];
		if (c=='B') col[i]=1;
		pos[a[i]][col[i]]=i;
	}
	memset(dp,0x3f,sizeof(dp));
	dp[0][0]=0;
	for (i=0;i<=n;i++)
	{
		for (j=0;j<=n;j++)
		{
			if (i<n)
			{
				dp[i+1][j]=min(dp[i+1][j],dp[i][j]+pos[i+1][0]-1-t.query(pos[i+1][0]));
			}
			if (j<n)
			{
				dp[i][j+1]=min(dp[i][j+1],dp[i][j]+pos[j+1][1]-1-t.query(pos[j+1][1]));
				t.add(pos[j+1][1],1);
			}
		}
		for (j=1;j<=n;j++) t.add(pos[j][1],-1);
		if (i<n) t.add(pos[i+1][0],1);
	}
	cout<<dp[n][n];
	return 0;
}

Measured memory_bytes: 16000
#include <iostream>

using namespace std;
struct node{
    char type;
    int value;
    node *left, *right;
    node(){
        type='\0';
        value=-1;
        left=right=NULL;
    }
    ~node(){
        if(left!=NULL) delete left;
        if(right!=NULL) delete right;
    }
};

node *root;

int rec(node* p, int i, string str){
    if(i==str.size())return -1;
    if(str[i]=='0'||str[i]=='1'||str[i]=='2'){
        p->type='C';
        p->value=str[i]-'0';
        return i;
    }
    if(str[i]=='-'){
        p->type='-';
        p->left=new node();
        return rec(p->left,i+1,str);
    }
    if(str[i]=='P'||str[i]=='Q'||str[i]=='R'){
        p->type=str[i];
        return i;
    }
    if(str[i]=='('){
        p->left=new node();
        i=rec(p->left,i+1,str)+1;
        p->type=str[i];
        p->right=new node();
        i=rec(p->right,i+1,str)+1;
        return i;
    }
    return i;
}
int P,Q,R;

int rec2(node*p){
    if(p==NULL) return -1;
    if(p->type=='C') return p->value;
    if(p->type=='P') return P;
    if(p->type=='Q') return Q;
    if(p->type=='R') return R;
    if(p->type=='-'){
        switch(rec2(p->left)){
            case 0: return 2;
            case 1: return 1;
            case 2: return 0;
        }
    }
    if(p->type=='*'){
        int l,r;
        l=rec2(p->left);
        r=rec2(p->right);
        if(!l||!r)return 0;
        if(l==2&&r==2) return 2;
        return 1;
    }
    if(p->type=='+'){
        int l,r;
        l=rec2(p->left);
        r=rec2(p->right);
        if(l==2||r==2) return 2;
        if(!l&&!r) return 0;
        return 1;        
    }
    return -1;
}

int main(){
    string str;
    node *p;
    while(cin>>str,str[0]!='.'){
        root=new node();
        rec(root,0,str);
        int ans=0;
        for(P=0;P<3;P++){
            for(Q=0;Q<3;Q++){
                for(R=0;R<3;R++){
                    if(rec2(root)==2)ans++;
                }
            }
        }
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 3192
N = int(input())
count = 0
for num in range(1, N+1):
    result = []
    if num % 2 != 0:
        for n in range(1, num+1):
            if num % n == 0:
                result.append(n)

    if len(result) == 8:
        count += 1

print(count)


Measured memory_bytes: 2940
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <time.h>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <string.h>
#define sf scanf
#define pf printf
#define lf double
#define ll long long
#define p123 printf("123\n");
#define pn printf("\n");
#define pk printf(" ");
#define p(n) printf("%d",n);
#define pln(n) printf("%d\n",n);
#define s(n) scanf("%d",&n);
#define ss(n) scanf("%s",n);
#define ps(n) printf("%s",n);
#define sld(n) scanf("%lld",&n);
#define pld(n) printf("%lld",n);
#define slf(n) scanf("%lf",&n);
#define plf(n) printf("%lf",n);
#define sc(n) scanf("%c",&n);
#define pc(n) printf("%c",n);
#define gc getchar();
#define re(n,a) memset(n,a,sizeof(n));
#define len(a) strlen(a)
using namespace std;
//https://codeforces.com/contest/1213/problems
//https://codeforces.com/contest/1213/submit
int main(){
    int n;
    s(n)
    pf("ABC%d",n); pn

    return 0;
}


Measured memory_bytes: 888
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		final int MAXCOL = 2;
		boolean first = true;
		int[] matrix=null;
		int i=0;
		int num=0;
		int time=0;
		int total=0;
		String[] col2 = null;
		while(in.hasNext()){
			i++;
			String str = in.nextLine();
			if(first){
				String[] col1 = str.split(" ",0);
				num = Integer.parseInt(col1[0]);
				time = Integer.parseInt(col1[1]);
				first = false;
			}else{
				col2 = str.split(" ",0);
			}
			if(i==MAXCOL){
				break;
			}
		}
		for(int z=0;z<num-1;z++){
			int n1 = Integer.parseInt(col2[z]);
			int n2 = Integer.parseInt(col2[z+1]);
			int sa = n2 - n1;
			if(time > sa){
				total += time - sa;
			}
		}
		System.out.println(num*time - total);
	}

}


Measured memory_bytes: 54072
import java.util.*

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val s = sc.next()
    println(problem081a(s))
}

fun problem081a(s: String): Int {
    var count = 0
    if (s[0] == '1') count++
    if (s[1] == '1') count++
    if (s[2] == '1') count++
    return count
}

Measured memory_bytes: 31264
N = int(input())

lst = [1]
i = 1
while 6**i <= N:
  lst.append(6**i)
  i += 1
i = 1
while 9**i <= N:
  lst.append(9**i)
  i += 1

lst.sort()

dp = [100001]*(N+1)
dp[0] = 0
for i in range(1,N+1):
  for k in lst:
    if i - k >= 0:
      dp[i] = min(dp[i],dp[i-k]+1)
      
print(dp[N])

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

vector<long long> cake123(
    int x, 
    int y, 
    int z, 
    int k, 
    long long a[], 
    long long b[], 
    long long c[]) {
  sort(a, a+x, greater<long long>());
  sort(b, b+y, greater<long long>());
  sort(c, c+z, greater<long long>());

  priority_queue<long long> que;
  for(int i=0;i<x && i<k; i++) {
    for(int j=0;j<y && j<k; j++) {
      que.push(a[i] + b[j]);
    }
  }

  priority_queue<long long> que2;
  int consumed = 0;
  while(!que.empty() && consumed <= k) {
    long long item = que.top();
    for(int i=0;i<z && i<k; i++) {
      que2.push(c[i] + item);
    }
    que.pop();
    consumed++;
  }

  vector<long long> ans;
  consumed = 0;
  while(!que2.empty() && consumed++ < k) {
    ans.push_back(que2.top());
    que2.pop();
  }
  return ans;
}
int main() {
  int x, y, z, k;
  cin >> x;
  cin >> y;
  cin >> z;
  cin >> k;
  long long a[x], b[y], c[z];
  for(int i=0;i<x;i++)
    cin >> a[i]; 
  for(int i=0;i<y;i++)
    cin >> b[i];
  for(int i=0;i<z;i++)
    cin >> c[i];
  vector<long long> ans = cake123(x, y, z, k, a, b, c);
  for(int i=0;i<ans.size();i++) {
    cout << ans[i];
    if(i!= (ans.size() -1))
      cout << endl;
  }
}

Measured memory_bytes: 43108
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int N = int.Parse(s[0]);
            int D = int.Parse(s[1]);
            int[,] x = new int[N, D];
            int[,] dd = new int[N, N];
            int count = 0;
            for (int i = 0; i < N; ++i)
            {
                s = Console.ReadLine().Split(' ');
                for (int j = 0; j < D; ++j)
                {
                    x[i, j] = int.Parse(s[j]);
                }
            }
            for (int i = 0; i < N; ++i)
            {
                for (int j = 0; j < N; ++j)
                {
                    dd[i, j] = 0;
                    for (int k = 0; k < D; ++k)
                    {
                        dd[i, j] += (x[i, k] - x[j, k]) * (x[i, k] - x[j, k]);
                    }
                }
            }
            for (int i = 0; i < N; ++i)
            {
                for (int j = i + 1; j < N; ++j)
                {
                    for (int k = 1; k * k < 40 * 40 * 10; ++k)
                    {
                        if (dd[i, j] == k * k) ++count;
                    }
                }
            }
            Console.WriteLine(count);
        }
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
string askiii[101];
int main(){
	int n,i;
    scanf("%d%*d",&n);
    for(i=0;i<n;i++)
        cin>>askiii[i];
    sort(askiii,askiii+n);
    for(i=0;i<n;i++)
        cout<<askiii[i];
    return 0;
}

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

using ll = long long;
using vi = vector<int>;
using pll = pair<ll,ll>;
#define f(i,a,b) for (int i = a; i < b; i++)
#define pb push_back
#define Min(a,b) a=min(a,b)

const int mod = 1e9+7;

ll modpow(ll a, ll b) {
	return b?modpow(a*a%mod,b/2)*(b&1?a:1)%mod:1;
}

pll solve(vi ds) {
	int x = mod;
	f(i,0,ds.size()) Min(x,ds[i]);
	int w = 0;
	ll a = 1, b = 1;
	vi nxt;
	f(i,0,ds.size()) if (x == ds[i]) {
		if (nxt.size()) {
			pll sol = solve(nxt);
			a = a*sol.first%mod;
			b = b*((sol.first+sol.second)%mod)%mod;
			nxt = vi();
		}
		w++;	
	} else nxt.pb(ds[i]-x);
	if (nxt.size()) {
		pll sol = solve(nxt);
		a = a*sol.first%mod;
		b = b*((sol.first+sol.second)%mod)%mod;
	}
	return pll(a*modpow(2,x)%mod,
		(b*modpow(2,w)%mod+(modpow(2,x)+mod-2)*a%mod)%mod);
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
#ifdef LOCAL
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	clock_t start = clock();
#endif

	int n;
	cin>>n;
	vi ds(n);
	f(i,0,n) cin>>ds[i];
	cout << solve(ds).second << endl;

#ifdef LOCAL
	cout << setprecision(12) << (long double)(clock()-start) / CLOCKS_PER_SEC << endl;
#endif
	
	return 0;
}



Measured memory_bytes: 384
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Console = System.Console;

namespace Atcoder
{
    class Program
    {

        static void Main(string[] args)
        {
            var N = ReadInt();
            var r = ReadIntArray();

            double ret = int.MaxValue;

            for (int i = 0; i < 100; i++)
            {
                double tmp = 0;
                foreach (var item in r)
                {
                    tmp += Math.Pow(item - i, 2);
                }

                if (ret > tmp)
                {
                    ret = tmp;
                }
            }

            Console.WriteLine(ret);
        }
        private static readonly Func<string> Read = () => Console.ReadLine();
        private static readonly Func<string[]> ReadStringArray = () => Console.ReadLine().Split();
        private static readonly Func<int> ReadInt = () => int.Parse(Console.ReadLine());
        private static readonly Func<long> ReadLong = () => long.Parse(Console.ReadLine());
        private static readonly Func<int[]> ReadIntArray = () => Console.ReadLine().Split().Select(int.Parse).ToArray();
        private static readonly Func<long[]> ReadLongArray = () => Console.ReadLine().Split().Select(long.Parse).ToArray();
        private static readonly Action<string> Cw = str => Console.WriteLine(str);
    }
}

Measured memory_bytes: 13396
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>

#define                           int                         long long
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);




using namespace std;

const int inf=1e18;
const int mod=1e9+7;
const int M=100009;
inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}

int cnt[4];
string s[M+3];
 main()

{
    fast
    int n;
    cin>>n;
    f(i,0,2)cin>>cnt[i];
    bool flag=false;
    vector<char>ses;
    f(i,0,n-1)cin>>s[i];
    f(i,0,n-1)
    {
        int c1=s[i][0]-'A';
        int c2=s[i][1]-'A';
        if(cnt[c1]>cnt[c2])
        {
            cnt[c1]--;
            cnt[c2]++;
            ses.pb(s[i][1]);
        }
        else if(cnt[c2]>cnt[c1])
        {
            cnt[c2]--;
            cnt[c1]++;
            ses.pb(s[i][0]);
        }
        else
        {

            if(i<n-1 && (s[i+1][0]==s[i][0] || s[i+1][1]==s[i][0]))
            {
                cnt[c1]++;
                cnt[c2]--;
                ses.pb(s[i][0]);
            }
            else
            {
                cnt[c1]--;
                cnt[c2]++;
                ses.pb(s[i][1]);
            }

        }
        f(i,0,2)if(cnt[i]<0)flag=1;

    }
    if(flag)
    {
        cout<<"No\n";
        return 0;
    }
    cout<<"Yes\n";
    for(auto x:ses)
    {
        cout<<x<<" ";
    }
    cout<<endl;
    return 0;

}













Measured memory_bytes: 6928
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <stack>
#include <queue>

#define FOR(i, b, e) for(int i = (int)(b); i < (int)(e); ++i)
#define RFOR(i, b, e) for(int i = (int)(e-1); i >= (b); --i)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, 0, n)
#define REPC(x,c) for(const auto& x:(c))
#define VS vector<string>
#define VL vector<long long>
#define VI vector<int>
#define VVI vector<vector<int>>
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort((x).rbegin(),(x).rend())
#define PAIR pair<int,int>
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

using  ll = long long;
constexpr int MOD = 1000000007;
using namespace std;

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

VL prime_decomposition(ll n) {
	ll i = 2;
	VL table{};
	while (i * i <= n) {
		while (n % i == 0) {
			n /= i;
			table.emplace_back(i);
		}
		++i;
	}
	if (n > 1) {
		table.emplace_back(n);
		return table;
	}
}


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

	ll s = 0;
	RFOR(b, 1, n + 1) {
		if (b < k) { break; }
		ll d = n % b;
		ll l = n / b;
		s += (b - k)*l;
		if (d >= k) { s += (d - k + 1); }
	}
	cout << ((k == 0) ? s - n : s) << endl;
}

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

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1,i,j;
    //cin>>t;
    while(t--)
    {
        int n,m,flag=0,count=0,sum=0,maxi=0,mini=1e18;
        cin>>n;

        while (n % 2 == 0)  
        {  
            count++;
            n = n/2;  
        }
        i=1;
        if(count==2) sum++;
        else
        {
            while(count>=i)
            {
                sum++;
                count-=i;
                i++;
            }
        }
        for (int i = 3; i <= sqrt(n); i = i + 2)  
        {  
            count=0;
            while (n % i == 0)  
            {  
                count++;
                n = n/i;  
            }  
            j=1;
            if(count==2)
            {
                sum++;
                continue;
            }
            while(count>=j)
            {
                sum++;
                count-=j;
                j++;
            }
        }  
  
    if (n > 2)  
        sum++;
        cout<<sum;
    }
}

Measured memory_bytes: 3672
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000000;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

///////////////////////////




int main() {

	ll a, b, c, d, e, k;
	cin >> a >> b >> c >> d >> e >> k;

	if (e - a > k) { cout << ":("; }
	else { cout << "Yay!"; }
	

	system("PAUSE");
}

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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(a) max((a),-(a))
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repe(i,n) rep(i,(n)+1)
#define per(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define pere(i,n) rep(i,(n)+1)
#define all(x) (x).begin(),(x).end()
#define SP <<" "<<
#define RET return 0
#define MOD 1000000007
#define INF 1000000000000000000

typedef long long LL;
typedef long double LD;

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> h(n);
  for(int i=0;i<n;i++) cin >> h[i];
  sort(h.begin(),h.end());
  int ans=1000000000;
  for(int i=0;i<n-k+1;i++){
    ans=min(ans,h[k+i-1]-h[i]);
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
    int a, b, c;
    cin >> a >> b >> c;
    if (a == b + c or b == a + c or c == a + b){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで
// -fsanitize=undefinedでオーバーフロー検出
#include <bits/stdc++.h>
#define mod 1000000007
#define INF LLONG_MAX
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};
class UnionFind {
public:
    vector <ll> par; // 各元の親を表す配列
    vector <ll> siz; // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(ll sz_): par(sz_), siz(sz_, 1LL) {
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }
    void init(ll sz_) {
        par.resize(sz_);
        siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
        for (ll i = 0; i < sz_; ++i) par[i] = i; // 初期では親は自分自身
    }

    // Member Function
    // Find
    ll root(ll x) { // 根の検索
        while (par[x] != x) {
            x = par[x] = par[par[x]]; // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(ll x, ll y) {
        x = root(x);
        y = root(y);
        if (x == y) return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y]) swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y) { // 連結判定
        return root(x) == root(y);
    }

    ll size(ll x) { // 素集合のサイズ
        return siz[root(x)];
    }
};

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

    ll a,b,c,d,m,n,maxi=0,f=0,mini=INF,sum=0;
    string str;
    cin>>n>>m;
    UnionFind uf(n);
    rep(i,m){
        cin>>a>>b;
        uf.merge(a-1,b-1);
    }
    rep(i,n){
        maxi=max(uf.size(i),maxi);
    }
    cout<<maxi<<endl;

    return 0;
}


Measured memory_bytes: 6364
//---------------------------
// AOJ???????????¬???
// copied by future731
// 2016/5/27
//---------------------------
 
#include <stdio.h>
 
int main(void)
{
    int in_second;//??\??????????????????S
    int out_hour, out_minute, out_second;//?????????h:m:s
 
    //??\???
    scanf("%d", &in_second);
 
    //?????????????¨????
    out_second = in_second % 60;
    out_minute = (in_second /60) % 60;
    out_hour = (in_second / 60) /60;
 
    //??????
    printf("%d:%d:%d\n", out_hour, out_minute, out_second);
 
    return 0;
}

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

using ll = long long;

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    ll sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
        sum += a.at(i);
    }
    sort(a.rbegin(), a.rend());

    int cnt = 1;
    for (int i = 1; i < n; i++) {
        sum -= a.at(i - 1);

        if (a.at(i - 1) <= sum * 2) cnt++;
        else break;
    }

    cout << cnt << endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <time.h>
#include <stack>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cassert>

using namespace std;

const int N = 200005;
const int inf = 1000 * 1000 * 1000;
const int mod = 1000 * 1000 * 1000 + 7;

string s;
int a[28];
long long answ = 1;

int main(){
    cin>>s;
    for(int i=0;i<(int)s.size();i++){
        int x = s[i] - 'a';
        a[x]++;
    }
    for(int i=0;i<(int)s.size();i++){
        int x = s[i] - 'a';
        a[x]--;
        long long d = 1ll * ((int)s.size() - i - 1 - a[x]);
        answ += 1ll * d;
    }
    cout<<answ<<endl;
    return 0;
}


Measured memory_bytes: 640
#include<stdio.h>
int main(void)
{
	int n, m;
	while(scanf("%d %d", &n, &m))
	{
		if(n == 0 && m == n)
		{
		    break;
        }
        int i = 0;
        for (i = 0;i < m; i++)
        {
        	printf("#");
		}
		printf("\n");
		for( i= 0; i < n - 2; i++)
	    {
	    	printf("#");
	    	int j =0;
		    for(j= 0; j < m - 2; j++)
		    {
			    printf(".");
		    }
		    printf("#");
		    printf("\n");
	    }
	    for(i = 0;i < m; i++)
		{
	        printf("#");
		}
		printf("\n");
		printf("\n");
    }
}


Measured memory_bytes: 2560
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <vector>
#include <map>
#include <cstdlib>
#include <set>
#include <stack>
#include <queue>
using namespace std;

#define X first
#define Y second
#define N 100010
typedef long long ll;
typedef pair<int,int> pii;

const int INF=1<<30;
const int Mod=1000000000+7;

int n;
int a[N];

int gcd(int x,int y)
{
	int tmp;
	while (y)
	{
		tmp=x%y;
		x=y,y=tmp;
	}
	return x;
}

bool Solve()
{
	if (n==1) return a[1]!=1;
	
	bool flag=true;
	for (int i=1;i<=n;i++) if (a[i]!=1) flag=false;
	if (flag) return 0;
	
	int cnt=0;
	for (int i=1;i<=n;i++) if (!(a[i]&1)) cnt++;
	if (cnt&1) return 1;
	else 
	{
		if (n-cnt>=2) return 0;
		bool flag=false;
		for (int i=1;i<=n;i++) if (a[i]>1 && (a[i]&1))
		{
			flag=true;
			a[i]--;
			int d=a[1];
			for (int j=2;j<=n;j++) d=gcd(d,a[j]);
			for (int j=1;j<=n;j++) a[j]/=d;
			return !Solve();
		}
		if (!flag) return 0;
	}
}

int main()
{
	//freopen("in.in","r",stdin);
	//freopen("out.out","w",stdout);
	
	scanf("%d",&n); 
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	if (Solve()) printf("First\n");
	else printf("Second\n");
	
	return 0;
}

Measured memory_bytes: 640
// include
// ------------------------------------------------
#include <bits/stdc++.h>
#include <algorithm>
#include <math.h>

using namespace std;

// func
// ------------------------------------------------
int CalcSumOfDigit(int n);      // 各桁の和を計算する。
int getDigit(int n);            // 数字の桁数を取得する。
string upper(string str);       // 英字を大文字に変換する。
string lower(string str);       // 英字を小文字に変換する。

// define
// ------------------------------------------------
#define all(a)        (a).begin(),(a).end()
#define rall(a)       (a).rbegin(),(a).rend()
#define sz(a)         int((a).size())
#define rep(i,n)      for(int(i)=0;(i)<(n);(i)++)
#define repe(i,n)     for(int(i)=0;(i)<=(n);(i)++)
#define vsort(v)      sort((v).begin(),(v).end())
#define rvsort(v)     sort(rall((v)))
#define vi            vector<int>
#define GCD(a,b)      __gcd((a),(b))
#define LCM(a,b)      (a)/GCD((a),(b))*(b)
#define kiriage(a,b)  ((a)+(b)-1)/(b)

const int INF = 1e9;

typedef long long ll;
typedef unsigned long long ull;

// code
// ------------------------------------------------
int main() {

  ll n,m;
  string s,t;
  cin >> n >> m >> s >> t;

  ll l = LCM(n,m);
  ll g = GCD(n,m);

  bool isExist = true;
  
  rep(i,g)
  {
    if(s[i * n / g] != t[i * m / g])
    {
      isExist = false;
      break;
    }
  }

  if(isExist)
  {
    cout << l << endl;
  }
  else
  {
    cout << -1 << endl;
  }

  return 0;
}
// funcの実体
// ------------------------------------------------
int getDigit(int n)
{
  int i = 1;
  while(1)
  {
    n = n / 10;
    if(n == 1)
      break;
    i++;
  }
  return i;
}
int CalcSumOfDigit(int n)
{
  int s = 0;
  while(n)
  {
    s += n % 10;
    n = n / 10;
  }
  return s;
}

string upper(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(97 <= *itr && *itr <= 122)
    {
      *itr = *itr - 32;
    }
  }
  return str;
}

string lower(string str)
{
  for(auto itr = str.begin();itr != str.end() ; itr++)
  {
    if(65 <= *itr && *itr <= 90)
    {
      *itr = *itr + 32;
    }
  }
  return str;
}


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

int main() {
	int n;
	cin >> n;
	long long int a[n],s=0,d=0;
	for(int i=0;i<n;i++)
	cin >> a[i];
	for(int i=1;i<n;i++){
		if(a[i]<a[i-1]){
			d=a[i-1]-a[i];
			s=s+d;
			a[i]=a[i-1];
		}
	}
	cout<<s;
	return 0;
}

Measured memory_bytes: 5160
#include <iostream>
using namespace std;
#include <string>
#include <vector>
#include <algorithm>
#include <map>
typedef long long ll;

int main(int argc, char *argv[])
{
	int a, b;

	cin >> a >> b;
	
	int c=a-2*b;


	cout << ((c>0) ? c : 0)  << endl;
	return 0;
}



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

#define mp make_pair
#define pb push_back
#define fst first
#define snd second
#define int long long
#define MMAX 16384
#define fast_io() ios::sync_with_stdio(false)
#define FOR(i, l, r) for(int i = (l); i < (r); i++)

typedef long long ll;
typedef pair<ll, ll> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef set<int> si;
typedef double ld;
typedef pair<ld, ld> dd;

const ll INF = 1000000000000000000LL;
const int NMAX = 1e6+4;
const int mod = 1e9+7;
const ld eps = 1e-10;
const ld PI = acos(-1);

struct edge{int v, t;};

int N, M;
vector<edge> adj[NMAX];
vi vis;

bool isBipartite(int n, int c){
    vis[n] = c;
    for(edge e : adj[n]) if(!vis[e.v]) {
        if(!isBipartite(e.v, -c)) return false;
    } else if(vis[n] != -vis[e.v]) return false;
    return true;
}

int sum, node, k;
vi col;
bool getOddCycle(int n, int v = 1){
    col[n] = v;
    for(edge e : adj[n]){
        if(col[e.v] == 0){
            if( getOddCycle(e.v, -v) ){
                //cout<<e.t<<endl;
                sum += v * e.t;
                if(node == n) return 0;
                return 1;
            }
            if(node != -1) return 0;
        } else if (col[e.v] == v){
            node = e.v;
            k = n;
            //cout<<e.t<<endl;
            sum += v*e.t;
            return 1;
        }
    }
    return 0;
}


vi val;

bool isFillable(int n, int v, int &mina, int &minb){
    val[n] = v;
    mina = min(mina, v);
    for(edge e : adj[n]){
        if(val[e.v] == INF){
            if( !isFillable(e.v, e.t-v, minb, mina) ) return false;
        } else if(val[n] + val[e.v] != e.t) return false;
    }
    return true;
}

signed main(){
    fast_io();
    cin >> N >> M;
    vis.assign(N, 0);
    val.assign(N, INF);
    col.assign(N, 0);
    FOR(i, 0, M){
        int u, v, t;
        cin >> u >> v >> t;
        u--;v--;
        adj[u].pb({v,t});
        adj[v].pb({u,t});
    }
    sum = 0; 
    node = -1;
    //cout << "isBipartite: " << isBipartite(0, 1) << endl;
    if(isBipartite(0, 1)){
        int a = INF, b = INF;
        if(!isFillable(0, 0, a, b)) {
            cout << 0 << endl;
            return 0;
        }
        b += a-1;
        cout << max(b, 0LL) << endl;
        return 0;
    } else {
        getOddCycle(0);
        //cout<<sum<<endl;
        int a = INF, b = INF;
        if(isFillable(node, abs(sum)/2, a, b) and a > 0 and b > 0) cout << 1 << endl;
        else cout << 0 << endl;
        return 0;
    }
}

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

using namespace std;

int main(){
    int sx,sy,tx,ty;

    cin >> sx >> sy;
    cin >> tx >> ty;

    tx-=sx;
    ty-=sy;

    for(int i=0;i<ty;i++){
        cout << 'U';
    }
    for(int i=0;i<tx;i++){
        cout << 'R';
    }
    for(int i=0;i<ty;i++){
        cout << 'D';
    }
    for(int i=0;i<tx+1;i++){
        cout << 'L';
    }
    for(int i=0;i<ty+1;i++){
        cout << 'U';
    }
    for(int i=0;i<tx+1;i++){
        cout << 'R';
    }
    cout << "DR";
    for(int i=0;i<ty+1;i++){
        cout << 'D';
    }
    for(int i=0;i<tx+1;i++){
        cout << 'L';
    }
    cout << 'U' << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(), (x).end())
#define ALL(x) (x).begin(), (x).end()
#define rep(i, n) for (ll i = 0; i < n; i++)
#define reps(i, m, n) for (ll i = m; i < n; i++)
#define repr(i, m, n) for (ll i = m; i >= n; i--)
template <class T> bool maxi(T &a, const T &b) {
    if (a < b) { a = b; return 1;} return 0;}
template <class T> bool mini(T &a, const T &b) {
    if (b < a) { a = b; return 1;} return 0;}
#define dame {cout<< "No" <<"\n"; return;}
#define INF2 1000000000000000037
#define INF  1000000007
#define MOD  1000000007
#define PI (acos(-1))
using namespace std;
using ll = long long;
using ld = long double;
using P  = pair<ll,ll>;
//--GLOBAL---------------------------------
ll modpow(ll a, ll n=MOD-2, ll mod=MOD){ // a^n % MOD の計算
    ll res = 1;
    while (n > 0){
        if(n & 1) res = res * a % mod;
        a = a * a  % mod;
        n >>= 1;
    }
    return res;
}
//--MAIN-----------------------------------
void Main() {
    ll N; cin>>N;
    ll ans=0;
    rep(i,1<<18){
        ll num=0;
        ll ct=0,ct1=0,ct2=0,ct3=0;
        repr(j,8,0){
            num*=10;
            if(!(i>>(2*j)&1) and !(i>>(2*j)&2)){
                if(ct1!=0 or ct2!=0 or ct3!=0) ++ct;
            }
            if((i>>(2*j)&1) and !(i>>(2*j)&2)){num+=3; ++ct1;}
            if(!(i>>(2*j)&1) and (i>>(2*j)&2)){num+=5; ++ct2;}
            if((i>>(2*j)&1) and (i>>(2*j)&2)){num+=7; ++ct3;}
        }
        if(num>N) break;
        if(ct!=0 or ct1==0 or ct2==0 or ct3==0) continue;
        ++ans;
    }
    cout<< ans <<"\n";
}
//--START----------------------------------
int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
}
//-----------------------------------------


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

ll solve() {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    ll ans = max({a*c,a*d,b*c,b*d});
    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3632
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int divCnt;
        int maxDivCnt = 0;
        int maxN = 1;

        for (int i = 1; i <= N; i++) {

            divCnt = divCnt(i);
            if(maxDivCnt < divCnt) {
                maxDivCnt = divCnt;
                maxN = i;
            }
        }
        System.out.println(maxN);
    }

    private static int divCnt(int i) {
        int cnt = 0;
        return divCnt(i, cnt);
    }

    private static int divCnt(int i,int cnt) {
        if(i/2 >= 1 && i%2 == 0) {
            i = i /2;
            cnt = divCnt(i,cnt);
            cnt ++;
        }
        return cnt;
    }

}

Measured memory_bytes: 23892
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define vl vector<ll>
#define pll pair<ll,ll>
#define mll map<ll, ll> 
#define rep(i,a)  for(ll i= 0;i < a;i++)
#define rep1(i,a) for(ll i= 1;i < a;i++)
#define foi(i, a, b)    for(ll i = a; i<b ; i++)
#define fod(i, a, b)    for(ll i = a; i>=b ; i--)
#define pb push_back
#define sz(v) v.size()
#define all(a) a.begin(), a.end()
#define max3(a, b, c)   max(max(a, b), c)
#define min3(a, b, c)   min(min(a, b), c)
#define MAX 1000005
#define MOD 1000000007
#define el "\n"
const ll INF = 2e9+5;
  
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b, a%b);}
ll lcm(ll a, ll b){return a*b/gcd(a, b);}
ll isPrime(ll n){if(n<=3) return 1;if(n%2==0||n%3==0) return 0;
for(ll j=5;j*j<=n;j+=6){if(n%j == 0||n%(j+2) == 0) return 0;}return 1;}
 
using namespace std;
void solve(){
   ll n,w;
   cin>>n>>w;
   vector<ll> wt(n),v(n);
   rep(i,n)cin>>wt[i]>>v[i];
   ll dp[n+1][w+1];
   rep(i,n+1)rep(j,w+1){
      if(i==0||j==0) dp[i][j]=0;
      else if(wt[i-1]<=j) dp[i][j] = max(dp[i-1][j], v[i-1]+dp[i-1][j-wt[i-1]]);
      else dp[i][j] = dp[i-1][j];
      // cout<<dp[i][j]<<" ";
   }
   cout<<dp[n][w];
}
 
int main() {
   #ifndef ONLINE_JUDGE
      freopen("input.txt", "r" , stdin);
      freopen("output.txt", "w" , stdout);
   #endif
   ios::sync_with_stdio(0); 
   cin.tie(0); cout.tie(0);   
   ll t;
   // cin>>t;
   t = 1;
   ll tc=0;
   while(tc++<t){
      // cout<<"Case #"<<tc<<": ";
      solve();
   }
   cerr<<"Time taken : "<<(double)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
   return 0;
}

Measured memory_bytes: 82672
n,m = map(int,input().split())
a = [[0,0] for _ in range(n)]
pn = 0
ac = 0
for i in range(m):
    p, s = input().split()
    if s == "AC":
        if a[int(p)-1][1] == 0:
            a[int(p)-1][1] = 1
            pn += a[int(p)-1][0]
            ac += 1
    else:
        a[int(p)-1][0] += 1
print(ac, pn)

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

int main()
{
	int n;
 	cin >> n;
   	vector<int> arr(n);
  	for(int i = 0; i < n; i++)
    {
		cin >> arr[i];
    }
  	int counter = 0;
  	for(int i = 0; i < n - 1; i++)
    {
     for(int j = i + 1; j < n; j++)
     {
      counter += arr[i]*arr[j];
     }
    }
  cout << counter;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <cmath>
#include <vector>
#include <regex>
#include <map>
#include <set>
using namespace std;
int main(){
    int N,M;
    cin >> N >> M;
    
    int A[100000] = {};
    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    sort(A,A+N);
    
    vector<pair<int,int>> BC(M);
    for(int i=0;i<M;i++){
        cin >> BC[i].second >> BC[i].first;
    }
    sort(BC.begin(),BC.end(),greater<pair<int,int>>());
    
    int j = 0;
    for(int i = 0;i<M;i++){
        int nokori = BC[i].second;
        while(nokori > 0){
            if(A[j]<BC[i].first){
                A[j] = BC[i].first;
                j++;
                nokori--;
                if(j>=N){
                    goto out;
                }
            }else{
                break;
            }
        }
    }
out:
    long long ans = 0;
    for(int i=0;i<N;i++){
        ans += A[i];
    }
    cout << ans << endl;
    
    return 0;
}



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

int joi[65000];

int main() {

    while(1) {

        int n;

        cin >> n;

        if(n==0) break;

        int p;
        long long int suml = 0;

        for (int i = 0; i < n; i++) {
            scanf(" %d", &p);
            suml += p;
        }
        for (int i = 0; i < n-1; i++) {
            scanf(" %d", &joi[i]);
        }

        sort(joi,joi + n,greater<int>());

        long long int ans = suml * n;

        for(int i=0;i<n-1;i++){
            if(ans > (suml + joi[i]) * (n-(i+1)) ){
                break;
            }
            suml += joi[i];
            ans = suml * (n-(i+1));
        }

        cout << ans << endl;


    }

    return 0;
}

Measured memory_bytes: 3388
n = gets.chomp.to_i
a = []
n.times do
  a.push(gets.chomp.to_i)
end

max=a[1]-a[0]
min=a[0] + 1
0.upto(n-2) do |i|
  if (min > a[i])
    min = a[i]
      (i+1).upto(n-1) do |j|
        sa = a[j] - a[i]
        max = sa if sa >= max
        
      end
  end
end
puts max


Measured memory_bytes: 8904
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

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

inline int toInt(string s) {int v; istringstream sin(s);sin>>v; return v;}

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector< vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9+7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

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

    if(a == b) cout << c << endl;
    else if(a == c) cout << b << endl;
    else cout << a << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int MOD = 1000000007;
const ll INF = 1LL << 60;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    ll ans = 1;
    while (n > 0)
    {
        ans*=n;
        ans%=MOD;
        n--;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int K = sc.nextInt();
		int S = sc.nextInt();
		int Z = 0;
		int count = 0;

		/* 3重for文だとTLE
		for(int i = 0; i <= K; i++) {
			for(int j = 0; j <= K; j++) {
				for(int k = 0; k <= K; k++) {
					if(i + j + k == S) {
						count++;
					}

				}
			}
		}

		System.out.println(count);
		*/

		for(int i = 0; i <= K; i++) {
			for(int j = 0; j <=K; j++) {
				Z = S - i - j;
				if(Z >= 0 && Z <= K) {
					count++;
				}
			}
		}

		System.out.println(count);
	}

}


Measured memory_bytes: 23636
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int N;
    long long Ans=0;
    cin>>N;
    N--;
    for(int i=1;i<=N;i++) Ans+=N/i;
    cout<<Ans<<endl;
    return 0;
}

Measured memory_bytes: 3652
"use strict";
const Main = (input) =>{
  let xs = input.trim().split(' ').map(v=>parseInt(v,10));
  if(xs[0] >= xs[1]){
  	console.log(10);
  }else if(xs[0] < xs[1]){
  	console.log(0);
  }
}
Main(require('fs').readFileSync('/dev/stdin','utf8'));

Measured memory_bytes: 7496
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    int n;
    string s;
    cin >> n >> s;
    vector<int> r(n+1);
    vector<int> g(n+1);
    vector<int> b(n+1);
    for(int i = 0; i < n; i++)
    {
        r[i+1] = r[i];
        g[i+1] = g[i];
        b[i+1] = b[i];
        if(s[i] == 'R') r[i+1]++;
        else if(s[i] == 'G') g[i+1]++;
        else b[i+1]++;
    }
    ll ans = 0;
    for(int i = 0; i < n; i++)
    {
        if(s[i] == 'R')
        {
            for(int j = i+1; j < n; j++)
            {
                if(s[j] == 'R') continue;
                if(s[j] == 'G')
                {
                    int tmp = b[n] - b[j];
                    if(j+j-i < n && s[j+j-i] == 'B') tmp--;
                    ans += tmp;
                }
                if(s[j] == 'B')
                {
                    int tmp = g[n] - g[j];
                    if(j+j-i < n && s[j+j-i] == 'G') tmp--;
                    ans += tmp;
                }
            }
        }
        if(s[i] == 'G')
        {
            for(int j = i+1; j < n; j++)
            {
                if(s[j] == 'G') continue;
                if(s[j] == 'B')
                {
                    int tmp = r[n] - r[j];
                    if(j+j-i < n && s[j+j-i] == 'R') tmp--;
                    ans += tmp;
                }
                if(s[j] == 'R')
                {
                    int tmp = b[n] - b[j];
                    if(j+j-i < n && s[j+j-i] == 'B') tmp--;
                    ans += tmp;
                }
            }
        }
        if(s[i] == 'B')
        {
            for(int j = i+1; j < n; j++)
            {
                if(s[j] == 'B') continue;
                if(s[j] == 'G')
                {
                    int tmp = r[n] - r[j];
                    if(j+j-i < n && s[j+j-i] == 'R') tmp--;
                    ans += tmp;
                }
                if(s[j] == 'R')
                {
                    int tmp = g[n] - g[j];
                    if(j+j-i < n && s[j+j-i] == 'G') tmp--;
                    ans += tmp;
                }
            }
        }

    }
    cout << ans << endl;
}


Measured memory_bytes: 3644
#include <stdio.h>

int main(){
    int x[3000],y[3000];
    int temp;
    int j, ary_cnt;

    while(1){
        scanf("%d %d",&x[ary_cnt],&y[ary_cnt]);
        if(x[ary_cnt]==0 && y[ary_cnt]==0){
            break;
        } else {
            ary_cnt++;
        }

    }
    for(j=0;j<ary_cnt;j++){

           if(x[j] > y[j]){
               temp = y[j] ;
               y[j] = x[j] ;
               x[j] = temp ;
           } 
           printf("%d %d\n",x[j] ,y[j]);
    }
        
        return 0;
}



Measured memory_bytes: 2028
a,b=map(int,input().split())

if a==0 or b==0:
  ans="Zero"
elif a>0:
  ans="Positive"
else:
  if b>0:
    ans="Zero"
  else:
    c=b-a+1
    if c%2==0:
      ans="Positive"
    else:
      ans="Negative"

print(ans)

Measured memory_bytes: 3060
#include<algorithm>
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#define LL long long
#define M 310
using namespace std;
namespace IO{
	const int BS=(1<<19); int Top=0;
	char Buffer[BS],OT[BS],*OS=OT,*HD=Buffer,*TL=Buffer,SS[20]; const char *fin=OT+BS-1;
	char Getchar(){if(HD==TL){TL=(HD=Buffer)+fread(Buffer,1,BS-1,stdin);} return *HD++;}
	void flush(){fwrite(OT,1,OS-OT,stdout);}
	void Putchar(char c){*OS++ =c;if(OS==fin)flush(),OS=OT;}
	void write(int x){
		if(!x){Putchar('0');return;} if(x<0) x=-x,Putchar('-');
		while(x) SS[++Top]=x%10,x/=10;
		while(Top) Putchar(SS[Top]+'0'),--Top; Putchar('\n');
	}
	int read(){
		int nm=0,fh=1; char cw=getchar();
		for(;!isdigit(cw);cw=getchar()) if(cw=='-') fh=-fh;
		for(;isdigit(cw);cw=getchar()) nm=nm*10+(cw-'0');
		return nm*fh;
	}
}
using namespace IO;
int n,m,p[M][M],fd[M],cnt[M],ans;
bool vis[M];
bool del(){
	for(int i=1;i<=m;i++) if(cnt[i]>=ans) vis[i]=true;
	for(int i=1;i<=n;i++){
		while(fd[i]<=m&&vis[p[i][fd[i]]]) fd[i]++;
		if(fd[i]>m) return false;
	}
}
void calc(){
	int maxn=0; memset(cnt,0,sizeof(cnt));
	for(int i=1;i<=n;i++) cnt[p[i][fd[i]]]++;
	for(int i=1;i<=m;i++) maxn=max(maxn,cnt[i]);
	ans=min(ans,maxn);
}
int main(){
//	freopen("data.in","r",stdin);
//	freopen("data.out","w",stdout);
	n=read(),m=read(),memset(vis,false,sizeof(vis));
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++) p[i][j]=read();
		cnt[p[i][fd[i]=1]]++,ans=max(ans,cnt[p[i][1]]);
	}
	while(del()&&ans>1) calc(); printf("%d\n",ans); return 0;
}

Measured memory_bytes: 640