akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define MOD 998244353 

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

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

ll power(ll a, ll n, ll m)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans=(ans*a)%m;
        n>>=1;
        a=(a*a)%m;
    }
    return ans;
}

int main()
{
    IOS; 
    ll fac[1000001];
    fac[0]=fac[1]=1;
    repf(i,2,1000001) fac[i]=(fac[i-1]*i)%mod;
    ll n,k;
    cin>>n>>k;
    ll a[n+1];
    repf(i,1,n+1) cin>>a[i];
    sort(a+1,a+n+1);
    ll pre[n+1];
    pre[0]=0;
    repf(i,1,n+1) pre[i]=a[i]+pre[i-1];
    ll ans=0;
    repf(i,k,n+1)
    {
        ll s=(pre[n]-pre[i-1])-(pre[n-i+1]-pre[0]);
        s=(s+mod)%mod;
        ll num=fac[i-2];
        ll den=(fac[i-k]*fac[k-2])%mod;
        den=power(den,mod-2,mod);
        ll val=(num*den)%mod;
        val=(val*s)%mod;
        ans=(ans+val)%mod;
    }
    cout<<ans<<endl;
}  

Measured memory_bytes: 9600
#include<bits/stdc++.h>
using namespace std;
 
#define fastio ios_base::sync_with_stdio(0); cin.tie(0)
#define LL long long 
#define mod 998244353 
#define FOR(i, j, k) for (int i=j ; i<k ; i++)
#define ROF(i, j, k) for (int i=j ; i>=k ; i--) 
 
const long long INF = 1e18;
const long long MAX = 1e5+10;

int main(){
    fastio;
    int n,x,y; cin>>n>>x>>y;
    map<int,int>m; 
    FOR(i,1,n+1){
        FOR(j,i+1,n+1){
           int d = min(abs(y-j)+abs(x-i)+1,abs(j-i));
           m[d]++; 
        }
    }
    FOR(i,1,n) cout<<m[i]<<"\n";
}

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

int main() {
	vector<string> M = { "SUN","MON","TUE","WED","THU","FRI","SAT" };
	string S;
	cin >> S;
	for (int i = 0; i < 7; i++) {
		if (S == M[i]) {
			cout << 7 - i;
			return 0;
		}
	}
}

Measured memory_bytes: 256
/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/* 
 * File:   main.c
 * Author: Ivan
 *
 * Created on July 3, 2018, 5:56 AM
 */

#include <stdio.h>
#include <stdlib.h>
#define MAX 2000001
#define k 10000

/*
 * 
 */

void countingSort(int A[], int n, int B[]);

int main(int argc, char** argv) {
    int *A, *B, n;
    scanf("%d", &n);
    
    A = (int *)malloc(sizeof(int) * n+1);
    B = (int *)malloc(sizeof(int) * n+1);
    for (int i = 0; i < n; ++i) scanf("%d", &A[i+1]);    
    
    countingSort(A, n, B);
    
    for (int x = 1; x <= n; ++x)
    {
        if (x > 1) printf(" ");
        printf("%d", B[x]);
    }
    printf("\n");
    
    return (EXIT_SUCCESS);
}

void countingSort(int A[], int n, int B[])
{
    int C[k+1];
    for (int ix = 0; ix <= k; ++ix) C[ix] = 0;
    for (int jx = 0; jx < n; ++jx) C[A[jx+1]]++;
    for (int kx = 1; kx <= k; ++kx) C[kx] += C[kx-1];
    for (int w = 1; w <= n; ++w)
    {
        B[C[A[w]]] = A[w];
        C[A[w]]--;
    }
}




Measured memory_bytes: 17384
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	vector<vector<int>> a(n, vector<int>(n));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			cin >> a[i][j];
		}
	}
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			for (int k = 0; k < n; k++) {
				if (a[j][k] != min(a[j][k], a[j][i] + a[i][k])) {
					cout << -1 << '\n';
					return 0;
				}
			}
		}
	}
	long long ans = 0;
	for (int i = 0; i < n; i++) {
		for (int j = i + 1; j < n; j++) {
			bool ok = true;
			for (int k = 0; k < n; k++) {
				if (i == k || j == k) continue;
				if (a[i][j] == a[i][k] + a[k][j]) ok = false;
			}
			if (ok) ans += a[i][j];
		}
	}
	cout << ans << '\n';
	return 0;		
}


Measured memory_bytes: 640
from sys import stdin

[N, M, Q] = [int(x) for x in input().rstrip().split()]
A = []
B = []
C = []
D = []
score_dict = {}
for i in range(Q):
    [a, b, c, d] = [int(x) for x in input().rstrip().split()]
    A.append(a)
    B.append(b)
    C.append(c)
    D.append(d)


def check_Q(temp_arr):
    tot_val = 0
    for i in range(Q):
        a = A[i]-1
        b = B[i]-1
        c = C[i]
        d = D[i]
        if temp_arr[b] - temp_arr[a] == c:
            tot_val += d

    return tot_val

temp_arr = [1 for _ in range(N)]
max_val = 0
while(True):
    #check_Q(temp_arr)
    temp_val = check_Q(temp_arr)
    #print(temp_arr, temp_val)
    if temp_val>max_val:
        max_val=temp_val

    for i in range(N):
        temp_arr[N-1-i]+=1
        if temp_arr[N-1-i] == M+1:
            temp_arr[N-1-i] = 0
            continue
        else:
            break

    if temp_arr[0] ==  0:
        break

    min_val=0
    for i in range(1,N):
        if temp_arr[i]<temp_arr[i-1]:
            temp_arr[i] = temp_arr[i-1]
    

