akhauriyash/Code-Regression huggingface dataset:
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

struct UFTree(T)
{
    struct Node
    {
        T parent;
        T rank = 1;
    }

    this(T n)
    {
        nodes.length = n;
        sizes.length = n;
        foreach (i, ref node; nodes) {
            node = Node(i.to!T);
            sizes[i] = 1;
        }
    }

    bool unite(T a, T b)
    {
        a = root(a);
        b = root(b);

        if (a == b) return false;

        if (nodes[a].rank < nodes[b].rank) {
            sizes[nodes[a].parent] += sizes[nodes[b].parent];
            nodes[b].parent = nodes[a].parent;
        } else {
            sizes[nodes[b].parent] += sizes[nodes[a].parent];
            nodes[a].parent = nodes[b].parent;
            if (nodes[a].rank == nodes[b].rank) nodes[a].rank += 1;
        }

        return true;
    }

    T size(T i)
    {
        return sizes[root(i)];
    }

private:
    Node[] nodes;
    T[] sizes;

    T root(T i)
    {
        if (nodes[i].parent == i) return i;

        return nodes[i].parent = root(nodes[i].parent);
    }
}

alias AB = Tuple!(int, "a", int, "b");

AB[10^^5] ABS;
long[10^^5] RS;

void main()
{
    auto nm = readln.split.to!(long[]);
    auto N = nm[0];
    auto M = nm[1];

    foreach (i; 0..M) {
        auto ab = readln.split.to!(int[]);
        ABS[i] = AB(ab[0] - 1, ab[1] - 1);
    }

    long fd = N * (N - 1) / 2;
    auto uft = UFTree!long(N.to!long);
    foreach_reverse (i; 0..M) {
        RS[i] = fd;

        auto ab = ABS[i];
        auto a = uft.size(ab.a);
        auto b = uft.size(ab.b);
        if (uft.unite(ab.a, ab.b)) {
            fd -= a * b;
        }
    }

    foreach (r; RS[0..M]) {
        writeln(r);
    }
}

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

int main() {
  int n;
  double xa,ya,ra,xb,yb,rb,l;
  cin >> n;
  for(int i=0;i<n;i++) {
    cin >> xa >> ya >> ra >> xb >> yb >> rb;
    l = sqrt((xb-xa)*(xb-xa) + (yb-ya)*(yb-ya));
    if(l > ra + rb)
      cout << 0 << endl;
    else if((l <= ra + rb) && (l >= abs(ra-rb)))
      cout << 1 << endl;
    else if(l < ra - rb)
      cout << 2 << endl;
    else if(l < rb - ra)
      cout << -2 << endl;
  }
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int k, x;

void solve()
{
    // 黒で塗られている可能性のある座標で最大と最小のもの
    int ma,mi;
    ma = x + k - 1;
    mi = x - k + 1;
    for (int i=mi;i<=ma;i++){
        cout << i << ' ';
    }
    cout << endl;
}

int main()
{
    cin >> k;
    cin >> x;
    solve();
}

Measured memory_bytes: 384
#include<stdio.h>

int main(void){
	int n,min=1,i,k,h[131072];
	unsigned long long int c=0;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&h[i]);
	}
	for(i=0;i<n;i++){
		if((h[i] - 1)/min != 0){
			k = (h[i] - 1)/min;
			c+=k;
			if(min < 2){min=2;}
		}
		else if(h[i] == min){
			min++;
		}
	}
	printf("%llu\n",c);
	return 0;
}

Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef vector<pii> vp;

int gcd(int a, int b){
    if(b==0) return a;
    return gcd(b,a%b);
}
int lcm(int a, int b){
    return a/gcd(a,b)*b;
}


signed main(void) {
    int n,k;
    cin >> n >> k;
    if(k == 1)cout << 0 << endl;
    else cout << n-k << endl;
}


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

public class Main {
    final private Input input;
    final private PrintWriter output;

    public class Input {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        Input() throws FileNotFoundException {
            reader = new BufferedReader(new InputStreamReader(System.in));
        }

        String nextLine() throws IOException {
            return reader.readLine();
        }

        String nextToken() throws IOException {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(nextLine());
            }
            return tokenizer.nextToken();
        }

        int nextInt() throws IOException {
            return Integer.parseInt(nextToken());
        }

        long nextLong() throws IOException {
            return Long.parseLong(nextToken());
        }

        double nextDouble() throws IOException {
            return Double.parseDouble(nextToken());
        }
    }

    public Main() throws FileNotFoundException {
        input = new Input();
        output = new PrintWriter(System.out);
    }

    private void close() {
        output.flush();
    }

    public static void main(String[] args) throws IOException {
        Main solver = new Main();
        solver.solve();
        solver.close();
    }

    private void solve() throws IOException {
        long s = input.nextLong();
        long c = input.nextLong();
        long d = (c - 2 * s) / 2;
        long ans = 0;
        for (long x = d - 10000000; x <= d + 10000000; x++) {
            if (x >= 0 && x <= c) {
                long cur = Math.min((c - x) / 2, s + x / 2);
                ans = Math.max(ans, cur);
            }
        }
        for (long x = 0; x <= 10000000; x++) {
            if (x >= 0 && x <= c) {
                long cur = Math.min((c - x) / 2, s + x / 2);
                ans = Math.max(ans, cur);
            }
        }
        for (long x = c; x >= c - 10000000; --x) {
            if (x >= 0 && x <= c) {
                long cur = Math.min((c - x) / 2, s + x / 2);
                ans = Math.max(ans, cur);
            }
        }

        output.println(ans);
    }
}

Measured memory_bytes: 21716
// Winners don't quit and Quitters don't win
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mod 998244353
#define MAX 100005
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,v1,v2,sum=0;
    cin>>n;
    v1=n/500;
    sum+=v1*1000;
    n=(n-v1*500);
    v2=n/5;
    sum+=v2*5;
    cout<<sum;
}

Measured memory_bytes: 256
import itertools
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
AB = [a+b for a,b in itertools.product(A,B)]
AB.sort(reverse=True)
AB = AB[:K]
ABC = [ab + c for ab,c in itertools.product(AB,C)]
ABC.sort(reverse=True)
for i in range(K):
    print(ABC[i])

