akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	string s;
	cin >> s;
	deque<char>c;
	for(int i=0;i<s.length();i++)
	{
		c.push_back(s[i]);
	}
	bool flag = true;
	string loc;
	string s1 = "maerd",s2 = "remaerd",s3 = "esare",s4 = "resare";
	while(!c.empty())
	{
		loc="";
		while(!c.empty()&&loc.length()!=5)
		{
			loc = loc+c.back();
			c.pop_back();
		}
		if(loc==s1||loc==s3)
		{
			continue;
		}
		else
		{
			while(!c.empty()&&loc.length()!=6)
			{
				loc = loc+c.back();
				c.pop_back();
			}
			if(loc==s4)
			{
				continue;
			}
			else
			{
				while(!c.empty()&&loc.length()!=7)
				{
					loc = loc+c.back();
					c.pop_back();
				}
				if(loc==s2)
				{
					continue;
				}
				else
				{
					flag = false;
					break;
				}
			}
		}
	}
	if(flag)
	{
		cout << "YES\n";
	}
	else
	{
		cout << "NO\n";
	}
	return 0;
}
	


Measured memory_bytes: 3892
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;

void createMaps(int Num, map<string, int> &ret, bool add)
{
	while (Num--)
	{
		string temp;
		cin >> temp;
		auto itr = ret.find(temp);
		if (itr == ret.end())
		{
			if (add)ret.insert(make_pair(temp, 1));
		}
		else
		{
			if (add)
				itr->second++;
			else
				itr->second--;
		}
	}
}

