akhauriyash/Code-Regression huggingface dataset:
_ = int(input())
an = list(map(int,input().split()))

odd = list(filter((lambda x:x%2==1),an))
div4 = list(filter((lambda x:x%4 ==0),an))
div2 = set(an).difference(set(odd)).difference(set(div4))
if len(div2) == 0:
  div4.append(0)
if len(odd) <= len(div4):
  print('Yes')
else:
  print('No')

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(n);(i)++)
#define repr(i,n) for(int (i)=(n)-1;(i)>=0;(i)--)
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define mod 1000000007
#define inf 10000000000000


typedef long long ll;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef pair<int,int> pint;
typedef pair<ll,ll> pll;
typedef vector<pint> vpint;

vint pos(5);
int k;
bool check=true;

int main(){
    int x,y;
    cin>>x>>y;
    cout<<x+y/2<<endl;
}

Measured memory_bytes: 256
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

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


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


// aよりもbが大きいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmax(T & a, const T & b) {
	if (a < b) {
		a = b;  // aをbで更新
		return true;
	}
	return false;
}
// aよりもbが小さいならばaをbで更新する
// (更新されたならばtrueを返す)
template <typename T>
bool chmin(T & a, const T & b) {
	if (a > b) {
		a = b;  // aをbで更新
		return true;
	}
	return false;
}


#define ARRAY_MAX 100005
const int INF = 1e9 + 7;
const ll MOD = 1e9 + 7;

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


/******************************************************************************************/



int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);

	ll n,m;

	while(cin >> n >> m,n){


		ll ans = 0;
		vector<string> N(n);
		vector<int> M(n);

		for (int i = 0; i < n; i++)
		{
			cin >> N[i] >> M[i];
			reverse(N[i].begin(),N[i].end());
		}
		
		vector<string> kuji(m);
		for (int i = 0; i < m; i++)
		{
			cin >> kuji[i];
			reverse(kuji[i].begin(),kuji[i].end());
		}
		//kuji
		for (int i = 0; i < m; i++)
		{
			//prize
			for (int j = 0; j < n; j++)
			{
				//cout << "i= " << i << endl;
				bool flag = true;
				for (int k = 0; k < 8; k++)
				{
					if(N[j][k] == '*'){
						break;
					}
			
					flag &= (kuji[i][k] == N[j][k]);
				}
				if(flag){
					ans += M[j];
				}

			}
	
		}
	
		cout << ans << endl;
	}
	



	return 0;
}




Measured memory_bytes: 3100
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	long long h, g;
	cin >> h;
	g = h;
	long long c = 0;
	while(g != 1){
		g =g/ 2;
		c ++;
	}
	long long an = pow(2, c) * 2 - 1;
	cout << an << endl;
	return 0;
}


Measured memory_bytes: 256
# 初期入力
H,W = (int(x) for x in input().split())
S = [list(input()) for i in range(H)]
import numpy as np
S_np = (np.array(S) ==".")*1 #文字を数字に変換 Trueの所のみ演算、Falseは０


#置いたマス(i,j)から4方向探す
L = np.zeros((H,W),dtype=int)
R = np.zeros((H,W),dtype=int)
U = np.zeros((H,W),dtype=int)
D = np.zeros((H,W),dtype=int)
for i in range(W):
    # if S_int[i,j] ==0:これはいらない？⇒*S_npで１or０をかけてるから不要
    if i == 0: 
        L[:,i]      = S_np[:,i]
        R[:,W-i-1]  = S_np[:,W-i-1]
    else:
        L[:,i]      = (L[:,i-1] +1) * S_np[:,i]
        R[:,W-i-1]  = (R[:,W-i] +1) * S_np[:,W-i-1]

for i in range(H):
    if i == 0: 
        D[i,:]      = S_np[i,:]
        U[H-i-1,:]  = S_np[H-i-1,:]
    else:
        D[i,:]      = (D[i-1,:] +1) * S_np[i,:]
        U[H-i-1,:]  = (U[H-i,:] +1) * S_np[H-i-1,:]

#各方向を位置ごとに足す(numpyなら足すだけで行列の和) 
light = L + R + D + U -3 #基準点を4方向＋１してるからー３
light_max = np.max(light)
print(light_max)

Measured memory_bytes: 266636
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <time.h>
#define int long long
#define endl '\n'
#define INF 1000000000000000000
#define EPS 1e-10
#define all(a) a.begin(),a.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define fi first
#define se second
#define pb push_back
#define double long double
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
template<class T, class S> bool chmax(T &a, const S &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class S> bool chmin(T &a, const S &b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); }
ll lcm(ll n, ll m) { return n / gcd(n, m)*m; }

ll mod = 1000000007;
ll modsize = 1000010;

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

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

vector<ll> fac(modsize + 5);
vector<ll> inv(modsize + 5);
vector<ll> facinv(modsize + 5);

void modcalc() {
	fac[0] = fac[1] = 1; inv[1] = 1;
	facinv[0] = facinv[1] = 1;
	for (int i = 2; i < modsize; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod%i] * (mod / i) % mod;
		facinv[i] = facinv[i - 1] * inv[i] % mod;
	}
}

ll modcomb(ll n, ll k) {
	if (n < 0 || k < 0 || n < k) return 0;
	return fac[n] * facinv[k] % mod * facinv[n - k] % mod;
}

ll modperm(ll n, ll k) {
	if (n < 0 || k < 0 || n < k) return 0;
	return fac[n] * facinv[n - k] % mod;
}

