akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rrep(i,a,b) for(int i=(int)(a);i>=(int)(b);--i)
#define fore(i,a) for(auto &i:a)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define isin(i,a,b) ((a) <= (i) && (i) < (b))
#define uni(a) (a).erase(unique(all(a)),(a).end())
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)(a).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll  = long long;
using unit= unsigned;
using ull = unsigned long long;
using P   = pair<int,int>;
using vi  = vector<int>;
using vl  = vector<ll>;
using vvi = vector<vi>;
using vp  = vector<P>;
void _main(); int main(){ cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T>void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T>void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T>void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T>void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T>bool chmax(T &a, const T &b){ if (a<b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if (b<a){ a = b; return 1; } return 0; }
template<class T>T gcd(T a, T b){ if (b==0){ return a; }else{ return gcd(b, a%b); }}
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }
constexpr double eps = 1e-10;
constexpr int inf = INT_MAX / 2;
constexpr ll infl = 1LL << 60;

void _main() {
  string S;
  cin >> S;
  int N = S.size();

  int cnt = 0;
  fore(c, S) if (c == 'o') ++cnt;

  YES(cnt + (15-N) >= 8);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
char s1[100010],s2[100010];
int len;
int main()
{
	cin>>s1;
	for(int i=strlen(s1)-1; i>=0; i--)
	{
		s2[len++]=s1[i];
	}
	for(int i=0; i<strlen(s2); i++)
	{
		switch(s2[i])
		{
			case 'b':
			{
				s2[i]='d';
				break;
			}
			case 'd':
			{
				s2[i]='b';
				break;
			}
			case 'p':
			{
				s2[i]='q';
				break;
			}
			case 'q':
			{
				s2[i]='p';
				break;
			}
		}
	}
	if(strcmp(s1,s2)==0) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


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

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;

#define REPS(i, a, n) for (int i = (a); i < (n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (int i = (a); i >= n; --i)
#define DEP(i, n) DEPS(i, n, 0)

#define vint(v,n) vector<int> v(n); REP(i,n) cin >> v[i];
#define vlint(v,n) vector<ll int> v(n); REP(i,n) cin >> v[i];
#define vdouble(v,n) vector<double> v(n); REP(i,n) cin >> v[i];
#define vvdoube(v,n1,n2) vector<vector<double> > v(n1, vector<double>(n2, 0)); REP(i,n1) REP(j,n1) cin >> v[i][j];
#define string(x) string x; cin >> x;
#define vstring(v,n) vector<string> v(n); REP(i,n){string a; std::cin >> a; v.push_back(a); }

#define all(v) (v).begin(), (v).end()
#define rall(v) (v).begin(), (v).end(), std::greater<int>()

static const string abet("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ");
static const long long int MOD = 1000000007;
static const double PI=3.1415926535897932;
static const int INF = 0x3f3f3f3f;
static const int INFTY = (1 << 29);
static const long long LINFTY = (1LL << 32);

static const int dy4[]={0, 0, 1, -1};
static const int dx4[]={1, -1, 0, 0};
static const int dx8[] = {1, 1, 1, 0, 0, -1, -1, -1};
static const int dy8[] = {-1, 0, 1, -1, 1, -1, 0, 1};

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

  string S;
  cin >> S;

  REP(i, S.length()) if(S[i]==',') S[i]=' ';

  cout << S << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    string s;
    cin>>s;
    ll sum=0;
    for(int i=0;i<s.length();i++){
        sum+=s[i]-'0';
    }
    if(sum%9==0){
        cout<<"Yes";
    }
    else{
        cout<<"No";
    }
    return 0;
}

Measured memory_bytes: 3696
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
using namespace std;
int main(){
    string s;
    cin >> s;
    int K;
    cin >> K;
    string t = s;
    vector<int> alp(26, 0);
    for(int i = 0; i < t.size(); i++){
        alp[t[i] - 'a']++;
    }
    set<string> se;
    for(int i = 0; i < 26; i++){
        if(se.size() > K) break;
        if(alp[i] == 0) continue;
        for(int j = 0; j < t.size(); j++){
            if(t[t.size() - 1 - j] == 'a' + i){
                for(int k = 1; k <= 5; k++){
                    if(t.size() - 1 - j + k > t.size()) break;
                    se.insert(t.substr(t.size() - 1 - j, k));
                }
            }
        }
    }
    vector<string> v;
    for(auto u: se){
        v.push_back(u);
    }
    sort(v.begin(), v.end());
    cout << v[K - 1] << endl;
}

Measured memory_bytes: 384
import logging
import math

logging.basicConfig(level=logging.INFO, format="%(message)s")
logging.disable(logging.CRITICAL)

def P(n, r):
    return math.factorial(n) // math.factorial(abs(n - r))

def C(n, r):
    return P(n, r) // math.factorial(r)

N, K = (int(x) for x in input().split())
red_N = N -K


for i in range(1, K + 1):
    div_red_c = 0
    div_blue_c = C(K - 1, i - 1)
    div_red_c = C(red_N + 1, i)
    
    ans = (div_blue_c * div_red_c) % (10 ** 9 + 7)
    print(ans)

Measured memory_bytes: 4584
#include <bits/stdc++.h> //AtCoder
#include <atcoder/all> //AtCoder
#include <iostream> //Codeforces
#include <vector> //Codeforces

//#define int long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repeq(i,a,b) for(int i=a;i<=b;i++)
#define Vi vector<int>
#define VVi vector<Vi>
#define Vs vector<string>
#define Vc vector<char>
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define cyes cout<<"yes"<<endl
#define cno cout<<"no"<<endl

using namespace std;
using namespace atcoder;

/*int gcd(int a,int b){return b?gcd(b,a%b):a;}//最大公約数
int lcm(int a,int b){return a/gcd(a,b)*b;}//最小公倍数*/

/****************************** START ******************************/

signed main(){
  int N,M;
  cin >> N >> M;
  scc_graph graph(N);
  int a,b;
  rep(i,0,M){
    cin >> a >> b;
    graph.add_edge(a,b);
  }
  
  auto scc = graph.scc();
  cout << scc.size() << endl;
  for (auto v : scc) {
    cout << v.size() << " ";
    for (int x : v) {
      cout << x << " ";
    }
    cout << endl;
  }
      
}      

Measured memory_bytes: 40596
K,N=map(int,input().split())
A=[int(s) for s in input().split(" ")]

Smax=0
for i in range(N):
    S=0
    if i!=N-1:
        if A[i+1]>A[i]:
            S=A[i+1]-A[i]
        else:
            S=A[i]-A[i+1]
    else: 
        if A[0]>A[-1]:
            S=A[0]-A[-1]
        else:
            S=A[-1]-A[0]
    
    if S>K/2:
        S=K-S
    if Smax<S:
        Smax=S

print(K-Smax)

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

int main()
{
    int a,b,c;
    while(~scanf("%d %d %d",&a,&b,&c))
    {
        if(c>=a&&c<=b)
            printf("Yes\n");
        else
            printf("No\n");
    }
    return 0;
}


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

using namespace std;
using ll = long long;

int main() { 
    ios_base::sync_with_stdio(0); 
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    priority_queue<int> q;
    for (int x : a) q.push(x);
    while (!q.empty()) {
        if (!m) break;
        int x = q.top(); q.pop();
        x /= 2, --m;
        q.push(x);
    }
    ll sum = 0;
    while (!q.empty()) {
        sum += 1LL * q.top();
        q.pop();
    }
    cout << sum << '\n';
}

Measured memory_bytes: 1276
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
using namespace std;
#define N 500005
char q[N];
int n,d[N],in[N];
queue <int> h;
long long tt;
int main(){
	scanf("%s",q+1); n=strlen(q+1);
	if(q[1]=='>') ++in[0];
	if(q[n]=='<') ++in[n];
	for(int i=1;i<n;++i)
		in[i]=(q[i]=='<')+(q[i+1]=='>');
	for(int i=0;i<=n;++i) if(!in[i]) h.push(i);
	while(!h.empty()){
		int x=h.front(); h.pop();
		if(x>0){
			--in[x-1];
			if(in[x-1]>=0) d[x-1]=max(d[x-1],d[x]+1);
			if(in[x-1]==0) h.push(x-1);
		}
		if(x<n){
			--in[x+1];
			if(in[x+1]>=0) d[x+1]=max(d[x+1],d[x]+1);
			if(in[x+1]==0) h.push(x+1);
		}
	}
	for(int i=0;i<=n;++i) tt+=d[i];
	printf("%lld",tt);
}

Measured memory_bytes: 5248
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define llong long long
#define pb(a) push_back(a)
#define INF 9999999

using namespace std;

typedef pair<int,int> P;

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

int main(){
	int X;
	cin>>X;
	vector<int> vec;
	FOR(i,1,35){
		FOR(j,2,20){
			long long c=1;
			REP(k,j){
				c=c*i;
				if(c>2000)break;
			}
			if(c<=2000)vec.push_back(c);

		}
	}
	VSORT(vec);
	int l=vec.size();
	int d;
	if(X==1){
		cout<<1<<endl;
		return 0;
	}
	REP(i,l){
		if(vec[i]>X){
			d=i-1;
			break;
		}
	}
	cout<<vec[d]<<endl;
}


Measured memory_bytes: 256
def main():
    N = int(input())
    MOD = 10**9 + 7
    ans = 1
    primes = sorted(Eratosthenes(N))
    for p in primes:
        cur = 0
        k = 1
        while p**k <= N:
            cur += N//(p**k)
            k += 1
        ans = ans * (cur+1) % MOD
    print(ans%MOD)

def Eratosthenes(x: int) -> set:
    """x以下の素数のsetを返す"""
    import math
    sup = int(x)
    primes = {i for i in range(2,sup+1)}
    for i in range(2,int(math.sqrt(sup+1))+1):
        if i in primes:
            mul = 2
            while i*mul <= sup:
                primes.discard(i*mul)
                mul += 1
    return primes

if __name__ == '__main__':
    main()

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

int pow2(int m){
  int p = 1;
  for(int i = 0; i < m; i++) p *= 2;
  return p;
}

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

  int a = m * 1900 + (n-m) * 100;
  int p = pow2(m);

  cout << a * p << endl;
}


Measured memory_bytes: 256
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int main(){
  int M, N, res;
  rd(N);
  rd(M);
  res = (100*(N-M) + 1900*M) << M;
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190822-2

// --- original code ---
// {
//   int N, M, res;
//   rd(N, M);
//   res = (100(N-M) + 1900M) << M;
//   wt(res);
// }


Measured memory_bytes: 256
from itertools import product
def main():
    n = int(input())
    for x, y in product(range(1, 3501), repeat = 2):
        if 4 * x * y - n * (x + y) != 0:
            z = n * x * y / (4 * x * y - n * (x + y))
        else:
            continue
        if z.is_integer() and z > 0:
            print(x, y, int(z))
            break

if __name__ == '__main__':
    main()


Measured memory_bytes: 72504
from collections import defaultdict as dd
from fractions import gcd
L = 10**6+1
isPrime = [True] * L
isPrime[0] = False
isPrime[1] = False
primes = []
for n in range(2, L):
  if isPrime[n]:
    primes.append(n)
    isPrime[2*n::n] = [False] * ((L-n-1) // n)

def primeFactorization(n):
  ret = dd(int)
  ret[1] = 1
  for p in primes:
    while n % p == 0:
      ret[p] += 1
      n //= p
  ret[n] = 1
  return ret

A, B = map(int, input().split())
g = gcd(A, B)
ps = primeFactorization(g)
print(len(ps))

Measured memory_bytes: 20608
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <queue>
#include <vector>
#include <cmath>
#include <cctype>
#include <cstring>
#include <cstdio>

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;

int main(void){
  int n, k;
  string s;

  cin >> n >> k >> s;

  for (int i = 0; i < s.length(); i++) {
    if (i == k-1) {
      putchar(tolower(s[i]));
    } else {
      putchar(s[i]);
    }
  }
  cout << '\n';

  return 0;
}

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

using namespace std;

long long gcd(long long a,long long b){
	if(max(a,b)%min(a,b)==0){
		return min(a,b);
	}else{
		return (gcd(max(a,b)%min(a,b),min(a,b)));
	}
}

long long lcm(long long a,long long b){
	return a*b/gcd(a,b);
}

int main(){
	long long a,b;
	cin >> a >> b;
	cout << lcm(a,b) << endl;
	return 0;
}


Measured memory_bytes: 256
from collections import deque

INF = 100000000
H, W, N = list(map(int, input().split()))
maze = [list(input()) for i in range(H)]

x = -1
for letters in maze:
    x += 1
    y = -1
    for letter in letters:
        y += 1
        if letter == "S":
            sx = x
            sy = y
        elif letter == str(N):
            gx = x
            gy = y

dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]


def bfs():
    count = 0
    backup = []
    for tmp_goal in range(1, N + 1):
        d = [[INF for i in range(W)] for j in range(H)]
        if tmp_goal == 1:
            q = deque([[sx, sy]])
            d[sx][sy] = 0
        else:
            q = deque([backup])
            d[backup[0]][backup[1]] = count

        while len(q) != 0:
            tmp_x, tmp_y = q.popleft()
            if maze[tmp_x][tmp_y] == str(tmp_goal):
                count = d[tmp_x][tmp_y]
                backup = [tmp_x, tmp_y]
                q.clear()
                break
            for j in range(0, 4):
                nx = tmp_x + dx[j]
                ny = tmp_y + dy[j]
                if 0 <= nx < H and 0 <= ny < W and maze[nx][ny] != "X" and d[nx][ny] == INF:
                    q.append([nx, ny])
                    d[nx][ny] = d[tmp_x][tmp_y] + 1
    return count


if __name__ == '__main__':
    ans = bfs()
    print(ans)

Measured memory_bytes: 45844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const int N = 2e5 + 10;
int a[N];
map<int, int> mp;
int main() {
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; ++i) {
        scanf("%d", a + i);
        mp[a[i]]++;
    }
    for (auto it = mp.begin(); it != mp.end(); ++it) {
        if (it->second >= 2) {
            cout << "NO" << '\n';
            return 0;
        }
    }
    cout << "YES\n";
    return 0;
}

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

#define ll long long
#define mk make_pair
#define pb push_back
#define ff first
#define sc second

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

using namespace std;


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

   int n; cin >> n;
   map<int, int> numbers;
   while(n--){
      int num; cin >> num;
      numbers[num]++;
   }
   int ans = 0;
   for(auto i : numbers){
      if(i.second % 2 != 0){
         ans++;
      }
   }
   cout << ans;
   return 0;
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using vi = vector<int64_t>;
using vvi = vector<vi>;
int64_t INF = 1000000007;

int main() {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    int64_t x;
    cin >> x;
    int64_t maxNum = ceil(sqrt(x));
    int64_t a, b;
    bool res = false;
    for(int64_t i=1; i<maxNum+1; i++){
        // +と-の両方を試す
        if(x%i==0){
            rep(j,INF){
                a = j;
                b = j-i;
                if(a*a*a*a*a - b*b*b*b*b == x){
                    cout << a << " " << b << endl;
                    res = true;
                    break;
                }
                if(-a*a*a*a*a + b*b*b*b*b == x){
                    cout << -a << " " << -b << endl;
                    res = true;
                    break;
                }
                if(a*a*a*a*a + b*b*b*b*b == x){
                    cout << a << " " << -b << endl;
                    res = true;
                    break;
                }
                if(-a*a*a*a*a - b*b*b*b*b == x){
                    cout << -a << " " << b << endl;
                    res = true;
                    break;
                }
                if( j>i &&
                    abs(a*a*a*a*a-b*b*b*b*b)>x &&
                    abs(a*a*a*a*a+b*b*b*b*b)>x){
                    break;
                }
            }
        }
        if(res) break;
    }
}

Measured memory_bytes: 3760
N = int(input())
def check_right_triangle(l):
    ans = ""
    max_number = l.pop(l.index(max(l)))
    if((max_number**2) == (l[0]**2+l[1]**2)):
        return "YES"
    else:
        return "NO"
for i in range(N):
    length_of_three_side = list(map(int,input().split()))
    print(check_right_triangle(length_of_three_side ))


Measured memory_bytes: 5604
import java.util.HashSet;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt(), k = sc.nextInt();
		HashSet<Integer> owners = new HashSet<Integer>();
		for (int i = 0; i < k; ++i) {
			for (int j = 0, d = sc.nextInt(); j < d; ++j) {
				owners.add(sc.nextInt());
			}
		}
		System.out.println(n - owners.size());
	}
}


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

