akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

int main(void){
   int N, M;
   scanf("%d %d",&N,&M);
   
   if(N<0 || N>1000000){
     printf("1~10^6の範囲で入力してください\n");
   }
   if(M<0 || M>10000){
     printf("1~10^4の範囲で入力してください\n");
   }

   int A[M];
   int i ,sum=0;
    for(i=0;i<M;i++){
      scanf("%d",&A[i]);
      if(A[i]<0 || A[i] > 10000){
        printf("1~10^4の範囲で入力してください\n");
       }
	  sum+=A[i]; 
	}
    
	int ans=N-sum;
	if(ans<0){
      printf("%d\n",-1);
	}else{
	  printf("%d\n",ans);
	}
	
	return 0;
}

Measured memory_bytes: 1744
/*
    Author      : Dinesh Verra
    College     : ABV-IIITM
    Date        : 02/08/2020
    Source		: 
    Explanation : 
*/
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp> 
// using namespace boost::multiprecision; 
using namespace std;
typedef long long ll;
// typedef unsigned long long ll;
#define cu continue
#define br break
#define pb push_back
#define eb emplace_back
#define mod 1000000007
#define inf INT_MAX
#define pll pair <ll,ll>
#define min_pq priority_queue <pll> ,vector <pll>, greater <pll> > > 
#define F first
#define S second
#define vll vector <ll>
#define vpll vector <pll>
#define dbg(n) cout<<#n<<' '<<n<<endl;
#define all(v) v.begin(),v.end()
#define nl cout<<'\n'

template <typename A1>
void prn(A1&& arg)
{
	cout<<arg<<'\n';
}
template <typename A1, typename... A>
void prn(A1&& arg, A&&... args)
{
	cout<<arg<<' ';
	prn(args...);
}

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


	ll n;
	cin>>n;
	string s;
	cin>>s;
	ll a=0,b=0;
	for(ll i=0;i<n;i++)
	{
		if(s[i]=='R') a++;
		else b++;
	}
	ll ans=min(a,b);
	ll cnt=0;
	for(ll i=0;i<a;i++)
		if(s[i]!='R') cnt++;
	ans=min(ans,cnt);
	prn(ans);
}

Measured memory_bytes: 3772
#pragma GCC optimize("unroll-loops,Ofast")
#pragma GCC target("avx,sse,sse2,ssse3,tune=native")
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
using namespace std;
using ll = long long;
using ld = long double;
const int maxn = 1<<18, mod = 1e9 + 7;
ll rn = 999;
bool ask(ll n) {
	cout << "? " << n << endl;
	char t;
	cin >> t;
	return t == 'Y';
}
void ans(ll n) {
	cout << "! " << n << endl;
	exit(0);
}
int main() {
	cin.tie(0)->sync_with_stdio(0);
	ll r = 1;
	while(r < 1e11 && ask(r)) r *= 10;
	if(r == 1e11) {
		ll q = 10;
		while(q < 1e11 && !ask(q-1)) q *= 10;
		r = q;
	}
	ll a = r;
	for(ll i = 1ll<<35; i>>=1;)
		if(a+i < 10ll*r && !ask(a+i)) a += i;
	ans((a+1)/10);
	return 0;
}


Measured memory_bytes: 720
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + (ll)b) % mod
#define MUL(a, b) a = (a * (ll)b) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = a; i < b; i++)
#define rer(i, a, b) for(int i = a - 1; i >= b; i--)
#define all(a) (a).begin(), (a).end()
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef pair<int, pi> ppi;
typedef vector<ll> vec;

const int MAX_N = 200010;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 30;

void Debug() {cout << '\n'; }

template<class FIRST, class... REST> 
void Debug(FIRST arg, REST... rest) { cout << arg << " "; Debug(rest...); }

template<class T>
ostream& operator<< (ostream& out, const vector<T>& v) {
	out << "[";
	if(!v.empty()) {
		rep(i, 0, (int)v.size() - 1) out << v[i] << ", ";
		out << v.back();
	}
	out << "]";
  return out;
}

template<class S, class T>
ostream& operator<< (ostream& out, const pair<S, T>& v) {
	out << "(" << v.first << ", " << v.second << ")";
	return out;
}

///g++ -g3 -std=c++0x -DLOCAL -Wall -ftrapv -D_GLIBCXX_DEBUG -Wl,-stack,268435456 -o
///g++ -O2 -std=c++0x -DLOCAL -Wall -Wl,-stack,268435456 -o

////////////////////////////////////////////////////////////////////////

bool C[26];

void solve() {
	string str;
	cin >> str;
	bool res = false;
	rep(i, 0, str.size()) {
		int a = str[i] - 'a';
		if(C[a]) res = true;
		else C[a] = true;
	}
	if(res) cout << "no\n";
	else cout << "yes\n";
}

int main() {
	ios::sync_with_stdio(false);
    cin.tie(0);	
    cout << fixed;
	cout.precision(20);
#ifdef LOCAL
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}



Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<cstdio>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
#include <cmath>
#include <limits>
#include <iostream>
#include <map>
#include<set>
using namespace std;
#define INF 1LL<<62
#define MAX 100000
#define MOD 1000000007
typedef long long ll;
typedef pair<int,int> P;
typedef pair<pair<int,int>,int> p;
#define bit(n,k) ((n>>k)&1) /*nのk bit目*/
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
struct edge{ll to,cost,val;};
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}
//__builtin_popcount(S);
//C.erase(unique(C.begin(),C.end()),C.end());
//#define int ll

