akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)a, i##_len=(b); i<i##_len; i++)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

#define all(box) box.begin(), box.end()

using namespace std;

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

const long long INF = LLONG_MAX/3;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
inline void Yes (bool condition) { if(condition) { cout << "Yes" << endl; } else { cout << "No" << endl;} }

struct UnionFind{
	std::vector<int> par,siz;
	void init(int n){
		par.resize(n);
		for(int i=0;i<n;i++)par[i]=i;
		siz.resize(n,1);
	}
	UnionFind(int n){
		init(n);
	}
	int root(int n){
		if(par[n]==n)return n;
		else return par[n]=root(par[n]);
	}
	bool issame(int x,int y){
		return (root(x)==root(y));
	}
	bool marge(int a,int b){
		if(issame(a,b))return false;
		else{
			a=root(a),b=root(b);
			if(siz[a]<siz[b])swap(a,b);
			siz[b]+=siz[a];
			par[a]=par[b];
			return true;
		}
	}
	int size(int n){
		return siz[root(n)];
	}
};

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

const int MOD=998244353;
long long fac[510000], finv[510000], inv[510000];
long long MAX=510000;
bool COMinited=false;
long long COM(int n, int k){
	if(COMinited==false){
		fac[0] = fac[1] = 1;
    	finv[0] = finv[1] = 1;
    	inv[1] = 1;
    	for (int i = 2; i < MAX; i++){
        	fac[i] = fac[i - 1] * i % MOD;
        	inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        	finv[i] = finv[i - 1] * inv[i] % MOD;
    	}
		COMinited=true;
	}
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}
template< typename T >
struct BinaryIndexedTree {
  vector< T > data;

  BinaryIndexedTree(int sz) {
    data.assign(++sz, 0);
  }

  T sum(int k) {
    T ret = 0;
    for(++k; k > 0; k -= k & -k) ret += data[k];
    return (ret);
  }

  void add(int k, T x) {
    for(++k; k < data.size(); k += k & -k) data[k] += x;
  }
};
signed main(){
	int a,b,c;
	cin>>a>>b>>c;
	cout<<c<<" "<<a<<" "<<b<<endl;
}

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

const int mx = 1e5+5;

int n, m, vis[mx];
vector<int> g[mx];

vector<int> ts;
void dfs(int u){
    vis[u] = 1;
    for(int v : g[u])
        if(!vis[v]) dfs(v);
    ts.push_back(u);
}

int main(){

    cin >> n >> m;
    while(m--){
        int u,v; cin >> u >> v;
        g[u].push_back(v);
    }for(int i=1; i<=n; i++)
        if(!vis[i]) dfs(i);
    reverse(ts.begin(), ts.end());

    vector <int> dp(n+1, 0);
    for(int u : ts) for(int v:g[u])
        dp[v] = max(dp[v], 1+dp[u]);
    cout << *max_element(dp.begin(), dp.end()) << "\n";
    return 0;
}


Measured memory_bytes: 11732
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
#include<iostream>
#include<bits/stdc++.h>
#include<cstdio>
#include<string.h>
#include<map>
#include<cmath>
#include<stack>
#include<algorithm>
#include<assert.h>
using namespace std;
#define endl '\n'
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define all(x) x.begin(),x.end()
#define mem0(s) memset(s,0,sizeof(s))
#define meminf(s) memset(s,0x3f,sizeof(s))
#define mp_insert(a,b,c) mp.insert(map<pair<int,int>,int>::value_type(make_pair(a,b),c))
double pi=acos(-1);
typedef long long ll;
typedef unsigned long long ull;
inline ll lowbit(ll x){return x&(-x);}
inline ll min(ll a,ll b){return a<b?a:b;}
inline ll max(ll a,ll b){return a>b?a:b;}
inline ll floor(const ll&a,const ll&b){return a/b;};
inline ll gcd(ll a,ll b){return b==0?a:gcd(b,a%b);}
const ll INF=4223372036854775807,max_n=100005,mod=1000000007;
inline ll ceil(const ll&a,const ll&b){if(a%b==0)return a/b;return a/b+1;};
inline ll pow(ll a,ll b,ll mod){ll res=1;a%=mod;assert(b>=0);for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

ll mul(ll a, ll b) {return (a%mod)*(b%mod)%mod;}
ll qpow(ll a, ll b)
{
    ll res = 1; a%=mod;
    while(b)
    {
        if(b&1) res = mul(res, a);
        a = mul(a, a);
        b>>=1;
    }
    return res;
}
ll com(ll a, ll b)//Ca^b
{
    if(a<b) return 0;
    if(b==0 || a==b) return 1;
    b = min(b, a-b);
    ll ca = 1, cb = 1;
    for(int i = 0; i < b; i++)
    {
        ca = mul(ca, a-i);
        cb = mul(cb, i+1);
    }
    return  mul(ca, qpow(cb, mod-2));
}
ll lucas(ll a, ll b)
{
	if(a<0||b<0)return 0;
    if(b==0) return 1;
    return com(a%mod, b%mod)*lucas(a/mod, b/mod)%mod;
}
int main()
{
	int x,y;cin>>x>>y;
	if((x+y)%3!=0)cout<<"0";
	else
	{
		int ceng=(x+y)/3;
		cout<<(lucas(ceng,y-(ceng))+mod)%mod;
	}
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main() {
unsigned long long int N,A,B;
 cin>>N>>A>>B;
 if(N==1&&A!=B)
 	cout<<0<<endl;
 else if (A>B){
 	cout<<0<<endl;
 }
 else{
 	cout<<B*(N-1)+A-A*(N-1)-B+1<<endl;
 }
}

		


Measured memory_bytes: 384
#include <iostream>
using namespace std;
int main(void){
    int S,h,m,s;
    cin>>S;
    s=S%60;
    h=S/3600;
    m=(S-3600*h-s)/60;
    cout<<h<<':'<<m<<':'<<s<<"\n";
    return 0;
    
}



Measured memory_bytes: 3104
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int length = sc.nextInt();
        String str = sc.next();
        int index = sc.nextInt();
        System.out.println(str.replaceAll("[^" + String.valueOf(str.charAt(index-1))  +"]","*"));
    }
}

