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

#include <bits/stdc++.h>
using namespace std;
#define sd(x) scanf("%d", &x)
#define slld(x) scanf("%lld", &x)
#define all(x) x.begin(), x.end()
#define For(i, s, e) for (ll i = s; i < e; i++)
#define Forr(i, s, e) for (ll i = s; i > e; i--)
#define pb push_back
#define ll long long
#define mp make_pair
#define INF 1e18
int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    cout << fixed << setprecision(8);
    ll n, w;
    ll upper = 1;
    cin >> n >> w;
    ll val[n], wt[n];
    For(i, 0, n)
    {
        cin >> wt[i] >> val[i];
        upper += val[i];
    }
    ll kp[upper][n + 1];

    For(i, 0, upper)
    {
        For(j, 0, n + 1)
        {
            kp[i][j] = INF;
        }
    }
    For(i, 0, n + 1) kp[0][i] = 0;
    For(j, 1, n + 1)
    {
        For(i, 1, upper)
        {

            if (val[j - 1] <= i)
            {
                kp[i][j] = min(
                    kp[i][j - 1], kp[i - val[j - 1]][j - 1] + wt[j - 1]);
            }
            else
                kp[i][j] = kp[i][j - 1];
        }
    }
    ll mxp = 0;
    For(i, 0, upper)
    {
        if (kp[i][n] <= w)
            mxp = max(mxp, i);
    }
    // For(j, 0, upper)
    // {
    //     cout << setw(4) << j << " ";
    // }
    // cout << endl;
    // For(i, 0, n + 1)
    // {
    //     For(j, 0, upper)
    //     {
    //         cout << setw(4) << kp[j][i] << " ";
    //     }
    //     cout << endl;
    // }

    cout << mxp << endl;
    return 0;
}

Measured memory_bytes: 82412
# ABC141
def main():
    S = input().rstrip()
    odd, even = set(S[::2]), set(S[1::2])
    flg = odd <= {"R", "U", "D"} and even <= {"L", "U", "D"}
    print("Yes" if flg else "No")


if __name__ == "__main__":
    main()

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

int gcd(int p, int q){
    if (p % q == 0){
        return q;
    }
    return gcd(q, p % q);
}

int main(){
    int K;
    cin >> K;
    int sum = 0;
    for (int i=0; i<K; i++){
        for (int j=0; j<K; j++){
            for (int k=0; k<K; k++){
                sum += gcd(gcd(i+1, j+1), k+1);
            }
        }
    }
    cout << sum << endl;
    return 0;
}

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

using namespace std;

int dp[2][2005][2005],dpmn[2][2005][2005],dpmx[2][2005][2005];

int main(){
    //ifstream myfile("C:\\Users\\DurgaPrasad\\Downloads\\rand_15.in");
    int n,z,w;
    cin >> n >> z >> w;
    vector <int> a(n+2);
    a[0]=z,a[1]=w;  // we need dp[0][2][0]
    for(int i=2;i<n+2;i++){
        cin >> a[i];
    }

    // base case : for all the terminal states j=n+2
    for(int i=0;i<2;i++){
        for(int k=0;k<n+2;k++){
            dp[i][n + 2][k] = abs(a[k]-a[n+1]);
            dpmn[i][n + 2][k] = dp[i][n + 2][k];
            dpmx[i][n + 2][k] = dp[i][n + 2][k];
        }
    }
    for(int i=n+1;i>=2;i--){
        for(int j=0;j<i-1;j++){
            for(int p=0;p<2;p++){
                if(!p){
                    dp[p][i][j]=dpmx[1-p][i+1][i-1];
                }
                else{
                    dp[p][i][j]=dpmn[1-p][i+1][i-1];
                }
                dpmx[p][i][j]=max(dp[p][i][j],dpmx[p][i+1][j]);
                dpmn[p][i][j]=min(dp[p][i][j],dpmn[p][i+1][j]);
            }
        }
    }
    cout << dp[0][2][0] << endl;
    return 0;
}

Measured memory_bytes: 93696
/*input

*/
#include <bits/stdc++.h>
#define up(i,a,b) for(int (i) = (a);(i)<=(b);++(i))
#define down(i,b,a) for(int (i) = (b);i>=(a);--i)
#define debug(x) cerr << (x) << '\n';
#define bits(x,i) ((x >> i) & 1)
#define mid ((l+r)/2)
#define pr pair<int,int>
using namespace std;
const int logA = 60;
const int mod = 1e9 + 7;
long long dp[logA][2][2][2];
long long l,r;
long long solve(int pos,int isLow, int isHigh,int firstBit){
	if (pos < 0) return 1;
	long long& res = dp[pos][isLow][isHigh][firstBit];
	if (res != -1) return res;
	res = 0;
	int low = (isLow ? 0 : bits(l, pos)), high = (isHigh ? 1 : bits(r, pos));
	for(int choice = low; choice <= high;++choice){
		res += 
			solve(pos - 1,isLow | (choice != low),isHigh | (choice != high), firstBit | choice == 1);
		if (choice == 1 && low == 0 && firstBit == 1)
			res += solve(pos-1, isLow, isHigh,1);
		res %= mod;
	}
	return res;
}
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0);
	cin >> l >> r;
	memset(dp, -1, sizeof(dp));
	cout << solve(59, 0,0,0) << '\n';
	// debug
	int ans = 0;
	// for(int i=l;i<=r;++i){
	// 	for(int j=i;j<=r;++j) if (j % i == (j ^ i)) {
	// 		ans++;
	// 		// cout << j << ' ' << i << '\n';
	// 	}
	// }
	// cout << ans << '\n';
}

Measured memory_bytes: 3648
// --------------------<optimizations>--------------------
#pragma GCC optimize("O3")
//(UNCOMMENT WHEN HAVING LOTS OF RECURSIONS)\
#pragma comment(linker, "/stack:200000000")
//(UNCOMMENT WHEN TRYING TO BRUTEFORCE WITH A LOT OF LOOPS)\
#pragma GCC optimize("unroll-loops")