print(max_val)
    




Measured memory_bytes: 74220
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
ll GetDigit(ll num){ return log10(num)+1; } //numの桁数を求める

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

Measured memory_bytes: 3600
/*Lower_Rating*/
/*dianfenzhi*/
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<stack>
#include<vector>
#include<queue>
#include<bitset>
#include<map>
using namespace std;

#define LL long long
#define DB double
#define Pr pair<int,int>
#define X first
#define Y second
#define MAXN 1000000
#define eps 1e-10
#define INF 2147483647
#define mem(x,p) memset(x,p,sizeof(x))

LL read(){
  LL 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-'0';c=getchar();}
  return x*F;
}

int T,n,ans,pans;char s[MAXN+5];
int a[MAXN+5],F;
int pabs(int x){
    return (x>0)?x:-x;
}
int main(){
        ans=0;
        n=read();scanf("%s",s+1);
        for(int i=1;i<=n;i++)
        a[i]=s[i]-'0'-1;
        for(int i=1;i<n;i++){
            if(pabs(a[i+1]-a[i])==2)
            pans^=(((n-2)&(i-1))==(i-1));
            if(pabs(a[i+1]-a[i])==1)
            F|=1,ans^=(((n-2)&(i-1))==(i-1));
        }
        if(F)printf("%d",ans);
        else printf("%d",pans*2);
}


Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
 
int main() {
  int n,tmp;
  cin >> n;
  
  vector<int> pn;
  rep(i,n){
    cin >> tmp;
    pn.push_back(tmp);
  }
  
  int max = 0;
  int cnt = 0;
  rep(i,n){
    if(max > pn[i]||max == 0){
      max = pn[i];
      cnt++;
    }
  }
  
  cout << cnt << endl;
  
  return 0;

}

Measured memory_bytes: 1400
#include <iostream>
#include <iomanip>
#include <cassert>

#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
using namespace std;

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


void Main()
{
	int N;
	cin >> N;

	vector<int64_t> L(N+1);
	L[0] = 2;
	L[1] = 1;
	if (N > 1)
	{
		rep_init(i, 2, N+1)
		{
			L[i] = L[i-1] + L[i-2];
		}
	}

	cout << L[N] << endl;
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);

	Main();
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll,ll>;
const ll mod = 1e9+7;
#define ALL(x) (x).begin(),(x).end()
#define pow(x,y) modpow(x,y)
#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REPS(i,n) for(ll (i)=1;(i)<=(n);(i)++)
#define RREP(i,n) for(ll (i)=(n-1);(i)>=0;(i)--)
#define RREPS(i,n) for(ll (i)=(n);(i)>0;(i)--)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());

template<class T> inline void chmin(T& a, T b){
    if (a > b){
        a = b;
    }
}

template<class T> inline void chmax(T& a, T b){
    if (a < b){
        a = b;
    }
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int N;
    string S;
    cin >> N >> S;
    vector<int> right(N+1);
    vector<int> left(N+1);
    REPS(i,N){
        if(S[i-1] == 'W'){
            left[i] = left[i-1] + 1;
            right[i] = right[i-1];
        }else{
            left[i] = left[i-1];
            right[i] = right[i-1] + 1;
        }
    }
    int sum = INT32_MAX;
    REP(i,N){
        chmin(sum,left[i] + right[N] - right[i+1]);
    }
    cout << sum << "\n";
}

Measured memory_bytes: 3092
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>


typedef long double ld;
typedef long long ll;

using namespace std;