Measured memory_bytes: 23892
from collections import deque
n,m=map(int,input().split())
edge=[[] for _ in range(n+m)]
for i in range(n):
    lis=list(map(int,input().split()))
    for l in lis[1:]:
        l-=1
        edge[i].append(n+l)
        edge[n+l].append(i)
def bfs():
    visited=[0]*(n+m)
    q=deque([0])
    visited[0]=1
    while q:
        x=q.popleft()
        for nx in edge[x]:
            if visited[nx]==0:
                visited[nx]=1
                q.append(nx)
    return visited
visited=bfs()
if sum(visited[:n])==n:
    print("YES")
else:
    print("NO")

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

int main() {
    long long x;
    cin >> x;

    long long ans = (x / 11) * 2;
	int rem = x % 11;

    if (rem != 0) {
        if (rem > 6) {
            ans += 2;
        } else {
            ans += 1;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
//Fibonacci Number

#include<stdio.h>
#define N 44

int i,arr[N];

//If you call a recursive function, the calculatino become so slow.
//So, you have to use like a for sentence. 

int fib(int n)
{
  arr[0] = 1;
  arr[1] = 1;
  
  for(i = 2; i < n; i++)
    {
      arr[i] = arr[i - 2] + arr[i - 1];
    }

  if(n == 0 || n == 1) return 1;
  
  else return arr[i - 2] + arr[i - 1];
}

int main()
{
  int n;

  scanf("%d",&n);

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

  return 0;
}



Measured memory_bytes: 2112
#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 a, b; std::cin >> a >> b;
    int x; std::cin >> x;
    std::cout << (a <= x && x <= a + b ? "YES" : "NO") << std::endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#define INF	123456789

int n, m, c[21];
int dp[51234];

int main(void) {
	scanf("%d%d", &n, &m);
	for (int i = 0; i < m; ++i) { scanf("%d", &c[i]); }

	for (int i = 1; i <= n; ++i) { dp[i] = INF; }
	for (int i = 0; i < m; ++i) {
		for (int j = 0; j <= n; ++j) {
			if (j - c[i] >= 0) {
				dp[j] = std::min(dp[j], dp[j - c[i]] + 1);
			}
		}
	}

	printf("%d\n", dp[n]);
	return 0;
}

Measured memory_bytes: 2880
//
// Created by sark2 on 22-10-2019.
//

#include "bits/stdc++.h"

using namespace std;
#define PB push_back
#define IOS cin.sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define CASES int t;cin>>t;while(t--)
#define MP make_pair

using ll = long long;
using ld = long double;

const int mod = 1e9 + 7;

const int INF = 1e5+10;


int main() {
    IOS

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

    if(a <= 9 && b <= 9 && a >= 1 && b >= 1)
        cout<<a*b<<"\n";
    else
        cout<<-1;



}


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

using namespace std;

const int N = 1e3 + 5, mod = 1e9 + 7;
int n, m, dp[N][N];

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> m;
    dp[1][0] = 1;
    for (int i = 1; i <= n; ++i) {
        for (int j = 1; j <= m; ++j) {
            char c; cin >> c;
            if (c == '.') {
                dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
                dp[i][j] = (dp[i][j] + dp[i][j - 1]) % mod;
            }
        }
    }

    cout << dp[n][m];

    return 0;
}


Measured memory_bytes: 4224
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<set>
#include<math.h>
#include <bits/stdc++.h>
using namespace std;



int main(){
    long long int x;
    cin>>x;
    long long int cur=100;
    long long int y=0;
    while(cur<x){
        cur=cur*1.01;
        y+=1;
        //cout<<cur<<endl;
    }
    cout<<y<<endl;
    return 0;
}

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

int main(){
  int N, a, b, c, d;
  cin >> N;
  a = N / 1000;
  b = (N - 1000 * a) / 100;
  c = (N - 1000 * a - 100 * b) / 10;
  d = (N - 1000 * a - 100 * b - 10 * c);
  if(a == b && b == c)
    cout << "Yes";
  else if(b == c && c == d)
    cout << "Yes";
  else
    cout << "No";
  cout << endl;
}

Measured memory_bytes: 256
def gcd(a, b):
  if a > b:
    a, b = b, a
  while a % b != 0:
    a, b = b, a % b
  return b

n, k = map(int, input().split())
A = list(map(int, input().split()))
maxA = max(A)

l = A.pop()
for a in A:
  l = gcd(l, a)

print('POSSIBLE' if k % l == 0 and maxA >= k else 'IMPOSSIBLE')


Measured memory_bytes: 14252
#include "bits/stdc++.h"

using namespace std;

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

int main() {
    int a, b, c, x, y;
    cin >> a >> b >> c >> x >> y;
    int price = 0;
    int a_plus_b = a + b;
    int double_ab = c * 2;
    int min_double = min(a_plus_b, double_ab);

    int greedy_price = min_double * max(x, y);
    int num_of_needed_double = min(x, y);
    x -= num_of_needed_double;
    y -= num_of_needed_double;
    price += min_double * num_of_needed_double;
    price += x * a;
    price += y * b;
    price = min(price, greedy_price);
    cout << price << endl;
    return 0;
}



Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  ll k;
  cin >> n >> k;
  vector<int> v(n);
  for (auto &x : v) {
    cin >> x;
    x--;
  }
  int slow = 0, fast = 0, ctr = 0;
  do {
    ctr++;
    slow = v[slow];
    fast = v[v[fast]];
  } while (slow != fast);
  slow = 0, fast = 0;
  for (int i = 0; i < ctr; i++)
    fast = v[fast];
  int l = 0;
  while (slow != fast) {
    slow = v[slow];
    fast = v[fast];
    l++;
  }
  // cerr << l << " " << ctr << endl;
  if (l < k)
    k = ((k - l) % ctr) + l;
  slow = 0;
  for (int i = 0; i < k; i++)
    slow = v[slow];
  cout << slow + 1 << "\n";
}

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


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

    string s, t;

    cin>>s>>t;

    vector<vector<int>> dp(s.size()+1, vector<int>(t.size()+1, 0));

    for(size_t i = 1; i <= s.size(); ++i) {
        for(size_t j = 1; j <= t.size(); ++j) {
            if(s[i-1] == t[j-1]) {
                dp[i][j] = 1 + dp[i-1][j-1];
            } else {
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            }
        }
    }

    string output = "";
    int x = s.size();
    int y = t.size();
    int curr = 0;

    while(x > 0 && y > 0) {
        curr = dp[x][y];
        if(dp[x-1][y-1]==dp[x-1][y] && dp[x-1][y-1]==dp[x][y-1]) {
            
            if(curr > dp[x-1][y-1]) {
                output += s[x-1];
            }
            x--;
            y--;
        } else if(dp[x-1][y] > dp[x][y-1]) {
            x--;
        } else if(dp[x-1][y] < dp[x][y-1]) {
            y--;
        } else {
            x--;
        }
    }
    

    reverse(output.begin(), output.end());
    cout<<output<<endl;
    
    return 0;
}