#define pb push_back
#define mp make_pair
#define fi first
#define se second

using namespace std;

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

template <typename T> bool chkmax(T &x,T y){return x<y?x=y,true:false;}
template <typename T> bool chkmin(T &x,T y){return x>y?x=y,true:false;}

int readint(){
	int 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;
}

const int cys=998244353;
int n;
ll ans[300000];

ll mod(ll x){return x>=cys?x-cys:x;}

ll qpow(ll x,ll p){
	ll ret=1;
	for(;p;p>>=1,x=x*x%cys) if(p&1) ret=ret*x%cys;
	return ret;
}

struct graph{
	int m;
	int col[100005];
	ll A[300000];
	bool vis[100005];
	vector<int> adj[100005];
	void init(){
		for(int i=n;i>=1;i--){
			for(auto v:adj[i]) vis[col[v]]=1;
			while(vis[col[i]]) col[i]++;
			for(auto v:adj[i]) vis[col[v]]=0;
		}
		for(int i=1;i<=n;i++) A[col[i]]=(A[col[i]]+qpow(10,18*i))%cys;
	}
}g[4];

void fwt(ll *A,int m,int f){
	for(int i=1;i<m;i<<=1){
		for(int j=0;j<m;j+=(i<<1)){
			for(int k=j;k<j+i;k++){
				ll x=A[k],y=A[k+i];
				if(f>0) A[k]=mod(x+y),A[k+i]=mod(x+cys-y);
				else A[k]=(x+y)*((cys+1)/2)%cys,A[k+i]=(x+cys-y)*((cys+1)/2)%cys;
			}
		}
	}
}

