akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
int main() {
    #ifdef DEBUG
    std::ifstream in("/home/share/inputf.in");
    std::cin.rdbuf(in.rdbuf());
    #endif
    string S;
    cin >> S;
    int ans = 0, tmp = 0;
    set<char> s = {'A', 'T', 'G', 'C'};
    for(int i = 0; i < S.size(); i++) {
        if(s.count(S[i])) {
            tmp++;
        } else {
            tmp = 0;
        }
        ans = max(tmp, ans);
    }
    cout << ans << endl;
    return 0;
}

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


#define f(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define char_f(i,a) for(int i=(int)(a);(char)s[i]!='\0';i++)
#define rf(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define llf(i,a,b) for(long long int i=(long long int)(a);i<=(long long int)(b);i++)
#define llrf(i,a,b) for(long long int i=(long long int)(a);i>=(long long int)(b);i--)



#define ll long long
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define mem(ara) memset((ara),0,sizeof(ara))
#define memn(ara) memset((ara),-1,sizeof(ara))
#define bb begin()
#define ee end()
#define em emplace
#define eb emplace_back





#define si set<int>
#define sd set<double>
#define sll set<long long int>
#define ss set<string>
#define sc set<char>

#define pii pair<int,int>
#define pli pair<long long int,int>
#define pil pair<int,long long int>
#define pll pair<long long int,long long int>
#define pci pair<char,int>
#define pic pair<int,char>
#define pcl pair<char,long long int>
#define plc pair<long long int,char>

#define pss pair<string,string>
#define pcc pair<char,char>

#define pis pair<int,string>
#define psi pair<string,int>
#define pls pair<long long int,string>
#define psl pair<string,long long int>
#define pdd pair<double,double>
#define pcs pair<char,string>
#define psc pair<string,char>



#define vi  vector<int>
#define vll vector<long long int>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vii vector<pii>



#define mod 1000000007
#define mx (1<<30)-1
#define llmx (1ll<<62)
#define n_size 100005
#define g_size 10000005
double PI=acos(-1);
#define eps 1e-9



///unsigned int uMAX=4294967295;
///unsigned ll int ullMAX=18446744073709551615;


int power(int a,int b){
    int r=1;
    while(b){
        if(b & 1){
            r=r*a;
            b--;
        }
        a=a*a;
        b>>=1;
    }
    return r;
}


int arr[g_size];



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

	int n,m,T,res;

	int maxi=-mx,mini=mx,count=0;

	int i,j,k;

	bool flag;

	string s1,s2;

	char s[100000];

	int ara[n_size],ara2[n_size];

	cin>>k;

	vi v;

	rf(i,32,1){
        int l=1;
        int r=10;
        while(r-l>1){
            int mid=(l+r)/2;
            int x=power(i,mid);
            if(x>k) r=mid;
            else{
                v.pb(x);
                l=mid;
            }
        }
	}

	auto z=max_element(v.bb,v.ee);

	cout<<*z<<endl;
}



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

#define F first
#define S second

using namespace std;

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

const int N = 100010, M = 110;

int n;
int v[N];
LL m, x[N];
LL s[N], rs[N];
LL sm[N], rsm[N];

int main()
{
	scanf("%d%lld", &n, &m);
	for (int i = 1; i <= n; i ++ )scanf("%lld%d", &x[i], &v[i]);
	
	for (int i = 1; i <= n; i ++ )
	{
		s[i] = s[i - 1] + v[i];
		sm[i] = max(sm[i - 1], s[i] - x[i]);
		// cout << s[i] << ' ' << sm[i] << endl;
	}
	// puts("---");
	for (int i = n; i; i -- )
	{
		rs[i] = rs[i + 1] + v[i];
		rsm[i] = max(rsm[i + 1], rs[i] - (m - x[i]));
		// cout << rs[i] << ' ' << rsm[i] << endl;
	}
	
	LL maxa = 0, rmaxa = 0;
	for (int i = 1; i <= n; i ++ ) maxa = max(maxa, s[i] - x[i]);
	for (int i = 1; i <= n; i ++ ) maxa = max(maxa, rsm[i + 1] + s[i] - 2LL * x[i]);
	for (int i = n; i; i -- ) rmaxa = max(rmaxa, rs[i] - (m - x[i]));
	for (int i = n; i; i -- ) rmaxa = max(rmaxa, sm[i - 1] + rs[i] - 2LL * (m - x[i]));
	
	printf("%lld\n", max(maxa, rmaxa));
	return 0;
}

Measured memory_bytes: 4480
while(True):
	a,b=list(map(int,input().split()))
	if a==0 and b==0:
		break
	c=0
	for i in range(1,a+1):
		for j in range(1,i):
			for k in range(1,j):
				if i+j+k==b:
					c+=1
	print(c)

Measured memory_bytes: 7600
n = int(input())
a = list(map(int,input().split()))

ans = [0,0]
cum = [0,0]
sn = [1,-1]

for i, aa in enumerate(a):
    for j in range(2):
        if (-1)**i * sn[j] * aa > 0 and abs(aa) > abs(cum[j]):
            cum[j] += aa
            continue
        if cum[j]*aa < 0:
            ans[j] += abs(cum[j]) - abs(aa) + 1
        else:
            ans[j] += abs(cum[j]) + abs(aa) + 1
        cum[j] = (-1)**i * sn[j]
    
print(min(ans))

Measured memory_bytes: 14468
#include<iostream>
using namespace std;
int main()
{
  long long n,k,t,res;
  cin >> n >> k;
  t=n/k;
  res=t*t*t;
  if(k%2==0){
    t=n/(k/2)-n/k;
    res+=t*t*t;
  }
  cout << res << endl;
  return 0;
}

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


int main() {
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  long long cost = 0;
  while(x > 0 && y > 0){
    cost += min(a+b, 2*c);
    x--;
    y--;
  }
  if(x == 0 && y > 0) 
    cost += min(b, 2*c) * y;
  else if(x > 0 && y == 0) 
    cost += min(a, 2*c) * x;
  cout << cost << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
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;}

const int INF = 100000; 

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

   if(n <= m){
       cout << "Yes" << endl;
   }else{
       cout << "No" << endl;
   }

    return 0;
}


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