Measured memory_bytes: 35584
#include<cstdio>
#include<algorithm>
#include<vector>
#include<string>
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<complex>
#include<stack>

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


int main(){
	
	stack<int> st;
	int in;
	while(scanf("%d",&in)!=EOF){
		if(in!=0)st.push(in);
		else{
			printf("%d\n",st.top());
			st.pop();
		}
	}
}

Measured memory_bytes: 1176
#include <bits/stdc++.h>
#define vi vector<int>
#define ll long long
#define pb push_back
#define ii pair<int, int>
#define qi queue<int>
#define si stack<int>
#define mii map<int, int>
#define msi map<string, int>
#define fr first
#define sc second
#define all(x) x.begin(), x.end()
using namespace std;

const int MAX = 1e5+5;
const int mod = 1e9+7;



int main(int argc, char** argv) {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	//#ifndef ONLINE_JUDGE
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	//#endif

	string s, tmp;
	cin >> s;

	for (char c : s) {
		if (c == '0' || c == '1')
			tmp += c;
		else {
			if (tmp.length()) {
				tmp.erase(tmp.length()-1);
			}
		}
	}
	cout << tmp << endl;


	return 0;
}


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

using namespace std;

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

    if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
        cout << "Bad" << endl;

    } else {
        cout << "Good" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.lang.*;
import java.io.*;
public class Main
 {
	public static void main (String[] args)
	 {
            Scanner sc=new Scanner(System.in);
            int n=sc.nextInt(),k=sc.nextInt(),a[]=new int[n],i;
            int min=(int)Math.pow(10,9)+7;
            for(i=0;i<n;i++) {
            	a[i]=sc.nextInt();
            }
            Arrays.sort(a);
            for(i=0;(i+k-1)<n;i++) {
            	int diff=a[i+k-1]-a[i];
            	if(diff<min)
            		min=diff;
            }
            System.out.println(min);
	 }
}

Measured memory_bytes: 50128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll k, a;
  in(k);
  vector<ll> c(9);
  rep(i, 9)
    c[i] = i + 1;
  a = 0;
  while(c.size() < 300000){
    rep(i, 10){
      if(c[a] % 10 == i){
        c.pb(c[a] * 10 + i);
        if(i != 9)
          c.pb(c[a] * 10 + i + 1);
        if(i != 0)
          c.pb(c[a] * 10 + i - 1);
      }
    }
    a++;
  }
  sort(all(c));
  out(c[k - 1]);
  memi;
}

Measured memory_bytes: 6896
N = int(input())
A = list(map(int,input().split()))
out = []
cnt = 0
Amax = max(A)
Amaxi = A.index(Amax)
Amin = min(A)
Amini = A.index(Amin)
if abs(Amax)>=abs(Amin):
    for i in range(N):
        if i==Amaxi:
            continue
        else:
            A[i] = A[i]+Amax
            out.append([Amaxi+1,i+1])
            cnt+=1
    for i in range(1,N):
        A[i] = A[i-1]+A[i]
        out.append([i,i+1])
        cnt+=1
else:
    for i in range(N):
        if i==Amini:
            continue
        else:
            A[i] = A[i]+Amin
            out.append([Amini+1,i+1])
            cnt+=1
    for i in range(1,N):
        A[N-i-1] = A[N-i]+A[N-i-1]
        out.append([N-i+1,N-i])
        cnt+=1

print(cnt)
for i in range(len(out)):
    X = out[i]
    print(*X)

Measured memory_bytes: 62496
#include <iostream>
#include <cstdio>
#include <vector>
#include <math.h>

using namespace std;

typedef long long int ll;
typedef long double ld;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define vsort(a) sort(a.begin(), a.end())
#define rev(a) reverse(a.begin(), a.end());

const int MOD = 1000000007;
const int INF = INT_MAX;



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

    int flag = 1;
    if (n%2 == 0){
        for (int i=0; i < n/2; i++){
            if (s[i] != s[n/2+i]){
                flag = 0;
            }
        }
    }
    else flag = 0;

    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;

    
    return 0;
}




//              g++ -std=c++1z  

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
ll mod=1e9+7;