int main() {
	int a1, a2, a3;
	cin >> a1 >> a2 >> a3;
	if (a1 + a2 + a3 >= 22) {
		cout << "bust" << endl;
	} else {
		cout << "win" << endl;
	}

	return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
unsigned long long int max(unsigned long long int a, unsigned long long int b){
    if(a>b)
        return a;
    else
        return b;
}

int main(){
    int n,W;
    cin>>n>>W;
    int v[n],w[n];

    bool check[n][W+1] = {0};
    unsigned long long int dp[W+1] = {0};
    int mn = 100001;
    for(int i = 0;i<n;i++){
        cin>>w[i]>>v[i];
        mn = min(mn,w[i]);
    }

    unsigned long long int ans = 0;
    for(int i = mn;i<=W;i++){
        for(int j = 0;j<n;j++){
            if(i-w[j]>=0){
                if(check[j][i-w[j]]==false){
                    if(v[j]+dp[i-w[j]]>dp[i]){
                        for(int k = 0;k<n;k++)
                            check[k][i] = check[k][i-w[j]];

                        check[j][i] = true;
                        dp[i] = v[j]+dp[i-w[j]];
                    }
                }
            }
        }

        ans = max(ans,dp[i]);
    }


    cout<<ans;




}


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

int main(){
  string s;
  cin >> s;
  for(int i=0;i<3;i++){
   if( count(s.begin(),s.end(),s.at(i) ) != 1 ){
     cout << "No" << endl;
     return 0;
   }
  }
  cout << "Yes" << endl;
  return 0;
}

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

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

int dfs(int x, int y, int c){
    int count=0;
    for(int now=0; now<8; now++){
        for(int i=1; i<=8; i++){
            if(y+dy[now]*i<1||y+dy[now]*i>8||x+dx[now]*i<1||x+dx[now]*i>8) break;
            if(s[y+dy[now]*i][x+dx[now]*i]==c){
                for(int j=1; j<i; j++){
                    count++;
                }
                break;
            }
            if(s[y+dy[now]*i][x+dx[now]*i]==0){
                break;
            }
        }
    }
    return count;
}

void dfs1(int x, int y, int c){
    for(int now=0; now<8; now++){
        for(int i=1; i<=8; i++){
            if(y+dy[now]*i<1||y+dy[now]*i>8||x+dx[now]*i<1||x+dx[now]*i>8) break;
            if(s[y+dy[now]*i][x+dx[now]*i]==c){
                for(int j=1; j<i; j++){
                    s[y+dy[now]*j][x+dx[now]*j]=c;
                }
                break;
            }
            if(s[y+dy[now]*i][x+dx[now]*i]==0){
                break;
            }
        }
    }
}

int main(void){
    for(int i=1; i<=8; i++){
        string str;
        cin >> str;
        for(int j=1; j<=8; j++){
            s[i][j]=(str[j-1]=='o'?1:(str[j-1]=='x'?-1:0));
        }
    }
    int c=-1, jud=0, turn=0;
    while(true){
        c*=-1;
        turn++;
        if(turn%2==1) jud=0;
        int max=0, mx=-1, my=-1;
        for(int i=1; i<=8; i++){
            for(int j=1; j<=8; j++){
                if(s[i][j]!=0) continue;
                int ret=dfs(j, i, c);
                if(max<ret){
                    max=ret;
                    mx=j; my=i;
                }
                if(max==ret&&c==-1){
                    mx=j; my=i;
                }
            }
        }
        if(max>0){
            s[my][mx]=c;
            dfs1(mx, my, c);
        }
        //-----------------------
        // for(int i=1; i<=8; i++){
        //     for(int j=1; j<=8; j++){
        //         cout << (s[i][j]==1?'o':(s[i][j]==-1?'x':'.'));
        //     }
        //     cout << "\n";
        // }
        // cout << "\n";
        //-----------------------
        if(max==0) jud++;
        if(jud==2) break;
    }
    
    for(int i=1; i<=8; i++){
        for(int j=1; j<=8; j++){
            cout << (s[i][j]==1?'o':(s[i][j]==-1?'x':'.'));
        }
        cout << "\n";
    }
    
    
}



Measured memory_bytes: 3236
#include <iostream>
#include <fstream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <stack>
#include <queue>
#include <complex>
#include <set>
#include <list>
#include <iomanip>
#include <map>
#include <limits.h>
#include <memory.h>


using namespace std;
static const double EPS = 1e-10;
typedef long long ll;
typedef unsigned long long ull;
#define FOR(i,n) for(int i=0;i<(int)n;++i)
#define FORNUM(p, x) for (int num = p; num < (int)(x); ++num)
#define FORI(p, x) for (int i = p; i < (int)(x); ++i)
#define FORJ(p, x) for (int j = p; j < (int)(x); ++j)
#define FORK(p, x) for (int k = p; k < (int)(x); ++k)
#define FORL(p, x) for (int l = p; l < (int)(x); ++l)

typedef vector<double> vec;
typedef vector<vec> mat;

ll luc[100];


int main() {
	int v;
	cin>>v;
	luc[0]=2;
	luc[1]=1;
	for(int i=2;i<=v;i++){
		luc[i]=luc[i-1]+luc[i-2];
	}
	cout<<luc[v]<<endl;
	return 0;
}




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

public class Program
{

    public void Proc()
    {
        string inpt = Reader.ReadLine();
        List<string> list = new List<string>();
        int idx = 0;
        int ans = 0;
        for (int i = 1; i < inpt.Length; i++) {
            if(inpt[i]!=inpt[i-1]) {
                list.Add(inpt.Substring(idx, i-idx));
                idx = i;
            }
        }
        list.Add(inpt.Substring(idx));
        idx = 0;
        for (int i = 0; i < list.Count; i++) {
            if(idx <= inpt.Length/2&&idx+list[i].Length>inpt.Length/2) {
                ans = Math.Min(idx + list[i].Length, inpt.Length - idx);
                break;
            }
            idx += list[i].Length;
        }
        Console.WriteLine(ans);
    }


    public class Reader
    {
        private static StringReader sr;
        public static bool IsDebug = false;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (sr == null)
                {
                    sr = new StringReader(InputText.Trim());
                }
                return sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
        private static string InputText = @"


1122


";
    }

    public static void Main(string[] args)
    {
#if DEBUG
        Reader.IsDebug = true;
#endif
        Program prg = new Program();
        prg.Proc();
    }
}


Measured memory_bytes: 12384
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	const int mod = 1e9 + 7;
	int n; cin >> n;
	string s; cin >> s;
	vi dp(1, 1);
	rep(i, n - 1){
		vi next(i + 2);
		if(s[i] == '<') rep(j, i + 1) next[j + 1] = (next[j] + dp[j]) % mod;
		else for(int j = i; j >= 0; j--) next[j] = (next[j + 1] + dp[j]) % mod;
		dp = next;
	}
	cout << accumulate(all(dp), 0ll) % mod << endl;
	return 0;
}

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