ll modhom(ll n, ll k) {
	if (n < 0 || k < 0) return 0;
	if (n == 0 && k == 0) return 1;
	return modcomb(n + k - 1, k);
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	modcalc();

	int n;
	cin >> n;
	n--;
	int ans = 0;
	int cnt = 0;
	for (int i = (n + 1) / 2; i <= n; i++) {
		cnt = fac[i] * fac[n - i] % mod*modcomb(i - 1, n - i) % mod;
		cnt -= fac[i - 1] * fac[n - i + 1] % mod*modcomb(i - 2, n - i + 1) % mod;
		if (cnt < 0) cnt += mod;
		ans += cnt * i;
		ans %= mod;
	}
	cout << ans << endl;
}

Measured memory_bytes: 23808
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vvb> vvvb;
typedef vector<vvvb> vvvvb;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<ll, ll> PL;
typedef vector<PL> vpl;
typedef vector<vector<PL>> vvpl;
const int INF = 1001001001;
const ll LINF = 1e17;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define RFOR(i, a, b) for(ll i = (a); i > b; i--)
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, n) for(ll i = n-1; i > -1; i--)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define epb emplace_back

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}

inline ll popcnt(ll x){return __builtin_popcount((unsigned int)x);};
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }

ll D;
ll ok(vl x, vl y){
    ll sq = 0;
    rep(i, D){
        sq += (x[i]-y[i])*(x[i]-y[i]);
    }
    rep(i, 1000){
        if(sq == i*i) return 1;
    }
    return 0;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll N; cin >> N >> D;
    vvl X(N, vl(D));
    rep(i, N) rep(j, D) cin >> X[i][j];
    ll ans = 0;
    rep(i, N) FOR(j, i+1, N){
        ans += ok(X[i], X[j]);
    }
    cout << ans << endstr;
    return 0;
}


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

int h,w,k;
string ss[15];
int cnt[15];
int z;
int ro = 0;

int checkCut(int jj){
	int cc= 0;
	int ro = 0;

	for(int i =0;i<h;i++){
		//update cnt of row
			cnt[ro] += ss[i][jj] == '1';

		//check if need to cut
		if(cnt[ro] > k){
			cc = 1;
		}

		//adjust for horiontal cut already 
		if(z>>i & 1){
			ro ++;
		}
	}

	return cc;
}

int main(){
	int ans = 1e9;
	cin>>h>>w>>k;
	for(int i =0;i<h;i++){
		cin>>ss[i];
	}

	//bitmask for horizontal cuts
	//001 means cut on the third
	//100 means cut on the first
	for(z = 0;z< 1<<(h-1);z++){
		memset(cnt, 0, sizeof(cnt));
		int tot = __builtin_popcount(z);
		int re = 0;

		for(int j =0;j<w;j++){
			//if no of 1s>k 
			if(checkCut(j)){

				memset(cnt, 0, sizeof(cnt));
				tot ++;
				//?
				re = checkCut(j);
			}

		}

		//why !re when re == 0
		//else means no need vertical cut
		if(!re) ans= min(ans,tot);
	}

	cout<<ans;
}

Measured memory_bytes: 256
A, B, C, X, Y = map(int, input().split())
if A+B <= 2*C:
    ans = A*X+B*Y
else:
    c = min(X, Y)
    x = X-c
    y = Y-c
    ans = 2*C*c +min(A*x+B*y, 2*C*x+2*C*y)
print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<climits>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<bitset>
#include<iomanip>
using namespace std;

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define rep2(i,j,n) for(int i=(j);i<=(n);i++)
#define all(i) i.begin(),i.end()

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<int, int> pi;
typedef long long i64;

