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

#define X first
#define Y second
#define eb push_back
#define siz(a) int(a.size())
#define endl "\n"

#define trace2(x, y)             cerr <<#x<<": "<<x<<" | "<<#y<<": "<<y<< endl;
#define trace3(x, y, z)          cerr <<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl;
#define trace4(a, b, c, d)       cerr <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl;
#define trace5(a, b, c, d, e)    cerr <<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<<": "<<e<<endl;

using namespace std;

typedef long long int ll;
typedef vector < int > vi;
typedef vector < ll > vll;

const int mod=1e9+7;
const int maxn=1e6+5;

/*	finding inverse upto n
 * for i in xrange(2, N):
    ifc[i] = -(mod / i) * ifc[mod % i] % mod
 * 
*/
ll power(ll base, ll exp, ll mod){ll res = 1; while(exp){if(exp%2)res*=base;base*=base;res%=mod;base%=mod;exp/=2;}return res;}

string red, blue, str, curr;
ll n, dp[38][20];

ll go(ll idx, ll r, ll b){
	if(idx == 2*n){
		if(r == n && b == -1){
			return 1;
		}
		return 0;
	}
	
	ll &ret = dp[idx][r];
	
	if(ret != -1)
		return ret;
	
	ret = 0;
	
	if(r < n && str[idx] == curr[r]){
		ret += go(idx+1, r+1, b);
	}
	
	if(b >= 0 && str[idx] == curr[b]){
		ret += go(idx+1, r, b-1);
	}
	
	return ret;
}

int main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL); cout.tie(NULL);
	//freopen("input.in", "r", stdin);freopen("output.out", "w", stdout);	
	ll i, j;
	
	cin >> n;
	
	cin >> str;
	ll ans = 0;
	
	for(i=0; i<(1<<n); i++){
		red = "", blue = "";
		for(j=0; j<n; j++){
			if(i & (1<<j)){
				red += str[j];
			} else{
				blue += str[j];
			}
		}
	
		reverse(blue.begin(), blue.end());
		curr = red + blue;
		
		memset(dp, -1, sizeof(dp));
		
		ans += go(n, siz(red), n - siz(blue) - 1);
	}
	
	cout << ans;
	
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
  while(1){
    int e,m = 1111111;
    cin >> e; if(!e) break;
    for(int i = 0; i*i*i <= e; i++){
      int ee = e - i*i*i;
      for(int j = 0; j*j <= ee; j++){
	m = min(m,i+j+ee-j*j);
      }
    }
    cout << m << endl;
  }
}

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

int main() {
  string s;
  cin >> s;
  int n = s.size();
  if(n%2==1) cout << "No" << endl;
  else {
    bool ans = true;
    rep(i,n) {
      if(i%2 == 0) {
        if(s.at(i) != 'h') {
          ans = false;
          break;
        }
      }
      else {
        if(s.at(i) != 'i') {
          ans = false;
          break;
        }
      }
    }
    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
use std::io::Read;
use std::cmp::min;

fn main() {
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();
    s.trim();
    
    let mut count_0 = 0;
    let mut count_1 = 0;
    
    for c in s.chars() {
        if c == '0' {
            count_0 += 1;
        }
        if c == '1' {
            count_1 += 1;
        }
    }
    
    println!("{}", min(count_0, count_1) * 2);
}

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

int val(char c) {
  return (c == '#');
}

signed main() {
#ifdef _DEBUG
  freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int h, w;
  cin >> h >> w;
  vector<string> s(h + 2);
  for (int i = 1; i <= h; i++) {
    cin >> s[i];
    s[i] = "." + s[i] + ".";
  }
  for (int j = 1; j <= w; j++) {
    s[0    ] += '.';
    s[h + 1] += '.';
  }
  for (int i = 1; i <= h; i++)
  for (int j = 1; j <= w; j++) {
    if (s[i][j] == '#') continue;
    char c = '0';
    for (int k = -1; k <= 1; k++)
    for (int l = -1; l <= 1; l++) {
      if (k == 0 && l == 0) continue;
      c += val(s[i + k][j + l]);
    }
    s[i][j] = c;
  }
  for (int i = 1; i <= h; i++)
  for (int j = 1; j <= w; j++) {
    cout << s[i][j];
    if (j == w) cout << '\n';
  }
}


Measured memory_bytes: 3584
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int dp[100009];
int n,k,a[101];

int Grundy(int x){
  //cout<<x<<endl;
  int &g=dp[x];
  if(g!=-1)return g;
  if(x==0)return g=0;
  set<int>V;
  r(i,n){
    if(x>=a[i])V.insert(Grundy(x-a[i]));
  }
  g=0;
  while(V.count(g))++g;
  return g;
}
int main(){
  memset(dp,-1,sizeof(dp));
  cin>>n>>k;
  r(i,n)cin>>a[i];
  if(Grundy(k))cout<<"First"<<endl;
  else cout<<"Second"<<endl;
}

Measured memory_bytes: 13184
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		for(;T>0;T--){
			var d=ria();
			bool chk=true;
			int[] LR=new int[]{0,0};
			for(int i=0;i<d.Length;i++){
				int idx=-1;
				int max=0;
				for(int j=0;j<2;j++){
					if(LR[j]>=d[i])continue;
					if(LR[j]>=max){
						idx=j;
						max=LR[j];
					}
				}
				if(idx==-1){
					Console.WriteLine("NO");
					chk=false;
					break;
				}
				LR[idx]=d[i];
//Console.WriteLine("{0} {1}",LR[0],LR[1]);
			}
			if(chk){
				Console.WriteLine("YES");
			}
		}
		
		
	}
	int T;
	public Sol(){
		T=ri();
	}




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

Measured memory_bytes: 5328
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
typedef long long int ll;
using namespace std;
using Graph = vector<vector<int> >;

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int N;
cin>>N;
set<int> d;
rep(i,N){
    int tmp;
    cin>>tmp;
    d.insert(tmp);
}

cout<<d.size()<<endl;

//system("pause");
return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
import itertools

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines


def main():
    N = int(readline())
    P = ''.join(readline().decode().split()).rstrip()
    Q = ''.join(readline().decode().split()).rstrip()
    str_num = ''.join([str(i) for i in range(1, N+1)])
    all_list = list(itertools.permutations(list(str_num), N))
    all_list = [''.join(a) for a in all_list]
    all_list.sort()
    a = all_list.index(P)
    b = all_list.index(Q)
    print(abs(a - b))


if __name__ == '__main__':
    main()


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

namespace D___Even_Relation
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var nodes = new node[N+1];
            for(int i = 1 ; i < N+1 ; i++ ) nodes[i] = new node();
            for(int i = 0 ; i < N-1 ; i++)
            {
                var read = Array.ConvertAll(Console.ReadLine().Split(' '),int.Parse);
                nodes[read[0]].children.Add(read[1]);
                nodes[read[1]].children.Add(read[0]);
                nodes[read[0]].isCostOdd.Add(read[2] % 2 == 1);
                nodes[read[1]].isCostOdd.Add(read[2] % 2 == 1);
            }

            var queue = new Queue<node>();
            nodes[1].isOdd = false;
            queue.Enqueue(nodes[1]);
            while(queue.Count != 0)
            {
                var currentNode = queue.Dequeue();
                currentNode.visited = true;
                for(int i = 0 ; i < currentNode.children.Count;i++)
                {
                    var searchNode = nodes[currentNode.children[i]];
                    if(!searchNode.visited)
                    {
                        searchNode.isOdd = currentNode.isCostOdd[i] ^ currentNode.isOdd;
                        queue.Enqueue(searchNode);
                    }
                }
            }
            foreach(node n in nodes)
            {
                if(n == null) continue;
                Console.WriteLine(n.isOdd ? "0" : "1");
            }
        }
    }
    public class node
    {
        public bool visited{get;set;}
        public bool isOdd{get;set;}

        public List<int> children{get;set;}
        public List<bool> isCostOdd{get; set;}
        
        public node(){
            children = new List<int>();
            isCostOdd = new List<bool>();
        }
        
    }
}