int main(){
	n=readint();
	int x,y;
	for(int i=1;i<=3;i++){
		g[i].m=readint();
		for(int j=1;j<=g[i].m;j++){
			x=readint(); y=readint();
			if(x>y) swap(x,y);
			g[i].adj[x].pb(y);
		}
		g[i].init();
	}
	int m;
	for(m=1;m<n;m<<=1);
	for(int i=1;i<=3;i++) fwt(g[i].A,m,1);
	for(int i=0;i<m;i++) ans[i]=g[1].A[i]*g[2].A[i]%cys*g[3].A[i]%cys;
	fwt(ans,m,-1);
	printf("%lld\n",ans[0]);
	return 0;
}

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

using ll = long long;
const int mod = 1e9 + 7;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n + 1);
    int ans = 0;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        if ((a[i] & 1) && i & 1) ans++;
    }
    cout << ans;
}

Measured memory_bytes: 3656
# -*- coding: utf-8 -*-
import numpy as np
KN = input().split()
K = int(KN[0])
N = int(KN[1])
#print(K,N)

A = input().split()
A_np = np.append(np.array(A, dtype=np.int64), int(A[0])+K)
A_np_lag = np.append(A_np[1:], A_np[0])
A_diff = A_np_lag[:N] - A_np[:N]
#print(A_diff)
print(A_diff.sum() - A_diff.max())


