akhauriyash/Code-Regression huggingface dataset:
import math
from decimal import Decimal, ROUND_HALF_UP
for _ in range(int(input())):
    a, b = tuple(sorted(map(int, input().split()), reverse = True)), tuple(sorted(map(int, input().split())))
    c = 0
    q = {():(0, 0)}
    for i in range(9):
        nq = {}
        for k in q:
            for j in b:
                if j not in k:
                    x = q[k][0] + (a[i] + j) * (a[i] > j)
                    y = q[k][1] + (a[i] + j) * (a[i] < j)
                    if x > 85:c += math.factorial(9 - i - 1)
                    elif y < 86:nq[tuple(list(k) + [j])] = (x, y)
        q = nq
    c /= 362880
    print("{} {}".format(Decimal(c).quantize(Decimal('0.000001'), rounding=ROUND_HALF_UP), Decimal(1 - c).quantize(Decimal('0.000001'), rounding=ROUND_HALF_UP)))


Measured memory_bytes: 49036
# coding: utf-8
N, M, X = map(int, input().split())
A = list(map(int, input().split()))
lst = [1 if (i in A) else 0 for i in range(1, N+2)]
lst2 = lst[:X]
lst3 = lst[X-1:]
print(min(sum(lst2),sum(lst3)))

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

const int INF = 10000;