Measured memory_bytes: 139524
#include <stdio.h>

int main()
{
	char S[4];
	scanf("%s", S);
	if (S[0] == 'R' && S[1] == 'R' && S[2] == 'R') printf("3\n");
	else if (S[1] == 'R' && (S[0] == 'R' || S[2] == 'R')) printf("2\n");
	else if (S[0] == 'S' && S[1] == 'S' && S[2] == 'S') printf("0\n");
	else printf("1\n");
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1608
#include<bits/stdc++.h>
using namespace std;
#define REP(i,n) for(long long i=0;i<n;i++)
#define REP1(i,n) for(long long i=1;i<=n;i++)
#define ITE(arr) for(auto ite=(arr).begin();ite!=(arr).end();ite++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
typedef long long ll;
typedef pair<int,int> pii;
//---------------------
#define MAXN 50
//---------------------

ll k;
int main(){
	string str;

	cin>>str;
	ll ct=0;
	REP(i,str.size())
	{
		if(str[i]=='x') ct++;
	}
		if(ct<=7) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
    
    return 0;

}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    
    int A, B;
    int wa, sa, seki;
    int ans;
    cin >> A >> B;
    
    wa = A + B;
    sa = A - B;
    seki = A * B;
    
    ans = max({wa, sa, seki});
    cout << ans << endl;
    
}

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

int assort(const void *a, const void *b){return *(long long*)a-*(long long*)b;}
int dessort(const void *a, const void *b){return *(long long*)b-*(long long*)a;}

int main(void){
    int n;
    scanf("%d",&n);
    long long a[300030],ar[n+1],al[n+1],tmp,R[100005]={},L[100005]={};
    ar[0]=-1;
    al[0]=10e10;
    for (int i=0; i<n*3; i++){
        scanf("%lld",&a[i]);
    }
    for (int i=0; i<n; i++){
        ar[i+1]=a[i];
        R[0]+=ar[i+1];
    }
    qsort (ar,n+1,sizeof(long long),assort);
    for (int i=0; i<n; i++){
        tmp=a[i+n];
        if (tmp>ar[1]){
            R[i+1]=R[i]-ar[1]+tmp;
            ar[1]=tmp;
            long long bf=1;
            while(1){
                if (bf*2>n){
                    break;
                }
                if (ar[bf*2]<=ar[bf*2+1] || bf*2+1>n){
                    if (ar[bf]>ar[bf*2]){
                        tmp=ar[bf];
                        ar[bf]=ar[bf*2];
                        ar[bf*2]=tmp;
                        bf=bf*2;
                    } else {
                        break;
                    }
                } else {
                    if (ar[bf]>ar[bf*2+1]){
                        tmp=ar[bf];
                        ar[bf]=ar[bf*2+1];
                        ar[bf*2+1]=tmp;
                        bf=bf*2+1;
                    } else {
                        break;
                    }
                }
            }
        } else {
            R[i+1]=R[i];
        }
    }
    
    for (int i=0; i<n; i++){
        al[i+1]=a[n*3-i-1];
        L[0]+=al[i+1];
    }
    qsort (al,n+1,sizeof(long long),dessort);
    for (int i=0; i<n; i++){
        tmp=a[2*n-i-1];
        if (tmp<al[1]){
            L[i+1]=L[i]-al[1]+tmp;
            al[1]=tmp;
            long long bf=1;
            while(1){
                if (bf*2>n){
                    break;
                }
                if (al[bf*2]>=al[bf*2+1] || bf*2+1>n){
                    if (al[bf]<al[bf*2]){
                        tmp=al[bf];
                        al[bf]=al[bf*2];
                        al[bf*2]=tmp;
                        bf=bf*2;
                    } else {
                        break;
                    }
                } else {
                    if (al[bf]<al[bf*2+1]){
                        tmp=al[bf];
                        al[bf]=al[bf*2+1];
                        al[bf*2+1]=tmp;
                        bf=bf*2+1;
                    } else {
                        break;
                    }
                }
            }
        } else {
            L[i+1]=L[i];
        }
    }
    tmp=R[0]-L[n];
    for (int i=0; i<=n; i++){
        tmp=tmp>(R[i]-L[n-i])?tmp:(R[i]-L[n-i]);
    }
    printf("%lld\n",tmp);
    return 0;
}


Measured memory_bytes: 6392
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long double ld;
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,m;
  cin >> n >> m;
  vector<string> A(n), B(m);
  REP(i,n) cin >> A[i];
  REP(i,m) cin >> B[i];
  REP(i,n-m+1) REP(j,n-m+1){
    bool flag = true;
    REP(k,m) REP(l,m){
      if(B[k][l]!=A[i+k][j+l]){
        flag = false;
        break;
      }
    }
    if(flag){
      puts("Yes");
      return 0;
    }
  }

  puts("No");
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

int main() {
    const int numPrimes = 10005;
    bool primes[numPrimes];
    for (int i = 2; i != numPrimes; ++i) {
        primes[i] = true;
    }

    for (int i = 2; i != int(sqrt(numPrimes)); ++i) {
        if (primes[i]) {        
            for (int j = 2; i * j < numPrimes; ++j) {
                primes[i*j] = false;
            }
        }
    }

    int n;
    while (cin >> n && n != 0) {
        for (int i = n; i - 2 >= 0; --i) {
            if (primes[i] && primes[i-2]) {
                cout << i-2 << " " << i << endl;
                break;
            }
        }

    }
    return 0;
}

Measured memory_bytes: 1172
S = int(input())
mod = 10**9+7

ans = 0

x = [0]*(2020)
x[3] = 1
x[4] = 1
x[5] = 1
for i in range(6, S+1):
    x[i] += 1
    for j in range(3, i-2):
        x[i] += x[j]
        x[i] %= mod

print(x[S])

Measured memory_bytes: 9196
#include <bits/stdc++.h>
#define int long long
#define debug(x) cerr << "\n" \
                      << #x << ": " << x << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define INF (1LL << 30)
#define pii pair<int, int>
#define MOD 1000000007
using namespace std;

/*
    MAIN FUNCTION
 */