int main() {
	string s;
	cin >> s;
	int ans = 700;
	rep(i, 0, 3) {
		if (s[i] == 'o') {
			ans += 100;
		}
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <cstdio>

int main()
{
  int n;
  while (~scanf("%d", &n)) {
    if (n == 0)
      break;

    int ans = 0;
    while (n > 0) {
      ans += n / 5;
      n /= 5;
    }

    printf("%d\n", ans);
  }
  return 0;
}

Measured memory_bytes: 0
/*
ID: iCoder0020
PROG: Vacation
LANG: C++                  
*/

#include <bits/stdc++.h>

using namespace std;

typedef long long int li;

int main()
{
	int N;
	cin>>N;
	li A[N];
	li B[N];
	li C[N];
	for(int n = 0; n<N; n++)
	{
		cin>>A[n]>>B[n]>>C[n];
	}
	li dp[N][3];
	
	dp[N-1][0] = A[N-1];
	dp[N-1][1] = B[N-1];
	dp[N-1][2] = C[N-1];

	for(int n = 2; n<=N; n++)
	{
		dp[N-n][0] = max(dp[N-n+1][1], dp[N-n+1][2]) + A[N-n];
		dp[N-n][1] = max(dp[N-n+1][0], dp[N-n+1][2]) + B[N-n];
		dp[N-n][2] = max(dp[N-n+1][0], dp[N-n+1][1]) + C[N-n];
	}

	li ans = max(dp[0][0], dp[0][1]);
	ans = max(ans, dp[0][2]);

	cout<<ans<<endl;

	return 0;	
}

Measured memory_bytes: 4992
n = int(input())
s = input()
res = 0
l, r = 0, n - 1
while l < r:
    if s[l] != 'W':
        l += 1
    elif s[r] != 'R':
        r -= 1
    else:
        res += 1
        l += 1; r -= 1
print(res)


Measured memory_bytes: 65564
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


int main(){

	ll A,B,N;
	scanf("%lld %lld %lld",&A,&B,&N);

	printf("%lld\n",(A*min(B-1,N))/B);

	return 0;
}


Measured memory_bytes: 3824
import std.algorithm, std.container, std.conv, std.math, std.range, std.typecons, std.stdio, std.string;

auto rdsp(){return readln.splitter;}
void pick(R,T)(ref R r,ref T t){t=r.front.to!T;r.popFront;}
void readA(T)(size_t n,ref T[]t){t=new T[](n);auto r=rdsp;foreach(ref v;t)pick(r,v);}

void main()
{
  int[] s; readA(3, s);
  s.sort();
  writeln(s.equal([5, 5, 7]) ? "YES" : "NO");
}


Measured memory_bytes: 256
n = w = s = e = 0
for c in input():
	if c == "N":
		n += 1
	if c == "W":
		w += 1
	if c == "S":
		s += 1
	if c == "E":
		e += 1
b = ((n >= 1 and s >= 1) or (n==s==0)) and ((w >= 1 and e >= 1) or (w==e==0))
print("Yes" if b else "No")



Measured memory_bytes: 3064
#include <set>
    #include <map>
    #include <list>
    #include <queue>
    #include <stack>
    #include <cmath>
    #include <ctime>
    #include <cstdio>
    #include <vector>
    #include <string>
    #include <bitset>
    #include <cctype>
    #include <cstdlib>
    #include <cstring>
    #include <utility>
    #include <numeric>
    #include <complex>
    #include <sstream>
    #include <fstream>
    #include <iomanip>
    #include <cassert>
    #include <iostream>
    #include <iterator>
    #include <algorithm>
    using namespace std;
    typedef long long ll;
    typedef vector<int> vint;
    typedef pair<int, int> pint;
    #define rep(i, n) REP(i, 0, n)
    #define all(v) v.begin(), v.end()
    #define REP(i, x, n) for(int i = x; i < n; i++)
    #define INF 2e9
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b,c,d,x,flag=0,count=0,count2=0,count3=0,count4=0;
  string s,s2,s3;
  cin>>s;
  a=s.size();
  rep(i,a){
    if(s[i]=='N'){
      count++;
    }
    if(s[i]=='W'){
      count2++;
    }
    if(s[i]=='S'){
      count3++;
    }
    if(s[i]=='E'){
      count4++;
    }
  }
  if((count>=1 && count3>=1) || (count==0 && count3==0)){
    if((count2>=1 && count4>=1) || (count2==0 && count4==0)){
      cout<<"Yes"<<'\n';
      return(0);
    }
  }
  cout<<"No"<<'\n';

  return(0);
}


Measured memory_bytes: 256
A,B,C,K=map(int,input().split())

sum=0
import sys
if K>A:
    sum+=A
    K=K-A
else:
    sum+=K
    print(sum)
    sys.exit()
if K>B:
    K=K-B
else:
    print(sum)
    sys.exit()
if K>C:
    sum-=C
    print(sum)
else:
    sum-=K
    print(sum)


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

const ll MOD = ll(1e9 + 7);
ll dp[110][8];

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
#ifdef LOCAL
	std::ifstream in("in");
	std::cin.rdbuf(in.rdbuf());
#endif

	int H, W, K;
	cin >> H >> W >> K;
	K--;
	dp[0][0] = 1;
	for(int i = 0; i < H; i++){
		for(int j = 0; j < W; j++){
			for(int bit = 0; bit < 1 << (W - 1); bit++){
				bool ok = true;
				for(int k = 0; k < W - 2; k++){
					if(bit >> k & 1 && (bit >> (k + 1)) & 1) ok = false;
				}
				if(!ok) continue;

				int nj = j;
				if(bit >> j & 1) nj = j + 1;
				if((bit >> (j - 1)) & 1) nj = j - 1;
				dp[i + 1][nj] += dp[i][j];
				dp[i + 1][nj] %= MOD;
			}
		}
	}


	cout << dp[H][K] << endl;
}


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