namespace q4
{
    class Program
    {
        static void Main(string[] args)
        {
            var input1 = Console.ReadLine().Split(' ').Select(x => Convert.ToInt32(x)).ToArray();
            var N = input1[0];
            var X = input1[1] - 1;
            var Y = input1[2] - 1;
            var warp = Y - X;
            var wt = (X + Y) / 2;
            int?[] arr = new int?[N];
            var tbl = new int[N,N];

            Func<int, int, int> f = (I, J) =>
            {
                var d1 = Math.Abs(X - I);
                var d2 = Math.Abs(J - Y);
                return Math.Min(J - I, d1 + d2 + 1);
            };


            for (var i = 0; i < N - 1; i++)
            {
                for (var j = i + 1; j < N; j++)
                {
                    tbl[i, f(i, j)] += 1;
                }
            }

            for (var k = 0; k < N - 1; k++)
            {
                var c = 0;
                for (var i = 0; i < N - 1; i++)
                {
                    c += tbl[i, k+1];
                }
                Console.WriteLine(c);
            }
        }
    }
}


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

#define rep(i,N) for(int i=0;i<N;i++)
#define rep2(i,N) for(int i=1;i<=N;i++)
using namespace std;
long long  INF=1e18;
long long mod=1e9+7;


int main(){

    string s;
    cin>>s;

    int q;
    cin>>q;
    int  change=0;
    rep(i,q){
        int a;
        cin>>a;
        if(a==1){
            change++;
            change%=2;
        }
        else{
            int f;
            char c;
            cin>>f>>c;
            if(f==1){
                if(change){
                    s.push_back(c);
                }
                else{
                    s.insert(s.begin(),c);
                }
            }
            else{
                if(!change){
                    s.push_back(c);
                }
                else{
                    s.insert(s.begin(),c);
                }
            }
        }
    }
    if(!change){
        cout<<s<<endl;
    }
    else{
        for(int i=s.size()-1;i>-1;i--){
            cout<<s[i];
        }
        cout<<endl;
    }
    return 0;

}
/*


*/


Measured memory_bytes: 1028
height :: Int -> Int -> [Int] -> [Int]
height cnt _ [] = [cnt]
height cnt prev (x:xs)
    | prev < x  = cnt : height 0 x xs
    | otherwise = height (cnt+1) x xs

solve :: [Int] -> Int
solve xs = maximum hs
    where hs = height 0 (head xs) (tail xs)

main = getLine >> map read . words <$> getLine >>= print . solve


Measured memory_bytes: 36220
#include<iostream>
#include<cstdio>
#include<stack>
#include<queue>
#include<algorithm>
#include<string>
#include<set>
#include<map>
#include<vector>
#include<math.h>
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 pp(...) "\033[94m [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
#define dg1(x) debug() << pp(x)
#define dg2(x,y) debug() << pp(x) pp(y)
#define dg3(x,y,z) debug() << pp(x) pp(y) pp(z)
#define dg4(w,x,y,z) debug() << pp(w) pp(x) pp(y) pp(z)
#define msg(x) debug() << x
#define int long long
const int xx = 2e5;
const int MOD = 1e9 + 7;
int lcm(int a, int b){
  return a*(b/__gcd(a,b));
}
int findTrailingZeros(int n) 
{ 
    int count = 0; 
  
    for (int i = 5; n / i >= 1; i *= 5) 
        count += n / i; 
  
    return count; 
}

signed main(){

  ios::sync_with_stdio(false);cin.tie(0);

  int n;
  cin >> n;
  if(n%2){
    cout << 0 << '\n';
  }
  else cout << findTrailingZeros(n/2) << '\n';
  
}


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

int main(){

  int N;
  vector<int> L(101, 0);

  cin >> N;

  bool ans = false;
  // cout << "test" << endl;
  for(int i = 0 ; i < N ; ++i){
    // cout << "test : " << i << endl;
    cin >> L[i];
  }



  sort(L.begin(), L.end(), greater<int>());
  // reverse(L.begin(), L.end());

  int sum = 0;
  int ref = L[0];

  for(int i = 1 ; i < N ; ++i){
    sum += L[i];
    if(ref < sum) ans = true;
  }
  // cout << "test" << endl;

  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;

}

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

#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")

#define endl "\n"
#define fi first
#define se second
#define pb push_back
#define last(s) (s)[(int)((s).size())-1]
#define prelast(s) (s)[(int)((s).size())-2]
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define elif else if
#define left asdasd
#define next zaza
#define prev azaz
#define cclear cout<<flush;
#define x0 kerker
//#define time chas
#define y0 lolik
#define x1 ashkjl
#define y1 fakakaka
#define y2 ololol
#define x2 jejejejej
#define kchay ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define files freopen("a.in", "r", stdin);freopen("a.out", "w", stdout);
#define ref svyazi
#define int long long
#define ii pair<int, int>
#define llong long long
#define ld long double
#define list spisok

const ld eps = 1e-12;
const ld Pi = acos(-1);
const int md = 1e9 + 7;

using namespace std;
//using namespace __gnu_cxx;


/*
*/

int n, q, dp[5], cnt[5];
string s;


int32_t main() {
    kchay;

    cin >> n;
    cin >> s;
    cin >> q;

    while(q--) {
        int k;
        cin >> k;
        dp[0] = 0;
        dp[1] = 0;
        int ans = 0;
        cnt[1] = 0;
        for(int i = 0; i < k; i++) {
            if(s[i] == 'D') {
                dp[0]++;
            } elif(s[i] == 'M') {
                dp[1] += dp[0];
                cnt[1]++;
            } elif(s[i] == 'C') {
                ans += dp[1];
            }
        }

        for(int i = k; i < n; i++) {
            if(s[i - k] == 'D') {
                dp[1] -= cnt[1];
                dp[0]--;
            } elif(s[i - k] == 'M') {
                cnt[1]--;
            }
            if(s[i] == 'D') {
                dp[0]++;
            } elif(s[i] == 'M') {
                dp[1] += dp[0];
                cnt[1]++;
            } elif(s[i] == 'C') {
                ans += dp[1];
            }
        }
        cout << ans << endl;
    }



    return 0;
}


