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

using namespace std;

#define FC ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define FIN freopen("in.txt","r",stdin)
#define FOUT freopen("out.txt","w",stdout)
#define deb(x) cerr<<"DEBUG------"<<'\n';cerr<<#x<<"------>";err(x)

template<typename T>
void err(T a){
    cerr<<a<<'\n';
    cerr<<"END OF DEBUG"<<'\n'<<'\n';
}

const long double PI=acos(-1.0);  
const long double eps=1e-6;
const long long maxw=(long long)1e17+(long long)10;

using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

/*head------[@cordercorder]*/

const int maxn=(int)1e5+10; 

int n,m;
vector<int> e[maxn];
int dp[maxn];

int dfs(int u){
    if(dp[u]!=-1){
        return dp[u];
    }
    int v,ans=0;
    for(int i=0;i<(int)e[u].size();i++){
        v=e[u][i];
        ans=max(ans,dfs(v)+1);
    }
    dp[u]=ans;
    return ans;
}

void solve(){
    for(int i=1;i<=n;i++){
        dp[i]=-1;
    }
    int ans=0;
    for(int i=1;i<=n;i++){
        ans=max(ans,dfs(i));
    }
    printf("%d\n",ans);
}

int main(void){
    int u,v;
    scanf("%d %d",&n,&m);
    for(int i=1;i<=m;i++){
        scanf("%d %d",&u,&v);
        e[u].push_back(v);
    }
    solve();
    return 0;
}

Measured memory_bytes: 8832
#include<bits/stdc++.h>
using namespace std;
#define V vector
#define L long long
#define W V<L>
#define R(n) for(L i=0;i<n;i++)
L E=70;W S(V<W>p){if(!E){return{1,0};}V<V<W>>T(2);for(W x:p){T[x[1]&1].push_back({x[0]/2,x[1]/2});if(x[0]&1){T[(x[1]+1)&1].push_back({x[0]/2,(x[1]+1)/2});}}R(2){L c=0;for(W x:T[!i]){L Q=(2*x[0]+x[1])%3;c^=Q+1;}if(!c){E--;W A=S(T[i]);A[0]*=2;A[1]*=2;A[1]+=i;return A;}}for(W&v:p){v[0]++;}W A=S(p);A[0]--;return A;}int main(){L M=2e17,n;cin>>n;V<W>p(n);R(n){L a,b;cin>>a>>b;p[i]={a+M,b+M};}W x=S(p);cout<<x[0]-M<<" "<<x[1]-M;}

Measured memory_bytes: 62908
package main

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

func main() {
	in := IOInitialize()
	x, a, b := Int(in), Int(in), Int(in)

	for x = x - a - b; x > -1; x -= b {

	}
	fmt.Println(x + b)
}

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

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

func Int(s *bufio.Scanner) int {
	if !s.Scan() {
		panic("\t\tThere is a FALSE not to want.")
	}

	value, err := strconv.Atoi(s.Text())
	if err != nil {
		panic("\t\tError:Failed to convert text to int,")
	}
	return value
}

func IntArray(s *bufio.Scanner, size int) []int {
	deepArray := make([]int, size)
	for i := range deepArray {
		deepArray[i] = Int(s)
	}
	return deepArray
}

func GraphSetByEdge(s *bufio.Scanner, v int) [][]int {
	g := make([][]int, v)
	for i := range g {
		g[i] = make([]int, 0)
	}
	for xxNonUsedInLoopI := 0; xxNonUsedInLoopI < v-1; xxNonUsedInLoopI++ {
		a, b := Int(s)-1, Int(s)-1
		g[a] = append(g[a], b)
		g[b] = append(g[b], a)
	}

	return g
}

Measured memory_bytes: 640
#include <stdio.h>
#include <utility>
#include <algorithm>
typedef long long ll;

int main(void) {
  ll i, j, n, t, ans = 0;
  scanf("%lld%lld", &n, &t);
  ll dp[t + 3000];
  std::pair<ll, ll> p[n];
  for(i = 0; i < t + 3000; ++i) dp[i] = 0;
  for(i = 0; i < n; ++i) scanf("%lld%lld", &p[i].first, &p[i].second);
  std::sort(p, p + n);
  for(j = 0; j < n; ++j) {
    for(i = t - 1; i >= 0; --i) if(dp[i + p[j].first] < dp[i] + p[j].second) dp[i + p[j].first] = dp[i] + p[j].second;
  }
  for(i = 0; i < t + 3000; ++i) if(dp[i] > ans) ans = dp[i];
  printf("%lld", ans);
  return 0;
}

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

int		main(void)
{
	int a, b, c;

	cin >> a >> b >> c;
	for (int i = 0; i < a; i++)
	{
		if ((b * i + c) % a == 0)
		{
			cout << "YES" << endl;
			return (0);
		}
	}
	cout << "NO" << endl;
}



Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author toshibablack
 */

#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstring>
#include <fstream>
#include <functional>
#include <iostream>
#include <iomanip>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#define ll long long int
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define REP(i, n) for(int i=0;i<n;++i)
#define FOREACH(x, a) for(auto& (x) : (a))
#define ALL(a) (a).begin(),(a).end()
#define OUT(x) out << (x) << endl;
#define M0(x) memset(x,0,sizeof(x))
#define MINF(x) memset(x,0x3f,sizeof(x))
#define MMINUS(a) memset(a,0xff,sizeof(a))

const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
const ll LINF = 1e18;
const double EPS = 1.0/LINF;
const char ENDL = '\n'; // for JetBrains IDE only supports yen

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