//http://kmjp.hatenablog.jp/entry/2019/09/08/0930

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

    int N;
    int S[1<<18];
    cin>>N;

    for(int i=0;i<(1<<N);i++) cin>>S[i];
    sort(S,S+(1<<N));
    multiset<int> T;
    for(int i=0;i<(1<<N)-1;i++){
        T.insert(S[i]);
    }

    vector<int> V;
    V.push_back(S[(1<<N)-1]);
    for(int i=0;i<N;i++){
        vector<int> W=V;
        for(auto v:V){
            auto it=T.lower_bound(v);
            if(it==T.begin()){
                cout<<"No"<<endl;
                return 0;
            }
            it--;
            W.push_back(*it);
            T.erase(it);
        }
        swap(V,W);
    }
    cout<<"Yes"<<endl;
}


Measured memory_bytes: 13568
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.Random;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class CFennecVsMonster {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt(), k = in.nextInt();
            int[] h = in.readIntArray(n);
            Util.safeSort(h);
            long answer = 0;
            for (int i = 0; i < n - k; i++) {
                answer += h[i];
            }

            out.println(answer);
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public int[] readIntArray(int n) {
            int[] x = new int[n];
            for (int i = 0; i < n; i++) {
                x[i] = nextInt();
            }
            return x;
        }

    }

    static class Util {
        public static void safeSort(int[] x) {
            shuffle(x);
            Arrays.sort(x);
        }

        public static void shuffle(int[] x) {
            Random r = new Random();

            for (int i = 0; i <= x.length - 2; i++) {
                int j = i + r.nextInt(x.length - i);
                swap(x, i, j);
            }
        }

        public static void swap(int[] x, int i, int j) {
            int t = x[i];
            x[i] = x[j];
            x[j] = t;
        }

    }
}



Measured memory_bytes: 55328
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0;i<(n);i++)
#define N 105
#define INF 1000000000
typedef long long ll;
#define ALL(v) (v).begin(),(v).end()
#define SZ(x) int(x.size())
#define IN(a) cin>>(a)
#define OUT(a) cout<<(a)<<endl
typedef pair<int,int> P;
const int MAX = 100005;
const int MOD = 1000000007;

int main(){
    int x;
    cin>>x;
    if(x==7||x==5||x==3)OUT("YES");
    else OUT("NO");
    return 0;
}

Measured memory_bytes: 256
loop do
    n = gets.chomp.to_i
    if n == 0
        break
    end
    s = gets.split
    i = 0
    s.each do |j|
        i += j.to_f
    end
    m = i / n
    k = 0
    s.each do |l|
        k += (l.to_i - m) ** 2
    end
    a = k / n
    puts "#{sprintf("%.9f", Math.sqrt(a))}"
end

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

using namespace std;

using ll = long long;

constexpr ll MOD = 1e18;

void f(int K, vector<ll>& a) {
    for (int i = 1; i <= K; ++i) {
        for (int j = 2 * i; j <= K; j += i) {
            (a[i] += a[j]) %= MOD;
        }
    }
}

void inv_f(int K, vector<ll>& a) {
    for (int i = K; i >= 1; --i) {
        for (int j = 2 * i; j <= K; j += i) {
            (a[i] += MOD - a[j]) %= MOD;
        }
    }    
}

vector<ll> merge(int K, vector<ll> v1, vector<ll> v2) {
    if (v1.empty()) return v2;
    if (v2.empty()) return v1;

    f(K, v1);
    f(K, v2);

    vector<ll> res(K + 1, 0);
    for (int i = 1; i <= K; ++i) {
        res[i] = v1[i] * v2[i] % MOD;
    }

    inv_f(K, res);
    return res;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int K;
    cin >> K;
    int n = 3;

    vector<ll> memo;
    vector<ll> dp(K + 1, 1);
    while (n > 0) {
        if (n & 1) memo = merge(K, memo, dp);
        dp = merge(K, dp, dp);
        n >>= 1;
    }

    ll ans = 0;
    for (int i = 1; i <= K; ++i) {
        (ans += memo[i] * i % MOD) %= MOD;
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 3648
#include <iostream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <cassert>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <string>
#include <algorithm>
#include <utility>
#define llint long long
#define inf 1e18
#define rep(x, s, t) for(llint (x) = (s); (x) < (t); (x)++)
#define Rep(x, s, t) for(llint (x) = (s); (x) <= (t); (x)++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))

using namespace std;
typedef pair<llint, llint> P;

llint k;

int main(void)
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> k;
	llint x = 0, mul = 7;
	for(int i = 1; i <= 3*k; i++){
		x += mul, x %= k;
		if(x == 0){
			cout << i << endl;
			return 0;
		}
		mul *= 10, mul %= k;
	}
	cout << -1 << endl;
	
	return 0;
}

Measured memory_bytes: 3648
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		String str = scan.nextLine();
		int n = Integer.parseInt(str);

		String inputList[] = new String[n];
		for (int i = 0; i < n; i++) {
			String str2 = scan.nextLine();
			inputList[i] = str2;
		}
		scan.close();

		ArrayList<String> allCardList = new ArrayList<String>();
		for (int i = 1; i <= 13; i++) {
			allCardList.add("S" + " " + i);
		}
		for (int i = 1; i <= 13; i++) {
			allCardList.add("H" + " " + i);
		}
		for (int i = 1; i <= 13; i++) {
			allCardList.add("C" + " " + i);
		}
		for (int i = 1; i <= 13; i++) {
			allCardList.add("D" + " " + i);
		}

		for (int i = 0; i < 52; i++) {
			if (!(Arrays.asList(inputList).contains(allCardList.get(i)))) {
				System.out.println(allCardList.get(i));
			}
		}
	}
}