Measured memory_bytes: 36780
n, x = (int(_) for _ in input().split())
a = [int(_) for _ in input().split()]
ans = max(0, a[0] - x)
a[0] = min(a[0], x)
for i in range(1, n):
    tmp = a[i] + a[i - 1] - x
    if tmp > 0:
        a[i] -= tmp
        ans += tmp
print(ans)
        



Measured memory_bytes: 64112
#include <iostream>
#include <string>
#include <algorithm>

using namespace std;

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

    for(int i=0; i<s.length(); i++){
        if(s[i]==',') cout << " ";
        else cout << s[i];
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

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

	bool ok = true;
	for (int i = 0; i < s.size(); i++) {
		if (i % 2 == 0) {
			if (s[i] == 'L') {
				ok = false;
				break;
			}
		} else {
			if (s[i] == 'R') {
				ok = false;
				break;
			}
		}
	}

	cout << (ok ? "Yes" : "No") << endl;
	return 0;
}


Measured memory_bytes: 256
import collections
import itertools
import sys
def main():
    n = int(input())
    a = [input()[0] for i in range(n)]
    b = collections.Counter(a)
    c = list(b.keys())

    char = ['M','A','R','C','H']
    check = list(map(lambda x: x in char, c))
    vals = [c[x] for x in filter(lambda x: check[x], range(len(check)))]

    if sum(b[val] for val in vals) < 3:
        print(0)
        sys.exit()

    count = 0
    for comb in itertools.combinations(vals,3):
        count+=b[comb[0]] * b[comb[1]] * b[comb[2]]
    print(count)

if __name__ == "__main__":
    main()

Measured memory_bytes: 4224
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <unordered_map>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF 2 << 29
using Graph = vector<vector<int>>;

int n, m;
vector<bool> visit(8);
Graph graph(8);

int solve(int x) {
	visit[x] = true;

	//base case
	bool f = true;
	rep(i, n) if (!visit[i]) f = false;
	if (f) return 1;

	int ans = 0;
	//search non-visited node
	for(auto i : graph[x]) {
		if (visit[i] == false) {
			ans += solve(i);
			visit[i] = false;
		}
	}
	return ans;
}

int main() {
	cin >> n >> m;
	rep(i, m) {
		int a, b;
		cin >> a >> b;
		graph[a - 1].push_back(b - 1);
		graph[b - 1].push_back(a - 1);
	}

	cout << solve(0) << endl;

}

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



int main(){

	int n,m,ans=0;
	cin>>n>>m;

	vector<int>x(m);
	for(int i=0;i<m;i++)cin>>x[i];
	sort(x.begin(), x.end() );

	if(n>=m)cout<<0;
	else{
		vector<int>y(m-1);
		for(int i=0;i<m-1;i++){
			y[i]=x[i+1]-x[i];
		}

		sort(y.begin(), y.end() );
		for(int i=0;i<m-1-(n-1);i++){
			ans+=y[i];
		}

		cout<<ans;
	}

}



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

using namespace std;

using ll = long long;
using Pii = pair<int, int>;

const ll INF = (ll)1e11;

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

    cout << (s == "a" || s == "e" || s == "i" || s == "o" || s == "u" ? "vowel" : "consonant") << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> P3;
typedef pair<P ,P> PP;
constexpr ll MOD = ll(1e9) + 7;
constexpr int IINF = INT_MAX;
constexpr ll LLINF = LLONG_MAX;
constexpr int MAX_N = int(1e5) + 5;
constexpr double EPS = 1e-9;
constexpr int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i > 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define ALL(v) (v).begin(), (v).end()

ll gcd(ll p, ll q){
    if(q==0) return p;
    else return gcd(q, p%q);
}

ll lcm(ll p, ll q){
    return p/gcd(p,q)*q;
}

int main() {
    ll a, b, c, d, x, y;
    cin >> a >> b >> c >> d;
    a--;
    x = a;
    x -= a/c + a/d;
    x += a/lcm(c,d);

    y = b;
    y -= b/c + b/d;
    y += b/lcm(c,d);
    cout << y - x << endl;
    return 0;
}



Measured memory_bytes: 256
import java.util.*;
import javax.lang.model.util.ElementScanner6;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        // 入力
        int a = sc.nextInt();
        int b = sc.nextInt();

        int out = 6 - (a + b);

        // 出力
        System.out.println(out);
    }
}

Measured memory_bytes: 21332
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include<stdio.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<string.h>

#ifdef LOCAL
#define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
#define NDEBUG
#define eprintf(...) do {} while (0)
#endif
#include<cassert>

using namespace std;