signed main()
{
    string s;
    cin>>s;
    map<char,int> m{};

    rep(i,s.size()){
        m[s[i]]++;
    }
    for (auto k : m){
        if (k.second != 2){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}

Measured memory_bytes: 256
n, m = map(int, input().split())

sc = [[int(x) for x in input().split()] for _ in range(m)]
ans = -1
for i in range(10**n):
    if len(str(i)) != n:
        continue
    x = str(i)
    for s, c in sc:
        if int(x[s-1]) != c:
            break
    else:
        print(i)
        exit()
print(-1)   

Measured memory_bytes: 3064
i,o,t,j,l,s,z=map(int,input().split())
ans=0
if i==0 or j==0 or l==0:
  ans+=o+(i//2)*2+(j//2)*2+(l//2)*2
else:
  ans+=o+(i//2)*2+(j//2)*2+(l//2)*2
  ans1=o+((i-1)//2)*2+((j-1)//2)*2+((l-1)//2)*2+3
  ans=max(ans,ans1)
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
 
int main() {
  int N;
  cin>>N;
  int H[N];
  rep(i,N){
    cin>>H[i];
  }
  int count=0;
  int saidai=0;
  rep(i,N-1){
    if(H[i]>=H[i+1]){
      count++;
      saidai=max(saidai,count);
    }else{
      count=0;
    }
  }  
  cout <<saidai<<endl;
  return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int A[50],B[50],C[50],D[50];
int arr[11];
int N,M,Q;
int sum,ans;
void solve(int p,int n) {
    if(n == N+1) {
        sum = 0;
        for(int i=0;i<Q;i++) {
            if(arr[B[i]]-arr[A[i]] == C[i]) {
                sum+=D[i];
            }
        }
        ans = max(ans,sum);
        return ;
    }
    for(int i=p;i<=M;i++) {
        arr[n] = i;
        solve(i,n+1);
    }
}
int main () {
    ios_base::sync_with_stdio(false);
    cin>>N>>M>>Q;
    for(int i=0;i<Q;i++) {
        cin>>A[i]>>B[i]>>C[i]>>D[i];
    }
    ans = 0;
    solve(1,1);
    cout<<ans<<"\n";
    return 0;
}


Measured memory_bytes: 3680
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] sa = br.readLine().split(" ");
		int n = Integer.parseInt(sa[0]);
		sa = br.readLine().split(" ");
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(sa[i]);
		}
		br.close();

		Arrays.parallelSort(a);

		long ans = 1;
		for (int i = 0; i < n - 1; i++) {
			if (a[i] * 2 >= a[i + 1]) {
				ans++;
			} else {
				ans = 1;
			}
			a[i + 1] += a[i];
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 47832
// Remember...

#include<bits/stdc++.h>

#define F first
#define S second
#define PB push_back
#define sz(s) int((s).size())
#define bit(n,k) (((n)>>(k))&1)

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int maxn=110,mod=998244353;
const ll inf=1e18;

int a[maxn][maxn], b[maxn][maxn], f[maxn], n, m;
bool adj[maxn][maxn], is[maxn][maxn], mark[maxn];

bool dfs(int u){
    mark[u]=1;
    for(int i=0;i<n;i++){
	if(adj[u][i]==0) continue;
	if(f[i]==-1){
	    f[i]=u;
	    return 1;
	}
	if(mark[ f[i] ]==0 && dfs( f[i] ) ){
	    f[i]=u;
	    return 1;
	}
    }
    return 0;
}

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

    cin>>n>>m;

    for(int i=0;i<n;i++){
	for(int j=0;j<m;j++)
	    cin>>a[i][j], a[i][j]--;
    }
    for(int col=0;col<m;col++){
	memset(adj,0,sizeof adj);
	for(int i=0;i<n;i++){
	    for(int j=col;j<m;j++){
		adj[ a[i][j]/m ][i]=1;
	    }
	}
	memset(f,-1,sizeof f);
	for(int k=0;k<n;k++)
	    memset(mark,0,sizeof mark), assert(dfs(k));
	for(int i=0;i<n;i++){
	    int id=-1;
	    for(int j=col;j<m;j++)
		if(a[i][j]/m==f[i]) id=j;
	    assert(id!=-1);
	    swap(a[i][col], a[i][id]);
	}
    }
    for(int i=0;i<n;i++)
	for(int j=0;j<m;j++)
	    cout<<a[i][j]+1<<" \n"[j==m-1], b[i][j]=a[i][j];
    for(int i=0;i<n;i++){
	for(int j=0;j<m;j++){
	    a[ b[i][j]/m ][j]= b[i][j];
	}
    }
    for(int i=0;i<n;i++){
	for(int j=0;j<m;j++)
	    cout<<a[i][j]+1<<" \n"[j==m-1];
    }
    return 0;
}
// Deathly mistakes:
//  * Read the problem carefully.
//  * Check maxn.
//  * Overflows.


// #pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")


Measured memory_bytes: 512
from collections import defaultdict

b = defaultdict(lambda :0)
r = defaultdict(lambda :0)

b[""] = 0

n = int(input())
for i in range(n):
    a = input()
    a.replace("\r","")
    b[a] += 1
m = int(input())
for i in range(m):
    a = input()
    a.replace("\r","")
    r[a] += 1
      
b_keys = list(b.keys())
r_keys = list(r.keys())
all_keys = list(set(b_keys).union(set(r_keys)))
pays = defaultdict(lambda :0)

for i in all_keys: 
    pays[i] = b[i] - r[i]

print(max(pays.values()))

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

struct UnionFind{
  vector<int> par;
  UnionFind(int N):par(N){
    REP(i,N) par[i]=i;
  }
  int root(int x){
    if(par[x]==x) return x;
    return par[x]=root(par[x]);
  }
  void unite(int x,int y){
    int rx=root(x);
    int ry=root(y);
    if(rx==ry) return;
    par[rx]=ry;
  }
  bool same(int x,int y){
    int rx=root(x);
    int ry=root(y);
    return rx==ry;
  }
};

int main(){
  int N,M; scanf("%d%d",&N,&M);
  vector<vector<int>> e1,e2;
  int a,b;
  REP(i,M){
    scanf("%d%d",&a,&b);
    e1.push_back({--a,--b});
  }
  bool t=true;
  while(t){
    t=false;
    UnionFind uf(N);
    REP(i,e2.size()){
      uf.unite(e2[i][0],e2[i][1]);
    }
    REP(i,e1.size()){
      if(uf.same(e1[i][0],e1[i][1])){
        e2.push_back(e1[i]);
        e1.erase(e1.begin()+i);
        t=true;
        break;
      }
      uf.unite(e1[i][0],e1[i][1]);
    }
  }
  printf("%d\n",e1.size());
}

Measured memory_bytes: 3728
// IO library
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>

// container library
#include <deque>
#include <list>
#include <map>
#include <set>
#include <string>
#include <vector>

// namespace
using namespace std;

// typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<VB> VVB;

// container
#define EACH(i, c) for (auto i = (c).begin(); i != (c).end(); i++)
#define SORT(c) sort((c).begin(), (c).end())
#define GSORT(c) sort((c).begin(), (c).end(), greater<decltype((c).front())>())
#define SZ(x) ((int)(x).size())
#define MEMSET(c, v) memset((c), v, sizeof(c))

// repetition
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define NREP(i, n) FOR(i, 1, n + 1)
#define RFOR(i, a, b) for (int i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n, 0)
#define RNREP(i, n) RFOR(i, n, 1)

// constant
// const ll MOD = 1e9 + 7;
// const int INF = 1e9;
// const ll INF = 1e15;
// const int dx[4] = {0, -1, 1, 0};
// const int dy[4] = {-1, 0, 0, 1};
// const int dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const int dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};

// debug
#define test(x) cout << #x << " = " << x << endl

// answer output
#define Yes(c) cout << ((c) ? "Yes" : "No") << endl;
#define YES(c) cout << ((c) ? "YES" : "NO") << endl;
#define possible(c) cout << ((c) ? "possible" : "impossible") << endl;
#define POSSIBLE(c) cout << ((c) ? "POSSIBLE" : "INPOSSIBLE") << endl;


// --------------------------------------------------------


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

  int N;
  cin >> N;

  if (N == 3) {
    cout << 2 << " " << 3 << " " << 25 << endl;
    return 0;
  }

  int j = 1, mod2 = 0, mod3 = 0, mod5 = 0;
  REP(i, N - 2) {
    while (true) {
      j++;
      if (j % 2 == 0 || j % 3 == 0 || j % 5 == 0) {
        cout << j << " ";
        mod2 = (mod2 + j) % 2;
        mod3 = (mod3 + j) % 3;
        mod5 = (mod5 + j) % 5;
        break;
      }
    }
  }

  while (true) {
    j++;
    if ((j + mod2) % 2 == 0 && (j + mod5) % 5 == 0 && j % 3 == 0) {
      cout << j << " ";
      break;
    }
  }

  while (true) {
    j++;
    if ((j + mod3) % 3 == 0 && j % 10 == 0) {
      cout << j << endl;
      return 0;
    }
  }
}

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

int main() {
 long long int k,a,b,x,y,z,w;
 cin>>k>>x;
a=x+1-k;
b=x-1+k;
for(int i=a;i<=b;i++)
{
  cout<<i<<" ";
}
cout<<endl;
//cout<<max(x,max(y,z))<<endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const long long mod = 1e9 + 7;

int n;
int arr[N];
int spf[N];
void pre(){
    int i = 0, j = 0;
    for(i = 2; i < N; i++)
        spf[i] = i;
    for(i = 4; i < N; i += 2)
        spf[i] = 2;
    for(i = 3; i * i < N; i++){
        if(spf[i] == i){
            for(j = i * i; j < N; j += i) {
                if(spf[j] == j)
                    spf[j] = i;
            }
        }
    }
}
int primes_cnt[N];
vector<int> getFactorization(int x){
    vector<int> ret;
    while (x != 1)
    {
        ret.push_back(spf[x]);
        x = x / spf[x];
    }
    return ret;
}
void solve(){
    pre();
    int i = 0;
    int g = 0;
    for(i = 0; i < n; i++){
        g = __gcd(g, arr[i]);
        if(arr[i] == 1)
            continue;
        vector<int> prime_fact = getFactorization(arr[i]);
        for(int x : prime_fact)
            primes_cnt[x]++;
    }
    bool ok = true;
    for(i = 0; i < n; i++){
        if(arr[i] == 1)
            continue;
        vector<int> prime_fact = getFactorization(arr[i]);
        for(int x : prime_fact)
            primes_cnt[x]--;
        for(int x : prime_fact)
            ok &= (primes_cnt[x] == 0);
        for(int x : prime_fact)
            primes_cnt[x]++;
    }
    if(ok)
        cout << "pairwise coprime";
    else if(g == 1)
        cout << "setwise coprime";
    else
        cout << "not coprime";
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n;
    int i = 0;
    for(i = 0; i < n; i++)
        cin >> arr[i];
    solve();
    return 0;
}

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

int main(){
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  int count = 0;
  int sum = 0;
    
  for (int i = 0; i < n; i++){
    cin >> a.at(i);
  }
  
  for (int k = 0; k < n; k++){
    sum += a.at(k);
  }

  sort(a.begin(), a.end());
  reverse(a.begin(), a.end());
  
  for (int j = 0; j < m; j++){
    
    if (4 * m * a.at(j) < sum){
      cout << "No" << endl;
      break;
    }
    else{
      count++;
    }
  }
  
  if (count == m){
    cout << "Yes" << endl;
  }
}

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	long int  i,j,n,t,x,k,q;
	cin>>n>>k>>q;
	//int a[n+1];
	//memset(a,1,sizeof(a));
	//cout<<a[0]<<"\n";
	long int b[100001]={0};
	for(i=1;i<=q;i++)
	{
	    cin>>x;
	    b[x]++;
	  
	}
	for(i=1;i<=n;i++)
	{
	    if((k-(q-b[i]))<=0)
	    {
	        cout<<"No"<<"\n";
	    }
	    else
	    cout<<"Yes"<<"\n";
	}
	
	return 0;
}

Measured memory_bytes: 1408
open System
open System.Collections
open System.Collections.Generic
open System.IO
open System.Linq

[<AutoOpen>] 
module input =
    let Str()  = Console.ReadLine()
    let Int()  = Str() |> int
    let Char() = Str() |> char
    let CharList()  = [ for c in Str() -> c ]
    let CharArray() = [|for c in Str() -> c|]
[<AutoOpen>] 
module parse =
    let c2s (c:obj) = 
        match c with
        | :? (char[])    as c -> new string(c)
        | :? (char list) as c -> c|>Array.ofList|>String
        | :?  char       as c -> c.ToString()
        | _ -> failwith ""
    let c2i c = c2s(c) |> int

let enumerateSplitElement(str:string) =
    let strArr = [|for c in str ->string c|] |> Array.rev    
    let rec f (elem:string) lis cnt =
        seq{
            if cnt=strArr.Length then 
                yield! [elem::lis]
            else
                yield! f (strArr.[cnt]+elem) lis         (cnt+1)
                yield! f  strArr.[cnt]       (elem::lis) (cnt+1)
        }
    f strArr.[0] [] 1

[<EntryPoint>]
let main _ = 
    let S = Str()

    let ans = 
        enumerateSplitElement(S)
        |> Seq.map (fun x -> List.map(fun x -> int64 x) x)
        |> Seq.map (fun x -> List.sum x)
        |> Seq.sum

    printfn "%i" ans

    0
    



Measured memory_bytes: 12368
import java.io.InputStream;
import java.io.BufferedReader;
import java.io.PrintWriter;
import java.io.InputStreamReader;
import java.io.IOException;
import java.io.BufferedWriter;
import java.io.OutputStreamWriter;
import java.math.BigInteger;
import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Stream;

/**
 *
 * @author Pradyumn Agrawal coderbond007
 */

public class Main{
    public static InputStream inputStream = System.in;
    public static StringTokenizer tok = null;
    public static BufferedReader br = new BufferedReader(new InputStreamReader(inputStream), 32768);
    public static PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));

    public static void main(String[] args) throws java.lang.Exception{
        new Thread(null, new Runnable() {
            public void run() {
                try {
                    new Main().run();
                    out.close();
                } catch(IOException e){

                }
            }
        }, "1", 1 << 26).start();
    }
    public void run() throws IOException
    {
    	int W = ni();
        int a = ni(),b = ni();
        if(a > b){
            int temp = a;
            a = b;
            b = temp;
        }
        out.println(Math.max(b - a - W,0));
    }
    public static int ni() throws IOException {
        return Integer.parseInt(ns());
    }
    public static long nl() throws IOException {
        return Long.parseLong(ns());
    }
    public static double nd() throws IOException {
        return Double.parseDouble(ns());
    }
    public static char nc() throws IOException {
        return ns().charAt(0);
    }
    public static BigInteger nextBigInteger() throws IOException {
        return new BigInteger(ns());
    }
    public static String ns() throws IOException {
        while(tok == null || !tok.hasMoreTokens()){
            try {
                tok = new StringTokenizer(br.readLine());
            } catch (IOException e){
                throw new RuntimeException(e);
            }
        }
        return tok.nextToken();
    }
    public static int[] na(int n) throws IOException {
        int[] a = new int[n];
        for(int i = 0;i < n; i++){
            a[i] = ni();
        }
        return a;
    }
    public static long[] nal(int n) throws IOException {
        long[] a = new long[n];
        for(int i = 0;i < n; i++){
            a[i] = nl();
        }
        return a;
    }
    public static char[] ns(int n) throws IOException {
        return ns().substring(0,n).toCharArray();
    }
    public static char[][] nm(int n, int m) throws IOException{
        char[][] map = new char[n][];
        for(int i = 0;i < n; i++){
            map[i] = ns(m);
        }
        return map;
    }
    public static String readLine() {
    	try {
    		return br.readLine();
    	} catch(IOException e){
    		throw new RuntimeException(e);
    	}
    }
}

Measured memory_bytes: 23380
N=int(input())
x=[a for a in input()]
judge=list(set(x))
count=0
ans=[]


for j in range(N-1):
  for i in judge:
    X=x[0:j+1]
    Y=x[j+1::]
    if i in X and i in Y:
      count += 1
  else:
    ans.append(count)
    count=0
print(max(ans))

Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
using namespace std;
const int mod = 1000000007;
#define ll long long

int main()
{
	char X, Y;
	cin >> X >> Y;
	if (X < Y) cout << '<' << endl;
	else if(X>Y) cout << '>' << endl;
	else  cout << '=' << endl;
}

Measured memory_bytes: 256
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	vs := nextInts(2, sc)
	var res int
	if vs[0] < vs[1] {
		res = gcd(vs[0], vs[1])
	} else {
		res = gcd(vs[1], vs[0])
	}
	fmt.Println(res)
}

