akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0;i<n;++i)
#define REP1(i,n) for(int i=1;i<=n;++i)
#define SZ(i) int(i.size())
#ifdef tmd
#define IOS()
#define debug(...) fprintf(stderr,"#%d: %s = ",__LINE__,#__VA_ARGS__),_do(__VA_ARGS__);
template<typename T> void _do(T &&x){cerr<<x<<endl;}
template<typename T, typename ...S> void _do(T &&x, S &&...y){cerr<<x<<", ";_do(y...);}
template<typename It> ostream& _printRng(ostream &os,It bg,It ed)
{
    os<<"{";
    for(It it=bg;it!=ed;it++) {
        os<<(it==bg?"":",")<<*it;
    }
    os<<"}";
    return os;
}
template<typename T> ostream &operator << (ostream &os,vector<T> &v){return _printRng(os,v.begin(), v.end());}
template<typename T> void pary(T bg, T ed){_printRng(cerr,bg,ed);cerr<<endl;}
#else
#define IOS() ios_base::sync_with_stdio(0);cin.tie(0);
#define endl '\n'
#define debug(...)
#define pary(...)
#endif

const int MAXN = 51;
const ll MOD = 1000000007;

int w, d, n;
int ans[MAXN][MAXN];

typedef pair<int,int> pii;
struct BFS {
    const int shift = 200;
    vector<pii> data[405];

    void add (int hei, pii cell) {
        data[hei+shift].emplace_back(cell);
    }

    vector<pii> get(int hei) {
        return data[hei+shift];
    }
} bfs;

struct Walker {
    const int sz = 4;
    int dx[4] = {-1, 0, 1, 0};
    int dy[4] = {0, -1, 0, 1};

    bool validPosition (pii cur) {
        return cur.first >= 1 && cur.first <= w && cur.second >= 1 && cur.second <= d;
    }

    vector<pii> validMoves (pii cur) {
        vector<pii> ret;
        for (int i=0; i<sz; i++) {
            pii nw = {cur.first+dx[i], cur.second+dy[i]};
            if (validPosition(nw)) {
                ret.emplace_back(nw);
            }
        }
        return ret;
    }
} walker;

const int INF = 0x3f3f3f3f;
/*********************GoodLuck***********************/
int main () {
    IOS();

    memset(ans, INF, sizeof(ans));

    cin >> w >> d >> n;
    REP (i, n) {
        int hei;
        pii cell;
        cin >> cell.first >> cell.second >> hei;
        bfs.add(hei, cell);
        ans[cell.first][cell.second] = hei;
    }

    for (int i=200; i>= -200; i--) {
        vector<pii> lst = bfs.get(i);
        for (auto cur : lst) {

            vector<pii> valid = walker.validMoves(cur);
            for (auto nw : valid) {
                if (ans[nw.first][nw.second] == INF) {
                    bfs.add(i-1, nw);
                    ans[nw.first][nw.second] = i-1;
                }
            }
        }
    }
#ifdef tmd
    for (int i=1; i<=w; i++) {
        for (int j=1; j<=d; j++) {
                cout << ans[i][j] << " \n"[j==d];
        }
    }
#endif // tmd

    int sum = 0;
    bool bad = false;
    for (int i=1; i<=w; i++) {
        for (int j=1; j<=d; j++) {
            if (i>1 && abs(ans[i][j]-ans[i-1][j])>1) {
                bad = true;
            }
            if (j>1 && abs(ans[i][j]-ans[i][j-1])>1) {
                bad = true;
            }
            sum += ans[i][j];
        }
    }


    if (bad) {
        cout << "No" << endl;
    } else {
        cout << sum << endl;
    }
}



Measured memory_bytes: 3240
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
#define MAX 100001
#define INF 1000000009

struct edge { int to, cost; };

vector<edge> v[MAX];

bool flag;
bool visited[MAX];
int d[MAX];

void bfs(int n) {
    queue<int> que;
    que.push(n);
    d[n] = 0;
    while (que.size()) {
        int q = que.front();
        que.pop();
        for (int i = 0; i < v[q].size(); i++) {
            int res = v[q][i].to;
            if (visited[res]) {
                if (d[res] != d[q] + v[q][i].cost) {
                    flag = false;
                }
            } else {
                visited[res] = true;
                d[res] = d[q] + v[q][i].cost;
                que.push(res);
            }
        }
    }
}

int main() {
    int n, m;
    cin >> n >> m;
    for (int i = 0; i < m; i++) {
        int l, r, d;
        cin >> l >> r >> d;
        edge res;
        res.to = r;
        res.cost = d;
        v[l].push_back(res);
        res.to = l;
        res.cost = -d;
        v[r].push_back(res);
    }
    flag = true;
    for (int i = 1; i <= n; i++) {
        d[i] = INF;
        visited[i] = false;
    }
    for (int i = 1; i <= n; i++) {
        if (d[i] == INF) {
            d[i] = 0;
            bfs(i);
        }
    }
    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


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

int main()
{
    int n;
    cin >> n;
    int a[100001];
    int odd = 0;
    int mul4 = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i];
        if(a[i] % 4 == 0){
            mul4++;
        }
        if(a[i] % 2 == 1){
            odd++;
        }
    }
    if(odd + mul4 == n){
        if(odd <= mul4 + 1){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }
    else{
        if(odd <= mul4){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }
}

Measured memory_bytes: 640
using System;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {     
        static void Main(string[] args)
        {

            string[] datanum = Console.ReadLine().Split(' ');

            //????????????????????????n,m,l???int????????£??????
            long n = long.Parse(datanum[0]);
            long m = long.Parse(datanum[1]);
            long l = long.Parse(datanum[2]);

            //??\??????????????????A??¨??????B????????????????????????2?¬??????????
            long[,] matrixA2D = new long[n, m];
            long[,] matrixB2D = new long[m, l];

            //?¨??????????????????????????????????????¬??????????
            long[,] result2D = new long[l, n];



            //??????A??????????????????????????????
            for(long i = 0; i < n; i++)
            {
                string[]rowset = Console.ReadLine().Split(' ');

                for(long j = 0; j < m; j++)
                {
                    matrixA2D[i, j] = long.Parse(rowset[j]);
                }
            }

            //??????B??????????????????????????????
            for(long a = 0; a < m; a++)
            {
                string[] columsset = Console.ReadLine().Split(' ');

                for(long b = 0; b < l; b++)
                {
                    matrixB2D[a, b] = long.Parse(columsset[b]);
                }

            }


            //?????????????????????
            for(long r = 0; r < m; r++)
            {

                for(long u = 0; u < l; u++)
                {
                    long f = 0;

                    while(f < n)
                    {
                        result2D[u, f] += matrixA2D[f, r] * matrixB2D[r, u];
                        f++;
                    }

                }
            }


            //????????????
            for(long y = 0; y < n; y++)
            {
                string text = string.Empty;

                for (long z = 0; z < l; z++)
                {
                    text += result2D[z, y].ToString() + ' ';                                       
                }

                Console.WriteLine(text.TrimEnd());
            }


        }
    
    }

}

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