int main() {
    int N, K;
    string S;
    cin >> N >> K >> S;

    for (int i = 0; i < N; i++) {
        if (i + 1 == K) {
            cout << (char)tolower(S.at(i));
        } else {
            cout << S.at(i);
        }
    }
    cout << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<boost/multiprecision/cpp_int.hpp>
using namespace std;
using namespace boost::multiprecision;
#define BEGIN ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define END return EXIT_SUCCESS
#define rep(I,N) for(auto I=0;I<(N);++I)
#define up(I,A,B) for(auto I=(A);I<=(B);++I)
#define dw(I,A,B) for(auto I=(A);I>=(B);--I)
#define all(C) (C).begin(),(C).end()
#define rall(C) (C).rbegin(),(C).rend()
#define ft first
#define sd second
#define mp make_pair
#define mt make_tuple
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define rs resize
typedef long long ll;
typedef unsigned long long ull;
template<class T>inline void                                      in(T &p){cin>>p;}
template<class T1,class T2>inline void                            in(T1 &p1,T2 &p2){cin>>p1>>p2;}
template<class T1,class T2,class T3>inline void                   in(T1 &p1,T2 &p2,T3 &p3){cin>>p1>>p2>>p3;}
template<class T1,class T2,class T3,class T4>inline void          in(T1 &p1,T2 &p2,T3 &p3,T4 &p4){cin>>p1>>p2>>p3>>p4;}
template<class T1,class T2,class T3,class T4,class T5>inline void in(T1 &p1,T2 &p2,T3 &p3,T4 &p4,T5 &p5){cin>>p1>>p2>>p3>>p4>>p5;}
template<class T>inline void                                      ins(T &p){for_each(all(p),in<decltype(p[0])>);}
template<class T>inline void                             out(T p){cout<<p<<endl;}
template<class T1,class T2>inline void                   out(T1 p1,T2 p2){cout<<p1<<" "<<p2<<endl;}
template<class T1,class T2,class T3>inline void          out(T1 p1,T2 p2,T3 p3){cout<<p1<<" "<<p2<<" "<<p3<<endl;}
template<class T1,class T2,class T3,class T4>inline void out(T1 p1,T2 p2,T3 p3,T4 p4){cout<<p1<<" "<<p2<<" "<<p3<<" "<<p4<<endl;}
inline                                              void out(double p){printf("%.10f\n",p);}
template<class T>inline                             void outs(T p){for_each(all(p),out<decltype(p[0])>);}

inline void solve(void){
  double a,b,x;
  in(a,b,x);
  if(a*a*b==x)out(0);
  else if(x<=a*a*b/2)out(atan((a*b*b)/(2*x))*180/M_PI);
  else out(atan(2*(a*a*b-x)/(a*a*a))*180/M_PI);
}
int main(int argc,char**argv){
  BEGIN;
  solve();
  END;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
int A,B,C;
cin>>A>>B>>C;
if(A==B){
    if(C!=A){
        cout<<"Yes"<<endl;
        return 0;
    }
}
if(B==C){
    if(A!=C){
        cout<<"Yes"<<endl;
        return 0;
    }
}
if(A==C){
        if(B!=A){
        cout<<"Yes"<<endl;
        return 0;
    }
}
cout<<"No"<<endl;
}

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

const long double EPS = 1e-10;
const long long INF = 1e18;
const int MOD = (int)1e9 + 7;
const long double PI = acos(-1.0L);

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(n);
  rep(i, m) {
    int k;
    cin >> k;
    rep(j, k) {
      int s;
      cin >> s;
      s--;
      a[s] |= 1 << i;
    }
  }
  int p = 0;
  rep(i, m) {
    int x;
    cin >> x;
    p |= x << i;
  }
  int ans = 0;
  for (int s = 0; s < (1 << n); s++) {
    int t = 0;
    rep(i, n) {
      if (s >> i & 1) {
        t ^= a[i];
      }
    }
    if (t == p) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3612
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, string> P;
typedef tuple<int, string, string> T;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int x;

int solve() {
    if (x < 600) return 8;
    if (x < 800) return 7;
    if (x < 1000) return 6;
    if (x < 1200) return 5;
    if (x < 1400) return 4;
    if (x < 1600) return 3;
    if (x < 1800) return 2;
    return 1;
}

void input() {
    cin >> x;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    cout << solve() << endl;
}


Measured memory_bytes: 3120
import math
a,b,c = map(int,input().split())
print(float(0.5*a*b*math.sin(c*math.pi/180)))
print(float(a+b+math.sqrt(a**2 + b**2 - 2*a*b*math.cos(c*math.pi/180))))
print(float(b*math.sin(c*math.pi/180)))




Measured memory_bytes: 5708
#include <iostream>

using namespace std;

int main() {
    int r, g, b;
    cin >> r >> g >> b;

    if ((r * 100 + g * 10 + b) % 4 == 0) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}


Measured memory_bytes: 2992
#include<iostream>
#include<string>
#include<cstring>
using namespace std;

int main()
{
	//?????????
	int num1=0,num2=0,num3=0,num4=0,num5=0,num6=0,num7=0,t=0,p=0,h=0;
	cin>>num1>>num2>>num3>>num4>>num5;
	if(num1>num2){
		t=num1;
		num1=num2;
		num2=t;
	}
	if(num1>num3){
		p=num1;
		num1=num3;
		num3=p;
	}
	if(num4>num5){
		h=num4;
		num4=num5;
		num5=h;
	}
	num6=num1+num4-50;
	cout<<num6;
	cout<<"\n";
	return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

#define fi first
#define se second
#define repl(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define rep(i,n) repl(i,0,n)
#define each(itr,v) for(auto itr:v)
#define pb push_back
#define all(x) (x).begin(),(x).end()
#define dbg(x) cout<<#x"="<<x<<endl
#define mmax(x,y) (x>y?x:y)
#define mmin(x,y) (x<y?x:y)
#define maxch(x,y) x=mmax(x,y)
#define minch(x,y) x=mmin(x,y)
#define uni(x) x.erase(unique(all(x)),x.end())
#define exist(x,y) (find(all(x),y)!=x.end())
#define bcnt __builtin_popcount

#define INF INT_MAX/3

int n;
ll a[211111];
vector<ll> res;

int main(){
	cin.sync_with_stdio(false);
  cin>>n;
  rep(i,n){
    cin>>a[i];
  }
  for(int i=n-1;i>=0;i--){
    if(i%2==0)res.push_back(a[i]);
  }
  rep(i,n){
    if(i%2==1)res.push_back(a[i]);
  }
  if(n%2==0)reverse(all(res));
  rep(i,n)printf("%lld%c", res[i],i==n-1?'\n':' ');
	return 0;
}


Measured memory_bytes: 5488
import java.io.IOException;
import java.io.InputStream;
import java.util.Arrays;
import java.util.NoSuchElementException;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		int N = sc.nextInt();
		int min = Integer.MAX_VALUE;
		int max = 0;
		for (int i = 0; i < N; i++) {
			int a = sc.nextInt();
			min = Math.min(min, a);
			max = Math.max(max, a);
		}
		System.out.println(max - min);
	}

	private static class Is {
		int a;
		int b;
		Is (int a, int b) {
			this.a = a;
			this.b = b;
		}
	}

	public static long gcd(long a, long b) {
		long remainder = a % b;
		if (remainder == 0) {
			return b;
		} else {
			return gcd(b, remainder);
		}
	}
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }

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

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

    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr]))
            ptr++;
        return hasNextByte();
    }

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

    public long nextLong() {
        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();
        }
    }

    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
            throw new NumberFormatException();
        return (int) nl;
    }

    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


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

