akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double Double;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

// chmax, chmin
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;
}

void solve(long long N) {
    cout << (N+1) / 2 << endl;
}

int main() {
  long long N;
  scanf("%lld", &N);
  solve(N);
  return 0;
}


Measured memory_bytes: 256
# coding: utf-8
while 1:
    n=int(input())
    if n==0:
        break
    dic={}
    data=[]
    for i in range(n):
        data.append(input())
        data[i]=''.join([data[i][j] for j in range(len(data[i])) if j==0 or data[i][j-1] in 'aiueo'])
    l=0
    r=51
    while 1:
        mid=(l+r)//2
        st=set()
        for i in range(n):
            st.add(data[i][:mid])
        if len(st)==n:
            r=mid
        else:
            l=mid
        if (l+r)//2==mid:
            break
    print(r if r!=51 else -1)
        




Measured memory_bytes: 5632
#include<bits/stdc++.h>
using namespace std;
#define il inline
#define gc getchar()
#define ri register int
#define rb register bool
#define rc register char
#define rp(i,x,y) for(ri i=x;i<=y;++i)
#define my(i,x,y) for(ri i=x;i>=y;--i)

const int N=5e5+10,inf=1e9;
int len,dis[N],pre[N];
struct node{int to[26];node(){memset(to,0,sizeof(to));}}nod[N];
char str[N];
vector<int>V[26];

il int read()
{
	rc ch=gc;ri x=0;rb y=1;
	while(ch!='-' && (ch>'9' || ch<'0'))ch=gc;
	if(ch=='-')ch=gc,y=0;
	while(ch>='0' && ch<='9')x=(x<<1)+(x<<3)+(ch^'0'),ch=gc;
	return y?x:-x;
}
void print(ri x){if(!x)return;print(pre[x]);printf("%c",str[x]);}
il int upp(ri x,ri y)
{
	ri l=0,r=V[x].size()-1;
	while(l<r)
	{
		ri mid=(l+r)>>1;if(V[x][mid]>y)r=mid;else l=mid+1;
	}
	return l;
}

int main()
{
	//freopen("B.in","r",stdin);freopen("B.out","w",stdout);
	scanf("%s",str+1);len=strlen(str+1);
	rp(i,1,len)V[str[i]-'a'].push_back(i);rp(i,0,25)V[i].push_back(inf);
	rp(i,1,len)
	{
		rp(j,0,25){ri to=upp(j,i);if(V[j][to]!=inf)nod[i].to[j]=V[j][to];}
	}
	rp(i,0,25)if(V[i][0]!=inf)nod[0].to[i]=V[i][0];
	//QwQ
	//rp(i,1,len)rp(j,0,25)printf("nod[%d].to[%d]=%d\n",i,j,nod[i].to[j]);
	//QwQ
	queue<int>Q;memset(dis,63,sizeof(dis));
	rp(i,0,25)if(nod[0].to[i])Q.push(nod[0].to[i]),dis[nod[0].to[i]]=1;else return printf("%c",(char)('a'+i)),0;
	while(!Q.empty())
	{
		ri nw=Q.front();Q.pop();
		rp(i,0,25)
		{ri t=nod[nw].to[i];if(t){if(dis[t]>dis[nw]+1)dis[t]=dis[nw]+1,pre[t]=nw,Q.push(t);}else return print(nw),printf("%c",(char)('a'+i)),0;}
	}
	return 0;
}


Measured memory_bytes: 56192
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define double long double
using datas=pair<ll,ll>;
using ddatas=pair<double,double>;
using tdata=pair<ll,datas>;
using vec=vector<ll>;
using mat=vector<vec>;
using pvec=vector<datas>;
using pmat=vector<pvec>;
#define For(i,a,b) for(i=a;i<(ll)b;i++)
#define bFor(i,a,b) for(i=a;i>=(ll)b;i--)
#define rep(i,N) For(i,0,N)
#define rep1(i,N) For(i,1,N)
#define brep(i,N) bFor(i,N-1,0)
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define vsort(v) sort(all(v))
#define vrsort(v) sort(allr(v))
#define endl "\n"
#define pb push_back
#define print(v) cout<<v<<endl
#define printyes cout<<"Yes"<<endl
#define printno cout<<"No"<<endl
#define printYES cout<<"YES"<<endl
#define printNO cout<<"NO"<<endl
#define output(v) do{bool f=0;for(auto outi:v){cout<<(f?" ":"")<<outi;f=1;}cout<<endl;}while(0)
const ll mod=1000000007;
const ll inf=1LL<<60;
const double PI = acos(-1);
const double eps = 1e-9;
template<class T> inline bool chmax(T& a,T b){bool x=a<b;if(x)a=b;return x;} 
template<class T> inline bool chmin(T& a,T b){bool x=a>b;if(x)a=b;return x;} 

void startupcpp(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
}

double distance(ddatas x,ddatas y){
  double a=x.first-y.first,b=x.second-y.second;
  return sqrt(a*a+b*b);
}

ll modinv(ll a) {
  ll b=mod,u=1,v=0,t;
  while(b){
    t=a/b;
    a-=t*b; swap(a,b);
    u-=t*v; swap(u,v);
  }
  return (u+mod)%mod;
}

ll moddevide(ll a,ll b){return (a*modinv(b))%mod;}

vec modncrlistp,modncrlistm;

ll modncr(ll n,ll r){
  ll i,size=modncrlistp.size();
  if(size<=n){
    modncrlistp.resize(n+1);
    modncrlistm.resize(n+1);
    if(!size){
      modncrlistp[0]=modncrlistm[0]=1;
      size++;
    }
    For(i,size,n+1){
      modncrlistp[i]=modncrlistp[i-1]*i%mod;
      modncrlistm[i]=modinv(modncrlistp[i]);
    }
  }
  return modncrlistp[n]*modncrlistm[r]%mod*modncrlistm[n-r]%mod;
}

