akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<map>
#include<vector>
#include <bitset>
using namespace std;
#define MAX 300000
typedef long long ll;

int main(){
  pair<int,int> a[110],b[110];
  int N,data1,data2;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>data1>>data2;
    a[i]=make_pair(data1,data2);
  }

  for(int i=0;i<N;i++){
    cin>>data1>>data2;
    b[i]=make_pair(data1,data2);
  }
  sort(b,b+N);

  int num,temp,ans=0;

  for(int i=0;i<N;i++,num=-1,temp=-1){
    for(int j=0;j<N;j++){
      if(b[i].first>a[j].first && b[i].second>a[j].second){
        if(temp<a[j].second){
          temp=a[j].second;
          num=j;
        }
      }
    }
    if(num!=-1){
      ans++;
      a[num].first=300;
    }
  }
  cout<<ans<<endl;

  
}


Measured memory_bytes: 256
using System;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var word = Console.ReadLine().Split(' ');

            int LenA = word[0].Length;  // Aの文字数
            int LenB = word[1].Length;  // Bの文字数

            //char Ae = word[0].ToCharArray()[LenA - 1];  // Aの最後の文字
            //char Bs = word[1].ToCharArray()[0];         // Bの最初の文字
            //char Be = word[1].ToCharArray()[LenB -1];   // Bの最後の文字
            //char Cs = word[2].ToCharArray()[0];         // Cの最初の文字

            string Ae = word[0].Substring(LenA - 1, 1);
            string Bs = word[1].Substring(0, 1);
            string Be = word[1].Substring(LenB - 1, 1);
            string Cs = word[2].Substring(0, 1);

            if (Ae==Bs && Be==Cs) 
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>

using namespace std;

int main(void)
{
    int a, b, x;
    cin >> a >> b >> x;
    if(a > x){
        printf("NO\n");
    }else if(a + b < x){
        printf("NO\n");
    }else{
        printf("YES\n");
    }

    return 0;
}


Measured memory_bytes: 256
import java.io.*;
import java.math.*;
import java.util.*;
public class Main { 
 
	public static void main(String[] args) { 
		Scanner input = new Scanner(System.in);
		long N = input.nextLong();
		long P = input.nextLong(); //Product
		long maxGCD = 1;
		for (long prime = 2; prime <= Math.sqrt(P); prime++) {
			long numCurPrime = 0;
			while (P%prime==0) {
				P/=prime;
				numCurPrime++;
				if (numCurPrime%N==0) {
					maxGCD*=prime;
					numCurPrime=0; //Effectively floor division using simulation counters
				}
			}
		}
		if (P>1&&N==1) maxGCD*=P;
		System.out.println(maxGCD);
	}
	public static boolean Prime(long N) {
		for (long i = 2; i <= Math.sqrt(N); i++) {
			if (N%i==0) return false;
		}
		return true;
	}
}

Measured memory_bytes: 23892
h,w,m=map(int,input().split())
item=[list(map(int,input().split())) for i in range(m)]
row=[0]*h
col=[0]*w
for i in range(m):
    x,y=item[i]
    row[x-1]+=1
    col[y-1]+=1
mr,mc=max(row),max(col)
xr=set([i for i in range(h) if row[i]==mr])
xc=set([i for i in range(w) if col[i]==mc])
check=len(xr)*len(xc)
for i in range(m):
    r,c=item[i]
    if r-1 in xr and c-1 in xc:
        check-=1
print(mr+mc if check>0 else mr+mc-1)



Measured memory_bytes: 182604
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define repi(i, a, b) for (int i = int(a); i < int(b); ++i)
#define repr(i, n) for (int i = (int)n - 1; i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
const ll mod = 1e9 + 7;

//最大公約数
ll gcd(ll x, ll y) {
  if (y == 0) return x;
  if (y > x)
    return gcd(y, x);
  else
    return gcd(y, x % y);
}