Measured memory_bytes: 1948
/*
Original problem: https://atcoder.jp/contests/dp/tasks/dp_t
Author: sammochen
*/

#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"

using namespace std;

#define REP(x,l,u) for(ll x = l;x<u;x++)
#define RREP(x,l,u) for(ll x = l;x>=u;x--)

#define PII pair<int,int>
#define PLL pair<ll,ll>
#define MP make_pair

typedef  long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ld;
typedef vector<ll> VLL;
typedef vector<int> VI;

const ll mod = 1e9+7;

namespace SOLVE {
	void addmod(ll& a, ll b) {
		a += b;
		if (a >= mod) {
			a -= mod;
		}
	}

    void main() {
        int n;
		string s;
		cin >> n >> s;

		// dp[i][j]: number of ways to do the first i with j as the last number
		// 0-indexed 

		vector<VLL> dp(n, VLL(n));
		// base case
		dp[0][0] = 1;

		REP(i, 1, n) {
			// supports O(1) subarray sum
			VLL prefix(n); 
			prefix = dp[i-1];

			REP(j, 1, n) {
				addmod(prefix[j], prefix[j-1]); 
			}

			REP(num, 0, i + 1) { // from 0 up to i, i want to slot a number
				if (s[i - 1] == '<') {
					dp[i][num] = num == 0 ? 0 : prefix[num - 1];
				} else {
					dp[i][num] = num == 0 ? prefix[i] : (prefix[i] - prefix[num - 1] + mod) % mod;
				}
			}
		}

		// the answer is all the possibilities added together
		ll ans = 0;
		REP(i,0,n) {
			addmod(ans, dp[n-1][i]);
		} 
		cout << ans << endl;


    }
}


signed main() {
	int t;
	t = 1;
	// cin >> t;
	while (t--) {
		SOLVE::main();
	}

	return 0;
}

Measured memory_bytes: 71176
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
// #define int long long

template <class T>
bool INRANGE(T x, T a, T b) { return a <= x && x <= b; }
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;
}

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define RREP(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define RFOR(i, a, b) for (int i = (a); i >= (b); --i)
#define ALL(v) (v).begin(), (v).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

ll N;

ll dfs(string s) {
    if (stoll(s) > N) return 0;

    bool ok = true;
    {
        vector<bool> check(3, false);
        for (char c : s) {
            if (c == '3') check[0] = true;
            if (c == '5') check[1] = true;
            if (c == '7') check[2] = true;
        }
        for (bool b : check) if (!b) ok = false;
    }
    ll sum = 0;
    if (ok) sum = 1;

    for (char c : {'7', '5', '3'}) {
        sum += dfs(s+c);
    }

    return sum;
}

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

    cin >> N;
    
    cout << dfs("0") << endl;
    return 0;
}


Measured memory_bytes: 256
// finish date: 2018/01/30
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define bigmod 1000000007
#define INF 1050000000

#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>

using namespace std;



int main() {
    int n;
    cin>>n;
    int a;
    vi A(n,-1);
    cin>>a;
    A[(n-1)/2] = a;
    int sign = 1;
    FOR(i,2,n+1){
        cin>>a;
        A[(n-1)/2+(i*sign)/2] = a;
        sign*=-1;
    }
    if(n%2==0) reverse(A.begin(),A.end());
    rep(i,n) cout<<A[i]<<" ";
    cout<<endl;


    return 0;
}



Measured memory_bytes: 2944
N = gets.to_i
a = gets
b = gets
c = gets

counter = 0

N.times{|i|
if a[i] != b[i] && b[i] != c[i] && c[i] != a[i]
    counter += 2
elsif a[i] == b[i] && b[i] == c[i]
    counter += 0
else
    counter += 1
end
}

puts counter


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

int main() {
    int N,K;
    cin >> N >> K;
    int ans = 1;

    for (int i = 0; i < N; i++)
    {
        if (ans * 2 > ans + K){
            ans = ans + K;
        }
        else
        {
            ans *= 2;
        }
    };

    cout << ans << endl;
    
}


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

int main(void)
{
	int a, b, c, k;
  	cin >> a >> b >> c >> k;
  	int total = 0;
  	for (int i = 0;i<k;i++) {
    	if(i < a) total++;
      	else if (i < a + b) continue;
      	else total--;
    }
  	cout << total << endl;
}


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

using namespace std;

#define EACH(i,a) for (auto& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl;
#define OK(ok) cout << (ok ? "Yes" : "No") << endl;
typedef long long ll;

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail) {
  cin >> head; CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

const int INF = 1e9 + 1;
const int MOD = 1e9 + 7;
const int MAX_N = 1e5 + 1;

bool able[10];
int N, K;

bool check(int n)
{
  string s = to_string(n);
  REP(i, s.size()) {
    if (able[s[i] - '0']) return false;
  }
  return true;
}

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

  cin >> N >> K;
  REP(i, K) {
    CIN(a);
    able[a] = true;
  }

  int tmp = N;
  while(true) {
    if(check(tmp)) break;
    tmp++;
  }

  cout << tmp << endl;
  
  return 0;
}



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