int main (void) {
    int A[200000], N, K;
    int i, j, count=0;
    
    scanf("%d %d", &N, &K);
    for(i=0; i<N; i++) {
        scanf("%d", &A[i]);
    }
    for(i=0; i<N-K; i++){ 
        if(A[i]<A[i+K]) {
            printf("Yes\n");
        } else {
            printf("No\n");
        }
        
    }
    
    return 0;
}

Measured memory_bytes: 2868
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <queue>
#define rep(i,n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;

int main()
{
	int N;
	cin >> N;
	string S;
	cin >> S;
	vector<int> csE(N,0);
	rep(i, N)
	{
		if (S[i] == 'E')
		{
			if (i == 0) csE[i] = 1;
			else csE[i] = csE[i - 1] + 1;
		}
		else
		{
			if (i == 0) csE[i] = 0;
			else csE[i] = csE[i - 1];
		}
	}

	int ans = N;
	rep(i, N)
	{
		int csW; 
		if (i == 0) csW = 0;
		else csW = i - csE[i - 1];

		int csE_R = csE[N - 1] - csE[i];
		int chg = csW + csE_R;
		ans = min(ans, chg);
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 1796
#include<stdio.h>

static const int N = 1000;
int i=0;
void trace(int A[], int n){

  for ( i = 1; i <= n; i++ ){
    if ( i > 1 ) printf(" ");
    printf("%d", A[i]);
  }
  printf("\n");
}

int main(){
  int n, i, j, v;
  int A[N+1];
  scanf("%d", &n);

  for ( i = 1; i <= n; i++ ) scanf("%d", &A[i]);

  trace(A, n);
  for(i=2;i<=n;i++){
    v=A[i];
    j=i-1;
  while(j>=0&&A[j]>v){
    A[j+1]=A[j];
    j--;
    A[j+1]=v;
  }
   trace(A,n);
  }
  return 0;
}



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

int bic[19] = {};

void mul(int m){
	for(int i = 0;i <= 17;i++){
		bic[i] *= m;
	}
	for(int i = 0;i <= 17;i++){
		if(bic[i] >= 10000){
			bic[i+1] += bic[i] / 10000;
			bic[i] %= 10000;
		}
	}
}

string s[] ={
	"",
	"Man",
	"Oku",
	"Cho",
	"Kei",
	"Gai",
	"Jo",
	"Jou",
	"Ko",
	"Kan",
	"Sei",
	"Sai",
	"Gok",
	"Ggs",
	"Asg",
	"Nyt",
	"Fks",
	"Mts"
};


void print(){
	for(int i = 17;i >= 0;i--){
		if(bic[i] > 0){
			cout << bic[i] << s[i];
		}
	}
	cout << endl;
	return;
}

int main(){

	int m, n;
	while(cin >> m >> n, m != 0){
		memset(bic, 0, sizeof(bic));

		bic[0] = 1;

		for(int i = 0;i < n;i++){
			mul(m);
		}

		print();
	}

	return 0;
}


Measured memory_bytes: 3196
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <deque>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define rep(i, up) for (ll i = 0; i < up; ++i)
#define repp(i, up) for (ll i = 0; i <= up; ++i)
#define rrep(i, lo, up) for (ll i = lo; i < up; ++i)
#define rrepp(i, lo, up) for (ll i = lo; i <= up; ++i)

#define rdi(i) ll i; scanf("%lld", &i)
#define rds(s) string s; cin >> s
#define rdc(c) char c; cin >> c

#define INF 10000000000
#define MOD 1000000007

ll gcd(ll a, ll b)
{
    if (a < b) {
        return gcd(b, a);
    }
    ll r;
    while (r = a % b) {
        a = b;
        b = r;
    }
    return b;
}

int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    rrep(i, 1, n) {
        ll input;
        scanf("%lld", &input);
        ++a[input - 1];
    }
    rep(i, n) {
        printf("%lld\n", a[i]);
    }
    return 0;
}

Measured memory_bytes: 4372
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

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

	private void solve() throws IOException {
		try {
			//			solveA();
			solveB();
			// solveC();
			// solveD();
			// solveE();
			// solveF();
		} finally {
			if (in != null) {
				in.close();
			}
			if (out != null) {
				out.flush();
				out.close();
			}
		}

	}

	private void solveA() {
		int numA = nextInt();
		int numB = nextInt();
		int numC = nextInt();
		int numD = nextInt();

		out.println(numA * numB > numC * numD ? numA * numB : numC * numD);

	}

	private void solveB() {
		int numN = nextInt();
		char[] strS = next().toCharArray();

		int x = 0;
		int res = 0;
		for (int i = 0; i < strS.length; i++) {
			if (strS[i] == 'I') {
				x++;
			} else if (strS[i] == 'D') {
				x--;
			}
			res = Math.max(res, x);
		}

		out.println(res);
	}

	private void solveC() {
		int numN = nextInt();

		out.println("");
	}

	private void solveD() {
		int numN = nextInt();

		out.println("");
	}

	private void solveE() {
		int numN = nextInt();

		out.println("");
	}

	private void solveF() {
		int numN = nextInt();

		out.println("");
	}

	private final PrintWriter out = new PrintWriter(System.out);
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
}

Measured memory_bytes: 21076
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define all(v) begin(v), end(v)
#define pb(a) push_back(a)
#define fr first
#define sc second
#define INF 2000000000
#define int long long int

#define X real()
#define Y imag()
#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) ( EQ((a).X, (b).X) && EQ((a).Y, (b).Y) )
#define LE(n, m) ((n) < (m) + EPS)
#define LEQ(n, m) ((n) <= (m) + EPS)
#define GE(n, m) ((n) + EPS > (m))
#define GEQ(n, m) ((n) + EPS >= (m))

typedef vector<int> VI;
typedef vector<VI> MAT;
typedef pair<int, int> pii;
typedef long long ll;

typedef complex<double> P;
typedef pair<P, P> L;
typedef pair<P, double> C;

int dx[]={1, -1, 0, 0};
int dy[]={0, 0, 1, -1};
int const MOD = 1000000007;
ll mod_pow(ll x, ll n) {return (!n)?1:(mod_pow((x*x)%MOD,n/2)*((n&1)?x:1))%MOD;}
int madd(int a, int b) {return (a + b) % MOD;}
int msub(int a, int b) {return (a - b + MOD) % MOD;}
int mmul(int a, int b) {return (a * b) % MOD;}
int minv(int a) {return mod_pow(a, MOD-2);}
int mdiv(int a, int b) {return mmul(a, minv(b));}