typedef long long LL;
typedef vector<int> VI;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define EACH(i,c) for(__typeof((c).begin()) i=(c).begin(),i##_end=(c).end();i!=i##_end;++i)

template<class T> inline void amin(T &x, const T &y) { if (y<x) x=y; }
template<class T> inline void amax(T &x, const T &y) { if (x<y) x=y; }
template<class Iter> void rprintf(const char *fmt, Iter begin, Iter end) {
    for (bool sp=0; begin!=end; ++begin) { if (sp) putchar(' '); else sp = true; printf(fmt, *begin); }
    putchar('\n');
}

struct UnionFind {
    int n, cc, *u;
    UnionFind() : n(0), cc(0), u(NULL) {}
    UnionFind(int n_) : n(n_), cc(n_) {
	u = new int[n_];
	memset(u, -1, sizeof (int) * n);
    }
    UnionFind(const UnionFind &y) : n(y.n), cc(y.cc) {
	u = new int[y.n];
	memcpy(u, y.u, sizeof (int) * n);
    }
    ~UnionFind() {
	delete[] u; u = NULL;
	n = cc = 0;
    }
    friend void swap(UnionFind &x, UnionFind &y) {
	swap(x.n, y.n); swap(x.cc, y.cc); swap(x.u, y.u);
    }
    UnionFind& operator=(UnionFind y) { 
	swap(*this, y);
	return *this;
    }
    int root(int x) {
	int y = x, t;
	while (u[y] >= 0) y = u[y];
	while (x != y) { t = u[x]; u[x] = y; x = t; }
	return y;
    }
    bool link(int x, int y) {
	x = root(x); y = root(y);
	if (x == y) return false;
	if (u[y] < u[x]) swap(x, y);
	u[x] += u[y]; u[y] = x; cc--;
	return true;
    }
    bool same(int x, int y) { return root(x) == root(y); }
    int count_node(int x) { return -u[root(x)]; }
    int count_tree() { return cc; }
};

int N;
int X[200011], Y[200011];
int P[200011];

void MAIN() {
    scanf("%d", &N);
    REP (i, N) {
	int x,y;
	scanf("%d%d", &x, &y);
	x--; y--;
	X[i] = x;
	Y[i] = y;
	P[x] = i;
    }

    UnionFind U(N);
    VI stk;
    REP (x, N) {
	int idx = P[x];
	int y = Y[idx];

	if (!stk.empty() && Y[stk.back()] < y) {
	    int last = stk.back();
	    while (!stk.empty() && Y[stk.back()] < y) {
		U.link(stk.back(), idx);
		stk.pop_back();
	    }

	    stk.push_back(last);
	} else {
	    stk.push_back(idx);
	}
    }


    REP (i, N) printf("%d\n", U.count_node(i));
}

int main() {
    int TC = 1;
//    scanf("%d", &TC);
    REP (tc, TC) MAIN();
    return 0;
}



Measured memory_bytes: 6616
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

using namespace std;


int main()
{
	int N,K,Q;
	cin>>N>>K>>Q;
	int *points = new int[N];
	for(int i = 0; i < N; i++){
		points[i] = K - Q;
	}
	for(int i = 0 ; i < Q; i++){
		int index;
		cin>>index;
		points[index-1]++;
	}
	for(int i = 0 ; i < N; i++){
		if( points[i] > 0){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}



Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define file_se_input  freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define pp long long int
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define eb emplace_back
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define zip(i,a,b) for(int i=a;i<b;i++)
#define rzip(i,a,b) for(int i=a;i>=b;i--)
#define ll unsigned long long int
#define test int t;cin>>t; while(t--)
#define um unordered_map
#define en '\n'
#define us unordered_set
typedef pair<int, int>     pii;
typedef pair<char, int>    pci;
typedef pair<char, char>   pcc;
typedef vector<pii>       vii;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define INF (1e18+5)
#define inf (1e9+5)
#define mod 1000000007


bool check_prime(long long n)
{
	int flag = 0;
	for (long long i = 2; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			flag = 1;
			break;
		}
	}
	if (n == 1)
		return false;
	else if (flag == 0 || n == 2 || n == 3)
	{
		return true;
	}
	else
	{
		return false;
	}

}

int BE(int x, int n, int m) //function to calculate x raise to power n modulo m
{
	int result = 1;
	while (n > 0)
	{
		if (n % 2 == 1)
			result = result * x % m;
		x = x * x % m;
		n = n / 2;
	}
	return result;
}

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	if (fopen("input.txt", "r"))
	{
		freopen ("input.txt" , "r" , stdin);
		freopen ("output.txt" , "w" , stdout);
	}
#endif
	//_______________________________-code starts-_______________________________________________

	int n, m;
	cin >> n >> m;
	int a[m];
	map<int, int>mt;
	zip(i, 0, m)
	{
		cin >> a[i];
		mt[a[i]]++;
	}
	int dp[n + 1] = {0};
	// dp[0]=0;
	if (mt[1] == 0)
	{
		dp[1] = 1;
	}
	else
	{
		dp[1] = 0;
	}
	if (mt[1] != 0 && mt[2] != 0)
	{
		dp[2] = 0;
	}
	else if (mt[2] == 0)
	{
		dp[2] = dp[1] + 1;
	}
	else if (mt[1] != 0)
	{
		dp[2] = dp[1];
	}
	rep(i, 3, n)
	{
		if (mt[i] != 0)
		{
			dp[i] = 0;
		}
		else
		{
			dp[i] = (dp[i - 1] + dp[i - 2]) % mod;
		}
	}
	cout << dp[n] << en;

	return 0;
}



Measured memory_bytes: 8064
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <set>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;

void sieve(bool* a){
	for(int i=2;i<=sqrt(50100.);++i){
		if(a[i]){
			for(int j=i*2;j<=50100;j+=i){
				a[j]=false;
			}
		}
	}
}

int main(){
	int n;
	bool a[50101];
	memset(a , true , sizeof(a));
	a[0]=a[1]=false;
	sieve(a);
	while(cin>>n){
		int i,j;
		for(i=n-1;i>=2;--i){
			if (a[i]==true) break;
		}
		for(j=n+1;j<=50101;++j){
			if(a[j]==true) break;
		}
		cout << i << " " << j << endl;
	}
	return 0; 
}

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

int main(){
  int n, x;
  cin >> n >> x;
  vector<int> m(n);
  for(int i = 0; i < n; i++) cin >> m[i];
  int min = m[0];  
  for(int i = 0; i < n; i++){
    x -= m[i];
    if(min > m[i]) min = m[i];
  }
  cout << n + x / min << endl;
  return 0;
}

Measured memory_bytes: 3568
def lcm(a, b):
    return a * b // gcd (a, b)

def gcd(a, b):
    while b:
        a, b = b, a % b
    return a

def main():
    num = int(input())
    ans = int(input())

    for i in range(num - 1):
        ans = lcm(ans, int(input()))
    print(ans)

if __name__ == '__main__':
    main()



Measured memory_bytes: 38256
import java.math.BigInteger;
import java.util.*;

public class Main {
	static long MOD = (long) 1e9 + 7;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		sc.close();
		System.out.println((n + 1) / 2);
	}

	public static int arrayMax(int[] array) {
		int ans = Integer.MIN_VALUE;
		for (int i = 0; i < array.length; i++) {
			if (array[i] > ans)
				ans = array[i];
		}
		return ans;
	}

	public static int[] arrayInt(Scanner sc, int n) {
		int[] array = new int[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		return array;
	}

	public static Integer[] arrayInteger(Scanner sc, int n) {
		Integer[] array = new Integer[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextInt();
		}
		return array;
	}

	public static long[] arrayLong(Scanner sc, int n) {
		long[] array = new long[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextLong();
		}
		return array;
	}

	public static double[] arrayDouble(Scanner sc, int n) {
		double[] array = new double[n];
		for (int i = 0; i < n; i++) {
			array[i] = sc.nextDouble();
		}
		return array;
	}
}


Measured memory_bytes: 23124
n,m = map(int,input().split())
x = list(map(int,input().split()))
if n >= m:
    print(0)
    exit(0)

x.sort()
y = []
for i in range(1,m):
    y.append(x[i] - x[i-1])
y.sort(reverse = True)
ans = sum(y)
ans2 = sum(y[:n-1])
print(ans - ans2)

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

using namespace std;

typedef long long int li;
typedef vector<li> vi;
typedef pair<li,li> pi;
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define B begin()
#define E end()
#define f(i,l,r) for(li i=l;i<=r;++i)
#define fr(i,l,r) for(li i=l;i>=r;--i)
#define u_map unordered_map
#define endl "\n"

li fastpow(li base,li exp,li M) 
{
    li res=1;
    while(exp>0) {
        if(exp&1)
            res=(res*base)%M;

        base=(base*base)%M;
        exp>>=1;
    }
    return res;
}

vi par;

li root(li a)
{
    while(a!=par[a])
    {
        par[a]=par[par[a]];
        a=par[a];
    }

    return a;
}

void unio(li a,li b)
{
    par[root(a)]=root(b);
}



    
int main()
{    
    

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    li a,b,k;

    cin>>a>>b>>k;

    if(k>=(a+b))
    {
        a=0;
        b=0;
    }
    else if(k>a)
    {
        k-=a;
        a=0;
        b-=k;
    }
    else
    {
        a-=k;
    }

    cout<<a<<" "<<b;

    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b)for(int i=(int)(a);(i)<(int)(b);i++)
typedef long long ll;

int main() {
  int n, m;
  cin >> n >> m;
  string ans = (n == m) ? "Yes" : "No";
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void) {
   int W,H,C,i,TEMP;
   scanf("%d %d %d",&W,&H,&C);
   if(W<H){TEMP=W;}else{TEMP=H;}
   for(i=TEMP;i>0;i--){
	   if(H%i==0 && W%i==0){
		   printf("%d\n",(int)(H/i)*(int)(W/i)*C);
		   break;}
   }
   return 0;
}



Measured memory_bytes: 2104
#line 1 "main.cpp"
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = std::int_fast64_t;
using std::cout;
using std::cerr;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

#define NDEBUG

long long extGCD(long long a, long long b, long long &x, long long &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    long long d = extGCD(b, a%b, y, x);
    y -= a/b * x;
    return d;
}

i64 solve(i64 n) {
	n *= 2LL;

	std::vector<i64> ps;
	std::vector<std::pair<i64, int>> vec;
	{
		i64 m = n;
		for(i64 i = 2; i * i <= m; i++) {
			if(m % i) continue;

			vec.push_back({i, 0});
			while(!(m % i)) {
				vec.back().second++;
				m /= i;
			}
		}
		if(m != 1) vec.push_back({m, 1});

		for(auto v: vec) {
			ps.push_back(1);

			for(int i = 0; i < v.second; i++) ps.back() *= v.first;
		}
	}

	i64 ans = n - 1;
	int k = vec.size();
	for(int i = 0; i < (1 << k); i++) {
		i64 A = 1;
		for(int j = 0; j < k; j++) {
			if(i >> j & 1) continue;
			A *= ps[j];
		}
		i64 B = n / A;

		long long x, y;
		extGCD(A, B, x, y);
		if(!x or !y) continue;
		if(x < 0) {
			x *= -1;
			y *= -1;
		}

		__int128_t X = __int128_t(A) * __int128_t(x);
		__int128_t Y = __int128_t(B) * __int128_t(-y);
		if(X < ans) ans = X;
		if(Y < ans) ans = Y;
	}
	return ans;
}

i64 naive(i64 n) {
	i64 sum = 0;
	for(i64 i = 1; ; i++) {
		sum += i;
		if(sum % n) continue;
		return i;
	}
	return -1;
}

int main() {
	i64 n; scanf("%lld", &n);
	i64 ans = solve(n);
	printf("%lld\n", ans);

	#ifndef NDEBUG
	for(i64 i = 1000; i < 100000 ; i++)
		assert(solve(i) == naive(i));
	#endif
	return 0;
}

#ifdef MEMO
上界 2N
2N(2N + 1) / 2 = N(2N + 1)

k(k + 1)/(2N) が整数になればよい

2N を素因数分解したい、k と k + 1 は互いに素なので使う素数は独立
素因数の種類数はたかだか 14

bit 全探索

#endif


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

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

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


    int ans = 0, flag = 1;
    while( flag ){
        for( int i = 0; i < N; ++i )
            if( A[i] % 2 == 0 ) A[i] /= 2;
            else flag = 0;

        if( flag ) ++ans;
    }


    cout << ans << endl;

    return 0;
}


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