Measured memory_bytes: 26144
#include<stdio.h>
int MIN(int a,int b){return a<b?a:b;}
int ta[100010],to[100010],co[100010],nt[100010],it[100010],l[100010];
void mklsb(int v,int e,int *a,int *b,int *c){
  int i;
  for(i=0;i<v;i++)ta[i]=-1;
  for(i=0;i<e;i++){
    nt[i  ]=ta[to[i+e]=a[i]];
    nt[i+e]=ta[to[i  ]=b[i]];
    co[ta[a[i]]=i  ]=c[i];      
    co[ta[b[i]]=i+e]=0;
  }
}
int MF(int e,int s,int t,int min){
  if(s==t)return min;
  int i,r;
  for(;it[s]+1;it[s]=nt[it[s]]){
    if(co[it[s]]==0||l[s]>=l[to[it[s]]])continue;
    r=MF(e,to[it[s]],t,MIN(min,co[it[s]]));
    if(r>0){
      co[it[s]]-=r;
      co[(it[s]+e)%(2*e)]+=r;
      return r;
    }
  }
  return 0;
}
int maxf(int v,int e,int s,int g){
  int i,a=0,q[100010],t,r,c=3;
  while(1){
    q[0]=s;
    for(i=t=0;i<v;i++)l[i]=-1;
    l[q[0]]=0;
    for(r=1;r-t;t++){
      for(i=ta[q[t]];i+1;i=nt[i]){
	if(co[i]==0||l[to[i]]+1)continue;
	l[to[i]]=l[q[t]]+1;
	q[r++]=to[i];
      }
    }
    if(l[g]<0)return a;
    for(i=0;i<v;i++)it[i]=ta[i];
    for(;(r=MF(e,s,g,1e9))>0;a+=r);
  }
  return a;
}
int main(){
  int n,m,i,a[100010],b[100010],c[1000010],m1,m2;
  scanf("%d %d",&n,&m);
  for(i=0;i<m;i++)scanf("%d %d %d",&a[i],&b[i],&c[i]);
  mklsb(n,m,a,b,c);//prls(n);
  m1=maxf (n,m,0,n-1);
  printf("%d\n",m1);
  return 0;
}
  

Measured memory_bytes: 2716
N = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for _ in range(N):
  a = input()
  if a == "AC":
    ac += 1
  if a == "WA":
    wa += 1
  if a == "TLE":
    tle += 1
  if a =="RE":
    re += 1
print(f"AC x {ac}")
print(f"WA x {wa}")
print(f"TLE x {tle}")
print(f"RE x {re}")

Measured memory_bytes: 9064
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cmath>
#include <complex>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cassert>
#include <iomanip>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define Repr(e, b, i) for(int i = e; i >= b; i--)
#define rep(n, i) Rep(0, n-1, i)
#define repr(n, i) Repr(n-1, 0, i)
#define all(v) (v).begin(), (v).end()
#define pb(v) push_back(v)
#define uniq(v) (v).erase(unique(all(v)),(v).end())
#define bitcnt(x) __builtin_popcount(x)
#define fst first
#define snd second
#define Pqaz(T) priority_queue<T,vector<T>,greater<T>>
#define Pqza(T) priority_queue<T>
#define put(x) cout << x;
#define putsp(x) cout << x << ' ';
#define putbd cout << "---------------------------------------------" << endl;
#define putln(x) cout << x << endl;
#define debug(x) cerr << #x << "=" << x << endl;
#define ENJYU std::ios::sync_with_stdio(false);std::cin.tie(0);

typedef long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef complex<double> comp;
typedef vector <int> vec;
typedef vector <ll> vecll;
typedef vector <double> vecd;
typedef vector <vec> mat;
typedef vector <vecll> matll;
typedef vector <vecd> matd;

//vector の中身を出力
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

const int MAX = 200020;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<29;
const ll INFL = 1e18;
const int MOD = 1000000007;

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

//********************************template END****************************************//

void solve(void){

	int N, M, L;
	cin >> N >> M >> L;

	int as[3] = {abs(N-M), abs(M-L), abs(L-N)};

	sort(as, as+3);

	cout << as[0] + as[1] << endl;




}

int main(void){
	solve();
	//cout << "yui(*-v・)yui" << endl;
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;

const double PI = 3.1415926535897932384626433832795;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : abs(x); }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : abs(x); }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }

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

	string s;
	cin >> s;

	int k = s.size();

	int win = 0;
	for (auto c : s) {
		if (c == 'o') {
			win++;
		}
	}

	int add = 15 - k;
	if (win + add >= 8) {
		cout << "YES" << endl;
	} else {
		cout << "NO" << endl;
	}
	return 0;
}


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

const int INF = 1e+9+7;
const int MAX = 1e+5;


int main(){
    int N,Q;
    string S;
    cin >> N >> Q;
    cin >> S;

    vector<int> SUM(S.size()+1,0);
    rep2(i,1,S.size()){
        if(S[i]=='C'&&S[i-1]=='A'){
            SUM[i+1]=SUM[i]+1;
        }else{
            SUM[i+1]=SUM[i];
        }
    }

    vector<int> l(Q),r(Q);
    rep(i,Q) cin >> l[i] >> r[i];

    rep(i,Q) cout << SUM[r[i]] - SUM[l[i]] << endl;

}

Measured memory_bytes: 2176
/*
 * Author: .-O_O-.
 */
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define rep0(a,b) for(int a=0;a<b;a++)
#define rep1(a,b) for(int a=1;a<=b;a++)
#define repp(a,b,c) for(int a=b;a<c;a++)
#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()
#define f first
#define s second
#define pr(a) cout<<a
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define nx cout<<"\n"
#define int long long
// void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
                                                     
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]"<<endl;}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
const ll mod = 1000000007;
const ll N = 3005;
const ll mm = 1e+18;
void solve()
{
    int n;
    cin>>n;
    int a[n];
    rep0(i,n) cin>>a[i];
    int ans=0;
    rep0(i,n-2){
        repp(j,i+1,n-1){
            repp(k,j+1,n){
                if(a[i]+a[j]>a[k]&&a[i]+a[k]>a[j]&&a[j]+a[k]>a[i]&&a[i]!=a[j]&&a[i]!=a[k]&&a[j]!=a[k]) ans++;
            }
        }
    }
    pr(ans);
}
signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    //cin>>t;
    rep1(_i,t){
        //cout<<"Case #"<<_i<<": ";
        solve();
        //nx;
    }
    return 0;
}

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