Measured memory_bytes: 41388
#include<stdio.h>
#define N 100
typedef struct{
  int p,l,r;
}NODE;
int Depth(NODE *,int,int);
int Height(NODE *,int,int);
  int main(){
    int n,i,j,d,h,sum,id,l,r;
    NODE T[N];
    for(i=0;i<N;i++)
      T[i].p=-1;
    scanf("%d",&n);
    for(i=0;i<n;i++){
      scanf("%d%d%d",&id,&l,&r);
      T[l].p=id;
      T[r].p=id;
      T[id].l=l;
      T[id].r=r;
      
    }
    for(i=0;i<n;i++){
      printf("node %d: parent = %d, sibling = ",i,T[i].p);
      if(T[i].p==-1)
	printf("-1, degree = ");
      else if(T[T[i].p].l==i)
	printf("%d, degree = ",T[T[i].p].r);
      else if(T[T[i].p].r==i)
	printf("%d, degree = ",T[T[i].p].l);
      sum=0;
      if(T[i].l!=-1)
	sum++;
      if(T[i].r!=-1)
	sum++;
      printf("%d, depth = %d, height = %d, ",sum,Depth(T,i,0),Height(T,i,0));
      if(T[i].p==-1)
	printf("root\n");
      else if(sum!=0)
	printf("internal node\n");
      else
      printf("leaf\n");
      }
   
      

    return 0;
  }
int Depth(NODE T[],int i,int cnt){
  if(T[i].p==-1)
    return cnt;
  else
    return Depth(T,T[i].p,cnt+1);
}
int Height(NODE T[],int i,int cnt){
  int l=0,r=0;
  if(T[i].l==-1&&T[i].r==-1)
    return cnt;
  if(T[i].l!=-1)
    l=Height(T,T[i].l,cnt+1);
  if(T[i].r!=-1)
    r=Height(T,T[i].r,cnt+1);
  if(l>r)
    return l;
  else
    return r;
}