ll modpow(ll a,ll n){
  ll res=1;
  while(n){
    if(n&1)res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

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

ll countdigits(ll n){
  ll ans=0;
  while(n){n/=10;ans++;}
  return ans;
}

ll sumdigits(ll n){
  ll ans=0;
  while(n){ans+=n%10;n/=10;}
  return ans;
}

int main(){
  // startupcpp();
  // ll test;cin>>test;while(test--){
  ll i,j,N,H,W,ans;
  cin>>H>>W>>N;
  ans=max(H,W);
  cout<<(N+ans-1)/ans<<endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<cstdio>
using namespace std;
int main(){
	float x1,x2,x3, h ,h2, s , l;
	while(cin>>x1>>h){
		if(x1==0&&h==0)break;
		x2 = x1 / 2;
		x3=pow(x2,2);
		h2=pow(h ,2);
		x2 += h2;
		s =sqrt(x3+h2);
		
		l = (x1*s)/2;
		printf("%f\n",((4*l)+(x1)*(x1)));
	}
}

Measured memory_bytes: 0
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
 
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;
 
typedef pair<int, int> pi;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
 
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;
 
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;
 
#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
 
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
 
const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001; //check the limits, dummy
 
int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);    
	
	int N; cin >> N;
	FOR(i, 1, 10) {
		FOR(j, 1, 10) {
			if (i*j == N) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	
	
	return 0;
}
 
// read the question correctly (ll vs int)
// template by bqi343


Measured memory_bytes: 256
import java.io.IOException;
import java.util.Arrays;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws IOException {

		new Main().run();
	}

	private void run() throws IOException {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			d = scanner.nextInt();
			n = scanner.nextInt();
			if ((d | n) == 0)
				break;
			aer = new AER[n];
			for (int i = 0; i < n; i++) {
				aer[i] = new AER(scanner.nextInt(), scanner.nextInt(),
						scanner.nextInt());
			}
			dp = new int[d + 1][101];
			for (int[] dpp : dp)
				Arrays.fill(dpp, INF);
			PriorityQueue<AER> pq = new PriorityQueue<AER>();
			pq.offer(new AER(d, 0, 0));
			ans = INF;
			while (!pq.isEmpty()) {
				AER now = pq.poll();
				if (now.a == 0) {
					ans = Math.min(ans, now.r);
					continue;
				}
				if (ans - 1 <= now.r)
					continue;
				for (AER a : aer) {
					if (now.e < a.r)
						continue;
					int nhp = Math.max(0, now.a - a.a);
					int nexp = Math.min(100, now.e + a.e);
					if (now.a == nhp && now.e == nexp)
						continue;
					if (dp[nhp][nexp] <= now.r + 1)
						continue;
					dp[nhp][nexp] = now.r + 1;
					pq.offer(new AER(nhp, nexp, now.r + 1));

				}
			}
			System.out.println(ans == INF ? "NA" : ans);
		}
	}

	int d, n;
	int[][] dp;
	int INF = 1 << 30;
	AER[] aer;
	int ans;

	class AER implements Comparable<AER> {
		int a, e, r;

		public AER(int a, int e, int r) {
			super();
			this.a = a;
			this.e = e;
			this.r = r;
		}

		@Override
		public String toString() {
			return "AER [a=" + a + ", e=" + e + ", r=" + r + "]";
		}

		@Override
		public int compareTo(AER o) {
			if (this.a == o.a)
				return this.r - o.r;
			return this.a - o.a;
		}
	}
}

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

#define rep(i,n) for(int i=0; i<n ; ++i)
#define REP(i,a,b) for(int i=a; i<b; ++i)
#define all(v) (v).begin() , (v).end()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvc = vector<vector<char>>;
using pii = pair<int , int>;
using pll = pair<long long , long long>;

//プロトタイプ宣言
void faster(void);
template <class T>
T gcd(T , T);
template <class T>
T get_digent(T);
template <class T>
T POW(T , T);



int main(){
  faster();
  ll n,k;
  cin >> n >> k;
  vl h(n);
  rep(i,n) cin >> h[i];
  sort(all(h));
  ll ans = 0;
  rep(i,n-k) ans += h[i];
  cout << ans << endl;
}



























//同期解除
void faster(void){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
}

//ユークリッドの互除法
template <class T>
T gcd(T a, T b) {
  return (b ? gcd(b, a%b) : a);
} 

//桁数取得
template <class T>
T get_digent(auto x){
  string s;
  s = to_string(x);
  ll digent = s.size();
  return digent;
} 

//べき乗計算
template <class T>
T POW(T x, T y){
  if(y==0) return 1;
  if(y%2 == 1){
    ll temp = POW(x,y-1);
    return (temp*x);
  }
  else{
    ll temp = POW(x,y/2);
    return temp*temp;
  }
} 



Measured memory_bytes: 1792
import java.util.*;
class Main{
	public static void main(String[] args){
    	Scanner scan = new Scanner(System.in);
      	int word = scan.nextInt();
      	int last = word%100;
        int first = (word - last)/100;
      	
      	if(jadmon(last)*jadmon(first) == 1){
        	System.out.println("AMBIGUOUS");
        } else if(jadmon(first)== 1 && jadmon(last)==0){
        	System.out.println("MMYY");
        } else if(jadmon(first)==0 && jadmon(last) == 1){
        	System.out.println("YYMM");
        } else {
        	System.out.println("NA");
        }
      	
    }
  	public static int jadmon(int n){
    	if(n>0 && n<13){
        	return 1;
        } else {
        	return 0;
        }
    }
}


Measured memory_bytes: 20692
#include<stdio.h>
#include<algorithm>
using namespace std;
int s[110][210];
int t[110][210];
int main(){
	int a,b;
	scanf("%d%d",&a,&b);
	if(a*(a-1)/2<b*(a-1)){
		printf("-1\n");return 0;
	}
	for(int i=0;i<b;i++){
		for(int j=0;j<i;j++){
			s[j][i*2-1]=j;
			t[j][i*2-1]=i*2;
			s[j][i*2]=i*2-j-1;
			t[j][i*2]=i*2+1;
		}
		for(int j=0;j<i;j++){
			s[i][j*2]=i*2-j-1;
			t[i][j*2]=i*2;
			s[i][j*2+1]=j;
			t[i][j*2+1]=i*2+1;
		}
		s[i][i*2]=i*2;
		t[i][i*2]=i*2+1;
	}
	for(int i=0;i<b;i++){
		if(i)printf("\n");
		for(int j=0;j<b*2-1;j++)printf("%d %d\n",1+s[i][j],1+t[i][j]);
		for(int j=b*2;j<a;j++)printf("%d %d\n",j+1,i+1);
	}
}

Measured memory_bytes: 1192
/*
title:

url:
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <string>
#include <utility>
#include <cstring>
#include <map>
#include <cmath>

using namespace std;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define INF 1000000007

typedef pair<int, int> pint;
typedef long long ll;

int main()
{
    int a, b, k;
    cin >> a >> b >> k;
    vector<int> ans;
    for (int i = a; i <= b; i++)
    {
        if (i <= a + k - 1 || i >= b - k + 1)
        {
            ans.push_back(i);
        }
    }
    sort(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++)
    {
        cout << ans[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr double eps = 1e-9;
constexpr ll MOD = 1000000007LL;
template <typename T> bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T> bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
    for (int i = 0; i < v.size(); i++) {
        os << v[i] << (i + 1 == v.size() ? "\n" : " ");
    }
    return os;
}
template <typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) {
    t = v;
}
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) {
    for (auto &e : t) {
        fill_v(e, v);
    }
};
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int n = s.length();
    auto dp = make_v<int>(n + 1, 3);
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < 3; j++) {
            dp[i][j] = -INF;
            if (i - j - 1 == -1) {
                dp[i][j] = 1;
                continue;
            } else if (i - j - 1 < -1) {
                continue;
            }
            for (int k = 0; k < 3; k++) {
                if (i - j - k - 1 < 0) {
                    break;
                }
                if (s.substr(i - j - 1 - k, k + 1) != s.substr(i - j, j + 1)) {
                    chmax(dp[i][j], dp[i - j - 1][k] + 1);
                }
            }
           // cout << i << " " << j << " " << dp[i][j] << endl;
        }
    }
    cout << max({dp[n - 1][0], dp[n - 1][1], dp[n - 1][2]}) << endl;
}


Measured memory_bytes: 11412
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,a,b,c,d;
char s[200005];
bool x,y;
int main(){
	cin >> n >> a >> b >> c >> d;
	scanf("%s",s+1);
	for(int i=a+1;i<max(c,d)-1;i++)
		if(s[i]=='#' and s[i+1]=='#')x=true;
	for(int i=b-1;i<d;i++)
		if(s[i]=='.' and s[i+1]=='.' and s[i+2]=='.')y=true;
	if(!x and(c<d or y))cout << "Yes";
	else cout << "No";
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
const int INF = 1<<30;
bool m[2020]={};
int main(){
  int l, r;cin>>l>>r;
  if(2019*(l/2019)+2019<=r){
  	r %= 2019;
    r += 2019;
    l %= 2019;
  }else{
  	r %= 2019;
    l %= 2019;
  }
  for(int i=l;i<=r;i++){
    m[i%2019]=true;
  }
  int ans=INF;
  for(int i=0;i<2019;i++){
    if(!m[i])continue;
  	for(int j=0;j<i;j++){
      if(!m[j])continue;
      ans=min(ans, (i*j)%2019);
    }
  }
  cout<<ans<<endl;
}

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

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

	int N;
	pair<int, int> x_i[500];
	int ans[500 * 500] {};

	cin >> N;
	for (int j = 0; j < N; ++j)
	{
		int x, i;
		cin >> x;
		i = j + 1;

		x_i[j].first = x;
		x_i[j].second = i;

		ans[x - 1] = i;
	}

	sort(begin(x_i), begin(x_i) + N);

	bool is_exist = true;

	int index = 0;
	for (int j = 0; j < N; ++j)
	{
		int x = x_i[j].first;
		int i = x_i[j].second;

		for (int k = 0; k < i - 1; ++k)
		{
			while (ans[index] != 0)
				index++;
			if (index >= x - 1)
			{
				is_exist = false;
				goto OUTPUT;
			}
			ans[index] = i;
			index++;
		}
	}

	index = N*N - 1;
	for (int j = N - 1; j >= 0; --j)
	{
		int x = x_i[j].first;
		int i = x_i[j].second;

		for (int k = 0; k < N - i; ++k)
		{
			while (ans[index] != 0)
				index--;
			if (index <= x - 1)
			{
				is_exist = false;
				goto OUTPUT;
			}
			ans[index] = i;
			index--;
		}
	}

OUTPUT:
	if (!is_exist)
		cout << "No" << endl;
	else
	{
		cout << "Yes" << endl;
		for (int i = 0; i < N*N; ++i)
		{
			cout << ans[i];
			if (i != N*N - 1)
				cout << ' ';
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ar array
 
const int mxN=2e3;
int n, x, y, ans[mxN];
 
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
 
	cin >> n >> x >> y, --x, --y;
	for(int i=0; i<n; ++i) {
		for(int j=i+1; j<n; ++j) {
			int d=min(j-i, abs(i-x)+1+abs(j-y));
			++ans[d];
		}
	}
	for(int i=1; i<n; ++i)
		cout << ans[i] << "\n";
}

Measured memory_bytes: 3668
import copy
H,W,K=map(int,input().split())
List = []
for i in range (H):
  List.append(list((input())))
res = 0
List2 = copy.deepcopy(List)
List3 = copy.deepcopy(List)

                   
def checkBlack(listA, check):
  inter =0
  for k in range(H):
    inter += listA[k].count("#")
  if check == inter:
    return True
  else:
    return False
  
#横は塗らずに縦だけ塗る
def paintH(listB,k):
  for i in range(H):
    listB[i][k] = 0
  return listB

#縦は塗らずに横だけ塗る
def paintW(listB,k):
  for i in range(W):
    listB[k][i] = 0
  return listB

for bits in range(2**W):
  for j in range(W):
    if((bits>>j) & 1): 
      List3 = paintH(List2,j)
  List4 = copy.deepcopy(List3)  
  for bits2 in range(2**H):
    for l in range(H):
      if((bits2>>l) & 1): 
        List2 = paintW(List4,l)
    if checkBlack(List4,K):
      res +=1
    List4 = copy.deepcopy(List3)
  List2 = copy.deepcopy(List)
print(res)

Measured memory_bytes: 9264
printn = lambda x: print(x,end='')
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 10**18
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

h,w = inm()
s = []
for i in range(h):
    s.append(ins())
a = [[0]*w for i in range(h)]
dir = [(0,1),(0,-1),(1,0),(-1,0)]
id = 0
for i in range(h):
    for j in range(w):
        if a[i][j]!=0:
            continue
        id += 1
        a[i][j] = id
        q = [(i,j)]
        while len(q)>0:
            x,y = q.pop()
            c = s[x][y]
            for d in dir:
                u = x+d[0]
                v = y+d[1]
                if 0<=u<h and 0<=v<w and \
                   a[u][v]==0 and s[u][v]!=c:
                    a[u][v] = id
                    q.append((u,v))
bk = [0]*(id+1)
wh = [0]*(id+1)
for i in range(h):
    for j in range(w):
        if s[i][j]=='#':
            bk[a[i][j]] += 1
        else:
            wh[a[i][j]] += 1
print(sum([bk[i]*wh[i] for i in range(1,id+1)]))


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


int main()
{
	int n,x,ans=0;
	string s;
	cin>>n>>s;
	for(int i=0;i<n;i++)
	{
		if(s[i]=='I')x++;
		else x--;
		ans=max(ans,x);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
# python template for atcoder1
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

N = int(input())
s = input()[:-1]
ans = [1]*(N+2)


def print_ans(l: list):
    ret = ""
    for a in l[1:-1]:
        ret += "S" if a else "W"
    print(ret)


def next(ind: int, isSame: bool, isSheep: bool)->bool:
    return isSame ^ isSheep ^ ans[ind-1]


def check(first: bool, last: bool)->list:
    ans[0] = last
    ans[1] = first
    for i in range(1, N+1):
        ans[i+1] = next(i, s[i-1] == "o", ans[i])

    return ans[0] == ans[N] and ans[1] == ans[N+1]


for first in [True, False]:
    for last in [True, False]:
        if check(first, last):
            print_ans(ans)
            exit()
print("-1")


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

using namespace std;
using ll =long long;
using db = double;
using vll = vector<long long>;

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
#define SORT(a) sort((a).begin(),(a).end())
#define rSORT(a) reverse((a).begin(),(a).end())
#define For(i, a, b)    for(int i = (a) ; i < (b) ; ++i)
#define rep(i, n)       For(i, 0, n)
#define leftunique(a) {SORT(a);(a).erase(unique((a).begin(),(a).end()),(a).end());}
//leftuniqueは配列から同じ要素のものを取り除く 例 4 6 2 1 3 4 1 2 なら 1 2 3 4 6 になる
#define debug(x)  cout << #x << " = " << (x) << endl;
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
bool coY() {cout <<"Yes"<<endl;}
bool coN(){cout <<"No"<<endl;}
const int mod = 1e9 + 7;
const ll INF = 1LL << 60;
// a^n 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;
}
//グラフ用
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};	
//ここから書き始める

ll combination(ll n, ll i){
	ll count = 0;
	ll multi = 1;
	ll div =1;
	int limit = i;
	while(count < limit){
		multi *= n;
		n--;
		multi/= count+1;
		count ++ ;
	}
	return multi / div;
}

int main()
{
	cout <<setprecision(10);
	ll x ; cin >> x;
	
	ll ans = 0 ;
	ll sum = 0;
	for(ll i = 0 ; i < x ; i++){
		sum += i;
		if(sum >= x){
			ans = i ;
			cout << ans << endl;
			return 0;
		}
	}
	ans = x;
	cout << ans << endl;
			
}


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


int main()
{
    string s,s1,s2,s3,s4,s5;
    int i;
    cin>>s;
    s1=s;
    reverse(s.begin(),s.end());
    for(i=0; i<(s.length()-1)/2; i++)
        s2+=s1[i];
    for(i=(s.length()+3)/2-1; i<s.length(); i++)
        s3+=s1[i];
    s4=s2;
    s5=s3;
    reverse(s2.begin(),s2.end());
    reverse(s3.begin(),s3.end());
    if(s==s1&&s4==s2&&s5==s3)
        cout<<"Yes\n";
    else
        cout<<"No\n";
}


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

#define SIZE 100

struct Stack
{
    int top;
    int *list;
};

typedef struct Stack * Stack;

Stack createStack(int);
void push(Stack, int);
int pop(Stack);

int main(void)
{
    Stack s = createStack(SIZE);
    int cmd;
    while (scanf("%d", &cmd) != EOF)
        if (cmd)
            push(s, cmd);
        else
            printf("%d\n", pop(s));

    return 0;
}

Stack createStack(int size)
{
    Stack s = malloc(sizeof(struct Stack));
    s->top = 0;
    s->list = malloc(sizeof(int) * size);
    return s;
}

void push(Stack s, int x)
{
    s->list[s->top++] = x;
}

int pop(Stack s)
{
    return s->list[--s->top];
}




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

signed main() {
  int X, Y;
  cin >> X >> Y;

  int ans = 0;
  if (X == 1 && Y == 1) {
    ans += 400000;
  }

  if (X == 1) {
    ans += 300000;
  } else if (X == 2) {
    ans += 200000;
  } else if (X == 3) {
    ans += 100000;
  }

  if (Y == 1) {
    ans += 300000;
  } else if (Y == 2) {
    ans += 200000;
  } else if (Y == 3) {
    ans += 100000;
  }

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

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int A,B;

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>A>>B;
	cout<<B+(B-A)<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 892
#include <iostream>
using LL = long long int;
using namespace std;
int main(){
    int n,k;
    int *a;
    cin >> n >> k;
    a = new int[n];
    for(int i = 0;i < n;i ++){
        cin >> a[i];
    }
    for(int i = k;i < n;i++){
        if(a[i] > a[i - k]){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }
    }
    return 0;
}


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

bool check(string s) {
    int n = s.length();
    for (int i = 0; i < n; i++) {
        if (s[i] != s[n - 1 - i]) {
            return false;
        }
    }
    return true;
}

int main() {
    string S;
    cin >> S;
    int N = S.length();
    if (check(S) && check(S.substr(0, (N - 1) / 2)) && check(S.substr((N + 3) / 2 - 1))) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, char **argv)
{
    char a[128], b[128], c[128];
    scanf("%s %s %s", a, b, c);

    int i = 0;
    char *ps[3] = {a, b, c};
    while (1) {
        if (*ps[i] == '\0') {
            printf("%c\n", i+'A');
            break;
        }
        i = *(ps[i]++) - 'a';
    }
    return 0;
}



Measured memory_bytes: 128
n, k = map(int,input().split())
cities = list(map(lambda x:int(x)-1,input().split()))

footprint_L = list()
footprint_S = set()
i = 0
footprint_S.add(i)
footprint_L.append(i)
while cities[i] not in footprint_S:
    footprint_S.add(cities[i])
    footprint_L.append(cities[i])
    i = cities[i]

#print("terminal:", cities[i])


cyclestart = footprint_L.index(cities[i])
cyclelen = len(footprint_L) - cyclestart
#print(footprint_L)
#print(cyclestart, cyclelen)
#print((k-cyclestart) % cyclelen)
if k >= len(footprint_L):
    print(footprint_L[cyclestart+(k-cyclestart) % cyclelen]+1)
else:
    print(footprint_L[k]+1)


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

using namespace std;

int ans;
int n;
int st, ed, both;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		string s;
		cin >> s;
		if (s[0] == 'B') st++;
		if (*s.rbegin() == 'A') ed++;
		if (s[0] == 'B' && *s.rbegin() == 'A') both++;
		for (int i = 0; i < s.size() - 1; i++) {
			if (s[i] == 'A' && s[i+1] == 'B') ans++;
		}
	}
	st -= both;
	ed -= both;
	//cout << ans << ' ' <<  st << ' ' << ed << ' ' << both << '\n';;
	ans += min(st, ed);
	if (both) {
		ans += both-1;
		if (max(st, ed)) ans++;
	}
	cout << ans << '\n';
	return 0;
}



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

int main()
{
	long a;
	long b;
	char pm;
	long calc;

	cin >> a;
	cin >> pm;
	cin >> b;

	if( pm == '+' )
		calc = a + b;
	else
		calc = a - b;
	
	cout << calc << '\n';
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <map>
using namespace std;

int main() {
	int n,m,num;
	while (scanf("%d %d",&n,&m) && n != 0 && m != 0) {
		pair<int, int> place[m];
		for (int i=0; i<m; i++) {
			place[i].first = 0;
			place[i].second = i+1;
		}
		for (int i=0; i<n; i++) {
			for (int j=0; j<m; j++) {
				scanf("%d",&num);
				if (num == 1) place[j].first++;
			}
		}
		for (int i=0; i<m-1; i++) {
			for (int j=m-1; j>i; j--) {
				if (place[j].first>place[j-1].first) {
					swap(place[j], place[j-1]);
				}
			}
		}
		for (int i=0; i<m; i++) {
			if (i!=0) printf(" ");
			printf("%d",place[i].second);
		}
		printf("\n");
	}
}

Measured memory_bytes: 768
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
char a[8][8],b[8][8];
int main(){
rep(i,8)cin>>a[i];
rep(i,8)rep(j,8)b[j][7-i]=a[i][j];
cout<<"90"<<endl;
rep(i,8){rep(j,8){cout<<b[i][j];}cout<<endl;};

rep(i,8)rep(j,8)b[7-i][7-j]=a[i][j];
cout<<"180"<<endl;
rep(i,8){rep(j,8){cout<<b[i][j];}cout<<endl;};

rep(i,8)rep(j,8)b[7-j][i]=a[i][j];
cout<<"270"<<endl;
rep(i,8){rep(j,8){cout<<b[i][j];}cout<<endl;};

return 0;
}

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

using namespace std;

int main(){
    string S; long long K; cin >> S >> K; int one = 1;
    for (int i = 0; i < S.size() && i < K; i++){
        if (S[i] == '1') continue;
        else {cout << S[i] << endl; one = 0; break;}
    }

    if (one) cout << 1 << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define reps(i,s,n) for(int i=(s); i<(n); i++)
#define all(v) v.begin(),v.end()
#define outve(v) for(auto i : v) cout << i << " ";cout << endl
#define outmat(v) for(auto i : v){for(auto j : i) cout << j << " ";cout << endl;}
#define in(n,v) for(int i=0; i<(n); i++){cin >> v[i];}
#define out(n) cout << (n) << endl
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define infi 1900000000
#define infl 1100000000000000000
#define cyes cout << "Yes" << endl
#define cno cout << "No" << endl
#define csp << " " <<
#define outset(n) cout << fixed << setprecision(n);
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
template<typename T> using ve = vector<T>;
template<typename T> using pq2 = priority_queue<T>;
template<typename T> using pq1 = priority_queue<T,vector<T>,greater<T>>;




int main()
{
    string S;
    cin >> S;
    int K;
    cin >> K;
    ll N = int(S.length());
    
    ve<ve<vl>> dp(N+1,ve<vl>(2,vl(K+2,0)));
    dp[0][0][0] = 1;
    
    rep(i,N){
        int a = int(S[i]-'0');
        rep(j,2){
            rep(k,K+1){
                rep(x,(j ? 9 : a)+1){
                    if(x == 0){
                        dp[i+1][j || x < a][k] += dp[i][j][k];
                    }else{
                        dp[i+1][j || x < a][k+1] += dp[i][j][k];
                    }
                }
            }
            
            
            
        }
        
    }

    cout << dp[N][1][K] + dp[N][0][K] << endl;
    
    
    
    

    return 0;
}


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

int N;
vector<int> L;

void input() {
	scanf("%d", &N);
	for (int i(0); i < 2*N; ++i) {
		int t;
		scanf("%d", &t);
		L.emplace_back(t);
	}
}

int main() {
	input();
	sort(L.begin(), L.end());
	int sum(0);
	for (int i(0); i < N; ++i) {
		sum += L[2 * i];
	}
	printf("%d", sum);
	return 0;
}

Measured memory_bytes: 256
h,w,d = tuple(map(int,input().split()))

a = [[int(t)for t in input().split()]for _ in [0]*h]

pos = [0]*(h*w)

for i in range(h):
  for j in range(w):
    pos[a[i][j]-1] = (i,j)

cusum = [0]*d


for i in range(h*w-d):
  x,y = pos[i]
  z,w = pos[i+d]
  cost = abs(x-z)+abs(y-w)
  cusum.append(cusum[-d]+cost)

q = int(input())

for i in range(q):
  l,r = tuple(map(int,input().split()))
  l,r = l-1,r-1
  print(cusum[r]-cusum[l])

Measured memory_bytes: 18144
using System;

namespace C
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            var G = new int[15, 15];
            for (int i = 0; i < 15; i++) { for (int j = 0; j < 15; j++) { G[i, j] = -1; } }
            for (int i = 0; i < n; i++)
            {
                int m = int.Parse(Console.ReadLine());
                for (int j = 0; j < m; j++)
                {
                    string[] In = Console.ReadLine().Split(' ');
                    int a = int.Parse(In[0]);
                    int x = int.Parse(In[1]);
                    a--;
                    G[i, a] = x;
                }
            }
            int ans = 0;
            //参加者各々が正しい正しくないの全通りを試す
            for (int i = 0; i < (1 << n); i++)//1<<0=1 1<<1=2 1<<2=4　なので1<<nはn+1桁の2進数で表せる最大の数
            {
                var d = new int[n];
                for (int j = 0; j < n; j++)
                {
                    if (((i >> j) & 1) == 1) { d[j] = 1; }//iのjビット目が１か
                }
                bool ok = true;
                for (int j = 0; j < n; j++)
                {
                    if (d[j] == 1)
                    {
                        for (int k = 0; k < n; k++)
                        {
                            if (G[j, k] == -1) continue;
                            if (G[j, k] != d[k]) ok = false;
                        }
                    }
                }
                if (ok) ans = (int)Math.Max(ans, CountBit1(i));
            }
            Console.WriteLine(ans);
        }
        public static int CountBit1(int n)
        {
            string str="";
            while (n != 0)
            {
                str += n % 2;
                n /= 2;
            }
            int cnt = 0;
            foreach(var s in str)
            {
                if (s == '1') cnt++;
            }
            return cnt;
        }
    }
}


Measured memory_bytes: 45772
import sys
a = input().split()

L = int(a[0])
R = int(a[1])
if R - L == 2019:
  print(0)
  sys.exit()

mm = 2018

for i in range(L , R + 1):
  for j in range(L , R + 1):
    if i < j:
      n = (i * j) % 2019
      if n == 0:
        print(0)
        sys.exit()
      elif n < mm:
        mm = n
print (mm)

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

#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, n, m) for(int (i) = (n); (i) < (m); ++(i))

constexpr int INF = 1e9;
//constexpr ll INF = 1LL<<61;
constexpr ll mod = 1e9+7;

int ans = 0;
int N, M, Q;
vector<int> a, b, c, d;
vector<int> A;
void dfs(int depth){
  if(depth == N){
    int v = 0;
    REP(i, Q){
      if(A[b[i]]-A[a[i]] == c[i]){
        v += d[i];
      }
    }
    ans = max(ans, v);
    return;
  }
  int s = 1;
  if(depth != 0){
    s = A[depth-1];
  }
  FOR(i, s, M+1){
    A[depth] = i;
    dfs(depth+1);
  }
}

int main(){
  cin >> N >> M >> Q;
  a.resize(Q), b.resize(Q), c.resize(Q), d.resize(Q);
  A.resize(N);
  REP(i, Q){
    cin >> a[i] >> b[i] >> c[i] >> d[i];
    a[i]--, b[i]--;
  }
  dfs(0);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3472
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
 string s,r;
  cin>>s>>r;
  long long int a=0;
  for(long long int i=0;i<=s.size();i++)
  {
    if(s[i]!=r[i])
      a=a+1;
      else 
      continue;
  }
  cout<<a;

  return 0;
}

Measured memory_bytes: 3908
#include <stdio.h>
#include <math.h>
int  pow2(int);
int main(){
  int N,M;
  scanf("%d%d",&N,&M);
  int per = (N-M)*100;
  int inper = M*1900;
  int ans = (per+inper)*pow2(M);
  printf("%d",ans);
}

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


Measured memory_bytes: 128
#include<stdio.h>
int main()
{
    long int i,n,a,b[100001];
    scanf("%li",&n);
    for(i=1;i<=n;i++){
            scanf("%li",&a);
            b[a]=i;
    }
    for(i=1;i<=n;i++){
        printf("%li ",b[i]);
    }
    return 0;
    }

Measured memory_bytes: 1536
#include<iostream>
#include<stdio.h>
#include<math.h>

using namespace std;

int main()
{
    int a,b;
    cin >> a >> b ;
    if (a==1)
        a=14;
    if(b==1)
        b=14;
    if(a>b)
        cout << "Alice" << endl ;
    else if (a<b)
        cout << "Bob" << endl ;
    else
        cout << "Draw" << endl ;
    return 0;

}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

    private static int N;
    private static int[] P;
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        N = sc.nextInt();
        
        P = new int[N];
        for(int i=0;i<N;i++) {
            P[i] = sc.nextInt();
        }
        
        int ans = 0;
        int tempMin = Integer.MAX_VALUE;
        for(int i=0;i<N; i++) {
            if(P[i] <= tempMin) {
                ans++;
            }
            tempMin = Math.min(P[i], tempMin);
        }
        
        System.out.println(ans);
    }

}


Measured memory_bytes: 65192
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <vector>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

int asc(const void* a, const void* b) {
	return *(int*)a- *(int*)b;
}

int main()
{
	string n;
	int m = 0, i;
	cin >> n;
	i = atoi(n.c_str());
	rep(i, n.size()) {
		m += (int)n[i] - 48;
	}
	if (i % m == 0) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline

N = int(input())
x = []
y = []
for i in range(N):
    Ai = int(input())
    xi = []
    yi = []
    for j in range(Ai):
        xij, yij = map(int, input().split())
        xi.append(xij)
        yi.append(yij)
    x.append(xi)
    y.append(yi)

ans = 0
for i in range(2**N):
    bit = [i>>j&1 for j in range(N)]
    flag = True
    for j in range(N):
        if bit[j] == 0:
            continue
        for k in range(len(x[j])):
            if not bit[x[j][k] - 1] == y[j][k]:
                flag = False
    if flag:
        ans = max(ans, sum(bit))

print(ans)

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

using namespace std;

int gcd(int a, int b) {
  if (a <= b) {
    int box = a;
    a = b;
    b = box;
  }
  if (b == 0) {
    return a;
  }
  return gcd(b, a % b);
}

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

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

  vector<int> left(N + 1, 0);
  vector<int> right(N + 1, 0);
  for (int i = 0; i < N; i++) {
    left[i + 1] = gcd(left[i], A[i]);
  }
  for (int i = N - 1; i >= 0; i--) {
    right[i] = gcd(right[i + 1], A[i]);
  }

  int maxGcd = 0;
  for (int i = 0; i < N; i++) {
    int l = left[i];
    int r = right[i + 1];

    maxGcd = max(maxGcd, gcd(l, r));
  }
  cout << maxGcd << endl;
}


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

using ll=long long; 

void solve(){
	map<char, int> cnt;
	string s;
	cin>>s;
	for(int i=0; i<s.size(); i++){
		cnt[s[i]]=1;
	}
	if(cnt['N']==cnt['S']&&cnt['W']==cnt['E']){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
}

signed main(){
	//while(1)
	solve();
}

Measured memory_bytes: 256
// 2020-08-18 23:00:27
#include<bits/stdc++.h>
#ifdef LOCAL
#include "lib/debug.hpp"
#else
#define debug(...) 1
#endif
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) REP(i, 0, (n))
#define repc(i, n) REPC(i, 0, (n))
#define REP(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define REPC(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define REPCM(i, n, m) for (int i = (int)(n); i >= (int)(m); i--)
using namespace std;
using ll = long long;
using ld = long double;
using pr = pair<ll, ll>;
using vll = vector<ll>;
using vpr = vector<pr>;
using P = pair<int, int>;
template<class T> inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } else return false; }
template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } else return false; }

void answer() {
  ll k, q;
  cin >> k >> q;
  vector<ll> d(k);
  rep(i, k) cin >> d[i];
  rep(_, q) {
    ll n, x, m;
    cin >> n >> x >> m;
    ll y = x, z = 0;
    rep(i, k) {
      ll cnt = (n-1) / k;
      if(i < ((n-1) % k)) cnt++;
      if((d[i] % m) == 0) z += cnt;
      else y += cnt * (d[i] % m);
    }
    cout << (n - 1) - (y / m - x / m) - z << '\n';
  }
}
int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  answer();
  return 0;
}

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

i = 1
cyakusu = []
while i**2 <= c:
    if i**2 < c:
        if c%i == 0:
            cyakusu.append(i)
            cyakusu.append(c//i)
    if i**2 == c:
        cyakusu.append(i)
    i += 1

n = len(cyakusu)

yakusu = []
for j in range(n):
    if a<=cyakusu[j]<=b :
        yakusu.append(cyakusu[j])

print(len(yakusu))


Measured memory_bytes: 5600
import copy
import math

# a = get_int()
def get_int():
    return int(input())
# a = get_string()
def get_string():
    return input()
# a_list = get_int_list()
def get_int_list():
    return [int(x) for x in input().split()]
# a_list = get_string_list():
def get_string_list():
    return input().split()
# a, b = get_int_multi()
def get_int_multi():  # a, b = get_int_multi()
    return map(int, input().split())
# a_list = get_string_char_list()
def get_string_char_list():
    return list(str(input()))
# print("{} {}".format(a, b))
# for num in range(0, a):
# a_list[idx]
# a_list = [0] * a
'''
while (idx < n) and ():

    idx += 1
'''

def main():

    if get_int() >= 30:
        print("Yes")
    else:
        print("No")


if __name__ == '__main__':
    main()




Measured memory_bytes: 9348
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define COUT(x) cout << (x) << endl
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */


int main() {
    ll w, h, x, y;
    cin >> w >> h >> x >> y;
    long double ans;
    ans = (long double)w / 2 * h;
    int check = 0;
    if(x + x == w && y + y == h) check = 1;

    cout << fixed << setprecision(10) << ans << " " << check << endl;

    return 0;
}

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

using namespace std;

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

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

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    int a, b, c, d;
    char op1, op2, op3;
    d = n % 10; n /= 10;
    c = n % 10; n /= 10;
    b = n % 10; n /= 10;
    a = n % 10;

    if( a + b + c + d == 7 ) {
        op1 = op2 = op3 = '+';
    } else if( a + b + c - d == 7 ) {
        op1 = op2 = '+'; op3 = '-';
    } else if( a + b - c + d == 7 ) {
        op1 = op3 = '+'; op2 = '-';
    } else if( a - b + c + d == 7 ) {
        op2 = op3 = '+'; op1 = '-';
    } else if( a - b - c + d == 7 ) {
        op1 = op2 = '-'; op3 = '+';
    } else if( a + b - c - d == 7 ) {
        op2 = op3 = '-'; op1 = '+';
    } else if( a - b + c - d == 7 ) {
        op1 = op3 = '-'; op2 = '+';
    } else {
        op1 = op2 = op3 = '-';
    }

    cout << a << op1 << b << op2 << c << op3 << d << "=7" << endl;
    
    return 0;
}


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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()