func gcd(x int, y int) int {
	a, b := x, y
	for a != 0 {
		a, b = b%a, a
	}
	return b
}

func nextInt(sc *bufio.Scanner) int {
	sc.Scan()
	v, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return v
}

func nextInts(num int, sc *bufio.Scanner) []int {
	vs := make([]int, num)
	for i := 0; i < num; i++ {
		vs[i] = nextInt(sc)
	}
	return vs
}



Measured memory_bytes: 1116
import java.util.*
import kotlin.*

import java.io.InputStream
import java.lang.NumberFormatException
import java.lang.StringBuilder


fun main(args: Array<String>) {
    Program().solve()
}

class Program {
    fun solve() {
        val sc = FastScanner()
        val a = arrayOf(1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51)
        val k = sc.nextInt()
        println(a[k-1])
    }
}


class FastScanner {
    companion object {
        val input: InputStream = System.`in`
        val buffer = ByteArray(1024) { 0 }
        fun isPrintableChar(c: Int): Boolean = c in 33..126
    }

    var ptr = 0
    var buflen = 0
    private fun hasNextByte(): Boolean {
        if (ptr < buflen) {
            return true
        } else {
            ptr = 0
            buflen = input.read(buffer)
            if (buflen <= 0) {
                return false
            }
        }
        return true
    }

