akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <cmath>
#include<cstdio>
#include<iomanip>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <limits>
#include <set>
#include <map>
#include <bitset>

struct Comment
{
    int x{};
    int y{};
};

bool verify(
    const std::bitset<32>& bits,
    const std::vector<std::vector<Comment>>& allComments)
{
    for (size_t i = 0; i < allComments.size(); i++) {
        if (!bits[i]) continue;
        for (const auto& comment : allComments[i]) {
            if (bits[comment.x] != comment.y) {
                return false;
            }
        }
    }
    return true;
}

int main()
{
    int n{};
    std::cin >> n;
    std::vector<std::vector<Comment>> allComments(n);
    for (int i = 0; i < n; i++) {
        int a{};
        std::cin >> a;
        for (int j = 0; j < a; j++) {
            int x{}, y{};
            std::cin >> x >> y;
            allComments[i].emplace_back(Comment{x - 1, y});
        }
    }

    size_t result{};
    for (int i = 0; i < (1 << n); i++) {
        const std::bitset<32> bits(i);
        if (verify(bits, allComments)) {
            result = std::max(result, bits.count());
        }
    }

    std::cout << result << std::endl;
    return 0;
}


Measured memory_bytes: 256
n, m = gets.split(" ").map(&:to_i)
array_ac = Array.new(n,0)
array_wa = Array.new(n,0)
ac =0
wa = 0

m.times do
    a, b = gets.chop.split
    a = a.to_i

    if b == "WA" && array_ac[a-1] == 0
        array_wa[a-1] += 1
    elsif b == "AC" && array_ac[a-1] == 0
        ac += 1
        wa += array_wa[a-1]
        array_ac[a-1] = 1
    end
end

puts "#{ac} #{wa}"


Measured memory_bytes: 3452
import java.util.Scanner;


public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		   
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    int C = scanner.nextInt();
		    
		    if(A <= C && B <= C)
		    {
		    	System.out.println(A + B);
		    }
		    else if(A <= B && C <= B)
		    {
		    	System.out.println(A + C);
		    }
		    else
		    {
		    	System.out.println(C + B);
		    }
		    scanner.close();}
		  }

Measured memory_bytes: 21844
eval"N,K,*A,C=#{`tr ' 
' ,`}1"
j=M=10**9+7
A.sort!
p (K..N).sum{|i|C.*A[i-1]-A[-i]+0*C=C*i*(j+=1).pow(M-2,M)%M}%M
####################################################################################################

Measured memory_bytes: 28112
#include <cstdio>
#include <iostream>
#include <cmath>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <cstdlib>
#include <map>
#include <queue>
#include <utility>
#include <vector>
#include <set>
#include <memory.h>
#include <iomanip>
#include <bitset>
#include <list>
#include <stack>
#include <deque>
#include <numeric>

using namespace std;

#define mod 1000000007

int h, w;
char s[20][20];

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

int getresult(int sx, int sy){

	int ans = 0;

	vector<vector<int> > cost(h, vector<int>(w, -1));
	cost[sx][sy] = 0;
	queue<pair<int, int> > qu;
	qu.push(make_pair(sx, sy));

	while(!qu.empty()){
		int x = (qu.front()).first;
		int y = (qu.front()).second;
		qu.pop();

		for(int i = 0; i < 4; i++){
			int nx = x + dx[i];
			int ny = y + dy[i];
			if(nx < 0 || ny < 0 || nx >= h || ny >= w || s[nx][ny] == '#' || cost[nx][ny] >= 0) continue;
			cost[nx][ny] = cost[x][y] + 1;
			ans = max(ans, cost[nx][ny]);
			qu.push(make_pair(nx, ny));
		}
	}
	return ans;
}

int main()
{
	cin >> h >> w;
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			cin >> s[i][j];
		}
	}
	int ans = 0;
	for(int i = 0; i < h; i++){
		for(int j = 0; j < w; j++){
			if(s[i][j] == '#') continue;
			ans = max(ans, getresult(i, j));
		}
	}
	cout << ans << endl;
}

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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define FORR(i, m, n) for (int i = (m); i >= (n); i--)
#define REP(i, n) FOR(i, 0, (n))
#define REPR(i, n) FORR(i, (n) - 1, 0)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;
const int INF = 1000000001;

void solve();

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    solve();
    return 0;
}

void solve() {
    string s;
    int k;
    cin >> s >> k;
    string u = s + s + s + s;
    ll ua = 0;
    bool c = true;
    char p = '_';
    REP(i, u.size()) {
        if (u[i] == p) {
            if (c) {
                ua++;
                c = false;
            } else {
                c = true;
            }
        } else {
            c = true;
        }
        p = u[i];
    }
    string t = s + s;
    ll ta = 0;
    c = true;
    p = '_';
    REP(i, t.size()) {
        if (t[i] == p) {
            if (c) {
                ta++;
                c = false;
            } else {
                c = true;
            }
        } else {
            c = true;
        }
        p = t[i];
    }

    ll sa = 0;
    c = true;
    p = '_';
    REP(i, s.size()) {
        if (s[i] == p) {
            if (c) {
                sa++;
                c = false;
            } else {
                c = true;
            }
        } else {
            c = true;
        }
        p = s[i];
    }
    
    if (ua != ta * 2) {
        ll xa = 0;
        c = true;
        p = '_';
        REP1(i, s.size() - 2) {
            if (s[i] == p) {
                if (c) {
                    xa++;
                    c = false;
                } else {
                    c = true;
                }
            } else {
                c = true;
            }
            p = s[i];
        }
        cout << (k - 1) + xa * k << endl;
    } else {
        cout << ta * (k / 2) + sa * (k % 2) << endl;
    }

}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a[][] = new int[100][100];
		int b[] = new  int[100];
		int c[] = new int [100];

		int n,m;
		n = sc.nextInt();
		m = sc.nextInt();

		for(int i = 0;i<n;i++) {
			for(int j = 0;j<m;j++) {
				a[i][j]=sc.nextInt();
			}
		}
		
		
		for(int i=0;i<m;i++)b[i]=sc.nextInt();

		for(int i=0;i<n;i++) {
			for(int j=0;j<m;j++) {
				c[i]+=(a[i][j]*b[j]);
			}
		}

		for(int i = 0;i<n;i++)System.out.println(c[i]);
		sc.close();
	}
}