int main(){
    int N;
    cin >> N;
    vector<pair<int,int>> v(N+1);
    for(int i=1;i<=N;i++){
        int a;
        cin >> a;
        v[i] = {a,i};
    }
    sort(v.begin()+1,v.end());
    for(int i=1;i<=N;i++) cout << v[i].second << (i!=N? " ":"\n");
}

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


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

    int answer[200000] = {0};

    for(int j=1; j<N; j++){
        answer[A[j]-1]++; 
    }

    for(int k=0; k<N; k++){
        cout << answer[k] << endl;
    }




    return 0;
}

Measured memory_bytes: 5192
#include<iostream>                          
#include<vector>                    
 #include<bits/stdc++.h>

#define mod 998244353
#define pi 3.14159265358979
#define  PRE(x,p) cout<<setprecision(x)<<p; 
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define endl "\n"
#define high INT_MAX
#define low INT_MIN
#define ll long long int
using namespace std;
ll a[500005],n;
vector<ll>v; 
vector<ll>vec[200005];
bool vis[200005];
vector<vector<ll>>conn;

vector<ll>temp;
void dfs(ll u)
{
      vis[u]=true; 
      temp.pb(u);
      ll j;
      for(j=0;j<vec[u].size();j++)
      {
              if(vis[vec[u][j]])
              continue;
              else
              {
                     dfs(vec[u][j]);
              }
      }
      
}
void solve() 
{   ll m,i;
        cin>>n>>m;
        ll u,v;
  map<pair<ll,ll>,ll>ma;
  for(i=1;i<=n;i++)
  vis[i]=false;
  for(i=1;i<=m;i++)
  {
          cin>>u>>v;
          if(u>v)
          swap(u,v);
          if(ma.count(mp(u,v))>0)
          continue;
          else
          {
                  ma[{u,v}]=1;
                  vec[u].pb(v);
                  vec[v].pb(u);
                  
          }
  }
  for(i=1;i<=n;i++)
 { if(!vis[i])
   { if(i!=1)conn.pb(temp);
   temp.clear();
   dfs(i);  }
   
   
 }
 if(temp.size()!=0)
   conn.pb(temp);
//   for(i=1;i<=n;i++)
//   {
//           for(ll j=0;j<vec[i].size();j++)
//           cout<<vec[i][j]<<' ';
//           cout<<endl;
//   }
  //creating components;
  ll ans=0;
  for(i=0;i<conn.size();i++)
ans=max(ans,(ll)conn[i].size());
//    cout<<conn[i].size()<<' ';
  cout<<ans;
  
}
 
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
ll t=1;
//cin>>t;
// for(z=1;z<=t;z++)
solve();
 
return 0;
}

Measured memory_bytes: 39508
var GET=(function(){function f(s){return new g(s);}function g(s){this._s=s.trim().split("\n");this._y=0;}g.prototype.a=function(f){var s=this._s, y=this._y, r;if(typeof s[y]==="string")s[y]=s[y].split(" ").reverse();r=s[y].pop();if(!s[y].length)this._y++;return f?r:+r;};g.prototype.l=function(f){var s=this._s[this._y++].split(" ");return f?s:s.map(a=>+a);};g.prototype.m=function(n,f){var r=this._s.slice(this._y,this._y+=n).map(a=>a.split(" "));return f?r:r.map(a=>a.map(a=>+a));};g.prototype.r=function(n,f){var r=this._s.slice(this._y,this._y+=n);return f?r:r.map(a=>+a);};return f;})();
var o=GET(require("fs").readFileSync("/dev/stdin","utf8"));

console.log(main());
function main(){
  var n = o.a();
  var a = o.a();
  var b = o.a();
  var p = o.l();
  var x = 0, y = 0;
  for(var i = 0; i < n; i++){
    if(p[i] <= a)x++;
    else if(p[i] > b)y++;
  }
  return Math.min(x,y,n-x-y);
}

Measured memory_bytes: 21192
import itertools,sys
def S(): return sys.stdin.readline().rstrip()
S = S()
ans = 0
for i,j in itertools.combinations_with_replacement(range(len(S)),2):
    if all(x in 'ACGT' for x in S[i:j+1]):
        ans = max(ans,j+1-i)