#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include<bits/stdc++.h>

using namespace std;

#define int long long
#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define pii pair<ll,ll>
#define vpii vector<pair<ll,ll> >
#define F first
#define S second
#define ld long double
#define built __builtin_popcountll
#define mst(a,i) memset(a,i,sizeof(a))
#define all(x) x.begin(),x.end()
#define itit(it,a) for(auto it=(a).begin(); it!=(a).end(); it++)
#define rep(i,a,b) for(ll i=a; i<b; i++)
#define repr(i,a,b) for(ll i=a; i>b; i--)
#define reprr(i,a,b) for(ll i=a; i>=b; i--)
#define pi 3.14159265358979323846264338327950288419716939937510582097494459230
ll max3(ll x,ll y,ll z) {return max(max(x,y),z);}
ll min3(ll x,ll y,ll z) {return min(min(x,y),z);}
const ll N=1e5+10,M=2e5+10,M2=1e6+10,mod=1e9+7,inf=1e17+10;
const int INF=1e9+7;
void add(int& a, int b) {a+=b;if(a>=mod){a-=mod;}}

#define trace(...) cerr<<"Line:"<<__LINE__<<" "; __f(#__VA_ARGS__, __VA_ARGS__)
template<typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
    cerr<<name<<" : "<<arg1<<endl;
}
template<typename Arg1, typename ... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
    const char *comma=strchr(names+1,',');
    cerr.write(names,comma-names)<<" : "<<arg1<<" | ";
    __f(comma+1,args...);
}

int X[] = {0, 1, 0, -1};
int Y[] = {-1, 0, 1, 0};
//assic value of ('0'-'9') is(48 - 57) and (a-z) is (97-122) and (A-Z) is(65-90) and 32 for space
ll power(ll x,ll n){ll result=1;while(n>0){if(n%2==1)result=(result*x)%mod; x=((x%mod)*(x%mod))%mod;n=n/2;}return result;}


int32_t main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int a[4][4];
    rep(i,1,4){
        rep(j,1,4){
            cin >> a[i][j];
        }
    }
    int vis[4][4]={0};
    int n;
    cin >> n;
    while(n--){
        int x;
        cin >> x;
        rep(i,1,4){
            rep(j,1,4){
                if(a[i][j]==x) vis[i][j]=1;
            }
        }
    }
    bool ok=false;
    for(int i=1; i<=3; i++){
        int sum=0;
        int sum1=0;
        for(int j=1; j<=3; j++){
            sum+=vis[i][j];
            sum1+=vis[j][i];
        }
        if(sum==3 || sum1==3) ok=true;
    }
    if((vis[1][1] && vis[2][2] && vis[3][3])||(vis[3][1] && vis[2][2] && vis[1][3])) ok=true;
    if(ok) cout << "Yes";
    else cout << "No";
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;

namespace AtCoder.Abc
{
    //https://atcoder.jp/contests/abc144/tasks/abc144_a
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var inputIntArray = Console.ReadLine().Split(' ').Select(i => int.Parse(i));
            int a = inputIntArray.ElementAt(0);
            int b = inputIntArray.ElementAt(1);

            if(a < 10 && b < 10)
            {
                Console.WriteLine(a * b);
            }
            else
            {
                Console.WriteLine(-1);
            }

        }
    }
}


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

using namespace std;
using ll = long long;
using v1 = vector<int>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;

int S =0;
void merge(vector<ll>& a, int left, int mid, int right){
	int n1 = mid -left;
	int n2 = right - mid;
	vector<ll> L(n1);
	vector<ll> R(n2);
	rep(i, n1){
		L.at(i) = a.at(left + i);
	}
	L.push_back(1e10);
	rep(i, n2){
		R.at(i) = a.at(mid + i);
	}
	R.push_back(1e10);
	int i = 0;
	int j = 0;
	for(int k = left; k < right; k++){
		S++;
		if(L.at(i) > R.at(j)){
			a.at(k) = R.at(j);
			j++;
		}else{
			a.at(k) = L.at(i);
			i++;
		}
	}
}

void mergesort(vector<ll>& a, int left, int right){
	if(left +1 == right) return;
	int mid = (right + left)/2;
	mergesort(a, left, mid);
	mergesort(a, mid, right);
	merge(a, left, mid, right);
}

int main(){
	int n;
	cin >> n;
	vector<ll> a(n);
	rep(i, n){
		int b;
		scanf("%d", &b);
		a.at(i) = b;
	}
	mergesort(a, 0, n);
	rep(i, n){
		int b = a.at(i);
		printf("%d", b);
		if(i != n-1) printf(" ");
	}
	cout << endl << S << endl;;
}



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

int main(){
  int R,G,B,N;
  cin>>R>>G>>B>>N;
  int i=0;
  for(int r=0;r*R<=N;r++){
    int N2=N-r*R;
    for(int g=0;g*G<=N2;g++){
      if((N2-g*G)%B!=0)
        continue;
      i++;
    }
  }
  cout<<i<<endl;
}

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

class UnionFind {
private:
  int N;
  vector<int> PS;

public:
  UnionFind() : N(0) {}
  UnionFind(int n) : N(n), PS(n, -1) {}
  bool unite(int a, int b) {
    int x = root(a), y = root(b);
    if (x == y) return false;
    if (-PS.at(x) < -PS.at(y)) swap(x, y);
    PS.at(x) += PS.at(y);
    PS.at(y) = x;
    return true;
  }
  bool same(int a, int b) { return root(a) == root(b); }
  int root(int a) {
    if (PS.at(a) < 0) return a;
    return PS.at(a) = root(PS.at(a));
  }
  int size(int a) { return -PS.at(root(a)); }
  vector<vector<int>> groups() {
    vector<int> B(N), S(N);
    for (int i = 0; i < N; i++) {
      B.at(i) = root(i);
      S.at(B.at(i))++;
    }
    vector<vector<int>> ret(N);
    for (int i = 0; i < N; i++) {
      ret.at(i).reserve(S.at(i));
    }
    for (int i = 0; i < N; i++) {
      ret.at(B.at(i)).push_back(i);
    }
    auto f = [&](const vector<int> &v) { return v.empty(); };
    ret.erase(remove_if(ret.begin(), ret.end(), f), ret.end());
    return ret;
  }
};