Measured memory_bytes: 2108
#include<iostream>
#include<iomanip>
#include<cstdlib>
#include<stdio.h>
#include<time.h>
#include<math.h>
#include<algorithm>
#include<string>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<deque>
#include<set>
#include<map>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF 1000000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
int qx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
int qy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int main(void) {
	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: 3080
#include <cstdio>

const int P = 998244353;

int N, K, fac[500005], ifac[500005];

int power(int a, int x) {
	int ans = 1;
	for (; x; x >>= 1, a = 1LL * a * a % P)
		if (x & 1) ans = 1LL * ans * a % P;
	return ans;
}
int binom(int n, int m) {
	return n < m || m < 0 ? 0 : 1LL * fac[n] * ifac[m] % P * ifac[n - m] % P;
}

int solve(int n, int m, int b) {
	return (binom(n + m, n) + P - binom(n + m, n + b)) % P;
}

int main() {
	scanf("%d%d", &N, &K);
	if (K < N) return puts("0"), 0;
	for (int i = fac[0] = 1; i <= K; ++i)
		fac[i] = 1LL * fac[i - 1] * i % P;
	ifac[K] = power(fac[K], P - 2);
	for (int i = K; i; --i)
		ifac[i - 1] = 1LL * ifac[i] * i % P;
	int ans = 0;
	for (int R = 0; R <= K; ++R) {
		int B = K - R;
		if (R < B)
			continue;
		ans = (ans + solve(R, B - (R == B), R - N + 1)) % P;
	}
	printf("%d\n", ans);
	return 0;
}


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

#define pb push_back
#define eb emplace_back
#define mk make_pair
#define fi first
#define se second

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

const int INF = 0x3f3f3f3f;
const int MAXN = 1e5 + 5;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main() {
	ios::sync_with_stdio(false); cin.tie(NULL);
	vector<int> a(3);
	cin >> a[0] >> a[1] >> a[2];
	sort(a.begin(), a.end());

	if (a[0] == a[1] && a[1] != a[2]) cout << "Yes\n";
	else if (a[1] == a[2] && a[1] != a[0]) cout << "Yes\n";
	else cout << "No\n";


	return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! p {
    ($($x:expr),*) => {
        $(println!("{:?}", $x);)*
    };
}
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
         #[allow(unused_mut)]
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input! {s:chars}
    let n = s.len();
    let mut c = vec![1; s.len()];
    for i in 0..n - 2 {
        if s[i] == 'R' && s[i + 1] == 'R' {
            c[i + 2] += c[i];
            c[i] = 0;
        }
    }
    for i in (0..n - 2).rev() {
        if s[i + 2] == 'L' && s[i + 1] == 'L' {
            c[i] += c[i + 2];
            c[i + 2] = 0;
        }
    }
    for i in c {
        print!("{} ", i);
    }
    println!("");
}


Measured memory_bytes: 4604
def main():
    s = list(input())
    n = len(s)
    acgt = ["A", "C", "G", "T"]
    ans = 0
    for i in range(n):
        for j in range(i+1, n+1):
            flag = True
            for k in s[i:j]:
                if k not in acgt:
                    flag = False
                    break
            if flag:
                ans = max(len(s[i:j]), ans)
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include <iostream>
#include <cmath>
using namespace std;
 
#define FOR(i, a, n) for(int i = a; i < n; ++i)
#define ll long long
#define sc(a) scanf("%d", &a);
#define scl(a) scanf("%lld", &a);
 
 
 
void solve() {
 
	ll a, b;
  	cin >> a >> b;
  	char c; cin >> c;
  	int d; cin >> d;
  	
  	b*=100; b+=d;
  	ll ans = a * b;
  	ans /= 100;
	printf("%lld", ans);
}
 
 
int main() {
 
	int t = 1;
	while(t--) {
		solve();
	}
 
	return 0;
 
}

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

int main() {
  int n, a = 0, b = 0;
  cin >> n;
  
  vector<int> p(n), q(n), t(n);
  for (int i = 0; i < n; ++i) {
    cin >> p[i];
    t[i] = i + 1;
  }
  for (int i = 0; i < n; ++i) cin >> q[i];
  
  int cnt = 1;
  do {
    bool flag = 1;
    for (int i = 0; i < n; ++i) {
      if (p[i] != t[i]) {
        flag = 0;
        break;
      }
    }
    if (flag) a = cnt;
    
    flag = 1;
    for (int i = 0; i < n; ++i) {
      if (q[i] != t[i]) {
        flag = 0;
        break;
      }
    }
    if (flag) b = cnt;
    ++cnt;
  } while (next_permutation(t.begin(), t.end()));
  cout << abs(a - b) << "\n";
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <math.h>
#include <bitset>
#include <cmath>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <vector>
#include <random>
using namespace std;

/////////////////////////////////////////////////////////////////////////////////////////////
using namespace std;
typedef long long  ll;
#define rep(i,s,n)for(ll i=s;i<n;i++)
#define repe(i,s,n)for(ll i=s;i<=n;i++)

int a[200001] = {};
int main()
{
    int n; cin >> n;
    repe(i, 2, n) {
        int x; cin >> x;
        a[x]++;
    }
    repe(i, 1, n) {
        cout << a[i] << endl;
    }

    return 0;
}



Measured memory_bytes: 4416
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
using ll=long long;
constexpr ll mod=1000000007;
constexpr int inf=1000000000;
constexpr ll linf=1000000000000000000;

bool dfs1(int v,int parent,int parity,const vector<vector<int>> &g,const vector<int> &num){
    if(num[v]!=-inf&&num[v]%2!=parity){
        return false;
    }
    for(int u:g[v]){
        if(u==parent)continue;
        if(!dfs1(u,v,1-parity,g,num)){
            return false;
        }
    }
    return true;
}

bool dfs2(int v,int parent,vector<int> &mn,vector<int> &mx,const vector<vector<int>> &g,const vector<int> &num){
    for(int u:g[v]){
        if(u==parent)continue;
        if(!dfs2(u,v,mn,mx,g,num)){
            return false;
        }
        mn[v]=max(mn[v],mn[u]-1);
        mx[v]=min(mx[v],mx[u]+1);
        if(mx[v]<mn[v])return false;
    }
    return true;
}

void construct(int v,int parent,vector<int> &mn,vector<int> &mx,const vector<vector<int>> &g,vector<int> &num){
    for(int u:g[v]){
        if(u==parent)continue;
        if(mn[u]<=num[v]-1){
            num[u]=num[v]-1;
        }
        else{
            num[u]=num[v]+1;
        }
        construct(u,v,mn,mx,g,num);
    }
}

int main(){
    int n;
    cin>>n;
    vector<vector<int>> g(n);
    for(int i=0;i<n-1;i++){
        int s,t;
        cin>>s>>t;
        --s,--t;
        g[s].push_back(t);
        g[t].push_back(s);
    }
    int k;
    cin>>k;
    vector<int> num(n,-inf);
    int root;
    rep(i,k){
        int v,p;
        cin>>v>>p;
        --v;
        num[v]=p;
        root=v;
    }
    if(!dfs1(root,-1,num[root]%2,g,num)){
        cout<<"No"<<endl;
        return 0;
    }
    vector<int> mn(n,-inf),mx(n,inf);
    rep(i,n){
        if(num[i]!=-inf){
            mn[i]=mx[i]=num[i];
        }
    }
    if(!dfs2(root,-1,mn,mx,g,num)){
        cout<<"No"<<endl;
        return 0;
    }
    construct(root,-1,mn,mx,g,num);
    cout<<"Yes"<<endl;
    rep(i,n)cout<<num[i]<<endl;
}


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

int main(){
	int m;
	cin >> m;
	for(int i = 0; i < m; i++){
		int start, years, n;
		cin >> start >> years >> n;
		vector<int> vec;
		for(int j = 0; j < n; j++){
			int type, commission;
			double rate;
			cin >> type >> rate >> commission;
			
			int money = start;
			if(type){
				for(int k = 0; k < years; k++){
					money = int(money + money * rate - commission);
				}
			}else{
				int r = 0;
				for(int k = 0; k < years; k++){
					r = int(r + money * rate);
					money -= commission;
				} 
				money += r;
			}
			vec.push_back(money);
		} 
		sort(vec.begin(), vec.end());

		cout << vec[n-1] << endl;

	}

	return 0;
}

Measured memory_bytes: 1260
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i = 0; i < (N); i++)
#define repo(i,N) for(int i = 1; i < (N); i++)
#define pb push_back
#define mp make_pair
#define ll long long
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
//#define num 1000000007
#define pi acos(-1.0)
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//オーバーフローに注意 long long　にする
//'1'+=16;      で大文字Aに
//'大文字'+=32;  で小文字に
//string s = to_string(int数);
//int n = stoi(string文字列);


 
int main() {

  int k,a,b;
  cin >> k >> a >> b;
  
  for(int i=a; i<=b; i++){
    if(i%k==0) {
    cout << "OK" << endl;
    return 0;
    }
  
  }
  

  cout << "NG" << endl ;     //小文字だったら直す


}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define SZ(v) int((v).size())
#define ALL(vec) (vec).begin(),(vec).end()
typedef long long i64;
template<typename T> inline bool uax(T &x, T y) {return (y > x) ? x = y, true : false;}
template<typename T> inline bool uin(T &x, T y) {return (y < x) ? x = y, true : false;}
#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); \
  stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
string to_string(char c) { return "'" + string(1, c) + "'";}
string to_string(string s) { return '"' + s + '"';}
string to_string(const char* s) { return to_string((string) s);}
template<typename A> string to_string(A);
template<typename A, typename B> string to_string(pair<A, B> p){
  return "(" + to_string(p.first) + ": " + to_string(p.second) + ")";}
template<typename A> string to_string(A v) {bool f = false; string r = "{"; 
  for (auto x: v) {if (f) r += ", "; r += to_string(x); f = true;} return r += "}";}
template<typename A> string to_string(vector<vector<A>> v) {string r; 
  for (auto x: v) r += "\n" + to_string(x); return r;}
void err(istream_iterator<string>) {}
template<typename T,typename... Args> void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " =: " << to_string(a) << endl; err(++it, args...); }
template<typename T> void kek(T ans) {cout << ans << endl; exit(0);}
int const MOD = 1e9 + 7;
long long const INF = 1e18;
/***********************************************************************/