void Print(VI A){
  int N = SZ(A);
  REP(k,N) {
      cout << A.at(k);
      if(k != N-1) cout << " ";
      else cout << endl;
    }
}

int main() {
  int N;
  cin >> N;
  
  VI A(N);
  
  REP(i,N) {
    cin >> A.at(i);
  }
  
  int flag = 1, chan = 0;
  
  while(flag) {
    
    flag = 0;
    for(int i = N-1; i > 0; i--){
      if(A.at(i) < A.at(i-1)) {
        swap(A.at(i),A.at(i-1));
        chan++;
        flag = 1;
      }
    }
  }
  Print(A);
  cout << chan << endl;
  
  return 0;
}


Measured memory_bytes: 3156
from sys import stdout
printn = lambda x: stdout.write(str(x))
inn = lambda : int(input())
inl   = lambda: list(map(int, input().split()))
inm   = lambda:      map(int, input().split())
ins = lambda : input().strip()
DBG = True # and False
BIG = 999999999
R = 10**9 + 7

def ddprint(x):
  if DBG:
    print(x)

def modinv2(x,r):
  return pow(x,r-2,r)

def comb(n,a):
    dend = n
    for i in range(1,a):
        dend = (dend*(n-i))%R
    sor = 1
    for i in range(2,a+1):
        sor = (sor*i)%R
    return (dend*modinv2(sor,R))%R