int main() {
	int A, B, X;
	cin >> A >> B >> X;
	
	int Y = X-A;
	
	if(A > X) cout << "NO";
	else if(Y <= B) cout << "YES";
	else cout << "NO";
	
	cout << endl;

	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)               //repマクロ
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i) //多倍長
#define all(x) (x).begin(), (x).end()                              //先頭と最後を渡す
#define SZ(x) ((int)(x).size())                                    //sizeの返り値をunsigned int型からint型にする
//短くするだけ
#define pb push_back
#define mp make_pair
// 名前の変更
#define y0 y3487465
#define y1 y8687969
#define j0 j1347829
#define j1 j234892
#define next asdnext
#define prev asdprev

#define cauto const auto &                                      //これいる？
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()); //なにこれ
#define itn int                                                 //これいる？
// longlong型を省略して
typedef long long lint;

/* 最大値を更新するテンプレート */
template <class T>
bool umax(T &a, const T &b)
{
  if (a < b)
  {
    a = b;
    return 1;
  }
  return 0;
}
/* 最小値を更新するテンプレ */
template <class T>
bool umin(T &a, const T &b)
{
  if (b < a)
  {
    a = b;
    return 1;
  }
  return 0;
}

int main()
{
  int a[3];
  scanf("%d %d %d", &a[0], &a[1], &a[2]);
  if (a[0] > a[1])
  {
    int temp = a[0];
    a[0] = a[1];
    a[1] = temp;
  }
  if (a[0] > a[2])
  {
    int temp = a[0];
    a[0] = a[2];
    a[2] = temp;
  }
  if (a[1] > a[2])
  {
    int temp = a[1];
    a[1] = a[2];
    a[2] = temp;
  }
  if (a[0] == 5 && a[1] == 5 && a[2] == 7)
  {
    printf("YES\n");
  }
  else
  {
    printf("NO\n");
  }
}

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

int main() {
    int r, g, b, n; cin >> r >> g >> b >> n;
    int cnt = 0;
    for (int i = 0; i <= n/r ; i++) {
        for (int j = 0; j <= n/g; j++) {
            int tmp = r*i + g*j;
            if (tmp == n) {
                cnt++;
            }
            else if (n - tmp > 0 && (n-tmp)%b == 0) {
                cnt++;
            }
        }
    }
    

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 256
def main():
    M, N = map(int, input().split())
    S = input()
    T = input()

    INF = 10**18

    dp0 = [[0]*(N+1) for i in range(M+1)]
    dp1 = [[-INF]*(N+1) for i in range(M+1)]
    for p in range(M+1):
        for q in range(N+1):
            v0 = dp0[p][q]
            v1 = dp1[p][q]

            if p < M:
                if S[p] == 'I':
                    dp1[p+1][q] = max(dp1[p+1][q], v0+1)
                else:
                    dp0[p+1][q] = max(dp0[p+1][q], v1+1)
            if q < N:
                if T[q] == 'I':
                    dp1[p][q+1] = max(dp1[p][q+1], v0+1)
                else:
                    dp0[p][q+1] = max(dp0[p][q+1], v1+1)

    ans = max(max(e) for e in dp1)
    print(max(ans, 0))
main()



Measured memory_bytes: 290840
import java.util.Scanner;

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

		int k = sc.nextInt();

		System.out.println(k % 2 == 0 ? (k / 2) * (k / 2) : (k / 2) * (k / 2 + 1));

		sc.close();

	}
}



Measured memory_bytes: 21716
#include <algorithm>
#include <cassert>
#include <iostream>
#include <vector>
#include <cstdio>
#include <complex>
#include <cstring>
 
using namespace std;
 
typedef long long LL;
 
const int N = 5000 + 5;
const int M = 200 + 5;
const int INF = 1000000000 + 5;
 
int n, m;
int x[N];
int a[M];
LL tag[N << 2];
LL maxv[N << 2];
vector<pair<int, int> > st[M];
 
void modify(int t, int l, int r, int a, int b, LL v)
{
    if (b < l || r < a) return;
    if (a <= l && r <= b) {
        tag[t] += v;
        maxv[t] += v;
        return;
    }
    if (tag[t]) {
        tag[t << 1] += tag[t];
        maxv[t << 1] += tag[t];
        tag[t << 1 | 1] += tag[t];
        maxv[t << 1 | 1] += tag[t];
        tag[t] = 0;
    }
    int mid = (l + r) >> 1;
    modify(t << 1, l, mid, a, b, v);
    modify(t << 1 | 1, mid + 1, r, a, b, v);
    maxv[t] = max(maxv[t << 1], maxv[t << 1 | 1]);
}
 
LL query(int t, int l, int r, int a, int b)
{
    if (b < l || r < a) return 0;
    if (a <= l && r <= b) {
        return maxv[t];
    }
    if (tag[t]) {
        tag[t << 1] += tag[t];
        maxv[t << 1] += tag[t];
        tag[t << 1 | 1] += tag[t];
        maxv[t << 1 | 1] += tag[t];
        tag[t] = 0;
    }
    int mid = (l + r) >> 1;
    return max(query(t << 1, l, mid, a, b), query(t << 1 | 1, mid + 1, r, a, b));
}
 