using namespace std;

int main()
{
    vector<vector<pair<int,int> > > NUM;
    vector<int> Point;
    int N;
    int a,b,c;

    cin >> N;

    NUM.resize(3);

    for(int i=0; i<N; ++i) {
        cin >> a >> b >> c;
        NUM[0].push_back({a,i});
        NUM[1].push_back({b,i});
        NUM[2].push_back({c,i});
        Point.push_back(0);
    }

    sort(NUM[0].begin(),NUM[0].end());
    sort(NUM[1].begin(),NUM[1].end());
    sort(NUM[2].begin(),NUM[2].end());

    for(int i=0; i<3; ++i) {
        if(NUM[i][0].first!=NUM[i][1].first) {
            Point[NUM[i][0].second]+=NUM[i][0].first;
        }
        for(int j=1; j<N-1; ++j) {
            if(NUM[i][j-1].first!=NUM[i][j].first && NUM[i][j+1].first!=NUM[i][j].first) {
                Point[NUM[i][j].second]+=NUM[i][j].first;
            }
        }
        if(NUM[i][N-2].first!=NUM[i][N-1].first) {
            Point[NUM[i][N-1].second]+=NUM[i][N-1].first;
        }
    }

    for(int i=0; i<N; ++i) {
        cout << Point[i] << endl;
    }
    return 0;
}

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

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

using namespace std;

class mint{
	static const int MOD=1e9+7;
	int x;
public:
	mint():x(0){}
	mint(long long y){ x=y%MOD; if(x<0) x+=MOD; }

	mint& operator+=(const mint& m){ x+=m.x; if(x>=MOD) x-=MOD; return *this; }
	mint& operator-=(const mint& m){ x-=m.x; if(x<   0) x+=MOD; return *this; }
	mint& operator*=(const mint& m){ x=1LL*x*m.x%MOD; return *this; }
	mint& operator/=(const mint& m){ return *this*=inverse(m); }
	mint operator+(const mint& m)const{ return mint(*this)+=m; }
	mint operator-(const mint& m)const{ return mint(*this)-=m; }
	mint operator*(const mint& m)const{ return mint(*this)*=m; }
	mint operator/(const mint& m)const{ return mint(*this)/=m; }

	friend mint inverse(const mint& m){
		int a=m.x,b=MOD,u=1,v=0;
		while(b>0){ int t=a/b; a-=t*b; swap(a,b); u-=t*v; swap(u,v); }
		return u;
	}

	friend istream& operator>>(istream& is,mint& m){ long long t; is>>t; m=mint(t); return is; }
	friend ostream& operator<<(ostream& os,const mint& m){ return os<<m.x; }
	int to_int()const{ return x; }
};

mint pow(mint m,long long k){
	mint res=1;
	for(;k>0;k>>=1,m*=m) if(k&1) res*=m;
	return res;
}

int n,x,y,z;

bool trim(deque<int>& H){ // return true if H is xyz
	int sum=0,i=0;
	while(i<H.size()){
		if(sum+H[i]>x){
			if(i>0){
				sum-=H.front();
				i--;
			}
			H.pop_front();
			continue;
		}
		sum+=H[i];
		i++;
		if(sum==x) break;
	}
	if(i==H.size()) return false;

	sum=0;
	while(i<H.size()){
		if(sum+H[i]>y){
			H.pop_front();
			return trim(H);
		}
		sum+=H[i];
		i++;
		if(sum==y) break;
	}
	if(i==H.size()) return false;

	sum=0;
	while(i<H.size()){
		if(sum+H[i]>z){
			H.pop_front();
			return trim(H);
		}
		sum+=H[i];
		i++;
		if(sum==z) return true;
	}
	return false;
}

map<deque<int>,mint> memo[40][18];

mint dfs(int i,deque<int> H){
	if(i==n) return 1;

	int m=H.size();
	if(memo[i][m].count(H)==1) return memo[i][m][H];

	mint res=0;
	deque<int> H2;
	for(int a=1;a<=7;a++){
		H2.assign(H.begin(),H.end());
		H2.emplace_back(a);
		if(!trim(H2)) res+=dfs(i+1,H2);
	}
	res+=dfs(i+1,deque<int>{})*3; // 8, 9, 10
	return memo[i][m][H]=res;
}

int main(){
	cin>>n>>x>>y>>z;
	cout<<pow(mint(10),n)-dfs(0,deque<int>())<<'\n';
	return 0;
}


Measured memory_bytes: 398592
#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<set>
#include <iomanip>

#define rep0(i,N) for(int i=0;i<N;i++)
#define rep1(i,a,N) for(int i=0+a;i<N;i++)
#define lint long long int
#define SIZE 100005

using namespace std;


queue<pair<int,int>> q;
int nowh=0,noww=0;
char str[9][9];
void cal(pair<int,int> a){
	if(str[a.first][a.second+1]=='#'){
			pair<int,int> pp;
			pp.first=a.first;
			pp.second=a.second+1;
			q.push(pp);
		}
		if(str[a.first+1][a.second]=='#'){
			pair<int,int> pp;
			pp.first=a.first+1;
			pp.second=a.second;
			q.push(pp);
		}
}