int32_t main() {
 
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
 
  int r;
  cin >> r;
  kek(3 * r * r);
    
  return 0;
}


Measured memory_bytes: 892
#include<bits/stdc++.h>
        using namespace std;
        int main(){
          int n,m;
          cin>>n>>m;
          int a[n];
          bool dp[m+1]={0};
          for(int i=0;i<n;i++)cin>>a[i];
          for(int i=1;i<=m;i++){
          	for(int j=0;j<n;j++){
            	if(i>=a[j]&&!dp[i-a[j]])
                {  dp[i]=true;
                 	break;
                }	
            }
          }
          if(dp[m])
            cout<<"First"<<endl;
          else
            cout<<"Second"<<endl;
        }

Measured memory_bytes: 3720
#include <iostream>
#include <cstdio>
#include <cstring>
#include <stack>
using namespace std;

int N, M, A, B[5010][210], l[5010], r[5010];
long long f[5010][5010], dis[5010], ans;
		stack<pair<int, int> >s;

int main(){
	scanf("%d%d", &N, &M);
	for(int i=1; i<N; i++){
		scanf("%d", &A);
		dis[i+1]=dis[i]+1LL*A;
	}
	for(int i=1; i<=N; i++)
		for(int j=1; j<=M; j++){
			scanf("%d", &B[i][j]);
		}
	for(int i=1; i<=M; i++){
		s.push(make_pair(B[1][i], 1));
		for(int j=2; j<=N; j++)
			if(B[j][i]<s.top().first)
				s.push(make_pair(B[j][i], j));
			else{
				while(!s.empty() && s.top().first<=B[j][i]){
					r[s.top().second]=j;
					s.pop();
				}
				s.push(make_pair(B[j][i], j));
			}
		while(!s.empty()){
			r[s.top().second]=N+1;
			s.pop();
		}
		s.push(make_pair(B[N][i], N));
		for(int j=N-1; j; j--)
			if(B[j][i]<=s.top().first)
				s.push(make_pair(B[j][i], j));
			else{
				while(!s.empty() && s.top().first<B[j][i]){
					l[s.top().second]=j;
					s.pop();
				}
				s.push(make_pair(B[j][i], j));
			}
		while(!s.empty()){
			l[s.top().second]=0;
			s.pop();
		}
		for(int j=1; j<=N; j++)
			f[l[j]+1][j]+=1LL*B[j][i], f[j+1][r[j]]+=1LL*B[j][i], 
			f[l[j]+1][r[j]]-=1LL*B[j][i], f[j+1][j]-=1LL*B[j][i];
	}
	for(int i=1; i<=N; i++)
		for(int j=1; j<=N; j++)
			f[i][j]+=f[i-1][j]+f[i][j-1]-f[i-1][j-1];
	for(int i=1; i<=N; i++)
		for(int j=i; j<=N; j++)
			ans=max(ans, f[i][j]-dis[j]+dis[i]);
	printf("%lld", ans);
	return 0;
}

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