print(ans)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N; 
  int count = 0;
  cin >> N;
  vector<int> vec(N);
  for(int i=0; i<N; i++){
    cin >> vec.at(i);
  }
  sort(vec.begin(),vec.end());
  for(int i=0; i<vec.size(); i++){
    if(i==0){
      count++;
    }else{
      if(vec.at(i) > vec.at(i-1)){
        count++;
      }
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
/*
	In the name of Allah.
*/

#include <iostream>
#include <cstring>
#include <vector>
#include <set>
#include <cmath>
#include <algorithm>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
#define gap ' '
#define INF 99999999
#define L(i) ((i) & -(i))
 
const int MAXN = 1e5 + 10;


int main(){
	ll n; cin >> n;
	ll nu = 26; int len = 1;
	while(n > nu){
		n-=nu;
		nu*=26;
		len++;
	}
	string ans(len, '0');
	n--;
	for(int i = len-1; i >= 0; --i){
		ans[i] = n%26+'a';
		n/=26;
	}
	cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3104
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <string>
#include <tuple>
#include <functional>
#include <map>
#include <cmath>
using namespace std;

int S, dp[25000009], a[25000009], power[5000009], mod = 1000000007;
const int MAX_N = 25000000;

long long modpow(long long p, long long q, long long m) {
	long long r1 = 1, r2 = p;
	for (int i = 0; i < 30; i++) {
		if ((q&(1LL << i)) != 0) { r1 *= r2; r1 %= mod; }
		r2 *= r2; r2 %= mod;
	}
	return r1;
}

long long solve_2(long long n, long long k) {
	if (dp[k] > n) return 0;
	long long L = k, R = MAX_N, M, maxn = -1;
	for (int i = 0; i < 30; i++) {
		M = (L + R) / 2;
		if (dp[M] - dp[M - k] <= n) { maxn = max(maxn, M); L = M; }
		else { R = M; }
	}
	return maxn - (k - 1);
}

long long solve(long long n, long long k) {
	if (dp[MAX_N] - dp[MAX_N - k] <= n) {
		if (n%k == 0) {
			if (n / k <= 5000000) return ((power[n / k] - power[n / k - 1] + mod) - k + 1 + mod) % mod;
			return ((modpow(10, n / k, mod) - modpow(10, n / k - 1, mod) + mod) - k + 1) % mod;
		}
		return 1;
	}
	return solve_2(n, k) - solve_2(n - 1, k);
}

int main() {
	cin >> S;
	power[0] = 1; for (int i = 1; i <= 5000000; i++) power[i] = (1LL * power[i - 1] * 10LL) % mod;
	for (int i = 1; i <= 8; i++) {
		for (int j = power[i - 1]; j < power[i]; j++) {
			if (j > 25000000) break;
			a[j] = i;
		}
	}
	for (int i = 1; i <= 25000000; i++) dp[i] = dp[i - 1] + a[i];

	long long sum = 0;
	for (int i = 1; i <= min(MAX_N, 15000000); i++) {
		sum += solve(S, i); sum %= mod;
	}
	cout << sum << endl;
	return 0;
}

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

int main(void)
{
    string a,b;
    //int a,b,c,d;
    //char a,b,c;
    int i=0,sum=0;
    //char a,b='.';
    cin>>a;
    for(i=0;i<4;i++)
    {
        if(a[i]=='+') sum++;
        else sum--;
    }
    cout<<sum;
    return 0;
}



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

int main()
{
	double n;
	while (cin >> n)
	{
		double t = n / 9.8;
		double y = t * t * 4.9;
		int N = 0;
		for (N = 1;;N++)
		{
			if (y <= (N - 1) * 5)break;
		}
		cout << N << endl;
	}
	return 0;
}

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

int main() {
  int N; cin >> N;
  vector<int> A(N);
  map<int,int> map;
  for (int i =0; i<N; i++) {
    int a; cin >> a; A.at(i) = a;
    map[a] = i;
  }
  for (auto p : map) {
    int x = p.second + 1;
    cout << x << " ";
  }
  cout << endl;
}

Measured memory_bytes: 8272
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define SIZE 300005
#define MOD 1000000007LL
#define EPS 1e-10
#define INF 2147483647
#define LLINF 9223372036854775807LL
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define DOWN(i,b,a) for(int i=b;i>=a;i--)
#define SET(a,c) memset(a,c,sizeof a)
#define BIT(i,j) ((i)>>(j))&1
#define ALL(o) (o).begin(), (o).end()
#define ERASE(o) (o).erase(unique((o).begin(),(o).end()), (o).end())
#define SQ(x) ((x)*(x))
using namespace std;
typedef int_fast64_t ll;
typedef pair<ll,ll> Pll;
typedef pair<int, int> Pii;
typedef pair<double, double> Pdd;
typedef complex<double> dcomplex;
template<typename T> inline void priv(vector<T>a){REP(i,a.size()){cerr<<a[i]<<((i==a.size()-1)?"\n":" ");}}
inline void fastio(){cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15);}
ll gcd(ll a,ll b){ll c=max(a,b);ll d=min(a,b);return c==0||d==0?c:gcd(c%d,d);}
ll lcm(ll a,ll b){return a==0||b==0?0:a*b/gcd(a,b);}
ll modfact(ll a){ll b=1;FOR(i,2,a)b=b*i%MOD;return b;}
ll modpow(ll a, ll n){ll b=1;while (n>0){if(n&1)b=b*a%MOD;a=a*a%MOD;n>>=1;}return b;}
ll modcomb(ll n, ll k){ll b=1;k=min(n-k,k);DOWN(i,n,n-k+1)b=b*i%MOD;return b*modpow(modfact(k),MOD-2)%MOD;}

int N, M;
int A[301][301];
int current[301];
int selected[301];
int cnt[301];

inline int solve() {
    int ans = N;
    for(int k = 0; k < M - 1; k++) {
        for(int i = 0; i < M; i++) cnt[i] = 0;
        for(int i = 0; i < N; i++) {
            while(selected[A[i][current[i]]] == 0) current[i]++;
            cnt[A[i][current[i]]]++;
        }
        int tmp = 0, max_id;
        for(int i = 0; i < M; i++) {
            if(tmp < cnt[i]) {
                tmp = cnt[i];
                max_id = i;
            }
        }
        ans = min(ans, tmp);
        selected[max_id] = 0;
    }
    return ans;
}

int main() {
    fastio();
    cin >> N >> M;
    REP(i, N) REP(j, M) {
        cin >> A[i][j];
        A[i][j]--;
    }
    REP(i, M) selected[i] = 1;
    cout << solve() << "\n";
	return 0;
}

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

int N, M, X;
vector<int> A(101);

int main() {
    cin >> N >> M >> X;
    for(int i=0; i < M; i++) {
        int a;
        cin >> a;
        A[a]++;
    }

    int s = 0;
    for(int i = X; i <= N; i++) {
        s += A[i];
    }

    int s2 = 0;
    for(int i = X; i >= 0; i--) {
        s2 += A[i];
    }

    cout << min(s, s2) << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, a, n) for(ll i = (ll)a; i < (ll)n; i++)
#define FORR(i, n) for(ll i = (ll)n - 1LL; i >= 0LL; i--)
#define rep(i, n) FOR(i, 0, n)
#define ALL(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
template <typename T> using V = vector<T>;

constexpr int Mod = 998244353;
constexpr int mod = 1e9 + 7;
constexpr ll inf = 1LL << 60;

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

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

ll n, a, b;
V<ll> h;

bool f(const ll &mid) {
    V<ll> x = h;
    ll cnt = 0;
    rep(i, n) {
        x[i] -= b * mid;
        if(x[i] > 0) cnt += (x[i] + a - 1) / a;
    }
    return cnt <= mid;
}

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

    cin >> n >> a >> b;
    a -= b;
    h.resize(n);
    rep(i, n) cin >> h[i];
    sort(ALL(h), greater<int>());
    ll ng = 0, ok = 1e9;
    while(ng + 1 < ok)
        (f(ok + ng >> 1) ? ok : ng) = ok + ng >> 1;
    cout << ok << endl;

    return 0;
}

Measured memory_bytes: 1792
// A.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <cmath>

using namespace std;

int main() {
	char c;
	cin >> c;
	if (c < 'a') {
		cout << "A" << endl;
	} else {
		cout << "a" << endl;
	}
	return 0;
}


Measured memory_bytes: 3628
n, m = map(int, input().split())
l = list(map(int, input().split()))
x = 1 / 4 / m
cnt = 0
s = sum(l)
for i in l:
	if i >= x * s:
		cnt += 1
if cnt >= m:
	print('Yes')
else:
	print('No')

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <map>
#include <numeric>
#include <set>
#include <queue>
#include <list>
using namespace std;
typedef long long ll;
const int N = 2222222;
vector<ll> fact(N);
const int mod = 1e9 + 7;

ll power(ll a, ll b) {
	ll res = 1;
	while (b) {
		if (b & 1)res = res * a % mod;
		a = a * a % mod;
		b >>= 1;
	}
	return res;
}
ll c(ll a, ll b) {
	return fact[a] * power(fact[b], mod - 2) % mod * power(fact[a - b], mod - 2) % mod;
}

void solve() {
	ll k; cin >> k;
	string s; cin >> s;
	ll n = s.length();
	vector<ll> pw25(k + 1, 1), pw26(k + 1, 1);
	for (ll i = 1; i <= k; i++) {
		pw25[i] = pw25[i - 1] * 25 % mod;
		pw26[i] = pw26[i - 1] * 26 % mod;
	}
	fact[0] = 1;
	for (ll i = 1; i < N; i++)fact[i] = 1ll * fact[i - 1] * i % mod;
	//for (ll i : fact)cout << i << ' '; cout << endl;
	ll ans = 0;
	for (ll i = 0; i <= k; i++) {
		ll cur = pw25[k - i] * pw26[i] % mod * c(n + k - i - 1, n - 1) % mod;
		ans += cur;
		ans %= mod;
	}
	cout << ans << endl;

}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	// int t; cin >> t;
	// while (t--)
	solve();

}