int main() {
    int n;
    std::cin >> n;

    std::vector<int> A(n);
    for (int i = 0; i < n; i++) {
        std::cin >> A[i];
    }

    int q;
    std::cin >> q;
    for (int i = 0; i < q; i++) {
        int b, e, t;
        std::cin >> b >> e >> t;
        std::swap_ranges(A.begin() + b, A.begin() + e, A.begin() + t);
    }

    for (int i = 0; i < A.size(); i++) {
        std::cout << A[i];
        if (i < A.size() - 1) {
            std::cout << " ";
        }
    }
    std::cout << std::endl;
}



Measured memory_bytes: 3096
#include <bits/stdc++.h>
#include <limits.h>
#include <algorithm>  
#include <numeric>
#include <sys/resource.h>
 
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
 
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define endl '\n'
using ll = long long;
 
const int precision = 15;
const int modulo =  1000000007; // 10^9 + 7
const ll lmodulo =  1000000007; // 10^9 + 7
 
const double EPS = 1e-9;
const ll inf = 1e18;


void increaseStack() {
	const rlim_t kStackSize = 50 * 1024 * 1024;   // min stack size = 16 MB
	   struct rlimit rl;
	   int result;

	   result = getrlimit(RLIMIT_STACK, &rl);
	   if (result == 0)
	   {
	       if (rl.rlim_cur < kStackSize)
	       {
	           rl.rlim_cur = kStackSize;
	           result = setrlimit(RLIMIT_STACK, &rl);
	           if (result != 0)
	           {
	               fprintf(stderr, "setrlimit returned result = %d\n", result);
	           }
	       }
	   }
}