int main() {
    int N; cin >> N;
    vector<P> R(N);
    vector<P> B(N);
    bool use[N];
    rep(i, N){
        use[i] = false;
    }
    rep(i, N){
        int a, b; cin >> a >> b;
        R[i] = make_pair(a, b);
    }
    rep(i, N){
        int c, d; cin >> c >> d;
        B[i] = make_pair(c, d);
    }
    sort(R.begin(), R.end());
    sort(B.begin(), B.end());

    rep(i, N){
        int c = B[i].first;
        int x = INF;
        int b = -1;
        int n = 0;
        while(1){
            if(n == N)break;
            if(use[n]){
                n++;
                continue;
            }
            int a = R[n].first;
            if(a > c)break;
            if(R[n].second < B[i].second){
                if(R[n].second > b){
                    b = R[n].second;
                    x = n;
                }
            }
            n++;
        }
        if(x == INF)continue;
        use[x] = true;
    }

    int ans = 0;
    rep(i, N){
        if(use[i])ans++;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3536
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const ll maxn=1e9+5;
bool b[maxn]={0};

int n;
int main(){
	cin>>n;
	int tmp,f1=0;
	for(int i=0;i<n;i++){
		cin>>tmp;
		if(b[tmp])f1=1;
		b[tmp]=1;
	}
	if(!f1)cout<<"YES";
	else cout<<"NO";
	return 0; 
} 

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

using namespace std;

int main(){
    int n;
    cin>>n;
    vector<int> p(n);
    for (int i = 0; i < n; ++i) {
        cin>>p[i];
    }
    int ans=numeric_limits<int>::max();
    for (int l = 0; l <= p[0]; ++l) {
        vector<int> tp=p;
        tp[0]-=l;
        int tans=l;
        for (int i = 0; i < n-1; ++i) {
            if(tp[i]>0){
                tans+=tp[i]*2;
                tp[i+1]-=tp[i];
            }
        }
        if(tp.back()>0)tans+=tp.back();
        ans=min(ans,tans);
    }
    for (int r = 0; r <= p.back(); ++r) {
        vector<int> tp=p;
        tp.back()-=r;
        int tans=r;
        for (int i = n-1; i > 0; --i) {
            if(tp[i]>0){
                tans+=tp[i]*2;
                tp[i-1]-=tp[i];
            }
        }
        if(tp.front()>0)tans+=tp.front();
        ans=min(ans,tans);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3184
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8').trim()

const [p, q, r] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const ans = () => {
  let min = Infinity

  min = p + q < min ? p + q : min
  min = p + r < min ? p + r : min
  min = q + r < min ? q + r : min

  return min
}

console.log(ans())


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

int main(){
	ll L, R;
	cin >> L >> R;
	for(ll key=0;2019*key+1<=R;key++) {
		if(L <= 2019*key and 2019*key+1 <= R) {
			cout << 0 << endl;
			return 0;
		}
	}

	ll ans = ((L*R)%2019);
	for(ll x=L;x<=R;x++) {
		for(ll y=x+1;y<=R;y++) {
			if(ans > ((x*y)%2019))
				ans = ((x*y)%2019);
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>

using namespace std;

string S;

int main()
{
    cin >> S;
    if (S[S.length() - 1] == 's')
    {
        cout << S << "es" << endl;
    }
    else
    {
        cout << S << "s" << endl;
    }
}

Measured memory_bytes: 3640
#include "bits/stdc++.h"
using namespace std;
int main() {
	long long X, Y, Z;
	cin >> X >> Y >> Z;
	int ans = 0, bet = 1;
	while (ans * Y + bet * Z <= X) {
		ans++;
		bet++;
	}
	ans--;
	cout << ans << endl;
}

Measured memory_bytes: 256
/**
Bismillahir Rahmanir Rahim
!~~~~~~~~~~~~!
|Naimul Islam|
!~~~~~~~~~~~~!
*/
#include<bits/stdc++.h>

using namespace std;

typedef     unsigned long long  ull;
typedef     long long           ll;

#define     CS(x)        cout << "Case " << x << ": ";

#define in() ( { int a ; scanf("%d",&a); a; } )     //int x= in()

#define     PI           (acos(-1))
#define     sq(x)          ((x) * (x))
#define     mod          (1000000007)
#define     EPS          1e-9
#define     inf          1 << 30

#define     eb           emplace_back
#define     mp           make_pair
#define     SZ(_n)       (int)_n.size()
#define     ALL(_n)      _n.begin(), _n.end()
#define     Clear(a,b)   memset(a,b,sizeof(a))

#define     sp           ' '
#define     endl         "\n"
#define     nl           cout << endl
#define     r0           return 0

#define     Check(x)     cout << #x << " is " << x <<endl;
#define     precision(n) cout << fixed << setprecision(n);
#define     dbg          cout << "KHELA HOBE" << endl;
#define     doura      ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main()
{
	doura;
    ll a, b, k;
    cin >> a >> b >> k;
    if(a>=k) cout << a-k << sp << b;
    else cout << 0 << sp << max(0LL,b-k+a);
    nl;
//    cout << a<< sp <<b << endl;


    r0;
}















Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <string.h>
#include <math.h>

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)

using namespace std;

typedef long long ll;

char preS;
char s;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    preS = 'a';
    REP(i, 4) {
        cin >> s;
        if (preS == s) {
            cout << "Bad" << endl;
            return 0;
        } else {
            preS = s;
        }
    }
    
    cout << "Good" << endl;
    
    return 0;
}



Measured memory_bytes: 256
#include<stdio.h>

int main() {
    char str[3];
    int resa = 0, resb = 0, resc = 0;

    scanf("%s", str);

    for (int i = 0; i < 3; i++) {
        if (str[i] == 'a')
	    resa = 1;
	else if (str[i] == 'b')
	    resb = 1;
	else if (str[i] == 'c')
	    resc = 1;
	else
	    resa = 0;
    }
    if (resa == 1 && resb == 1 && resc == 1)
	printf("Yes\n");
    else
	printf("No\n");

    return 0;
}

Measured memory_bytes: 128
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;
 
public class Main {
	private static FastScanner sc = new FastScanner();
	
	public static void main(String[] args) {
		char[] str1 = sc.next().toCharArray();
		int n1 = str1.length;
		char[] str2 = sc.next().toCharArray();
		int n2 = str2.length;
		
		int[][] dp = new int[n1+1][n2+2];
		for(int i=0; i<=n1; i++) {
			dp[i][0] = i;
		}
		for(int i=0; i<=n2; i++) {
			dp[0][i] = i;
		}
		
		for(int i=1; i<=n1; i++) {
			for(int j=1; j<=n2; j++) {
				int cost = (str1[i-1] == str2[j-1]) ? 0 : 1;
				dp[i][j] = Math.min(dp[i-1][j]+1, Math.min(dp[i][j-1]+1, dp[i-1][j-1]+cost));
			}
		}
		
		System.out.println(dp[n1][n2]);
	}
	
	static class FastScanner {
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if(ptr < buflen) {
                return true;
            } else {
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch(IOException e) {
                    e.printStackTrace();
                }
                if(buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
        public boolean hasNext() { skipUnprintable(); return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt(){
            return Integer.parseInt(next());
        }
        public double nextDouble(){
            return Double.parseDouble(next());
        }
    }
}

Measured memory_bytes: 28868
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

typedef pair<int,int> pint;
int main(){
    int n,m;
    while(cin>>n>>m,n){
        int s,t;
        vector<int> v,w;
        vector<pint> pv;
        for(int i=0;i<m;++i){
            cin>>s>>t;
            if(s==1){
                v.push_back(t);
            }
            else pv.push_back(make_pair(s,t));
        }
        for(vector<pint>::iterator it=pv.begin();it!=pv.end();++it){
            if(find(v.begin(),v.end(),it->first)!=v.end()) w.push_back(it->second);
            else if(find(v.begin(),v.end(),it->second)!=v.end()) w.push_back(it->first);
        }
        v.insert(v.end(),w.begin(),w.end());
        sort(v.begin(),v.end());
        v.erase(unique(v.begin(), v.end()), v.end());
        cout<<v.size()<<endl;
    }
    return 0;
}

Measured memory_bytes: 3284
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

ll GCD(ll a, ll b) {
    if (b == 0) return a;
    else return GCD(b, a % b);
}


ll LCM(ll a, ll b){
    return a/GCD(a,b) * b;
}

int main(){
    int N,M; cin >> N >> M;
    vector<int> a(N);
    rep(i,N) cin >> a[i];
    rep(i,N) a[i] /= 2;
    bool ok = true;
    vector<int> b = a;
    vector<int> cnt(N);
    rep(i,N){
        int tmp = 0;
        while(b[i] % 2 == 0){
            b[i] /= 2;
            tmp++;
        }
        cnt[i] = tmp;
    }
    repr(i,1,N){
        if(cnt[i] != cnt[i-1]) ok = false;
    }
    if(!ok){
        cout << 0 << endl;
        return 0;
    }
    ll now = 1;
    rep(i,N){
        now = LCM(now,a[i]);
        if(now > M){
            cout << 0 << endl;
            return 0;
        }
    }
    cout << (ll)(M+now)/(now*2) << endl;

}


Measured memory_bytes: 1408
#include<deque>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<cmath>
#include<cstdlib>
#include<cstdio>
#include<cstring>
using namespace std;
int pn(int a[],int n){
  int i,j;
  a[0]=a[1]=0;
  for(i=2;i<n;i++)
    a[i]=i;
  for(i=2;i*i<n;i++){
    if(a[i]){
      for(j=i*i;j<n;j+=i)
        a[j]=0;
    }
  }
  j=2;
  for(i=0;j<n;i++){
    a[i]=a[j];
    for(j++;j<n&&a[j]==0;j++);
  }
  return i;
}
int main(){
  int i,j;
  int a[1000000];
  a[pn(a,1000000)]=1000001;
  long long n,m;
  while(cin>>n&&n){
    m=n;
    vector<long long> b;
    b.reserve(900);
    b.push_back(1);
    for(i=0;(long long)a[i]*a[i]<=m;i++){
      if(n%a[i]==0){
	int ln=b.size();
	long long pi=a[i];
	do{
	  for(j=0;j<ln;j++)
	    b.push_back(b[j]*pi);
	  n/=a[i];
	  pi*=a[i];
	}while(n%a[i]==0);
      }
    }
    if(n!=1){
      int ln=b.size();      
      for(j=0;j<ln;j++)
	b.push_back(b[j]*n);
    }
    int ct=0;
    for(i=0;i<(int)b.size();i++){
      for(j=i;j<(int)b.size();j++){
	if(b[i]/__gcd(b[i],b[j])*b[j]==m)
	  ct++;
      }
    }
    cout<<ct<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
// This file is a "Hello, world!" in C++ language by GCC for wandbox.
#include <bits/stdc++.h>
using namespace std;

int main(){
    string a, b; cin >> a >> b;
    int as = a.size();
    int bs = b.size();
    
    if(as < bs){
        cout << "LESS" << endl;
    }else if(as > bs){
        cout << "GREATER" << endl;
    }else{  
        if(a > b){
            cout << "GREATER" << endl;
        }else if(a < b){
            cout << "LESS" << endl;
       }else{
            cout << "EQUAL" << endl;
        }
    }
    
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define de(x) cout<<#x<<"="<<x<<endl
#define dd(x) cout<<#x<<"="<<x<<" "
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define repd(i,a,b) for(int i=a;i>=(b);--i)
#define repp(i,a,b,t) for(int i=a;i<(b);i+=t)
#define mt(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define mp(u,v) make_pair(u,v)
#define sz(a) (int)a.size()
#define pb push_back
#define PI acos(-1.0)
#define qc std::ios::sync_with_stdio(false)
#define all(a) a.begin(),a.end()
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef double db;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
typedef pair<int,pii> piii;

const ll mod = 1000000007;
const int N = 5e5+6;
const int M = 2e6+6;
const double eps = 1e-6;
const int inf = 0x3f3f3f3f;

bool eq(const db &a, const db &b) { return fabs(a - b) < eps; }
bool ls(const db &a, const db &b) { return a + eps < b; }
bool le(const db &a, const db &b) { return eq(a, b) || ls(a, b); }
ll gcd(ll a,ll b) { return a==0?b:gcd(b%a,a); };
ll lcm(ll a,ll b) { return a/gcd(a,b)*b; }
ll kpow(ll a,ll b) {ll res=1;a%=mod; if(b<0) return 1; for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll read(){
    ll x=0,f=1;char ch=getchar();
    while (ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
//inv[1]=1;
//for(int i=2;i<=n;i++) inv[i]=(mod-mod/i)*inv[mod%i]%mod;
ll a,b,k;
int main() {
	while(cin>>a>>b>>k) {
		if(a + b <= k) cout<<"0 0"<<endl;
		else {
			if(a <= k) {
				cout<<0<<" "<<a+b-k<<endl;
			} else {
				cout<<a-k<<" "<<b<<endl;
			}
		}
	}
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <iomanip>
#include <cassert>
#include <random>


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


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

#define fst first
#define snd second
#define fore(i,a,b) for(int i=a, ThxDem=b; i<ThxDem; ++i)
#define pb push_back
#define ALL(s) s.begin(),s.end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define SZ(s) int(s.size())
#define DBG(x) cerr <<#x << " = " << (x) << "\n"

#define SQR(x) ((x) * (x))

#define PI 3.1415926535897932385
#define INF 1000111222
#define eps 1e-7
#define maxN 11

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<string> vstr;
typedef vector<vll> vvll;
typedef vector<bool> vbool;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<vbool> vvbool;

vll ns,dp;
ll n,k;

ll solve(ll pos){
	ll & d = dp[pos];
	if(d != -1) return d;
	ll v=INF;
	fore(i,pos+1,min(pos+k+1,n)) v = min(v,abs(ns[i]-ns[pos])+solve(i));
	if(pos == (n-1)) v = 0;
	return d = v;
}

int main(){FIN
	
	cin >> n >> k;
	ns.resize(n);
	dp.assign(100010,-1);
	fore(i,0,n)cin >> ns[i];
	
	solve(0);
	
	cout << dp[0] << "\n";

	return 0;
}


Measured memory_bytes: 12696
#include <bits/stdc++.h>
#include <ext/numeric>

using namespace std;
using namespace __gnu_cxx;

#define all(v)   v.begin(), v.end()
#define endl "\n"
#define pb push_back
#define F first
#define S second
#define THINK_TWICE_CODE_ONCE cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
#define isOdd(n)    (n&1)
#define LLMAX LLONG_MAX
#define LLMIN LLONG_MIN
#define IMN INT_MIN
#define IMX INT_MAX
#define pow(n, m) power((ll)n, (ll)m)
#define numOfDigits(n)  ((n)? (ll)(log10(n)+1) : 1)
#define mem(x, val)    memset(x, val, sizeof(x))
#define MOD 1000000007

typedef long long ll;
typedef long double ld;
typedef double dd;
typedef string str;
typedef pair<int, int> pii;



int main()
{
    THINK_TWICE_CODE_ONCE
    //freopen("test cases\\.txt", "r", stdin) ;
    ll n, k, x, y; cin>>n>>k>>x>>y;
    ll first = min(n, k), rest = n - first;
    cout<<F*x + rest * y;
	return 0;

}


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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

int main(){
  int n;cin>>n;
  vector<ll>a(n);
  rep(i, n)cin>>a[i];
  sort(a.begin(), a.end());

  priority_queue<ll>q;
  q.push(a.back());
  ll result = 0;
  rrep(i, n-1){
    result += q.top();
    q.pop();
    q.push(a[i]);
    q.push(a[i]);
  }
  
  cout<<result<<endl;
  
  return 0;
}

Measured memory_bytes: 6856
s = input()


for i in range(len(s)):
    ans = s[:min(len(s), -(i+1))]
    if(len(ans)%2==1):
        continue
    else:
        mid = int(len(ans)/2)
        if(mid>=0):
            if(ans[:mid]==ans[mid:]):
                print(mid*2)
                break

Measured memory_bytes: 3060
import java.util.*;

public class Main {
    public static void main(String[] args){
        ArrayList<Integer> array = new ArrayList<Integer>();
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        for(int i=0; i<n; i++){
            int num = sc.nextInt();
            array.add(num);
        }
        int min = array.get(0);
        int max = array.get(0);
        long sum = 0;
        for(int j=0; j < array.size();j++){
            if(array.get(j) < min){
                min = array.get(j);
            }
            if(array.get(j) > max){
                max = array.get(j);
            }
            sum += array.get(j);
        }
        System.out.println(min + " " + max + " " + sum);
    }
}



Measured memory_bytes: 43860
#include <iostream>
#include <string>

using namespace std;

int n;

void dfs(string s, char mx) {
    if (s.length() == n) {
        cout << s << endl;
    } else {
        for (char c = 'a'; c <= mx; c++) {
            dfs(s + c, ((c == mx) ? (char)(mx + 1) : mx));
        }
    }
}

int main() {
   /* #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif*/
    cin >> n;
    dfs("", 'a');
    return 0;
}

Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
using vl = vector<ll>;

/* short */
#define pb push_back
#define mp make_pair
#define Fi first
#define Se second
#define ALL(v) begin(v), end(v)
#define RALL(v) rbegin(v), rend(v)

/* REPmacro */
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define FORR(i, a, b) for(int i = (a); i >= (b); i--)
#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOREACH(x, a) for(auto x : a)

/* exchange */
#define CHMIN(a, b) (a) = min((ll)(a), (ll)(b))
#define CHMAX(a, b) (a) = max((ll)(a), (ll)(b))

/* function */
#define IN(x) cin >> x
#define DEBUG(x) cerr << (x) << " "
#define LN() cerr << "\n"
#define PRINT(x) cout << (x) << endl
#define BR cout << endl

/* const */
const int ARRAY = 100005;
const int INF = 1001001001; // 10^9
const ll LINF = 1001001001001001001; // 10^18
const int MOD = 1e9 + 7;

ll N = 0;
ll t;
ll ret = 0;
ll A = 0, B = 0, C = 0;
string s;

void input() {
  IN(s);
}

void solve() {
  bool ok = true;
  ok &= (s[0] == s[1]);
  ok &= (s[1] == s[2]);
  ok &= (s[2] == s[0]);
  PRINT(ok?"No":"Yes");
}

int main(void){
  input();
  solve();
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 100005;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    LL n, k;
    cin >> n >> k;
    if( k % 2 ) {
        LL tmp = n / k;
        cout << tmp * tmp * tmp << endl;
        
    } else {
        LL tmp = n / ( k / 2 ) - n / k;
        LL t = n / k;
        t = t * t * t;
        cout << tmp * tmp * tmp + t << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
//登録しよう！→ https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define gre greater //sortを降順にする
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示

void solve(long long N, long long L){
  vector<int> a(N);
  int ans=0;
  for (int i = 0; i < N; i++) {
    a[i] = L+(i+1)-1;
    ans += L+(i+1)-1;
  }
  int x;
  if(a[0] > 0 && a[N-1] > 0)x = a[0];
  else if(a[0] <= 0 && a[N-1] >= 0)x = 0;
  else if(a[0] < 0 && a[N-1] < 0)x = a[N-1];
  cout << ans - x << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long N;
    scanf("%lld",&N);
    long long L;
    scanf("%lld",&L);
    solve(N, L);
}


Measured memory_bytes: 256
X, Y = map(int, input().split())
# a,b=map(int, input().split())  #複数数値入力　「A B」みたいなスペース空いた入力のとき
# c=list(map(int, input().split()))  #リスト入力 「a1 a2 a3 ...」みたいな配列のような入力のとき
# s=[list(map(int,list(input()))) for i in range(h)]  # 二次元配列入力　二次元マップみたいな入力のとき

#K = int(input())
#S = input()

##一次元配列の初期化
#a=[0]*5
#[i for i in range(100) if i%2==1] #奇数のみ
##二次元配列の初期化
#[[float("inf") for i in range(N)] for i in range(N)]

if ((Y%2)==0) & (Y<=X*4) & (Y>=X*2):
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9168
#include <stdio.h>
#include <iostream>
using namespace std;

int main(){
  int X;
  cin >> X;
  int range = 0;
  for(int i=0;i<8;i++){
   if(400+i*200<=X && X<600+i*200) range = 8-i; 
  }
  printf("%d\n",range);
  return 0;
}

Measured memory_bytes: 3760
import copy

N = int(input())
p = [int(i) for i in input().split()]

sortedP = copy.copy(p)
sortedP.sort()

count =0
for i in range(N):
    if p[i] != sortedP[i]:
        count = count +1

if (count == 2) or (count == 0):
    print("YES")
else:
    print("NO")

Measured memory_bytes: 3572
#include <iostream>
#include <string>
using namespace std;
  
int main()
{
    char ch;
    int i,count[26];
     
    for(i=0;i<26;i++){
        count[i]=0;
    }
     
    while(cin >> ch){
        if(islower(ch)){
            count[ch -'a']++;
        } else if(isupper(ch)){
            count[ch -'A']++;
        }
    }
    for(int i = 0;i < 26;i++){
        cout << char(i +'a') << " : " << count[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 1140
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <clocale>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define PB push_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ll = long long;
using Pi_i = pair<int, int>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;

const int MOD = 1000000007;
const int INF = 1000000000;
const int NIL = -1;

template<class T, class S>
bool chmax(T &a, const S &b){
    if(a < b){
        a = b; return true;
    }
    return false;
}
template<class T, class S>
bool chmin(T &a, const S &b){
    if(b < a){
        a = b; return true;
    }
    return false;
}



int main(){
    string T, P;
    cin >> T >> P;
    REPS(i, T.length() - P.length()){
        if(T[i] == P[0]){
            int j = 0;
            for(; j < P.length(); ++j)
                if(T[i+j] != P[j]) break;
            if(j == P.length())
                cout << i << "\n";
        }
    }
    return 0;
}



Measured memory_bytes: 3212
#include<iostream>

using namespace std;
int main(){
    int a, b;
    
    cin >> a >> b;
    if(a < b){
        cout << "a < b" << endl;
    }else if(a > b){
        cout << "a > b" << endl;
    }else{
        cout << "a == b" << endl;
    }
    
}


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

int main(){
  string s;
  cin>>s;
  map<char,int> mp;
  rep(i,s.size()){
    mp[s[i]]++;
  }
  int ans=INT_MAX;
  for(auto x : mp){
    vector<int> index;
    index.push_back(-1);
    rep(i,s.size()){
      if(s[i]==x.first) index.push_back(i);
    }
    index.push_back(s.size());
    int div=0;
    for(int i=0; i<index.size()-1; i++){
      div=max(div,index[i+1]-index[i]-1);
    }
    ans=min(ans,div);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 3568
#include <iostream>
#include <fstream>
#include <string>
#include <iomanip>
#include <math.h>
#include <stdbool.h>
#include <algorithm>
using namespace std;

class Point {
    public:
    double x, y;

    Point(double x = 0, double y = 0): x(x), y(y) {}

    Point operator + (Point p) { return Point(x+p.x, y+p.y); }
    Point operator - (Point p) { return Point(x-p.x, y-p.y); }
    Point operator * (double a) { return Point(a*x, a*y); }
    Point operator / (double a) { return Point(x/a, y/a); }

    double abs() {return sqrt(norm()); }
    double norm() {return x*x + y*y; }
};

typedef Point Vector;


double dot(Vector a, Vector b) {
    return a.x * b.x + a.y * b.y;
}

double cross(Vector a, Vector b) {
    return a.x*b.y - a.y*b.x;
}

int main(){
    #if 0
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
    #endif

    int n;
    cin >> n;

    Point i1, i2, p1, p2, p3;
    int isConvex = 1;

    for(int i=0; i<n; i++){
        if(i==0)
        {
            cin >> i1.x >> i1.y;
            cin >> i2.x >> i2.y;
            p1 = i1;
            p2 = i2;
        }
        else
        {
            p1 = p2;
            p2 = p3;
        }
        if(i==n-2){
            p3 = i1;
        }
        else if(i==n-1){
            p3 = i2;
        }
        else{
            cin >> p3.x >> p3.y;
        }

        //cout << p1.x << " " << p1.y << " " << p2.x << " " << p2.y << " " << p3.x << " " << p3.y << "\n";
        
        if( cross(p2-p1,p3-p2) < 0 ){
            isConvex = 0;
            break;
        }
    }

    cout << isConvex <<"\n";
    return 0;
}



Measured memory_bytes: 3224
#include <stdio.h>
#include <math.h>

int isPrime(int);

main() {
  
  int i;
  int c=0; //素数カウンタ
  int N; //入力される数
  int A[10000]; //入力された配列

  scanf(" %d", &N);

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

  for( i=0; i<N; i++) {
    c += isPrime( A[i]);
  }

  printf("%d\n", c);

  return 0;

}


int isPrime(int x) {

  //素数なら1,そうでないなら0を返す
  
  int i=3;

  if( x==2) {
    return 1;
  }

  if( x<2 || x%2==0) {
    return 0;
  }

  while( i<=sqrt( x)) {
    if( x%i==0) {
      return 0;
    }
    i=i+2;
  }

  return 1;
}

Measured memory_bytes: 628
#include<cstdio>
#include<iostream>
#include<cstring>
#include<vector>
#include<queue>
using namespace std;

#define ran 101101
#define i64 long long

int n, m, s, t;
vector<pair<int, int> > e[ran], _e[ran];
i64 d[2][ran], ans[ran];
priority_queue<pair<i64, int> > q;

void dij(int st, int id) {
	while(!q.empty()) q.pop();
	q.push(make_pair(0LL, st));
	int todo = n;
	memset(d[id], -1, sizeof d[id]);
	while(todo > 0 && !q.empty()) {
		pair<i64, int> p = q.top(); q.pop();
		i64 dist = -p.first;
		int cur = p.second;
		if (d[id][cur]!= -1LL) continue;
		
		todo--;
		d[id][cur] = dist;
		for(int i=0;i<(int)e[cur].size();i++) {
			int nxt = e[cur][i].first;
			if (d[id][nxt] == -1LL)
				q.push(make_pair(-(dist + e[cur][i].second), nxt));
		}
	}
}

int main() {
	cin >> n >> m >> s >> t;
	for(int i=0;i<m;i++) {
		int x, y, va, vb;
		cin >> x >> y >> va >> vb;
		e[x].push_back(make_pair(y, va));
		e[y].push_back(make_pair(x, va));
		_e[x].push_back(make_pair(y, vb));
		_e[y].push_back(make_pair(x, vb));
	}
	dij(s, 0);
	for(int i=1;i<=n;i++) e[i] = _e[i];
	dij(t, 1);
	long long mi = d[0][n] + d[1][n];
	for(int i=n;i>0;i--) {
		mi = min(mi, d[0][i] + d[1][i]);
		ans[i] = mi;
	}
	for(int i=1;i<=n;i++) cout<<1000000000000000LL - ans[i]<<endl;
	
	return 0;
}

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

int main() {
  int n, k, a, b;
  cin >> k;
  cin >> a >> b;
  n = (k/a)*a;
  while(n<=b){
    if(n>=a && n<=b){
      cout << "OK" << endl;
    	break;
    }
    n += k;
  }
  if(n>b) cout << "NG" << endl;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define Phuong_ ios_base::sync_with_stdio(0); cin.tie(0);
#define REP(i,a,b) for(int i=a; i<=b; ++i)

/// easy access -------------
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
typedef tuple<int, int, int> tp;
typedef pair<int, int> pi;
typedef vector<vector<int> > vv;
///-------------------------

int main()
{
    Phuong_; /// <3333
	int k;
	cin >> k;
	string s = "ACL";
	while(k--){
        cout << s;
	}
    return 0;
}


Measured memory_bytes: 3568
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace::std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
// #include <boost/numeric/interval.hpp>
// #include <boost/numeric/interval/io.hpp>
// #include <boost/intrusive/rbtree.hpp>
// #include <boost/geometry.hpp>
// #include <boost/geometry/geometries/linestring.hpp>
// #include <boost/geometry/geometries/polygon.hpp>
// #include <boost/geometry/geometries/point_xy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
using namespace __gnu_pbds;
using namespace::std;
// namespace mp = boost::multiprecision;
// typedef mp::number<mp::cpp_dec_float<0>> cfloat;
// typedef mp::cpp_int cint;
typedef long long lint;
typedef long long ll;
typedef long double ldouble;
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
typedef vector<vector<vector<lint>>> mat3;
typedef vector<double> dvec;
typedef vector<vector<double>> dmat;
typedef vector<vector<vector<double>>> dmat3;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
typedef vector<vector<vector<string>>> smat3;
typedef vector<pair<lint,lint>> pvec;
typedef vector<vector<pair<lint,lint>>> pmat;
typedef vector<vector<vector<pair<lint,lint>>>> pmat3;
#define rep(i, n) for(lint i = 0; i < (lint)(n); i++)
#define irep(i) for(lint i = 0;; i++)
#define irep1(i) for(lint i = 1;; i++)
#define irep2(i) for(lint i = 2;; i++)
#define rrep(i, n) for(lint i = (lint)(n-1); i >-1; i--)
#define rrepi(i,a,b) for(lint i = (lint)(b-1); i >a-1; i--)
#define repi(i,a,b) for(lint i=lint(a);i<lint(b);i++)
#define rep2(i,a,b,c) for(lint i=lint(a);i>lint(b);i+=c)
#define all(x) (x).begin(),(x).end()
#define PI 3.141592653589793
#define dist(x1,y1,x2,y2) (pow(pow(x2-x1,2)+pow(y2-y1,2),0.5))
#define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"");if(i>INF/2)cout<<"INF";else cout<<i;f=1;}cout<<"\n";}while(0)
#define output2(v) for(auto j:v)output(j);
#define input(a,n) lint n;cin>>n;vector<lint>a(n);rep(i,n)cin>>a[i];
#define SUM(v) accumulate(all(v),0LL)
#define INF (1LL<<60)
#define IINF (1<<30)
#define EPS (1e-10)
#define LINF 9223372036854775807
#define MOD 1000000007
#define endl "\n"
template<typename T=lint>T in(){return *istream_iterator<T>(cin);}
inline lint gcd(lint a,lint b){return b?gcd(b,a%b):a;}
inline lint lcm(lint a,lint b){return a*b/gcd(a,b);}
inline bool chmin(auto& s,const auto& t){bool res=s>t;s=min(s,t);return res;}
inline bool chmax(auto& s,const auto& t){bool res=s<t;s=max(s,t);return res;}
vector<lint> dx={-1,1,0,0,1,1,-1,-1};
vector<lint> dy={0,0,-1,1,1,-1,1,-1};

int main(){
    lint n,t;
    cin>>n>>t;
    vec a(n);
    rep(i,n)cin>>a[i];
    lint mn=INF,sa=0;
    rep(i,n){
        chmin(mn,a[i]);
        chmax(sa,a[i]-mn);
    }
    map<lint,lint>m,m2;
    map<lint,lint>ans;
    rep(i,n){
        m[a[i]]++;
        ans[a[i]]=min(m[a[i]],m[a[i]-sa]);
    }
    lint res=0;
    for(auto d:ans){
        res+=d.second;
    }
    cout<<res;
}

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

#define F first
#define S second
#define pb push_back
#define ll long long
#define int long long

using namespace std ;

const int MAXN = 1001 * 1001 ; 

int a[MAXN ] , t[MAXN] ; 

int32_t main()
{
	ios::sync_with_stdio(0) ; cin.tie(0) ; 
	int n , s = 0 ;
    cin >> n ;
	int t = n * (n+1) / 2 ; 	
    for(int i = 0 ; i < n ; i ++ ) cin >> a[i]  , s += a[i] ;
   	
   // cout << s << ' ' << t << endl ; 	

	if(s%t!=0)
		return cout << "NO" , 0 ; 
 
	int k = s / t ; 
	
	int T = 0 ;

	for(int i = 0 ; i < n ; i ++ ) 
	{
		int t = k + a[i] - a[(i+1)%n] ; 
	//	cout << t << ' ' << k << endl ; 
		if(t%n!=0||t<0)
			return cout << "NO" , 0 ;  
		T += t / n ; 
	}	
	if(k!=T)
		return cout << "NO" , 0 ; 
	cout << "YES" ;  




}

Measured memory_bytes: 1024
def main():
    import sys
    input = sys.stdin.readline
    n = int(input().rstrip('\n'))
    a = list(map(int, input().rstrip('\n').split()))
    cnt = 0
    t_cnt = 1
    for i in range(1, len(a)):
        if a[i-1] != a[i]:
            cnt += (t_cnt // 2)
            t_cnt = 1
        else:
            t_cnt += 1
    cnt += (t_cnt // 2)
    print(cnt)


if __name__ == '__main__':
    main()


Measured memory_bytes: 38256
#include <iostream>
#include <vector>
using namespace std;
 
class Dice{
public:
    long r[6];
    Dice(){};
    void roll(long a, long b, long c, long d){swap(r[a], r[b]);swap(r[b], r[c]);swap(r[c], r[d]);}
    void spin(char c){if (c == 'W') roll(0, 2, 5, 3); else roll(0, 1, 5, 4);}
};
 
int main(){
    char SWS[8]={"NNNWNNN"};
    int n;
    cin >> n;
    vector<Dice> D(n);
    for (int i = 0; i < n ; i++) for (int j = 0; j < 6; j++) cin >> D[i].r[j];
    for (int i = 0; i < n - 1; i++){
        for (int j = i + 1; j < n; j++){
            for (int k = 0; k < 8; k++){
                if (D[i].r[1] == D[j].r[1]) break;
                D[j].spin(SWS[k]);
            }
            for (int k = 0; k < 4; k++){
                if (D[i].r[0] == D[j].r[0]){
                    int ans = 0;
                    for (int l = 1; l < 6; l++) if (D[i].r[l] == D[j].r[l]) ans++;
                    if (ans == 5){cout << "No" << endl; return 0;}
                    /*
                    if (D[i].r[1] == D[j].r[1] && D[i].r[2] == D[j].r[2] && D[i].r[3]==D[j].r[3] && D[i].r[4] == D[j].r[4] && D[i].r[5] == D[j].r[5]){
                        cout << "No" << endl; return 0;
                    }
                    */
                }
                D[j].spin('W');
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 1196
total_days = int(input())
c = list(map(int, input().split()))
satis_day = [[0] * 26 for i in range(total_days)]
for i in range(total_days):
    satis_day[i] = list(map(int, input().split()))

total_satis = 0
not_held_count = [0] * 26

for i in range(total_days):
    type = int(input())
    type -= 1
    
    not_held_count = list(map(lambda x: x+1, not_held_count))
    not_held_count[type] = 0
    
    today_decrease = 0
    for j in range(26):
        today_decrease += c[j] * not_held_count[j]
    
    total_satis += (satis_day[i][type] - today_decrease)
    print(total_satis)
    

Measured memory_bytes: 9400
#include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dpa[3010][3010];

int main(){
  int N, T; cin >> N >> T;
  pair<int, int>p[N]; int a[N], b[N];
  rep(i, N){
    cin >> a[i] >> b[i];
    p[i] = {a[i], b[i]};
  }
  sort(p, p+N);
  int ans = 0;
  rep(i, N){
    rep(j, T){
        if(j>=p[i].first) dpa[i+1][j]= max(dpa[i][j], dpa[i][j-p[i].first]+p[i].second);
        else dpa[i+1][j] = dpa[i][j];
        if(j==T-1) ans = max(ans, dpa[i][j] + p[i].second);
    }
  }
  ans = max(ans, dpa[N][T-1]);
  cout << ans << endl;
}     

Measured memory_bytes: 35584
function Main(input) {
    input = input.trim().split("\n").map(function(x) { return x.split(" ")});    
    var N = parseInt(input[0][0], 10);
    var vec_a = input[1].map(e => parseInt(e, 10));
    var ans = 0;
    for (var i = 0; i < N; i++){
        if (i % 2 === 0 && vec_a[i] % 2 === 1) ans++;
    }

    console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8")); 

Measured memory_bytes: 29676
#include<stdio.h>

int main(){
  while(1){
    int n, i, j, k;
    int card[201], player[2], turn = 0, ba = 0;
    for(i = 0;i < 201;i++){
      card[i] = 1;
    }
    card[0] = 2;
    scanf("%d", &n);
    if(n == 0){
      return 0;
    }
    player[0] = player[1] = n;
    for(i = 0;i < n;i++){
      scanf("%d", &j);
      card[j] = 0;
    }
    while(player[0] != 0 && player[1] != 0){
      for(;ba <= 2 * n;ba++){
	if(card[ba] == turn){
	  card[ba] = 2;
	  player[turn]--;
	  break;
	}
      }
      if(ba == 2 * n + 1){
	ba = 0;
      }
      turn ^= 1;
    }
    printf("%d\n%d\n", player[1], player[0]);
  }
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define rep(i,l,r) for(int i=l;i<r;i++)
#define bep(i,l,r) for(int i=l;i>=r;i--)
#define ff first
#define ss second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define el '\n'
#define sz(s) s.size()
#define all(v) v.begin(),v.end()
#define mii map<int,int>
#define mr  make_pair

int mod = 1e9+7;
int inf = 4e18;
const int N = 3e5+5;
int powmod(int a,int b) {int res=1;if(a>=mod)a%=mod;for(;b;b>>=1){if(b&1)res=res*a;if(res>=mod)res%=mod;a=a*a;if(a>=mod)a%=mod;}return res;}
int dp[N+10];
signed main()
{
    io
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
        string s;
        cin>>s;
        s+= "hi";
        int n = sz(s);
        bool flag = 0;
        rep(i,0,n)
        {
            if(s[i]=='h'&&s[i+1]=='i')
                ++i;
            else
                flag = 1;
        }
        if(flag)
            cout<<"No"<<el;
        else
            cout<<"Yes"<<el;

    }
    return 0;
}


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

typedef long long ll;
const ll INF = 1e9, MOD = 1e9 + 7;
const double EPS = 1e-9, PI = 3.141592653589793;
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define fi first
#define se second
#define m_p make_pair

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll a,b,c,k;
  cin >> a >> b >> c >> k;
  if(k%2) cout << b-a << "\n";
  else cout << a-b << "\n";
  return 0;
}

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

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

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

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

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

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

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

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




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

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


Measured memory_bytes: 7720
MOD = 998244353
N, K = map(int, input().split())
rl = [list(map(int, input().split())) for _ in range(K)]
dp = [0] * (N + 1)
sdp = [0] * (N + 1)
dp[1] = 1
sdp[1] = 1

for i in range(2, N + 1):
    for j in range(K):
        l, r = rl[j][0], rl[j][1]
        tl = max(1, i - r)
        tr = max(0, i - l)
        dp[i] += sdp[tr] - sdp[tl - 1]
        dp[i] %= MOD
    sdp[i] += dp[i] + sdp[i - 1]
    sdp[i] %= MOD

print(dp[N])

Measured memory_bytes: 77136
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
//for(int i = 0; i<n; i++)
 
 
int main()
{
    int n, k;cin>>n >> k;
    int a = 1;
    for(int i = 0; i<n; i++){
        if(a * 2 <= a + k) a *= 2;
        else a += k;
    }
    cout << a << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll n, k;
    cin >> n >> k;
    n %= k;
    n = min(n, k - n);
    cout << n << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>

//#include<bits/stdc++.h>

// #include "beginner_138/beginner_138.h"
// Still dunno how to put linker 

using namespace std; 

// Sort that saves index.



void d_sol01(){
    // Simulation-less solition
    int n,k ;
    string s;
    cin >> n >> k >> s;

    // Calculating initial value of the first string
    int init = 0;
    for(int i = 1; i < n; i++){
        if(s.at(i)==s.at(i-1)) init++;
    }

    // Maximum possible value: when 
    // LLLRRLRLRRRL
    // LLLLRRLLRRL
    // LR LLRLRLL 
    // There can always be a way to increase happiness by +2, except when L and R groups are completely split to two groups
    // LLLRRR or RRRLLL, which gives one. For this case, init + k*2 might exceed n-1, so we need to use min.
    // Another edge case is when every letter is either R or L, which makes maximum happiness is n-1 or still the init value.


    cout << min(n-1, init + k*2); // Is there a case when init + k*2 be higher than n-1?
}

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

    d_sol01();
    
    
    return 0;
}

Measured memory_bytes: 512