int main() {
    double r, S, len;
    cin >> r;
    S = M_PI * r * r;
    len = 2 * M_PI * r;
    printf("%f %f\n", S, len);
    return 0;
}

Measured memory_bytes: 1232
#include <bits/stdc++.h> 
#define MAX 50 
using namespace std; 
   
void printString(long long n) 
{ 
    char str[MAX];
    long long i = 0; 
  
    while (n > 0) { 
         
        int rem = n % 26;  
        if (rem == 0) { 
            str[i++] = 'z'; 
            n = (n / 26) - 1; 
        } 
        else
        { 
            str[i++] = (rem - 1) + 'a'; 
            n = n / 26; 
        } 
    } 
    str[i] = '\0'; 
    reverse(str, str + strlen(str)); 
    cout << str << endl; 
  
    return; 
} 
int main() 
{ 
    long long n;
    cin>>n;
    printString(n); 
    return 0; 
}

Measured memory_bytes: 3616
#include <stdio.h>
int main(void){
	int a,b,c,d,e,k;
	scanf("%d\n%d\n%d\n%d\n%d\n%d",&a,&b,&c,&d,&e,&k);
	if(e-a>k) printf(":(\n");
	else printf("Yay!\n");
	return 0;
}


Measured memory_bytes: 128
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

using namespace std;

int main() {
    int H, W, D;
    cin >> H >> W >> D;

    pair<int, int> place[H * W + 1];
    // 各数値の座標を記録

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            int A;
            cin >> A;
            place[A] = {i, j};
        }
    }

    int mp[H * W + 1];
    // 始点からの消費魔力をメモ

    // 下ごしらえ開始
    for (int i = 1; i <= H * W; i++) {
        if (i <= D) {
            // いわゆる「始点」なので消費魔力は0
            mp[i] = 0;

        } else {
            // 座標を求める
            int x1 = place[i - D].first;
            int y1 = place[i - D].second;
            int x2 = place[i].first;
            int y2 = place[i].second;

            // 魔力を計算
            mp[i] = mp[i - D] + abs(x2 - x1) + abs(y2 - y1);
        }
    }

    int Q;
    cin >> Q;
    for (int i = 0; i < Q; i++) {
        // ここからクエリを捌いていく
        int L, R;
        cin >> L >> R;

        // 差分を取るだけで答えが出る
        cout << mp[R] - mp[L] << endl;
    }
    return 0;
}

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

using namespace std;

bool check(int n) {
	int a = n % 10;

	while (n > 0)
	{
		if (a != (n % 10))return false;
		n /= 10;
	}

	return true;
}

int main(void) {
	int i, n;
	cin >> n;

	for (i = n;;i++) {
		if (check(i)) {
			cout << i << endl;
			return 0;
		}
	}

	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(int argc, char const *argv[]) {
  int array[5],k;

  for (int i = 0; i < 5; i++) {
    scanf("%d\n", &array[i]);
  }
  scanf("%d",&k);

  for (int i = 1; i < 4; i++) {
    if (array[i+1] - array[0] > k) {
      printf(":(\n");
      return 0;
    }
  }

  printf("Yay!\n");
  return 0;
}


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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;

int n, k;

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

ll dp[200005];

main() {
  cin >> n >> k;
  ll ans = 0;
  for (int i = 1; i <= k; i++) dp[i] = modpow(k / i, n);

  for (int i = k; i > 0; --i)
    for (int j = 2; j <= k / i ; ++j) dp[i] -= dp[i * j];

  rep(i, k + 1) ans += dp[i] * i, ans %= mod;

  cout << ans << endl;
}


Measured memory_bytes: 4420
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; ++i)
#define ALL(v) v.begin(), v.end()
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1000000007;

int main()
{
   int n;
   cin >> n;
   pair<int,int> fm=make_pair(0,0);
   rep(i,n)
   {
      int a,b;
      cin >> a >> b;
      pair<int ,int> p;
      p = make_pair(a,b);
      if(p.first>fm.first)fm = p;
   }
   cout<<fm.first+fm.second<<endl;
   return 0;
}

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

#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define repn(i, n) for(int (i) = 1; (i) <= (n); (i)++)
#define repr(i, n) for(int (i) = (n-1); (i) >= 0; (i)--)
#define all(x) (x).begin(), (x).end()
#define lint long long
#define ulint unsigned long long
#define ldou long double
#define fi first
#define se second
#define setpre(x) std::cout << fixed << setprecision(x)
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define out(x) cout << (x) << endl
#define outs(x) cout << (x) << " "
#define yn(x) cout << ((x)?("Yes"):("No")) << endl
#define YN(x) cout << ((x)?("YES"):("NO")) << endl
#define bit_c(x) __builtin_popcountll(x)

inline void logger(){ std::cout << " [LOGGER] " << endl; }
template<typename A, typename... B>
void logger(const A& a, const B&... b){
    cout << a << " , ";
    logger(b...);
}

typedef pair<lint, lint> P;
const lint MOD = 1000000007;
const lint MOD9 = 998244353;
const lint INF = MOD * MOD;
const int MAX = 200005;

/* ...o(^-^)o... */