int main(){
	int h,w,ans=0;
	cin>>h>>w;
	rep0(i,h){
		cin>>str[i];
	}
	rep0(i,h){
		rep0(j,w){
			if(str[i][j]=='#')
				ans++;
		}
	}
	pair<int,int> p;
	p.first=0;
	p.second=0;
	q.push(p);
	pair<int,int> cp;
	cp.first=0;
	cp.first=0;
	while(cp.first!=h-1||cp.second!=w-1){
		q.pop();
		cal(cp);
		if(q.empty()==1){
			cout<<"Impossible";
			return 0;
		}
		cp.first=q.front().first;
		cp.second=q.front().second;
	}
	if(ans==h+w-1)
		cout<<"Possible";
	else
		cout<<"Impossible";
return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int D = sc.nextInt();
		double ans = (double)N / (2 * D + 1);
		ans = Math.ceil(ans);
		System.out.println((int)ans);
		sc.close();
	}

}



Measured memory_bytes: 22996
import java.util.Scanner;

public class Main
{
  public static void main(String[] args)
  {
  	Scanner sc = new Scanner(System.in);
    float d = sc.nextInt();
    float t = sc.nextInt();
    float s = sc.nextInt();
    
    float sdash = d/t;

    if (sdash > s)
        System.out.println("No");
    else
        System.out.println("Yes");
  }

}

Measured memory_bytes: 26976
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        long H = scan.nextLong();
        List<Pair> pairs = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            Pair p = new Pair(scan.nextInt(), scan.nextInt());
            pairs.add(p);
        }
        Pair max_pair = null;
        for (Pair p : pairs) {
            if (max_pair == null) {
                max_pair = p;
                continue;
            }
            if (max_pair.a < p.a) {
                max_pair = p;
            }
        }
        List<Long> b = new ArrayList<>();
        for (Pair p : pairs) {
            if (p.b < max_pair.a) {
                continue;
            }
            b.add(p.b);
        }
        b.sort(Comparator.reverseOrder());
        long current = 0;
        long count = 0;
        long answer = (H + max_pair.a - 1) / max_pair.a;
        for (int i = 0; i < b.size(); i++) {
            current += b.get(i);
            count += 1;
            if (H <= current) {
                break;
            }
        }
        if (current < H) {
            count += (H - current + max_pair.a - 1) / max_pair.a;
        }
        answer = Math.min(answer, count);
        System.out.println(answer);
    }
    class Pair {
        long a;
        long b;
        Pair(long a, long b) {
            this.a = a;
            this.b = b;
        }
    }
}


Measured memory_bytes: 96440
N = gets.to_i

bekijousuu = [1]

(2..(1000**0.5).to_i).each do |b|
  (2..99999).each do |p|
    break if b**p>N
    bekijousuu[b**p] = b**p
  end

end
bekijousuu = bekijousuu.compact

puts bekijousuu.reverse.find {|x| x<=N }


Measured memory_bytes: 1788
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <array>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <sstream>
#include <stdio.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <list>
#include <numeric>
#include <stack>

using namespace std;

#define Rep(i,a,b) for(int i = a; i < b; i++)
#define rep(i,b) Rep(i,0,b)
#define rrep(i,a) for(int i = a; i >= 0; i--)
#define allof(a) (a).begin(), (a).end()

typedef long long ll;
const int inf = 1e9 + 7;
const ll infll = 1ll << 60ll;
const ll mod = 1e9 + 7;
// 0~3までは右左下上 4~7までは斜め
constexpr int dx[] = { 1, 0, -1, 0, 1, 1, -1, -1 };
constexpr int dy[] = { 0, -1, 0, 1, 1, -1, -1, 1 };

/*
// 最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

// 最小公倍数
ll lcm(ll a, ll b) {
	return a / gcd(a, b) * b;
}*/

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

	string s;
	cin >> s;

	int n = (int)s.size();
	int num = 0;
	rep(i, (int)s.size()) {
		if (s[i] == 'o') num++;
	}

	if (num + 15 - n >= 8) cout << "YES" << endl;
	else cout << "NO" << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
const int maxn = 200005;
const int INF = 1000000005;
typedef long long ll;
ll a[maxn];
int main()
{
    int n;
    cin >> n;
    for(int i = 1; i <= n; i++)cin >> a[i];
    ll ans = 0;
    bool flag = true;
    if(a[1] != 0)flag = false;
    for(int i = n; i >= 2; i--)
    {
        if(a[i] > a[i-1])
        {
            if(a[i]-a[i-1] != 1)flag = false;
            ans++;
        }
        else if(a[i] <= a[i-1])
        {
            ans += a[i];
        }
    }
    if(flag)cout << ans << endl;
    else cout << -1 << endl;
    return 0;
}


Measured memory_bytes: 2424
//#define __USE_MINGW_ANSI_STDIO 0
#include <iostream>
#include <bits/stdc++.h>
using namespace std;

#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;

#define boost ios::sync_with_stdio(0); cin.tie(0)

#define fi first
#define se second
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)

typedef long long ll;
typedef double ld;
typedef pair<int, int> pii;

const int N = 3000 + 5;
int MOD;

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

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

ll dp[N][N];

ll fun(int p, int c) {
	if(c < 0) return 0;
	if(p == 0) return (c == 0);
	ll &memo = dp[p][c];
	if(memo != -1) return memo;
	ll ans = (fun(p-1, c-1) + fun(p-1, c) * (c+1)) % MOD;
	return memo = ans;
}

ll fact[N], ifact[N];

void calculateFact() {

	fact[0] = 1;

	for(int i=1; i<N; i++) {
		fact[i] = (i * fact[i-1]) % MOD;
	}
	ifact[N-1] = power(fact[N-1], MOD-2, MOD);

	for(int i=N-1; i>=1; i--) {
		ifact[i-1] = (i * ifact[i]) % MOD;
	}
}