void solve()
{
    cin >> n >> m;
    for(int i = 0; i < n - 1; ++ i) {
        scanf("%d", x + i);
    }
 
    long long ans = 0;
    for(int j = 0; j < m; ++ j) {
        st[j].push_back(make_pair(INF, -1));
    }
 
    for(int i = 0; i < n; ++ i) {
        long long tmp = 0;
        for(int j = 0; j < m; ++ j) {
            scanf("%d", a + j);
            tmp += a[j];
        }
        ans = max(ans, tmp);
 
        for(int j = 0; j < m; ++ j) {
            for( ; st[j].size() > 1; ) {
                if (a[j] >= st[j].back().first) {
                    int r = st[j].back().second;
                    int v = st[j].back().first;
                    st[j].pop_back();
                    int l = st[j].back().second + 1;
                    modify(1, 0, n - 1, l, r, -v);
                } else {
                    break;
                }
            }
            modify(1, 0, n - 1, st[j].back().second + 1, i, a[j]);
            st[j].push_back(make_pair(a[j], i));
        }
 
        if (i > 0) {
            modify(1, 0, n - 1, 0, i - 1, -x[i - 1]);
        }
        ans = max(ans, query(1, 0, n - 1, 0, i));
    }
    cout << ans << endl;
}
 
int main()
{
    solve();
    return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define ll long long
#define double long double
using namespace std;
ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	return x * y / gcd(x, y);
}
bool prime(ll n) {
	for (int i = 2; i*i <= n; i++) {
		if (n%i == 0)return false;
	}
	return true;
}
pair<double,string>a[11];
signed main() {
	ll n;
	double ans = 0;
	cin >> n;
	rep(i, n)cin >> a[i].first >> a[i].second;
	rep(i, n) {
		if (a[i].second == "JPY")ans += a[i].first;
		else ans += 380000*a[i].first;
	}
	cout << ans << endl;
	getchar(); getchar(); return 0;
}


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

int div26digit(long int N, int i){ //i=0,1,2...
  for(int j = 0; j<i; j++){
    N -= pow(26, j);
    if (N<0) return -1;
  }
  for(int j = 0; j<i; j++){
    N = N/26;
  }
  return (N+25)%26;
}


int main() {
  long int N;
  int digit[13];
  char a[13];
  cin >> N;
  for(int i = 0; i<13; i++){
    digit[i] = div26digit(N, i);
  }
  int j = 0;
  while(digit[j] >= 0){
    a[j] = 'a' + digit[j];
    j++;
  }
  j--;
  for (int k = 0; k < j; k++){
  	cout << a[j-k-1];
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3948
/*bismillah ->                                                                                                         << Suirkhanov Meyirlan >>
  GL HF


                                                                                                                      42

    bless my code =)
                                                                                                            NEVER FOLLOW YOUR RULES :D HAHAHAHA
*/


///scanf ("%d%d", &x, &y);
///printf("%d", &a)

#include <bits/stdc++.h>

#define fast ios_base::sync_with_stdio();   cin.tie(0);   cout.tie(0);
#define randoperation srand(time(0));
#define pii pair < int , int >
#define pll pair < ll, ll >
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define fast ios_base::sync_with_stdio();   cin.tie(0);   cout.tie(0);
#define randoperation srand(time(0));

using namespace std;

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

const ll N = 1e3 + 7;
const ld pi = 3.14159265359;
const int INF = 1e9 + 7;
const double eps = 1e-9;

const int xi[4] = {-1, 0, +1, 0};
const int yj[4] = {0, +1, 0, -1};
const int xxi[4] = {+1, 0, -1, 0};
const int yyj[4] = {0, -1, 0, +1};

int n, m;

bool u[N][N];

char a[N][N], ans[N][N];

int main(){

  //freopen("bridge.in", "r", stdin);
  //freopen("bridge.out", "w", stdout);

  fast
  randoperation;

  ///           ||
  ///start here \/

  cin >> n >> m;

  for(int i = 1; i <= n; i++){
    for(int j = 1; j <= m; j++){
      cin >> a[i][j];
    }
  }

  for(int i = 1; i <= n; i++){
    for(int j = 1; j <= m; j++){

      /// V

      bool t = 1;

      for(int k = 1; k <= n; k++){
        if(a[k][j] == '#'){
          t = 0;
        }
      }

      if(t){
        for(int k = 1; k <= n; k++){
          u[k][j] = 1;
        }
      }

      /// >

      t = 1;

      for(int k = 1; k <= m; k++){
        if(a[i][k] == '#'){
          t = 0;
        }
      }

      if(t){
        for(int k = 1; k <= m; k++){
          u[i][k] = 1;
        }
      }
    }
  }

  int cnt1 = 0, cnt2 = 0;

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

    int cnt = 0;

    for(int j = 1; j <= m; j++){
      if(u[i][j]){
        continue;
      }
      else{
        cout << a[i][j];
        cnt++;
      }
    }

    if(cnt == 0){
      continue;
    }
    else{
      cout << '\n';
    }
  }
}


Measured memory_bytes: 512
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
#include<vector>
#include<map>
using namespace std;

int read(){
	int x=0,f=1;
	char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=(x<<3)+(x<<1)+c-48;c=getchar();}
	return x*f;
}