int main(){
    int n, ma, mb; cin >> n >> ma >> mb;
    vector<int> a(n), b(n), c(n), d(n);
    rep(i, n){
        cin >> a[i] >> b[i] >> c[i];
        d[i] = b[i]*ma - a[i]*mb;
    }

    vector<map<int, int> > dp(n+1);
    rep(i, n+1){
        for(int j = -105; j <= 105; j++){
            dp[i][j] = MAX;
        }
    }

    rep(i, n) for(int j = -100; j <= 100; j++){
        dp[i+1][j] = dp[i][j];
        if(-100 <= j-d[i] && j-d[i] <= 100){
            if(j-d[i] != 0) dp[i+1][j] = min(dp[i+1][j], dp[i][j-d[i]] + c[i]);
            else dp[i+1][j] = min(dp[i+1][j], c[i]);
        }
    }

    if(dp[n][0] == MAX) dp[n][0] = -1;
    out(dp[n][0]);
}

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

#define ff              first
#define ss              second
#define int             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             998244353
#define endl            "\n"
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <= n; i++)
int max(int a, int b) {if (a > b) return a; else return b;}
int min(int a, int b) {if (a < b) return a; else return b;}
// #DEBUG
void __print(int x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i : x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
// ###################################################################

void fast()
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
// #ifndef ONLINE_JUDGE
//   freopen("input.txt", "r", stdin);
//   freopen("output.txt", "w", stdout);
// #endif
}
vector<int> stones;
int ans1 = INT_MAX;
int ans2 = INT_MAX;
int n;
int dp[100005];
int solve(int start) {
  if (start == n - 2) {
    return abs(stones[n - 1] - stones[n - 2]);
  }
  if (start == n - 1) {
    return 0;
  }
  if (dp[start] != -1) {
    return dp[start];
  }
  else {
    dp[start + 1] = solve(start + 1);
    dp[start + 2] = solve(start + 2);
    ans1 = abs(stones[start] - stones[start + 1]) + dp[start + 1];
    ans2 = abs(stones[start] - stones[start + 2]) + dp[start + 2];
    dp[start] = min(ans1, ans2);
    return dp[start];

  }
}
int32_t main()
{
  fast();
  cin >> n;
  memset(dp, -1, sizeof dp);
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    stones.push_back(a);
  }
  cout << solve(0);
}

Measured memory_bytes: 5108
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
#include<cassert>
#include<random>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

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

int main(){
	int n,m;
	int i,j,k;
	int a,b,c;
	cin>>n;
	m=360;
	a=gcd(n,m);
	cout<<m/a<<endl;
}

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

int main() {
	vector<int> n;

	for (int i = 0; i < 4; i++) {
		int j;
		cin >> j;
		n.push_back(j);
	}

	std::sort(n.begin(), n.end());

	bool a = n[0] == 1;
	bool b = n[1] == 4;
	bool c = n[2] == 7;
	bool d = n[3] == 9;

	cout << (a && b && c && d ? "YES" : "NO") << endl;
}

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


int main(){
    int a,b;
    cin >>a>>b;
    if (a<b)cout<<"a"<<" < "<<"b"<<endl;
    if(a==b)cout<<"a"<<" == "<<"b"<<endl;
    if(a>b)cout<<"a"<<" > "<<"b"<<endl;
}


Measured memory_bytes: 3068
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<string>
#include<queue>
#include<utility>
#include<cmath>
#include<sstream>
#include<istream>
#include<numeric>

using namespace std;