ll nck(int n, int k) {
	
	if(n < k || k < 0) return 0;

	ll ans = fact[n];
	ans = (ans * ifact[k]) % MOD;
	ans = (ans * ifact[n-k]) % MOD;

	return ans;
}

int main() {

	boost;

	int n; cin>>n>>MOD;
	calculateFact();

	memset(dp, -1, sizeof dp);

	ll ans = power(2, power(2, n, MOD-1), MOD);

	for(int i=1; i<=n; i++) {
		ll bb = power(2, power(2, n-i, MOD-1), MOD);
		ll pp = power(2, n-i, MOD);
		ll cc = 1;

		ll cnt = bb;

		for(int j=1; j<=i; j++) {
			cc = (cc * pp) % MOD;
			cnt += ((cc * fun(i, j)) % MOD * bb) % MOD;
		}
		cnt %= MOD;
		cnt = (cnt * nck(n, i)) % MOD;

		if(i & 1) ans -= cnt;
		else ans += cnt;
	}

	ans %= MOD;
	if(ans < 0) ans += MOD;

	cout<<ans<<"\n";
	
	return 0;
}

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


/// File input & output /////
#define fRead(x)        freopen("x.txt","r",stdin)
#define fWrite(x)       freopen ("x.txt","w",stdout)


#define ld              long double
#define ll              long long
#define ull             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define INF             2e16
#define PI              acos(-1.0)
#define mp              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>


#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())


#define FASTIO        ios_base::sync_with_stdio(0);cin.tie(nullptr);




///..................Sort by second element in a pair in decending order............. ///
bool SortbySecDesc(const pair<long long,long long > &a, const pair<long long,long long > &b)
{
    return a.second>b.second;
}

///.........................first element of pair in descending order..........................//////
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}



///.............................................................TEMPLATE................................................./////

int main()
{
    FASTIO;

    int n;

    cin >> n;

    string s1 , s2;



    for(int i=0; i<n; i++)
    {
        int a;

        cin >> a;

        s1 = s1 + to_string(a);
    }

    for(int i=0; i<n; i++)
    {
        int b;

        cin >> b;

        s2 += to_string(b);
    }

    if(s1==s2)
    {
        cout << 0 << endl;
        return 0;
    }



    string ans;


    for(int i=1; i<=n; i++)
    {
        ans += to_string(i);
    }

   // cout << s1 << " " << s2 << endl;


      int k = 0;

      int pos , pos1 ;


     do{

           // cout << ans << endl;
            k++;

        if(ans==s1)
        {
            pos = k;
        }
        if(ans==s2)
        {
            pos1 = k;
        }

     } while(next_permutation(ans.begin(),ans.end()));

    // cout << pos << " " << pos1 << endl;


      cout << abs(pos-pos1) << endl;



    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<map>
#include<iomanip>
#include<tuple>
#include<bitset>


using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define printfloat(x) cout << fixed << setprecision(7) << (x) << endl;
#define printbit(x) cout << bitset<15>(x) << endl;
using ll = long long int;



long double pi = 3.14159265359;

string s;
int a;

int main(){
    cin >> a;
    cin >> s;
    if(a >= 3200){
        cout << s << endl;
    }
    else cout << "red" << endl;


return 0;
}

Measured memory_bytes: 3600
def main(a: int, b: int, s: str):
    try:
        _a, _b = s.split('-')

        if a != len(_a) and b != len(_b):
            print('No')
        else:
            print('Yes')
    except ValueError:
        print('No')


if __name__ == "__main__":
    a, b = map(int, input().split())
    s = input()

    main(a, b, s)


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

#define     F       first
#define     S       second
typedef pair<int, int>  pi;
typedef long long       ll;

const int MAX=2e5+9;
int n, h[MAX];
map<int, int> freq;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    cin >> n;
    ll ans=0;
    for (int i=1; i<=n; ++i) {
        cin >> h[i];
        if (freq.find(i-h[i])!=freq.end())      ans+=freq[i-h[i]];
        ++freq[i+h[i]];
    }

    cout << ans;

    return 0;
}


Measured memory_bytes: 13764
N = int(input())
cells = [int(i) for i in input().split()]

index = N - 1
max = 0
nowRecord = 0

while index > 0:
    if cells[index-1] >= cells[index]:
        nowRecord += 1
    else:
        nowRecord = 0
    index -= 1
    if nowRecord > max:
        max = nowRecord

print(max)

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


int main() {
	int64_t MOD = 1000000000 + 7;
	int64_t N, K;
	cin >> N >> K;
	vector<int64_t> As;
	for (int64_t i = 0; i < N; ++i) {
		int64_t a;
		cin >> a;
		As.push_back(a);
	}

	int64_t ans = 0;
	for (int64_t i = 0; i < N; ++i) {
		int64_t n = 0, m = 0;
		for (int64_t j = 0; j < N; ++j) {
			if (As[i] > As[j]) {
				++m;
				if (i < j) {
					++n;
				}
			}
		}
		ans += (K * (n % MOD)) % MOD;
		ans %= MOD;
		int64_t t;
		if (K % 2 == 0) {
			t = ((K - 1) % MOD) * ((K / 2) % MOD);
		}
		else {
			t = (((K - 1) / 2) % MOD) * (K % MOD);
		}
		ans += ((t % MOD) * (m % MOD)) % MOD;
		ans %= MOD;
	}

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

Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func digits(n, k int) int {
	ret := 1
	for n > 0 {
		n /= k
		if n > 0 {
			ret++
		}
	}
	return ret
}

func main() {
	sc.Split(bufio.ScanWords)
	n, k := nextInt(), nextInt()
	puts(digits(n, k))
	wt.Flush()
}

var (
	sc  = bufio.NewScanner(os.Stdin)
	rdr = bufio.NewReaderSize(os.Stdin, 1000000)
	wt  = bufio.NewWriter(os.Stdout)
)

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(next())
	return i
}

func nextFloat64() float64 {
	f, _ := strconv.ParseFloat(next(), 64)
	return f
}