int a[1000];
priority_queue<double> q;
int main(){
	int k,m,n;
	n=read();
	double num;
	for(register int i=1;i<=n;i++){
		scanf("%lf",&num);
		q.push(-num);
	}
	while(!q.empty()){
		double x,y;
		x=q.top()*-1;q.pop();
		if(q.size()==0){printf("%5lf\n",x);return 0;}
		y=q.top()*-1;q.pop();
		x=(x+y)/2;
		q.push(-x);
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define lli long long int
#define ulli unsigned long long int
#pragma GCC target ("sse4.2")
using namespace std;
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#define time cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
#define plli pair<lli,lli>
#define pslli pair<string,lli>
#define pclli pair<char,lli>
const lli N=4e5+5;


int main()
{


    fast;
    lli n,a;
    cin>>n>>a;
    vector<lli>v;
    lli t=0;
    for(lli i=0;i<a;i++)
    {
        lli x;
        cin>>x;
        v.push_back(x);
        t+=x;
    }
    if(t>=n)
        cout<<"Yes";
    else
        cout<<"No";




    return 0;

}


Measured memory_bytes: 1400
#include <iostream>

using namespace std;

int main()
{
    int n,ans=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        if(i>=1&&i<=9) ans++;
        if(i>=100&&i<=999) ans++;
        if(i>=10000&&i<=99999) ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	int h, w;
	scanf("%d%d", &h, &w);
	for(int i = 0; i < w+2; i++){
		printf("#");
	}
	printf("\n");
	char pic[w];
	for(int i = 0; i < h; i++){
		scanf("%s", &pic[0]);
		printf("#%s#\n", pic);
	}
	for(int i = 0; i < w+2; i++){
		printf("#");
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#include <time.h>
typedef long long ll;
typedef long double ld;
#define INF (1LL<<60)
#define MOD1 1000000007
/*swap 交換*/
void swap(ll *a, ll *b){ll c;c=*b;*b=*a;*a=c;}
/*2つのうち大きい数を返す*/
ll max2(ll a,ll b){return a>=b?a:b;}
/*2つのうち小さい数を返す*/
ll min2(ll a,ll b){return a>=b?b:a;}
/*絶対値*/
ll ABS(ll a){return a>=0?a:(-a);}
typedef struct{
    ll aa;
    ll bb;
}frequent;
// 小大
int compare(const void *a, const void *b){
    return *(ll *)a>*(ll *)b?1:*(ll *)a<*(ll *)b?-1:0;}
/*GCD*/
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
/*LCM*/
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(void){
    ll n,i,ans=1;
    scanf("%lld",&n);
    ll t[n];
    for(i=0;i<n;i++){
        scanf("%lld",&t[i]);
        ans=lcm(ans,t[i]);    
    }
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 128
n = int(input())
a = list(map(int, input().split()))
import sys
input = sys.stdin.readline

#iを篩にかけた数をmemo
def sieve_table(n):
    table = [0] * (n+1)
    for i in range(2, n+1):
        if table[i] > 0:
            continue

        table[i] = i
        for j in range(2 * i, n+1, i):
            table[j] = i
    return table

#tableから素因数分解
def factorization_from_table(x, table):
    res = set()
    while x > 1:
        res.add(table[x])
        x //= table[x]
    
    return res

table = sieve_table(10 ** 6)
set_primes = set()

flg = True
for i in range(n):
    res = factorization_from_table(a[i], table)
    if len(set_primes & res) > 0:
        flg = False
        break
    
    for x in res:
        set_primes.add(x)
        
if flg:
    print('pairwise coprime')
else:
    from math import gcd
    tmp = a[0]
    for i in range(1, n):
        tmp = gcd(tmp, a[i])
    
    if tmp == 1:
        print('setwise coprime')
    else:
        print('not coprime')

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

int main() {
    string S, T;
    cin >> S >> T;

    bool flag = true;
    char map_S[26] = {}, map_T[26] = {};
    for (char c = 'a'; c <= 'z'; c++) {
        for (int i = 0; i < S.length(); i++) {
            if (S[i] == c) {
                if (map_S[c - 'a'] == 0) {
                    map_S[c - 'a'] = T[i];
                } else if (map_S[c - 'a'] != T[i]) {
                    flag = false;
                }
            }
            if (T[i] == c) {
                if (map_T[c - 'a'] == 0) {
                    map_T[c - 'a'] = S[i];
                } else if (map_T[c - 'a'] != S[i]) {
                    flag = false;
                }
            }
        }
    }

    cout << (flag ? "Yes" : "No") << endl;
}

Measured memory_bytes: 1020
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n; cin >> n;
  vector<int> a(n, 0);
  for (int i = 0; i < n; i++)
    cin >> a[i];
  int max = a[0];
  int64_t h = 0LL;
  for (int i = 1; i < n; i++) {
    int ai = a[i];
    if (ai >= max)
      max = ai;
    else 
      h += max - ai;
  }
  cout << h << endl;
  return 0;
}


Measured memory_bytes: 3980
///スマホコーディング
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<int(n);++i)
typedef long long ll;
const int inf=1e9;
int main(){
  string n;cin>>n;
  cout<<"ABC"<<n<<endl;
  return 0;
}

Measured memory_bytes: 256
use std::io::stdin;

fn main() {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    let a = s
        .split_whitespace()
        .map(|e| e.chars().next().unwrap())
        .skip(1)
        .next()
        .unwrap();

    println!("A{}C", a);
}


Measured memory_bytes: 4352
N,K = (int(x) for x in input().split())
A = list(map(int, input().split()))
newlist = [1,A[0]]
num = A[0] - 1
ans = [0]*N
ans[0] = 1
ans[A[0]-1] = 1
b = 0
c = 0
r = 0
for i in range(K):
    if(ans[A[num]-1] == 1):
        b = A[num]
        break
    newlist.append(A[num])
    ans[A[num]-1] = 1
    num = A[num]-1
for i in range (len(newlist)):
    if(newlist[i] == b):
        c = i
r = len(newlist)-c
a = (K-c)%r
print(newlist[c+a])

Measured memory_bytes: 32376
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<climits>
#include<map>
#define ll long long
using namespace std;
ll kaijou(ll t) {
	if (t ==0) {
		return 1;
	}
	else {
		return t * kaijou(t - 1);
	}
}

int main() {
	ll n, k;
	cin >> n >> k;
	if (n > k||k>n) {
		cout << (ll)(k * pow(k - 1, n - 1)) << endl;;
	}
	else {
		cout<<kaijou(k)<<endl;
	}
	
}





Measured memory_bytes: 512
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <stdio.h>
#include <cmath>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <functional>
#include <set>
#include <tuple>
#include <map>
#include <numeric>

using namespace std;
#define PI 3.14159265359
#define ll long long int

int main(void)
{
    ll a, b;
    cin >> a >> b;
    if(a > b){
        for(int i = 0; i < a; i++){
            printf("%c", b + '0');
        }
    }else{
        for(int i = 0; i < b; i++){
            printf("%c", a + '0');
        }
    }

    cout << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long A,C;
  double long B;
  
  cin >> A >> B;
  
  C = A*B*1000000000000000LL/1000000000000000LL;
  (long long)C;
  
  cout << C << endl;
  
}

Measured memory_bytes: 3732
import java.util.Scanner;

public class Main{

     public static void main(String []args){
        
        Scanner stdIn = new Scanner(System.in);
        
        int a = stdIn.nextInt();
        int b = stdIn.nextInt();
        
        if(a + b == 15){
            System.out.println("+");
        }
        else if(a * b == 15){
            System.out.println("*");
        }
        else{
            System.out.println("x");
        }
     }
}


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

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

    int sum[n] = { 0 };
    int count = 0;
    for (auto i = 0; i < n; i++) {
        if(s[i] == 'E') count++;
        sum[i] += count;
    }

    int min = sum[n - 1];
    for (auto i = 1; i < n; i++) {
        int tmp = (sum[n - 1] - sum[i]) + (i - sum[i - 1]);
        if(tmp < min) min = tmp;
    }

    cout << min << endl;
    return 0;
}

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

using namespace std;

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

  int N;
  cin >> N;
  int ans = (N + 1) / 1.08;

  if (int(ans * 1.08) != N) {
    cout << ":(" << endl;
    return 0;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3620
S = [c for c in input()]
T = [c for c in input()]
ST = [[s,t] for s,t in zip(S,T)]
S_dict = {}
T_dict = {}
for s,t in ST:
    if s not in S_dict:
        S_dict[s] = [t]
    elif t not in S_dict[s]:
        S_dict[s].append(t)
    if t not in T_dict:
        T_dict[t] = [s]
    elif s not in T_dict[t]:
        T_dict[t].append(s)

S_tmp = max([len(x) for x in S_dict.values()])
T_tmp = max([len(x) for x in T_dict.values()])
tmp = max(S_tmp, T_tmp)
flag = True if tmp < 2 else False
print('Yes' if flag else 'No')
# print(S_dict)

Measured memory_bytes: 26660
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,a,b) for(int i=a;i<b;i++)
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define vi vector<int>
#define vv vector<vi>
#define pb push_back
#define pi pair<int,int>
#define vp vector<pair<int,int> >
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define INF 100000000000
#define eps 1e-7
#define mod 1000000007
#define itn int
#define int ll
using namespace std;

int A,B;

signed main(void) {
    cin>>A>>B;
    int ans=0;
    rep(i,2) {
        if (A>B) {
            ans+=A;
            A--;
        } else {
            ans+=B;
            B--;
        }
    }
    cout<<ans<<endl;
    return 0;
}

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

int main(){
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;
    const int dx = tx -sx, dy = ty -sy;

    cout << string(dy, 'U') << string(dx, 'R');
    cout << string(dy, 'D') << string(dx, 'L');

    cout << 'L' << string(dy + 1, 'U') << string(dx + 1, 'R') << 'D'; 
    cout << 'R' << string(dy + 1, 'D') << string(dx + 1, 'L') << 'U';

    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void) {
	// Your code here!
	char S[16];
	cin >> S;

	int nSNum = 100000;

	for (int i = 0; i < 10; i++) {
		if (S[i + 2] == '\0')break;
		int nNum = (S[i]-'0') * 100 + (S[i + 1] - '0') * 10 + (S[i + 2] - '0');
		int nDifNum = 753 - nNum > 0 ? 753 - nNum : nNum - 753;
		if (nSNum > nDifNum)nSNum = nDifNum;
	}

	cout << nSNum << endl;
	return 0;
}

Measured memory_bytes: 256
program main;
var
	k, a, b, count, i : integer;

begin
	read(k);
    readln(a, b);
    
    if k = 1
    	then writeln('OK')
        	else begin
            	count := 0;
            	for i := a to b do begin
                	if (frac(i / k) = 0)
                    	then count := count +1;
                 end;
     if count <> 0
     	then writeln('OK')
        		else writeln('NG');
    end;
end.
   
    

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

int main(){
	int n;
	while(cin>>n){
		if(n==0)break;
		int a[n];
		int M=0,m=1e5;
		for(int i=0;i<n;i++){
			cin>>a[i];
		}
		int sum=0;
		for(int i=0;i<n;i++){
			M=max(a[i],M);
			m = min(a[i],m);
			sum+=a[i];
		}
		sum-=(M+m);
		cout<<sum/(n-2)<<endl;
	}
}


Measured memory_bytes: 3044
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;

const long long mod = 1000000007;
const long long inf = 1e18;

string bin(int a){
    string s="";
    while(a>0){
        s+='0'+(a&1);
        a>>=1;
    }
    return s;
}

int iscontain(string x,string y){
    for(int i=0;i<y.length();i++){
        if(y[i]=='0' && x[i]=='1')
            return 0;
    }
    return 1;
}


int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll n,k;
    cin>>n>>k;
    string s=bin(k);
    int l=s.length();
    vector<string> a(n);
    vector<ll> b(n);
    for(int i=0;i<n;i++){
        ll p,q;
        cin>>p>>q;
        a[i]=bin(p);
        while(a[i].length()<l){
            a[i]+='0';
        }
        b[i]=q;
        if(p>k)
            b[i]=0;
    }
    vector<string> kr;
    for(int i=0;i<l;i++){
        if(s[i]=='1'){
            string p=s;
            for(int j=0;j<i;j++){
                p[j]='1';
            }
            p[i]='0';
            kr.pb(p);
        }
    }
    kr.pb(s);
    ll ans=0;
    for(int j=0;j<kr.size();j++){
        ll count=0;
        for(int i=0;i<n;i++){
            if(iscontain(a[i],kr[j])==1){
                count+=b[i];
            }
        }
        if(count>ans)
            ans=count;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 10624
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin>>N;
  string S;
  int ans=0;
  for(int i=0;i<N;i++){
    cin>>S;
    if(S=="Y"){
      ans=1;
      break;
    }
  }
  cout<<(ans?"Four":"Three")<<endl;
}

Measured memory_bytes: 256
/* ***********************************************
Author        :Tisuama
Created Time  :2017年09月10日 星期日 11时12分28秒
File Name     :A.cpp
************************************************ */
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
int n;
int main()
{
    while(~scanf("%d",&n))
    {
        int ans=0;
        while(n)
        {
            if(n%10==9)
                ans=1;
            n/=10;
        }
        puts(ans==0?"No":"Yes");
    }    
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
N = int(input())
a = map(int,input().split(" "))

x = {}

for i in a:
    if i not in x:
        x[i] = 0
    x[i] = x[i]+1

out = 0
for k in x:
    v = x[k]
    if v < k:
        out = out + v
    if v > k:
        out = out + v - k

print(out)

Measured memory_bytes: 23292
#include "bits/stdc++.h"
using namespace std;

int main() {
	int N, C, MAX = 0;
	static int s[100000], t[100000], c[100000], M[200010], T[200010];
	cin >> N >> C;
	for (int i = 0; i < N; i++) {
		cin >> s[i] >> t[i] >> c[i];
	}
	for (int i = 1; i <= C; i++) {
		for (int j = 0; j < 200010; j++) T[j] = 0;
		for (int j = 0; j < N; j++) if (c[j] == i) T[s[j] * 2 - 1]++, T[t[j] * 2]--;
		for (int j = 1; j < 200010; j++) T[j] += T[j - 1];
		for (int j = 0; j < 200010; j++) if (T[j] > 0) M[j]++;
	}
	for (int i = 0; i < 200010; i++) MAX = max(MAX, M[i]);
	cout << MAX;
}

Measured memory_bytes: 2944
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<vector>
#include<set>
#include<list>
#include<queue>
#include<cmath>
#include<functional>
#include<algorithm>
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(n);i++)
using namespace std;


struct Range{
	int s,e;
	Range(){}
	Range(int s,int e):s(s),e(e){}
	bool operator<(const Range &r)const{return e<r.e;}
};
vector<Range> merge_range(vector<Range> r){
	vector<Range> res;
	sort(r.begin(),r.end());
	for(int i=0;i<(int)r.size();i++){
		int mi=r[i].s;
		while(!res.empty()&&r[i].s<=res.back().e){
			mi=min(mi,res.back().s);
			res.pop_back();
		}
		res.push_back(Range(mi,r[i].e));
	}
	return res;
}


int main(){
	int n,m;
	Range r[500];
	cin>>n>>m;
	rep(i,m)cin>>r[i].s>>r[i].e;
	int ans=n+1;
	vector<Range> vr(merge_range(vector<Range>(r,r+m)));
	rep(i,vr.size()){
		ans+=(vr[i].e-vr[i].s)*2;
	}
	cout<<ans<<endl;
	return 0;
}

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

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; }

using ll = long long;

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

ll pr(ll x){//因数の個数を返す
  vector<ll> v;
  ll y = x;
  for(ll i = 2LL;i*i<=x;i++) {
    if(y%i==0LL){
      ll z = 0LL;
      while(y%i==0LL){
        y/=i;
        z++;
      }
      v.push_back(z);
    }
  }
  if(y!=1LL) v.push_back(1LL);
  ll cnt = 1LL;
  for(auto t:v){
    cnt*=(t+1);
  }
  return cnt;
}

ll f(ll x) {
  ll cnt = 0LL;
  for(ll i = 2LL; i*i<=x; i++) {
    if(x%i!=0LL)continue;
    ll y = x;
    while(y%i==0LL){
      y/=i;
    }
    if(y%i==1LL)cnt++;
  }
  return cnt;
}
  

int main() {
  ll N;
  cin >> N;
  cout<<pr(N-1LL)+f(N)<<endl;
}


Measured memory_bytes: 256
package main

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

func main() {
	sc := NewScanner()
	S := sc.NextToken()
	var days = []string{"SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"}
	for i, d := range days {
		if S == d {
			a := (0 - i + 7) % 7
			if a == 0 {
				a = 7
			}
			fmt.Println(a)
		}
	}
}

type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return &Scanner{sc: sc}
}

func (r *Scanner) SetBufferSize(size int) {
	buf := make([]byte, size)
	r.sc.Buffer(buf, size)
}

func (r *Scanner) NextToken() string {
	r.sc.Scan()
	return r.sc.Text()
}

func (r *Scanner) NextInt64() int64 {
	n, e := strconv.ParseInt(r.NextToken(), 10, 64)
	if e != nil {
		panic(e)
	}
	return n
}

func (r *Scanner) NextInt() int {
	n, e := strconv.ParseInt(r.NextToken(), 10, 32)
	if e != nil {
		panic(e)
	}
	return int(n)
}

func (r *Scanner) NextInt64Array(size int) []int64 {
	a := make([]int64, size)
	for i := 0; i < size; i++ {
		a[i] = r.NextInt64()
	}
	return a
}

func (r *Scanner) NextIntArray(size int) []int {
	a := make([]int, size)
	for i := 0; i < size; i++ {
		a[i] = r.NextInt()
	}
	return a
}


Measured memory_bytes: 640