int64_t N;
vector<int64_t>vec(50);
bool solve(int64_t i, int64_t m) {
    if (m == 0) {
        return true;
    } else if (i >= N) {
        return false;
    }

    return solve(i+1, m) || solve(i+1, m-vec[i]);
}

int main()
{
    int64_t Q;
    cin >> N;
    for (int i=0; i < N; i++) {
        cin >> vec.at(i);
    }

    cin >> Q;
    for (int i=0; i < Q; i++) {
        int64_t m;
        cin >> m;
        if (solve(0, m)) {
            cout << "yes" << endl;
        } else {
            cout << "no" << endl;
        }
    }

    return 0;
}


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

          using namespace std;
          typedef long long ll;
          int n, m, s;
int arp[323];
          int main()
          {
            cin >> n >> m;
            for(int i = 1; i < n; i++)
              s += i;
            for(int i = 1; i < m; i++)
              s += i;
            cout << s;    
          }

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long int LL;
typedef unsigned long long int ULL; 
typedef long double dd; 
#define endl "\n"
int dx[4]={1,-1,0,0};
int dy[4]={0,0,-1,1};
//LL dp[2000001];
LL mod=1e9+7;
bool vis[100000];
using namespace std;
bool isPrime(LL n) {
  LL j; 
  for( j=2;j<=sqrt(n);j++){
    if(n%j==0){
      break;  
    } 
  }
  if(j>sqrt(n)){
    return 1; 
  }
  else{
    return 0; }
}
LL modexpo(LL a, LL b) {
  LL ans=1;
  a=a%mod;
  while(b>0){
    if((b&1)==1){
      ans=((ans%mod)*(a%mod))%mod;
    }
    b=b>>1;
    a=((a%mod)*(a%mod))%mod;
  }
  return ans; 
}
LL invmod(LL n){
  return modexpo(n,mod-2);
}

LL comb(LL n,LL r){
  if(r==0){
    return 1;
  }
  LL fact[n+1];
  fact[0] = 1; 
    for (LL i = 1; i <= n; i++){
       fact[i] = (fact[i - 1] * i) %mod;}
    return (fact[n] * invmod(fact[r]) % mod * invmod(fact[n - r]) % mod) %mod; 
}
LL gcd(LL a, LL b) {
  if (a == 0){
       return b;
       }  
    return gcd(b % a, a);  
}
LL lcm(LL a, LL b) {
  return (a*b)/gcd(a,b);
}
void solve(LL k){
  LL n; 
  cin>>n; 
  while(n--){
    cout<<"ACL";
  }
}
int main(){
  ios_base::sync_with_stdio(false);
    cin.tie(NULL); 
 LL t=1;
//cin>>t;
 LL k=1;
while(k<=t){
   solve(k);
  k++;
  }
   return 0;
   }

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

using namespace std;
using ll = long long;
using ld = long double;

int main() {
    ios_base::sync_with_stdio(0);
    cout.tie(0); cin.tie(0);
    ll n, W;
    cin >> n >> W;
    vector<ll> w(n), p(n);
    vector<vector<ll>> dp(n, vector<ll>(W + 1));
    for (int i = 0; i < n; i++) {
        cin >> w[i] >> p[i];
    }
    if (w[0] <= W) {
        dp[0][w[0]] = p[0];
    }
    for (int i = 1; i < n; i++) {
        for (int j = 0; j <= W; j++) {
            dp[i][j] = dp[i - 1][j];
            if (j - w[i] >= 0) {
                dp[i][j] = max(dp[i][j], dp[i - 1][j - w[i]] + p[i]);
            }
        }
    }
    cout << *max_element(dp[n - 1].begin(), dp[n - 1].end());
}


Measured memory_bytes: 79488
#include <iostream>
#include <string>
#include <vector>
#include <list>
#include <map>
#include <algorithm>
using namespace std;

#define LOOP(i,first,end) for(int i=(first);i<(end);i++)
#define ULL unsigned long long
#define LL long long
#define VULL vector<ULL>
#define VLL vector<LL>
#define VINT vector<int>

int main(void){
	map<int, int> count;

	string s;

	cin >> s;

	LOOP(i, 0, 4){
		count[s[i]]++;
	}
	if (count.size() == 2 && (*count.begin()).second == 2)cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
using namespace std;
const int MAXN=100010;
int get()
{
	int x;bool f=0;char c;
	while (!isdigit(c=getchar())) if (c=='-') f=1;
	x=c-48;
	while (isdigit(c=getchar())) x=(x<<1)+(x<<3)+c-48;
	if (f) return -x;else return x;
}
int N,A[MAXN];
struct Number
{
	int x,v;
	bool operator < (const Number &a) const {return v>a.v;}
}B1[MAXN],B2[MAXN];
int main()
{
	N=get();
	int Max=0;
	for (int i=1;i<=N;++i)
	{
		A[i]=get();
		Max=max(Max,A[i]);
	}
	for (int i=1;i<=N;++i)
		if (i&1) B1[A[i]].x=A[i],B1[A[i]].v++;
		else B2[A[i]].x=A[i],B2[A[i]].v++;
	sort(B1+1,B1+1+Max);
	sort(B2+1,B2+1+Max);
	if (B1[1].x!=B2[1].x) printf("%d\n",N-B1[1].v-B2[1].v);
	else printf("%d\n",N-max(B1[1].v+B2[2].v,B1[2].v+B2[1].v));
	return 0;
} 

Measured memory_bytes: 2176
#include <iostream>
int main(){int n,m,i,a,b,c[51]={};for(std::cin>>n>>m,i=0;i<m;++i){std::cin>>a>>b;++c[a];++c[b];}for(i=1;i<n+1;++i)std::cout<<c[i]<<"\n";}

Measured memory_bytes: 256
import java.util.Scanner;
import java.lang.Character;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();

        for (int i = 0; i < line.length(); i++) {
            char tmp = line.charAt(i);
            if(Character.isUpperCase(tmp)) {
                tmp = Character.toLowerCase(tmp);
            } else if (Character.isLowerCase(tmp)) {
                tmp = Character.toUpperCase(tmp);
            }
            System.out.print(tmp);
        }
        System.out.println();
    }
}