int main() {
  ll n;
  cin >> n;
  ll temp=0;
  vector<pll> w(n);
  for(ll i=0;i<n;i++) {
    ll a,b;
    cin >> a >> b;
    w[i]=pll(b,a);
  }
  sort(w.begin(),w.end());
  for(ll i=0;i<n;i++) {
    if(w[i].first>=temp+w[i].second) {
      temp+=w[i].second;
    }
    else {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
}

Measured memory_bytes: 3328
// 2011/04/04 Tazoe

#include <iostream>
using namespace std;

void eratos(bool prime[], int n)
{
	if(n>=1)
		prime[0] = false;
	if(n>=2)
		prime[1] = false;

	for(int i=2; i<n; i++)
		prime[i] = true;

	for(int i=2; i<n; i++){
		if(!prime[i])
			continue;
		for(int j=i+i; j<n; j+=i)
			prime[j] = false;
		if(n<i*i)
			return;
	}
}

int main()
{
	bool prime[50001];
	eratos(prime, 50001);

	while(true){
		int n;
		cin >> n;
		if(n==0)
			break;

		int cnt = 0;
		for(int i=2; i<=n-i; i++)
			if(prime[i]&&prime[n-i])
				cnt++;

		cout << cnt << endl;
	}

	return 0;
}

Measured memory_bytes: 916
/* ＵＴＦ－８ */
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <array>
#include <queue>
#include <stack>
#include <algorithm>
#include <tuple>
#include <numeric>
#include <type_traits>
#include <limits>

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <string.h>

#define USE_COLORED 1

#ifdef USE_COLORED
static const char stdout_pre[]  = "\033[1m"; // bold black
static const char stderr_pre[]  = "\033[31;1m"; // bold red
static const char stdxxx_post[] = "\033[m";

// 当然ながら GCC(g++)/libstdc++ 依存
#include <ext/stdio_filebuf.h>
using stdio_filebuf = __gnu_cxx::stdio_filebuf<char>;
class colored_stdio_filebuf : public stdio_filebuf {
private:
	const char* const pre_;
	const char* const post_;

public:
	colored_stdio_filebuf(FILE* fp, const char* pre, const char* post) : stdio_filebuf(fp, std::ios_base::out), pre_(pre), post_(post)
	{
	}

protected:
	std::streamsize xsputn(const char* s, std::streamsize count) override
	{
		stdio_filebuf::xsputn(pre_, strlen(pre_));
		auto ret = stdio_filebuf::xsputn(s, count);
		stdio_filebuf::xsputn(post_, strlen(post_));
		return ret;
	}
};
#endif

int main()
{
#ifdef USE_COLORED
	if (getenv("DEBUG")) {
		std::cout.rdbuf(new colored_stdio_filebuf(stdout, stdout_pre, stdxxx_post));
		std::cerr.rdbuf(new colored_stdio_filebuf(stderr, stderr_pre, stdxxx_post));
	} else
#endif
	{
		int fd = open("/dev/null", O_WRONLY);
		dup2(fd, 2);
		close(fd);
	}

	std::string S[3] = {};
	int pos[3] = {};
	for (auto& s : S) {
		std::cin >> s;
	}
	
	int turn = 0;
	while (pos[turn] < S[turn].size()) {
		auto nextturn = S[turn][pos[turn]] - 'a';
		++pos[turn];
		turn = nextturn;
	}
	std::cout << static_cast<char>('A' + turn) << "\n";
}


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

using namespace std;

int main()
{
    int a[100001] = {};
    int n = 0;
    int ans = 0;
    cin >> n;
    int i = 0;
    for (i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    i = 0;
    while (i < n)
    {
        if (a[i] == a[i + 1])
            i++;
        else if (a[i] < a[i + 1]) //
        {
            while (a[i] <= a[i + 1])
                i++;
            i++;
            ans++;
        }
        else
        {
            while (a[i] >= a[i + 1])
            {
                if (a[i + 1] == 0)
                    i++;
                i++;
            }
            i++;
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 640
from math import sqrt
from itertools import permutations

def dict(p, q):
    return sqrt((p[0]-q[0])**2 + (p[1]-q[1])**2)

n = int(input())
coord = []
for _ in range(n):
    coord.append([int(i) for i in input().split()])

sum = cnt = 0
for c in permutations(coord):
    for i in range(n-1):
        sum += dict(c[i], c[i+1])
    cnt += 1

print(sum/cnt)


Measured memory_bytes: 3064
#include<iostream>
#include<math.h>
#include<vector>
#include<array>
#include<algorithm>
#include<numeric>
#include<map>
#include<queue>
#include<deque>
#include<set>
#include<cstdio>
#include<cstring>
#include<string>
using namespace std;
typedef long long ll;
typedef vector<int> vec;
typedef vector<vector<int>> mat;

int main(){
    ll N;cin>>N;
    if(N%2==1){
        cout<<0<<endl;
        return 0;
    }
    else{
        N/=2;
        ll ans=0;
        while(N>0){
            ans+=N/5;
            N/=5;
        }
        cout<<ans<<endl;
        return 0;
    }
}

Measured memory_bytes: 256
def pay(i: int, remain: int, z: int):
    for i in range(0, (n - z) + 1):
        if 10 * i + 5 * (remain - i) + z == m:
            print(i, remain - i, z)
            exit()

    return


n, M = list(map(int, input().split(" ")))
m = int(M / 1000)

for z in range(n, -1, -1):
    pay(0, n - z, z)

print(-1, -1, -1)


Measured memory_bytes: 3188
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};
#[allow(unused_imports)]
use std::io::{stdout, stdin, BufWriter, Write};

fn divisors(n: usize) -> Vec<usize> {
    let mut m = 1;
    let mut divs = vec![];
    while m*m <= n {
        if n%m == 0 {
            divs.push(m);
            divs.push(n/m);
        }
        m += 1;
    }
    divs.sort();
    divs.dedup();
    divs
}

fn main() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }

    input!{
      n: usize,
      k: usize,
      aa: [usize; n],
    }
    let sum: usize = aa.iter().sum();
    let mut ans = 1;
    let divs = divisors(sum);
    for v in divs {
        let mut mds: Vec<_> = aa.iter().map(|&a| a%v).collect();
        let s2: usize = mds.iter().sum();
        mds.sort();
        for i in 0..(s2/v) {
            mds[n-i-1] = 0;
        }
        let req: usize = mds.iter().sum();
        if req <= k {
            ans = max(ans, v);
        }
    }
    puts!("{}\n", ans);
}


Measured memory_bytes: 4352
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan=new Scanner(System.in);
		int a=scan.nextInt();
		int b=scan.nextInt();
		if(b>=a) {
			System.out.println(a);
		}
		else {
			System.out.println(a-1);
		}
	}
}


Measured memory_bytes: 21844
h,w=[int(i) for i in input().split()]
s=[input() for i in range(h)]

ans=True
for i in range(h):
    for j in range(w):
        if s[i][j]=='.':
            continue
        if 0<i and s[i-1][j]=='#':
            continue
        if i<h-1 and s[i+1][j]=='#':
            continue
        if 0<j and s[i][j-1]=='#':
            continue
        if j<w-1 and s[i][j+1]=='#':
            continue
        ans=False
        break
    else:
        continue
    break
if ans:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
#include <stdio.h>
int main(){
int n;
scanf("%d",&n);
int a,b;
scanf("%d %d",&a,&b);
for (a==a;a<=b;a++){
	if(a%n==0){
		printf("OK");
		return 0;
	}
	else{
		continue;
	}
}
printf("NG");
return 0;
}


Measured memory_bytes: 1692
//============================================================================
// Name        : AOL.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cctype>
#include <string>
#include<algorithm>

using namespace std;



int main(){


	char n1,n2,n3;

	cin>>n1>>n2>>n3;


	if(n1==n3){
		cout<<"Yes"<<endl;
	}else
		cout<<"No"<<endl;






}









Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long int 
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define vii vector<int>
#define mii map<int,int>
#define mod 1000000007
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define pqmin priority_queue<int,vector<int>,greater<int>>
#define pqmax priority_queue<int>
using namespace std;
int32_t main()
{
    IOS;
  int n;
  cin>>n;
  int a[n];
  double s=0;
  for(int i=0;i<n;i++)
  {
      cin>>a[i];
      s=s+1/(double)a[i];
  }
 cout<<1/s<<endl;
    return 0;
}


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

using namespace std;
using ll = long long;
using P = pair<int, int>;
#define all(c) (c).begin(), (c).end()
const int INF = 1e9 + 1;
const ll LINF = 1e18 + 1;
const ll MOD = 1e9 + 7;

class modint {
 public:
  ll n;
  int mod = MOD;

  modint(const ll x = 0) noexcept : n(x) {}
  modint& operator+=(const modint a) {
    n += a.n;
    n %= mod;
    return *this;
  }
  modint operator+(const modint a) { return modint(*this) += a; }
  modint& operator-=(const modint a) {
    n += (mod - a.n);
    n %= mod;
    return *this;
  }
  modint operator-(const modint a) { return modint(*this) -= a; }
  modint& operator*=(const modint a) {
    n *= a.n;
    n %= mod;
    return *this;
  }
  modint operator*(const modint a) { return modint(*this) *= a; }
  modint pow(ll exp) {
    if (exp == 0) return 1;
    modint a = pow(exp >> 1);
    a *= a;
    if (exp & 1) a *= *this;
    return a;
  }
  modint inverse() { return pow(mod - 2); }
  modint operator/(const modint a) { return modint(*this) /= a; }
  modint& operator/=(modint a) { return (*this) *= a.inverse(); }
};
ostream& operator<<(ostream& o, const modint& m) {
  o << m.n;
  return o;
}

modint fact(int n) {
  static vector<modint> f = {1, 1};
  while (n >= (int)f.size()) f.push_back(f[f.size() - 1] * modint(f.size()));
  return f[n];
}

modint combin(int n, int k) { return fact(n) / fact(n - k) / fact(k); }

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

  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  sort(all(a));
  modint nck = combin(n, k);
  modint ans = 0;

  for (int i = 0; i < n; ++i) {
    if (n - i - 1 < k - 1) break;
    modint cnt = combin(n - i - 1, k - 1);
    ans += cnt * modint(a[n - i - 1]);
  }
  for (int i = 0; i < n; ++i) {
    if (n - i - 1 < k - 1) break;
    modint cnt = combin(n - i - 1, k - 1);
    ans -= cnt * modint(a[i]);
  }

  cout << ans << endl;
  return 0;
}


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

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