int main()
{
  long long X, Y, Z;

  cin >> X >> Y >> Z;

  cout << Z << " " << X << " " << Y << endl;


  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define FASTIO cin.tie(0);cout.tie(0);ios_base::sync_with_stdio(false)
#define ll long long int
#define F first
#define S second
#define pll pair<ll,ll>
#define vl vector<ll>
#define vi vector<int>
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define vpii vector<pair<int,int> >
#define vvpii vector<vpii >
#define vpll vector<pair<ll,ll> >
#define vvpll vector<vpll >
#define pb push_back
#define MOD 1000000007
#define brk cout<<"\n"

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set;

struct compare {
	bool operator() (const pair<int, int> &a, const pair<int, int> &b) const {
		if ((a.S - a.F) != (b.S - b.F)) return ((a.S - a.F) > (b.S - b.F));
		else return (a.F < b.F);
	}
};

ll n;

void add_self(ll &a, ll b) {
	a += b;
	if (a >= MOD)a -= MOD;
}

ll mul(ll a, ll b) {
	a *= b;
	if (a >= MOD) a %= MOD;
	return a;
}

vvl MULT(vvl A, vvl B) {
	vvl C(n, vl(n));
	for (ll i = 0; i < n; i++) {
		for (ll j = 0; j < n; j++) {
			for (ll k = 0; k < n; k++) {
				//ll add=
				add_self(C[i][j], mul(A[i][k], B[k][j]));
			}
		}
	}
	return C;
}

int main() {
// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
	FASTIO;
	ll k; cin >> n >> k;
	vvl edges(n, vl(n)), mult(n, vl(n)), dp(n, vl(n));
	for (ll i = 0; i < n; i++) {
		for (ll j = 0; j < n; j++) {
			cin >> edges[i][j];
			mult[i][j] = edges[i][j];
		}
	}
	//vl temp(n, 1);
	for (ll i = 0; i < n; i++) dp[i][i] = 1;
	while (k) {
		if (k % 2) {
			dp = MULT(dp, mult);
		}
		mult = MULT(mult, mult);
		k /= 2;
	}

	//dp.pb(edges);
	// ll up_to = log2(k);
	// for (ll step = 1; step <= up_to; step++) {
	// 	vvl temp(n, vl(n, 0));
	// 	for (ll i = 0; i < n; i++) {
	// 		for (ll j = 0; j < n; j++) {
	// 			for (ll k = 0; k < n; k++) {
	// 				add_self(temp[i][j], (dp[step - 1][i][k]*dp[step - 1][k][j]) % MOD);
	// 			}
	// 		}
	// 	}
	// 	dp.pb(temp);
	// }

	// ll req = k % (1 << up_to);
	// while (req != 0) {
	// 	ll now = log2(req);
	// 	vvl temp(n, vl(n, 0));
	// 	for (ll i = 0; i < n; i++) {
	// 		for (ll j = 0; j < n; j++) {
	// 			for (ll k = 0; k < n; k++) {
	// 				add_self(temp[i][j], (dp[dp.size() - 1][i][k]*dp[now][k][j]) % MOD);
	// 			}
	// 		}
	// 	}
	// 	dp.pb(temp);
	// 	req = req % (1 << now);
	// }

	ll ans = 0;
	for (ll i = 0; i < n; i++) {
		for (ll j = 0; j < n; j++) {
			add_self(ans, dp[i][j]);
		}
	}
	cout << ans; brk;


}

Measured memory_bytes: 384
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

template<int Modulo = MOD> struct Mint {
	Int val;
	constexpr Mint(Int v = 0) noexcept : val(v% Modulo) {
		if (val < 0) v += Modulo;
	}
	constexpr int getmod() { return Modulo; }
	constexpr Mint operator - () const noexcept { return val ? Modulo - val : 0; }
	constexpr Mint operator + (const Mint& r) const noexcept { return Mint(*this) += r; }
	constexpr Mint operator - (const Mint& r) const noexcept { return Mint(*this) -= r; }
	constexpr Mint operator * (const Mint& r) const noexcept { return Mint(*this) *= r; }
	constexpr Mint operator / (const Mint& r) const noexcept { return Mint(*this) /= r; }
	constexpr Mint& operator += (const Mint& r) noexcept {
		val += r.val;
		if (val >= Modulo) val -= Modulo;
		return *this;
	}
	constexpr Mint& operator -= (const Mint& r) noexcept {
		val -= r.val;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr Mint& operator *= (const Mint& r) noexcept {
		val = val * r.val % Modulo;
		return *this;
	}
	constexpr Mint& operator /= (const Mint& r) noexcept {
		Int a = r.val, b = Modulo, u = 1, v = 0;
		while (b) {
			Int t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % Modulo;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr bool operator == (const Mint& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const Mint& r) const noexcept {
		return this->val != r.val;
	}
	friend ostream& operator << (ostream& os, const Mint<Modulo>& x) noexcept {
		return os << x.val;
	}
	friend istream& operator >> (istream& is, Mint<Modulo>& x) noexcept {
		Int tmp; is >> tmp;
		x = Mint<Modulo>(tmp);
		return is;
	}
	friend constexpr Mint<Modulo> modpow(const Mint<Modulo>& a, Int n) noexcept {
		Mint res(1), tmp = a;
		while (n > 0) {
			if (n & 1) res *= tmp;
			tmp *= tmp;
			n >>= 1;
		}
		return res;
	}
};

using mint = Mint<>;

template<class T>
vector<T> divisor(T n) {
	vector<T> res;
	for (T i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			res.emplace_back(i);
			if (i * i != n) res.emplace_back(n / i);
		}
	}
	sort(res.begin(), res.end(),greater<T>());
	return res;
}

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N, M;
	cin >> N >> M;

	vector<Int> temp = divisor(M);
	Int len = temp.size();

	Int ans;
	for (Int i = 0; i < len; i++) {
		if (temp[i] * N <= M) {
			ans = temp[i];
			break;
		}
	}
	cout << ans << "\n";
}

Measured memory_bytes: 384
#include	<cstdint>
#include	<iostream>
#include	<fstream>

typedef		std::uint_least32_t		ULI;		//10^9
typedef		std::int_least32_t		SLI;
typedef		std::uint_least64_t		ULLI;
typedef		std::int_least64_t		SLLI;

using namespace std;

int		Cnt = 0;

void Swap(int *a, int *b)
{
	int		temp = *a;
	*a = *b;
	*b = temp;
	Cnt++;
}

void SelectionSort(int A[], int N)
{
	for (int i = 0; i < N; i++)
	{
		int		minj = i;
		for (int j = i; j < N; j++)
		{
			if (A[j] < A[minj])
			{
				minj = j;
			}
		}
		if (i != minj)
		{
			Swap(&(A[i]), &(A[minj]));
		}
	}
}

int main()
{
	int		N;
	int		A[100];

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

	SelectionSort(A, N);

	for (int i = 0; i < N; i++)
	{
		if (i != 0)	cout << " ";
		cout << A[i];
	}
	cout << "\n";

	cout << Cnt << "\n";

	return 0;
}

Measured memory_bytes: 3096
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cmath>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
using namespace std;

int main(){
  int N;
  cin >> N;
  vector<int> p(N);
  for(int i = 0;i < N;i++){
    cin >> p.at(i);
  }
  int count = 0;
  for(int i = 0;i < N;i++){
    if((i + 1) != p.at(i)){
      count++;
    }
  }
  if(count <= 2){
    cout << "YES" << endl;
  }else{
    cout << "NO" << endl;
  }
}


Measured memory_bytes: 3596