namespace std {
    bool operator<(const P& a, const P& b) {
        return a.X != b.X ? a.X < b.X : a.Y < b.Y;
    }
}

int dp[1010][1010];

signed main() {
    string s1, s2; cin >> s1 >> s2;
    int n, m;
    n = s1.length();
    m = s2.length();

    memset(dp, 0, sizeof(dp));

    repq(i,0,n) dp[i][0] = i;
    repq(i,0,m) dp[0][i] = i;
    rep(i,0,n) {
        rep(j,0,m) {
            int cost = (s1[i] != s2[j]);
            dp[i+1][j+1] = min(dp[i][j+1] + 1, dp[i+1][j] + 1);
            dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + cost);
            // printf("%lld ", dp[i+1][j+1]);
        }
        // cout << endl;
    }
    cout << dp[n][m] << endl;
    return 0;
}

Measured memory_bytes: 11160
#include<bits/stdc++.h>
#define fi        first
#define se        second
#define pb        push_back
#define PI        acos(-1)
#define LC(a)     ((a<<1))
#define RC(a)     ((a<<1)+1)
#define MID(a,b)  ((a+b)>>1)
#define mem(a, b) memset(a, b, sizeof(a))
#define IOS()     std::ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
using namespace std;
typedef long long ll;
typedef unsigned long long ULL;
typedef pair<int,int> PII;
typedef pair<ll,ll>   PLL;
const int INF = 0X3F3F3F3F;
const int MIN = -(1<<30);
const ll N = 2e5+7;
const ll mod = 1e9+7;
ll a[N];
ll b[N];
inline void solve()
{
	int n;
	cin>>n;
	for(int i=0; i<n; i++) cin>>a[i];
	b[n-1] = a[n-1];
	for(int i=n-2; i>=0; i--)
		b[i] = (b[i+1]+a[i])%mod;
	ll ans = 0;
	for(int i=0;i<n-1;i++)
	ans = (ans + a[i]*b[i+1]%mod)%mod;
	cout<<ans<<endl;

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




Measured memory_bytes: 6748
n = int(input())
data = []
for i in range(n):
    data.append(input().split())

x, y = 0, 0
t = 0
ans = "Yes"

for i in data:
    add = abs(int(i[2])-y) + abs(int(i[1])-x)
    tt = int(i[0])-t

    if tt % add == 0 :
        t = int(i[0])
        x,y = int(i[1]), int(i[2])

    else:
        ans = 'No'
        break

print(ans)

Measured memory_bytes: 32148
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<map>
#include<iomanip>
#include<limits>
#include<queue>
#include<set>


using namespace std;

int main(){

    int N,Y;
    cin >> N >>Y;
    int res10000 = -1,res5000 = -1,res1000 = -1;
    for(int a = 0;a <= N;a++){
    	for(int b = 0; b <= N-a;b++){
    	     int c = N - a - b;
    		 int total = 10000*a + 5000*b + 1000*c;
    		 if(total == Y){
    			 res10000 = a;
    			 res5000  = b;
    			 res1000  = c;
    		 }
    	}
    }

    cout << res10000 << " " << res5000 << " " << res1000 << endl;

	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
using Real = mp::number<mp::cpp_dec_float<1024>>;
int main(){
  Bint A;
  cin>>A;
  Bint N=1;
  Bint B;
  int c=0;
  for(int i=0;i<A;i++){
    cin>>B;
    if(c!=0 && B!=0){
      if(i==A-1){
        N=-1;
        break;
      }
      else{continue;}
    }
    else if (B==0){N=0;break;}
    N=N*B;
    if(N>1000000000000000000){
      c++;
      if(i==A-1){N=-1;}
    }
  }
  
  cout<<N<<endl;
}

Measured memory_bytes: 3700
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define show(x) cout << #x << " = " << (x) << endl;
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
//cout << fixed << setprecision(10);

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; }

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

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

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		String s = scan.next();
		scan.close();

		int check[]=new int[26];
		for(int i=0;i<26;i++) {
			check[i]=0;
		}
		int x=0;
		for(int i=0;i<s.length();i++) {
			int num= s.charAt(i)-'a';
			check[num]+=1;
			if(check[num]==2) {
				x=1;
				break;
			}
		}
		System.out.println((x==1)? "no":"yes");
	}
}

Measured memory_bytes: 21844
(defun main ()
  (let* ((a (read))
         (b (read))
         (h (read))
         (m (read))
         (angle (- (* (* 2 pi) (+ (/ h 12) (* (/ 1 12) (/ m 60)))) (* (* 2 pi) (/ m 60))))
         (ans (sqrt (- (+ (expt a 2) (expt b 2)) (* 2 a b (cos angle))))))
    (format t "~,20f~%" ans)))

(main)


Measured memory_bytes: 24140
from statistics import mean, median,variance,stdev
import numpy as np
import sys
import math
import fractions
import itertools

def j(q):
    if q==1: print("Yes")
    else:print("No")
    exit(0)


def ct(x,y):
    if (x>y):print("")
    elif (x<y): print("")
    else: print("")

def ip():
    return int(input())

def swap(s,pos):
    s[pos]-=1
    s[pos+1]+=1
    print(s)
    if pos == n-2: return s
    if s[pos+2] == 0: swap(s,pos+1)
    return s


#n = ip()                              #入力整数1つ
#left,n= (int(i) for i in input().split())      #入力整数横2つ
n,x,y = (int(i) for i in input().split())    #入力整数横3つ
#n,m,x,y= (int(i) for i in input().split())  #入力整数横4つ
#a = [int(i) for i in input().split()]        #入力整数配列
#a = input()                                  #入力文字列
#a = input().split()                          #入力文字配列
#n = ip()                      #入力セット(整数改行あり)(1/2)
#a=[ip() for i in range(n)]    #入力セット(整数改行あり)(2/2)