func nextInts(n int) []int {
	slice := make([]int, n)
	for i := 0; i < n; i++ {
		slice[i] = nextInt()
	}
	return slice
}

func nextFloat64s(n int) []float64 {
	slice := make([]float64, n)
	for i := 0; i < n; i++ {
		slice[i] = nextFloat64()
	}
	return slice
}

func nextMega() string {
	buf := make([]byte, 0, 1000000)
	for {
		l, p, _ := rdr.ReadLine()
		buf = append(buf, l...)
		if !p {
			break
		}
	}
	return string(buf)
}

func putf(format string, a ...interface{}) {
	fmt.Fprintf(wt, format, a...)
}

func puts(a ...interface{}) {
	fmt.Fprintln(wt, a...)
}


Measured memory_bytes: 640
import java.io.*;
import java.math.BigInteger;
import java.util.*;

public class Main {

	public static class FastReader {
		BufferedReader br;
		StringTokenizer root;
		
 
		public FastReader() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
 
		String next() {
			while (root == null || !root.hasMoreTokens()) {
				try {
					root = new StringTokenizer(br.readLine());
				} catch (Exception addd) {
					addd.printStackTrace();
				}
			}
			return root.nextToken();
		}
 
		int nextInt() {
			return Integer.parseInt(next());
		}
 
		double nextDouble() {
			return Double.parseDouble(next());
		}
 
		long nextLong() {
			return Long.parseLong(next());
		}
 
		String nextLine() {
			String str = "";
			try {
				str = br.readLine();
			} catch (Exception addd) {
				addd.printStackTrace();
			}
			return str;
		}
	}
	
	public static PrintWriter out = new PrintWriter (new BufferedOutputStream(System.out));
	
	public static FastReader sc = new FastReader();
 
	static int mod = (int) (1e9+7),MAX=(int) (3e5);
    static List<Integer>[] edges;
    static Long[][] dp;
    
	public static void main(String[] args) {
	
	    int n = sc.nextInt();
	    dp = new Long[n+1][2];
	    edges = new ArrayList[n+1];
	    for(int i=0;i<edges.length;++i) edges[i] = new ArrayList<>();
	    for(int i=1;i<n;++i) {
	    	int u = sc.nextInt();
	    	int v = sc.nextInt();
	    	edges[u].add(v);
	    	edges[v].add(u);
	    }
	    dfs(1,0);
	    long ans = (dp[1][1] + dp[1][0])%mod;
	    out.print(ans);
		out.close();
   }

	private static void dfs(int v, int par) {
		long o1=1,o2=1;
	    for(int child : edges[v]) {
	    	if(child != par) {
	    		dfs(child,v);
	    		o1 = ((o1%mod) * (dp[child][0]%mod))%mod;
	    		o2=((o2%mod)*(dp[child][0] + dp[child][1]))%mod;
	    	}
	    }
	    dp[v][1] = o1;
	    dp[v][0] = o2;
		
	}

    }



Measured memory_bytes: 72924
// BFS
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <string>
#include <cmath>
#include <queue>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define INF 1<<30

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

typedef pair<int,int> pii;
typedef pair<int,pii> P;