    private fun readByte(): Int = if (hasNextByte()) buffer[ptr++].toInt() else -1

    private fun skipUnprintable() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr].toInt())) ptr++
    }

    fun hasNext(): Boolean {
        skipUnprintable()
        return hasNextByte()
    }

    fun next(): String {
        if (!hasNext()) throw NoSuchElementException()
        val sb = StringBuilder()
        var b = readByte()
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b)
            b = readByte()
        }
        return sb.toString()
    }

    fun nextInt(): Int {
        if (!hasNext()) throw NoSuchElementException()
        var n = 0
        var b = readByte()
        // '-' = 45
        val minus = b == 45
        if (minus) {
            b = readByte()
        }

        // '0' = 48 '9' = 57
        if (b !in 48..57) {
            throw NumberFormatException()
        }

        while (true) {
            if (b in 48..57) {
                n *= 10
                n += b - 48
            } else if (b == -1 || !isPrintableChar(b)) {
                return if (minus) -n else n
            } else {
                throw NumberFormatException()
            }
            b = readByte()
        }
    }

    fun nextLong(): Long {
        if (!hasNext()) throw NoSuchElementException()
        var n = 0L
        var b = readByte()
        // '-' = 45
        val minus = b == 45
        if (minus) {
            b = readByte()
        }

        // '0' = 48 '9' = 57
        if (b !in 48..57) {
            throw NumberFormatException()
        }

        while (true) {
            if (b in 48..57) {
                n *= 10
                n += b - 48
            } else if (b == -1 || !isPrintableChar(b)) {
                return if (minus) -n else n
            } else {
                throw NumberFormatException()
            }
            b = readByte()
        }
    }

    fun nextDouble(): Double = next().toDouble()
}