#jの変数はしようできないので注意
#全足しにsum変数使用はsum関数使用できないので注意
n-=y
print(n//(x+y))

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

int main(void) {
  ios::sync_with_stdio(false);
  int N, K;
  cin >> N >> K;
  vector<int> P(N);
  rep(i, N) { cin >> P[i]; }
  sort(P.begin(), P.end());
  int answer = 0;
  rep(i, K) answer += P[i];
  cout << answer << endl;
  return 0;
}


Measured memory_bytes: 3648
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

bool solve(const vector<vector<pair<int, int> > >& v)
{
    int n = v[0].size() + 1;
    vector<set<pair<int, int> > > s(2);
    vector<int> cnt(n, 0);
    for(int i=0; i<2; ++i){
        for(int j=0; j<n-1; ++j){
            int a = v[i][j].first;
            int b = v[i][j].second;
            s[i].insert(make_pair(a, b));
            s[i].insert(make_pair(b, a));
            ++ cnt[a];
            ++ cnt[b];
        }
    }

    queue<pair<int, int> > q;
    for(const auto& p : s[0]){
        if(p.first < p.second && s[1].find(p) != s[1].end())
            q.push(p);
    }

    for(int t=0; t<n-1; ++t){
        int a, b;
        for(;;){
            if(q.empty())
                return false;
            tie(a, b) = q.front();
            q.pop();
            if(cnt[a] != -1 && cnt[b] != -1)
                break;
        }

        if(cnt[a] < cnt[b])
            swap(a, b);
        cnt[a] += cnt[b] - 4;
        cnt[b] = -1;

        for(int i=0; i<2; ++i){
            s[i].erase(make_pair(a, b));
            s[i].erase(make_pair(b, a));
            for(;;){
                auto it = s[i].lower_bound(make_pair(b, -1));
                if(it == s[i].end() || it->first != b)
                    break;

                int c = it->second;
                s[i].erase(make_pair(b, c));
                s[i].erase(make_pair(c, b));
                s[i].insert(make_pair(a, c));
                s[i].insert(make_pair(c, a));
                if(s[i^1].find(make_pair(a, c)) != s[i^1].end())
                    q.push(make_pair(a, c));
            }
        }
    }

    return true;
}

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

    vector<vector<pair<int, int> > > v(2, vector<pair<int, int> >(n-1));
    for(int i=0; i<2; ++i){
        for(int j=0; j<n-1; ++j){
            cin >> v[i][j].first >> v[i][j].second;
            -- v[i][j].first;
            -- v[i][j].second;
        }
    }

    if(solve(v))
        cout << "YES" << endl;
    else
        cout << "NO" << endl;

    return 0;
}


Measured memory_bytes: 21232
#define _USE_MATH_DEFINES

#include <iostream>	//cin, cout
#include <vector>	//vector
#include <algorithm> //sort,min,max,count
#include <string>	//string
#include <ios>		//fixed
#include <iomanip>	//setprecision
#include <utility> //swap
#include <cstdlib>	//abs(int)
#include <cmath>	//sqrt
#include <sstream>	//stringstream,getline
#include <cmath>	//ceil,M_PI

using namespace std;


int main() {

	int A, B, C;
	cin >> A >> B >> C;

	bool flg = false;

	if (A == B) {
		if (B != C) {
			flg = true;
		}
	}
	else {
		if (A == C || B == C) {
			flg = true;
		}
	}

	if (flg) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;

}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define ALL(a) (a).begin(), (a).end()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;
using P = pair<int, int>;
const int MOD = 1e9+7;
const double EPS = 1e-9;
const ll INFTY = 1e10+1;