Measured memory_bytes: 40764
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1<<(n))
#define ii(x) int x; cin >> (x)
#define ii2(x, y) int x, y; cin >> (x) >> (y)
#define ii3(x, y, z) int x, y, z; cin >> (x) >> (y) >> (z)
#define yn(x, ok, ng) cout << ((x)?(ok):(ng)) << endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
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;}
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int const INF = 1001001001;

int MAX = 1000001;

int n;
vb b;

vector<int> Eratos(int MAX) {
    vector<int> is_prime(MAX,1);
    is_prime[0] = 0; is_prime[1] = 0;
    for(int i = 2; i < MAX; ++i) {
        if(!is_prime[i]) continue;
        if(!b[i]) continue;
        for(int j = i*2; j < MAX; j += i) is_prime[j] = 0;
    }
    return is_prime;
}

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

cin >> n;
vi a(n);
b = vb(MAX);

vi c(MAX);

int cnt = 0;
rep(i,n) {
    cin >> a[i];
    c[a[i]]++;
    b[a[i]] = true;
}
if(c[1] >= 2) {
    cout << 0 << endl;
    return 0;
} else if(c[1] == 1){
    cout << 1 << endl;
    return 0;
}

vi is_prime = Eratos(MAX);

int ans = 0;
rep(i,n) {
    if(is_prime[a[i]] && c[a[i]] == 1) ans++;
}
cout << ans << endl;
return 0;
}

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

int main(){
   int n, R[200000];
    cin >> n;
    for ( int i = 0; i < n; i++ ){
       cin >> R[i];
    }
    
    int ans = R[1] - R[0];
    int min =R[0];
    
    for ( int i = 1; i < n; i++ ){
        
       if ( R[i] - min > ans ) ans = R[i] - min;
       if ( R[i] < min ) min = R[i]; 
    } 
  
        cout << ans << endl;
    
    
    
}
    

Measured memory_bytes: 1940
/**
 *    Creator :  bizarre
 *    Date : 4/2020
 *    Problem Number : 428
**/
#include <bits/stdc++.h>
using namespace std;
#define bizarre     ios_base::sync_with_stdio( false ), cin.tie( nullptr ), cout.tie( nullptr );
/*
vector<int> prime_Numbers;
int primes[1000005];
void prime(int n)
{
    primes[1]=primes[0]=0;
    for(int i=2; i<=n; i++)
        primes[i]=true;
    for(int i=2; i<=n; i++)
    {
        if(primes[i]==true)
        {
            prime_Numbers.push_back(i);
            for(int j=i+i; j<=n; j+=i)
                primes[j]=false;
        }
    }
    for(int i=2; i<=n; i++)
        primes[i]+=primes[i-1];
}

void move1step(long long& a, long long& b, long long q)
{
    long long c= a-q*b;
    a=b;
    b=c;
}
long long egcd(long long r0,long long r1,long long& x0,long long& y0)
{
    long long x1=0,y1=1;
    x0=1;
    y0=0;
    while(r1)
    {
        long long q=r0/r1;
        move1step(r0,r1,q);
        move1step(x0,x1,q);
        move1step(y0,y1,q);
    }
    return r0;
}
bool  solve (long long a, long long b, long long c,long long&x, long long& y)
{
    long long g=egcd(a,b,x,y);
    int m=c/g;
    x*=m;
    y*=m;
    return c%g==0;
}



int npr(long long n, long long r)
{
    return (fact[n] * inv[n - r]) % mod;
}

int gcd(int a, int b)
{
    if(b==0)
        return a;
    return gcd(b,a%b);
}
void PrimeFactorization(int n)
{
    for(int i=2; i*i<=n; i++)
    {
        int c=0;
        if(n%i==0)
        {
            while(n%i==0)
            {
                n/=i;
            }

        }
    }

}
const int inf = 2e9, mod = 1e9 + 7,N=1e5+5;
long long fact[N], inv[N];
long long fp(long long base, long long exp)
{
    if (exp == 0)
        return 1;
    long long ans = fp(base, exp / 2);
    ans = (ans * ans) % mod;
    if (exp % 2 != 0)
        ans = (ans * (base % mod)) % mod;
    return ans;
}
void pre(long long n)
{
    fact[0] = 1;
    inv[0] = 1;
    for (long long i = 1; i <= n; i++)
    {
        fact[i] = (i * fact[i - 1]) % mod;
        inv[i] = fp(fact[i], mod - 2);
    }
}
int ncr(long long n, long long r)
{
    return (((fact[n] * inv[n - r]) % mod) * inv[r]) % mod;
}
long long ncrtane(long long n, long long r)
{
    long long ans=1,cntr=1;
    for(int i=n;i>n-r;i--)
    {
        ans*=i;
        ans/=cntr;
        cntr++;
    }
    return ans;
}
*/
const int N=1e5+5;
vector<int>graph[N];
bool vis[N];
int dp[N];
void dfs(int node)
{
    vis[node]=true;
    for(auto child:graph[node])
    {
        if(!vis[child])dfs(child);
        dp[node]=max(dp[node],dp[child]+1);
    }
}
int main()
{
    bizarre
    int n,m,mxm=0;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
       int x,y; cin>>x>>y;
       graph[x].push_back(y);
    }
    memset(vis,0,sizeof vis);
    memset(dp,0,sizeof dp);
    for(int i=1;i<=n;i++)
    {
        dfs(i);
        mxm=max(mxm,dp[i]);
    }
    cout << mxm;
    return 0;
}