int gcd(int a,int b){return b?gcd(b,a%b):a;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

using namespace std;

class BAlgae {
public:
    int r, D, x2000;

    void solve(std::istream& in, std::ostream& out) {
        in >> r >> D >> x2000;

        int ans = x2000;
        REP(i, 10) {
            ans = r * ans - D;
            OUT(ans);
        }
    }
};


int main() {
    BAlgae solver;
    std::istream& in(std::cin);
    std::ostream& out(std::cout);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
ll mod = 1000000007;

int main() {
    const int INF = 2000000010;
    int n, t;
    cin >> n >> t;
    int a[n];
    rep(i, n) {
        cin >> a[i];
    }

    int b[n];  /* b[i]には、a[i](i = 1 ～ n-1)に対する
                  a[j](j = 0 ～ i-1)の最小値が入る。
                  ただしb[0] = INF とする */

    b[0] = INF;
    rep(i, n-1) {
        if(a[i] < b[i]) {
            b[i+1] = a[i];
        }
        else {
            b[i+1] = b[i];
        }
    }

    int c[n];
    rep(i, n) {
        c[i] = a[i] - b[i];
    }

    sort(c, c+n);
    reverse(c, c+n);

    int ans = 0;
    rep(i, n) {
        if(c[0] > c[i]) {
            break;
        }
        ans++;
    }

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

Measured memory_bytes: 1408
#include<iostream>
#include<string>

using namespace std;

int main(){
    string s;
    char tmp;
    int n,cnt=1;
    cin>>n;
    cin>>s;
    tmp=s[0];
    for(int i=1; i<n; i++){
        if(tmp!=s[i]){
            tmp=s[i];
            cnt++;
        }
    }
    cout<<cnt<<endl;
    return 0;
}

Measured memory_bytes: 512
using System;

namespace algorithm
{
	class Program
	{
		
		static void Main(string[] args)
		{
			string[] divide = { "maerd", "esare", "resare", "remaerd" };

			char[] chars = Console.ReadLine().ToCharArray();
			Array.Reverse(chars);
			string s = new string(chars);
			
			for (int i = 0; i < s.Length;)
			{
				bool flg = false;
				for (int j = 0; j < divide.Length; j++)
				{
					if (i + divide[j].Length > s.Length)
					{
						flg = false;
					}
					else if (s.Substring(i, divide[j].Length) == divide[j])
					{
						flg = true;
						i += divide[j].Length;
						
						break;
					}
				}
				if (!flg)
				{
					Console.WriteLine("NO");
					return;
				}
				if (i >= s.Length) break;
			}

			Console.WriteLine("YES");


		}

	}
}


Measured memory_bytes: 13664
#include<cstdio>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
 
using namespace std;
 
#define reps(i,f,n)for(int i = f; i < int(n); i++)
#define rep(i,n) reps(i,0,n)
#define PII pair<int, int>
#define PPI pair< int, PII >
 
int visited[2][128];
 
priority_queue< PPI , vector< PPI > , greater< PPI > > q;
vector< PII > e[128];
int z[128][128];
int n,m;
 
void mE(){
    rep(i,128){
        rep(j, e[i].size()){
            int x = e[i][j].first;
            rep(k, e[x].size()){
                z[i][e[x][k].first] = 0;
            }
        }
    }
}
 
 
int Dijkstra(){
    //1->n
    q.push(make_pair<int, PII >(0, make_pair<int,int>(1,0)));
 
 
    while(!q.empty()){
        int cost = q.top().first;
        int np = q.top().second.first;
        int use = q.top().second.second;
        q.pop();
        //cout << np << ":" << cost << ":" << use << endl;
 
        if(np == n)return cost;
        if(visited[use][np])continue;
        visited[use][np] = 1;
 
        rep(i,e[np].size()){
            //cout << "s:" << e[np][i].second + cost << ":" << e[np][i].first << ":" << use << endl;
            q.push(make_pair<int,PII >(e[np][i].second+cost, make_pair<int,int>(e[np][i].first, use)));
        }
 
        if(use == 0){
            rep(i,128){
                if(z[np][i] == 100000000)continue;
                //cout << "use :" << i << endl;
                //cout << "u:" << cost + 0 << ":" << i << ":" << 1 << endl;
                q.push(make_pair<int,PII >(cost+0, pair<int,int>(i, 1)));
            }
        }
    }
 
    return -1;
}
 
int main(void){
 
    int a,b,c;
    while(1){
        scanf("%d%d", &n, &m);
        if(n+m==0)break;
        rep(i,128)rep(j,128)z[i][j] = 100000000;
        rep(j,2)rep(i,128)visited[j][i] = 0;
        rep(i,128)e[i].clear();
 
        rep(i,m){
            scanf("%d%d%d", &a, &b, &c);
            e[a].push_back(make_pair<int,int>(b,c));
            e[b].push_back(make_pair<int,int>(a,c));
        }
 
        mE();
 
        printf("%d\n", Dijkstra());
 
        while(!q.empty())q.pop();
    }
 
    return 0;
}

Measured memory_bytes: 1280
///Bismillahir Rahmanir Rahim
#include "bits/stdc++.h"

#define                           ll                          long long
#define                           int                         ll
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<ll,ll>
#define                           clr(x)                      memset(x,0,sizeof(x));
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           show(x,y)                   cout<<x<<" : ";for(auto z:y)cout<<z<<" ";cout<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);

using namespace std;

const ll inf=1e18;
const int mod=1e9+7;
const int M=100005;

 main()

{
    fast
    int n;
    cin>>n;
    int val=2*n;
    int k=-1;
    for(int i=1;i*i<=val;i++)
    {
        if(val%i==0)
        {
            int x=i;
            int y=val/i;
            if(x>y)swap(x,y);
            if(y-1==x)
            {
                k=y;
            }
        }
    }
    if(k==-1)
    {
        cout<<"No"<<endl;return 0;
    }
    cout<<"Yes"<<endl;
    vector<int>vec[k+2];
    int cur=1;
    f(i,1,k-1)
    {
        int niche=k-i;
        int lft=cur;
        int rgt=cur+niche-1;
        f(j,lft,rgt)
        {
            vec[i].pb(j);
        }
        for(int j=i+1,x=lft;j<=k;j++,x++)
        {
           vec[j].pb(x);
        }
        cur=rgt+1;
    }
    cout<<k<<endl;
    f(i,1,k)
    {
        int sz=vec[i].size();
        cout<<sz;
        for(auto x:vec[i])
        {
            cout<<" "<<x;
        }
        cout<<endl;
    }
    return 0;

}





































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

int main() {
	vector<vector<int>> c(3,vector<int>(3));
	vector<int> x(3);
	int i, j;
	for (i = 0; i < 3; ++i)
	{
		for (j = 0; j < 3; ++j) {
			cin >> c[i][j];
		}
		cout << endl;
	}
	for (i = 1; i < 3; ++i)
	{
		for (j = 0; j < 3; ++j) {
			x[j] = c[i][j] - c[0][j];
		}
		if (x[0] != x[1] || x[0] != x[2] || x[1] != x[2]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include<stdlib.h>
#include<stdio.h>
#define test ll t; cin>>t; while(t--)
#define FOR(p,n) for(ll i=p;i<(ll)n;i++)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<100007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
using namespace std;
void solve()
{
	double a,b;
	int ans=0;
	cin>>a>>b;
	for(int i=1;i<=10000;i++)
	{
		double x=floor(i*0.08);
		double y=floor(i*0.1);
		if(x==a && y==b)
		{
			ans++;
			cout<<i<<endl;
			break;
		}
	}
	if(ans==0)
		cout<<"-1"<<endl;
	
}
signed main()
{
	fastio;
//	test
		solve();
}




Measured memory_bytes: 256
#-----------にゃんにゃん準備-----------#
def nyan(f=lambda x: x): return map(f,input().split())
#------------にゃんにゃん------------#
a,b,c = nyan(int)
print(min(a+b,b+c,c+a))
#---------にゃんにゃんおしまい---------#

Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int n,m;
vi a,b;

int main(){
	cin>>n>>m;
	a=b=vi(n);
	m/=100;
	for(int i=0;i<n;i++){
		cin>>a[i]>>b[i];
		b[i]/=100;
	}
	int res=inf;
	for(int i=0;i<1<<n;i++){
		int A=0,B=0;
		for(int j=0;j<n;j++) if(i&1<<j){
			A+=a[j];
			B+=a[j]*(j+1)+b[j];
		}
		if(m>B){
			for(int j=n-1;j>=0;j--) if(!(i&1<<j)){
				for(int k=1;k<a[j];k++){
					A++;
					B+=j+1;
					if(m<=B) break;
				}
				if(m<=B) break;
			}
		}
		if(m<=B) res=min(res,A);
	}
	cout<<res<<endl;
}

Measured memory_bytes: 256
using System;
using System.Diagnostics;
using System.IO;

namespace AtCoder.MinPuro2019 {
    class C {
        static void Main() => CustomMain();

        static void Solve() {
            int k, a, b;
            ReadMulti(out k, out a, out b);

            long bs = 1;
            var m = 0;
            for (int i = 0; i < k; i++) {
                if (0 < m) {
                    m--;
                    bs += b;
                } else if (i != k - 1 && a < b && a <= bs) {
                    m++;
                    bs -= a;
                } else {
                    bs++;
                }
            }

            WriteAnswer(Math.Max(k + 1, bs));
        }

        static void CustomMain() {
#if DEBUG
            // ファイルからテストケースを読み込む
            global::Common.ChangeStdIn();
            // 時間計測
            var stopwatch = new Stopwatch();
            stopwatch.Start();
#endif
            // 出力高速化
            var streamWriter = new StreamWriter(Console.OpenStandardOutput()) {AutoFlush = false};
            Console.SetOut(streamWriter);
            // 回答
            Solve();
#if DEBUG
            stopwatch.Stop();
            Console.WriteLine(stopwatch.Elapsed);
#endif
            Console.Out.Flush();
        }

        static int ReadInt() => int.Parse(Console.ReadLine());
        static long ReadLong() => long.Parse(Console.ReadLine());
        static float ReadFloat() => float.Parse(Console.ReadLine());
        static double ReadDouble => double.Parse(Console.ReadLine());
        static string ReadString() => Console.ReadLine();

        static int[] ReadIntArray() => Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        static long[] ReadLongArray() => Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        static float[] ReadFloatArray() => Array.ConvertAll(Console.ReadLine().Split(' '), float.Parse);
        static double[] ReadDoubleArray() => Array.ConvertAll(Console.ReadLine().Split(' '), double.Parse);
        static string[] ReadStringArray() => Console.ReadLine().Split(' ');

        static T TypeConversion<T>(string s) {
            if (typeof(T) == typeof(int)) {
                return (T) Convert.ChangeType(int.Parse(s), typeof(T));
            } else if (typeof(T) == typeof(long)) {
                return (T) Convert.ChangeType(long.Parse(s), typeof(T));
            } else if (typeof(T) == typeof(double)) {
                return (T) Convert.ChangeType(double.Parse(s), typeof(T));
            } else {
                return (T) Convert.ChangeType(s, typeof(T));
            }
        }

        static void ReadMulti<T, U>(out T a, out U b) {
            var str = ReadStringArray();
            a = TypeConversion<T>(str[0]);
            b = TypeConversion<U>(str[1]);
        }

        static void ReadMulti<T, U, V>(out T a, out U b, out V c) {
            var str = ReadStringArray();
            a = TypeConversion<T>(str[0]);
            b = TypeConversion<U>(str[1]);
            c = TypeConversion<V>(str[2]);
        }

        static void WriteAnswer(object ans) => Console.WriteLine(ans);
    }
}

Measured memory_bytes: 11092
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
#define ll long long
#define ull long long unsigned
using namespace std;
#define foru(i,a,n) for (int i=(a); i<=(n); i++)
#define ford(i,n,a) for (int i=(n); i>=(a); i--)
#define rep(i,n) for(int i=0; i<n; i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define bit1cnt(x) (__builtin_popcountll(x))
#define sqr(x) ((x) * (x))
#define sz(x) ((int)(x.size()))
#define Pi 3.14159265358979
#define ii pair<int,int>
#define LL pair<ll,ll>
const int N = 2e5;

int main(){
    ios::sync_with_stdio(0); cin.tie(0);
    string s, t;
    cin >>s >>t;
    int n = s.size() - 1;
    int m = t.size() - 1;
    sort(s.begin(), s.end());
    sort(t.begin(), t.end());
    if(n < m){
        if(t.find(s) != string::npos)
            cout <<"Yes";
        else{
            if(t[m] > s[0])
                cout <<"Yes";
            else
                cout <<"No";
        }
    }
    else{
        if(t[m] > s[0])
            cout <<"Yes";
        else
            cout <<"No";
    }
    return 0;
}


Measured memory_bytes: 256
// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_1_A&lang=jp
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double pi=3.141592653589793;
typedef unsigned long long ull;
typedef long double ldouble;
const ll INF=1e18;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)

vector<int> d(50001);
vector<int> V(20);
int n, m;

int bfs(){
    queue<int> que;
    rep(i, n+1) d.at(i) = -1;
    rep(i, m){
        que.push(V.at(i));
        d.at(V.at(i)) = 1;
    }
    while(que.size()){
        int p = que.front();
        que.pop();
        if(p > n) break;
        rep(i, m) {
            if(p+V.at(i) <= n && d.at(p+V.at(i)) == -1){
                que.push(p+V.at(i));
                d.at(p+V.at(i)) = d.at(p) + 1;
            }
        }
    }
    return d.at(n);
}

int main(){
    cin >> n >> m;
    rep(i, m){
        cin >> V[i];
    }

    int answer = bfs();
    cout << answer << endl;
}


Measured memory_bytes: 3236
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL


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

    int N;
    char s[3*100000 + 1];
    scanf("%d%s", &N, s);

    vs32 L(N + 1, 0);
    L[0] = 0;
    int ans = N;
    rep (i, N)
    {
        L[i + 1] = L[i];
        if (s[i] == 'W') ++L[i + 1];
        ans = MIN(ans, L[i + 1] + L[i] - i);
    }

    printf("%d\n", ans + N - 1 - L[N]);
    return 0;
}



Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define DBG_N(hoge) cerr<<" "<<(hoge)<<endl;
#define DBG cerr<<"!"<<endl;
#define BITLE(n) (1LL<<((ll)n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a,b,c,d,e;
  string s,ss,sss;
  cin>>a;
  b=a/100;
  c=a%100;
  if(1<=b&&b<=12&&1<=c&&c<=12){
    cout<<"AMBIGUOUS"<<endl;
  }else if(1<=b&&b<=12){
    cout<<"MMYY"<<endl;
  }else if(1<=c&&c<=12){
    cout<<"YYMM"<<endl;
  }else{
  cout<<"NA"<<endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <complex>
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
using namespace std;

typedef long long ll;

int main()
{
    int n;
    cin >> n;
    vector<ll> a(n * 3);
    for (int i = 0; i < n * 3; i++) cin >> a[i];
    sort(a.begin(), a.end(), greater<ll>());
    int i = 0;
    ll ans = 0;
    bool second = false;
    for (int i = 0; i < n * 2; i++) {
        if (!second) {
            second = true;
        } else {
            second = false;
            ans += a[i];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2560
import numpy as np

N = np.int(input())
slist = [input() for _ in range(N)]
M = np.int(input())
tlist = [input() for _ in range(M)]
sslist = np.array(list(set(slist)))
number = np.zeros(len(sslist))
for i in range(len(sslist)):
    number[i] = np.sum(slist.count(sslist[i])) - np.sum(tlist.count(sslist[i]))
answer = np.int(np.max(number))  
print(np.max((answer, 0)))



Measured memory_bytes: 12440
#include <iostream>
#include <string>
#include <algorithm>
#include <numeric>
#include <queue>
#include <utility>
#include <cmath>
#include <iomanip>
using namespace std;

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

typedef long long lint;
typedef pair<int,int> P;

#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))

int main()
{

    int N,K;
    cin >> N >> K;

    lint ans;

    ans = N-K;

    if(K==1) ans = 0;

    cout << ans << endl;

}


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

int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  
  if (a + b > c + d) {
    cout << "Left" << endl;
  }
  else if (a + b == c + d) {
    cout << "Balanced" << endl;
  }
  else {
    cout << "Right" << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main () {
	int n;
	cin>>n;
	vector<int> d(n);
	for (int i = 0; i<n; i++) {
		cin>>d[i];
	}
	int ans=0;
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			ans+=d[i]*d[j];
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 256
from itertools import combinations 
N = int(input())
L = list(map(int,input().split()))


ans = list(combinations(L,3))
ans1 = 0
for i in ans:
    if (i[0]+i[1]>i[2] and i[0]+i[2]>i[1] and i[1]+i[2]>i[0] and i[0]!=i[1] and i[0]!=i[2] and i[1]!=i[2]):
        ans1+=1

print(ans1)

Measured memory_bytes: 20468
#include <stdio.h>

int min(int a, int b)
{
  return a < b ? a : b;
}

int main(void)
{
  int A, B, K;
  scanf("%d%d%d", &A, &B, &K);
  if(2*K <= B-A+1){
    for(int i = A; i < A+K; i++)
      printf("%d\n", i);
    for(int i = B+1-K; i < B+1; i++)
      printf("%d\n", i);
  }
  else
    for(int i = A; i < B+1; i++)
      printf("%d\n", i);
}


Measured memory_bytes: 128
import sys

h, w, d = map(int, sys.stdin.readline().split())
a = [[int(x) for x in sys.stdin.readline().split()] for _ in range(h)]
q = int(sys.stdin.readline().rstrip())
lr = zip(*[map(int, sys.stdin.read().split())] * 2) 

def main():
    place = [None] * (h * w + 1)
    for i in range(h):
        for j in range(w):
            place[a[i][j]] = (i, j)
    
    cost = [0] * (h * w + 1)
    cost[0] = None
    for x in range(1, 1+d):
        i, j = place[x]
        while x + d <= h * w:
            nex = x + d
            nex_i, nex_j = place[nex]
            cost[nex] = cost[x] + abs(nex_i - i) + abs(nex_j - j)
            x = nex
            i, j = nex_i, nex_j

    for l, r in lr:
        yield cost[r] - cost[l]

if __name__ == '__main__':
    ans = main()
    print(*ans, sep='\n')

Measured memory_bytes: 33628
N = int(input())
S = input()
C = [0] * N
t = 0
for i in range(N):
    C[i] = t
    if S[i] == 'W':
        t += 1
t = 0
for i in range(N - 1, -1, -1):
    C[i] += t
    if S[i] == 'E':
        t += 1
print(min(C))


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

typedef long long ll;

int main () {
	int N, X, T;
	cin >> N >> X >> T;
	if (N%X==0) {
		cout << (N/X)*T << endl;
	} else {
		cout << ((N/X)+1)*T << endl;
	}
	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
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 main()
{
  string s ;
  cin >> s ;
  int ans = 0 ;
  REP(i,6){
    if(s.at(i)=='1'){
      ans++ ;
    }
  }
  
  cout << ans <<endl ;
  


  return 0 ;
}




Measured memory_bytes: 256
//  cout << char(i+48) << endl;//なぜかaは47と得る時がある。+48で出力もaにできる。
//  cout << char(97) << endl;//アスキーコードでaを出力
// sort(b.begin(), b.end());//bという配列を小さい方からソート
// reverse(b.begin(), b.end());//bという配列をリターン
// 10桁でdouble出力するパターン１ 
// printf("%.10f\n", ma);
// 10桁でdouble出力するパターン２
//cout << fixed << setprecision(10);
//  cout << ma << endl;

/*01 02 03 12 13 23　と６回見ていくパターン 
for(int i=0;i<n-1;i++){
  for(int j=i+1;j<n;j++){
    }
  }
*///vector<vector<int>> data(3, vector<int>(4));//int型の2次元配列(3×4要素の)の宣言
//int64_t a;
//10のi乗pow(10, i);
//10の1/2乗（ルート）pow(10, 0.5)
/*string s; stringでの文字列を数字型に変える方法
  cin >> s;
  rep(i,s.size()-2) {
  int a= (s.at(i)-'0')*100 + (s.at(i+1)-'0')*10+ s.at(i+2) -'0';
    */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
  int n;
  cin >> n;
  vector<int>t(n);
  rep(i,n) cin >> t.at(i);
  int m;
  cin >> m;
  vector<int>p(m);
  vector<int>x(m);
  rep(i,m) cin >> p.at(i) >> x.at(i);
  int sum = 0;
  rep(i,n) sum += t.at(i);
  rep(i,m) cout << sum + (x.at(i) - t.at(p.at(i)-1)) << endl;
}

Measured memory_bytes: 3636
#include <iostream>
using namespace std;
int main()
{
	long long int X;
	cin >> X;
	long long int money = 100;
	long long int year = 0;
	
	while(money<X){
		money = (money/100) + money;
		year++;
	}
	
	
	std::cout << year  <<  std::endl;
  
}


Measured memory_bytes: 3612
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define MOD7 1000000007
#define LL_INF 1LL << 60
#define LL_MINF -1LL << 60
#define INT_INF 2000000000
#define INT_MINF -2000000000
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const long double PI = (acos(-1));



int main(){
    ll a, b, c;
    cin >> a >> b>> c;
    int count = 0;
    for(int x = a; x <= b; x++){
        if(c % x == 0) count++;
    }
    cout << count << endl;
}


Measured memory_bytes: 3092
from collections import defaultdict
import bisect
N = int(input())
A = list(map(int,input().split()))
plus = [A[i]+(i+1) for i in range(N)]
diff = [-A[i]+(i+1) for i in range(N)]

plusc = defaultdict(list)
for i in range(N):
    plusc[plus[i]].append(i)
ans = 0
for i in range(1,N):
    ans += bisect.bisect_left(plusc[diff[i]],i)
print(ans)

Measured memory_bytes: 100316
N=int(input())
A=list(map(int, input().split()))
sortedA=sorted(A, reverse=True)
Bob=0
Alice=0
for i in range(len(A)):
  # print(i)
  if i == 0 or i%2==0:
    Alice+=sortedA[i]
  else:
    Bob +=sortedA[i]
print(Alice-Bob)


Measured memory_bytes: 3060
# EduDPC - Vacation
import sys
input = sys.stdin.readline

n = int(input())
arr = [list(map(int, input().rstrip().split())) for _ in range(n)]
dp = [[0, 0, 0] for i in range(n)]
dp[0] = arr[0]
for i in range(1, n):
    dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + arr[i][0]
    dp[i][1] = max(dp[i - 1][0], dp[i - 1][2]) + arr[i][1]
    dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + arr[i][2]
print(max(dp[-1]))

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

int N;
vector<int> A;

int main () {
  cin >> N;
  A.resize(N);
  rep(i,N) cin >> A[i];

  int X = 0;
  for(int i = 0; i < N; i++) {
    if(i % 2 == 0) {
      X += A[i];
    } else {
      X -= A[i];
    }
  }

  cout << X;
  for(int i = 0; i < N - 1; i++) {
    X = 2*A[i] - X;
    printf(" %d", X);
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 1664
N,X=map(int,input().split())
L=list(map(int,input().split()))
L.insert(0,0)
long=0
count=0
for i in range(N+1):
    count=i+1
    long=long+L[i]
    if long>X:
        count=count-1
        break
print(count)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define ll long long int
#define INF 1000000000000
#define MOD 1000000007
#define DEBUG(x) cerr<<'>'<<#x<<':'<<x<< endl
using namespace std;

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll h1, h2, m1, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    ll hours = h2 - h1;
    ll mins = m2 - m1;
    if(mins < 0)
    {
        mins = mins + 60;    
        hours -= 1;
    }   
    mins = mins - k;
    if(mins < 0)
    {
        mins = mins + 60;
        hours -= 1;
    }
    ll ans = hours * 60 + mins;
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main(){
        string s;

        cin >> s;

        if (s[2] == s[3] && s[4] == s[5]){
                cout << "Yes" << endl;
        }
        else {
                cout << "No" << endl;
        }
        return 0;
}

Measured memory_bytes: 3592
#include<stdio.h>
int main(void){
	int a,b,d,r;
	double f;
	scanf("%d %d",&a,&b);
	d=a/b;
	r=a%b;
	f=(double)a/b;
	printf("%d %d %lf\n",d,r,f);
	return 0;
}

Measured memory_bytes: 636
k = int(input())
s = input()

def pre(n,MOD):
    f = 1
    factor = [1]
    for m in range(1,n+1):
        f *= m
        f %= MOD
        factor.append(f)
    inv = pow(f,MOD-2,MOD)
    invs = [1] * (n+1)
    for m in range(n,1,-1):
        inv *= m
        inv %= MOD
        invs[m-1] = inv
    return factor,invs

MOD = 10**9 + 7
n = len(s)
factor,invs = pre(n+k,MOD)
ans = 0
for i in range(k+1):
    temp = 1
    temp = (temp * factor[n-1+k-i] * invs[n-1] * invs[k-i]) % MOD
    temp = temp * pow(25,k-i,MOD) % MOD
    temp = temp * pow(26,i,MOD) % MOD
    ans = (ans + temp) % MOD
print(ans)

Measured memory_bytes: 165876
#include<bits/stdc++.h>
#define rep(i,n) for(int (i) = 0;(i) < (n);(i)++)
#define SORT(c) sort((c).begin(),(c).end())
#define INF 1000000007
//S.size()

using namespace std;


typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<bool> VB;
typedef unsigned long long ll;



int main(void){
  string a,b;cin>>a>>b;
  int ab = stoi(a + b);
  double dp = pow(ab,0.5);
  cout<<(ceil(dp) == floor(dp)?"Yes":"No");

}


Measured memory_bytes: 384
import java.util.Scanner;

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

        int N = sc.nextInt();
        int[] h = new int[N];
        for(int i=0; i<N; i++) {
            h[i] = sc.nextInt();
        }

        int[] dp = new int[N];
        for(int i=0; i<N; i++) {
            dp[i] = (int) Math.pow(10, 9);
        }

        dp[0] = 0;

        for(int x=0; x<N-2; x++){
            dp[x+1] = Math.min(dp[x+1], dp[x] + Math.abs(h[x+1] - h[x]));
            dp[x+2] = Math.min(dp[x+2], dp[x] + Math.abs(h[x+2] - h[x]));
        }
        int x = N-2;
        dp[x+1] = Math.min(dp[x+1], dp[x] + Math.abs(h[x+1] - h[x]));

        System.out.println(dp[N-1]);
    }
}

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


int main(){
    int64_t n, ans = 0;
    cin >> n ;
    int a=0, b, rv=-1, wv=-1;
    vector<char> vec(n);

    for (int i = 0; i < n; i++){
        cin >> vec.at(i);
        if(vec.at(i) == 'W') a++;
    }

    if(a == 0 || a == n){
        cout << 0 << endl;
    }else{
    vector<int> rvec(n-a);
    vector<int> wvec(a);

    for (int i = 0; i < n; i++){
        if(vec.at(i) == 'W'){
            wv++;
            wvec.at(wv) = i;
        }else{
            rv++;
            rvec.at(rv) = i;
        }
    }


    for (int i = 0; i < a; i++){
        if(rvec.at(n-a-1-i) < wvec.at(i)){
            break;
        }else{
            b = rvec.at(n-a-1-i);
            rvec.at(n-a-1-i) = wvec.at(i);
            wvec.at(i) = b;
            ans++;
        }
    }

    cout <<  ans  << endl;
    }

}

Measured memory_bytes: 4312
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
#define fi first
#define se second
template<typename A, typename B> inline bool chmax(A &a, B b) { if (a<b) { a=b; return 1; } return 0; }
template<typename A, typename B> inline bool chmin(A &a, B b) { if (a>b) { a=b; return 1; } return 0; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = 0;
//---------------------------------//

int main() {
	ll X;
	cin >> X;
	ll ans = X / 500 * 1000;
	X %= 500;
	ans += X / 5 * 5;
	cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>

long table[200000][3];

int main()
{
    std::string S;
    std::cin >>S;
    for(long i=0; i<S.length(); i++){
        std::cout << 'x';
    }
    std::cout << std::endl;
    return 0;
}

Measured memory_bytes: 256
// Created by new_sm
//
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define si set<int> 
#define mii map<int,int>
#define pb push_back
#define pf push_front
#define pii pair<int,int>
#define extract_word(s)  stringstream str(s); while(str>>word)
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define SET(s) cout<<fixed<<setprecision(s)
#define chotu 1000000007
#define set0(a) memset(a,0,sizeof(a))
#define endl "\n"
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define lower_string(s) transform(all(s),s.begin(),::tolower())
#define upper_string(s) transform(all(s),s.begin(),::toupper())
#define size(s) s.size()
template<class T> bool umin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool umax(T &a, T b) { return a < b ? (a = b, true) : false; }
template<typename T,typename U>
bool compare(T x,U y){return(abs(x-y)<=1e-9);}
void solve()
{
fastio
	int n;
	cin>>n;
	cout<<(1000-n%1000)%1000;
}
int main()
{
//code
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif
fastio	
int t;
t=1;
while(t--)
{
	solve();
	cout<<endl;
}
}


Measured memory_bytes: 3636
#include <cstdio>

int r[10000];

int main(){
	int i = 0;
	while(1){
		scanf("%d", &r[i]);
		if(r[i] != 0){
			i++;
		}else{
			break;
		}
	}
	for(int k=0; k<i; ++k){
		printf("Case %d: %d\n", k+1, r[k]);
	}

}


Measured memory_bytes: 2716
#include <bits/stdc++.h>
using namespace std;
int main(){
std::ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    long test;
    test=1;
    // cin>>test;
    while(test--)
    {
        long i,j,n,m,q,a=0,t,b,c,temp,k,maxpeak=0,peak,d;
        cin>>n;
        if(n<1200)cout<<"ABC";
        else cout<<"ARC";
        
        
    }
}

Measured memory_bytes: 256
n=gets.to_i
blue = Hash.new
red = Hash.new
words = []
for i in 0...n do
  str=gets.chomp
  if blue[str]==nil then
    blue[str]=1
  else
    blue[str]+=1
  end
end
m=gets.to_i
for i in 0...m do
  str=gets.chomp
  if blue[str]!=nil then
    blue[str]-=1
    if blue[str]<0 then
      blue[str]=0
    end
  end
end
p blue.values.max


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

#define N 8
#define FREE -1
#define NOT_FREE 1

int row[N],col[N],dpos[2*N-1],dneg[2*N-1];
bool X[N][N];

void initialize(){
	for (int i = 0; i < N; ++i) {row[i]=FREE,col[i]=FREE;	}
	for (int i = 0; i <2*N-1; ++i) {dpos[i]=FREE,dneg[i]=FREE;	}
}

void printBoard(){
	for (int  i = 0;  i < N; ++ i) {
		for (int j = 0; j < N; ++j) {
			if(X[i][j]){
				if(row[i]!=j)return;
			}
		}
	}
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			cout<<((row[i]==j)?"Q":".");
		}
		cout<<endl;
	}
}

void recursive(int i){
	if(i==N){
		printBoard();return;
	}
	for (int j = 0; j < N; ++j) {
		//(i,j)?????????????????????????\?????????????????????´????????????
		if(NOT_FREE==col[j]||NOT_FREE==dpos[i+j]||NOT_FREE==dneg[i-j+N-1])continue;
	//(i,j)??????????????????????????????
	row[i]=j;col[j]=dpos[i+j]=dneg[i-j+N-1]=NOT_FREE;
	//?¬????????????????
	recursive(i+1);
	//(i,j)???????????????????????????????????????????????????
	row[i]=col[j]=dpos[i+j]=dneg[i-j+N-1]=FREE;
	}
	//??????????????????????????±???
}
int main(){
	initialize();
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			X[i][j]=false;
		}
	}
	int k;cin>>k;
	for (int i = 0; i < k; ++i) {
		int r,c;cin>>r>>c;
		X[r][c]=true;
	}

	recursive(0);
	return 0;
}

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

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define test cout<<"test"<<endl;
#define fi first
#define se second
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = n; i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = m - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
void chmin(T &a,T b){if(a>b)a=b;}
template<typename T>
void chmax(T &a,T b){if(a<b)a=b;}
void pmod(ll &a,ll b){a=(a+b)%MOD;}
void pmod(ll &a,ll b,ll c){a=(b+c)%MOD;}
void qmod(ll &a,ll b){a=(a*b)%MOD;}
void qmod(ll &a,ll b,ll c){a=(b*c)%MOD;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  //cout<<fixed<<setprecision(10);
  ll res=0,buf=0;
  bool judge = true;
  ll n,m,k;cin>>n>>m>>k;
  set<ll>st;
  rep(i,0,n+1)rep(j,0,m+1){
    st.insert((n-i)*j+(m-j)*i);
  }
  ans1(st.count(k));
  return 0;
}

Measured memory_bytes: 13056
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d,e,k,s1,s2;
  cin>>a;cin>>b;cin>>c;cin>>d;cin>>e;cin>>k;
  s1=max(max(max(max(a,b),c),d),e);
  s2=min(min(min(min(a,b),c),d),e);
  if((s1-s2)>k)cout<<":("<<endl;
  else cout<<"Yay!"<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#define MAX 2000001

int A[MAX],pos;

void maxHeapify(int *A,int x){

  int largest,l,r,temp;

  l = 2*x;
  r = (2*x)+1;

  if(l<=pos && A[l]>A[x])
    largest = l;
  else
    largest = x;

  if(r<=pos && A[r]>A[largest])
    largest = r;
  
  if(largest != x){
    temp = A[x];
    A[x] = A[largest];
    A[largest] = temp;
    maxHeapify(A,largest);
  }
}

void insert(int *A,int k){

  int temp,i;

  pos++;
  A[pos] = k;

  i = pos;
  while(i>1 && A[i/2] < A[i]){
    temp = A[i];
    A[i] = A[i/2];
    A[i/2] = temp;
    i = i/2;
  }

  //printf("ins, i = %d\n", pos);
}



void extractMax(int *A){

  printf("%d\n",A[1]);
  A[1] = A[pos];
  pos--;
  maxHeapify(A, 1);
  
  //printf("del i = %d, A[1] = %d\n", pos, A[1]);
}

int main(void){
  
  int k;
  char c[10];
  pos = 0;

  while(1){
    scanf("%s",c);
    if(strcmp(c,"insert")==0){
      scanf("%d",&k);
      insert(A,k);
    }

    else if(strcmp(c,"extract")==0){
      extractMax(A);
    }

    else break;

  }
  return 0;
}

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

void init() {
  cin.tie(nullptr); // cin 時に cout を flush しない
  // cout << "hogehoge" << '\n';  // endl は改行後に flush するので、改行のみとする
  // ios::sync_with_stdio(false); // cin/cout と scanf/printf が混在する場合は注意
}

int main() {
  init();
  int a;
  cin >> a;
  if (a == 0) {
    cout << 1 << endl;
  } else {
    cout << 0 << endl;
  }
  return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>  // std::greater<T>()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値

using namespace std;

// macro
#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define DESCEND greater<int>()  // sort 降順
#define UNIQUE(vec) (vec).erase(unique(ALL((vec))), (vec).end());  // 必ずsortを行なってから
#define MIN(vec) *min_element(ALL((vec)))
#define MAX(vec) *max_element(ALL((vec)))
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値

// func declaration
template <class T> void printVec(vector<T>);
template <class T> void calcVec(vector<T>&, int, char);
bool checkMultiple(vector<int>&, int);
int ctoi(const char);
int dist_l2r(int, int);

// const
const int INF = 10000000;

/*MEMO
辞書順
abc < abcd, atcoder < atlas
*/

int main() {
    int N, K;
    cin >> N >> K;
    vector<int> vec(N);
    REP(i, N) cin >> vec.at(i);

    int selects = N - K + 1;
    vector<int> distance(selects);
    REP(i, selects) {
        int left = vec.at(i), right = vec.at(i + (K-1));
        int dist = dist_l2r(left, right);
        distance.at(i) = dist;
    }
    cout << MIN(distance) << endl;

    return 0;
}


// function
template <class T> void printVec(vector<T> vec) {
    // 1要素ずつ、空白・改行なしで出力
    REP(i, vec.size()) {
        cout << vec.at(i);
    }
    cout << endl;
}

template <class T> void calcVec(vector<T> &vec, int num, char ch) {
    // vec全体への演算
    if (ch == '+') {
        REP(i, vec.size()) {
            vec.at(i) += num;
        }
    } else if (ch == '-') {
        REP(i, vec.size()) {
            vec.at(i) -= num;
        }
    } else if (ch == '*') {
        REP(i, vec.size()) {
            vec.at(i) *= num;
        }
    } else if (ch == '/'){
        REP(i, vec.size()) {
            vec.at(i) /= num;
        }
    } else if (ch == '%') {
        REP(i, vec.size()) {
            vec.at(i) %= num;
        }
    }
}

bool checkMultiple(vector<int> &vec, int num) {
    // vecの中身が、全てnumの倍数かどうかのチェック
    int count = 0;
    REP(i, vec.size()) {
        if (vec.at(i)%num != 0) count++;
    }
    return (count == 0);
}

int ctoi(const char c) {
    if('0' <= c && c <= '9') return (c-'0');
    return -1;
}

int dist_l2r(int left, int right) {
    if (left >= 0 && right >= 0) {
        return right;
    } else if (left <= 0 && right <= 0) {
        return abs(left);
    } else {
        // 符号が違う時
        int min = (abs(left) < abs(right)) ? abs(left): abs(right);
        int max = (abs(left) > abs(right)) ? abs(left): abs(right);
        return min + (min + max);
    }
}


Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef pair<int, int> ii;

int K;
vll A;

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

  ll ans_max=2, ans_min=2;

  for (int i=K-1;i>=0;--i){
    ll x=ans_min;
    ll y=ans_max;
    ll q=ans_min/A[i], r=ans_min%A[i];
    if(r!=0) {ans_min=(q+1)*A[i];}
    q=ans_max/A[i], r=ans_max%A[i];
    ans_max=q*A[i]+A[i]-1;
    if(ans_min>y|| ans_max<x) {cout << -1 << endl;return 0;} 
  }

  cout << ans_min << ' ' << ans_max << endl;
  return 0;
}

Measured memory_bytes: 1400
#include<iostream>
using namespace std;
int main()
{
    int a, b, c;
    cin >> a >> b >> c;
    if((a == 5 && b == 5 && c == 7) || (a == 5 && b == 7 && c == 5) || (a == 7 && b == 5 && c == 5))
    cout << "YES";
      else cout << "NO";
    return 0;
}

Measured memory_bytes: 256