#define fst first
#define snd second
#define pb push_back

template <typename T> bool chkmax(T& a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> bool chkmin(T& a, T b) { return a > b ? a = b, 1 : 0; }

const int maxn = 19;
const int oo = 0x3f3f3f3f;

template<typename T> T read() {
	T n(0), f(1);
	char ch = getchar();
	for( ;!isdigit(ch); ch = getchar()) if(ch == '-') f = -1;
	for( ; isdigit(ch); ch = getchar()) n = n * 10 + ch - 48;
	return n * f;
}

LL ans = 0, d, n;
LL P10[maxn], b[maxn], s[maxn];
const LL w[] = { 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 };

void dfs(int cur, LL tmp, LL val, bool flag = false) {
    if(cur == n/2) {
        ans += (tmp == d) * val;
        return;
    }

    if(tmp - 9LL * s[cur] > d) return;
    if(tmp + 9LL * s[cur] < d) return;

    for(int i = -9; i <= 9; i++) {
        if(flag) {
            dfs(cur+1, tmp + i*b[cur], val * (i >= 0 ? w[i]-1 : w[-i]));
        }else {
            dfs(cur+1, tmp + i*b[cur], val * w[abs(i)]);
        }
    }
}

int main() {
#ifndef ONLINE_JUDGE
    //freopen("data.txt", "r", stdin);
    //freopen("ans.txt", "w", stdout);
#endif
    cin >> d;
    if(d % 9) return puts("0"), 0;

    P10[0] = 1;
    for(int i = 1; i < maxn; i++) P10[i] = P10[i-1] * 10LL;

    for(n = 2; n <= 18; n++) {
        for(int j = 0; j < n/2; j++) b[j] = P10[n-1-j] - P10[j];

        s[n/2] = 0;
        for(int j = n/2-1; j>=0;j--) s[j] = s[j+1] + b[j];

        if(n & 1) {
            dfs(0, 0, 10, 1);
        }else {
            dfs(0, 0, 1, 1);
        }
    }
    cout << ans << endl;

    return 0;
}


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

const int N = 2e5 + 5;

int n, a[N], b[N];

int main() {
    std::cin >> n;
    for(int i = 1; i <= n; ++i)
        std::cin >> a[i] >> b[i];
    std::sort(a + 1, a + n + 1);
    std::sort(b + 1, b + n + 1);
    if(n & 1)
        std::cout << b[n / 2 + 1] - a[n / 2 + 1] + 1;
    else
        std::cout << b[n / 2] + b[n / 2 + 1] - a[n / 2] - a[n / 2 + 1] + 1;
    return 0;
}


Measured memory_bytes: 5196
#include<bits/stdc++.h>
using namespace std;
#define  ft  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define  ll  long long
string s,p;
int main()
{
    ft
    ll t,i,j,n,m,c;
    cin>>s;
    if(s=="Sunny")
    {
        p="Cloudy";
    }
    else if(s=="Cloudy")
    {
        p="Rainy";
    }
    else
    {
        p="Sunny";
    }
    cout<<p<<"\n";
    return 0;
}

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

using namespace std;

#ifndef aa
#define trace(...)
#define endl '\n'
#endif
#define pb push_back
#define ub upper_bound
#define lb lower_bound
#define fi first
#define se second
#define int long long
typedef long long ll;
typedef long double ld;
#define double long double
#define pii pair<int,int>
#define pdd pair<double,double>
#define pll pair<ll,ll>
#define sz(x) ((long long)x.size())
#define fr(a,b,c) for(int a=b; a<=c; a++)
#define frev(a,b,c) for(int a=c; a>=b; a--)
#define rep(a,b,c) for(int a=b; a<c; a++)
#define trav(a,x) for(auto &a:x)
#define all(con) con.begin(),con.end()
#define deb(x) cout << x << endl
#define done(x) {cout << x << endl;return;}
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;
mt19937_64 mt(chrono::steady_clock::now().time_since_epoch().count());
//const int mod = 998244353;
const int mod = 1e9 + 7;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<pair<int, int>> vpii;
typedef map<int, int> mii;
typedef set<int> si;
typedef set<pair<int,int>> spii;
typedef queue<int> qi;


const int N = 405;

int d;
vi c(27);
vvi a(N,vi(27));
vector<si> s(27);

int f(vi &v){
  int res = 0;
  fr(i,1,26)
    s[i]={-1,d};
  vi last(27,-1);
  rep(i,0,d){
    last[v[i]]=i;
    s[v[i]].insert(i);
    fr(j,1,26)
      res-=(i-last[j])*c[j];
    res+=a[i][v[i]];
  }
  return res;
}


void solve() {

  
  cin>>d;
  fr(i,1,26)
    cin>>c[i];
  rep(i,0,d)
    fr(j,1,26)
      cin>>a[i][j];
  
  vi v(d);
  rep(i,0,d)
    cin>>v[i];
  int res = f(v);
  int q;
  cin>>q;
  while(q--){
    int x,y;
    cin>>x>>y;
    x--;
    int z = v[x];
    s[z].erase(x);
    auto it = s[z].lb(x);
    int nxt = *it, lst = *(--it);
    int fact = c[z]*(x-lst);
    res -= fact*(nxt-x);
    it = s[y].lb(x);
    nxt = *it, lst = *(--it);
    fact = c[y]*(x-lst);
    res+=fact*(nxt-x);
    res+=a[x][y]-a[x][z];
    s[y].insert(x);
    v[x]=y;
    cout<<res<<endl;
  }
}


signed main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    //srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(15);
    int t = 1;
   //cin >> t;

    while (t--)
        solve();
#ifdef aa
    cout << endl << endl << endl << endl << "Time elapsed: " << (double)(clock() - clk) / CLOCKS_PER_SEC << endl;
#endif
    return 0;
}