Measured memory_bytes: 8320
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        double m = sc.nextDouble();
        double[] a = new double[n];
        double sum = 0.0;
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextDouble();
            sum += a[i];
        }
        double ans = 0.0;
        double tmp = sum / (m * 4.0);
        for (int i = 0; i < n; i++) {
            if(a[i] >= tmp) ans++;
        }
        if(ans >= m) System.out.println("Yes");
        else System.out.println("No");
    }
}

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

using namespace std;

int main()
{
long long int a,b;
char operato;
scanf("%lld %c %lld",&a,&operato,&b);
if(operato=='+'){
    printf("%lld",a+b);
}
else{
    printf("%lld",a-b);
}
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define dbg(x) cout<<#x<<":"<<x<<endl
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<ll,P> PP;

int main(){
  ll n,p=1e9+7,c[222222];
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>c[i];
  }

  ll dp[222222]={};
  ll ls[222222];
  fill_n(ls,222222,-1);

  dp[0]=1;
  ls[c[0]]=0;
  for(int i=1;i<n;i++){

    if(ls[c[i]]==-1||ls[c[i]]==i-1){
	 ls[c[i]]=i;
	 //	 dbg(i);
	 dp[i]=dp[i-1];
	 continue;
    }

    dp[i]+=dp[i-1];
    dp[i]+=dp[ls[c[i]]];
    dp[i]%=p;
    ls[c[i]]=i; 
    //    dbg(dp[i]);
  }

  cout<<dp[n-1]<<endl;
  return 0;
}


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

const int MAX_T=51,MAX_P=11;

int M,T,P,R,m,t,p,r;
vector<vector<int>> result(MAX_T,vector<int>(3));
vector<vector<int>> penalty(MAX_T,vector<int>(MAX_P));

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(cin >> M >> T >> P >> R,M){
        for (int i=0;i<T;++i){
            result[i][0]=result[i][1]=0,result[i][2]=i+1;
            for (int j=0;j<P;++j) penalty[i][j]=0;
        }
        for (;R--;){
            cin >> m >> t >> p >> r; --t,--p;
            if (r) ++penalty[t][p];
            else {
                ++result[t][0];
                result[t][1]-=m+penalty[t][p]*20;
            }
        }
        sort(result.begin(),result.begin()+T);
        reverse(result.begin(),result.begin()+T);
        for (int i=0;i<T;++i){
            if (i) cout << (result[i][0]==result[i-1][0]&&result[i][1]==result[i-1][1]?'=':',');
            cout << result[i][2];
        }
        cout << '\n';
    }
}


Measured memory_bytes: 3204
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  vector<string> s(N);
  for(int i=0;i<N;i++){
    cin>>s.at(i);
  }
  int M;
  cin>>M;
  vector<string> t(M);
  for(int i=0;i<M;i++){
    cin>>t.at(i);
  }
  vector<int> ANS;
  for(int i=0;i<N;i++){
    int ans = 0;
    for(int j=0;j<N;j++){
      if(s.at(i)==s.at(j)){
        ans++;
      }
    }
    for(int j=0;j<M;j++){
      if(s.at(i)==t.at(j)){
        ans--;
      }
    }
    ANS.push_back(ans);
  }
  sort(ANS.begin(),ANS.end());
  reverse(ANS.begin(),ANS.end());
  if(ANS.at(0)<0){
    cout<<0<<endl;
  }
  else{
    cout<<ANS.at(0)<<endl;
  }
  return 0;
}

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

// varibable settings
#define int long long
const int INF=1e18;

// define basic macro {{{
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define _rrep(i,n) rrepi(i,0,n)
#define rrepi(i,a,b) for(int i=(int)((b)-1);i>=(int)(a);--i)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(i,a) for (auto&& i : a)
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define pb(a) push_back(a)
#define mp(a, b) make_pair(a, b)
#define mt(a, b, c) make_tuple(a, b, c)
#define divceil(a,b) ((a)+(b)-1)/(b)
#define is_in(x, a, b) ((a)<=(x) && (x)<(b))
#define uni(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define ub upper_bound
#define lb lower_bound
#define posl(A, x) (lower_bound(all(A), x)-A.begin())
#define posu(A, x) (upper_bound(all(A),x)-A.begin())
template<class T> inline void chmax(T &a, const T &b) { if((a) < (b)) (a) = (b); }
template<class T> inline void chmin(T &a, const T &b) { if((a) > (b)) (a) = (b); }

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long double ld;
typedef pair<int,int> pii;
typedef tuple<int,int,int> iii;

template<typename T> using PQ = priority_queue<T, vector<T>, greater<T>>;
struct Fast { Fast(){ std::cin.tie(0); ios::sync_with_stdio(false); } } fast;

void xputs(){}
template <class Head, class... Tail>
void xputs(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(Tail) == 0) { cout << endl; }
  else { cout << " "; }
  xputs(std::move(tail)...);
}

#if defined(PCM) || defined(LOCAL)
  #include "lib/dump.hpp"
#else
  #define dump(...) 42
  #define dump_1d(...) 42
  #define dump_2d(...) 42
#endif
//}}}

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

  vector<vector<int>> ans;
  ans.pb({1});
  ans.pb({1});
  dump(ans);
  int color_num = 2;
  int m = 2;
  while (m<=n){
    // [m, m+color_num-1]の追加
    rep(i, 0, color_num){
      ans[i].pb(m+i);
    }
    vi newcolor; rep(i, m, m+color_num) newcolor.pb(i);
    ans.pb(newcolor);

    m += color_num;
    color_num++;
  }
  if (m==n+1){
    dump_2d(ans, sz(ans), sz(ans[0]));
    cout << "Yes" << endl;
    cout << sz(ans) << endl;
    rep(j, sz(ans)){
      cout << sz(ans[j]) << " ";
      rep(i, sz(ans[j])) cout << ans[j][i] << (i!=sz(ans[j])-1 ? " " : "\n");
    }
  }
  else{
    cout << "No" << endl;
  }
  
  return 0;
}