int main() {
  ll a, b, ans = 1;
  cin >> a >> b;
  ll x = gcd(a, b);
  for (ll i = 2; i < 10000007; ++i) {
    if (x % i == 0) {
      while (x % i == 0) {
        x /= i;
      }
      ans++;
    }
  }
  if (x > 1) ans++;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

int cnt[4][2020][2020];

int main(void){
	int h,w,i,j,ans=0,tmp;
	string s[2020];
	cin >> h >> w;
	for(i=0; i<h; ++i){
		cin >> s[i];
		cnt[0][i][0] = ((s[i][0] == '#')?0:1);
		for(j=1; j<w; ++j){
			cnt[0][i][j] = ((s[i][j] == '#')?0:cnt[0][i][j-1]+1);
		}
		cnt[1][i][w-1] = ((s[i][w-1] == '#')?0:1);
		for(j=(w-1); j>0; --j){
			cnt[1][i][j-1] = ((s[i][j-1] == '#')?0:cnt[1][i][j]+1);
		}
	}
	for(j=0; j<w; ++j){
		cnt[2][0][j] = ((s[0][j] == '#')?0:1);
		for(i=1; i<h; ++i){
			cnt[2][i][j] = ((s[i][j] == '#')?0:cnt[2][i-1][j]+1);
		}
		cnt[3][h-1][j] = ((s[h-1][j] == '#')?0:1);
		for(i=(h-1); i>0; --i){
			cnt[3][i-1][j] = ((s[i-1][j] == '#')?0:cnt[3][i][j]+1);
		}
	}
	for(i=0; i<h; ++i){
		for(j=0; j<w; ++j){
			if(s[i][j]=='#'){
				continue;
			}
			tmp = cnt[0][i][j]+cnt[1][i][j]+cnt[2][i][j]+cnt[3][i][j]-3;
			ans = max(tmp,ans);
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 67968
#include <iostream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <utility>
#include <algorithm>
#include <functional>
#include <deque>
#define INF 1e9
#define MAX_N 100002
using namespace std;

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

int main() {
    int N;
    int t[MAX_N], x[MAX_N], y[MAX_N];
    int dt[MAX_N], dx[MAX_N], dy[MAX_N];
    t[0] = x[0] = y[0] = 0;
    cin >> N;
    for (int i = 1; i <= N; ++i) {
        cin >> t[i] >> x[i] >> y[i];
        dt[i] = t[i] - t[i - 1];
        dx[i] = abs(x[i] - x[i - 1]);
        dy[i] = abs(y[i] - y[i - 1]);
    }
    
    bool flag = true;
    for (int i = 1; i <= N; ++i) {
        int k = dt[i] - (dx[i] + dy[i]);
        if (k < 0 || k % 2 == 1) {
            flag = false;
            break;
        }
    }
    
    if (flag) {
        cout << "Yes\n";
    } else {
        cout << "No\n";
    }
    
    return 0;
}


Measured memory_bytes: 2560
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#define PII pair<int,int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
using namespace std;
inline int read(){
	int x=0,f=1;char c=getchar();
	while(c<'0'||c>'9') { if(c=='-') f=-1; c=getchar();}
	while(c>='0'&&c<='9') { x=(x<<3)+(x<<1)+(c^48); c=getchar();}
	return f==1?x:-x;
}
inline void print(int x){
	if(x<0) x=~x+1,putchar('-');
	if(x>=10) print(x/10);
	putchar((x%10)|48);
}
int n,m;
int fa[100010];
inline int find(int x){
	return fa[x]==x?x:find(fa[x]);
}
int main(){
	n=read(),m=read();
	for(int i=1;i<=n;++i) fa[i]=i;
	for(int i=1;i<=m;++i){
		int a=read(),b=read();
		int fx=find(a),fy=find(b);
		if(fx!=fy) fa[fx]=fy;
	}
	int ans=-1;
	for(int i=1;i<=n;++i) if(fa[i]==i) ++ans;
	print(ans);
}

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

int main()
{
    set<string> s;
    int n;
    string fruit;
    cin >> n;
    REP (i, n) {
        cin >> fruit;
        s.insert(fruit);
    }
    cout << s.size() << endl;
}

Measured memory_bytes: 19100
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ld long double
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
#define eb emplace_back
template<class T>void chmax(T &a,T b){if(a<b)a=b;}
template<class T>void chmin(T &a,T b){if(a>b)a=b;}
constexpr int INF=1000000000000000000;
constexpr int mod=1000000007;
constexpr double eps=1e-8;
const double pi=acos(-1);
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int Random(int mi,int ma){
    random_device rnd;
    mt19937 mt(rnd());//32bit
    //[mi,ma]
    uniform_int_distribution<int>engine(mi,ma);
    return engine(mt);
}
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%mod;
    int memo=modpow(a,b/2);
    return memo*memo%mod;
}
vector<int>kaijo,invkaijo;
void init_fact(int n){
    kaijo.resize(n+1);
    invkaijo.resize(n+1);
    kaijo[0]=1;
    for(int i=1;i<=n;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=mod;
    }
    rep(i,n+1)invkaijo[i]=modpow(kaijo[i],mod-2);
}
int comb(int a,int b){
    if(a<b)return 0;
    if(a<0||b<0)return 0;
    return kaijo[a]*invkaijo[a-b]%mod*invkaijo[b]%mod;
}
int inv(int x){
    x=modpow(x,mod-2);
    return x;
}

signed main(){
    cin.tie(0);ios::sync_with_stdio(false);
    int h,w,k,ans=0;
    char c[6][6];
    cin>>h>>w>>k;
    rep(i,h){
        rep(j,w){
            cin>>c[i][j];
        }
    }
    rep(i,1<<h){
        rep(j,1<<w){
            char d[6][6];
            rep(l,h){
                rep(m,w){
                    d[l][m]=c[l][m];
                }
            }
            rep(l,h){
                if((i>>l)&1){
                    rep(m,w)d[l][m]='R';
                }
            }
            rep(m,w){
                if((j>>m)&1){
                    rep(l,h)d[l][m]='R';
                }
            }
            int cnt=0;
            rep(l,h){
                rep(m,w){
                    if(d[l][m]=='#')cnt++;
                }
            }
            if(cnt==k)ans++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3648
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    static int n,m;
    static long dp[]  ,arr[];
    static boolean[] v;
    static LinkedList<Integer>[] adj;
    static int[] ans;

    public static void main(String[] args) throws IOException{
        Reader.init(System.in);
        int n = Reader.nextInt();
        int[] a = new int[n+1];
        int[] b= new int[n+1];
        for (int i = 0 ; i < n+1 ; i++){
            a[i] = Reader.nextInt();
        }
        for (int i = 0; i < n ; i++){
            b[i] =Reader.nextInt();
        }
        long ans = 0;
        for (int i = 0  ; i < n ; i++){
            int min1 = Math.min(a[i],b[i]);
            ans+= min1;
            a[i]-=min1;
            b[i]-=min1;
            int min2 = Math.min(a[i+1],b[i]);
            ans+=min2;
            a[i+1]-=min2;
            b[i]-=min2;
        }
        System.out.println(ans);

    }


}

class TrieNode{

    int[][] next = new int[2][(1000003)*30];
    int[] cnt = new int[(1000003)*30];
    int Idx = 1;
    int value;
    TrieNode[] arr = new TrieNode[2];

    void insert(int n){
        int cur = 0;
        for(int i = 30 - 1; i >= 0; --i) {
            int val = n >> i & 1;
            int nxt = next[val][cur];
            if (nxt == 0)
                nxt = next[val][cur] = Idx++;
            cur = nxt;
            cnt[cur]++;
        }
    }

    int query(int n , int k){
        int num = 0;
        int ans = 0;
        for(int i = 30 - 1; i >= 0; i--) {
            int val = n >> i & 1;
            if (((k >> i) & 1) == 0) {
                if(val==1) {
                    ans += cnt[next[0][num]];
                }
                else{
                    ans += cnt[next[1][num]];
                }
                num = next[val][num];
            }
            else {
                if (val==1) {
                    num = next[0][num];
                }
                else{
                    num = next[1][num];
                }
            }
            if (num == 0) {
                break;
            }
        }
        ans +=cnt[num];
        return ans;
    }

}

class Reader {
    static BufferedReader reader;
    static StringTokenizer tokenizer;

    /** call this method to initialize reader for InputStream */
    static void init(InputStream input) {
        reader = new BufferedReader(
                new InputStreamReader(input) );
        tokenizer = new StringTokenizer("");
    }

    /** get next word */
    static String next() throws IOException {
        while ( ! tokenizer.hasMoreTokens() ) {
            //TODO add check for eof if necessary
            tokenizer = new StringTokenizer(
                    reader.readLine() );
        }
        return tokenizer.nextToken();
    }

    static int nextInt() throws IOException {
        return Integer.parseInt( next() );
    }
    static long nextLong() throws IOException {
        return Long.parseLong( next() );
    }

    static double nextDouble() throws IOException {
        return Double.parseDouble( next() );
    }
}

Measured memory_bytes: 43664
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <complex>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <cassert>
#include <fstream>
#define popcount __builtin_popcount
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
    int n, d; cin>>n>>d;
    if(n%(2*d+1)==0) cout<<n/(2*d+1)<<endl;
    else cout<<n/(2*d+1)+1<<endl;
    return 0;
}

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

int main() {
  int N, K;
  int  l[50];
  cin >> N >> K;
  for (int i = 0; i < N; i++) {
    cin >> l[i];
  }

  sort(l, l + N, greater<int>());
  int sum = 0;

  for (int i = 0; i < K; i++) {
    sum += l[i];
  }
  cout << sum << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
long long euclid(long long a,long long b){
  if (a%b==0) return b;
  else return euclid(b,a%b);
}
long long cmulti(long long a,long long b){
  return a*b/euclid(a,b);
}
int main() {
  long long a,b,c,d;cin>>a>>b>>c>>d;
  long long ans=0;
  if(c<d){
    long x=c;
    c=d;
    d=x;
  }
  long long m = cmulti(c,d);
  ans += (b/c +b/d -b/m);
  ans -= ((a-1)/c +(a-1)/d -(a-1)/m);
  ans = b-(a-1) -ans;
  cout << ans<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define dup(x,y) (((x)+(y)-1)/(y))
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const double EPS = 1e-10;
const int INF = 1e9;
const ll LINF = 1e15;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

int main() {
	string s;
	cin >> s;
	if (s[2] == s[3] && s[4] == s[5]) cout << "Yes" << endl;
	else cout << "No" << endl;
}

Measured memory_bytes: 3588
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
int main()
{
	int n;
	scanf("%d",&n);
	int ans = 0;
	for(int i = 1; i <= n; i++){
		int a,b;
		scanf("%d%d",&a,&b);
		ans += (b-a)+1;
	}
	printf("%d\n",ans);
}

Measured memory_bytes: 128
#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
typedef long long LL;

int main() {
  int N, K; std::cin >> N >> K;
  std::string S; std::cin >> S;
  S[K-1] = std::tolower(S[K-1]);
  std::cout << S << std::endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define mod 1000000007
#define inf 40000000007
#define eps 1e-8
#define PI 3.14159265359
#define sp printf(" ")
#define vi vector<int>
#define vl vector<long long>
#define vc vector<char>
#define vs vector<string>
#define pii pair<int, int>
#define pll pair<long long, long long>
#define pcc pair<char, char>
#define mp make_pair
#define FF first
#define SS second
#define pb(x) push_back(x)
#define sd(x) scanf("%d", &(x))
#define pd(x) printf("%d", (x))
#define pdn(x) printf("%d\n", (x))
#define sld(x) scanf("%ld", &(x))
#define pld(x) printf("%ld", (x))
#define pldn(x) printf("%ld\n", (x))
#define slf(x) scanf("%lf", &(x))
#define plf(x) printf("%.9lf", (x))
#define plfn(x) printf("%.8lf\n", (x))
#define sch(x) scanf("%c", &(x))
#define pch(x) printf("%c", (x))
#define pchn(x) printf("%c\n", (x))
#define gtl(x) getline(cin, (x))
#define flsh fflush(stdout)
#define ios ios::sync_with_stdio(false); cin.tie(0) ; cout.tie(0)
#define endl '\n'
using namespace std;
#define N 1000006
#define M 100006
#define T 300001
int v[T];
int main()
{
    ios;
    int n;
    cin>>n;
    string s;
    cin>>s;
   // int n=s.size();
    for(int i=0;i<s.size();i++)
    {
        if(s[i]=='E')v[i+1]=v[i]+1;
        else v[i+1]=v[i];
    }
    int ans=n;
    for(int i=1;i<=n;i++)
    {
        int w=(i-1)-v[i-1]+(v[n]-v[i]);
        ans=min(ans,w);
    }
    cout<<ans<<endl;
    
}

Measured memory_bytes: 1812
#include <iostream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <list>
#include <utility>
#include <vector>
#include <set>
#include <algorithm>
#include <cmath>
#include <climits>
#include <map>
#include <unordered_map>
#include <string.h>
#include<iomanip>
#include <iterator>
#include <locale>

#define all(a) a.begin(),a.end()
#define VV(T) vector<vector< T > >
#define rep(i,N) for(int i = 0; i <N; i++)
#define repsg(i,s,g) for(int i = s; i <g; i++)
#define name(x) #x
using namespace std;

const int INF = INT_MAX;
const long long INFL =LONG_LONG_MAX;
const double PI = atan(1)*4;
const int MOD = pow(10,9)+7;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

typedef long long ll,LL;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
typedef pair<int,int> pii;
typedef pair<LL, LL> pLL;


// vector入力
template<typename T>
istream& operator >> (istream& is, vector<T>& vec){
    for(T& x: vec) is >> x;
    return is;
}
// vector出力
template<typename T>
ostream& operator << (ostream& os, vector<T>& vec){
    for(int i=0; i<vec.size(); i++){
        os << vec[i] << ( i+1 == vec.size() ? "" : " " );
    }
    return os;
}

ll gcb(ll a, ll b){/// ユークリッドの互除法: O(log)
    
    if(b == 0) return a;
    
    return gcb(b,a%b);
}


ll lcm(ll a, ll b){
    
    return  a/gcb(a,b) * b; ///gcbは約数
}


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










Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#define in(n, m) for (int i=n; i<m;i++)
#define inj(n, m)for (ll j=n; j<m;j++)
#define ink(n, m)for (ll k=n; k<m;k++)
using namespace std;
using ll=long long;
using P =pair<ll, ll>;
const ll INF = 1LL << 60;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int n, m, q;
vector<int> a, b, c, d;
int ans;

void dfs(vector<int>A) {
	if (A.size() == n + 1) {
		int now = 0; 
		in(0, q) {
			if(A[b[i]]-A[a[i]]==c[i]) now+=d[i];
			ans = max(ans, now);
		}
		return;
	}
	A.push_back(A.back());
	while (A.back() <= m) {
		dfs(A);
		A.back()++;
	}
}

int main() {
	cin >> n >> m >> q;
	a = b = c = d = vector<int>(q);
	in(0, q) {
		cin >> a[i] >> b[i] >> c[i] >> d[i];
	}

	dfs(vector<int>(1,1));
	cout << ans << endl;
	return 0;
}


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

int main() {
    int A = 1;
    int B = 0;
    int C = 0;
    string s;
    while(cin >> s){
        if (s[0]=='A'){
           if(s[2]=='B'){
               int tmp;
               tmp = B;
               B = A;
               A = tmp;
           }
           else if(s[2]=='C'){
               int tmp;
               tmp = C;
               C = A;
               A = tmp;
           }
           }
        if (s[0]=='B'){
           if(s[2]=='A'){
               int tmp;
               tmp = A;
               A = B;
               B = tmp;
           }
           else if(s[2]=='C'){
               int tmp;
               tmp = C;
               C = B;
               B = tmp;
           }
           }
        else if (s[0]=='C'){
            if(s[2]=='A'){
               int tmp;
               tmp = A;
               A = C;
               C = tmp;
           }
           else if(s[2]=='B'){
               int tmp;
               tmp = B;
               B = C;
               C = tmp;
           }
           }
    }
    if (A==1){
        cout << "A" << endl;
    }
    else if (B==1){
        cout << "B" << endl;
    }
    else if (C==1){
        cout << "C" << endl;
    }
    return 0;
}


Measured memory_bytes: 3064
#include <stdio.h>
int main(void){
  long a,b,k;
  long m=0l;
  scanf("%ld%ld%ld",&k,&a,&b);
  if(b-a<=2l||k<a){printf("%ld",k+1l);return 0;}
  k-=a-1l;m=a;
  m+=(b-a)*(k/2l)+k%2l;
  printf("%ld",m);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define rep(i,x,y) for(int i=x;i<=y;++i)
#define out(i,u) for(int i=first[u];i!=-1;i=next[i])
#define repvc(i,vc) for(int i=0,_sz=vc.size();i<_sz;++i)
using namespace std;
const int INF=1<<30;
typedef long long ll;
int read()
{
	int ret=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9') {if(ch=='-')f=-1;ch=getchar();}
	for(;ch>='0'&&ch<='9';ch=getchar()) ret=ret*10+ch-'0';
	return ret*f;
}
struct Edge{
	int a,b;
	Edge(int a=0,int b=0):a(a),b(b){}
};
vector<Edge>vc;
int main()
{
	std::ios::sync_with_stdio(false);
	int n,k;
	cin>>n>>k;
	if(k>(n-1)*(n-2)/2) {
		cout<<-1<<endl;
		return 0;
	}
	int cur=0;
	rep(i,2,n)
	{
		vc.push_back(Edge(i,1));
		cur=cur+i-2;
		if(cur==k){
			rep(j,i+1,n) rep(k,1,j-1) vc.push_back(Edge(j,k));
			break;
		}
		if(cur>k)
		{
			rep(j,2,2+(cur-k)-1) vc.push_back(Edge(i,j));
			rep(j,i+1,n) rep(k,1,j-1) vc.push_back(Edge(j,k));
			break;
		}
	}
	cout<<vc.size()<<endl;
	rep(i,0,vc.size()-1)cout<<vc[i].a<<" "<<vc[i].b<<endl;
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
using namespace std;
using ll = long long;
using P = pair<int,int>;

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

int main() {
  int n;
  cin >> n;
  vector<int> b(n);
  REP(i, n-1) cin >> b[i];
  int ans = b[0] + b[n-2];
  REP(i, n-1) ans += min(b[i], b[i+1]);
  cout << ans << endl;

  return 0;
}

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

using namespace std;

int main(void){
  vector<int> a(3);
  cin >> a[0] >> a[1] >> a[2];

  sort(a.begin(), a.end());

  cout << a[0]+a[1] << endl;
  
  return 0;
}


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

#ifdef LOCAL
#define DEBUG(...) debug(#__VA_ARGS__, __VA_ARGS__);
#else
#define DEBUG(...) 6;
#endif

template<typename T, typename S> ostream& operator << (ostream &os, const pair<T, S> &p) {return os << "(" << p.first << ", " << p.second << ")";}
template<typename C, typename T = decay<decltype(*begin(declval<C>()))>, typename enable_if<!is_same<C, string>::value>::type* = nullptr>
ostream& operator << (ostream &os, const C &c) {bool f = true; os << "["; for (const auto &x : c) {if (!f) os << ", "; f = false; os << x;} return os << "]";}
template<typename T> void debug(string s, T x) {cerr << s << " = " << x << "\n";}
template<typename T, typename... Args> void debug(string s, T x, Args... args) {cerr << s.substr(0, s.find(',')) << " = " << x << " | "; debug(s.substr(s.find(',') + 2), args...);}

const int INF = 1e9;

int dp[100005], pred[100005];

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

    int n, m;
    string s;
    cin >> n >> m >> s;

    deque<int> dq{0};
    pred[0] = -1;
    for (int i=1; i<=n; i++) {
        if (!dq.empty() && dq.front() == i - m - 1)
            dq.pop_front();
        if (s[i] == '1')
            dp[i] = INF;
        else {
            dp[i] = dp[dq.front()] + 1;
            pred[i] = dq.front();
        }
        while (!dq.empty() && dp[dq.back()] > dp[i])
            dq.pop_back();
        dq.push_back(i);
    }

    if (dp[n] >= INF) {
        cout << "-1\n";
        return 0;
    }
    int u = n;
    vector<int> v;
    while (pred[u] != -1) {
        v.push_back(u - pred[u]);
        u = pred[u];
    }
    for (int i=(int)v.size()-1; i>=0; i--)
        cout << v[i] << " \n"[i==0];

    return 0;
}


Measured memory_bytes: 4860
#include <stdio.h>

int main(void){
    int n,m,line[3][50]={0},i,sum,o,j,a,b,c,min=2500;
    char map[50][51],temp[4]="WBR";
    scanf("%d %d",&n,&m);
    for(i=0;i<n;i++)
        scanf("%s",map[i]);
    for(i=0;i<3;i++)
        for(o=0;sum=0,o<n;o++){
            for(j=0;j<m;j++)
                if(temp[i] != map[o][j])
                    sum++;
            line[i][o]=sum;
        }
    for(i=1;i<n-1;i++)
        for(o=i+1;o<n;o++){
            sum=0;
            for(a=0;a<i;sum+=line[0][a],a++);
            for(b=i;b<o;sum+=line[1][b],b++);
            for(c=o;c<n;sum+=line[2][c],c++);
            if(min > sum)
                min=sum;
        }
    printf("%d\n",min);
    return 0;
}

Measured memory_bytes: 600
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<set>
#include<map>
#include<iomanip>
typedef long long LL;

using namespace std;



int main(void) {
	LL a, b, c;
	cin >> a >> b >> c;
	if (a + b >= c) {
		cout << b + c;
	}
	else {
		cout << b + a + b + 1;
	}
	return 0;
}

Measured memory_bytes: 256
n,x,y=map(int,input().split())
dp=[0]*n
for i in range(1,n):
  for j in range(i+1,n+1):
    cnt=min(j-i,1+abs(x-i)+abs(y-j))
    dp[cnt]+=1
for k in range(1,n):
  print(dp[k])


Measured memory_bytes: 80352
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

int main(){

	int n, ans=0;
	string s;

	cin>> n;
	cin>> s;

	for (int i = 0;i < n - 2;i++) {
		if (s[i] == 'A' && s[i + 1] == 'B' && s[i + 2] == 'C') ans++;
	}

	cout<< ans << endl;


}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>
#define swap(a,b) a^=b^=a^=b 
#define inf 1000000007

int main(void) {
	// your code goes here
	int n,color,d[31][31],c[501][501],i,j,k,x,y,value,min=inf,a[3],v[3][501];
	scanf("%d %d",&n,&color);
	for(i=1;i<=color;i++){
		for(j=1;j<=color;j++){
			scanf("%d",&d[i][j]);
		}
	}
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++){
			scanf("%d",&c[i][j]);
		}
	}
	for(i=1;i<=color;i++){
		v[0][i]=0;
		v[1][i]=0;
		v[2][i]=0;
		for(x=1;x<=n;x++){
			for(y=1;y<=n;y++){
				if(i!=c[x][y]) v[(x+y)%3][i]=v[(x+y)%3][i]+d[c[x][y]][i];
			}
		}
	}
	for(i=1;i<=color;i++){
		for(j=1;j<=color;j++){
			if(i==j) continue;
			for(k=1;k<=color;k++){
				if(i==k||j==k) continue;
				value=v[0][i]+v[1][j]+v[2][k];
				if(min>value) min=value;
			}
		}
	}
	printf("%d\n",min);
	return 0;
}


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

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

int main() {
    int N,M;cin>>N>>M;
    string S,T;cin>>S>>T;
    int g = gcd(N,M);

    for(int i=0;i<g;++i){
        if(S[N/g*i]!=T[M/g*i]){
            cout << -1 << endl;
            return 0;
        }
    }
    cout << (long long)N*M/g << endl;
    return 0;
}

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

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

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

namespace AtCoder_solve
{
    class Program
    {
        public const ulong mod = 1000000007;

        static void Main(string[] args)
        {
            var s = Console.ReadLine();
            var cnt10 = 0;
            var cnt01 = 0;
            for(int i = 0; i < s.Length; i++)
            {
                if (i % 2 == 0 && s[i] != '1') cnt10++;
                if (i % 2 == 1 && s[i] != '1') cnt01++;
                if (i % 2 == 0 && s[i] != '0') cnt01++;
                if (i % 2 == 1 && s[i] != '0') cnt10++;
            }
            Console.WriteLine(Math.Min(cnt10,cnt01));
            
        }

        static public long Input()
        {
            return long.Parse(Console.ReadLine());
        }

        static public string[] Input2()
        {
            return Console.ReadLine().Split();
        }
        
        static public long[] Input3()
        {
            string[] data = Console.ReadLine().Split();
            long[] res = new long[data.LongLength];
            for(long i = 0; i < data.LongLength; i++)
            {
                res[i] = long.Parse(data[i]);
            }
            return res;
        }
        public static long Choose(long n, long a)
        {
            long x = 1;
            long y = 1;
            for (long i = 0; i < a; i++)
            {
                x *= n - i;
                y *= i + 1;
            }
            return x / y;
        }

        public static long Gcd(long a, long b)
        {
            long x = Math.Max(a, b);
            long y = Math.Min(a, b);
            if (x % y == 0) return y;
            else return Gcd(y, x % y);
        }
    }
}


Measured memory_bytes: 11232
#include<stdio.h>

int main()
{

    int n,p,i;
    long long
    int x[4],y[4],s1x,s2x,s1y,s2y;
    scanf("%d",&n);
    while(n--){
        for(i=0;i<4;i++)
            scanf("%lld %lld",&x[i],&y[i]);
        s2x=x[3]-x[2];
        s1x=x[1]-x[0];
        s2y=y[3]-y[2];
        s1y=y[1]-y[0];
        if(s1y*s2y + s1x*s2x==0)
            printf("1\n");
        else if(s1x*s2y - s1y*s2x==0)
            printf("2\n");

        else
            printf("0\n");




    }

    return 0;

}



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

int main(){
    string S,T;
    cin>>S>>T;
    int count=0;
    for(int i=0;i<3;i++){
        if(S[i]==T[i])count++;
    } 
    cout<<count<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long
const int mod = 1e9 + 7;
int main()
{
	SPEED
	int a, b, c, d;
	cin >> a >> b >> c >> d;

	while(a>0 && c>0)
	{
		c-=b;
		a-=d;
	}

	if (c<=0)
	{
		cout << "Yes";
	}
	else
	{
		cout << "No";
	}
	return 0;
}

Measured memory_bytes: 3648
#define _CRT_SECURE_NO_WARNINGS // #pragma warning(disable:4996)
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <functional>
#include <sstream>
#include <cmath>
#include <set>
#include <map>
using namespace std; 

#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define pb push_back
#define mp(a,b) make_pair(a,b)
#define all(a) a.begin(),a.end()
#define len(x) ((int)(x).size())
#define tmax(a,b,c) max((a),max((b),(c)))
#define tmin(a,b,c) min((a),min((b),(c)))
#define debug(x) cerr << #x << " is " << x << endl;

typedef pair<int, int> Pii;
typedef vector<int> Vi;
typedef vector<vector<int> > VVi;
typedef long long ll;
const int inf = 2e9;
const ll ll_inf = 1e17;
const int mod = 1e9 + 7;
const long double eps = 1e-10;

int main()
{
	int n;
	cin >> n;
	int sum = 0;
	rep(i,1,n+1) sum += i;
	cout << sum << endl;

	return 0;
}

Measured memory_bytes: 256
import math
n = sorted(list(map(int,input().split())))
if n[1] - n[0] >= 2:
    ans = 0
elif n[1] - n[0] == 0:
    ans = math.factorial(n[1]) * math.factorial(n[0]) * 2
else:
    ans = math.factorial(n[1]) * math.factorial(n[0])
print(ans % (10**9 + 7) )



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

int main()
{
  string res = "No";
  int n;
  cin >> n;
  while(int a = n % 10)
  {
    if(a == 9)
      res = "Yes";
    n /= 10;
  }
  
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 3604
#include<stdio.h>
int main(void)
{
    int A, B, C, d, i, K;

    scanf("%d%d%d%d",&A,&B,&C,&K);
    if((A >= B) && (A >= C)){
      for(i=1;i<=K;i++)
         A = A * 2;
    }
    else if((B >= A) && (B >= C)){
      for(i=1;i<=K;i++)
         B = B * 2;
    }
    else if((C >= B) && (C >= A)){
      for(i=1;i<=K;i++)
         C = C * 2;
    }
    d = A + B + C;
    printf("%d\n", d);
    return 0;
}


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

int main() {
    int n;
    cin >> n;
    set<int> as;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;
        as.insert(a);
    }
    int q;
    cin >> q;
    while (q--) {
        int a;
        cin >> a;
        cout << as.count(a) << endl;
    }
}


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

int main() {
	vector<int> arr(5);
	for(int i = 0; i < 5; i++) {
		cin >> arr[i];
	}
	int ans = 0;
	for(int i = 4; i >= 0; i--) {
		ans += arr[i]+((arr[i]%10!=0)?10-(arr[i]%10):0);
	}
	int res = 0;
	for(int i = 0; i < 5; i++) {
		res = max(res,((arr[i]%10)==0)?0:(10-(arr[i]%10)));
	}
	ans -= res;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
string S,T;
int hashh(string x)
{
	int p=0;
	for (int i=0;i<=S.length()-1;i++)
	{
		p=(p*171+x[i])%1000007;
	}
	return p;
}
int main()
{
	char C[110];
	cin>>S;
	cin>>T;
	int t=hashh(T);
	int s=hashh(S);
	if(s==t)
	{
		printf("Yes");
		return 0;
	}
	for (int i=0;i<=S.length()-1;i++)
	{
		for (int j=0;j<=S.length()-2;j++)
		{
			C[j+1]=S[j];
		}
		C[0]=S[S.length()-1];
		for (int k=0;k<S.length();k++)
		{
			S[k]=C[k];
		}
		s=hashh(C);
		if (s==t)
		{
			printf("Yes");
			return 0;
		}
	}
	printf("No");
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>

using namespace std;

typedef long long ll;

int main() {
    ios::sync_with_stdio(false);
    ll k, cnt = 9;
    cin >> k;
    if (k < 10) cout << k << endl;
    else {
        vector<ll> prev(9), now;
        iota(prev.begin(), prev.end(), 1);
        while (cnt < k) {
            for (auto i = prev.begin(); i != prev.end(); ++i) {
                for (ll j = -1; j <= 1; ++j) {
                    ll t = *i % 10 + j;
                    if (t >= 0 && t <= 9) {
                        now.push_back(*i * 10 + t);
                        if (++cnt == k) {
                            cout << now.back() << endl;
                            return 0;
                        }
                    }
                }
            }
            prev = now;
            now.clear();
        }
    }
    return 0;
}


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

#define INF 100000000
#define ABS(a) (a<0?-(a):a)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define REP(i,a) for(int i=0;i<a;i++) 

using namespace std;

int getDigit(long long num){
  int count = 0;
  while(num != 0){
    num = num / 10;
    count ++;
  }
  return count;
}

int main(){
  long long N;
  cin >> N;
  vector<pair<long long, long long>> prime;
  long long count = 0;
  int re = 100000;
  while(N > count*count){
    count++;
    if(N % count == 0){
      int a = getDigit(count);
      int b = getDigit(N / count);
      re = MIN(re, MAX(a , b));
    }
  }
  cout << re << endl;
}



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

int main(){
  long long n,a,b,c,d,e;
  cin >> n >> a >> b >> c >> d >> e;
  long long minM = min({a,b,c,d,e});

  long long ans = (n + minM - 1)/minM + 4;
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<map>
#include<cstdio>
#include<stack>
#include<queue>
#include<fstream>
#include<cstring>
#include<deque>
#include<iomanip>
#include <numeric>
//#include<bits/stdc++.h>

using namespace std;
#define ok1 printf("ok1\n");
#define ok2 printf("ok2\n");
#define M 1000000000000000000LL
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);(i)--)
#define all(a) (a).begin(),(a).end()
#define reall(a) (a).rbegin(),(a).rend()
#define pb push_back
#define pf push_front
#define MIN(a,b) a=min((a),(b))
#define MAX(a,b) a=max((a),(b))
#define SIZE(v) (int)v.size()
#define Eunique(v) v.erase(unique(all(v)),v.end());
#define pvec(v) rep(i,v.size()){ cout << v[i] << " ";}
#define INF 0x3f3f3f3f
#define mset(m,v) memset(m,v,sizeof(m))

const double pi = acos(-1.0);

typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef deque<ll> dll;
typedef pair<ll, ll> P;
#define mod 1e9 + 7;
ll dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };

ll gcd(ll x, ll y)
{
	ll r;
	while ((r = x % y) != 0)
	{
		x = y;
		y = r;
	}
	return y;
}
ll lcm(ll x, ll y)
{
	x /= gcd(x, y);
	y /= gcd(x, y);
	return (x * y);
}





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

	ll a = 0, b = 0, c = 0, d, e, ans = 0, n, ret = M, m, x = 0, y = 0;
	//bool x = false;
	string s,t;
	cin >> s >> t;
	if (s > t) cout << ">\n";
	else if(s==t) cout << "=\n";
	else cout << "<\n";
	//cout << a+ (b-a)*2 << endl;
	return 0;
}


Measured memory_bytes: 256
from collections import deque

def main():
    N = int(input())
    A = tuple(map(int, input().split()))

    b = deque()
    for i in range(N):
        if i % 2 == (N - 1) % 2:
            b.appendleft(A[i])
        else:
            b.append(A[i])

    print(*b, sep=' ')

main()


Measured memory_bytes: 25668
//自称高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

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

int main() {
    int ans = 0;
    int tmp;
    int n;
     cin >> n;
    cout << n*800-200*(int)(n/15) << endl;
}

Measured memory_bytes: 256
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("Ofast")
#pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;


#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
	cerr << name << " : " << arg1 << std::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...);
}
#else
#define trace(...)
#endif

#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void pre(){


}

void solve(){


}
vector<pii> g[100009];
int d[100009];
bool vis[100009];
bool dfs(int u,int f){
	if(u==f) return 1;
	trav(i,g[u]){
		if(!vis[i.snd]){
			vis[i.snd]=1;
			if(dfs(i.fst,f)) return 1;
			vis[i.snd] = 0;
		}
	}
	return 0;
}
int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();
	int n;cin>>n;
	int m;cin>>m;
	rep(i,m){
		int u,v;cin>>u>>v;
		d[u]++,d[v]++;
		g[u].pb(mp(v,i));
		g[v].pb(mp(u,i));
	}
	vi kk;
	repA(i,1,n) if(d[i]%2){
		cout<<"No";
		exit(0);
	}
	else if(d[i]==4) kk.pb(i);
	if(m<n+2){
		cout<<"No";
		exit(0);
	}
	if(m>n+2){
		cout<<"Yes";
		exit(0);
	}
	if(sz(kk)!=2){
		cout<<"Yes";
		exit(0);
	}
	int cnt = 0;
	while(dfs(kk[0],kk[1])){
		cnt++;
	}
	if(cnt==4) cout<<"No";
	else cout<<"Yes";
	return 0;
}



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

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

    string answer = "No";
    for (int i = 1; i < 10; i++)
    {
        for (int j = 1; j < 10; j++)
        {
            if(i*j==n)
                answer = "Yes";
        }
    }
    cout << answer << endl;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
          
          #define F first
          #define S second
          #define N 222222
          #define M 1000000007
          #define pb push_back
          #define cend(s) return cout << s, 0
          using namespace std;
          typedef long long ll;
          typedef vector<int> vi;
          ll ar[3232];
          int main()
          {
            int n;
            cin >> n;
            if(n >= 30)
              cout << "Yes";
            else cout << "No";  
          }

Measured memory_bytes: 3592
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <limits>
#include <cmath>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = (int)1e9 + 7;
const int MAX_N = (int)1e5 + 5;
#define debug(x) cout << #x << ": " << x << endl

signed main(void)
{
    string s; cin >> s;
    int n = s.size();
    string a = s.substr(0, n / 2);
    string b = s.substr(n / 2);
    reverse(b.begin(), b.end());
    int ans = 0;
    for(int i = 0; i < min(a.size(), b.size()); i++)
    {
        if(a[i] != b[i]) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define ALL(x) x.begin(), x.end()
#define LEN(x) (int)x.size()
#define iostreamBooster() do{ cin.tie(nullptr); ios_base::sync_with_stdio(false); }while(0)
using namespace std;
typedef int64_t i64;
typedef pair<int,int> pii;
template<class A, class B>inline bool chmax(A &a, const B &b){return b>a ? a=b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b<a ? a=b,1 : 0;}
constexpr int INF = 0x3f3f3f3f;

i64 N, P;

i64 countModulable(i64 d)
{
  i64 tmp = P;
  i64 cnt = 0;
  while(tmp % d == 0) {
    tmp /= d;
    ++cnt;
  }
  return cnt;
}

i64 countDividable(i64 d)
{
  i64 tmp = P;
  i64 cnt = 0;
  while(tmp >= d) {
    tmp /= d;
    ++cnt;
  }
  return cnt;
}

signed main()
{
  cin >> N >> P;

  if (N == 1) {
    cout << P << endl;
    return 0;
  }

  i64 ans = 1;

  for (i64 i = 2; countDividable(i) >= N; ++i) {
    if (countModulable(i) >= N) ans = i;
  }

  cout << ans << endl;

  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<cassert>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<bitset>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
typedef long long ll;
typedef long double ld;
#define str string
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
const ll gosenchou = 5000000000000000;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct E {//辺の情報を入れる変数
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(H a, H b) {
	return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}//rad＝座標上の2点間の距離
ll ari(ll a, ll b, ll c) {
	return (a + b)*c / 2;
}//等差数列の和
ll fact(ll x, ll k, ll p) {//最大値、個数、あまり
	ll sum = 1;
	for (int i = 0; i < k; i++) {
		sum *= (x--);
		sum %= p;
	}
	return sum;
}//階乗(正）
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x%p;
		x = x * x%p;
		n >>= 1;
	}
	return res;
}//x^n%p
short ctos(char a) {
	return (int)(a - '0');
}
const long long Inf = 4523372036854775807;
const int inf = 15000000000;
//----------------------------------------------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++
signed main() {
	int a, b;
	cin >> a >> b;
	if (a % 2 == 1 && b % 2 == 1) {
		cout << "Yes\n";
	}
	else {
		cout << "No\n";
	}
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
#define N 100005
int st[N],nd[N],a[N];
int pos[2*N],dfn[2*N],cnt,sum[N][2],s1;
int fa[N][20],dep[N],ans[N],n,m,an;
int g1[N][2];
bool f[N];
struct mzls
{
	int l,r,id,aa,bb;
	bool p;
}a1[N];
struct node
{
	int to,co,ct;
	node(){}
	node(int xx,int yy,int zz)
	{
		to=xx,co=yy,ct=zz;
	}
};
vector<node>g[N];
inline bool cmp(mzls x,mzls y)
{
	if(pos[x.l]!=pos[y.l])
		return pos[x.l]<pos[y.l];
	return x.r<y.r;
}
map<int,int>mp;
inline void dfs(int x)
{
	dfn[++cnt]=x;
	st[x]=cnt;
	dep[x]=dep[fa[x][0]]+1;
	for(int i=1;i<20;i++)
		fa[x][i]=fa[fa[x][i-1]][i-1];
	int l1=g[x].size();
	for(int i=0;i<l1;i++)
	{
		int v=g[x][i].to,co=g[x][i].co,ct=g[x][i].ct;
		if(v==fa[x][0])
			continue;
		fa[v][0]=x;
		g1[v][0]=co,g1[v][1]=ct;
		dfs(v);
	}
	dfn[++cnt]=x;
	nd[x]=cnt;
}
inline int LCA(int x,int y)
{
	if(dep[x]<dep[y])
		swap(x,y);
	for(int i=19;i>=0;i--)
		if(dep[fa[x][i]]>=dep[y])
			x=fa[x][i];
	if(x==y)
		return x;
	for(int i=19;i>=0;i--)
		if(fa[x][i]!=fa[y][i])
		{
			x=fa[x][i];
			y=fa[y][i];
		}
	return fa[x][0];
}
inline void modify(int x)
{
	if(!f[x])
	{
		sum[g1[x][0]][0]++;
		sum[g1[x][0]][1]+=g1[x][1];
		s1+=g1[x][1];
		f[x]=1;
	}
	else
	{
		sum[g1[x][0]][0]--;
		sum[g1[x][0]][1]-=g1[x][1];
		s1-=g1[x][1];
		f[x]=0;
	}
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<n;i++)
	{
		int x,y,x1,y1;
		scanf("%d%d%d%d",&x,&y,&x1,&y1);
		g[x].push_back(node(y,x1,y1));
		g[y].push_back(node(x,x1,y1));
	}
	dfs(1);
	int d=sqrt(n);
	for(int i=1;i<=2*n;i++)
		pos[i]=(i-1)/d;
	for(int i=1;i<=m;i++)
	{
		int x,y;
		scanf("%d%d%d%d",&a1[i].aa,&a1[i].bb,&a1[i].l,&a1[i].r);
		if(st[a1[i].l]>st[a1[i].r])
			swap(a1[i].l,a1[i].r);
		if(nd[a1[i].l]>st[a1[i].r])
		{
			x=nd[a1[i].r];
			y=nd[a1[i].l]-1;
			a1[i].p=0;
		}
		else
		{
			x=nd[a1[i].l];
			y=st[a1[i].r];
			a1[i].p=1;
		}
		a1[i].l=x;
		a1[i].r=y;
		a1[i].id=i;
	}
	sort(a1+1,a1+m+1,cmp);
	int l1=1,r1=0;
	for(int i=1;i<=m;i++)
	{
		while(l1>a1[i].l)
			modify(dfn[--l1]);
		while(l1<a1[i].l)
			modify(dfn[l1++]);
		while(r1<a1[i].r)
			modify(dfn[++r1]);
		while(r1>a1[i].r)
			modify(dfn[r1--]);
		int lc=LCA(dfn[l1],dfn[r1]);
		//if(a1[i].p)
		//	modify(lc);
		ans[a1[i].id]=s1-sum[a1[i].aa][1]+sum[a1[i].aa][0]*a1[i].bb;
		//if(a1[i].p)
		//	modify(lc);
	}
	for(int i=1;i<=m;i++)
		printf("%d\n",ans[i]);
	return 0;
}


Measured memory_bytes: 24832
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int ans=0;
	int n;
	int mx=0;
	cin>>n;
	while(n--)
	{
		int a;
		cin>>a;
		if(a>=mx)
		{
			ans++;
		}
		mx=max(a,mx);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long a, b, v, w ,t;
  cin >> a>> v>> b>> w>> t;
 
  if (v > w && max(a - b, b - a) <= (v - w) * t) {
    cout << "YES" << endl;
  }
  else {
    cout << "NO" << endl;
  }
}

Measured memory_bytes: 3632