int main() {
  int n,m;
  while(cin >> n >> m,n||m) {
    int cx, cy;
    char ba[n+2][m+2];
    memset(ba, '.', sizeof(ba));
    for (int y=1; y<=m; ++y) {
      for (int x=1; x<=n; ++x) {
        cin >> ba[x][y];
        if (ba[x][y] == '&') {
          cx = x;
          cy = y;
        }
      }
    }
    int ans[n+2][m+2];
    memset(ans,-1,sizeof(ans));
    priority_queue<P, vector<P>, greater<P> > Q;
    Q.push(P(0,pii(0,0)));
    while(!Q.empty()) {
      P nwP = Q.top();
      Q.pop();
      pii nwp = nwP.second;
      int x = nwp.first, y = nwp.second;
      if (ans[x][y] >= 0) continue;
      //  printf("%d,%d\n",x,y);
      ans[x][y] = nwP.first;
      REP(k,4) {
        int xx = x+dx[k], yy = y+dy[k];
        if (ans[xx][yy] >= 0 || xx<0||n+2<=xx||yy<0||m+2<=yy) continue;
        if (ba[x][y] == '#' && ba[xx][yy] != '#') {
          Q.push(P(nwP.first+1, pii(xx,yy)));
        } else {
          Q.push(P(nwP.first, pii(xx,yy)));
        }
      }
    }
    // REP(y,m) {
    //   REP(x,n) {
    //     cout << ans[x+1][y+1] << "" ;
    //   }
    //   cout << endl;
    // }
    cout << ans[cx][cy] << endl;
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define int long long
#define P(x) cout << x << endl
#define D(x) P(#x << ": " << x)
#define F(i,n) for (int i=0; i<(int)(n); i++)
#define DEC(i,n) for (int i=(int)(n); --i>=0;)
#define S(s) (int)((s).size())
#define ALL(v) v.begin(), v.end()
#define MI(a,v) a = min(a,(v))
#define MA(a,v) a = max(a,(v))
#define V vector
#define pb push_back
#define mt make_tuple
using namespace std;
const int INF=1e9;

bool test() {
    int n; cin>>n;
    int a[n];
    int mi=INF, ma=0;
    F(i,n) {
        cin>>a[i];
        MI(mi,a[i]);
        MA(ma,a[i]);
    }
    if (ma-mi > 1) return false;
    if (mi == ma) {
        if (mi <= n/2) return true;
        if (mi == n-1) return true;
        return false;
    }
    int u=0;
    F(i,n) {
        if (a[i] == mi)
            u++;
    }
    int v = ma;
    //D(u), D(v);
    return (u <= n-2 && u+1 <= v && v <= u + (n-u)/2);
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout<<(test()?"Yes":"No")<<"\n";
}

Measured memory_bytes: 1024
#include <iostream>


int main() {


	std::cin.tie(nullptr); std::ios::sync_with_stdio(false);
	std::string s; std::cin >> s;
	int index_A = 0, index_Z = 0;
	for (int i = 0; i < s.size(); i++) {
		if (s[i] == 'A') {
			index_A = i;
			break;
		}
	}

	for (int i = s.size() - 1; i >= 0; i--) {
		if (s[i] == 'Z') {
			index_Z = i;
			break;
		}
	}

	std::cout << index_Z - index_A + 1;


	return 0;


}

Measured memory_bytes: 720
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <map>
#include <queue>

static const int INF = 1000000007;
using ll = long long;
using namespace std;



int main() {
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    int x = c - a, y = d-b;
    string s;
    for (int i = 0; i < x; ++i) {
        s += "R";
    }
    for (int j = 0; j < y; ++j) {
        s += "U";
    }
    for (int i = 0; i < x; ++i) {
        s += "L";
    }
    for (int j = 0; j < y; ++j) {
        s += "D";
    }
    s += "D";
    for (int i = 0; i < x+1; ++i) {
        s += "R";
    }
    for (int j = 0; j < y+1; ++j) {
        s += "U";
    }
    s += "LU";
    for (int i = 0; i < x+1; ++i) {
        s += "L";
    }
    for (int j = 0; j < y+1; ++j) {
        s += "D";
    }
    s += "R";
    cout << s << "\n";
    return 0;
}


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

namespace ABC043_C
{
    class Program
    {
        static int Sum(List<int> list, int mid)
        {
            return list.Sum(i => (i - mid) * (i - mid));
        }


        static void Main(string[] args)
        {
            Console.ReadLine();
            var A = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToList();

            var min = A.Min();
            var max = A.Max();
            var ret = 99999999;

            for (int i = min; i <= max; i++)
            {
                ret = Math.Min(ret, Sum(A, i));
            }

            Console.WriteLine(ret);
        }
    }
}


Measured memory_bytes: 13396
#include <bits/stdc++.h> //library
#define rep(i, n) for(int i = 0; i < (int)(n); i++) //for-loop (from 0)
#define reps(i,n) for(int i = 1; i <= (int)(n); i++) //for-loop (from 1)
#define all(x) (x).begin(),(x).end() //start-to-end iteration, mainly in upper_bound, lower_bound
#define SZ(x) ((int)(x).size()) //unsigned to signed

using namespace std;
using ll = long long; //long long
ll M = 1000000000 + 7;

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; } //compare a,b and replace by greater
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; } //compare a,b and replace by smaller
ll qp(int a, ll b) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a; a = 1ll * a*a; } while (b >>= 1); return ans; } //power
ll qp(int a, ll b, ll Mod = M) { int ans = 1; do { if (b & 1)ans = 1ll * ans*a%Mod; a = 1ll * a*a%Mod; } while (b >>= 1); return ans; } //power(mod)
int gcd(int a, int b) { return b ? gcd(b, a%b) : a; } //gcd
int dx[4] = { 1,0,-1,0 }; //path
int dy[4] = { 0,1,0,-1 }; //path
ll RS(ll N, ll P, ll Mod = M) { if (P == 0)return 1; else if (P % 2 == 0) { ll sq = RS(N, P / 2, Mod); return sq*sq%Mod; } else { return N*RS(N, P - 1, Mod) % Mod; } } //power(mod)(repeat-square,fast)
ll nPr(ll n, ll r, ll Mod = M) { ll ans = 1; rep(i, r) { ans = ans * (n - i) % Mod; } return ans; } //permutation
ll nCr(ll n, ll r, ll Mod = M) { ll bunbo = 1; ll bunshi = 1; rep(i, r) { bunbo = bunbo * (i + 1) % Mod; bunshi = bunshi * (n - i) % Mod; } return bunshi * RS(bunbo, Mod - 2, Mod) % Mod; } //combination

int main(void) {
  int n,k; cin >> n >> k;
  vector<int> h(n);
  rep(i,n) cin >> h[i];
  
  vector<int> dp(n);
  dp[0] = 0; dp[1] = abs(h[0]-h[1]);
  for (int i = 2; i < n; i++){
    dp[i] = M;
    for (int j = 1; j <= k; j++){
      if (i-j < 0) break;
      dp[i] = min(dp[i],dp[i-j]+abs(h[i-j]-h[i]));
    }
  }
  cout << dp[n-1] << endl;
  return 0;
}

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

ll dig(ll s){
  ll answer =0;
  while (s!=0){
    s /= 10;
    answer++;
  }
  return answer;
}

int main() {
  ll N;
  cin >> N;
  ll ans = 1e10;
  
  for (ll i=1; i*i<=N; i++){
    if(N%i == 0){
      ll B = N/i;
      ll tans = max(dig(i), dig(B));
      ans = min(ans, tans);
    }
  }
  cout << ans << endl;
  
}

Measured memory_bytes: 3636
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

int main(){

	int n, row[10][10], colume[10][10], m[10][10], block[3][3][9];

	cin >> n;
	
	for(int i=0; i<n; i++){
	
		for(int j=1; j<10; j++){
			for(int k=1; k<10; k++){
				row[j][k] = 0;
				colume[j][k] = 0;
  		  }
   		for(int k=0; k<3; k++){
	      for(int l=0; l<3; l++){
    			block[k][l][j] = 0;
    		}
  	  }
    }

		for(int j=1; j<10; j++){
			for(int k=1; k<10; k++){
				scanf("%d", &m[j][k]);
				row[j][m[j][k]]++;
				colume[k][m[j][k]]++;
				block[((j-1)-(j-1)%3)/3][((k-1)-(k-1)%3)/3][m[j][k]]++;
			}
		}

		for(int j=1; j<10; j++){
			for(int k=1; k<10; k++){
				if(row[j][m[j][k]] == 1 && colume[k][m[j][k]] == 1 && block[((j-1)-(j-1)%3)/3][((k-1)-(k-1)%3)/3][m[j][k]] == 1){
					cout << " ";
				}
				else{
					cout << "*";
				}
				cout << m[j][k];
			}
			cout << endl;
		}
		
		if(i!=n-1) cout << endl;
		
	}

	return 0;

}

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