Measured memory_bytes: 3840
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define FRE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
#define int long long
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
#define endl "\n"
const int oo = INT_MAX;
const int MOD = 1e9 + 7;
const int sz = 1e5 + 5;

int32_t main() {
    IOS;
    int tc = 1;
    //cin >> tc;
    while(tc--) {
        int n, ind = 0; cin >> n;
        vector<int> a(n), b(n);
        for(auto &el : a) {
            cin >> el;
        }
        for(auto &el : b) {
            cin >> el;
        }
        reverse(b.begin(), b.end());
        int common = -1, l = -1, r = -1;
        for(int i = 0; i < n; ++i) {
            if(a[i] == b[i]) {
                common = a[i];
                l = i;
                break;
            }
        }
        for(int i = 0; i < n; ++i) {
            if(a[i] == b[i] && a[i] == common) {
                r = i;
            }
        }
        if(l != -1 && r != -1) {
            for(int i = 0; i < n && l <= r; ++i) {
                if(a[i] == common || b[i] == common) continue;
                swap(b[i], b[l++]);
            }
            if(l <= r) return 0 * printf("No\n");
        }
        cout << "Yes" << endl;
        for(auto el : b) cout << el << " ";
    }
}

Measured memory_bytes: 6356
using System;
using System.Linq;

class A
{
	static void Main()
	{
		string[] x = (Console.ReadLine()).Split(' ');
        int L = int.Parse(x[0]);
        int R = int.Parse(x[1]);
        int d = int.Parse(x[2]);

		int Count =0;
        for(int i=L;i<=R;i++)
        {
            if(i%d==0)
            {
                Count++;
            }
        }
        Console.WriteLine(Count.ToString());
	}
}

Measured memory_bytes: 27452
#include<iostream>
#include<bitset>
#include<vector>
#include<cmath>
#include<algorithm>

using sll = signed long long;
using bs = std::bitset<16>;

auto f(sll a)->sll {
	if (a < 0)
		return 0;

	auto m4 = a % 4;

	auto ans = a - m4;
	for (sll i{ ans + 1 }; i <= a; ++i)
		ans ^= i;
	return ans;
}

int main() {

	sll A, B;
	std::cin >> A >> B;

	std::cout << ( f(B)^f(A-1) ) << "\n";

	return 0;
}

Measured memory_bytes: 888
#include<string>
#include<iostream>
#include <algorithm>
#include<vector>
#include<functional>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <numeric>
#define ll long long
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
using namespace std;



int main() {
    ll K, A, B;
    cin >> K >> A >> B;
    for (ll i = A; i <= B; i++) {
        if (i%K == 0) {
            cout << "OK" << endl;
            return 0;
        }
    }
    cout << "NG" << endl;
    return 0;
}

Measured memory_bytes: 3596
#include<cstdio>
#include<cstring>
#include<queue>
#include<algorithm>
#include<cmath>
using namespace std;
long long a[100000+10];
int main()
{
    a[0]=1;
    for(int i=1;i<=100000;i++)
        a[i]=a[i-1]*i%(1000000000+7);
        int n;
    while(scanf("%d",&n)!=-1)
    {
        printf("%lld\n",a[n]);
    }
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<int, int> pii ;
const int mod = 1e9 + 7;

ll binPow(ll x, ll y, ll md = mod){
    ll res = 1;
    x %= mod;
    while(y){
        if(y & 1){
            res = (res * x) % mod;
        }
        y >>= 1;
        x = (x * x) % mod;
    }
    return res;
}

void solve(){
    int a, b, c;
    cin >> a >> b >> c;
    vector<int> v(101);
    v[a]++;
    v[b]++;
    v[c]++;
    cout << 101 - count(v.begin(), v.end(), 0);
}

int main() {
#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    solve();
    return 0;
}



Measured memory_bytes: 256
#[allow(unused_macros)]
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)*}
    };
}

#[allow(unused_macros)]
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)*}
    };

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

#[allow(unused_macros)]
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, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

use std::cmp::max;

fn main() {
    input! {
        a: i64,
        b: i64,
    }

    let ans = max(0, a - b * 2);

    println!("{}", ans);
}


Measured memory_bytes: 4352
//
// Created by Edward on 4/25/2020.
//

#include <bits/stdc++.h>
#include <iostream>

using namespace std;

typedef long long ll;

namespace coincombo2{
    int N, K;
    ll L, R;
    ll a[40];
    vector< vector<ll> > left;
    vector< vector<ll> > right;

    void put(){
        for(int i = 0; i < (1 << N/2); i++){
            int cnt = 0;
            ll sum = 0;
            for(int j = 0; j < N/2; j++){
                if(i & (1 << j)){
                    cnt++;
                    sum+=a[j];
                }
            }
            left[cnt].push_back(sum);
        }
        for(int i = 0; i < (1 << (N - N/2)); i++){
            int cnt = 0;
            ll sum = 0;
            for(int j = 0; j < N - N/2; j++){
                if(i & (1 << j)){
                    cnt++;
                    sum+=a[N/2 + j];
                }
            }
            right[cnt].push_back(sum);
        }
    }