Measured memory_bytes: 37436
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma warning(disable : 4996)
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<unordered_map>
#include<unordered_set>
#include<time.h>
#include<random>
#include<array>


using namespace std;

#define REP(i, n) for(int i = 0;i < n;++i)
#define REPR(i, n) for(int i = n-1;i >= 0;--i)
#define FOR(i, m, n) for(int i = m;i < n;++i)
#define FORR(i, m, n) for(int i = m-1;i >= n;--i)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end())
#define ll long long
#define print(x) cout<<(x)<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define lb(v,n) lower_bound(v.begin(), v.end(), (n))
#define ub(v,n) upper_bound(v.begin(), v.end(), (n))
//#define int long long
//#define double long double
#define all(x) (x).begin(), (x).end()
#define print_space(v) REP(i,v.size())cout << v[i] << ((i == v.size() - 1) ? "\n" : " ")
template<typename T1, typename T2> inline void chmin(T1 & a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1& a, T2 b) { if (a < b) a = b; }
typedef pair<int, int>P;
std::random_device rd;
std::mt19937 mt(rd());
constexpr int MOD = 1e9 + 7; constexpr int MAX = 200020;
const double pi = acos(-1); constexpr double EPS = 1e-8;
constexpr ll INF = 1e16;
typedef array<int, 3>arr3;
int readInt() {
	bool minus = false;
	int result = 0;
	char ch;
	ch = getchar();
	while (true) {
		if (ch == '-') break;
		if (ch >= '0' && ch <= '9') break;
		ch = getchar();
	}
	if (ch == '-') minus = true; else result = ch - '0';
	while (true) {
		ch = getchar();
		if (ch < '0' || ch > '9') break;
		result = result * 10 + (ch - '0');
	}
	if (minus)
		return -result;
	else
		return result;
}