int main() {
  int N, M;
  cin >> N >> M;
  UnionFind UF(N);
  int cnt = N;
  for (int i = 0; i < M; i++) {
    int A, B;
    cin >> A >> B, A--, B--;
    cnt -= UF.unite(A, B);
  }
  cout << cnt - 1 << "\n";
}

Measured memory_bytes: 3756
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
    int n, m; cin >> n >> m;
    vector<int> as(n);
    vector<pair<int, int>> pairs(m);
    for(int i=0; i<n; ++i){
        cin >> as[i];
    }
    for(int i=0; i<m; ++i){
        int b, c; cin >> b >> c;
        pairs[i]=make_pair(c, b);
    }

    sort(as.begin(), as.end());
    sort(pairs.begin(), pairs.end(), greater<pair<int, int>>());

    int ai=0, pi=0;
    while(ai<n && pi<m){
        if(as[ai]>=pairs[pi].first){
            break;
        }
        as[ai]=pairs[pi].first;
        ++ai;
        --pairs[pi].second;
        if(pairs[pi].second==0) ++pi;
    }

    long long ans=0;
    for(int i=0; i<n; ++i){
        ans+=as[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1408
import numpy as np

N = int(input())
A = list(map(int,input().split()))

A = sorted(A)
C = np.cumsum(A)

ans = 0
cnt = 0

for i in range(N-1) :
    if C[i]*2 >= A[i+1] :
        cnt += 1
    else :
        cnt = 0

ans = cnt + 1

print(ans)
    

Measured memory_bytes: 23220
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#define ll long long 
#define fr(i,n) for(int i=0;i<n;i++)
#define pb push_back
#define inf (1<<31)
#define xx first
#define yy second

using namespace std;

void bin(vector<int> &b){
   
    for(int i=b.size()-1;i>=0;i--){
        if(b[i]==0){
            b[i]++;
            break;
        }
        else
            b[i]=0;
    }
}
long long int f(const vector<int> &a,int p,int q){
    long long int s=0;
    for(int i=q,j=0; i>=p; i--,j++){
        s+=a[i]*pow(10,j);
    }
    return s;
}
int main() {
	ios::sync_with_stdio(0);
	string S;
	cin>>S;
	long long int sum=0;
	vector<int> a(S.length()),b(S.length()-1);
	fr(i,S.length()){
	    a[i]=S[i]-48;
	}
	
	sum=f(a,0,a.size()-1);
//	cout<<f(a,0,2)<<endl;;
	fr(i,(1<<a.size())-1){
	    bin(b);
	    vector<int> c;
	    c.pb(-1);
	    fr(j,b.size()){
	        if(b[j]==1)
	            c.pb(j);
	    }
	    c.pb(a.size()-1);
	    fr(j,c.size()-1){
	        sum+=f(a,c[j]+1,c[j+1]);
//	        cout<<f(a,c[j]+1,c[j+1])<<endl;
	    }
	}
//	fr(i,a.size())
//	    cout<<a[i]<<endl;
    
	cout<<sum/2;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<ll,ll> P;
#define M 1000000007
#define F first
#define S second
#define PB push_back
#define INF 100000000000000000
int a,b;
int main(void){
    cin>>a>>b;
    if(b>1)cout<<a-(b-1)-1<<endl;
    else cout<<0<<endl;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int[] A = new int[26];
		for(int i=0;i<26;i++) A[i] = (int)1e9;
		for(int i=0;i<N;i++){
			int[] B = new int[26];
			foreach(var c in S[i]) B[c - 'a']++;
			for(int j=0;j<26;j++){
				A[j] = Math.Min(A[j],B[j]);
			}
		}
		
		List<char> L = new List<char>();
		for(int i=0;i<26;i++){
			for(int j=0;j<A[i];j++) L.Add((char)('a' + i));
		}
		
		Console.WriteLine(String.Join("",L));
		
		
		
	}
	int N;
	String[] S;
	public Sol(){
		N = ri();
		S = new String[N];
		for(int i=0;i<N;i++) S[i] = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


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

int main(){
  int64_t X,A,B;
  cin >> X >> A >> B;
  if(B-A<=0){
    cout << "delicious" << endl;
  }else{
    if(B-A<=X){
      cout << "safe" << endl;
    }else{
      cout << "dangerous" << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
n = int(input())
l = list(map(int,input().split()))
m = l[0]
s = 0
for x in range(1,n):
  if l[x-1]>l[x]:
    s+=(m - l[x])
    l[x] = l[x-1]
  else:
    m = l[x]
print(s)


Measured memory_bytes: 32156
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

#include <boost/rational.hpp>
*/
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define repr4(i,s,n) for(ll i = (n);i>=(s);i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Graphw = vector<vector<pair<ll,ll>>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;
#define MOD 1000000007;
/*
namespace mp = boost::multiprecision;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部長が32の浮動小数点数型
using Real32 = mp::number<mp::cpp_dec_float<32>>;
// 仮数部長が1024の浮動小数点数型
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
// 有理数型
using Rat = boost::rational<Bint>;
*/




int main() {
string A,B;
cin>>A>>B;
if(A.size()>B.size()){
  cout<<"GREATER"<<endl;
  return 0;
}
else if(A.size()<B.size()){
  cout<<"LESS"<<endl;
}
else{
  int x=0;
  while(x<A.size()){
    if(A[x]-'0'>B[x]-'0'){
      cout<<"GREATER"<<endl;
      return 0;
    }
    else if(A[x]-'0'<B[x]-'0'){
      cout<<"LESS"<<endl;
      return 0;
    }
    else{
      x++;
    }
  }
  cout<<"EQUAL"<<endl;
}
return 0;
}

Measured memory_bytes: 3656
n,m=map(int,input().split())
mp = {}
arr= [ int(o) for o in input().split()]
for i in range (n):
    mp[i+1]=arr[i]
s = set()
# print(mp)
while m>0:
    a,b=map(int,input().split())
    if(mp[a]<mp[b]):
        s.add(a)
    elif(mp[b]<mp[a]):
        s.add(b)
    else:
        s.add(a)
        s.add(b)
    m-=1
print(n-len(s))




Measured memory_bytes: 25836
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
constexpr int mod=1000000007;
constexpr int mod1=998244353;
vector<int> dx={0,1,0,-1},dy={-1,0,1,0};
bool inside(int y,int x,int h,int w){
	if(y<h && y>=0 && x<w && x>=0) return true;
	return false;
}





int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,k;cin >> n >> k;
	vector<int> a(n);
	rep(i,n) cin >> a.at(i);
	cout << (n - 1 + (k - 2)) / (k - 1) << endl;
}


Measured memory_bytes: 640
using DataStructures

parseInt(x)=parse(Int, x)
parseMap(x::Array{SubString{String},1})=map(parseInt, x)

function main()
    K = readline() |> parseInt
    dd = DefaultDict{Int,Int}(0)
    for i in 1:K
        for j in 1:K
            dd[gcd(i,j)] += 1
        end
    end
    ans = 0
    for key in keys(dd)
        for k in 1:K
           ans += gcd(key,k)*dd[key] 
        end
    end
    println(ans)
end

main()

Measured memory_bytes: 193380
#include<bits/stdc++.h>
using namespace std;
int main(){ 
   int n,p,r;
   cin>>n>>p>>r;
   if((n==p)&&(p==r)){
       cout<<"No"<<endl;
   }
   else if((n==p)||(p==r)||(r==n)){
       cout<<"Yes"<<endl;
   }
   else{
       cout<<"No"<<endl;
   }
   
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
#include <iostream>
#include <algorithm>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <utility>
using namespace std;

#define rep(i,n) for(int (i)=0; (i)<(int)(n); ++(i))
#define foreach(c,i) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)

const float eye[] = { .2f, .6f, 1.1f, (float)(1<<30) };

int main() {
  float l, r;
  int cl[4], cr[4];

  rep (i,4) cl[i] = cr[i] = 0;
  while (cin >> l >> r) {
    int ll = upper_bound(eye, eye + 4, l) - eye;
    int rl = upper_bound(eye, eye + 4, r) - eye;
    cl[3-ll]++;
    cr[3-rl]++;
  }
  rep (i,4) cout << cl[i] << " " << cr[i] << endl;
  return 0;
}

Measured memory_bytes: 0
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        _r: usize,
        g: usize,
        b: usize,
    };
    println!(
        "{}",
        ["NO", "YES"][((g * 10 + b) % 4 == 0) as usize]
    );
}


Measured memory_bytes: 2072
#include <cstdio>
#include <algorithm>
#define HEIGHT 10

using namespace std;

int a[HEIGHT];
/*
void solve(){
	bool f=true;
	int right,left;
	right = left = 0;
	for(int i=0;i<HEIGHT;i++){
		if(right<a[i] && left<a[i]){
			if(right<left){
				left = a[i];
			} else {
				right = a[i];
			}
		} else if(right<a[i]){
			right = a[i];
		} else if(left<a[i]){
			left = a[i];
		} else {
			f = false;
			break;
		}
	}
	if(f) printf("YES");
	else printf("NO");
}*/

bool back(int right, int left, int n){
	if(n == 10) return true;
	bool result = false;
	if(right<a[n]) result = result || back(a[n],left,n+1);
	if(left<a[n]) result = result || back(right,a[n],n+1);
	return result;
}

void solve(){
	if(back(0,0,0)) printf("YES\n");
	else printf("NO\n");
}
			
int main(){
	
	int lp;
	scanf("%d",&lp);
	
	for(int i=0;i<lp;i++){
		for(int j=0;j<HEIGHT;j++){
			scanf(" %d",&a[j]);
		}
		solve();	
	}
	return 0;
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/03/03  Problem: ABC 120 A / Link: http://abc120.contest.atcoder.jp/tasks/abc120_a  ----- */


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

	ios_base::sync_with_stdio(false);

	LL A, B, C; cin >> A >> B >> C;
	LL ans = (B/A)*C;
	ans = min(B / A, C);
	
	
	cout << (ans) << "\n";

	return 0;
}


Measured memory_bytes: 256
N = int(input())
now_x = 0
now_y = 0
now_t = 0
Flag = False
for i in range(N):
    t , x, y = map(int,input().split())
    dx = abs(x - now_x)
    dy = abs(y - now_y)
    dt = abs(t - now_t)
    if (dt - (dx + dy)) % 2 != 0 or dt < (dx + dy):
        Flag = True
    now_x = x
    now_y = y
    now_t = t
print("No" if Flag else "Yes")

Measured memory_bytes: 3064
from collections import Counter
S = input()
L = []
for i in range(len(S)):
    L.append(S[i])

c = Counter(L)

if (len(S) == 1):
    print('YES')
    exit()

max_num = 0
min_num = 10**5 + 7
if (len(S) % 2 == 0):
    # 偶数個の場合はlen(S) の切り捨て(含める)までのスライスとそれ以外を[::-1]したのとイコールにならないようにする
    even = 0
    odd = 0
    for i in set(L):
        if (c[i] % 2 == 0):
            even += 1
            max_num = max(max_num, c[i])
            min_num = min(min_num, c[i])
        else:
            odd += 1
            max_num = max(max_num, c[i])
            min_num = min(min_num, c[i])

    if (max_num - min_num > 1):
        print('NO')
        exit()
    else:
        if (even == 3 and odd == 0):
            print('YES')
            exit()
        elif (even == 1 and odd == 2):
            print('YES')
            exit()
        elif (odd == 2 and even == 0):
            print('YES')
            exit()
        else:
            print('NO')
            exit()
else:
    # 奇数この場合はlen(S)の切り捨て(含めない)までのスライスとそれ以外を[::-1]したのとイコールにならないように
    even = 0
    odd = 0
    for i in set(L):
        if (c[i] % 2 == 0):
            even += 1
            max_num = max(max_num, c[i])
            min_num = min(min_num, c[i])
        else:
            odd += 1
            max_num = max(max_num, c[i])
            min_num = min(min_num, c[i])
    if (max_num - min_num > 1):
        print('NO')
        exit()
    else:
        if (even == 2 and odd == 1):
            print('YES')
            exit()
        elif (even == 0 and odd == 3):
            print('YES')
            exit()
        else:
            print('NO')
            exit()


Measured memory_bytes: 9996
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF LLONG_MAX/5
#define all(v) v.begin(),v.end()
#define P pair<int,int>
#define S second
#define F first
#define f(i,n) for(int i=0;i<n;i++)
int mypow(int a,int b,int c){
	if(b==0)return 1;
	if(b%2)return mypow(a,b-1,c)*a%c;
	int z=mypow(a,b/2,c);
	return z*z%c;
}
int a[100000],b[100000],c[100000],d[100000];
double x[200000];
vector<int> v;
signed main(){
	int n,m;
	cin>>n;
	f(i,n){
		cin>>a[i]>>b[i];
		v.push_back(a[i]);
	}
	v.push_back(0);
	sort(all(v));
	v.erase(unique(all(v)),v.end());
	x[0]=1;
	f(i,n){
		int z=lower_bound(all(v),a[i])-v.begin();
		x[z]=1-((double)(b[i])/10);
	}
	f(i,n+1){
		if(i)x[i]*=x[i-1];
	}
	cin>>m;
	f(i,m){
		cin>>c[i]>>d[i];
		int y=lower_bound(all(v),c[i])-v.begin()-1,z=lower_bound(all(v),d[i])-v.begin()-1;
		printf("%.100lf\n",1e9*x[z]/x[y]);
	}
	return 0;	
}




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

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i,n) for(ll i=1;i<=(ll)(n);i++)
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define rrep1(i,n) for(ll i=(ll)(n);i>0;i--)
#define REP(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
#define mp make_pair


int main() {
  int h, w;
  cin >> h >> w;
  vector<string> s(h);
  rep (i, h) {
    cin >> s[i];
  }
  bitset<100> tate, yoko;
  rep (i, h) {
    bool flag = true;
    rep (j, w) {
      if (s[i][j] == '#') {
        flag = false;
        break;
      }
    }
    if (flag) {
      tate[i] = true;
    }
  }
  rep (j, w) {
    bool flag = true;
    rep (i, h) {
      if (s[i][j] == '#') {
        flag = false;
        break;
      }
    }
    if (flag) {
      yoko[j] = true;
    }
  }
  rep (i, h) {
    if (tate[i]) {
      continue;
    }
    rep (j, w) {
      if (!yoko[j]) {
        cout << s[i][j];
      }
    }
    cout << endl;
  }
}
  


Measured memory_bytes: 256
//#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define trav(x,a) for (const auto& x: a)
#define sz(x) (int)(x).size()
#define all(x) (x).begin(), x.end()
#define mem(a,v) memset((a), (v), sizeof (a))
#define enl printf("\n")
#define case(t) printf("Case #%d: ", (t))
#define ni(n) scanf("%d", &(n))
#define nl(n) scanf("%lld", &(n))
#define nai(a, n) for (int _i = 0; _i < (n); _i++) ni(a[_i])
#define nal(a, n) for (int _i = 0; _i < (n); _i++) nl(a[_i])
#define pri(n) printf("%d\n", (n))
#define prl(n) printf("%lld\n", (n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define vii vector<pii>
#define vll vector<pll>
#define vi vector<int>
#define vl vector<long long>
#define pb push_back
#define mp make_pair
#define st first
#define nd second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef cc_hash_table<int,int,hash<int>> ht;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> oset;
const double pi = acos(-1);
const int mod = 1e9 + 7;
const int inf = 1e9 + 7;
const int N = 1e6 + 5;
const double eps = 1e-9;

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


Measured memory_bytes: 3616
#ifndef LOCAL
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#else
#include <iostream>
#include <iomanip> 
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; }
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
#define fix(a) fixed << setprecision(a)
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'


void solve(){
  double n;
  cin >> n;
  rep(i,1,n+1){
    if (int(i * 1.08) == n){
      cout << i;
      return;
    }
  }
  cout << ":(";
}

int main() {
  ios::sync_with_stdio(false);
  int t = 1;
  // cin >> t;
  forn(i, t){
    solve();
  }
}

/* 

1
322123


n - 1
0 ... (n-1) [res ... res] S - (n-1) ... S


 */

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>

int main() {
	std::string s;
	std::cin >> s;
	int nSum = 0;
	if (s[0] == 'Y')
		nSum += 1;
	if (s[1] == 'A')
		nSum += 1;
	if (s[2] == 'K')
		nSum += 1;
	if (s[3] == 'I')
		nSum += 1;

	if (nSum == 4) {
		std::cout << "Yes" << std::endl;
	}
	else {
		std::cout << "No" << std::endl;
	}
	return 0;
}

Measured memory_bytes: 256
use std::io::*;
use std::str::FromStr;

fn judge(mut x: u32) -> bool {
    if x % 3 == 0 {
        true
    } else {
        while x > 0 {
            if x % 10 == 3 {
                return true;
            } else {
                x /= 10;
            }
        }
        false
    }
}

fn main() {
    let cin = stdin();
    let mut sc = Scanner::new(cin.lock());

    let n: u32 = sc.next();
    for x in 1..(n + 1) {
        if judge(x) {
            print!(" {}", x);
        }
    }
    println!();
}

/* ========== Scanner ========== */

struct Scanner<R: Read> {
    reader: R,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(reader: R) -> Scanner<R> {
        Scanner { reader: reader }
    }

    fn read<T: FromStr>(&mut self) -> Option<T> {
        let token = self
            .reader
            .by_ref()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            token.parse::<T>().ok()
        }
    }

    fn next<T: FromStr>(&mut self) -> T {
        if let Some(s) = self.read() {
            s
        } else {
            writeln!(stderr(), "Terminated with EOF").unwrap();
            std::process::exit(0);
        }
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.next()).collect()
    }

    fn chars(&mut self) -> Vec<char> {
        self.next::<String>().chars().collect()
    }
}



Measured memory_bytes: 5032
#include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
#include<algorithm>
#include<cmath>
#include<limits>
using namespace std;

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

typedef long long ll;

int main() {
	int a, b;
	cin >> a >> b;
	if (max(a, b) - min(a, b) >= 1) cout << max(a, b) * 2 - 1 << endl;
	else cout << max(a, b) + min(a, b) << endl;
	return 0;
}

Measured memory_bytes: 256
function main()
  
  N = parse(Int, readline())
  A = map(x -> parse(Int, x), split(readline()))
  
  ans::BigInt = 1
  
  if in(0, A)
    ans = 0
  end
  
  for i in A
    
    if ans * i > 10^18
      ans = -1
      break
    else
      ans *= i
    end
    
  end
  
  println(ans)
  
end

main()

Measured memory_bytes: 201572
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
priority_queue<lli> p;
priority_queue<lli, vector<lli>, greater<lli> > q;
lli a, b(0), c(0), d, e, f, g, h, x[100009], y[100009], z[100009], u[100009], v[100009];
int main()
{
	cin>>a;
	for(int i=1;i<=a;i++)
	{
		cin>>x[i];
		q.push(x[i]);
		b=b+x[i];
	}
	u[0]=b;
	for(int i=1;i<=a;i++)
	{
		cin>>y[i];
		if(q.top()>y[i])
		{
			u[i]=u[i-1];
		}
		else
		{
			u[i]=b-q.top()+y[i];
			b=u[i];
			q.pop();
			q.push(y[i]);
		}
	}
	for(int i=1;i<=a;i++)
	{
		cin>>z[i];
		p.push(z[i]);
		c=c+z[i];
	}
	v[a+1]=c;
	for(int i=a;i>=1;i--)
	{
		if(p.top()<y[i])
		{
			v[i]=v[i+1];
		}
		else
		{
			v[i]=c-p.top()+y[i];
			c=v[i];
			p.pop();
			p.push(y[i]);
		}
	}
	d=-1e18;
	for(int i=0;i<=a;i++)
	{
		d=max(d, u[i]-v[i+1]);
	}
	cout<<d;
}

Measured memory_bytes: 5876
from heapq import heappush,heappop,heapify
from collections import deque,defaultdict,Counter
import itertools
from itertools import permutations,combinations
import sys
import bisect
import string
import math
import time
import random
def I():
    return int(input())
def MI():
    return map(int,input().split())
def LI():
    return [int(i) for i in input().split()]
def LI_():
    return [int(i)-1 for i in input().split()]
def StoI():
    return [ord(i)-97 for i in input()]
def ItoS(nn):
    return chr(nn+97)
def GI(V,E,Directed=False,index=0):
    org_inp=[]
    g=[[] for i in range(n)]
    for i in range(E):
        inp=LI()
        org_inp.append(inp)
        if index==0:
            inp[0]-=1
            inp[1]-=1
        if len(inp)==2:
            a,b=inp
            g[a].append(b)
            if not Directed:
                g[b].append(a)
        elif len(inp)==3:
            a,b,c=inp
            aa=(inp[0],inp[2])
            bb=(inp[1],inp[2])
            g[a].append(bb)
            if not Directed:
                g[b].append(aa)
    return g,org_inp
def show(*inp,end='\n'):
    if show_flg:
        print(*inp,end=end)
YN=['Yes','No']
mo=10**9+7
inf=float('inf')
l_alp=string.ascii_lowercase
u_alp=string.ascii_uppercase
ts=time.time()
#sys.setrecursionlimit(10**5)
input=lambda: sys.stdin.readline().rstrip()

def ran_input():
    import random
    n=random.randint(4,16)
    rmin,rmax=1,10
    a=[random.randint(rmin,rmax) for _ in range(n)]
    return n,a

show_flg=False
show_flg=True
#for i in range(n):

ans=0
a,b=LI()
import fractions
print(a*b//fractions.gcd(a,b))


Measured memory_bytes: 65004
#include <stdio.h>
#include <iostream>
#include <math.h>
using namespace std;
 
int main()
{	
	int a,b;
	scanf("%d %d", &a, &b);
	int res1 = a*b;
	int res2 = (a*2) + (b*2);
    printf("%d %d\n", res1, res2);
    return 0;
}

Measured memory_bytes: 1188
//
//  main.cpp
//  CoderWork
//
//  Created by Minoru Hayashi on 2020/02/29.
//  Copyright © 2020 Minoru Hayashi. All rights reserved.
//

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

#define REP(i,n) for (int i=0; i<(n); i++)
#define REP2(i,x,n) for (int i=x; i<(n); i++)
#define ALL(n) begin(n), end(n)

using ll = long long;

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


const int INF = 1LL<<29;

//#define __DBG__


void solve(void){

  int N;
  cin >> N;
  
  vector<int> h(N);
  
  REP(i,N){
    cin >> h[i];
  }
  
  vector<int> DP(N+2,INF);
  DP[0]=0;
  
  REP2(i,1,N){
    DP[i] = min (DP[i], DP[i-1]+abs(h[i]-h[i-1]));
    if(i>1){ DP[i] = min (DP[i], DP[i-2]+abs(h[i]-h[i-2]));}
  }
 
  cout << DP[N-1] << endl;

  return;
}


int main(int argc, const char * argv[]) {

    cin.tie(0);
    ios::sync_with_stdio(false);
  
    solve();
 
    return 0;
}




Measured memory_bytes: 1024
n = int(input())
score = []
for _ in range(n):
  score.append(int(input()))

score.sort()

total = sum(score)
for num in score:
  if total%10 == 0 and num%10 != 0:
    total -= num
    break

if total%10 == 0: total = 0
print(total)

Measured memory_bytes: 3064
import sys
from itertools import product

input = sys.stdin.readline


def main():
    N = int(input())
    X = [0] * N
    Y = [0] * N
    H = [0] * N
    for i in range(N):
        X[i], Y[i], H[i] = map(int, input().split())

    for Cx, Cy in product(range(101), repeat=2):
        Ch = set()
        Ch_upper = float("inf")
        for x, y, h in zip(X, Y, H):
            a = abs(x - Cx) + abs(y - Cy)
            if h == 0:
                Ch_upper = min(Ch_upper, a)
            else:
                Ch.add(h + a)
        if len(Ch) != 1:
            continue
        else:
            Ch = Ch.pop()
            if Ch <= Ch_upper:
                ans = f"{Cx} {Cy} {Ch}"
                break

    print(ans)


if __name__ == "__main__":
    main()


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

using namespace std;

#define int long long
#define ALL(x) (x).begin(),(x).end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

typedef pair<int,int> PI;
typedef pair<int,pair<int,int>> PII;
static const int INF=1010000000000000017LL;
static const double eps=1e-12;
static const double pi=3.14159265358979323846;
static const int dx[4]={1,-1,0,0};
static const int dy[4]={0,0,1,-1};
static const int ddx[8]={1,-1,0,0,1,1,-1,-1};
static const int ddy[8]={0,0,1,-1,1,-1,1,-1};

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

int A,B,C;
int K;

signed main(){
    cin>>A>>B>>C;
    cin>>K;
    int cnt=0;
    while(cnt<K){
        if(A<B&&B<C)break;
        if(B<=A)B*=2;
        else if(C<=B)C*=2;
        cnt++;
    }
    if(A<B&&B<C)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define debug(x) cerr << #x << ": " << x << endl
#define debugArray(x, n)                           \
  for (long long hoge = 0; (hoge) < (n); ++(hoge)) \
  cerr << #x << "[" << hoge << "]: " << x[hoge] << endl
using namespace std;

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  const int INF = INT_MAX / 10;
  int H, W;
  cin >> H >> W;
  int N = H * W;
  int dist[N][N];
  for (int i = 0; i < N; i++) fill(dist[i], dist[i] + N, INF);
  string S[H];
  for (int i = 0; i < H; i++) cin >> S[i];
  for (int i = 0; i < H; i++) {
    for (int j = 0; j < W; j++) {
      if (S[i][j] == '.') {
        int now = i * W + j;
        dist[now][now] = 0;
        for (pair<int, int> d : {make_pair(0, 1), make_pair(1, 0),
                                 make_pair(-1, 0), make_pair(0, -1)}) {
          int nexti = i + d.first, nextj = j + d.second;
          if (nexti < 0 || H <= nexti || nextj < 0 || W <= nextj) continue;
          if (S[nexti][nextj] == '#') continue;
          int next = nexti * W + nextj;
          dist[now][next] = 1;
        }
      }
    }
  }
  for (int k = 0; k < N; k++) {
    for (int i = 0; i < N; i++) {
      for (int j = 0; j < N; j++) {
        if (dist[i][j] > dist[i][k] + dist[k][j]) {
          dist[i][j] = dist[i][k] + dist[k][j];
        }
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < N; i++) {
    for (int j = 0; j < N; j++) {
      if (dist[i][j] == INF) continue;
      ans = max(ans, dist[i][j]);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4240
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  vector<int> v(N);
  int count = 0;
  for(int i=0; i<N; i++){
    cin >> v.at(i);
  }
  vector<int> w(N);
  for(int i=0; i<N; i++){
    while(v.at(i)%2 == 0){
      count++;
      v.at(i) /= 2;
    }
    
    w.at(i) = count;
    count = 0;
  }
  sort(w.begin(), w.end());
  cout << w.at(0) << endl;
    
	
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int h, w;
    cin >> h >> w;
    vector<vector<int>> g(h + 2, vector<int>(w + 2, 0));
    auto x = g;
    for (int i = 0; i < h; ++i) {
        string s;
        cin >> s;
        for (int j = 0; j < w; ++j) {
            g[i + 1][j + 1] = (s[j] == '.');
        }
    }
    for (int i = 0; i < h; ++i) {
        int c = 0;
        for (int j = 0; j < w; ++j) {
            x[i + 1][j + 1] += c;
            if (g[i + 1][j + 1]) c++;
            else c = 0;
        }
    }
    for (int i = 0; i < h; ++i) {
        int c = 0;
        for (int j = w-1; j >= 0; --j) {
            x[i + 1][j + 1] += c;
            if (g[i + 1][j + 1]) c++;
            else c = 0;
        }
    }
    for (int j = 0; j < w; ++j) {
        int c = 0;
        for (int i = 0; i < h; ++i) {
            x[i + 1][j + 1] += c;
            if (g[i + 1][j + 1]) c++;
            else c = 0;
        }
    }
    for (int j = 0; j < w; ++j) {
        int c = 0;
        for (int i = h-1; i >= 0; --i) {
            x[i + 1][j + 1] += c;
            if (g[i + 1][j + 1]) c++;
            else c = 0;
        }
    }
    int ans = 0;
    for (int i = 0; i < h; ++i) {
        for (int j = 0; j < w; ++j) {
            if (g[i+1][j + 1]) {
                ans = max(ans, x[i+1][j + 1] + 1);
            }
        }
    }
    cout << ans << "\n";
    return 0;
}

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

int main(){
    int n;
    cin >> n;
    string s[n], x;
    int t[n];
    rep(i, n) cin >> s[i] >> t[i];
    cin >> x;
    bool flag = false;
    int ans = 0;
    rep(i, n){
        if (flag) ans += t[i];
        if (s[i] == x) flag = true;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl
#define show2(a, n, m) rep(i, n) { rep(j, m) {cout << a[i][j] << ' ';} cout << endl;} 
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100010;

int main() {
//	cout << fixed << setprecision(15);
    int n, m;
    cin >> n >> m;
    vector<pii> ans;
    if(n % 2) {
        rep1(i, n) {
            if(i >= n - i + 1) break;
            ans.push_back(make_pair(i, n - i + 1));
        }
    }
    else {
        int di = 0;
        rep1(i, n) {
            if(i + di >= n - i + 1) break;
            ans.push_back(make_pair(i + di, n - i + 1));
            if(n / 4 == i) di = 1;
        }
    }
    rep(i, m) cout << ans[i].first << ' ' << ans[i].second << endl;
}


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

int main(){
  int n,m,ans_ac=0,ans_pen=0;cin>>n>>m;
  vector<int> pen(100001,0);
  vector<bool> ac(100001,0);
  REP(i,m){
    string tmp;int p;
    cin>>p>>tmp;
    if(tmp=="AC"){
      if(ac.at(p)==0) ans_pen+=pen.at(p);
      ac.at(p)=1;
    }else{
      pen.at(p)++;
    }
  }

  REP(i,100001) if(ac.at(i)) ans_ac++;
  cout<<ans_ac<<" "<<ans_pen;
}

Measured memory_bytes: 640
//#define _GLIBCXX_DEBUG
#include<bits/stdc++.h>
#define PI 3.14159265359
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
const long long INF= 1e+18+1;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll> >vvl;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll,ll> T;
const ll MOD=1000000007LL;
string abc="abcdefghijklmnopqrstuvwxyz";
string ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
int main(){
  ll x,y,z,k;cin>>x>>y>>z>>k;
  vl a(x),b(y),c(z);
  rep(i,x)cin>>a[i];
  rep(i,y)cin>>b[i];
  rep(i,z)cin>>c[i];
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  sort(b.begin(),b.end());
  reverse(b.begin(),b.end());
  sort(c.begin(),c.end());
  reverse(c.begin(),c.end());
  priority_queue<tuple<ll,ll,ll,ll> >q;
  set<tuple<ll,ll,ll,ll> >S;
  q.push(make_tuple(a[0]+b[0]+c[0],0,0,0));
  S.insert(make_tuple(a[0]+b[0]+c[0],0,0,0));
  ll count=0;
  while(true){
    T t=q.top();
    q.pop();
    cout<<get<0>(t)<<endl;
    count++;
    if(count==k)return 0;
    ll i=get<1>(t);
    ll j=get<2>(t);
    ll k=get<3>(t);
    if(!S.count(make_tuple(a[i+1]+b[j]+c[k],i+1,j,k))&&i!=x-1){
      S.insert(make_tuple(a[i+1]+b[j]+c[k],i+1,j,k));
      q.push(make_tuple(a[i+1]+b[j]+c[k],i+1,j,k));
    }
    if(!S.count(make_tuple(a[i]+b[j+1]+c[k],i,j+1,k))&&j!=x-1){
      S.insert(make_tuple(a[i]+b[j+1]+c[k],i,j+1,k));
      q.push(make_tuple(a[i]+b[j+1]+c[k],i,j+1,k));
    }
    if(!S.count(make_tuple(a[i]+b[j]+c[k+1],i,j,k+1))&&k!=x-1){
      S.insert(make_tuple(a[i]+b[j]+c[k+1],i,j,k+1));
      q.push(make_tuple(a[i]+b[j]+c[k+1],i,j,k+1));
    }
  }
}

Measured memory_bytes: 1152
#include<bits/stdc++.h>
#define pb push_back
#define fr first
#define sc second
#define all(x) x.begin(), x.end()
#define skip continue
#define NAME "code"
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
 
void faster(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
 
const int MAXN = 2e5 + 1;
const ll INF = 1e18;
const ld pi = acos(-1);

string s, t;
vector<int> z;
int n;

vector<int> z_function(string s) {
    int n = (int) s.size();
    vector<int> z(n);
    for (int i = 1, l = 0, r = 0; i < n; ++i) {
        if (i <= r)
            z[i] = min (r - i + 1, z[i - l]);
        while (i + z[i] < n && s[z[i]] == s[i + z[i]])
            ++z[i];
        if (i + z[i] - 1 > r)
            l = i, r = i + z[i] - 1;
    }
    return z;
}

int main() {

    faster();

    cin >> n >> s >> t;

    s = t + '#' + s;
    n = s.size();

    z = z_function(s);

    for(int i = 0; i < n; ++i){
        if(i + z[i] == n){
            cout << n - z[i] - 1;

            return 0;
        }
    }

    cout << n - 1;

    return 0;
}

Measured memory_bytes: 256