Measured memory_bytes: 26788
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define pii pair<int,int>
using namespace std;

int main(){
	int n;
	cin>>n;
	
	vector<pair<string,pii > > v(n);
	REP(i,n){
		string s;
		int p;
		cin>>s>>p;
		v[i]=make_pair(s,make_pair(-1*p,i+1));
	}
	
	sort(ALL(v));
	
	REP(i,n){
		cout<<v[i].second.second<<endl;
	}
}//復習.解説参考.

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

vector<vector<int>> xy;
vector<int> dp;
vector<bool> reached;

void dfs (int u) {
  if (reached.at(u)) return;
  reached.at(u) = true;
  for (int v : xy.at(u)) {
    dfs(v);
    dp.at(u) = max(dp.at(u), dp.at(v) + 1);
  }
}

int main() {
  int N, M;
  cin >> N >> M;

  xy.resize(N);
  dp.resize(N, 0);
  reached.resize(N, false);

  for (int i = 0; i < M; i++) {
    int x, y;
    cin >> x >> y;
    x--;
    y--;

    xy.at(x).push_back(y);
  }

  int ans = 0;
  for (int i = 0; i < N; i++) {
    dfs(i);
    ans = max(ans, dp.at(i));
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 8192
#include <bits/stdc++.h> 
using namespace std; 
typedef long long ll;
int main()
{
    ll n,p=0,u,v,q=0,i,r;
    cin>>n;
    string s;
    cin>>s;
    ll a[2][n];
    for(i=0;i<n;i++)
    {
        a[0][i]=0;
        a[1][i]=0;
    }
    for(i=0;i<n;i++)
    {
        if(s[i]=='E')
        {
            p++;
            a[0][i]=p;
            a[1][i]=q;
        }
        if(s[i]=='W')
        {
            q++;
            a[1][i]=q;
            a[0][i]=p;
        }
    }
    r=n;
   
    for(i=0;i<n;i++)
    {
        if(i==0)
        {
            u=p-a[0][i];
            v=0;
            if(r>u+v)
            {
                r=u+v;
            }
        }
        else
        {
            u=p-a[0][i];
            v=a[1][i-1];
            if(r>u+v)
            {
                r=u+v;
            }
        }
    }
    cout<<r<<endl;
}

Measured memory_bytes: 5380
#include<bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pil pair<int,ll>
#define pli pair<ll,int>
#define mod 1000000000
#define mp make_pair
#define pb push_back
#define ff first
#define ss second
#define pi 3.14159
ll power(ll a,int n){
  if(n==0)
    return 1;
  if((n%2)==0)
    return power(a*a,n/2);
  else
    return a*power(a*a,n/2);    
}
vector<bool> mark;
void seive(ll N){
    mark.resize(N+1);
  for(ll i=2;i*i<=N;i++){
    if(!mark[i]){
       for(ll j=i*i;j<=N;j+=i){
         mark[j]=1;
       }
      }
  }
}
//vector<int> a1(150002),a2(150002);
int main(){
FASTIO
int n,m,x;
cin>>n>>m>>x;
vector<int> c(n);
vector<vector<int> > a(n,vector<int>(m));
for(int i=0;i<n;i++){
  cin>>c[i];
  for(int j=0;j<m;j++){
    cin>>a[i][j];
  }
}
int p=power(2,12);
int ans=-1;
for(int i1=1;i1<=p;i1++){
  vector<int> v(m);
  int ct=0;
  for(int i=0;i<n;i++){
    if((i1)&(1<<i)){
      ct+=c[i];
      for(int j=0;j<m;j++){
          v[j]+=a[i][j];
      }
    }
  }
  bool is=true;
  for(int j=0;j<m;j++){
    if(v[j]<x){
      is=false;
      break;
    }
  }
  if(is){
    if(ans==-1)
      ans=ct;
    else
      ans=min(ans,ct);
  }
}
cout<<ans;
return 0;
}


Measured memory_bytes: 3668
#include <bits/stdc++.h>
using namespace std;
#define reps(i, a, n) for (int i = (a); i < (n); ++i)
#define rep(i, n) reps(i, 0, n)
#define deps(i, a, n) for (int i = (a); i >= (n); --i)
#define dep(i, n) deps(i, n, 0)
#define inf 2147483647
#define int long long

signed main(void)
{
	int n; cin >> n;
	int a[100005];
	rep (i, n) cin >> a[i];

	int gl[100005], gr[100005];
	gl[0] = 0, gl[1] = a[0];
	gr[n - 1] = 0, gr[n - 2] = a[n - 1];
	reps (i, 2, n)
	{
		gl[i] = __gcd(gl[i - 1], a[i - 1]);
		gr[n - i - 1] = __gcd(gr[n - i], a[n - i]);
	}
	//rep (i, n) cout << gl[i] << ", " << gr[i] << endl;

	int ans;
	ans = gl[n - 1] > gr[0] ? gl[n - 1] : gr[0];
	reps (i, 1, n - 1)
	{
		int tmp;
		tmp = __gcd(gl[i], gr[i]);
		if (tmp > ans) ans = tmp;
	}
	cout << ans << endl;
}


Measured memory_bytes: 5916
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;
import java.util.HashMap;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        DBannedK solver = new DBannedK();
        solver.solve(1, in, out);
        out.close();
    }

    static class DBannedK {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            int[] a = new int[n];
            Arrays.setAll(a, i -> in.nextInt());
            HashMap<Integer, Integer> map = new HashMap<>();
            for (int i = 0; i < n; i++) {
                if (map.containsKey(a[i])) {
                    map.put(a[i], map.get(a[i]) + 1);
                } else {
                    map.put(a[i], 1);
                }
            }
            long sum = 0;
            for (int e : map.values()) {
                sum += (long) e * (e - 1) / 2;
            }
            long[] ans = new long[n];
            for (int i = 0; i < n; i++) {
                int v = map.get(a[i]);
                out.println(sum - v + 1);
            }
        }

    }
}