    int main(){
        cin >> N >> K;
        cin >> L >> R;
        for(int i = 0; i < N; i++){
            cin >> a[i];
        }
        for(int i = 0; i < N/2 + 1; i++){
            vector <ll> v;
            left.push_back(v);
        }
        for(int i = N/2; i < N + 1; i++){
            vector <ll> v;
            right.push_back(v);
        }
        put();
        for(int i = 0; i < N/2; i++){
            sort(left[i].begin(), left[i].end());
        }
        for(int i = 0; i < N - N/2; i++){
            sort(right[i].begin(), right[i].end());
        }
        ll count = 0;
        for(int i = max(0, K - (N - N/2)); i <= min(K, N/2); i++){
            for(ll x: left[i]){
                ll v = lower_bound(right[K-i].begin(), right[K-i].end(), R+1-x) - lower_bound(right[K-i].begin(), right[K-i].end(), L-x);
                count += v;
                //cout << x << " in left gets " << v << " in right." << endl;
            }
        }
        cout << count << endl;
        return 0;
    }
}

int main(){
    coincombo2::main();
    return 0;
}


Measured memory_bytes: 23420
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

a = [0]
for i in range(1, 10):
    a.append(a[i-1]+i)
a = a[1:]

n = int(input())
if n == 1:
    ans = 0
else:
    primes = factorization(n)
    ans = 0
    for prime in primes:
        t = prime[1]
        for i in range(10):
            if t < a[i]:
                ans += i
                break
print(ans)

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

string s;
const long long M = 1000000007;
unsigned long long dp[100001][13];

int main()
{
	cin >> s;

	int n = s.size();
	dp[0][0] = 1;

	for (int i = 1; i < 13; i++)
		dp[0][i] = 0;

	for (int i = 0; i < n; i++) {
		if (s[i] == '?') {
			for (int j = 0; j < 10; j++)
				for (int k = 0; k < 13; k++)
					dp[i + 1][(k * 10 + j) % 13] += dp[i][k];
		}
		else {
			int c = s[i] - '0';

			for (int k = 0; k < 13; k++)
				dp[i + 1][(k * 10 + c) % 13] += dp[i][k];
		}

		for (int j = 0; j < 13; j++)
			dp[i + 1][j] %= M;
	}

	cout << dp[n][5] << endl;

	return 0;
}

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;

#define fi first
#define se second

const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);

void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

int N; ll A, B, H[int(1e5+5)];

bool Judge(ll num){
  ll ans = 0;
  for (int i = 0; i < N; i++){
    ll now = H[i] - B * num;
    if (now <= 0) continue;
    ans += (now - 1) / (A - B) + 1;
    if (ans > num) return false;
  }
  return true;
}

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

  ll L = 0, R = 1e9;
  while (R - L > 1){
    ll now = (L + R) / 2;
    if (Judge(now)) R = now;
    else L = now;
  }
  cout << R << endl;

  return 0;
}


Measured memory_bytes: 4332
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> pii;
typedef long long ll;

#define pb push_back
#define fastIO ios_base::sync_with_stdio(false); cin.tie(nullptr);
#define endl '\n'
#define deb(x) cout << #x << " "<< x << endl;
#define fo(i, n) for(int i=0; i<n; i++)
#define Fo(i, k, n) for(int i=k; i<n; i++)

struct greaterr
{
    template<class T>
    bool operator()(T const &a, T const &b) const { return a > b; }
};

vector<bool> sieve(1000007,true);

void help(){
     sieve[0] = false;
     sieve[1] = false;

     for(int i=2;i*i<=1000000;++i){
        if(sieve[i]){
            for(int j=i*i;j<=1000000;j+=i)
                sieve[j] = false;

        }
     }


}

int main() {
   fastIO

   int a,b,c;
   cin>>a>>b>>c;

   cout<<(max(0,c-(a-b)));





   return 0 ;
      }


Measured memory_bytes: 384
def word_break(s, words):
    ok = [True]
    word_length = max(len(word) for word in words)
    for i in range(1, len(s) + 1):
        ok += any(ok[j] and s[j:i] in words for j in range(max(0, i - word_length), i)),
    return ok[-1]


s = input()
words = {"eraser", "erase", "dreamer", "dream"}
print("YES" if word_break(s, words) else "NO")

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

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

    vector<int> h(n);
    for (int i = 0; i < n; i++)
        cin >> h.at(i);

    int max_cnt = 0;
    for (int i = 0; i < n - 1; i++) {
        int j, cnt = 0;
        for (j = i; j < n - 1; j++) {
            if (h.at(j) < h.at(j + 1))
                break;
            else
                cnt++;
        }

        i = j;

        max_cnt = max(max_cnt, cnt);
    }

    cout << max_cnt << endl;
}

Measured memory_bytes: 3752
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

using vvll = vector< vector<ll> >;
using vll = vector<ll> ;

#define IOS ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert
#define endl '\n'
#define all(x) x.begin(), x.end()
#define sz(x) ((long long)x.size())

const ll maxs = 1e6+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e15;


void pre(){



}

int a,b,c,d;
const int N = 3005;
int vis[N][N];
int dp[N][N];

long go(int i,int j){
    if(i>c){
        return 0;
    }
    if(j>d){
        return 0;
    }
    if(i==c and j==d)
        return 1;
    if(vis[i][j])
        return dp[i][j];
    vis[i][j] = true;
    long ans = j*go(i+1,j)%mod;
    ans += i*go(i,j+1)%mod;
    ans -= i*j*go(i+1,j+1)%mod;
    ans%=mod;
    ans+=mod;
    ans%=mod;
    return dp[i][j]=ans;
}

void solve(){  
    mod = 998244353;
    cin >> a >> b >> c >> d;
    long ans = go(a,b);
    cout << ans << endl;
}   

int main(){
    
    IOS;
    pre();
    ll T = 1;   
    //cin>>T;
    ll tt = 1;
    while(T--){  
        //cout << "Case #" << tt << ": "; 
        tt++;
        solve();
    }
    return 0;
}

Measured memory_bytes: 74484
import java.util.Scanner;

public class Main {
	public static Scanner sc;
	
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		int i=1;
		int H[]=new int[300];
		int W[]=new int[300];
		