int main() {
  int a, b, q; cin >> a >> b >> q;

  vl shrine(a+2), temple(b+2);
  shrine[0] = -INFTY; temple[0] = -INFTY;
  shrine[a+1] = 2*INFTY; temple[b+1] = 2*INFTY;
  rep(i,a) cin >> shrine[i+1];
  rep(i,b) cin >> temple[i+1];
  sort(ALL(shrine)); sort(ALL(temple));
  
  ll x, distance, tmp, ans;
  rep(i,q) {
    cin >> x;
    auto s_Iter = lower_bound(ALL(shrine), x) - shrine.begin();
    auto t_Iter = lower_bound(ALL(temple), x) - temple.begin();
    ans = 2*INFTY;
    rep(j,(1<<2)) {
      bitset<2> s(j);
      distance = min(abs(x - shrine[s_Iter-s[0]]), abs(x - temple[t_Iter-s[1]]));
      tmp = distance + abs(shrine[s_Iter-s[0]] - temple[t_Iter-s[1]]);
      ans = min(ans, tmp);
    }
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 2944
#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define DEBUG true
#ifdef ONLINE_JUDGE
#undef DEBUG
#define DEBUG false
#endif 

using namespace std;

#define MAXN ((int)2e5+5)
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9 + 9)
#define ll long long
#define _ << " " <<
#define CLEAR(a, b) memset(a, b, sizeof(a))
#define TRACE(x) if(DEBUG) cerr << #x << " = " << x << endl;
#define TRACE2(x,y) if(DEBUG) cerr << #x << " = " << x << " | " << #y << " = " << y << endl;
#define pb push_back
#define all(x) x.begin(), x.end()
#define endl "\n"
#define pii pair<int,int>
#define mid ((l+r)/2)

int n;
string s;

int main()
{
	ios_base::sync_with_stdio(false);cin.tie(0);
	cin >> n >> s;	

	if(n%2)
		cout << "No\n";
	else
	{
		for (int i = 0; i < n/2; ++i)
		{
			if(s[i] != s[i + n/2])
			{
				cout<<"No\n";
				return 0;
			}
		}

		cout << "Yes\n";
	}

}

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

using namespace std;

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

const int iinf = 1 << 29;
const long long linf = 1ll << 61;

#define modp(x, y) (((y) + (x) % (y)) % (y))
template<typename T> inline T gcd(T x, T y) { if(x < y) swap(x, y); T mod = x % y; if(mod == 0) return y; return gcd(y, mod); }
template<typename T> inline T lmc(T x, T y) { return x / gcd(x, y) * y; }

int main(int argc, char* argv[])
{
	char S[210];
	scanf("%s", S);
	int L = strlen(S);

	int ans = 0;
	for (int i = 1; i <= (L - 1) / 2; i++) {
		bool flag = true;
		for (int j = i; j < 2 * i; j++) {
			if (S[j] != S[j - i]) {
				flag = false;
				break;
			}
		}
		if (flag) ans = 2 * i;
	}
	printf("%d\n", ans);

	return 0;
}


Measured memory_bytes: 256
#include <algorithm> 
#include <cstdio> 
#define SZ 1000009 
#define p 1000000007 
#define llg long long 
using namespace std; 

llg dp[20][SZ], ans = 0, lst[SZ], fac[SZ], Cc[20], ifac[SZ]; 
int n, m, a[SZ], allsta, Log[SZ], sn; 

int read(); 
bool cmp(int x, int y) {return x > y; } 
llg fsq(llg x, llg kn) {
	llg ret = 1; 
	while (kn) {
		if (kn & 1) (ret *= x) %= p; 
		(x *= x) %= p; kn >>= 1; 
	} 
	return ret; 
} 
llg C(llg x, llg y) {return fac[x] * ifac[y] % p * ifac[x - y] % p; } 
void get_C() { 
	Cc[0] = 1; for (int i = 1; i <= n; ++i) Cc[i] = Cc[i - 1] << 1; 
	for (int i = 1; i <= allsta; ++i) Log[i] = Log[i >> 1] + i & 1; 
	fac[0] = 1; for (int i = 1; i <= allsta + 1; ++i) fac[i] = fac[i - 1] * i % p; 
	ifac[allsta + 1] = fsq(fac[allsta + 1], p - 2); 
	for (int i = allsta; i >= 0; --i) ifac[i] = ifac[i + 1] * (i + 1) % p; 
	for (int i = 0; i <= allsta; ++i) {
		int lsti = sn - i - 1, ni = 0, sum = lsti; lst[i] = 1; 
		while (lsti) {
			if (lsti & 1) 
				(lst[i] *= C(sum, Cc[ni]) * fac[Cc[ni]] % p) %= p; 
			if (lsti & 1) sum -= Cc[ni]; ++ni; lsti >>= 1; 
		} 
	} 
} 

int main() {
	n = read(), m = read(); sn = 1 << n; allsta = sn - 1; 
	for (int i = 1; i <= m; ++i) a[i] = read(); 
	sort(a + 1, a + 1 + m, cmp); dp[0][0] = 1; get_C(); 
	for (int i = 0; i <= m; ++i) dp[i][0] = 1; 
	for (int i = 1; i <= m; ++i) {
		for (int j = 0; j <= allsta; ++j) dp[i][j] = dp[i - 1][j]; 
		for (int j = 0; j <= allsta; ++j) 
			for (int k = 1; k <= n; ++k) if (!((j >> k - 1) & 1)) 
				if (j + Cc[k - 1] <= sn - a[i] + 1) 
					(dp[i][j | (1 << k - 1)] += 	
		dp[i - 1][j] * C(sn - a[i] - j, Cc[k - 1] - 1) % p * fac[Cc[k - 1]] % p) %= p; 
	} 
	for (int j = 0; j <= allsta; ++j) { 
		llg now = dp[m][j] * fac[sn - j - 1] % p; 
		if (Log[j] & 1) (now *= (p - 1)) %= p; 
		(ans += now) %= p; 
	} 
	printf("%lld\n", ans * sn % p); 
	return 0; 
} 

int read() {
	int x = 0, f = 1; char c = getchar(); 
	while (c > '9' || c < '0') f = (c == '-') ? -1 : f, c = getchar(); 
	while (c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar(); 
	return x * f; 
} 

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

using namespace std;
#define int long long
string n;
int k;

int dp[105][105][2];

int count(int x,int nz,int t){
	if(x==n.size()){
		if(nz==k)
			return 1;
		return 0;
	}
	if(dp[x][nz][t]!=-1)
		return dp[x][nz][t];
	int c=0,m=9;
	if(t){
		m=n[x]-'0';
	}
	for(int i=0;i<=m;i++){
		if(i!=0){
			c+=count(x+1,nz+1,(t&&(i==m)?1:0));
		}
		else
			c+=count(x+1,nz,(t&&(i==m)?1:0));
	}
	return dp[x][nz][t]=c;
}

signed main(){
	cin>>n>>k;
	memset(dp,-1,sizeof(dp));
	cout<<count(0,0,1);
}


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

using namespace std;
typedef long long int ll;
typedef pair <ll,ll> P;
#define REP(i, n) for(ll i = 0LL; i < (ll)(n); i++)
#define REPR(i, n) for(ll i = n-1; i >= 0LL; i--)
#define FOR(i, n, m) for(ll i = n; i < (ll)(m); i++)
#define PRINT(x) cout << x << endl
#define ALL(v) v.begin(), v.end()
#define INF (ll)1e18
#define INFD 1e18
#define PI 3.14159265358979
// #define MOD 1000000007
#define MOD 2019
#define vl vector<ll>

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


template<int mod>
struct ModInt{
	int x;
	ModInt():x(0){}
	ModInt(long long y):x(y>=0?y%mod:(mod-(-y)%mod)%mod){}
	ModInt &operator+=(const ModInt &p){
		if((x+=p.x)>=mod)x-=mod;
		return *this;
	}
	ModInt &operator-=(const ModInt &p){
		if((x+=mod-p.x)>=mod)x-=mod;
		return *this;
	}
	ModInt &operator*=(const ModInt &p){
		x=(int)(1LL*x*p.x%mod);
		return *this;
	}
	ModInt &operator/=(const ModInt &p){
		*this*=p.inverse();
		return *this;
	}
	ModInt &operator^=(long long p){
		ModInt res = 1;
		for (; p; p >>= 1) {
			if (p & 1) res *= *this;
			*this *= *this;
		}
		return *this = res;
	}
	ModInt operator-()const{return ModInt(-x);}
	ModInt operator+(const ModInt &p)const{return ModInt(*this)+=p;}
	ModInt operator-(const ModInt &p)const{return ModInt(*this)-=p;}
	ModInt operator*(const ModInt &p)const{return ModInt(*this)*=p;}
	ModInt operator/(const ModInt &p)const{return ModInt(*this)/=p;}
	ModInt operator^(long long p)const{return ModInt(*this)^=p;}
	bool operator==(const ModInt &p)const{return x==p.x;}
	bool operator!=(const ModInt &p)const{return x!=p.x;}
	explicit operator int() const { return x; }						   // added by QCFium
	ModInt operator=(const int p) {x = p; return ModInt(*this);} // added by QCFium
	ModInt inverse()const{
		int a=x,b=mod,u=1,v=0,t;
		while(b>0){
			t=a/b;
			a-=t*b;
			std::swap(a,b);
			u-=t*v;
			std::swap(u,v);
		}
		return ModInt(u);
	}
	friend std::ostream &operator<<(std::ostream &os,const ModInt<mod> &p){
		return os<<p.x;
	}
	friend std::istream &operator>>(std::istream &is,ModInt<mod> &a){
		long long x;
		is>>x;
		a=ModInt<mod>(x);
		return (is);
	}
};
typedef ModInt<MOD> mint;

int main()
{
	string S;
	cin >> S;
	map<ll, ll> m;
	ll ans = 0;
	// REP(i, S.size()) {
	// 	ll tmp = stoll(S.substr(i, S.size()-i));
	// 	PRINT(tmp);
	// 	m[tmp % 2019]++;
	// }

	mint t = 0;
	REPR(i, S.length()) {
		mint a = S[i] - '0';
		t = t + a * ((mint)10^(S.length()-1 - i));
		// PRINT(t);
		// PRINT(i);
		m[t.x]++;
	}
	for(P p : m) {
		// PRINT(p.first << " : " << p.second);
		ans += (p.second *(p.second-1)) / 2;
	}
	ans += m[0];
	PRINT(ans);
	return 0;
}


Measured memory_bytes: 3692
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <assert.h>
     
using namespace std;
     
typedef long long ll;
     
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
     
#define MOD 1000000007

int main(){
  ll n,k;
  cin>>n>>k;
  vector<ll> v;
  rep(i,0,n){
    ll a;
    cin>>a;
    v.pb(a);
  }
  long long low = 1;
  long long high = 1000000000;
  while(low < high){
    long long mid = (high + low) >> 1;
    ll a = 0;
    rep(i,0,v.sz){
      ll b = v[i]/mid;
      if(v[i]%mid!=0)b++;
      a += b-1;
    }
    if(a<=k){
      high = mid;
    }
    else{
      low = mid + 1;
    }
  }
  cout << low << endl;
  return 0;
}

Measured memory_bytes: 5360
// I/O
#include <iostream>
#include <iomanip>

// data structures
#include <queue>
#include <set>
#include <vector>

// manipulations
#include <algorithm>

#define rep(i,n) for(int i=0;i< (n);++i)
#define REP(i,n) for(int i=1;i<=(n);++i)
#define for_lowercase(c) for(int c='a';c<='z';++c)
#define for_uppercase(c) for(int c='A';c<='Z';++c)
#define ALL(a) (a).begin(),(a).end()
using LLI = long long int;
LLI GCD(LLI a,LLI b){ if(a<b) return GCD(b,a); else if(a%b==0) return b; else return GCD(b,a%b); }
LLI LCM(LLI a,LLI b){ return (a/GCD(a,b))*b; }
using VI  = std::vector<LLI>;
using PI  = std::pair<LLI,LLI>;
using VVI = std::vector<VI>;
using VPI = std::vector<PI>;
template<class T> bool is_odd (T x){ return   x%2 ; }
template<class T> bool is_even(T x){ return !(x%2); }

int main() {
    std::ios::sync_with_stdio(false);
    LLI sum[100005]={};
    LLI N,K;
    std::cin >> N >> K;

    rep(i,N){
        LLI a,b;
        std::cin >> a >> b;
        sum[a] += b;
    }

    REP(i,100000){
        sum[i] += sum[i-1];
    }
    REP(i,100000){
        if( sum[i-1] < K && K <= sum[i]){
            std::cout << i << std::endl;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 1024
inputs = Array.new
while line = $stdin.gets
  inputs << line.chomp
end

N = inputs[0]
vs = inputs[1].split(" ").map(&:to_i)
cs = inputs[2].split(" ").map(&:to_i)

res = 0
[vs, cs].transpose.each do |v, c|
  val = v - c > 0 ? v - c : 0
  res = res + val
end

puts res


Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,i;
    cin>>a>>b;
     if(a<0 && b>0)
    {
	 cout<<"Zero"<<endl;
	 return 0;
    }
    else
     if(a==0 || b==0)
     {
	   cout<<"Zero"<<endl;
	   return 0;
	 }
	 else
	  if(a<0 && b<0)
	  {
	   if((b-a)%2==0)
	    cout<<"Negative"<<endl;
       else
        cout<<"Positive"<<endl;
	  }
	  else
	   if(a<0 && b>0)
	   {
	    if(abs(0-a)%2==0)
	     cout<<"Negative"<<endl;
        else
         cout<<"Positive"<<endl;
	   }
	   else
	    cout<<"Positive"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stack>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <stdlib.h>
#include <tuple>
using namespace std;
const double PI = 3.14159265358979323846;



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

	char hip = str.c_str()[str.size() - 1];

	if (hip == '2' || hip == '4' || hip == '5' || hip == '7' || hip == '9') {
		cout << "hon" << endl;
	}
	else if (hip == '0' || hip == '1' || hip == '6' || hip == '8') {
		cout << "pon" << endl;
	}
	else {
		cout << "bon" << endl;
	}
	
	return 0;
}

Measured memory_bytes: 3592
fun main() {
    val l = readLine()!!.split(' ').map { it.toLong() }
    var k: Long
    if (l[2] >= l[1]) {
        k = l[1]-1
    } else {
        k = l[2]
    }


     val max = Math.floor(l[0].toDouble()*k.toDouble()/l[1].toDouble())-l[0].toDouble()*Math.floor(k.toDouble()/l[1].toDouble())

    println(max.toInt())
}



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

int main() {
  int N;
  cin>>N;
  vector<int> a(N);
  for(int i=0;i<N;i++){
    cin>>a.at(i);
  }
  
  set<int> color;
  int rainbow=0;
  for(int x:a){
    x/=400;
    if(x<8){
      color.insert(x);
    }
    else
      rainbow++;
  }
  int ans = color.size();
  if(ans!=0)
    cout<<ans<<" "<<(ans+rainbow)<<endl;
  else
    cout<<"1"<<" "<<rainbow<<endl;
}


Measured memory_bytes: 3600
#include <map>
#include <iostream>
using namespace std;
int main() {
    constexpr int M = 1000000007;
    int n; cin >> n;
    map<int, int> cnt;
    cnt[-1] = 3;
    long long ans = 1;
    while (n--) {
        int a; cin >> a;
        int d = cnt[a-1] - cnt[a];
        if (d <= 0) { cout << 0 << endl; return 0; }
        ans = ans * d % M;
        cnt[a]++;
    }
    cout << ans << endl;
}


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

using namespace std;
using ll = long long;

//container util
#define SORT(c) sort((c).begin(),(c).end())

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


int main(void){

	ll H; cin >> H;

	ll ans = 0;
	ll cnt = 0;
	while(H != 1){
		H /= 2;
		ans += pow(2, cnt++);
	}

	ans += pow(2, cnt++);
	cout << ans << endl;



	return 0;

}


Measured memory_bytes: 256
'use strict';
const fs = require('fs');
const mod = BigInt(1e9+7);


class ABC041 {
  static A(input) {
    var s, i
    input = input.trim().split('\n');
    [s, i] = input;
    i = parseInt(i, 10);
    console.log(s[i-1]);
  }
  static B(input) {
    var a, b, c;
    input = input.trim().split(' ').map(BigInt);
    [a, b, c] = input;
    var ans = a * b % mod * c % mod;
    ans = Number(ans);
    console.log(ans);
  }
  static C(input) {
    var [n, height] = input.trim().split('\n');
    height = height.split(' ').map(n => parseInt(n, 10));
    n = parseInt(n, 10);
    var height = Object.keys(height).map(key => [parseInt(key, 10)+1, height[key]]);
    height.sort(function(first, second) {
      return (second[1] - first[1]);
    });
    for (var [i, _] of height) {console.log(i);}
  }
  static D(input) {
    var lines = input.trim().split('\n');
    var [n, m] = lines[0].split(' ').map(x => +x);
    var edges = new Array(n).fill(0);
    for (var i = 0; i < m; i++) {
      var [x, y] = lines[1+i].split(' ').map(x => +x);
      edges[x-1] |= 1<<(y-1);
    }
    var comb = new Array(1<<n).fill(null); comb[0] = 1;
    function count(edges, bit) {
      if (comb[bit] != null) {return comb[bit];}
      comb[bit] = 0;
      for (var i = 0; i < n; i++) {
        if (bit>>i&1 && !edges[i]) {
          var nxt_bit = bit & ~(1<<i);
          var nxt_edges = edges.slice();
          for (var j = 0; j < n; j++) {
            nxt_edges[j] &= ~(1<<i);
          }
          comb[bit] += count(nxt_edges, nxt_bit);
        }
      }
      return comb[bit];
    }
    console.log(count(edges, (1<<n)-1));
  }
}

class ABC173 {
  static A(input) {
    var n = +input.trim();
    console.log(Math.floor((n+999)/1000)*1000 - n);
  }
  static B(input) {
    var lines = input.trim().split('\n');
    var n = +lines[0];
    var cnt = {
      'AC': 0,
      'WA': 0,
      'TLE': 0,
      'RE': 0
    }
    for (var i = 0; i < n; i++) {
      cnt[lines[1+i]]++;
    }
    for (var [verd, c] of Object.entries(cnt)) {
      console.log(`${verd} x ${c}`);
    }
  }
  static C(input) {
    var lines = input.trim().split('\n');
    var [h, w, k] = lines[0].split(' ').map(x => +x);
    var c = lines.slice(1);
    var tot = 0;
    for (var i = 0; i < (1<<h); i++) {
      for (var j = 0; j < (1<<w); j++) {
        var cnt = 0;
        for (var y = 0; y < h; y++) {
          if (i>>y&1) continue;
          for (var x = 0; x < w; x++) {
            if (j>>x&1)continue;
            cnt += c[y][x]=='#';
          }
        }
        tot += cnt == k;
      }
    }
    console.log(tot);
  }
  static D(input) {
  }
  static E(input) {
  }
  static F(input) {
  }
}


var input = fs.readFileSync('/dev/stdin', 'utf8');
ABC173.C(input);

Measured memory_bytes: 32340
#include<iostream>
#include<algorithm>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
#define Max(a,b) a=max(a,b);
typedef long long ll;
using namespace std;
#define N 5010
#define M 210
ll a[M][N],A[M][N],b[N],B[N],n,m;
int main(){
    cin>>n>>m;
    lol(i,n-1){
	cin>>b[i];
	B[i+2]=b[i];
    }
    lol(i,n)lol(j,m)scanf("%lld",&a[j][i]);
    lol(i,m){
	A[i][0]=0;
	lol(j,n)A[i][j+1]=max(A[i][j],a[i][j]);
    }
    B[0]=B[1]=0;
    lol(i,n)B[i+1]+=B[i];
    lol(i,n+1){
	B[i]=-B[i];
	lol(j,m)B[i]+=A[j][i];
    }
    ll ans=0;
    lol(i,n){
	ll gre=0;
	for(int j=i+1;j<=n;j++)Max(gre,B[j]);
	Max(ans,gre);
	lol(j,m){
	    ll maxi=-1;
	    for(int k=i+2;k<=n;k++){
		if(a[j][k-1]>=a[j][i])break;
		Max(maxi,a[j][k-1]);
		B[k]-=A[j][k];
		A[j][k]=maxi;
		B[k]+=A[j][k];
	    }
	}
	lol(j,n+1)B[j]+=b[i];
    }
    cout<<ans<<endl;
    return 0;
}


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

int main(){
  int n;
  cin >> n;
  map<int, vector<int>> m;
  rep(i, n-1){
    int a, b;
    cin >> a >> b;
    m[a].push_back(b);
    m[b].push_back(a);
  }
  queue<int> que;
  vector<int> color(n+1, 0);
  color[1] = 1, color[n] = -1;
  que.push(1); que.push(n);
  while(!que.empty()){
    int g = que.front(); que.pop();
    rep(i, m[g].size()){
      if(color[m[g][i]] == 0 && color[g] == 1){
        color[m[g][i]] = 1;
        que.push(m[g][i]);
      } else if (color[m[g][i]] == 0 && color[g] == -1){
        color[m[g][i]] = -1;
        que.push(m[g][i]);
      }
    }
  }
  int black = 0, white = 0;
  rep(i, n){
    if(color[i+1] == 1) black++;
    else white++;
  }
  if(black > white) cout << "Fennec" << endl;
  else cout << "Snuke" << endl;
  return 0;
}


Measured memory_bytes: 11520
n = int(input())

def gen_primes(limit):
    prime_table = [True] * (limit + 1)
    prime_table[0] = False
    prime_table[1] = False
    for i in range(2, int(limit**.5)+1):
        prime_table[i+i::i] = [False] * (limit//i-1)
    return prime_table

primes = gen_primes(10**5)
like2017 = [0] * len(primes)

for i in range(1, len(primes), 2):
    if primes[i] and primes[(i+1)//2]:
        like2017[i] = 1

from itertools import accumulate
like2017 = list(accumulate(like2017))
for _ in range(n):
    l,r = list(map(int, input().split()))
    print(like2017[r] - like2017[l-1])

Measured memory_bytes: 14400
from collections import Counter
N = int(input())
A = list(map(int, input().split()))

c = Counter(A)

ans = 0
memoflg = False

for k,v in c.most_common():
  #print(k,v)
  while v > 1:
    if v >= 3:
      v -= 2
      ans += 1
    elif v == 2:
      if memoflg:
        memoflg = False
        ans += 1
      else:
        memoflg = True
      v -= 1

if memoflg:
  ans += 1
  
print(N - ans * 2)

Measured memory_bytes: 21980
#include<iostream>
#include<vector>
#include<string>

using namespace std;
typedef vector< vector<int> > vv;
#define INF 1e9

//連続不等号使えると勘違い

void go_next(int I,int J,vv& dp,vector<string> x,int w,int h){
  //cout << 0 << endl;
  if(I<h-1){
    //cout << I << endl;
    if(x[I+1][J]=='.' and dp[I+1][J]>dp[I][J]+1){
      dp[I+1][J]=dp[I][J]+1;go_next(I+1,J,dp,x,w,h);
    }
  }
  if(0<I){
    //cout << 1 << endl;
    if(x[I-1][J]=='.' and dp[I-1][J]>dp[I][J]+1){
      dp[I-1][J]=dp[I][J]+1;go_next(I-1,J,dp,x,w,h);
    }
  }
  if(J<w-1){
    //cout << 2 << endl;
    if(x[I][J+1]=='.' and dp[I][J+1]>dp[I][J]+1){
      dp[I][J+1]=dp[I][J]+1;go_next(I,J+1,dp,x,w,h);
    }
  }
  if(0<J){
    //cout << 3 << endl;
    if(x[I][J-1]=='.' and dp[I][J-1]>dp[I][J]+1){
      dp[I][J-1]=dp[I][J]+1;go_next(I,J-1,dp,x,w,h);
    }
  }
}

int main(){
  int h ,w;cin >> h >> w;
  vv dp(h,vector<int>(w,INF));dp[0][0]=1;
  vector<string> x(h);for(int i=0;i<h;i++)cin >>x[i];
  int c=0;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(x[i][j]=='.'){c+=1;}
    }
  }
  //cout << 0 << endl;
  go_next(0,0,dp,x,w,h);
  //cout << 0 << endl;
  if(dp[h-1][w-1]==INF)cout << -1 << endl;
  else cout << c-dp[h-1][w-1] << endl;
}


Measured memory_bytes: 2560
#include<iostream>
#include<queue>
#include<vector>

using namespace std;

struct P{short c,r;};
struct State{
  int t;
  short pos, remain;
  bool operator < (const State& st) const {
    return t > st.t;
  }
};

const int MAX = 5005;
const int INF = (1<<25);
int T[MAX][MAX];
vector<short> Edge[MAX];
P price[MAX];
short N,K;

void input(){
  cin >> N >> K;
  for(int i = 0; i < N; i++) cin >> price[i].c >> price[i].r;
  for(int i = 0; i < K; i++){
    int a,b;
    cin >> a >> b;
    a--;b--;
    Edge[a].push_back(b);
    Edge[b].push_back(a);
  }
}

void solve(){
  fill(T[0], T[0]+MAX*MAX, INF);

  T[0][0] = 0;
  priority_queue<State> Q;
  Q.push((State){0,0,0});
  while(!Q.empty()){
    const State now = Q.top();
    Q.pop();

    if(now.t > T[now.pos][now.remain]) continue;

    if(now.remain > 0){
      for(int i = 0; i < (int)Edge[now.pos].size(); i++){
	State nex = now;
	nex.pos = Edge[now.pos][i];
	nex.remain--;

	if(T[nex.pos][nex.remain] > nex.t){
	  T[nex.pos][nex.remain] = nex.t;
	  Q.push(nex);
	}
      }
    }

    State nex = now;
    nex.t += price[now.pos].c; 
    nex.remain = price[now.pos].r;
    if(T[nex.pos][nex.remain] > nex.t){
      T[nex.pos][nex.remain] = nex.t;
      Q.push(nex);
    }
  }

  
  int ans = INF;
  for(int i = 0; i < MAX; i++) ans = min(ans,T[N-1][i]);
  cout << ans << endl;
}

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

Measured memory_bytes: 99488
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double EPS = 1e-8;

template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}
template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}

int main(){
    int x, y;
    cin >> x >> y;
    if(y&1) {
        cout << "No" << '\n';
        return 0;
    }
    y /= 2;
    if(x <= y && y <= x * 2) {
        cout << "Yes" << '\n';
    }
    else {
        cout << "No" << '\n';
    }
    return 0;
}

Measured memory_bytes: 3596
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>

using namespace std;

int main() {
   int N, tmp;
   cin >> N;
   map <int, int> log;
   for (int i = 0; i < N; i++) {
      cin >> tmp;
      log[tmp]++;
   }
   int ans = 0;
   for (auto it = log.begin(); it != log.end(); ++it) {
      if (it->second % 2 != 0) ans++;
   }
   cout << ans << endl;
   return 0;
}


Measured memory_bytes: 4864
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <map>
#include <limits>
using namespace std;
typedef long long ll;

float inf = std::numeric_limits<float>::infinity();

/* 二次元配列の宣言
  vector<vector<int>> tb;
  tb.resize(H);
  for (size_t i = 0; i < H; i++) {
    tb[i].resize(W);
  }
*/
/*
  A.resize(N);
  for (int i = 0; i < N; i++) {scanf("%d",&A[i]);}
*/

int main(void) {
  char c;
  array<char,5> boin={'a','e','i','o','u'};
  cin >> c;

  for (size_t i = 0; i < 5; i++) {
    if (boin[i]==c){
      cout << "vowel" << '\n';
      exit(0);
    }
  }
  cout << "consonant" << '\n';
}


Measured memory_bytes: 256