Measured memory_bytes: 88164
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
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(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    ll d;
    cin >> n >> d;
    int ans = 0;
    rep(i,n){
        ll x, y;
        cin >> x >> y;
        if(d*d >= x*x+y*y) ++ans;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3652
/* Bismillahirrahmanirrahim */
/* Author : Jehian Norman Saviero (@Reiva5) */
#include <bits/stdc++.h>

// MACROS SAMPAH
#define Jehian using
#define Norman namespace
#define Saviero std

Jehian Norman Saviero;

// MACROS TYPE
typedef long l;
typedef long long ll;
typedef unsigned long ul;
typedef unsigned long long ull;
typedef double ld;
typedef pair<int,int> pi;
typedef pair<l,l> pl;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<l> vl;
typedef vector<ll> vll;

// MACROS FOR PRINT
#define nl printf("\n")
#define sp printf(" ")

// MACROS FOR ATTRIBUTE
#define fi first
#define se second

// MACROS FOR FUNCTION AND METHOD
#define eb emplace_back
#define mp make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define ALL(x) (x).begin(), (x).end()
#define ALLN(x,n) (x), (x)+(n)
#define CUBE(x) (SQR(x)*(x))
#define SET(x,y) for (int _qwe = sizeof(x)/sizeof(x[0]); _qwe; ) x[--_qwe] = (y)
#define SQR(x) ((x)*(x))
#define SSORT(x,sz) sort(ALLN(x,sz))
#define RESET(x) memset((x), 0, sizeof(x))
#define VSORT(x) sort(ALL(x))

// MACROS READ INPUT
#define sci(x) scanf("%d", &x)
#define scl(x) scanf("%ld", &x)
#define scll(x) scanf("%lld", &x)
#define scul(x) scl(x)
#define scull(x) scll(x)

int main() {
	string S;
	int K;
	cin >> S;
	cin >> K;
	int idx = 0;
	while (K > 0) {
		if (S[idx] == '1') {
			--K;
			++idx;
		} else {
			cout << S[idx] << endl;
			return 0;
		}
	}
	cout << S[idx-1] << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
signed main(){
  stack<int> a,q;
  string b;
  int c=0;
  cin>>b;
  for(int i=0;i<b.size();i++){
    if(b[i]!='B') c++,a.push(b[i]);
    else if(c!=0) c--,a.pop();
  }
  for(int i=0;i<c;i++){
    q.push(a.top()-48);
    a.pop();
  }
  for(int i=0;i<c;i++){
    cout<<q.top();
    q.pop();
  }
  cout<<"\n";
}

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

int main() {
    int x, y;

    while ( cin >> x >> y) {
        if (x == 0 && y == 0) {
            return 0;
        } else if ( x >= y) {
            cout << y << " " << x << endl;
        } else {
            cout << x << " " << y << endl;
        } 
    }
}


Measured memory_bytes: 3100
#include<stdio.h>
#include<math.h>

int main ()
{
   int a,b,c,s,A;
   scanf("%d%d%d",&a,&b,&c);
   s=(a+b+c)/2;
   A=sqrt(s*(s-a)*(s-b)*(s-c));
   printf("%d",A);


    return 0;
}

Measured memory_bytes: 128
import java.io.*;
import java.util.*;
import java.util.function.*;

final class Solver {
	void solve(Supplier<String> sc) {
		int D = Integer.parseInt(sc.get());
		int[] C = new int[26];
		Arrays.setAll(C, $ -> Integer.parseInt(sc.get()));
		var S = new int[D][26];
		for (int i = 0; i < D; i++) {
			int[] row = S[i];
			Arrays.setAll(row, $ -> Integer.parseInt(sc.get()));
		}

		int[] result = new int[D];
		for (int i = 0; i < D; i++) {
			int max = -1;
			for (int j = 0; j < S[i].length; j++) {
				if (max < S[i][j]) {
					max = S[i][j];
					result[i] = j;
				}
			}
		}

		for (int value : result) {
			System.out.println(value + 1);
		}
	}

	void judge(Supplier<String> sc){
		int D = Integer.parseInt(sc.get());
		int[] C = new int[26];
		Arrays.setAll(C, $ -> Integer.parseInt(sc.get()));
		var S = new int[D][26];
		for (int i = 0; i < D; i++) {
			int[] row = S[i];
			Arrays.setAll(row, $ -> Integer.parseInt(sc.get()));
		}
		int[] T = new int[D];
		Arrays.setAll(T, $ -> Integer.parseInt(sc.get()) - 1);

		var currentSatisfaction = 0;
		var last = new int[26];
		for (int i = 0; i < D; i++) {
			last[T[i]] = i + 1;
			currentSatisfaction += S[i][T[i]];
			for (int j = 0; j < 26; j++) {
				currentSatisfaction -= C[j] * (i + 1 - last[j]);
			}
			System.out.println(currentSatisfaction);
		}
	}
}

class Main {
	public static void main(String... args) {
		System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		var reader = new BufferedReader(new InputStreamReader(System.in));
		new Solver().judge(new Supplier<>() {
			StringTokenizer line;

			public String get() {
				while (line == null || !line.hasMoreTokens()) try {
					line = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
				return line.nextToken();
			}
		});
		System.out.flush();
	}
}

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

int main()
{
    int a, b, x;
    cin >> a >> b >> x;
    if(a <= x && x <= a+b){
        cout << "YES" << endl;
    }
    else{
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#define buf 1000001

int main(void){
	int i,j,a,c,d,cnt=0,b[buf],left,right,mid,key;
	scanf("%d",&a);
	for(i=0;i<a;i++)
		scanf("%d",&b[i]);
	scanf("%d",&c);
	for(j=0;j<c;j++){
		scanf("%d",&d);
		left = 0;
		right = a;
		while(left < right){
			mid = (left + right)/2;
			if(b[mid] == d){
				cnt++;
				break;
			}
        		else if(d < b[mid])
            			right = mid;
        		else if(d > b[mid])
            			left = mid+1;
    		}
	}
	printf("%d\n",cnt);
	return 0;
}
 

 
		

Measured memory_bytes: 2652
#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define shalaby ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);cerr.tie(0);
#define mod 100000000
using namespace std;

inline int D()
{
    int t;
    scanf("%d",&t);
    return t;
}
inline ll llD()
{
    ll t;
    scanf("%lld",&t);
    return t;
}
 ll Max=1e18+8;
const int OO=-1e6;
int xt[4]= {1,0,0,-1};
int yt[4]= {0,1,-1,0};
////////////////////////////////////////////////////////////////////////////////////

ll mem[100005],a[100005],n,m;
bool valid(int x,int y)
{
    return x>-1 && y>-1 && x<n && y<m;
}
void init()
{
    memset(mem,-1,sizeof mem);
}
/////////////////////////////////////////////////////////////////////
ll solve(int i=n-1)
{
    if(i<0)
        return Max;
        if(i==0)
            return 0;

    ll &ret=mem[i];
    if(~ret)return ret;
    return ret=min((solve(i-1)+abs(a[i]-a[i-1])),(solve(i-2)+abs(a[i]-a[i-2])));
}

int main()
{
    init();
    int T=1;
///   T=D();
    while(T-->0)
    {
        cin >> n ;
        for(int i=0; i<n; i++)
        {
            cin >> a[i];
        }
        cout << solve();
    }
}


Measured memory_bytes: 7496
/// Rustで競技プログラミングの入力をスッキリ記述するマクロ
///
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        n: usize,
        m: usize,
        q: usize,
        lr_a: [[usize; 2]; m],
        pq_a: [[usize; 2]; q],
    }

    let mut lr_map = vec![vec![0; n+1]; n+1];

    for lr in &lr_a {
        lr_map[lr[0]][lr[1]] += 1;
    }

    for y in 0..n+1 {
        let mut sum = 0u64;
        for x in 0..n+1 {
            sum += lr_map[y][x];
            lr_map[y][x] = sum;
        }
    }

    for x in 0..n+1 {
        let mut sum = 0u64;
        for y in 0..n+1 {
            sum += lr_map[y][x];
            lr_map[y][x] = sum;
        }
    }

    for pq in pq_a.iter() {
        let p = pq[0];
        let q = pq[1];

        let ans = lr_map[q][q] - lr_map[p-1][q] - lr_map[q][p-1] + lr_map[p-1][p-1];
        println!("{}", ans);
    }
}


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

using namespace std;

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

    vector<bool> is_prime(n+3, true);
    
    is_prime[1] = false;
    for(int i=2;i<=n+2;i++){
        if(!is_prime[i]) continue;
        for(int j=2*i;j<=n+2;j+=i){
            is_prime[j] = false;
        }
    }

    long long int ans = 0LL;
    for(int i=3;i<=n;i+=2){
        if(is_prime[i] && is_prime[i+2]){
            ans += 2LL;
        }
    }

    cout << ans << endl;
}


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

int main(void) {
	int n;
	int h[100010];
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> h[i];
	}
	int a = 0;
	for (int i = 0; i < n; i++) {

		if (a > h[i]) {
			cout << "No";
			return 0;
		}else if (a < h[i]) {
			h[i]--;
			a = h[i];
		}
		else {
			a = h[i];
		}
	}
	cout << "Yes";
	return 0;
}

Measured memory_bytes: 640
# ContestName
# URL
import sys
import numpy as np

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    N, M, C = i2nn()
    B = i2nn()
    A = ii2nnn(N)
    A, B = np.array(A), np.array(B)
    n = 0
    for i in range(N):
        if np.dot(A[i,:], B) + C > 0:
            n += 1
    print(n)

main()


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

using namespace std;

string getCode(string s)
{
  static string VOWEL = "aiueo";
  string code = "";
  code += s[0];
  for(int i = 1; i < s.size(); i++) {
    if(VOWEL.find(s[i-1]) != string::npos) code += s[i];
  }
  return code;
}

int identifiableCodeLength(int n, string s[])
{
  int maxLen = -1;
  for(int i = 0; i < n; i++) {
    s[i] = getCode(s[i]);
    maxLen = max(maxLen, (int)s[i].size());
  }
  for(int len = 1; len <= maxLen; len++) {
    set<string> codes;
    for(int i = 0; i < n; i++) {
      string code = s[i].substr(0, min(len, (int)s[i].size()));
      if(codes.find(code) == codes.end()) {
	codes.insert(code);
      } else {
	break;
      }
    }
    if(codes.size() == n) return len;
  }
  return -1;
}

int main()
{
  int n;
  while(cin >> n, n) {
    string s[55];
    for(int i = 0; i < n; i++) cin >> s[i];
    cout << identifiableCodeLength(n, s) << endl;
  }
  return 0;
}

Measured memory_bytes: 1236
// abc131a.cpp : Security
#include <bits/stdc++.h>
using namespace std;
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))
#define in(x) cin>>(x)
#define ote(x) cout<<(x)<<endl

int main(){
  string s; in(s);
  bool f = false;
  char c0= s[0];
  up(i,1,s.length(),1){
    char c1 = s[i];
    if(c0==c1){
      f = true;
      break;
    }
    c0 = c1;
  }
  ote(f?"Bad":"Good");
}

Measured memory_bytes: 256