		for(;;) {
			H[i]=sc.nextInt();
			W[i]=sc.nextInt();
			if(H[i]==0 && W[i]==0) {
				break;
			}
			i++;
		}
		i=1;
		for(;;) {
			if(H[i]==0 && W[i]==0) {
				break;
			}
			int j,k;
			for(j=1;j<=H[i];j++) {
				for(k=1;k<=W[i];k++) {
					if(j%2==1) {//奇数列目
						if(k%2==1) {
							System.out.print("#");
						}else {
							System.out.print(".");
						}
					}else {
						if(k%2==0) {
							System.out.print("#");
						}else {
							System.out.print(".");
						}
					}
				}
				System.out.print("\n");
			}
			System.out.print("\n");
			i++;
		}
	}
}


Measured memory_bytes: 37884
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
using namespace std;
using lint = long long;
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 long long INF = 1LL << 60;

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

    int64_t x = sqrt(n) +1;

    int64_t ans;

    for(int64_t i = x; i >= 1; i--){
        if(n % i == 0){
            ans = i + (n/i) -2;
            break;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <vector>
#include <tuple>
#include <queue>
#include <utility>
#include <iostream>

// Connects a set of subsets and checks the belonging of the data.
// unite : near O(1)
// root : near O(1)
// same : near O(1)
// size : near O(1)
class UnionFind
{
	using Abel = int;
	std::vector<Abel> data;

  public:
	UnionFind(int n) : data(n, -1) {}

	// Connects between x and y.
	bool unite(Abel x, Abel y)
	{
		x = root(x);
		y = root(y);
		if (x != y)
		{
			if (data[y] < data[x])
			{
				std::swap(x, y);
			}
			data[x] += data[y];
			data[y] = x;
		}
		return x != y;
	}

	// Finds the belonging of x.
	Abel root(Abel x) { return data[x] < 0 ? x : data[x] = root(data[x]); }

	// Checks where x and y belong to the same subset.
	bool same(Abel x, Abel y) { return root(x) == root(y); }

	// Look up the size of the subset belonged to x.
	Abel size(Abel x) { return -data[root(x)]; }
};

// Graph template (start)
template <class... Args>
struct Edge
{
	int from, to;
	std::tuple<Args...> values;
	Edge(int from, int to, Args... values)
		: from(from), to(to), values(values...) {}
};

template <class E>
auto operator<(const E &e, const E &f)
{
	return e.values > f.values;
}

template <class... Args>
class Graph
{
	using Edges = std::vector<Edge<Args...>>;
	std::vector<Edges> graph_;

  public:
	Graph(int n) : graph_(n) {}
	std::size_t size() { return graph_.size(); };
	std::size_t size() const { return graph_.size(); };
	auto &operator[](unsigned int x) { return graph_[x]; }
	const auto &operator[](unsigned int x) const { return graph_[x]; }
	void AddEdge(int s, int t, Args... v) { graph_[s].emplace_back(s, t, v...); }
	void AddEdge(Edge<Args...> e) { graph_[e.from].push_back(e); }
};
// Graph template (end)

using Weight = long long;
// Kruskal's algorithm
// Finds a minimum-spanning-tree.
// Returns the sum of the tree's cost and the edges of the tree.
// Complexity : O(E log V)
template <class... Args>
auto Kruskal(const auto &g)
{
	const int n = g.size();
	UnionFind uf(n);
	std::priority_queue<Edge<Args...>> q;
	for (int i = 0; i < n; ++i)
	{
		for (const auto &e : g[i])
		{
			if (i < e.to)
			{
				q.push(e);
			}
		}
	}
	Weight total_cost = 0;
	Graph<Args...> forest(n);
	int forest_size = 0;
	while (forest_size < n - 1 && !q.empty())
	{
		auto e = q.top();
		q.pop();
		if (uf.unite(e.from, e.to))
		{
			forest.AddEdge(e);
			forest_size++;
			total_cost += std::get<0>(e.values);
		}
	}
	return std::make_pair(total_cost, forest);
}

int main()
{
	int n, m;
	std::cin >> n >> m;
	Graph<Weight> g(n);
	for (int i = 0; i < m; ++i)
	{
		int u, v, cost;
		std::cin >> u >> v >> cost;
		g.AddEdge(u, v, cost);
		g.AddEdge(v, u, cost);
	}
	std::cout << Kruskal<Weight>(g).first << std::endl;
}


Measured memory_bytes: 10300
#include<bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    int dig_sum = 0;
    int tmp = n;
    while( tmp > 0 ) {
        dig_sum += tmp % 10;
        tmp /= 10;

    }

    if( n % dig_sum ) cout << "No";
    else cout << "Yes";
    cout << endl;
    return 0;
}



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

int Sum(int n){
    int sum=0;
    while(n>0){
        sum+=n%10;
        n/=10;
    }
    return sum;
}

int main() {
    int n,a,b;
    cin>>n>>a>>b;
    int r=0;
    int s;
    for(int i=1;i<=n;++i){
        s=Sum(i);
        if(a<=s&&s<=b){
            r+=i;
        }
    }
    cout<<r<<endl;
    return 0;
}

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

int main(){
  int n,k,i;
  cin>>n>>k;
  char a;
  for(i=0;i<n;i++){
    cin>>a;
    if(i==k-1){
      if(a=='A'){
        a='a';
      }else if(a=='B'){
        a='b';
      }else{
        a='c';
      }
    }
    cout<<a;
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long LL;
template <typename F, typename S> std::ostream& operator<<(ostream& os, const pair<F,S>& p) {
    os << "(" << p.first << "," << p.second << ")"; return os; }
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "["; for(const T& a: v){ os << a << ", "; } os << "]"; return os; }
template <typename K, typename V> ostream& operator<<(ostream& os, const map<K,V>& m) {
    os << "{"; for(const auto& p: m){ os << p.first <<":"<< p.second << ", "; } os << "}"; return os; }


int main(){
    string s;
    cin >> s;
    LL n = s.size();
    vector<LL> a(n);
    LL cnt = 0;
    LL pos = 0;
    for(LL i = 0; i < n; ++i){
        if(s[i] == 'R'){
            cnt += 1;
            if(s[i+1] == 'L'){
                pos = i;
                a[pos] += (cnt+1)/2;
                a[pos+1] += cnt/2;
                cnt = 0;
            }
        }
        if(s[i] == 'L'){
            LL dist = i - pos;
            a[pos + dist%2] += 1;
        }
    }
    for(LL i = 0; i < n; ++i){
        if(i+1 == n){
            cout << a[i] << endl;
        }else{
            cout << a[i] << " ";
        }
    }
    return 0;
}



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

#define ff first
#define ss second
#define PI acos(-1)
#define pb push_back
#define int long long
#define ld long double
#define sp fixed<<setprecision
#define bp __builtin_popcountll
#define all(x) x.begin(),x.end()
#define pii pair<long long,long long>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

const int M = (1e9)+7;
const int N = 200005;

int ans[N];

signed main()
{
    FAST
    int tc=1;
    //cin>>tc;
    for(int ti=1;ti<=tc;ti++)
    {
        for(int i=1;i<N;i++)ans[i] = 1 + ans[i%bp(i)];

        int n;
        cin>>n;
        string s;
        cin>>s;
        reverse(all(s));

        int tot[n] = {};
        int bp = 0,sb,bb;
        for(int i=0;i<n;i++)bp += (s[i] == '1');
        sb = bp - 1; sb = max(0LL,sb);
        bb = bp + 1;
        int big = 0,small = 0,po= 1LL;
        for(int i=0;i<n;i++,po*=2LL,po%=bb)po %= bb,big += (po*(s[i]-'0')), big %= bb;
        po = 1LL;
        for(int i=0;sb && i<n;i++,po*=2LL,po%=sb)po %= sb,small += (po*(s[i] == '1')), small %= sb;
        int ps = 1LL,pb = 1LL;
        for(int i=0;i<n;i++)
        {
            int now;
            if(s[i] == '1')
            {
                if(!sb)tot[i] = 0;
                else
                {
                    now = small - ps;
                    now += sb;
                    now %= sb;
                    tot[i] = 1 + ans[now];
                }
            }
            else
            {
                now = big + pb;
                now %= bb;
                tot[i] = 1 + ans[now];
            }
            ps *= 2LL;
            pb *= 2LL;
            if(sb)ps %= sb;
            pb %= bb;
        }
        reverse(tot,tot+n);
        for(int i=0;i<n;i++)cout<<tot[i]<<endl;
    }
    return 0;
}


Measured memory_bytes: 6856
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
using namespace std;
#define rep(i, n)for(int i=0; i<n; i++)

int main(){
  int N;
  cin >> N;
  //

  long long L[100];
  L[0] = 2;
  L[1] = 1;
  
  rep(i, N-1){
    L[i+2] = L[i+1]+L[i];
  }

  cout << L[N] << endl;

  return 0;
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize ("-ffloat-store")  
#pragma GCC optimize ("-fno-defer-pop")
typedef long long int ll; 


int main()
{	
	std::ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
		
	
	string s;
	cin>>s;
	
	for(char c:s)
	{
		if(c=='7')
		{
			cout<<"Yes"<<endl;
			return 0;
		}
	}
	
	cout<<"No"<<endl;
	
}


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

bool isprime(int n){
    double rootn = sqrt(n);
    if (n < 2){
        return false;
    }
    else if (n == 2){
        return true;
    }
    else if (n % 2 == 0){
        return false;
    }
    else{
        for(int i = 3; i <= rootn; i += 2){
            if(n % i == 0){
                return false;
            }
        }
        return true;
    }
}


int main(){
    int N, K;
    cin >> N >> K;
    vector<int> A = {};
    for(int i=0; i<N; i++){
        int a;
        cin >> a;
        A.push_back(a);
    }

    for(int i=0; i<N-K; i++){
        if(A[K+i] > A[i]){
            cout << "Yes" << endl;
        }
        else{
            cout << "No" << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 4372
N,M = map(int, input().split())
dp = [0 for i in range(N+1)]
dp[0] = 1
dp[1] = 1
for i in range(M):
    dp[int(input())] = None
for i in range(2,N+1):
    if dp[i] != None:
        if dp[i-2] != None:
            dp[i] += dp[i-2]
        if dp[i-1] != None:
            dp[i] += dp[i-1]
mod = 10**9 + 7
print(dp[N]%mod)

Measured memory_bytes: 462616
#include<stdio.h>
int main(void)
{
 int a,b;
 
 scanf("%d",&a);
 scanf("%d",&b);
  
  if(a>b){
    printf("a > b\n");
}else if(a<b){
    printf("a < b\n");
} else{
    printf("a == b\n");
}
return 0;
}

Measured memory_bytes: 1816
n = int(input())
a = list(map(int,input().split()))
star = 0
ans = [0 for i in range(n)]
for i in range(n):
    star += a[i]
for i in range((n-1)//2):
    ans[0] += 2*a[2*i+1]
    ans[1] += 2*a[2*i+2]
ans[0] = star-ans[0]
ans[1] = star-ans[1]
for i in range(1,n//2):
    ans[2*i] = ans[2*(i-1)] + 2*a[2*(i-1)+1] - 2*a[2*(i-1)]
    ans[2*i+1] = ans[2*(i-1)+1] + 2*a[2*(i-1)+2] - 2*a[2*(i-1)+1]
ans[n-1] = ans[n-3] + 2*a[n-2]  - 2*a[n-3]
for i in range(n):
    print(ans[i],end=' ')

Measured memory_bytes: 65380
#include<stdio.h>
#include<string.h>
#include<string>
#include<queue>
#include<map>
using namespace std;
int dir[]={-4,4,-1,1};//上下左右 
map<string,int> table;
void bfs(string st)
{
	queue<string> q;
	table[st]=1;q.push(st); //起始状? 
	while(!q.empty())
	{
		st=q.front();q.pop();
		int num=st.find('0');//找到空格位置 
		for(int i=0;i<4;++i)
		{	
			int tn=num+dir[i];//可能??的数?
			if(tn<0||tn>7||num==3&&dir[i]==1||num==4&&dir[i]==-1)
			//空格在3的?候，4不能??，因?3 4 不相?，反之同理 
			{
				continue;
			}
			string tp=st;
			swap(tp[num],tp[num+dir[i]]);//移?物? 
			if(!table[tp])//未出??的状? 
			{
				q.push(tp);
				table[tp]=table[st]+1; 
			}
		}
	}
}
int main()
{
	int num;
	string st="01234567";//起始状? 
	bfs(st);//逆向搜索 
	//freopen("shuju.txt","r",stdin);
	while(~scanf("%d",&num))
	{
		st[0]=num+'0';
		for(int i=1;i<8;++i)
		{
			scanf("%d",&num);
			st[i]=num+'0';
		}
		printf("%d\n",table[st]-1);//从1?始?号的 
	}
	return 0;
}

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

int main(){
    int n; cin>>n;
    int k = 0;
    for(int i=1; i<=n; i++){
        int p; cin >> p;
        if(p!=i) k++;
    }
    if(k<=2) cout<< "YES" <<endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<ctype.h>
#include<string.h>
int main(void){
	char s[10000] = { 0 };
	gets(s);
	int i = -1;
	while (s[++i]) {
		s[i] = toupper(s[i]);
	}

	printf("%s\n", s);

	return 0;
}

Measured memory_bytes: 524
import java.util.*;
import sun.misc.Unsafe;
import java.lang.reflect.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Field f = Unsafe.class.getDeclaredField("theUnsafe");
        f.setAccessible(true);
        Unsafe unsafe = (Unsafe) f.get(null);

        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        long[] a = new long[n];
        for (int i=0; i<n; i++) {
            a[i] = sc.nextInt();
        }

        long[][] dp = new long[n][n];
        for (int i=0; i<n; i++) {
            dp[i][i] = a[i];
        }

        for (int i = n - 2; i > -1; i--) {
            for (int j = i + 1; j < n; j++) {
                dp[i][j] = Math.max(a[i] - dp[i + 1][j], a[j] - dp[i][j - 1]);
            }
        }
        System.out.println(dp[0][n - 1]);
    }
}

Measured memory_bytes: 131780
n,k,q = map(int,input().split())
Sco = [0 for i in range(n)]
for i in range(q):
    a = int(input())
    Sco[a-1] += 1
#print(Sco)
for m in Sco:
    if k-q+m <= 0:
        print("No")
    else:
        print("Yes")


Measured memory_bytes: 4620
#include <iostream>

void ArrayDump(int *A, int N)
{
    for (int i = 0; i < N; i++) {
        std::cout << *(A + i);
        if (i != N - 1) {
            std::cout << " ";
        }
    }
    std::cout << std::endl;
}

void InsertionSort(int *A, int N)
{
    for (int i = 1; i < N; i++) {
        int v = A[i];
        int j = i - 1;
        while (j >= 0 && A[j] > v) {
            A[j+1] = A[j];
            j--;
        }
        A[j+1] = v;
        ArrayDump(A, N);
    }
}

int main(int argc, char* argv[])
{
    int array_size = 0;
    int array[100];

    std::cin >> array_size;
    for (int i = 0; i < array_size; i++) {
        std::cin >> array[i];
    }

    ArrayDump(array, array_size);
    InsertionSort(array, array_size);
}


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

using namespace std;

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

  uint64_t n, k;
  cin >> n >> k;
  uint64_t ans = pow(n / k, 3);
  if (k % 2 == 0) {
    ans += pow((n / (k / 2)) - n / k, 3);
  }
  cout << ans << "\n";
}


Measured memory_bytes: 256
// 2133
#include<bits/stdc++.h>
#define fast ios::sync_with_stdio(false);cin.tie(NULL)
using namespace std;
#define int long long
#define MOD 1000000007
typedef vector<int> vi;
typedef pair<int,int> pi;
#define inf 1e18
#define For(i,a,b) for (int i = a; i < b; i++)
#define Rep(i,a,b) for (int i = a; i <= b; i++)
#define ps(x,y) fixed << setprecision(y) << x 
#define pb push_back 
#define mp make_pair 

int a[100005];
 
int32_t main()
{
    fast;
    int n; cin >> n;
    Rep(i, 1, n) cin >> a[i];
    sort(a + 1, a + 1 + n);
    int fl = 1, sum1 = 0, sum2 = 0;
    if(n % 2 == 1) {
        if(a[1] != 0) fl = 0;
        else {
            int val = (n/2) * (n/2 + 1);
            for(int i = 2; i<=n-1; i+=2) {
                sum1 += a[i];
            }

            for(int i = 3; i<=n; i+=2) {
                sum2 += a[i];
            }

            if(sum1 != sum2 or (sum1 != val or sum2 != val)) fl = 0;
        }
    }
    else {
        if(a[2] != 1) fl = 0;
        else {
            int val;
            val = (n/2) * (n/2);

            for(int i = 2; i<=n; i+=2) {
                sum1 += a[i];
            }

            for(int i = 1; i<=n-1; i+=2) {
                sum2 += a[i];
            }

            if(sum1 != sum2 or (sum1 != val or sum2 != val)) fl = 0;

        }
    }

    if(fl == 1) {
        int ans = 1;
        if(n % 2 == 1) n--;
        n /= 2;
        while(n--) {
            ans *= 2;
            ans %= MOD;
        }
        cout << ans;
    }
    else cout << 0;

    //cout << sum1 << " " << sum2;
    
    return 0;
}

Measured memory_bytes: 4404