int n;
char s[51];
int main() {
    scanf("%d %s", &n, s);
    int cnt = 0;
    for (int i = 0; i < n-2; ++i) {
        if (s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C') {
            cnt++;
        }
    }
    printf("%d\n", cnt);
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i=0;i < (int)(n);i++)


int main(){
    int n;
    string s;
    cin >> n;
    double ans=0.0;
    if (n == 1) printf("%.10f\n",double(1));
    else if (n%2 == 0) printf("%.10f\n",1.0/2.0);
    else  printf("%.10f\n",double(n-(n/2))/n);

    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

constexpr int MOD = 1000000007;

int mod(const ll &x){
    return x > 0 ? x % MOD : (x % MOD + MOD) % MOD;
}

int modm(const ll &x,const ll &m){
    return (x % MOD) * (m % MOD) % MOD;
}

int modpow(ll x, ll p) {
    int ret = 1;
    while(p > 0) {
        if (p & 1) ret = modm(ret,x);
        x = modm(x,x);
        p >>= 1;
    }
    return ret;
}

// x * modinv(d)
int modd(ll x,ll d) {
    return modm(x,modpow(d,MOD-2));
}

int main(void)
{
    IOS
    int S; cin >> S;
    vector<int> dp(S+1);
    dp[0] = 1;
    FOR(i,3,S+1) {
        dp[i] = mod(dp[i-3] + dp[i-1]);
    }
    OUT(dp[S])

    return 0;
}

Measured memory_bytes: 3592
#include<algorithm>
#include<iostream>
#include<stdio.h>
#include<iostream>
#include<stdio.h>
#include<vector>
#include<set>
#include<string>
#include<iomanip>
#include<queue>
#include<functional>
#include<cmath>
#include<map>
#include<tuple>
#define rep(i,n) for(int i=0; i<(int)n; i++)//n回繰り返す
#define rrep(i,n)for(int i=n-1;i>=0;i--)
#define REP(i,n) for (int i = 1; i <= (int)n; i++)//i=1からi=nまで
#define RREP(i,n)for(int i=n;i>=1;i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using graph = vector<vector<int>>;
const ll mod = pow(10, 9) + 7;
const int INF = 1e9;
const ll LINF = 1e18;
const double pi = 3.14159265358979323846;
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() {
    ll N; cin >> N;
    string ans;
    while (N > 26) {
        int a = N % 26;
        if (a == 0) {
            ans.push_back('z');
            N -= 26;
        }
        else {
            ans.push_back('a' + a - 1);
        }
        
        N /= 26;
    }
    int b = N;
  
 
        ans.push_back('a' + b - 1);
        reverse(ans.begin(), ans.end());
        cout << ans << endl;
    
   
}


    





















Measured memory_bytes: 3624
#include <iostream>
#include <climits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <deque>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define DEBUG false
using namespace std;

const int MAX = 100001;
const int MOD = 1000000007;

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

int ceil(int x, int y){
  return (x % y == 0) ? x / y : x / y + 1;
}

int gcd(int x, int y){
  return y ? gcd(y, x % y) : x;
}

int lcm(int x, int y){
  return x / gcd(x, y) * y;
}

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

  int n, x;
  cin >> n >> x;
  int l[n];
  for(int i = 0; i < n; i++) cin >> l[i];

  int count = 1;
  int d = 0;
  for(int i = 0; i < n; i++){
    d = d + l[i];
    if(d <= x) ++count;
  }

  cout << count << endl;

  return 0;
}


Measured memory_bytes: 256
n=int(input())
A=[]
L=[]
for i in range(n):
   a=int(input())
   A.append(a)
   D=[]
   for i in range(a):
      x,y=map(int,input().split())
      D.append((x,y))
   L.append(D)
ans=0
for i in range(2**n):
   B=[0]*n
   for j in range(n):
      if i>>j&1:
         B[j]=1
   if 1 in B:
      flag=True
      for k in range(n):
         if B[k]==1:
            for m in range(A[k]):
               if B[L[k][m][0]-1]!=L[k][m][1]:
                  flag=False
                  break
      if flag:
         ans=max(ans,sum(B))
print(ans)

Measured memory_bytes: 46828
// https://beta.atcoder.jp/contests/abc115

#define SUBMIT

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

int main() {
    int x;
    cin >> x;
    switch (x) {
        case 22:
            cout << "Christmas Eve Eve Eve";
            break;
        case 23:
            cout << " Christmas Eve Eve";
            break;
        case 24:
            cout << "Christmas Eve";
            break;
        case 25:
            cout << "Christmas";
            break;
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int n,m,x[100],a[100];
	int i,j,s;
	s=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&x[i]);
	}
	scanf("%d",&m);
	for(j=1;j<=m;j++){
		scanf("%d",&a[j]);
		s=a[j];
		if(x[s+1]!=x[s]+1){
			x[s]++;
		}
		if(x[s]>=2019){
			x[s]=2019;
		}
	}
	for(i=1;i<=n;i++){
		printf("%d\n",x[i]);
	}
	return 0;
}


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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define VI         vector<int>
#define MOD 1000000007

using ll = long long int;
using P = pair<int,int>;

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

const ll INF=(ll)1e19;
//const int INF=(1<<30);

int main(){
  double a,b,h,m;
  cin >> a >> b >> h >> m;

  double h_rad = M_PI * 2.0 * (h * 60 + m)  / 720;
  double m_rad = M_PI * 2.0 * m / 60;

  double ans = sqrt(a * a + b * b - 2.0 * a * b * cos(m_rad - h_rad));

  printf("%0.20f\n",ans);
}



Measured memory_bytes: 4248
//A - Station and Bus

#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    string s;

    cin >> s;

    if ((s == "AAA") || (s == "BBB")){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }


    return 0;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
	int k, a, b;
	cin >> k;
	cin >> a >> b;

	bool res = false;
	int i;
	for (i = a; i <= b; i++) {
		if (i % k == 0) {
			res = true;
			break;
		}
	}

	if(res)cout << "OK";
	else cout << "NG";

	return 0;
}