Measured memory_bytes: 31264
#include <stdio.h>

int main(void) {

   int A,B;
   scanf("%d%d",&A,&B);
   
   if (A >= 13) {
      printf("%d\n", B);
   }
   else if (6 <= A && A <= 12) {
      printf("%d\n", B/2);
   }
   else {
      printf("0\n");
   }


  return 0;
}


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

int main()
{
    int sec;
    cin >> sec;
    int h, m, s;
    h = sec / 3600;
    m = sec % 3600 / 60;
    s = sec % 60;
    cout << h << ":" << m << ":" << s << endl;
}


Measured memory_bytes: 3092
//-O2 is required.
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
using namespace std;
typedef vector<int> V;
map<V,int>m;
//map<V,pair<pair<int,int>,V> >track;
//V v1,v2;
pair<int,int>vec2nvec;
int bfs(V &v, int back){
	if(!back&&m.find(v)!=m.end()){
		//v1.clear();
		//vec2nvec=make_pair(0,0);
		//v2=v;
		return m[v];
	}
	set<V>s;
	queue<pair<V,int> >q;
	if(back)m[v]=0;
	s.insert(v);
	int i,j;
	for(q.push(make_pair(v,0));!q.empty();){
		V vec=q.front().first;
		int depth=q.front().second;
		q.pop();
		if(back&&depth>3)return 0;
		for(i=0;i<vec.size();i++)
			for(j=i+1;j<vec.size();j++){
				V nvec=vec;
				reverse(nvec.begin()+i,nvec.begin()+j+1);
				if(!back&&m.find(nvec)!=m.end()){
					//v1=vec;
					//vec2nvec=make_pair(i,j);
					//v2=nvec;
					return depth+1+m[nvec];
				}
				if(!s.insert(nvec).second)continue;
				if(back)m[nvec]=depth+1;
				//track[nvec]=make_pair(make_pair(i,j),vec);
				q.push(make_pair(nvec,depth+1));
			}
	}
	return 0;
}
//void backtrack(V &v){
//	if(track.find(v)==track.end())return;
//	backtrack(track[v].second);
//	printf("%d %d\n",track[v].first.first+1,track[v].first.second+1);
//}
//void forwardtrack(V &v){
//	if(track.find(v)==track.end())return;
//	printf("%d %d\n",track[v].first.first+1,track[v].first.second+1);
//	forwardtrack(track[v].second);
//}
main(){
	V prob;
	int i=0,t,n;
	for(scanf("%d",&n);i<n;i++){
		if(scanf("%d",&t)==-1)return 0;
		prob.push_back(t);
	}
	V goal=prob;
	sort(goal.begin(),goal.end());
	bfs(goal,1);
	printf("%d\n",bfs(prob,0));
	//backtrack(v1);
	//if(vec2nvec.first!=vec2nvec.second)printf("%d %d\n",vec2nvec.first+1,vec2nvec.second+1);
	//forwardtrack(v2);
}

Measured memory_bytes: 91004
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 3010
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
#define INF 1000000000000
const int MAX = 1000000;
const int MOD = 1000000007;
int main(){
	int n;
    cin>>n;
    vector<int> d(n);
    int sum=0;
    REP(i,n){
        cin>>d[i];
        sum+=d[i];
    }
    ll ans=0;
    REP(i,n){
        ans+=d[i]*(sum-d[i]);
    }
    ans/=2;
    OUT(ans);
    return 0;
}

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

int main(){
	int n;
    cin >> n;
	int ans = 1000000000;
	rep(i,n){
		int a;
		int cnt = 0;
		cin >> a;
		if(a%2 == 1){
			ans = 0;
			break;
		}
		while(1){
			a /= 2;
			cnt++;
            if(a %2 == 1) break;
		}
		ans = min(ans,cnt);
	}
	cout << ans << endl;
}

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

using namespace std;

#define sqr(x) ((x) * (x))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

typedef vector<int> vi;
typedef long long ll;

void solve() {
  int N;
  cin >> N;
  vector<pair<int, int>> p(N);
  for (int i = 0; i < N; i++) {
    int a, b;
    cin >> a >> b;
    p[i] = make_pair(b, a);
  }
  ll sum = 0;
  sort(all(p));
  for (auto x : p) {
    sum += x.second;
    if (sum > x.first) {
      cout << "No" << endl;
      return;
    }
  }
  cout << "Yes" << endl;
}

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

  solve();

  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main(){
    int x,a,b,c;
    cin>>x;
    a = x/100;
    b = (x-a*100)/10;
    c = x-(b*10)-(a*100);
    if(a==7||b==7||c==7){
        cout <<"Yes";
    }
    else{
        cout <<"No";
    }
}

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

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;

    for(int i=0; i<s.size(); ++i) {
        int rot = s[i] + n;
        if (rot > 90) rot -= 26;
        cout << (char)(rot);
    }
    cout << endl;
    
    return 0;
}