n,a,b = inm()
print((pow(2,n,R)-comb(n,a)-comb(n,b)-1)%R)


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

int main(){
    int a[3][3];
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++){
            cin >> a[i][j];
        }
    }
    int b[3][3] = {};
    int n;
    cin >> n;
    while(n--){
        int x;  cin >> x;
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(a[i][j]==x)  b[i][j] = true;
            }
        }
    }
    bool ok = false;
    for(int i = 0; i < 3; i++){
        bool tmp = true;
        for(int j = 0; j < 3; j++)  tmp &= b[i][j];
        ok |= tmp;
        tmp = true;
        for(int j = 0; j < 3; j++)  tmp &= b[j][i];
        ok |= tmp;
    }
    bool tmp = true;
    for(int i = 0; i < 3; i++)  tmp &= b[i][i];
    ok |= tmp;
    tmp = true;
    for(int i = 0; i < 3; i++)  tmp &= b[i][2-i];
    ok |= tmp;
    cout << (ok ? "Yes" : "No") << endl;
    return 0;
}

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

#define ll long long

using namespace std;
int n, t;
int b[100002];

int main() {
    ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);

    cin >> n;
    while (n--) cin >> t, b[t]++, b[t - 1]++, b[t + 1]++;
    sort(b, b + 100002, greater<int>());
    cout << b[0];
    return 0;
}

Measured memory_bytes: 640