Measured memory_bytes: 3624
using System;

class Program {
    static void Main(string[] args) {
        var data = Console.ReadLine().Split(' ');
        var l = int.Parse(data[0]);
        var r = int.Parse(data[1]);
        long min = 2019;
        //l-rの間に2019の倍数が含まれている時
        if(r-l > 2019) {
            Console.WriteLine(0);
        } else {
            for (long i = l; i < r; i++) {
                for (long j = i + 1; j < r + 1; j++) {
                    if ((i * j) % 2019 < min) {
                        min = (i * j) % 2019;
                        if (min == 0) {
                            break;
                        }
                    }
                }
            }
            Console.WriteLine(min);
        }
    }
}


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


void solve()
{
    int a,b,c;
    cin>>a>>b>>c;
    
    if((a!=b)&&(b!=c)&&(a!=c))
    cout<<3;
    else if(((a==b)&&(b!=c))||((b==c)&&(a!=c))||((a==c)&&(b!=c)))
    cout<<2;
    else
    cout<<1;
    
    
}
int main()
{
    solve();
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;
int main() {
  int n;
  long long a, max_h=0, ans=0;
  scanf("%d", &n);
  for(int i=0;i<n;i++) {
    scanf("%lld", &a);
    if(max_h > a) {
      ans += max_h - a;
    }
    max_h = max(max_h, a);
  }
  printf("%lld", ans);
  return 0;
}

Measured memory_bytes: 1728
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
using namespace std;
const int maxn=1e5+5;
int a[maxn];
int main()
{
    int  n,x;
    long long ans=0,now=0;
    scanf("%d%d",&n,&x);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(int i=0;i<n;i++)
    {
        if(now+a[i]<=x) now=a[i];
        else
        {
            ans += now+a[i]-x;
            now=a[i]-(a[i]+now-x);
        }
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n;
    cin>>n;
    ll sum=0;
    sum+=2*(n/11);
    n%=11;
    sum+=2*(n/10);
    n%=10;
    sum+=2*(n/9);
    n%=9;
    sum+=2*(n/8);
    n%=8;
    sum+=2*(n/7);
    n%=7;
    if(n==0)
    {
    cout<<sum<<endl;
    }
    else
    {
        cout<<sum+1<<endl;
    }
    return 0;
}


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

using namespace std;

int main(){
	int N, X; cin >> N >> X;
	vector<int> t(N);
	for(int i = 0; i < N; ++i){
		cin >> t[i];
		t[i] = abs(X - t[i]);
	}
	int max_d = 0;
	for(int i = 0; i < t.size(); ++i){
		max_d = __gcd(max_d, t[i]);
	}
	cout << max_d << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <map>
#include <utility>
#include <vector>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <cstdlib>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i <= n; i++) 

ll sigma(ll n) {
    ll ans = n*(n+1)/2;
    return ans;
}


int main() {
    ll n;
    cin >> n;
    ll ans = sigma(n-1);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
/* ***********************************************
Author        :taciturnity
Created Time  :2020/2/21 8:23:51
File Name     :TEST.cpp
************************************************ */

#include <iostream>
#include <vector>
#include <queue>
#include <cstdio>
#include <map>
#include <set>
#include <stack>
#include <string>
#include <cmath>
#include <bitset>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#define ll long long
#define INF 0x3f3f3f3f
#define rep(i,x,y) for(int i = x;i <= y;++i)
#define fori(i,x,y) for(int i = x;i >= y; -- i)
#define bug puts("--------------")
#define out(x) cout<<x<<'\n';
inline char gc(){char op[2];scanf("%s",op);return op[0];}
const int N = 1e6+10;
const double eps = 0.00000001;
const ll mod = 1e9 ;
using namespace std;
ll read()
{
    ll x=0,f=1;char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
char s[N];
int main(){
    cin >> (s+1);
    if(s[3] == s[4] &&s[5] == s[6]) puts("Yes");
    else puts("No");
}

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

int h[20][20];
int dx[]{ 1,-1 }, dy[]{ -1,1 };
int main() {
	int n;
	int t = 0;
	while (scanf("%d", &n), n) {
		h[0][0] = 1;
		int x = 0, y = 1;
		int idx = 0, p = 1;
		while (p < n*n) {
			int px = x, py = y;
			while (0 <= px&&px < n && 0 <= py&&py < n) {
				h[px][py] = ++p;
				px += dx[idx]; py += dy[idx];
			}
			idx = !idx;
			if (x == 0 || y == 0) {
				if (x == n-1 && y == 0) {
					swap(x, y);
					x++;
				}
				else if (x == 0 && y == n-1) {
					swap(x, y);
					y++;
				}
				else {
					swap(x, y);
					if (x == 0)y++;
					else x++;
				}
			}
			else {
				swap(x, y);
				if (x < y)x++; else y++;
			}
		}
		printf("Case %d:\n", ++t);
		rep(i, n) {
			rep(j, n) {
				printf("%3d", h[i][j]);
			}
			printf("\n");
		}
	}
}

Measured memory_bytes: 3116
#include <bits/stdc++.h>
#ifdef LOCAL
#include "debug.h"
#define dump(...)                                                    \
    cout << "   " << string(#__VA_ARGS__) << ": "                    \
         << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" \
         << endl                                                     \
         << "   ",                                                   \
        dump_func(__VA_ARGS__)
#else
#define dump(...)
#endif

#define ll long long
#define BUF 1e5
#define INF 1 << 30
#define vi vector<int>
#define vvi vector<vector<int>>
#define all(a) (a).begin(), (a).end()
constexpr ll mod = 1e9 + 7;
using namespace std;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

signed main() {
    cin >> N;
    vi p(N);
    for (int i = 0; i < N; i++) {
        cin >> p[i];
    }
    vi sp(p);
    sort(all(sp));
    for (int i = 0; i < N; i++) {
        if (sp[i] != p[i])
            ans++;
    }
    if (ans > 2) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
    }
}

Measured memory_bytes: 256