Measured memory_bytes: 256
// Standard I/O
#include <iostream>
#include <sstream>
#include <cstdio>
// Standard Library
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
// Template Class
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
// Container Control
#include <algorithm>

using namespace std;

#define rep( i, n ) for( int i = 0; i < n; ++i )
#define irep( i, n ) for( int i = n-1; i >= 0; --i )
#define reep( i, s, n ) for ( int i = s; i < n; ++i )
#define ireep( i, n, s ) for ( int i = n-1; i >= s; --i )
#define foreach(itr, x) for( typeof(x.begin()) itr = x.begin(); itr != x.end(); ++itr)

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all( v ) v.begin(), v.end()
#define fs first
#define sc second
#define vc vector

// for visualizer.html
double SCALE = 1.0;
double OFFSET_X = 0.0;
double OFFSET_Y = 0.0;
#define LINE(x,y,a,b) cerr << "line(" << SCALE*(x) + OFFSET_X << ","	\
	<< SCALE*(y) + OFFSET_Y << ","										\
	<< SCALE*(a) + OFFSET_X << ","										\
	<< SCALE*(b) + OFFSET_Y << ")" << endl;
#define CIRCLE(x,y,r) cerr << "circle(" << SCALE*(x) + OFFSET_X << ","	\
	<< SCALE*(y) + OFFSET_Y << ","										\
	<< SCALE*(r) << ")" << endl;

typedef long long ll;
typedef complex<double> Point;

typedef pair<int, int> pii;
typedef pair<int, pii> ipii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector< vector<int> > vii;
typedef vector< vector<double> > vdd;

typedef vector<int>::iterator vi_itr;

const int IINF = 1 << 28;
const int MOD = 1e9+7;
const double INF = 1e30;
const double EPS = 1e-10;
const double PI = acos(-1.0);

// Direction : L U R D
const int dx[] = { -1, 0, 1, 0};
const int dy[] = { 0, -1, 0, 1 };

int n;
int a[200000];
ll sum[200010];

pair<ll, ll> solve ( int l, int r, int d ) {
    ll mid_sum = sum[r] - sum[l];
    auto itr = lower_bound(sum+l, sum+r, sum[l]+mid_sum/2);
    int idx = itr - sum;

    if ( idx+d < l || idx+d >= r ) return mp(1ll << 62, 0);
    if ( l == idx+d  || r == idx+d ) return mp(1ll << 62, 0);

    ll left = (sum[idx+d] - sum[l]), right = (sum[r] - sum[idx+d]);
    return mp(left, right);
}