int main()
{
	int N, M;
	map<string, int> s, t;
	cin >> N;
	createMaps(N, s, true);
	cin >> M;
	createMaps(M, s, false);

	int ans = 0;
	for (auto itr : s)
	{
		if (ans < itr.second)
			ans = itr.second;
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    ll n;
    cin>>n;
    ll s,sum=0,mn=100;
    rep(i,n){
        cin>>s;
        sum+=s;
        if(s%10!=0) mn=min(mn,s);
    }
    if(mn==100) cout<<0<<endl;
    else if(sum%10!=0) cout<<sum<<endl;
    else cout<<sum-mn<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
 
int main(void)
{
    int a, b, c;
 
    scanf(" %d %d %d", &a, &b, &c);
 
    if (a > b){
        a ^= b;
        b ^= a;
        a ^= b;
    }
    if (b > c){
        b ^= c;
        c ^= b;
        b ^= c;
    }
    if (a > b){
        a ^= b;
        b ^= a;
        a ^= b;
    }
 
    printf("%d %d %d\n", a, b, c);
 
    return 0;
}

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

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

int gcd(int x, int y) {
    if(x == -1)
        return y;

    if(x < y)
        swap(x,y);

    while(x%y != 0) {
        int t = x%y;
        x = y;
        y = t;
    }

    return y;
}

int main() {
    int N,A,r=-1;
    cin >> N;
    rep(i,N) {
        cin >> A;
        r = gcd(r,A);
    }
    
    cout << r << endl;
}

Measured memory_bytes: 256
//minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
typedef long long ll;
const int N=2e5+5;
char s[N];int n,m,x,y,q;
ll a[N],b[N],c[N],res;
priority_queue<int,vector<int>,greater<int> >Q;
int main(){
//	freopen("testdata.in","r",stdin);
	scanf("%d%d%d%d%d",&x,&y,&n,&m,&q);
	fp(i,1,n)scanf("%lld",&a[i]);sort(a+1,a+1+n),reverse(a+1,a+1+n);
	fp(i,1,m)scanf("%lld",&b[i]);sort(b+1,b+1+m),reverse(b+1,b+1+m);
	fp(i,1,q)scanf("%lld",&c[i]);sort(c+1,c+1+q),reverse(c+1,c+1+q);
//	fp(i,1,n)a[i]+=a[i-1];fp(i,1,m)b[i]+=b[i-1];fp(i,1,q)c[i]+=c[i-1];
//	fp(i,0,x)fp(j,0,y)cmax(res,a[i]+b[j]+c[x-i+y-j]);
	fp(i,1,x)res+=a[i];fp(i,1,y)res+=b[i];
	fp(i,1,x)Q.push(a[i]);fp(i,1,y)Q.push(b[i]);
	R int k=1;
	while(!Q.empty()&&k<=q){
		R int x=Q.top();Q.pop();
		if(c[k]<=x)break;
		res+=c[k]-x,++k;
	}
	printf("%lld\n",res);
	return 0;
}

Measured memory_bytes: 4728
a,b,k = map(int,input().split())
l = []
for i in range(k):
    if a+i<=b:
        l.append(a+i)
for i in range(k-1,-1,-1):
    if b-i>=a and not b-i in l:
        l.append(b-i)
l.sort()
for i in range(len(l)):
    print(l[i])

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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main()
{
    int A, B;
    cin >> A >> B;

    int ans = 0;
    rep(i, 2) {
        if (A > B) {
            ans += A;
            A--;
        }
        else {
            ans += B;
            B--;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
        
#define pb push_back
#define ll long long
#define f first
#define s second
#define ld long double
#define fa fflush(stdout); 
#define mp make_pair
using namespace std;
void data() {
    #ifdef NURS
        freopen("main.in", "r", stdin);
        freopen("main.out", "w", stdout);
    #endif
} 
const int N = 1e6 + 100;
const ll mod = 1e9 + 7;
const ll big = 1e16;
const int p = 37;

vector<int> g[N];
map<pair<int,int>, int> was;
int ans = 0;
void dfs(int v, int p, int color)
{                                                 
	ans = max(ans, color);
	int cnt = 1;
	for (int i = 0; i < g[v].size(); i++)
	{
		if (g[v][i] == p)
		{
			continue;
		}
		if (cnt == color)
		{
			cnt++;
		}
		was[{v, g[v][i]}] = cnt;
		dfs(g[v][i], v, cnt);
		cnt++;
	}
}
int main() 
{
	data();   
	int n;
	cin >> n;          
	int a[n + 1], b[n + 1];
	for (int i = 1; i <= n - 1; i++)
	{
		cin >> a[i] >> b[i];
		g[a[i]].pb(b[i]);
		g[b[i]].pb(a[i]);
	}
	dfs(1, -1, -1);
	cout << ans << '\n';
	for (int i = 1; i <= n - 1; i++)
	{
		if (was[{a[i], b[i]}])
		{
			cout << was[{a[i], b[i]}] << '\n';
			continue;
		}
		cout << was[{b[i], a[i]}] << '\n';
	}
}


Measured memory_bytes: 40140
#include<iostream>
#include<sstream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;

int n, a[10];

int main(){
	cin >> n;
	rep(i, n) cin >> a[i];
	
	map<ll, int> m;
	set<ll> s;
	queue<pair<int, ll> > q;
	ll t = 0, g = 0;
	rep(i, n){
		t *= 16, t += a[i];
		g *= 16, g += i + 1;
	}
	q.push(mp(0, g));
	m[g] = 0;
	
	while(!q.empty()){
		ll t = q.front().second;
		int c = q.front().first; q.pop();
		
		rep(i, n) a[n - 1 - i] = t % 16, t /= 16;
		rep(i, n) for(int j = i + 1; j < n; j++){
			reverse(a + i, a + j + 1);
			ll h = 0;
			rep(k, n) h *= 16, h += a[k];
			if(!m.count(h)){
				m[h] = c + 1;
				if(c < 3) q.push(mp(c + 1, h));
			}
			reverse(a + i, a + j + 1);
		}
	}
	if(m.count(t)){
		cout << m[t] << endl;
		return 0;
	}
	q.push(mp(0, t));
	s.insert(t);
	
	while(!q.empty()){
		ll t = q.front().second;
		int c = q.front().first; q.pop();
		
		rep(i, n) a[n - 1 - i] = t % 16, t /= 16;
		rep(i, n) for(int j = i + 1; j < n; j++){
			reverse(a + i, a + j + 1);
			ll h = 0;
			rep(k, n) h *= 16, h += a[k];
			if(m.count(h)){
				cout << c + 1 + m[h] << endl;
				return 0;
			}
			if(c < 3 && !s.count(h)){
				s.insert(h);
				q.push(mp(c + 1, h));
			}
			reverse(a + i, a + j + 1);
		}
	}
	cout << 9 << endl;
	
	return 0;
}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

int n, k, l;

map<pair<int, int>, int> cnt;

/////////////////////////////////////////////////////////
class UnionFind {
public:
  static const int MAX_N_LIB = (ll)(2e5 + 100);

  int uf_par[MAX_N_LIB];
  int uf_rank[MAX_N_LIB];
  int uf_size[MAX_N_LIB];

  UnionFind(int n) {
    init(n);
  }

  void init(int n) {
    for (int i = 0; i < n; ++i) {
      uf_par[i] = i;
      uf_rank[i] = 0;
      uf_size[i] = 1;
    }
  }

  int find(int x) {
    if (uf_par[x] == x) return x;
    else {
      return uf_par[x] = find(uf_par[x]);
    }
  }

  void unite(int x, int y) {
    x = find(x);
    y = find(y);

    if (x == y) return;

    if (uf_rank[x] == uf_rank[y]) {
      uf_rank[x] += 1;
      uf_par[y] = x;
      uf_size[x] += uf_size[y];
    }
    else if (uf_rank[x] > uf_rank[y]) {
      uf_par[y] = x;
      uf_size[x] += uf_size[y];
    }
    else if (uf_rank[x] < uf_rank[y]) {
      uf_par[x] = y;
      uf_size[y] += uf_size[x];
    }

  }

  bool same(int x, int y) {
    return find(x) == find(y);
  }

  int size(int x) {
    return uf_size[find(x)];
  }
};
/////////////////////////////////////////////////////////

int main(void) {
  // Here your code !
  scanf("%d %d %d", &n, &k, &l);

  UnionFind union_find_k(n + 5);
  UnionFind union_find_l(n + 5);

  for (int i = 0; i < k; ++i) {
    int p, q;
    scanf("%d %d", &p, &q);
    union_find_k.unite(p, q);
  }

  for (int i = 0; i < l; ++i) {
    int r, s;
    scanf("%d %d", &r, &s);
    union_find_l.unite(r, s);
  }

  for (int i = 1; i <= n; ++i) {
    cnt[make_pair(union_find_k.find(i), union_find_l.find(i))] += 1;
  }

  for (int i = 1; i <= n; ++i) {
    int tmp = cnt[make_pair(union_find_k.find(i), union_find_l.find(i))];
    printf("%d ", tmp);
  }

  printf("\n");

  return 0;
}


Measured memory_bytes: 16768
import scala.io.StdIn._

object Main extends App {

  def poland(a: Array[String], stack: Stack) {
    a.foreach{
      case x if (x == "+") => stack.push(stack.pop() + stack.pop())
      case x if (x == "-") => stack.push((stack.pop() - stack.pop()) * -1)
      case x if (x == "*") => stack.push(stack.pop() * stack.pop())
      case x => stack.push(x.toInt)
    }
  }

  val stack = new Stack(Array[Int](0), 0)
  val a = readLine.split(" ").toArray
  poland(a, stack)
  println(stack.pop())
}

class Stack(var a: Array[Int], var top: Int) {
  def push(x: Int) {
    a = a:+x
    top += 1
  }
  def pop() = {
    val x = a(top)
    top -= 1
    a = a.init
    x
  }
}


Measured memory_bytes: 44156
gets
d = [gets, gets].map{|v| v.split.map(&:to_f)}.transpose.map{|x,y| (x-y).abs}
(1..4).each do |i|
  puts ((i == 4) ? d.max : d.map{|c| c**(i)}.inject(:+)**(1.0/i))
end

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

// template {{{
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); (i) += 1)
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); (i) -= 1)

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

// constexpr i32 mod   = 998244353;
constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }

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

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// }}}