int powm(int a, int b) {
    int res = 1;
    while (b) {
        if (b & 1)
            res = (res*a) % mod;
        a = (a * a) % mod;
        b >>= 1;
    }
    return res;
}

int divide(int a, int b) {
    return (a % mod) * powm(b, mod - 2) % mod;
}

int norm(int a) {
    while (a >= mod) a -= mod;
    while (a < 0) a += mod;
    return a;
}


int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}


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

int main(){
  int N;
  cin >> N;
  
  vector<int> A(N);
  int nega = 0;
  for (int i = 0; i < N; i++){
    int a;
    cin >> a;
    A.at(i) = abs(a);
    
    if (a < 0){
      nega++;
    }
  }

  sort(A.begin(), A.end());
  
  ll ans = 0;
  for (int i = 1; i < N; i++){
    ans += A.at(i);
  }
  
  if (nega % 2 == 0){
    ans += A.at(0);
  }
  else{
    ans -= A.at(0);
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3776
main = do
    [a,b] <- return . map (read::String->Int) . words =<< getLine
    let chk
	 | a*b <= 0  = "Zero"
	 | 0 < a     = "Positive"
	 | otherwise = let
			sz = b-a+1
		       in
			if sz`mod`2/=0
			    then "Negative"
			    else "Positive"
    putStrLn chk

Measured memory_bytes: 508
# encoding:utf-8
import copy
import numpy as np
import random
#

# n,q = map(int,input().split())
# s = list(str(input()))
# L = []
# for i in range(q):
#     l,r = map(int,input().split())
#     L.append([l,r])
#
# # count_ac = np.zeros([n])
# count_ac = []
# count = 0
# i = 0
# while i < n-1:
#     if s[i] == "A" and s[i+1] == "C":
#         count_ac.append(count)
#         count += 1
#         count_ac.append(count)
#         i += 2
#     else:
#         count_ac.append(count)
#         i += 1
#
# count_ac.append(count)
#
#
# # print(count_ac)
# for i in range(q):
#     ans = count_ac[L[i][1]-1]-count_ac[L[i][0]-1]
#     print(int(ans))

N,Q = map(int,input().split())
S = input()
t = [0 for i in range(N+1)]
for i in range(N):
    t[i+1] = t[i] + (1 if S[i:i+2]=="AC" else 0)
for i in range(Q):
    l,r = map(int,input().split())
    print(t[r-1]-t[l-1])


Measured memory_bytes: 17856
IDENTIFICATION                   DIVISION.
PROGRAM-ID.                      ABC_092_A.
ENVIRONMENT                      DIVISION.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 A      PIC 9(4).
    01 B      PIC 9(4).
    01 C      PIC 9(4).
    01 D      PIC 9(4).

    01 X      PIC 9(4).
    01 Y      PIC 9(4).

    01 ZS     PIC Z(5).
    01 ans    PIC X(4).
    01 DUMMY  PIC X(1).
PROCEDURE                        DIVISION.
MAIN.
    ACCEPT A.
    ACCEPT B.
    ACCEPT C.
    ACCEPT D.

    MOVE FUNCTION MIN(A, B) TO X.
    MOVE FUNCTION MIN(C, D) TO Y.

    ADD X TO Y.

    MOVE Y TO ZS.

    PERFORM UNANS.

    DISPLAY ans(1:FUNCTION STORED-CHAR-LENGTH(ans)).
    STOP RUN.

UNANS                            SECTION.
    UNSTRING
        ZS DELIMITED BY ALL SPACE
        INTO DUMMY ans
    END-UNSTRING.


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

using namespace std;

#define YES cout << "YES" << endl;
#define NO  cout << "NO"  << endl;
#define Yes cout << "Yes" << endl;
#define No  cout << "No"  << endl;
 
#define INF INT_MAX
#define MOD 1000000007
#define PI  acos(-1)

using ll  = long long;
using ull = unsigned long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

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

int main(int argc, char *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    string s;
    cin >> s;

    string ans = "";
    rep (i, s.size()) {
        ans += "x";
    }

    cout << ans << endl;
    return 0;
}

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

int main() {
  int N , a;
  cin >> N;
  vector<int> vec(N);
  int ans = 0;

  for(int i = 0; i < N; i++){
    cin >> a;
    vec.at(i) = a;
  }
  
  sort(vec.begin(), vec.end());
  reverse(vec.begin(), vec.end());
  
  int alice = 0;
  int bob = 0;
  for(int i = 0; i < vec.size(); i++){
    if( i % 2 == 0 ){
      alice += vec.at(i);
    } else {
      bob += vec.at(i);
    }
  }
  
  cout << alice - bob << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
 
int main(){
    const int max = 20;
     
    int num_of_fig;
    std::cin >> num_of_fig;
    std::vector<int> formula(num_of_fig);
    for(int i = 0; i < num_of_fig; ++i){
        std::cin >> formula[i];
    }
     
    std::vector<std::vector<unsigned long long>> total(num_of_fig);
    for(int i = 0; i < num_of_fig; ++i){
        total[i].resize(max+1, 0);
    }
    total[0][formula[0]] = 1;
     
    for(int i = 0; i < num_of_fig - 2; ++i){
        for(int j = 0; j <= max; ++j){
            if(j + formula[i+1] <= max){
                total[i+1][j + formula[i+1]] += total[i][j];
            }
            if(j - formula[i+1] >= 0){
                total[i+1][j - formula[i+1]] += total[i][j];
            }
        }
    }
     
    std::cout << total[num_of_fig - 2][formula[num_of_fig - 1]] << std::endl;
     
    return 0;
}

Measured memory_bytes: 1212
import collections

n = int(input())
s = [input() for _ in range(n)]
m = int(input())
t = [input() for _ in range(m)]

counter1 = collections.Counter(s)
counter2 = collections.Counter(t)
ans = max(counter1[k] - counter2[k] for k in counter1)
print(max(ans, 0))

Measured memory_bytes: 3316
def main():
    odd = False
    even = False

    odds = []
    evens = []
    for i, s in enumerate(list(input())):
        if i % 2 == 0:
            evens.append(s in ['R', 'U', 'D'])
        else:
            odds.append(s in ['L', 'U', 'D'])

    odd = odds.count(False) == 0
    even = evens.count(False) == 0

    r = 'No'
    if odd and even:
        r = 'Yes'

    print(r)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#include <cassert>
#include <functional>
#include <numeric>
#include <limits>
#include <iomanip>
#include <queue>
#include <cmath>
#include <math.h>
#include <map>
#include <string>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const long long INF = 1LL << 60;
using pll = pair<long long, long long>;
#define min(a, b) ((a) < (b) ? (a) : (b))
#define max(a, b) ((a) > (b) ? (a) : (b))


long long res = 0;
long long fnc(long long x) {

    ++res;
    if (x == 4 || x == 2 || x == 1) {
        res += 3;
        return res;
    }

    if (x % 2 == 0) {
        x /= 2;
    }
    else {
        x = 3 * x + 1;
    }


    return fnc(x);
}

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

    long long S; cin >> S;

    cout << fnc(S) << endl;

 	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
const int Nmax = 1000000;
int N;
ll C, K, T[Nmax];

int main(){
	cin >> N >> C >> K;
	for(int i=0; i<N; i++) cin >> T[i];
	sort(T, T+N);

	int ans = 1;
	ll last = T[0];
	ll count = 1;
	for(int i=1; i<N; i++){
		if(T[i] > last+K || count==C){
			ans++;
			last = T[i];
			count = 1;
		}
		else{
			count++;
		}
	}
	
	cout << ans << endl;

	return 0;
}


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

#define FOR( i, m, n )   for( int i = m; i < n; i++ )
#define REP( i, n )      FOR( i, 0, n )
#define ALL( a )         (a).begin(), (a).end()

int main(){
  string name;
  cin >> name;
  if( name == "ani" ) cout << "square1001" << endl;
  else cout << "e869120" << endl;

}



Measured memory_bytes: 3144
#include <iostream>
#include <sstream>
#include <fstream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstdio>
#include <numeric>
#include <string.h>
#define rep(i, x) for (int i = 0; i < (int)(x); i++)
#define repn(i, x) for (int i = 1; i <= (int)(x); i++)
#define repr(i, x) for (int i = ((int)(x) - 1); i >= 0; i--)
#define reprn(i, x) for (int i = ((int)(x)); i > 0; i--)
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long int64;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const long long  INFL = 1e18;
const int MOD = 1000000007;
void solve() {
	int a, b; cin >> a >> b;
	int sum = a;
	int ans = 1;
	if (b == 1) {
		cout << 0 << endl;
		return;
	}
	if (a >= b) {
		cout << 1 << endl;
		return;
	}
	while (sum < b) {
		sum += (a - 1);
		ans++;
	}
	cout << ans << endl;
	return;
}

int main() {
	solve();
  return 0;
}

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

#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for(int i = m; i < (n); ++i)
#define pb push_back
#define ALL(c) (c).begin(), (c).end()

typedef vector<int> vi;

bool prime[300000];

int main()
{
    int n;
    fill_n(prime, 300000, true);
    prime[0] = prime[1] = false;
    rep2(i, 2, 300000) if(prime[i])
        for(int j = i*2; j < 300000; j+=i)
            prime[j] = false;
    vi p;
    rep(i, 300000) if(prime[i]) p.pb(i);
    while(cin >> n && n)
        cout << upper_bound(ALL(p), 2*n) - upper_bound(ALL(p), n) << endl;
}

Measured memory_bytes: 0
n,q=map(int,input().split())
s=input()
l=[]
r=[]
for i in range(q):
    a,b=map(int,input().split())
    l.append(a)
    r.append(b)
i=0
k=[0]
while i <len(s)-1:
    if s[i]=="A" and s[i+1]=="C":
        k.append(k[i]+1)
    else:
        k.append(k[i])
    i+=1
k.append(k[i])
for j in range(q):
    print(k[r[j]-1]-k[l[j]-1])


Measured memory_bytes: 14212
/*

                                  In the name of Allah, Most Gracious, Most Merciful


*/
#include<bits/stdc++.h>
#include<numeric>
using namespace std;

//*** constant value ***
const long double PI = 3.141592653589793238;
const double EPS = 1e-6 ;
//*** constant value ***

//****** define ********
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define dd double
#define vll vector<ll>
#define vs vector<string>
#define fn(i,n) for(ll i = 0; i<n; i++)
#define f(i,a,b) for(i=a;i<b;i++)
#define f1(i,a,b) for(i=b-1;i>=a;i--)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pls pair<ll,string>
#define vpl vector<pll>
#define pb push_back
#define mk make_pair
#define x first
#define y second
#define tt cout<<"Came here"<<endl;
//****** define ********

int main()
{
    IOS;
    ll n;
    cin>>n;
    if(n>=30)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;

return 0;
}



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

// 1ブロックごとに必ず1回は全部消すことになる→全部消した後の始点の推移を書く？

vector<int> v[200001]; // v[n]には A_k = n となるkが入ってる, ソート済みなので二分探索で値がlog n

// v[i] の k = j の index を二分探索で取得
int biSearch(int i, int j){
    int lb=0, ub = v[i].size() - 1;
    while( v[i][ub] != j ){
        int mid = (lb+ub)/2;
        if( v[i][mid] >= j){
            ub = mid;
        }else{
            lb = mid;
        }
    }
    return ub;
}

int main() {
    int N;
    ll K;
    cin >> N >> K;
    vector<int>A(N);
    for (int i = 0; i < N; ++i) {
      cin >> A[i];
      v[A[i]].push_back(i);
    }

    vector<int> ans; // 最初に1周するまで各kの出力の始点を保存(線形で出力が求まる)
    int s = 0; // 始点

    while (true){
        int index = biSearch(A[s], s);
        if(index == v[A[s]].size() - 1) {
            ans.push_back(s);
            s = v[A[s]][0] + 1;

            // 単独で末尾の場合
            if(s == N){
                ans.push_back(-1);
                break;
            }
        }else {
            if(v[A[s]][index+1] + 1 == N){
                ans.push_back(-1);
                break;
            }else {
                s = v[A[s]][index+1] + 1;
            }
        }
    }
    K = (K-1) % ans.size();
    int i = ans[K];
    if(i != -1){
        while (i != N){
            int index = biSearch(A[i], i);
            if(index != v[A[i]].size() - 1) {
                i = v[A[i]][index+1] + 1;
            }else{
                cout << A[i] << " ";
                i++;
            }
        }
    }

    return 0;
}

Measured memory_bytes: 14072
#include<iostream>
using namespace std;
int main(){
  while(true){
    int xsize,ysize;
    cin>>xsize>>ysize;
    if(!xsize&&!ysize)break;
    int course[xsize+2][ysize];
    for(int y=0;y<ysize;y++){
      for(int x=0;x<xsize;x++){
	cin>>course[x+1][y];
      }
    }
    int pattern[xsize+2][ysize+1];
    for(int y=0;y<ysize;y++){
      for(int x=0;x<xsize+2;x++){
	if(y) pattern[x][y] = 0;
	else if(course[x][y]) pattern[x][y] = 0;	    
	else pattern[x][y] = 1;
      }
    }
    pattern[0][0] = 0;
    pattern[xsize+1][0] = 0;
    int count = 0;
    for(int y=0;y<ysize;y++){
      for(int x=1;x<xsize+1;x++){
	if(course[x][y]==0){
	  if(y==ysize-1) count+=pattern[x][y];
	  else{
	    if(course[x-1][y+1]==0)
	      pattern[x-1][y+1] += pattern[x][y];
	    if(course[x][y+1]!=1)
	      pattern[x][y+1] += pattern[x][y];
	    if(course[x+1][y+1]==0)
	      pattern[x+1][y+1] += pattern[x][y];
	  }
	}
	if(course[x][y]==2){
	  if(y==ysize-2) count+= pattern[x][y];
	  else if(y==ysize-1) count+= pattern[x][y];
	  else pattern[x][y+2] += pattern[x][y];
	}
      }
    }
    cout<<count<<endl;
  }
  return 0;
}

Measured memory_bytes: 0