int main()
{
    cin >> n;
    rep(i, n) cin >> a[i];

    sum[0] = 0;
    rep(i, n) sum[i+1] = sum[i] + a[i];

    ll ans = 1ll << 62;
    reep(i, 1, n) {
        reep(j, -1, 2) reep(k, -1, 2) {
            auto left = solve(0, i, j);
            auto right = solve(i, n, k);

            ll val[4] = { left.fs, left.sc, right.fs, right.sc };

            // cout << i << " " << j << " " << k << endl;
            // cout << "  "; rep(l, 4) cout << val[l] << " "; cout << endl;
            
            sort(val, val+4);
        
            ans = min(ans, val[3] - val[0]);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 2688
#include <stdio.h>
#include <string.h>
 int main()
 {
     int i,j,k=0;
	 char str[26];
     gets(str);
     for (i = 0; i < strlen(str); i++)
	 	{
         for (j =i + 1; j < strlen(str);j++) 
		 	{
             if (str[i] == str[j]) 
			 k=1;
            }
        }
     if(k==1) printf("no");
     else printf("yes");
 }


Measured memory_bytes: 128
from collections import Counter

h, w = map(int, input().split())
a = Counter(''.join(input() for _ in range(h)))

center = h * w % 2
side = (h // 2) * (w % 2) + (w // 2) * (h % 2)

cnt = 0
for i in a:
    if cnt == center:
        break
    if a[i] % 2 == 1:
        a[i] -= 1
        cnt += 1
cnt = 0
for i in a:
    if cnt == side:
        break
    if a[i] % 4 == 2:
        a[i] -= 2
        cnt += 1

print('Yes' if sum(a[i] % 4 for i in a) == 0 else 'No')


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

using namespace std;

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  set<char> s;
  for(int i=0; i<n; i++){
    char x;
    cin >> x;
    s.insert(x);
  }
  string num[5] = {"", "One", "Two", "Three", "Four"};
  cout << num[s.size()] << endl;
  return 0;
}


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

template <typename T> inline void read (T &x) {bool b = 0; char c; while (!isdigit (c = getchar()) && c != '-');
if (c == '-') c = getchar(), b = 1; x = c - 48; while (isdigit(c = getchar())) x = (x<<3) + (x<<1) + c - 48; if (b)x=-x;}
template <typename T> inline void wrip(T x) {if (x > 9) wrip(x / 10); putchar(x%10 + 48); }

template <typename T> inline void write(T x) {if (x < 0) putchar('-'), x = -x; wrip(x); putchar(' ');}
template <typename T> inline void writeln(T x) {if (x < 0) putchar('-'), x = -x; wrip(x); putchar('\n');}
inline char readch() {char c; do c = getchar(); while (c == '\n' || c == ' '); return c;}
inline void reads(string &s) {char c; while((c=getchar())==' '||c =='\n'); s=c; while((c=getchar())!=' '&&c!='\n') s+=c;}
inline void getlines(string &s) {char c; while((c=getchar())=='\n'); s=c; while((c=getchar())!='\n') s+=c;}
typedef const int csint;

#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef long double ld;
typedef pair <int, int> ii;
typedef vector <int> vi;

const ld pi = acos(-1);
const ll inf = 1e9;
const int mod = 1e9 + 7,
N = 2e5 + 11;

ll f[N];
ll pw(ll a, ll b) {
    if (b == 0)
        return 1;
    ll t = pw(a, b / 2);
    t = t * t  % mod;
    if (b % 2)
        return t * a % mod;
    return t;
}
int main() {
    #ifdef makacha
        freopen("m.inp", "r", stdin);
        freopen("m.out", "w", stdout);
    #endif // makacha
    ll n, a, b;
    cin >> n >> a >> b;
    ll res = pw(2, n) - 1;
    f[0] = 1;
    for (int i = 1; i <= b; i++)
        f[i] = f[i - 1] * (n - i + 1) % mod * pw(i, mod - 2) % mod;
    res = (res - f[a] + mod) % mod;
    res = (res - f[b] + mod) % mod;
    cout << res;
}


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

int main() {
    int n;
    cin >> n;
    long long sum = 0;
    for (int i = 1; i < n; i++) {
        sum += i;
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
#include<vector>
#include<cmath>
#include<queue>
#include<string.h>
#include<map>
#include<algorithm>
#define ll long long
#define rep(i,a,b) for(int i = a;i < b;i++)
#define N 100004
#define INF 1e9+7

using namespace std;

string s,t;

int main()
{
    ios_base::sync_with_stdio(false);

    cin >> s >> t;

    rep(d,0,s.size())
    {
        bool can = true;

        rep(j,0,s.size())
        {
            if(s[(j+d)%s.size()] != t[j])
            {
                can = false;
                break;
            }
        }

        if(can)
        {
            cout << "Yes\n";
            return 0;
        }
    }

    cout << "No\n";

    return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <bits/stdc++.h>
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;

int main(int argc, char** argv) {
	int n;
	scanf("%d",&n);
	
	int ren[n];
	int b,k=1;
	int cnt=n;
	for(int i=0;i<n;i++)
	{
		scanf("%d",&b);
		ren[i]=b;
	}
	
	sort(ren,ren+n);
	for(int i=0;i<n;i++)
	{
		while(ren[i+1]==ren[i])
		{
			k++;
			i++;
		}
		if(k%2==0) cnt-=k;
		else cnt=cnt-k+1;
		k=1;
	}
	printf("%d",cnt);
	return 0;
}

Measured memory_bytes: 640
#include<iostream>
using namespace std;
int main(){
	long long int A,B,V,W,T,x,y;
	cin>>A>>V>>B>>W>>T;
	x=B-A-(V-W)*T;
	y=A-B-(V-W)*T;
	if(A<B){
	if(x<=0){
		cout<<"YES"<<endl;
	}
	else{
		cout<<"NO"<<endl;
	}
	}
	if(A>B){
		if(y<=0){
			cout<<"YES"<<endl;
		}
		else{
			cout<<"NO"<<endl;
		}
	}
		
	
}

Measured memory_bytes: 3636
<?php 
    fscanf(STDIN, '%d %d', $x, $y);
    $a = [1,3,5,7,8,10,12];
    $b = [4, 6, 9, 11];
    $c = 2;
    if((in_array($x, $b, true) && in_array($y, $b, true))||
      (in_array($x, $a, true) && in_array($y, $a, true))||
      ($x == 2 && $y == 2)){
        echo "Yes";
    }else{
        echo "No";
    }
?>



Measured memory_bytes: 4604
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from collections import defaultdict

S = input()
S = sorted(S)
S = list(map(ord, S))

ans = 0
while len(S) > 0:
    mn = S[0]
    S.remove(mn)
    nxt = mn + 1
    succ = 1
    while True:
        if nxt in S:
            S.remove(nxt)
            succ += 1
            nxt += 1
        else:
            break
    ans += min(3, succ)
print(ans)

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

int main(){
  string S; cin>>S;
  int a=S.size();
  vector<int> b(10,0); int c=0;
  for(int i=0;i<a;i++){
    if(S[i]=='A'||S[i]=='T'||S[i]=='G'||S[i]=='C'){
      b[c]++;
    }else{
      c++;
    }
  }
  sort(b.begin(),b.end());
  cout<<b[9]<<endl;
}

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

using namespace std;

int main()
{
  int q;
  cin >> q;
  long long s = 0, t = 0;
  while(q--){
    int p, n;
    char c;
    cin >> p >> c >> n;
    if(c == '(') s += n;
    else t += n;
    if(s == t) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  
    vector<int> vec = { a, b, c};
    sort(vec.begin(), vec.end()); //

    if(vec.at(0) == 5 &&vec.at(1) == 5 && vec.at(2) == 7) {
        cout << "YES" << endl;
    }
  else{
    cout<< "NO" << endl;
  }
  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional> 
#define ff first 
#define endl "\n"
#define ss second 
#define li list<int>
#define vi vector<int>
#define ll long long int
#define pii pair<int,int>
#define vii vector<pair<int,int> >
#define mp make_pair
#define pb push_back
#define setbits(x) __builtin_popcountll(x)
#define custom  pair<int,pair<int,int> >
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> pbds; 
#define mod 1000000007
ll dp[401][401];
ll cost[401][401];
ll solve(int i,int j,vector<ll> &arr){
    if(i>=j)
    return 0;
    if(dp[i][j]!=-1)
    return dp[i][j];
    ll sum=LLONG_MAX;
    for(int k=i;k<j;k++){
        sum=min(solve(i,k,arr)+solve(k+1,j,arr)+cost[i][j],sum);
    }
    return dp[i][j]=sum;
}
int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    vector<ll> arr(n);
    for(int i=0;i<n;i++){
        cin>>arr[i];
    }
    memset(cost,0,sizeof cost);
    for(int i=0;i<n;i++){
        cost[i][i]=arr[i];
    }
    for(int i=0;i<n;i++){
        for(int j=1;j<n;j++){
            if(i>j)continue;
            else{
                cost[i][j]=cost[i][j-1]+arr[j];
            }
        }
    }
    memset(dp,-1,sizeof dp);
    ll ans=solve(0,n-1,arr);
    cout<<ans;
    return 0;
}

Measured memory_bytes: 6200