void solver() {
    int n = input(), m = input();
    auto G = make_vector(n, 0, 0);
    range(i, 0, m) {
        int a = input() - 1, b = input() - 1;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    vector< int > dist(n, inf);
    vector< int > ans(n, -1);

    queue< int > q;
    q.push(0);
    dist[0] = 0;

    vector< int > used(n);
    while (!q.empty()) {
        int v = q.front();
        q.pop();
        if (used[v]) continue;
        used[v] = true;

        for (auto u: G[v]) {
            if (dist[u] <= dist[v] + 1) continue;
            dist[u] = dist[v] + 1;
            ans[u] = v;
            q.push(u);
        }
    }

    cout << "Yes" << endl;
    range(i, 1, n) {
        cout << ans[i] + 1 << endl;
    }
}

signed main(int argc, char *argv[]) {
    solver();
}


Measured memory_bytes: 11040
//A - Plural Form
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>

#define LL long long
#define Cl(X,Y) memset((X),(Y),sizeof(X))
#define FOR(i,A,B) for(int i=A;i<=B;i++)
#define BOR(i,A,B) for(int i=A;i>=B;i--)
#define Lowbit(X) (X & (-X))
#define INF 0x3f3f3f3f
#define Rson (X<<1|1)
#define Lson (X<<1)
using namespace std;
const int MaxN=1e3+10;

char Num[MaxN];
int Len;

inline void File() {
    freopen(".in","r",stdin);
    freopen(".out","w",stdout);
}

int main() {
    // File();
    // ios::sync_with_stdio(false);
    scanf("%s",Num+1);
    Len=strlen(Num+1);
    if(Num[Len]=='s') Num[++Len]='e',Num[++Len]='s';
    else Num[++Len]='s';
    FOR(i,1,Len) cout<<Num[i];
    // fclose(stdin);
    // fclose(stdout);
   // system("pause");
    return 0;
}

Measured memory_bytes: 3760
def main():
	a, b, c, x = (int(input()), int(input()), int(input()), int(input()))

	count = 0
	for i in range(a+1):
		y = x- 500*i
		if y == 0:
			count += 1
			continue
		if y > 0:
			for j in range(b+1):
				z = y - j*100
				if z == 0:
					count += 1
					continue
				if z > 0:
					for k in range(c+1):
						if int(z-50*k) == 0:
							count += 1
							break

	print (count)

if __name__ == "__main__":
    # global stime
    # stime = time.clock()
    main()


Measured memory_bytes: 3064
#include<cstring>
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<queue>
#include<map>
using namespace std;
const long long Maxn=1e6;
typedef long long ll;

int main(){
	int a,b,c;
	cin>>a>>b>>c;
	if(a+b>=c) printf("Yes\n");
	else printf("No\n");
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <vector>
#include <cstdlib>
using namespace std;
#define REP(i,n) for(int i = 0;i < (int)(n);i++)

int main() {
char a,b,c;
cin >> a >> b >> c;
if((b == a)||(a == c)||(b==c))cout <<"No";
else cout<<"Yes";

return(0);
}



Measured memory_bytes: 256
import           Control.Monad
import           Control.Monad.ST
import qualified Data.Array                    as A
import qualified Data.Array.ST                 as ST
import qualified Data.Array.Unboxed            as AU
import qualified Data.ByteString.Char8         as BS
import           Data.Char
import           Data.Int
import qualified Data.IntMap                   as IM
import           Data.List
import qualified Data.Map                      as M
import           Data.Maybe
import           Data.Ord
import qualified Data.Set                      as S
import qualified Data.Vector                   as V
import qualified Data.Vector.Mutable           as VM
import qualified Data.Vector.Unboxed           as VU
import qualified Data.Vector.Unboxed.Mutable   as VUM

readInt :: IO [Int]
readInt = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

readInts :: Int -> IO [[Int]]
readInts n = replicateM n readInt

readString :: IO [String]
readString = map BS.unpack . BS.words <$> BS.getLine

readStrings :: Int -> IO [[String]]
readStrings n = replicateM n <$> readString

toPair :: [a] -> (a, a)
toPair [x, y] = (x, y)


main = do
  s <- getLine
  t <- getLine
  putStrLn $ if f s == f t && sort (f (sort s)) == sort (f (sort t))
    then "Yes"
    else "No"

f s = map length (group s)


Measured memory_bytes: 38268
from collections import defaultdict
ri = lambda : list(map(int, input().split(' ')))


def solve():
    n, a, d = ri()

    if d == 0:
        print(1 if a == 0 else n + 1)
        return

    if d < 0:
        a, d = -a, -d

    dic = defaultdict(list)
    for i in range(n + 1):
        l = a * i + i * (i - 1) // 2 * d
        r = a * i + (n-i + n-1)*i // 2 * d
        dic[l % d].append((l // d, r // d + 1))
    
    ans = 0
    for p in dic.values():
        end = -1e18
        p.sort()
        for t in p:
            s, e = t
            if end < s:
                ans += (e-s)
                end = e
            if end < e:
                ans += (e - end)
                end = e

    print(ans)


if __name__ == '__main__':
    solve()

Measured memory_bytes: 71344
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, M;
  cin >> N >> M;
  vector<int> vote(N);
  for (int i=0; i < vote.size(); i++){
    cin >> vote.at(i);
  }
  double sum = 0;
  for (int i=0; i < vote.size(); i++){
    sum += vote.at(i);
  }
  sort(vote.begin(), vote.end());
  reverse(vote.begin(), vote.end());
  if (vote.at(M-1) >= sum/(4*M)){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

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

x = [0] * n
x[0] = sum(a) - sum([a[i] for i in range(1, n, 2)]) * 2
for i in range(n-1):
    x[i+1] = 2 * a[i] - x[i]

print(' '.join(map(str, x)))


Measured memory_bytes: 24948
#include<iostream>
using namespace std;
int main(){
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  while(a > 0){
    c = c - b;
    if(c <= 0){
      cout << "Yes\n";
	  break;
    }
    a = a - d;
    if(a <= 0){
      cout << "No\n";
      break;
    }
  }
}

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

int main(){
  int a;
  int cards[4][13];
  for (int i=0;i<4;i++){
    for (int j=0;j<13;j++){
      cards[i][j]=0;
    }
  }

  cin>>a;
  string s;
  int x;

  for (int i=0;i<a;i++){
    cin>>s>>x;
    if (s=="S"){
      cards[0][x-1]=1;
    }
    if(s=="H"){
      cards[1][x-1]=1;
    }
    if(s=="C"){
      cards[2][x-1]=1;
    }
    if (s=="D"){
      cards[3][x-1]=1;
    }
  }
  for(int i=0;i<4;i++){
    for(int j=0;j<13;j++){
      if(cards[i][j]==0){
        if (i==0)cout<<"S "<<j+1<<endl;
        if (i==1)cout<<"H "<<j+1<<endl;
        if (i==2)cout<<"C "<<j+1<<endl;
        if (i==3)cout<<"D "<<j+1<<endl;
      }
    }
  }
}


Measured memory_bytes: 3156
#include <iostream>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
const int MOD = 1e9 + 7;
 
ll dp[100001][13];
 
int main(){
    string S;
    cin >> S;
    dp[0][0] = 1;
    rep(i,S.size()){
        rep(j,10){
            int c = S[i] - '0';
            if(S[i] == '?' || c == j){
                rep(k,13){
                    dp[i + 1][(k * 10 + j) % 13] += dp[i][k];
                    dp[i + 1][(k * 10 + j) % 13] %= MOD;
                }
            }
        }
    }
    cout << dp[S.size()][5] << endl;
}

Measured memory_bytes: 10624
/**
SXR0aXAkI0JwbXptI3FhI3Z3I293bCNqY2IjUG0jMCNicG0jVHFkcXZvLyNCcG0jQW10bjBhY2phcWFicXZvLyNNYm16dml0MSNWdyNhdGN1am16I2tpdiNhbXF9bSNQcXUjVnd6I0F0bW14MSNQcWEjaXptI2l0dCNicHF2b2EjUXYjYnBtI3BtaWRtdmEjaXZsI3d2I21pemJwMSNFcHcjcWEjYnBtem0ja2l2I3F2Ym16a21sbSNRdiNQcWEjeHptYW12a20jbXtrbXhiI0lhI3BtI3htenVxYmJtYnBHI1BtI3N2d2VtYnAjRXBpYiMraXh4bWl6bWJwI2J3I1BxYSNrem1pYmN6bWEjSWEsI0ptbnd6bSN3eiNJbmJteiN3eiNKbXBxdmwjYnBtdTEjVnd6I2FwaXR0I2JwbXwja3d1eGlhYSNJY29wYiN3biNwcWEjc3Z3ZXRtbG9tI017a214YiNpYSNQbSNlcXR0bWJwMSNQcWEjYnB6d3ZtI2x3YnAjbXtibXZsI1dkbXojYnBtI3BtaWRtdmEjSXZsI3d2I21pemJwLyNpdmwjUG0jbm1tdG1icCNWdyNuaWJxb2NtI3F2I29jaXpscXZvI0l2bCN4em1hbXpkcXZvI2JwbXUvI053eiNQbSNxYSNicG0jVXdhYiNQcW9wMSNCcG0jQWN4em11bSMrcXYjb3R3enwsMQ==
*/
#include <cstring>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cassert>

#define F first
#define S second
#define endl '\n'
#define deb(x) cout<<#x<<' '<<x<<endl;
#define pb push_back

/*
#ifdef IZI_KATKA
#define int __int64_t
#else
#define int __int64
#endif
*/

const long long MOD = 1e9 + 7;
const long long MAXN = 1e6 + 1;
using namespace std;

typedef long long ll;

long long readInt() {
    bool minus1 = false;
    long long result = 0;
    char ch;
    ch = getchar();
    while (true) {
        if (ch == '-') break;
        if (ch >= '0' && ch <= '9') break;
        ch = getchar();
    }
    if (ch == '-') minus1 = true; else result = ch-'0';
    while (true) {
        ch = getchar();
        if (ch < '0' || ch > '9') break;
        result = result*10 + (ch - '0');
    }
    if (minus1)
        return -result;
    else
        return result;
}

int a, b, c;

int main() {
	#ifdef IZI_KATKA
	assert(freopen("input", "r", stdin));
    assert(freopen("output", "w", stdout));
    #endif
    a = readInt(), b = readInt(), c = readInt();
//	sum = a + b + c;
	for (int i = 1; i <= 100; i++) {
		int tmp_a = 0, tmp_b = 0, tmp_c = 0;
		if ((a & 1) || (b & 1) || (c & 1)) {
			cout << i - 1;
			return 0;	
		}
		tmp_b += (a / 2);
		tmp_c += (a / 2);
		tmp_a += (b / 2);
		tmp_c += (b / 2);
		tmp_a += (c / 2);
		tmp_b += (c / 2);
		a = tmp_a;
		b = tmp_b;
		c = tmp_c;
	}
	cout << -1;
	cout << endl;
    return 0;
}

Measured memory_bytes: 256
{-# LANGUAGE FlexibleContexts #-}
    
import Control.Monad.ST
import Data.Array.ST
import Control.Arrow
import Control.Monad
import Data.List
import qualified Data.ByteString.Char8 as B

main :: IO ()
main = readLine >>= main'
    where
        main' [n, m] = readContents m >>= print . solve n m 

solve :: Int -> Int -> [[Int]] -> Int 
solve n m xyzs = runST (makeTree n >>= check >>= count)
    where
        check uft = uft <$ mapM_ mf xyzs
            where
                mf [x, y, z] = unionNodes a b uft
                    where
                        a = x - 1
                        b = y - 1
        count uft = length . group . sort <$> mapM mf [0..(n - 1)]
            where
                mf i = fst <$> findRoot i uft

readLine :: IO [Int]
readLine = unfoldr (fmap (second (maybe B.empty snd . B.uncons)) . B.readInt) <$> B.getLine

readContents :: Int -> IO [[Int]]
readContents = flip replicateM readLine

type UFTree s = STArray s Int (Int, Int)

makeTree :: Int -> ST s (UFTree s)
makeTree n = newListArray (0, n - 1) . zip [0..(n - 1)] $ repeat 1

findRoot :: Int -> UFTree s -> ST s (Int, Int)
findRoot v uft = readArray uft v >>= check
    where
        check res@(root, _)
            | v == root = return res
            | otherwise = findRoot root uft >>= edit
        edit res = res <$ writeArray uft v res
            
unionNodes :: Int -> Int -> UFTree s -> ST s ()
unionNodes a b uft = mapM (`findRoot` uft) [a, b] >>= check
    where
        check [(c, cs), (d, ds)]
            | c == d = return ()
            | cs < ds = writeArray uft c (d, cs + ds) >> writeArray uft d (d, ds + cs)
            | otherwise = writeArray uft d (c, cs + ds) >> writeArray uft c (c, cs + ds) 

isSame :: Int -> Int -> UFTree s -> ST s Bool
isSame a b uft = (== 1) . length . group <$> mapM (\v -> fst <$> findRoot v uft) [a, b]

size :: Int -> UFTree s -> ST s Int 
size v uft = snd <$> findRoot v uft

Measured memory_bytes: 39676
N = int(input())
A = list(map(int, input().split(' ')))


def main():
    for a in A:
        if a % 2 == 0:
            if a % 3 == 0 or a % 5 == 0:
                pass
            else:
                return 'DENIED'

    return 'APPROVED'


print(main())

Measured memory_bytes: 2940
number = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(number):
    now = input()
    if now == "AC":
        ac += 1
    elif now == "WA":
        wa += 1
    elif now == "TLE":
        tle += 1
    else:
        re += 1

print("AC x " + str(ac))
print("WA x " + str(wa))
print("TLE x " + str(tle))
print("RE x " + str(re))

Measured memory_bytes: 69844
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	/**
	 * @param args
	 */
	Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		// TODO Auto-generated method stub

		new Main().run();

	}

	void run() {
		while (true) {
			int n = sc.nextInt();
			if (n == 0)
				break;
			int ss[] = new int[n];
			for (int i = 0; i < n; i++) {

				ss[i] = sc.nextInt();
			}
			Arrays.sort(ss);
			int sum = 0;
			for (int i = 1; i <= n - 2; i++) {
				sum += ss[i];
			}
			System.out.println(sum / (n - 2));
		}
	}
}

Measured memory_bytes: 20964
import sys
from collections import deque
import copy

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    s = input_raw[0]
    N = len(s)
    is_lose = True
    for i in range(N - 2):
        if (s[i] != s[i + 2]):
            is_lose = False
            break
    if is_lose == True:
        print "Second";
        exit()

    if s[0] == s[N - 1]:
        if N % 2 == 0:
            print "First"
        else:
            print "Second"
    else:
        if N % 2 == 0:
            print "Second"
        else:
            print "First"


if __name__ == '__main__':
    main()


Measured memory_bytes: 6128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const unsigned long long INF = 1000000000000000000;
#define rep1(i, n) for (ll i=0; i<(n); i++) 
#define rep2(i, k, n) for (ll i=k; i<(n); i++)


int main() {
    ll n;
    cin >> n;
    vector<ll> a(n, 0);
    unsigned long long ans = 1;
    bool judge = true;
    rep1(i, n){
        cin >> a[i];
    }
    sort(a.begin(), a.end());
    if (a[0]==0){
        cout << 0 << endl;
        return 0;
    }
    rep1(i, n){
        if (a[i] <= INF/ans) ans *= a[i];
        else{
            cout << -1 << endl;
            return 0;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 4004
#define ll long long
#define lld long double
#define cn(n)  ll n;cin >> n;
#define tes(t) ll t;cin>>t;while(t--) 
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define rep(i, a, b) for (int i = a; i <= b; i++)
#define repd(i, a, b) for (int i = a; i >= b; i--)
#define pii pair<int, int>
#define pll pair<ll, ll>
#define al(v) v.begin(), v.end()
#define oset(X) tree<X, null_type, less<X>, rb_tree_tag, tree_order_statistics_node_update>
#define roset(X) tree<X, null_type, greater<X>, rb_tree_tag, tree_order_statistics_node_update>
const ll MOD = 1000 * 1000 * 1000 + 7;
const ll INF = 1ll * 1000 * 1000 * 1000 * 1000 * 1000 * 1000 + 7;
const ll MOD2 = 998244353;
const long double PI = 3.141592653589793;
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
using namespace __gnu_pbds;
using namespace std;
ll power(ll x, ll y, ll p){ll res = 1;x %= p;while (y > 0){if (y & 1)res = (res * x) % p;y = y >> 1;x = (x * x) % p;}return res;}
ll po(ll base, ll powerRaised){if (powerRaised != 0)return (base * po(base, powerRaised - 1));else return 1;}
ll gcd(ll a, ll b){if (b == 0)return a;return gcd(b, a % b);}
ll lcm(ll a, ll b){return (a * b) / gcd(a, b);}
int main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
// #ifndef ONLINE_JUDGE
//   freopen("input.txt", "r", stdin);
//   freopen("output.txt", "w", stdout);
// #endif //*
	string s,t;
  cin>>s>>t;
  int n=s.length();
  int m=t.length();
  int ans=m;
  rep(i,0,n-m)
  {
    int cnt=0;
    rep(j,i,i+m-1)
    {
      if(s[j]!=t[j-i])
      cnt++;
    }
    ans=min(ans,cnt);
  }
  cout<<ans;
	
	
}
	

  


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first 
#define ss second
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python 
#define gcd __gcd
#define append push_back
#define str to_string
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
// declaration shortcuts
#define ll long long
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997; 
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int main(){
	fastio();
	int n;
	cin>>n;
	map<string,int>f;
	int maxi=0;
	for(int i=0;i<n;i++){
		string s;
		cin>>s;
		f[s]++;
		maxi = max(maxi,f[s]);
	}
	for(auto i:f){
		if(i.ss==maxi){
			cout<<i.ff<<"\n";
		}
	}
}

Measured memory_bytes: 23936
#include <iostream>
#include <vector>
#define vi vector<int>
#define ll long long
using namespace std;
long long res = 0;
int n;
vi adj[200001] = {};

void dfs(int u, int p)
{
	if (p != -1)
	{
		if (p < u) {res += (ll)(u - p) * (n - u);}
		else {res += (ll)(p - u) * (u + 1);}
	}
	else {res += n;}
	for (auto v : adj[u])
	{
		if (v != p)
		{
			dfs(v, u);
		}
	}
	
}

int main()
{
	cin >> n;
	for (int i = 1; i < n; i++)
	{
		int u, v; cin >> u >> v;
		u--; v--;
		adj[u].push_back(v);
		adj[v].push_back(u);
	}
	dfs(0, -1);
	cout << res << "\n";
	return 0;
}

Measured memory_bytes: 23856
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using static MyIO;


public class A
{
    public static void Main()
    {
        int n = GetInt();
        var a = n / 15;
        Console.WriteLine((n * 800) - (a * 200));
    }
}


public static class MyIO
{
    private static string[] args = null;
    private static int num = -1;
    private static int used = -1;

    private static string getArg()
    {
        if (used == num)
        {
            args = Console.ReadLine().Split(' ');
            num = args.Length;
            used = 0;
        }
        return args[used++];
    }

    public static int GetInt() { return int.Parse(getArg()); }
    public static long GetLong() { return long.Parse(getArg()); }
    public static double GetDouble() { return double.Parse(getArg()); }
    public static string GetString() { return getArg(); }
}


Measured memory_bytes: 11092
#include <algorithm>
#include <iostream>
#include <vector>
using namespace std;
template <class T>
inline bool chmax(T &a, T b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

typedef long long ll;
ll MOD = 1000000007;

// a^p
// 2^3 = 2 * 2^2
// 2^2 = 2 * (2^1)
// 2^1 = 2
ll modpow(ll a, ll p, ll mod) {
  if (p == 0)
    return 1;

  if (p % 2 == 0) {
    ll half = modpow(a, p / 2, mod) % mod;
    return half * half % mod;
  } else {
    return a * modpow(a, p - 1, mod) % mod;
  }
}

// nCa を求める
ll modCombination(ll n, ll a, ll mod) {
  if (n - a < a) {
    return modCombination(n, n - a, mod);
  }

  ll denominator = 1; // 分母
  ll numerator = 1;   // 分子

  for (ll i = 0; i < a; i++) {
    denominator *= a - i;
    numerator *= n - i;
    denominator %= mod;
    numerator %= mod;
  }

  return numerator * modpow(denominator, mod - 2, mod) % mod;
}

class UnionFind {
private:
  vector<ll> parents;

public:
  UnionFind(ll n) : parents(n, -1) {}

  bool issame(ll x, ll y) {
    return root(x) == root(y);
  }

  bool merge(ll x, ll y) {
    if (issame(x, y))
      return false;

    ll rx = root(x);
    ll ry = root(y);
    if (parents[rx] > parents[ry])
      swap(rx, ry);
    // サイズ情報を更新
    parents[rx] += parents[ry];
    // yの親を更新
    parents[ry] = rx;

    return true;
  }

  ll size(ll x) {
    return -parents[root(x)];
  }

private:
  ll root(ll x) {
    if (parents[x] < 0)
      return x;
    // 根の親の値に木の(-)サイズの情報を入れる
    return parents[x] = root(parents[x]);
  }
};

int main() {
  ll D, G;
  cin >> D >> G;

  vector<ll> p(D);
  vector<ll> c(D);

  for (ll i = 0; i < D; i++) {
    cin >> p[i];
    cin >> c[i];
  }

  ll ans = G / 10;
  for (ll bit = 0; bit < (1 << D); bit++) {
    ll points = 0;
    ll current = 0;
    for (ll i = 0; i < D; i++) {
      if (bit & (1 << i)) {
        points += (i + 1) * 100 * p[i] + c[i];
        current += p[i];
      }
    }

    if (points >= G) {
      ans = min(ans, current);
      continue;
    }

    // cout << points << ": " << current << endl;

    for (ll i = D - 1; i >= 0; i--) {
      if (bit & (1 << i)) {
        continue;
      }

      for (ll j = 0; j < p[i]; j++) {
        points += (i + 1) * 100;
        current += 1;

        if (points >= G) {
          break;
        }
      }

      if (points >= G) {
        break;
      }
    }

    if (points >= G) {
      ans = min(ans, current);
    }
  }

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


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

int get_val(vector<int> &a,int index){
    if(index==0) return x[0][a[index]];
    return x[get_val(a,index-1)][a[index]];
}
int check(vector<int> &e){return get_val(e,4);}

int main(){
    x.resize(10);
    for(int i=0;i<10;i++){
        x[i].resize(10);
        for(int j=0;j<10;j++){
            cin>>x[i][j];
        }
    }
    int res=0;
    for(int i=0;i<10000;i++){
        vector<int> a(5);
        int ival=i;
        bool pos=true;
        for(int j=0;j<4;j++){
            a[j]=ival%10;
            ival/=10;
        }
        a[4]=get_val(a,3);
        vector<int> e=a;
        for(int error=0;error<5;error++){
            for(int j=0;j<10;j++){
                if(a[error]==j){
                    continue;
                }
                e[error]=j;
                pos=pos&&(check(e)!=0);
                e[error]=a[error];
            }
        }
        for(int j=0;j<4;j++){
            if(e[j]!=e[j+1]){
                swap(e[j],e[j+1]);
                pos=pos&&(check(e)!=0);
                swap(e[j],e[j+1]);   
            }
        }
        res+=(!pos);
    }
    cout<<res<<endl;
    return 0;
}

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

#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define ALL(v) v.begin(), v.end()
#define SZ(x) ((int)(x).size())
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

#define MAX_V 100001 
int V;
vector<int> G[MAX_V];
vector<int> rG[MAX_V];
vector<int> vs;
bool used[MAX_V];
int cmp[MAX_V];

void add_edge(int from, int to){
    G[from].push_back(to);
    rG[to].push_back(from);
}

void dfs(int v){
    used[v] = true;
    rep(i, SZ(G[v]))if (!used[G[v][i]])dfs(G[v][i]);
    vs.push_back(v);
}

void rdfs(int v, int k){
    used[v] = true;
    cmp[v] = k;
    rep(i, SZ(rG[v]))if (!used[rG[v][i]])rdfs(rG[v][i], k);
}
int scc(){
    memset(used, 0, sizeof(used));
    vs.clear();
    rep(v, V)if (!used[v])dfs(v);
    memset(used, 0, sizeof(used));
    int k = 0;
    for (int i = vs.size() - 1; i >= 0; i--){
        if (!used[vs[i]])rdfs(vs[i], k++);
    }
    return k;
}

int main() {
    int M, N;
    cin >> N >> M;
    V = N;
    rep(i, M){
        int a, b;
        cin >> a >> b;
        add_edge(a -1, b -1);
        add_edge(b -1, a -1);
    }

    int n = scc(); // cmp ��v��SCC��ID���i�[  O(N + M)
    cout << n - 1;
    return 0;    
}




Measured memory_bytes: 15752
/// Containers Start
#include <algorithm>
#include <bitset>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <regex>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
/// C Header Files
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <math.h>
#include <stdio.h>
/// Containers End

using namespace std;

/// Math Start
#define PI acos(-1.0)
#define Pi 3.141592653589793
#define EPS (1e-7)
#define INF (0x3f3f3f3f)
/// Math End

/// Extra Start
#define nn '\n'
#define pb push_back
#define ull unsigned long long
#define ll long long
#define MOD 1000000007
#define sz(a) int((a).size())
#define space " "
#define All(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
/// Extra End

#define rep(i, n) for (int i = 0; i < n; i++)
#define Cini(a)                                                                \
    int a;                                                                     \
    cin >> a;
#define Cinii(a, b)                                                            \
    int a, b;                                                                  \
    cin >> a >> b;
#define Ciniii(a, b, c)                                                        \
    int a, b, c;                                                               \
    cin >> a >> b >> c;
#define Cins(s)                                                                \
    string s;                                                                  \
    cin >> s;
#define Cinss(s1, s2)                                                          \
    string s1, s2;                                                             \
    cin >> s1 >> s2;
#define Cinc(c)                                                                \
    char c;                                                                    \
    cin >> c;
/// Functions End

/// Debug Start
#define deb(x) cout << #x << ": " << x << endl
#define deb2(x, y) cout << #x << ": " << x << '\t' << #y << ": " << y << endl;
#define deb3(x, y, z)                                                          \
    cout << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": "   \
         << z << endl;
/// Debug End

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

/**>>>>>>>>>>>>>>>>>>> END <<<<<<<<<<<<<<<<<<**/

/// template

signed main(void) {
    cin.sync_with_stdio(false);
    cin.tie(0);
    Cinii(h1,n1);
    Cinii(h2,n2);
    Cini(K);
    cout << max(h2 * 60 + n2 - (h1 * 60 + n1) - K,0) << nn;
    return 0;
}

Measured memory_bytes: 3164
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int gcd(int x, int y) { return (x % y) ? gcd(y, x % y) : y; }
int main() {
  int n, m;
  int f = 0, sum = 0;
  cin >> n >> m;
  int num[n];
  for (int i = 0; i < n; i++) {
    cin >> num[i];
    sum = sum + num[i];
  }
  for (int j = 0; j < n; j++) {
    if ((double)sum / (4 * m) <= num[j]) {
      // cout << num[j];
      f++;
    }
  }
  if (f >= m) {
    cout << "Yes";
  }

  else {
    cout << "No";
  }

  return 0;
}

// g++ lo.cpp
// ./a.exe
// g++ -o つくりたいふぁいるめい　もとのふぁいる.cpp
/*
for (int i = 0; i < n - 2; i++) {
  for (int j = i + 1; j < n - 1; j++) {
    int k = 2 * j - i;*/

Measured memory_bytes: 256
import math
h = int(input())
if h == 1:
 print(1)
else:
 cnt=0
 while True:
  cnt+=1
  h=math.floor(h/2)
  if (h/2) < 1:
   cnt+=1
   break
 sum=0
 for i in range(cnt):
  sum=sum + (2**i)
 print(sum)

Measured memory_bytes: 3060
n = int(input())
A = list(map(int, input().split()))

P = [0]*n
for i, a in enumerate(A):
    P[a-1] = i

import heapq
q = []
heapq.heapify(q)
R = [n-1]*n
for i, a in enumerate(A):
    while q and q[0]*(-1) > a:
        v = heapq.heappop(q)*(-1)
        R[v-1] = i-1
    heapq.heappush(q, a*(-1))

q = []
L = [0]*n
for j in range(n):
    i = n-1-j
    a = A[i]
    while q and q[0]*(-1) > a:
        v = heapq.heappop(q)*(-1)
        L[v-1] = i+1
    heapq.heappush(q, a*(-1))

#print(L)
#print(R)
ans = 0
for i in range(n):
    a = i+1
    l, r, p = L[i], R[i], P[i]
    ans += (p-l+1)*(r-p+1)*a
print(ans)

Measured memory_bytes: 104064
#include <iostream>

using namespace std;

int main() {
    int n;
    while (cin >> n) {
        int stack = 0;
        int x[n];
        char c[n];
        for (int i = 0; i < n; i++) {
            cin >> c[i] >> x[i];
        }
        for (int i = 0; i < n; i++) {
            if (c[i] == '(') {
                stack += x[i];
            } else {
                stack -= x[i];
            }
            if (stack < 0) {
                cout << "NO" << endl;
                goto end;
            }
        }
        cout << (stack == 0 ? "YES" : "NO") << endl;
end:;
    }
    return 0;
}

Measured memory_bytes: 1156
#include<iostream>
#include<string>
using namespace std;
int main ()
{
int x,y;
	cin>>x>>y;
	if((x==1||x==3||x==5||x==7||x==8||x==10||x==12)&&(y==1||y==3||y==5||y==7||y==8||y==10||y==12))
	cout<<"Yes"<<endl;
	else if((x==4||x==6||x==9||x==11)&&(y==4|y==6||y==9||y==11))
	cout<<"Yes"<<endl;
	else if(x==2&&y==2)
	cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

}



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

using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
using WGraph = vector<vector<pair<int, ll>>>;

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

constexpr int dx[4] = {-1, 0, 0, 1}, dy[4] = {0, -1, 1, 0};
constexpr int INF = 1e9;
constexpr int MOD = 1e9 + 7;
constexpr long long LINF = 1e18;
constexpr double EPS = 1e-10;
constexpr double PI = M_PI;

void solve() {
    int a, b, c, k;
    cin >> a >> b >> c >> k;

    for (int i=0; i<k; ++i) {
        if (b <= a) {
            b *= 2;
        } else if (c <= b) {
            c *= 2;
        }
    }
    if (c > b && b > a) cout << "Yes" << '\n';
    else cout << "No" << '\n';
}

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

    solve();

    return 0;
}


Measured memory_bytes: 3604
function Main(input) {
  input=input.split("\n");
  
  if(input[0]==='ABC'){
    console.log('ARC');
  }else{
    console.log('ABC');
  }
}


//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
  
  


Measured memory_bytes: 29472
#include <iostream>
#include <algorithm>
#include <array>
#include <math.h>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>

#define INT_MAX 2000000000
#define MOD 1000000007
#define ll long long
#define rep(i,a,b) for(i = (a); i < (b); i++)
#define bitget(a,b) (((a) >> (b)) & 1)
#define vint vector<int>
#define vsort(x) sort(x.begin(),x.end())

using namespace std;

int main() {

	int i, j, k;
	string s;
	cin >> s;
	int a[26] = {};
	rep(i, 0, s.length()) {
		a[s[i] - 'a']++;
	}
	int ans=-1;
	char an;
	rep(i, 0, 26) {
		if (a[i] == 0) {
			ans = 0;
			an = 'a' + i;
			break;
		}
	}
	if (ans == 0) {
		cout << an << endl;
	}
	else {
		cout << "None" << endl;
	}
	return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
#define int long long
using namespace std;
string s;
bool isPallindrome(int ind1, int ind2)
{
    for(int i = ind1; i < (ind1 + ind2) /2; i++)
    {
        if(s[i] != s[ind2 - 1 - i])
            return false;
    }
    return true;
}
main()
{
    cin >> s;
    string ans = "No";
    if(isPallindrome(0, s.size()))
    {
        if(isPallindrome(0, (s.size() - 1) / 2))
        {
            if(isPallindrome((s.size() + 3) / 2, s.size()))
               ans = "Yes";
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bint = boost::multiprecision::cpp_int;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
#define ssort(v) sort(v.begin(), v.end())
#define gsort(v) sort(v.rbegin(), v.rend())
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }

int main()
{
    int N, M;
    cin >> N >> M;
    vector<int> H(N);
    vector<bool> G(N);
    G.assign(N, true);
    rep(i,N) cin >> H[i];
    rep(i,M) {
        int a, b;
        cin >> a >> b;
        a--; b --;
        if (H[a] == H[b]) G[a] = G[b] = false;
        if (H[a] < H[b]) G[a] = false;
        if (H[a] > H[b]) G[b] = false;
    }
    int ret = 0;
    rep(i,N) {
        if (G[i]) ret ++;
    }
    cout << ret << "\n";
    return 0;
}


Measured memory_bytes: 3756