void solve () {
	increaseStack();

	int n, k; cin >> n >> k;
	vector<int> a(n);
	for (auto &it : a) cin >> it;

	vector<int>memo(k + 1, -1);

	memo[0] = 0;
	function<bool(int)> won = [&](int cur) -> bool {
		if(cur == 0) {
			return false;
		}

		if (memo[cur] != -1)  return memo[cur];

		for (auto i : a) {
			if ((cur - i) < 0) continue;
			if (!won(cur - i)) {
				memo[cur] = 1;
				return true;
			}
		}
		memo[cur] = false;
		return false;
	};
	if (won(k)) {
		cout << "First";
	} else {
		cout << "Second";
	}

	// vector<int> dp(k + 1);
	// dp[0] = 0;
	// for (auto i = 1; i <= k; ++i) {
	// 	for (auto v : a) {
	// 		if(i - v >= 0 and dp[i - v] == 0) {
	// 			dp[i] = 1;
	// 			break;
	// 		}
	// 	}
	// }

	// if (dp[k] == 1) {
	// 	cout << "First";
	// } else {
	// 	cout << "Second";
	// }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  cout.precision(precision);
  cout.setf(ios_base::fixed);
  solve();
  return 0;
}


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

int main()
{
          int a;
          int b;
          int c;
          cin >> a;
          cin >> b;
          cin >> c;
          1<=a<=100;
          1<=b<=100;
          1<=c<=100;
          if (a==b && a==c)
          {
                    cout << "1";

          }
          else if (a==b && a!= c)
          {
                    cout << "2";

          }
          else if (a==c && a!= b)
          {
                    cout << "2";

          }

          else if (a!=b && a!= c)
                    if(b==c)
                    {
                               cout << "2";

                    }
                    else
                    {
                              cout << "3";

                    }
          else if (a<1 || a>=100)
          {


          }
          else if (b<1 || b>=100)
          {

          }
          else if (c<1 || c>=100)
          {

          }





    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
   int n,m;
 
   scanf("%d",&n);
   for (m=n/1.1;floor(m*1.08)<n;m++) ;
   if (floor(m*1.08)!=n) puts(":(");
   else                  printf("%d\n",m);
   return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define lli long long int
using namespace std;
#define mod 1000000007
#define MOD 1000000037
#define mod1 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define INF 2e9


int main()
{
    fastio;
    int n;
    cin >> n;
    vector<int>v(n);
    for(int i=0;i<n;i++)
        cin >> v[i];
    map<int,int>m;
    m[v[0]+1]=1;
    lli ans=0;
    for(int i=1;i<n;i++)
    {
        int t=i+1-v[i];
        ans+=m[t];
        m[i+1+v[i]]+=1;
    }
    cout << ans << endl;
}

Measured memory_bytes: 21040
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
const Int MOD = 1000000007;
int main() {
    int N, K; cin >> N >> K;
    vector<Int> A(N); for (auto &a : A) cin >> a;
    vector<Int> cnts(2001), sum(2001);
    for (auto &a : A) cnts[a]++;
    for (int i = 1; i <= 2000; i++) {
        sum[i] = sum[i-1] + cnts[i];
    }
    Int ans = 0;
    for (int i = 0; i < N; i++) {
        Int c = 0;
        for (int j = 0; j < i; j++) {
            if (A[j] > A[i]) c++;
        }
        ans += c * K + sum[A[i]-1] * K % MOD * (K - 1) % MOD * 500000004;
        ans %= MOD;
    }
    cout << ans << '\n';
    return 0;
}


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

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

#define all(x)          x.begin(), x.end()
#define kill(x)         return cout << x << endl, 0
#define X               first
#define Y               second
#define sep             ' '
#define endl            '\n'

ll pw(ll a, ll b, ll mod) {
    if (!b)    return 1;
    if (b & 1) return a * pw(a * a % mod, b / 2, mod) % mod;
    return pw(a * a % mod, b / 2, mod) % mod;
}

const ll N    = 1e4 + 10;
const ll MOD  = 998244353;
const ll INF  = 1e18;

ll n, k, fact[N], inv[N], ans[N];

ll C(ll n, ll r) {
    if (r < 0 || r > n)
        return 0;
    return fact[n] * inv[r] % MOD * inv[n - r] % MOD;
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
    fact[0] = inv[0] = 1;
    for (ll i = 1; i < N; i++) {
        fact[i] = i * fact[i - 1] % MOD;
        inv[i] = pw(fact[i], MOD - 2, MOD);
    }
    cin >> k >> n;
    for (int i = 2; i <= 2 * k; i++) {
        int p = 0;
        for (int j = 1; j <= k; j++) {
            if (i - j <= k && j < i - j)
                p++;
        }
        int l = k - 2 * p - (i % 2 == 0);
        for (int q = 0; q <= (i % 2 == 0); q++) {
            for (int m = 0; m <= p; m++) {
                ans[i] = (ans[i] + pw(2, m, MOD) * C(p, m) % MOD * C(n + l - 1 - q, m + l - 1) % MOD) % MOD;
            }
        }
        cout << ans[i] << endl;
    }
    return 0;
}


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

bool check(int n){
	for(int i = 1;i <= 9;++i){
		if(n % i == 0 && (n/i < 10)) return 1;
	} 
	return 0;
}

int main()
{
	int n;
	cin >> n;
	if(check(n)) printf("Yes");
	else printf("No");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int a,b,c;

int main(){
	cin>>a>>b>>c;
	cout<<min(b/a,c)<<endl;
}

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

using namespace std;
typedef long long ll;

void YesNo(bool x) {
    cout << (x ? "Yes" : "No") << endl;
}

int main() {
    string s;
    cin >> s;
    YesNo(!(s == "AAA" || s == "BBB"));
    return 0;
}

Measured memory_bytes: 256
<?php

class In {

	private $buf = [];
	private $count = 0;
	private $pointer = 0;

	public function nextLine() {
		$ret = '';
		if($this->hasNext()){
			while($this->hasNext()){
				$ret .= $this->next();
			}
		}else{
			$ret = trim(fgets(STDIN));
		}

		return $ret;
	}

	public function next() {
		if(!$this->hasNext()) {
			$str = trim(fgets(STDIN));
			$this->buf = explode(' ',$str);
			$this->count = count($this->buf);
			$this->pointer = 0;
		}

		return $this->buf[$this->pointer++];
	}

	public function hasNext() {
		return $this->pointer < $this->count;
	}

	public function nextInt() {
		return (int)$this->next();
	}

	public function nextDouble() {
		return (double)$this->next();
	}
}

class Out {
	public function println($str = '') {
		echo $str . PHP_EOL;
	}
}

$in = new In();
$out = new Out();

$A = $in->nextInt();
$B = $in->nextInt();

if (($A+$B) % 3 === 0 || $A % 3 === 0 || $B % 3 === 0) {
	$out->println('Possible');
} else {
	$out->println('Impossible');
}

?>


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

const int maxn=55;
const int INF=0x3f3f3f3f;
int n,m;
char s[maxn][maxn];
bool vis[maxn][maxn];

namespace KM{
	const int maxl=105;
	const int maxr=2505;
	int vl,vr,a[maxl][maxr];
	bool visx[maxl],visy[maxr];
	int x[maxl],matx[maxl];
	int y[maxr],maty[maxr],home[maxr],slack[maxr];
	int work(){
		for(int i=1;i<=vl;i++)
			x[i]=INF,matx[i]=0;
		for(int i=1;i<=vr;i++)
			y[i]=maty[i]=0;
		for(int s=1;s<=vl;s++){
			for(int i=1;i<=vr;i++){
				visy[i]=false;
				home[i]=0;
				slack[i]=INF;
			}
			for(int i=1;i<=vl;i++){
				if(!matx[i]){
					visx[i]=true;
					for(int j=1;j<=vr;j++){
						int val=x[i]+y[j]-a[i][j];
						if(val<slack[j]){
							slack[j]=val;
							home[j]=i;
						}
					}
				}
				else visx[i]=false;
			}
			bool f=false;
			while(!f){
				int dlt=INF;
				for(int i=1;i<=vr;i++)if(!visy[i])dlt=min(dlt,slack[i]);
				for(int i=1;i<=vl;i++)if(visx[i])x[i]-=dlt;
				for(int i=1;i<=vr;i++){
					if(visy[i])y[i]+=dlt;
					else slack[i]-=dlt;
				}
				for(int i=1;i<=vr;i++){
					if(!visy[i]&&slack[i]==0){
						visy[i]=true;
						if(!maty[i]){
							f=true;
							int pos=i,fa=home[pos];
							while(pos){
								int nxt=matx[fa];
								matx[fa]=pos;
								maty[pos]=fa;
								pos=nxt;fa=home[pos];
							}
							break;
						}
						else{
							int pos=maty[i];
							visx[pos]=true;
							for(int i=1;i<=vr;i++){
								if(visy[i])continue;
								int val=x[pos]+y[i]-a[pos][i];
								if(val<slack[i]){
									slack[i]=val;
									home[i]=pos;
								}
							}
						}
					}
				}
			}
		}
		int res=0;
		for(int i=1;i<=vl;i++)res+=a[i][matx[i]];
		return res;
	}
}

void go(int x,int y){
	vis[x][y]=true;
	if(y+1<=m&&s[x][y+1]!='#'&&!vis[x][y+1])go(x,y+1);
	if(x+1<=n&&s[x+1][y]!='#'&&!vis[x+1][y])go(x+1,y);
}

int main(){
	scanf("%d%d",&n,&m);
	KM::vr=n*m;
	for(int i=1;i<=n;i++)scanf("%s",s[i]+1);
	for(int i=1;i<=n;i++)for(int j=1;j<=m;j++)if(s[i][j]=='o'){
		KM::vl++;
		go(i,j);
		for(int p=1;p<=n;p++)for(int q=1;q<=m;q++){
			KM::a[KM::vl][(p-1)*m+q]=vis[p][q]?(p-i+q-j):-INF;
			vis[p][q]=false;
		}
	}
	printf("%d\n",KM::work());
	return 0;
}

Measured memory_bytes: 4864