bool dp[4005000];
int cum[2020];
int A[2020];
void solve() {
	int N = readInt();
	REP(i, N) {
		A[i] = readInt();
		cum[i + 1] = cum[i] + A[i];
	}
	int mid = (cum[N] + 1) / 2;
	dp[0] = true;

	REP(i, N) {
		int mn = min(mid, cum[i]+1);
		REPR(j, mn) {
			dp[j + A[i]] |= dp[j];
		}
	}
	FOR(i, mid, cum[N] + 1) {
		if (dp[i]) {
			printf("%d\n", i); return;
		}
	}
}

signed main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);
	//int q; cin >> q;
	//while (q--)
		solve();
}



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

int main() {
string w,a="Yes";
cin>>w;
if(w.length()%2==0){


for(int i=1;i<w.length();i++){

    if(w[0] ==w[i]){
        if(i==1){
            w=w.substr(2);
        }else{
            w = w.substr(1,i-1)+w.substr(i+1);
        }
        i=0;
    }else if(i==w.length()-1){
        a="No";
    }

}
}else{
    a="No";
}

cout<<a<<endl;
	return 0;
}

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

#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define repLRE(i, l, r) for (ll i = (l); i <= (r); ++i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

/* Macros reg. ends here */

const ll INF = 1LL << 50;

static const long long mod = 1000000007;

int main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);

  string s;
  cin >> s;

  vector<char> ans;

  for (auto c : s) {
    if (c == 'B') {
      if (ans.size() > 0) ans.pop_back();
    } else
      ans.push_back(c);
  }

  for (auto c : ans) {
    cout << c;
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int dp[2000][2000];
int data[2000][2000];
int main(){
	int h,w;	cin>>h>>w;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++)	cin>>data[i][j];
	}
	for(int i=0;i<h;i++){
		if(data[i][0]==0)	dp[i][0]=1;
	}
	for(int i=0;i<w;i++){
		if(data[0][i]==0)	dp[0][i]=1;
	}
	for(int i=1;i<h;i++){
		for(int j=1;j<w;j++){
			if(data[i][j]==1)	continue;
			dp[i][j]=min(dp[i-1][j-1],min(dp[i][j-1],dp[i-1][j]))+1;
		}
	}
	int ans=0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			ans=max(ans,dp[i][j]);
		}
	}
	cout<<ans*ans<<endl;
	return 0;
}
	

Measured memory_bytes: 25728
fun solve(S: String) {
    val s = S.split("")
    var ans = "No"
    for (i in 1..2){
        if (s[i] != s[i + 1]) {
            ans = "Yes"
            break
        }
    }
    println(ans)
}

fun main() {
    val S = readLine()!!
//    val N = readLine()!!.toInt()
//    val (N, M) = readLine()!!.split(" ").map { it.toInt() }
//    val A = readLine()!!.split(" ").map { it.toInt() }
    solve(S)
}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin>>n;
    int a[200005];
    rep(i,n+1){
      a[i]=0;
    }
    rep(i,n-1){
      int t;cin>>t;
      a[t]++;
    }
    REP(i,1,n+1){
      cout<<a[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 4400
import numpy as np

H, N = map(int, input().split())
A, B = np.zeros(N, dtype='int'), np.zeros(N, dtype='int')
for i in range(N):
    a, b = map(int, input().split())
    A[i] = a
    B[i] = b

dp = np.zeros(H, dtype='int')
minimum_cost_magic = np.argmin(B)
minA, minB = A[minimum_cost_magic], B[minimum_cost_magic]
dp[:minA] = minB
for h in range(minA, H):
    mincost = 10*dp[h-1]
    dp_minusAmj = dp[h - A]
    dp_minusAmj[h - A < 0] = 0
    dp[h] = np.min(dp_minusAmj + B)

print(dp[H-1])

Measured memory_bytes: 12504
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>

using namespace std;

#define INF 2140000000
#define MOD 1000000007

int main() {
	char c;

	cin >> c;

	if (c == 'A') {
		cout << 'T';
	}
	else if (c == 'T') {
		cout << 'A';
	}
	else if (c == 'C'){
		cout << 'G';
	}
	else {
		cout << 'C';
	}

	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args) {
    try {
      Scanner scan = new Scanner(System.in);
      int a, b, c;

      a = Integer.parseInt(scan.next());
      b = Integer.parseInt(scan.next());
      c = Integer.parseInt(scan.next());

      if(a + b >=c){
        System.out.println("Yes");
      }else{
        System.out.println("No");
      }


    }
    catch (Exception e) {

    }
  }
}


Measured memory_bytes: 23764
n = int(input())
a = []
max = int(input())
a.append(max)
second_max = int(input())
a.append(second_max)
if max<second_max:
    second_max,max = max,second_max
for i in range(n-2):
    g = int(input())
    a.append(g)
    if g>max:
        max = g
    elif g>second_max:
        second_max = g

for i in range(n):
    if a[i]!=max:
        print(max)
    else:
        print(second_max)

Measured memory_bytes: 12520