akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ll long long
int main()
{
    std::string n;
    std::vector<ll> a;
    std::cin >> n;
    ll ans = 0;
    for (ll i = 0; i < n.size(); ++i) {
        std::string temp1 = n.substr(i, 1);
        ll temp2 = stoi(temp1);
        a.push_back(temp2);
    }
    for (auto v : a) {
        ans += v;
        ans %= 9;
    }
    if (ans == 0) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No" << std::endl;
    }
    //std::cout << ans << std::endl;
    return 0;
}

Measured memory_bytes: 5432
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<functional>
#include<math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pf(n) printf("%lld\n",n)
#define pff(a,b) printf("%d  %d\n",a,b);
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1001001001;
const double PI = acos(-1);

int main() {
	ll n, m;
	cin >> n >> m;
	vector<p> ab(n);
	rep(i, n) cin >> ab[i].first >> ab[i].second;
	sort(ab.begin(), ab.end());
	ll mone = 0;
	for (int i = 0; m > 0; i++) {
		if (ab[i].second >= m) {
			mone += ab[i].first*m;
			m = 0;
		}
		else {
			m -= ab[i].second;
			mone += ab[i].first*ab[i].second;
		}
	}
	pf(mone);


	return 0;
}

Measured memory_bytes: 4880
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define N 2000+5
using namespace std;
int h,w,ans,a[N][N];
int l[N][N],r[N][N],up[N][N];
bool is[N][N];
char ch[N];
int main()
{
	scanf("%d%d",&h,&w);
	for (int i=1;i<=h;i++)
	{
		scanf("%s",ch+1);
		for(int j=1;j<=w;j++)
			a[i][j]=ch[j]=='#'?1:0;
	}
	for(int i=1;i<h;i++)
		for(int j=1;j<w;j++)
			is[i][j]=a[i][j]^a[i+1][j]^a[i+1][j+1]^a[i][j+1];
	for(int i=1;i<h;i++) 
    {
		for(int j=1;j<w;j++) l[i][j]=is[i][j]?0:l[i][j-1]+1;
		for(int j=w-1;j;j--) r[i][j]=is[i][j]?0:r[i][j+1]+1;
	}
	for(int i=1;i<w;i++) l[0][i]=r[0][i]=1e9;
	ans = max(h,w);
	for(int i=1;i<h;i++)
		for(int j=1;j<w;j++)
		{
			if(is[i][j]) up[i][j]=0,l[i][j]=r[i][j]=1e9;
			else
			{
				up[i][j] = up[i-1][j]+1;
				l[i][j] = min(l[i][j],l[i-1][j]);
				r[i][j] = min(r[i][j],r[i-1][j]);
				ans = max(ans,(up[i][j]+1)*(l[i][j]+r[i][j]));
	        }
	    }
	printf("%d",ans);
    return 0;
}

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

int main(){
  long long n, k;
  long long a, b;
  cin >> n >> k;
  map<long long, long long> mp;
  for(int i = 0; i < n; i++){
    cin >> a >> b;
    mp[a] += b;
  }
  long long sum = 0;
  for(auto& itr : mp){
    sum += itr.second;
    if(sum >= k){
      cout << itr.first << endl;
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 4224
#include <stdio.h>
#include <iostream>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <limits>
#include <numeric>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

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

	for (int i = 0; i*i <= n; i++) {
		ans = i*i;
	}

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

Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main {	

	private static void solve(){
		//Implement solution here.
		int D = ni();
		int[] c = na(26);
		int[][] s = new int[D][26];
		for(int i = 0; i < D; i++)s[i] = na(26);
		int[] t = na(D);
		outScore(D, c, s, t);
		
	}
	
	private static void outScore(int D, int[] c, int[][] s, int[] t) {
		int result = 0;
		int[] last = new int[26];
		for(int i = 1; i <= D; i++) {
			result += s[i - 1][t[i - 1] - 1];
			last[t[i - 1] - 1] = i;
			for(int j = 0; j < 26; j++) {
				result -= c[j] * (i - last[j]);
			}
			System.out.println(result);
		}
	}

	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		boolean hasNext = true;
		while(hasNext){
			solve();	
			try{
				br.mark(1);
				if(br.read() > 0){
					br.reset();			
					System.out.println("---");
				} else {
					hasNext = false;
				}
			}catch(Exception e){
				throw new RuntimeException(e);
			} 
		}
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}


Measured memory_bytes: 27668
#include<cstdint>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<iterator>
#include<stack>
#include<cctype>
#include<climits>
#include<string>
#include<bitset>
#include<cfloat>
#include<iomanip>
#include<numeric>
#include<utility>
#include<initializer_list>


#define repi(i,start,end)for(int64_t (i)=(start);(i)<(end);++(i))
#define rep(i,end) repi((i),0,(end))
#define rfor(x, v) for(auto& (x) : (v))
#define iterate(itr, v) for(auto (itr)=(v).begin();(itr)!=(v).end();++(itr))
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vin(v) rep(i,(v).size()) cin >> (v)[i];
#define vpin(v) rep(i,(v).size()) cin >> (v)[i].first >> (v)[i].second

using namespace std;
using Int = int64_t;
using pint = pair<Int, Int>;
using vint = vector<Int>;
using vvint = vector<vint>;
using vpint = vector<pint>;
using vstr = vector<string>;

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;  }
template<class T>void put_double(T a){cout<<setprecision(15);cout<<a<<"\n";}
template<class T>void println(T a){cout << a << "\n";}
template<class T>void put_line(T &v){iterate(itr,v){cout<<*itr<<((itr==--v.end())?"\n":" ");}}
// auto [x, y] = make_tuple(3, 4); => let (x, y) = (3, 4);


int cnt(vstr v) {
    int res = 0;
    rfor(str, v) 
        rfor(c, str) if(c=='#') res++;
    //println(res);
    return res;
}

int main(void) {
    int h,w,k; cin >> h >> w >> k;
    vstr c(h);
    rep(i, h) cin >> c[i];
   int ans = 0; 
    rep(i, 1<<h) {
        rep(j, 1<<w) {
            vstr cmp(h);
            copy(all(c), cmp.begin());
            rep(x, h) {
                if(i & 1<<x) {
                    rep(y, w) cmp[x][y]='x';
                }
            }
            rep(x, w) {
                if(j & 1<<x) {
                    rep(y, h) cmp[y][x]='x';
                }
            }
            //rfor(s, cmp) println(s);
            if(cnt(cmp)==k) ans++;
        }
    }
    println(ans);

    return 0;
}

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

#define MOD (1000000000+7)
#define N 100000

int main() {
	int n;

	cin >> n;

	int ans;
	for( int i = n; ; i++ ) {
		int d100 = i / 100;
		int d10 = (i%100) / 10;
		int d1 = i % 10;
		if( d100 == d10 && d10 == d1 && d1 == d100 ) {
			ans = d100 * 100 + d10 * 10 + d1;
			break;
		}
	}

	cout << ans << endl;

	return 0;
}


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

ll calc(string s){
	ll ret=0;
	rep(i,s.size()){
		ret+=(s.at(s.size()-1-i)-'0')*pow(10,i);
	}
	return ret;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;cin >> s;
	int size=s.size()-1;
	ll ans=0;
	for(int i=0;i<(1<<size);++i){
		ll sum=0,first=0;
		rep(j,size){
			if(i&(1<<j)){
				sum+=calc(s.substr(first,j-first+1));
				first=j+1;
			}
		}
		sum+=calc(s.substr(first,s.size()-first+1));
		ans+=sum;
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES	// M_PI=3.1415...
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 20桁出力 cout << setprecision(20) << double;
#include <queue>
#include <bitset>	// bitset<8> bs1(131uL); // 10000011 bs1[0]は1 01stringからビット集合生成可
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VL;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef vector<pair<int, int> > VPII;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<int, int> P;
typedef pair<int, pair<P, P> > PP;

#define INF 999999999999999997;
#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORL(i,a,b) for(LL i=(a);i<(b);i++)
#define FOR_REV(i,a,b) for(int i=(a);i>=(b);i--)
//for gcc (未test)
// #define FOREACH_IT(it,c) for(typeof(c)::iterator it=(c).begin(); it!=(c).end(); ++it)
//for Visual Studio
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
#define FOR_ITR(d) for(auto itr=d.begin(),d_end=d.end();itr!=d_end;++itr)	// C++11
// for Debug.
#define DUMP_VVI(b) FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}
// 入力をpush_back(d)やarray[d]に使う時に1行で書ける
// int INPUT_INT() {int d;cin>>d;return d;}
template<class T>T IN() { T d; cin >> d; return d; }
// 最大公約数（Greatest Common Divisor）
LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; }
// 最小公倍数（Least Common Multiple）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; }
// Y年はうるう年か否か
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); }

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

// vector注意
// vec[i][j]の形に入力を入れるとき、vecは初期化してある必要がある.

// ------------------- include, typedef, define END. -------------------


int main() {
	FAST_IO;
	// for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;
	bool dbgF = true;

	//コードはここから書く.
	int N, K;
	LL ans = 1;
	cin >> N >> K;
	FOR(i, 0, N) {
		ans = min(ans + K, ans * 2);
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

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

#define iof freopen("input.txt","r", stdin) ;freopen("output.txt","w", stdout) ;
#define io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);

#define mod 1000000007
#define vec vector<long long>
#define pb push_back
#define ll  long long
#define f(b) for(int i=0;i<b;i++)
#define f2(b) for(int j=0;j<b;j++)
#define f3(b) for(int k=0;k<b;k++)
#define endl '\n'
#define pi pair<int,int>
#define INF 1000000000000000001

long long pow(long long x, long long y){ if (y == 0) return 1; else if (y % 2 == 0) return pow(x, y / 2) * pow(x, y / 2);else return x * pow(x, y / 2) * pow(x, y / 2);}
long long dig(long long n) {return floor(log10(n) + 1);}

int main()
{
	io
	#define int long long
    //int t; cin>>t; while(t--)
    {
        int n;
        cin>>n;

        int x,curr=0,cnt=0;

        f(n)
        {
            cin>>x;
            if(x<curr) cnt+= curr-x;
            else curr =x;
        }

        cout<<cnt;
    }
}


Measured memory_bytes: 3700
#include<bits/stdc++.h>
#include<atcoder/all>

using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007



template<typename T,typename E>
class LazySegtree{
  public:
  using F = function<T(T,T)>;
  using G = function<T(T,E)>;
  using H = function<E(E,E)>;
  int n,height;
  F f;
  G g;
  H h;
  T ti;
  E ei;
  vector<T> dat;
  vector<E> laz;
  LazySegtree(F f,G g,H h,T ti,E ei):
    f(f),g(g),h(h),ti(ti),ei(ei){}

  void init(int N){
    n = 1;height = 0;
    while(n < N)n <<= 1,height++;
    dat.assign(n << 1,ti);
    laz.assign(n << 1,ei);
  }
  void build(const vector<T> &v){
    int N = v.size();
    init(N);
    rep(i,N)dat[i+n] = v[i];
    for(int i = n-1;i > 0;i--)dat[i] = f(dat[(i<<1)|0],dat[(i<<1)|1]);
  }
  inline T reflect(int k){
    return (laz[k] == ei ? dat[k] : g(dat[k],laz[k]));
  }
  inline void eval(int k){
    if(laz[k] == ei)return;
    laz[(k<<1)|0] = h(laz[(k<<1)|0],laz[k]);
    laz[(k<<1)|1] = h(laz[(k<<1)|1],laz[k]);
    dat[k] = reflect(k);
    laz[k] = ei;
  }
  inline void thrust(int k){
    for(int i = height;i > 0;i--)eval(k >> i);
  }
  inline void recalc(int k){
    while(k >>= 1)dat[k] = f(reflect((k << 1)|0),reflect((k << 1)|1));
  }
  void update(int a,int b,E x){
    thrust(a+=n);
    thrust(b+=n-1);
    for(int l = a,r = b+1;l < r;l >>= 1,r >>= 1){
      if(l & 1)laz[l] = h(laz[l],x),l++;
      if(r & 1)r--,laz[r] = h(laz[r],x);
    }
    recalc(a);
    recalc(b);
  }
  void set_val(int a,T x){
    thrust(a+=n);
    dat[a] = x;laz[a] = ei;
    recalc(a);
  }
  T get(int a,int b){
    thrust(a+=n);
    thrust(b+=n-1);
    T vl = ti,vr = ti;
    for(int l = a,r = b+1;l < r;l >>= 1,r >>= 1){
      if(l & 1)vl = f(vl,reflect(l++));
      if(r & 1)vr = f(reflect(--r),vr);
    }
    return f(vl,vr);
  }
};
using Pl = pair<ll,int>;
const int mod = 998244353;

ll modpow(ll n,int r){
  ll res = 1;
  while(r){
    if(r & 1)res = res*n%mod;
    n = n*n%mod;
    r >>= 1;
  }
  return res;
}
vector<ll> ten(200001,1);
ll nine = modpow(9,mod-2);

int main(){
  
  
  int n,q;
  cin >> n >> q;
  rep(i,n)ten[i+1] = ten[i]*10%mod;
  auto f = [](Pl a,Pl b){
    return Pl{(a.first*ten[b.second]%mod+b.first)%mod,a.second+b.second};
  };
  auto g = [](Pl a,ll b){
    Pl k = {0,a.second};
    k.first = (b*(ten[a.second]-1)%mod)*nine%mod;
    return k;
  };
  auto h = [](ll a,ll b){
    return b;
  };
  LazySegtree<Pl,ll> seg(f,g,h,Pl{0,0},(ll)998244353);
  seg.build(vector<Pl>(n,{1,1}));
  while(q--){
    int l,r,d;
    cin >> l >> r >> d;
    l--;
    seg.update(l,r,d);
    cout << seg.get(0,n).first << "\n";
  }



  return 0;
}

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

int main() {
    int N; cin >> N;
    vector<vector<int>> a(2, vector<int>(N+1));
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < N; j++) {
            cin >> a.at(i).at(j);
        }
    }
    vector<vector<int>> dp(2, vector<int>(N+1));
    dp.at(0).at(0) = a.at(0).at(0);
    for (int i = 0; i < N; i++) {
        dp.at(1).at(i) = max(dp.at(1).at(i), dp.at(0).at(i) + a.at(1).at(i));
        dp.at(0).at(i+1) = max(dp.at(0).at(i+1), dp.at(0).at(i) + a.at(0).at(i+1));
        dp.at(1).at(i+1) = max(dp.at(1).at(i+1), dp.at(1).at(i) + a.at(1).at(i+1));
    }
    cout << dp.at(1).at(N-1) << endl;
    return 0;
}


Measured memory_bytes: 256
n,k = map(int,input().split())
x = list(map(int,input().split()))
ans = 10**10
for i in range(n-k+1):
    if x[i] * x[i+k-1] >= 0:
        if x[i] >= 0:
            ans = min(ans,x[i+k-1])
        else:
            ans = min(ans,abs(x[i]))
    else:
        if abs(x[i]) <= x[i+k-1]:
            ans = min(ans,abs(x[i]*2)+x[i+k-1])
        else:
            ans = min(ans,x[i+k-1]*2+abs(x[i]))
print(ans)

Measured memory_bytes: 62576
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=1e9;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
 
int main(){
  string s,t;
  cin>>s>>t;
  int ans=INF;
  int cnt=0;
  rep(i,len(s)-len(t)+1){
    cnt=0;
    rep(j,len(t)){
      if(s[j+i]!=t[j]) cnt++;
    }
    ans=min(ans,cnt);
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>

using namespace std;

#define sz(a) static_cast<int>((a).size())
#define f first
#define s second
#define els(v) for (auto &el : (v))


#ifdef KIRYA
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#endif

template<typename T>
void _dbg(const char* _s, T _h) {
    cerr << _s << " = " << _h << "\n";
}

template<typename T, typename... Ts>
void _dbg(const char*_s, T _h, Ts... _t) {
    int _b = 0;

    while (((_b += *_s == '(') -= *_s == ')') != 0 || *_s != ',')
        cerr << *_s++;

    cerr << " = " << _h << ",";
    _dbg(_s + 1, _t...);
}

const int64_t INF = static_cast<int64_t>(1e9) + 7;
const int64_t LINF = INF * INF;
const int MAXN = static_cast<int>(1e6) + 17;

void solve() {
    int64_t n, d, a;
    cin >> n >> d >> a;
    vector<pair<int64_t, int64_t>> monster(n);
    for (size_t i = 0; i < n; ++i) {
        cin >> monster[i].first >> monster[i].second;
    }
    sort(monster.begin(), monster.end());
    int64_t gr_size = pow(n, 0.5);
    int64_t n_groups = (n + gr_size - 1) / gr_size;
    vector<int64_t> groups(n_groups, 0);
    int64_t ans = 0;
    for (size_t i = 0; i < n; ++i) {
        int64_t cnt = (max<int64_t>(monster[i].second + groups[i / gr_size], 0) + a - 1) / a;
        if (cnt == 0) {
            continue;
        }
        ans += cnt;
        int64_t val = cnt * a;
        int64_t gr = (i + gr_size - 1) / gr_size;
        int64_t bnd = gr * gr_size;
        int64_t last_cord = monster[i].first + 2 * d;
        size_t j;
        for (j = i; j < bnd && monster[j].first <= last_cord; ++j) {
            monster[j].second -= val;
        }
        if (monster[j].first > last_cord) {
            continue;
        }
        for (j = gr; j < n_groups && monster[min<size_t>(n - 1, (j + 1) * gr_size - 1)].first <= last_cord; ++j) {
            groups[j] -= val;
          //  cout << i << ' ' << "Subbing\n";
        }
        if (j == n_groups) {
            continue;
        }
        for (j = j * gr_size; j < n && monster[j].first <= last_cord; ++j) {
            monster[j].second -= val;
        }
    }
    cout << ans << '\n';
}

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

    int q = 1;

    for (int i = 0; i < q; ++i) {
        solve();
    }
}

Measured memory_bytes: 3456
C = []
for i in range(3):
    C.append(list(map(int, input().split())))
for i in range(1,101):
    b1 = C[0][0]-i
    b2 = C[0][1]-i
    b3 = C[0][2]-i
    a2 = C[1][0]-b1
    a3 = C[2][0]-b1
    if [[i+b1,i+b2,i+b3],[a2+b1,a2+b2,a2+b3],[a3+b1,a3+b2,a3+b3]] == C:
        print("Yes")
        exit()
print("No")

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

int N, M, Q;
vector<int> arr;
vector<int> chk;
vector<int> pnt;
vector<vector<int> > Pos;

int main() {
    scanf("%d %d %d", &N, &M, &Q);
    arr.resize(Q);
    Pos.resize(M);
    for(int i = 0; i < Q; i++) {
        scanf("%d", &arr[i]);
        arr[i]--;
        Pos[arr[i]].push_back(i);
    }
    chk = vector<int>(M, 0);
    pnt = vector<int>(N, Q);
    int mn = 0;
    int st = 0;
    for(int i = Q - 1; i >= 0; i--) {
        if(chk[arr[i]]) continue;
        while(mn < M && chk[mn]) mn++;
        bool ok = true;
        int pos = (int)Pos[arr[i]].size() - 1;
        for(int j = N - 1; j >= 0; j--) {
            while(pos >= 0 && Pos[arr[i]][pos] >= pnt[j]) pos--;
            if(pos < 0) {
                if(arr[i] != mn) ok = false;
                for(int k = j; k >= st; k--) pnt[k] = -1;
                st = j + 1;
                break;
            }
            pnt[j] = Pos[arr[i]][pos--];
        }
        if(!ok) {
            printf("No");
            return 0;
        }
        chk[arr[i]] = 1;
    }
    printf("Yes");
}


Measured memory_bytes: 6912
N = int(input())
X,Y = [],[]
def func(p):
    return p[0]-p[1], p[0]+p[1]
for _ in range(N):
    x,y = func(list(map(int,input().split())))
    X.append(x)
    Y.append(y)
ans = 0
ans = max(max(X)-min(X),max(Y)-min(Y))
print(ans)

Measured memory_bytes: 24920
N = int(input())
count = 0
flag = False
for i in range(N):
    D1, D2 = map(int, input().split())

    if D1 == D2:
        count += 1
    else:
        count = 0
    if count >= 3:
        flag = True

if flag:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9192
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus >= 201703L
#        pragma GCC target("avx2")
#    else
#        pragma GCC target("avx")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

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

    int n;
    string s;
    cin >> n >> s;

    int ans = 0;
    for (int i = 0; i <= n; i++) {
        int tem = 0;
        string a, b;
        a = s.substr(0, i);
        b = s.substr(i, n - i);

        sort(a.begin(), a.end());
        sort(b.begin(), b.end());

        a.erase(unique(a.begin(), a.end()), a.end());
        b.erase(unique(b.begin(), b.end()), b.end());

        for (int k = 0; k < a.size(); k++) {
            for (int l = 0; l < b.size(); l++) {
                if (a[k] == b[l]) {
                    tem++;
                }
            }
        }

        ans = max(ans, tem);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
int X,Y;
  cin>>X>>Y;
  int n,z;
  n=Y-2*X;
  z=4*X-Y;
  if(n%2==0 && n/2>=0 && z%2==0 && z/2>=0){ 
  cout << "Yes"<<endl;}
    else 
    {cout<<"No"<<endl;}
  
    return 0;
    }
 

Measured memory_bytes: 3584
#include <iostream>
#include <algorithm>
using namespace std;
int main(){
    int n;
    char p[30];
    int ans = 0;
    cin>>n;
    
    for(int i=0;i<n;i++){
        int k;
        cin>>k;
        p[i]=k;
    }

    for(int i=1;i<n-1;i++){
        if(p[i]!=max(p[i-1],max(p[i],p[i+1]))&&p[i]!=min(p[i-1],min(p[i],p[i+1]))){
            ans++;
        }
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>

int main() {
  int N;
  std::cin >> N;
  std::vector<int> stones(N+1);
  for(int i = 1; i <= N; i++) {
    std::cin >> stones[i];
  }
  std::vector<long> dp(N+1);
  dp[0] = INT_MAX;
  dp[1]    = 0;
  for(int i = 2; i < N+1; i++) {
      dp[i] = std::min(dp[i-1]+std::abs(stones[i-1]-stones[i]),dp[i-2]+std::abs(stones[i-2]-stones[i]));
  }
  std::cout << dp[N] << "\n";
  return 0;
}

Measured memory_bytes: 4568
N,M = map(int,input().split())
dp = [[0]*(M+1) for _ in range(N+1)]

for i in range(1, N+1):
    W,V = map(int,input().split())
    for j in range(W):
        dp[i][j] = dp[i-1][j]
    for j in range(M-W+1):
        dp[i][j+W] = max(dp[i-1][j+W],dp[i-1][j]+V)

print(max(dp[-1]))

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

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SIZE(a) int((a).size())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ROF(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n) FOR(i,0,n)
#define PER(i,n) ROF(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;
const int MOD = 1e9+7;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

LL modpow(LL a, LL n) {
    LL res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}


void Main()
{
    int x,a;cin>>x>>a;

    if(x<a){
        cout<<0<<endl;
    }
    else{
        cout<<10<<endl;
    }

	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
    return 0;
}

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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()

using namespace std;
typedef long long  ll; typedef vector<int> VI; typedef pair<int,int> pii; typedef vector<ll> VL; const int MD = 1e9 + 7;
void dbg(){cerr<<"\n";} template <class F,class ...S> void dbg(const F& f, const S&...s){cerr <<f <<": "; dbg(s...);}


int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	ll a; double b;
	cin >>a >>b;
	
	ll bb = b*100 + 0.1;
	ll ans = (a*bb)/100 ;
	
	cout << ans <<"\n";
	return 0;
}


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

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

    for( int i=0 ; i<N ; i++ )
    {
        if( S[K-1] != S[i] ) S[i] = '*';
    }

    cout << S << endl;
}

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

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

    ll a;
    cin >> a;
    cout << a + a * a + a * a * a << "\n";
}


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



int main() {
  int N,M,i,j;
  cin>>N>>M;;
  vector<int> a(M),b(M);
  vector<int> city(N,0);
  for(i=0;i<M;i++){
    cin>>a.at(i)>>b.at(i);
    city.at(a.at(i)-1)++;
    city.at(b.at(i)-1)++;
  }
  for(i=0;i<N;i++){
    cout<<city.at(i)<<endl;
  }
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#define ll long long
#define INF (1LL << 60)
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 3005;

ll dp[MAX_N][MAX_N][2];
ll a[MAX_N];

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    rep(i,n){
        cin >> a[i];
    }
    rep(i,n+1){
        dp[i][i][n%2] = 0;
    }
    srep(i,1,n+1){
        rep(j,n-i+1){
            int k = i+j;
            int te = (n-i)%2;
            if(te == 0){
                dp[j][k][0] = max(dp[j+1][k][1]+a[j], dp[j][k-1][1]+a[k-1]);
            }else{
                dp[j][k][1] = min(dp[j+1][k][0]-a[j], dp[j][k-1][0]-a[k-1]);
            }
        }
    }
    // rep(i,n){
        // srep(j,i,n+1){
            // cout << i << " " << j << " " << dp[i][j][(n-(j-i))%2] << "\n";
        // }
    // }
    cout << dp[0][n][0] << "\n";
    return 0;
}

Measured memory_bytes: 139648
#include <iostream>
#include <cstring>
#include <map>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <set>
#include <vector>
#include <queue>
#include <list>
#include <numeric>

using namespace std;
typedef long long ll;

int main(){
  string n;
  cin>>n;
  bool flag = false;
  for(int i = 0; i<2;i++){
    if(n[i]==n[i+1]&&n[i+1]==n[i+2])
    flag = true;
  }
  if(flag) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String N = sc.next();
		String n = N.substring(N.length() - 1);
		if(n.equals("2") || n.equals("4") || n.equals("5") || n.equals("7") || n.equals("9")){
			System.out.print("hon");
		}else if(n.equals("0") || n.equals("1") || n.equals("6") || n.equals("8")){
			System.out.print("pon");
		}else{
			System.out.print("bon");
		}
	}
}

Measured memory_bytes: 35676
n = int(input())
a = [int(i) for i in input().split()]

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


def get(i, j):
    i, j = min(i, j), max(i, j)
    return b[j]-b[i]


j = 0
k = 0
ans = 10**18
for i in range(n):
    while j < n and abs(get(0, j) - get(j, i)) > abs(get(0, j + 1) - get(j + 1, i)):
        j += 1
    while k < n and abs(get(i, k) - get(k, n)) > abs(get(i, k + 1) - get(k + 1, n)):
        k += 1
    an = [get(0, j), get(j, i), get(i, k), get(k, n)]
    ans = min(ans,max(an)-min(an))
print(ans)

Measured memory_bytes: 121172
#include<bits/stdc++.h>
using namespace std;
int n,m;
char a[100][100];
queue< pair<int,int> >q;
int d[4]={0,1,-1,0},c[4]={1,0,0,-1};
int dd[100][100];
void step(){
    while(!q.empty()){
        int xx1=q.front().first;
        int xx2=q.front().second;
        q.pop();
        for(int i=0;i<=3;i++){
            int x1=xx1+d[i];
            int x2=xx2+c[i];
            if((a[x1][x2]=='.')&&(dd[x1][x2]==0)){
                dd[x1][x2]=dd[xx1][xx2]+1;
                q.push(make_pair(x1,x2));
            }
        }
        
    }
}
int main(){
    cin>>n>>m;
    int count =0;
    dd[1][1]=0;
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin>>a[i][j];
            if(a[i][j]=='#'){
                count++;
            }
        }
    }
    q.push(make_pair(1,1));
    step();
    if(dd[n][m]==0)
	    cout<<-1;
	else
	    cout<<n*m-count-dd[n][m]-1;

}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
int main(){
    int h,w;
    cin >> h >> w;
    string grid[50];
    char dx[] = {-1, 0, +1, -1, +1, -1, 0, +1};
    char dy[] = {-1, -1, -1, 0, 0, +1, +1, +1};
    for(int i=0;i<h;i++){
      cin >> grid[i];
    }
    int count;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            count =0;
            if(grid[i][j]=='.'){
                for(int k=0;k<8;k++){
                if (0 <= i + dx[k] && i + dx[k] < h){
                 if (0 <= j + dy[k] && j + dy[k] < w){
                     if(grid[i + dx[k]][j + dy[k]] == '#'){
                     count++;
                     }
                 }
                }
                }
            cout << count;
            }else{
                cout << grid[i][j];
            }
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>

#define EPS	1.0e-10
#define MAX_CRYSTAL	32
#define rep(idx, max)	for(int idx = 0, idx##Max = max; idx < idx##Max; idx ++)

typedef struct _POINT
{
	int x, y;

	_POINT() {}
	_POINT(int _x, int _y) : x(_x), y(_y) {}
} POINT;

int g_crystalNum;
POINT	g_hero, g_devil;
POINT	g_crystals[MAX_CRYSTAL];

int	g_bSolved;
int	g_bReached[MAX_CRYSTAL];
int	g_reachedCount;

double Distance(const POINT &src1, const POINT &src2)
{
	double x = src1.x - src2.x;
	double y = src1.y - src2.y;
	return( ::sqrt(x * x + y * y) );
}

void Solve(const POINT &pt, const double time)
{
	//std::cout << time << std::endl;
	if (g_bSolved) { return; }

	if (g_reachedCount == g_crystalNum)
	{
		g_bSolved = true;
		return;
	}

	rep(n, g_crystalNum)
	{
		if (g_bReached[n]) { continue; }
		double r = time + ::Distance(pt, g_crystals[n]);	// Elapsed time of hero
//		if (r - ::Distance(g_devil, g_crystals[n]) > EPS) { return; }	// Could not reached (You are too late :P)
		if (::Distance(g_devil, g_crystals[n]) < r + EPS) { return; }	// Could not reached (You are too late :P)
	}

	rep(n, g_crystalNum)
	{
		if (g_bReached[n]) { continue; }

		g_bReached[n] = true;
		g_reachedCount++;
		::Solve(g_crystals[n], time + ::Distance(pt, g_crystals[n]));
		g_bReached[n] = false;
		g_reachedCount--;
	}
}

int main(int nArgs, char **lplpszArgs)
{
	while (std::cin >> g_crystalNum)
	{
		std::cin >> g_hero.x >> g_hero.y >> g_devil.x >> g_devil.y;
		if (g_crystalNum == 0) { break; }
		rep(i, g_crystalNum)
		{
			POINT &pt = g_crystals[i];
			std::cin >> pt.x >> pt.y;
		}

		//::printf("Hero: (%d, %d), Devil: (%d, %d)\n", g_hero.x, g_hero.y, g_devil.x, g_devil.y);

		g_bSolved = false;
		::memset(g_bReached, 0, sizeof(g_bReached));
		g_reachedCount = 0;
		::Solve(g_hero, 0);
		std::cout << (g_bSolved ? "YES" : "NO") << std::endl;
	}
}

Measured memory_bytes: 1152
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
//System.Threading.Tasks;

namespace Ring
{
    class Program
    {
        static void Main(string[] args)
        {
            String s = Console.ReadLine();
            String p = Console.ReadLine();
            for (int i = 0; i < s.Length; ++i)
            {
                if (s[i] == p[0])
                {
                    bool flag = true;
                    for (int j = 0; j < p.Length - 1; ++j)
                    {
                        if (s[next(i + j, s.Length)] != p[j + 1])
                        {
                            flag = false;
                            break;
                        }
                    }
                    if (flag)
                    {
                        Console.WriteLine("Yes");
                        Environment.Exit(0);
                    }
                }
            }
            Console.WriteLine("No");
        }
        static int next(int now, int max)
        {
            if (now + 1 >= max)
            {
                return (now + 1) - max;
            }
            else return now + 1;
        }
    }
}


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


int main(void){
    string S;
    cin >> S;

    int64_t cnt = 0;
    vector<int64_t> A(S.size() + 1);
    A[0] = 0;
    for (int i = 0; i < S.size(); i++){
        if (S[i] == '<')
            cnt++;
        else
            cnt = 0;
        A[i + 1] = cnt;
    }

    cnt = 0;
    for (int i = S.size() - 1; i >= 0; i--){
        if (S[i] == '>')
            cnt++;
        else
            cnt = 0;
        A[i] = max(A[i], cnt);
    }

    cout << accumulate(A.begin(), A.end(), 0LL) << endl;

}


Measured memory_bytes: 4740
#include<iostream>
#include<algorithm>
#include<cstdio>

using namespace std ;

int main()
{
	int num[ 3 ] ;
	cin >> num[ 0 ] >> num[ 1 ] >> num[ 2 ] ;
	sort( num ,num + 3 ) ;
	printf( "%d %d %d\n" ,num[ 0 ] ,num[ 1 ] ,num[ 2 ] ) ;
	return 0 ;
}

Measured memory_bytes: 3224
#define _USE_MATH_DEFINES
#include <iostream>
#include <queue>
#include <vector>
#include <math.h>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <cctype>
#include <cstdlib>
using namespace std;

#define INF (1 << 20)
#define EPS (1e-10)
#define EQ(a,b) (fabs((a)-(b)) < EPS)

int main(){
	int n;
	cin >> n;
	for (int j = 0; j < n; ++j) {
		double x[4], y[4];
		for (int i = 0; i < 4; ++i) cin >>x[i] >> y[i];
		double xa = x[0] - x[1];
		double ya = y[0] - y[1];
		double xb = x[2] - x[3];
		double yb = y[2] - y[3];
		if (EQ(xa * yb, ya * xb)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 1224
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
*$* WRITER:kakitamasziru/OxOmisosiru *$*
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#ifdef LOCAL_JUDGE
#define _GLIBCXX_DEBUG
#endif
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
//#include <unordered_set> //unordered_set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
#include <bitset> // bitset
#define endl "\n";
using namespace std;

const long long INF = 4000000000000000001;
const int inf = 1001001001;
const int MOD = 1000000007;
typedef pair<long long,long long> P;

//Solve N^M. This, mod_pow use Iterative Square Method.
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //When end-of-a bit is 1, times simple N.
    if (M & 1) res = (res * N) % MOD;
    return res %= MOD;
}
long long gcd(long long a, long long b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}
long long lcm(long long a, long long b) {
    return a / gcd(a, b) * b ;
}



int main() {
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
 
    int N;cin >> N;
    if(N < 10){
        cout << 0 << endl;
        return 0;
    }
    map<int,int> prime_factor;
    for(int i = 2;i<=N;i++){
        int now = i;
        while(true){
            int prv = now;
            for(int j = 2;j<=sqrt(now);j++){
                if(now % j == 0){
                    now /= j;
                    prime_factor[j]++;
                    break;
                }
            }
            if(now == prv){
                prime_factor[now]++;
                break;
            }
        }
    }

    vector<int> factor;
    for(auto V : prime_factor) factor.push_back(V.second);

    int ans = 0;
    //a = p^74
    for(int i = 0;i<factor.size();i++){
        if(factor.at(i) >= 74) ans++;
    }
    //a = p^24*q^2
    for(int i = 0;i<factor.size();i++){
        for(int j = 0;j<factor.size();j++){
            if(i == j) continue;
            if(factor.at(i) >= 24 && factor.at(j) >= 2) ans++;
        }
    }
    //a = p^14*q^4
    for(int i = 0;i<factor.size();i++){
        for(int j = 0;j<factor.size();j++){
            if(i == j) continue;
            if(factor.at(i) >= 14 && factor.at(j) >= 4) ans++;
        }
    }
    //a = p^4*q^4*r^2
    for(int i = 0;i<factor.size();i++){
        for(int j = i+1;j<factor.size();j++){
            for(int k = 0;k<factor.size();k++){
                if(k == i || k == j) continue;
                if(factor.at(i) >= 4 && factor.at(j) >= 4 && factor.at(k) >= 2) ans++;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3584
use std::io::stdin;
use std::str::FromStr;
#[allow(dead_code, unused_mut)]
fn read<T: FromStr>() -> T {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim().parse().ok().expect("1")
}
#[allow(dead_code, unused_mut)]
fn read_vec<T: FromStr>() -> Vec<T> {
    read::<String>().split_whitespace()
        .map(|e| e.parse().ok().expect("2"))
        .collect()
}
#[allow(dead_code, unused_mut)]
fn read_two<T: FromStr>() -> (T, T) {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    let mut x = s.split_whitespace().map(|x| x.parse().ok().unwrap());
    (x.next().unwrap(), x.next().unwrap())
}
#[allow(dead_code, unused_mut)]
fn read_three<T: FromStr>() -> (T, T, T) {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    let mut x = s.split_whitespace().map(|x| x.parse().ok().unwrap());
    (x.next().unwrap(), x.next().unwrap(), x.next().unwrap())
}
use std::collections::HashSet;
fn main() {
    let n: i32 = read();
    let mut hs: HashSet<String> = HashSet::new();
    for i in 0..n {
        let s: String = read();
        hs.insert(s);
    }
    println!("{}", hs.len());
}

Measured memory_bytes: 15260
N = int(input())
A = list(map(int,input().split()))
X = [0]*(10**5+2)
for a in A:
    X[a-1] += 1
    X[a] += 1

    X[a+1] += 1
maxx = 0
print(max(X))
# maxx_idx = 0
# for idx,x in enumerate(X):
#     if maxx <= x:
#         maxx = x
#         maxx_idx = idx
# print(maxx)

Measured memory_bytes: 13964
// This amazing code is by Eric Sunli Chen.
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;
template<typename T> bool get_int(T &x)
{
	char t=getchar();
	bool neg=false;
	x=0;
	for(; (t>'9'||t<'0')&&t!='-'&&t!=EOF; t=getchar());
	if(t=='-')neg=true,t=getchar();if(t==EOF)return false;
	for(; t<='9'&&t>='0'; t=getchar())x=x*10+t-'0';
	if(neg)x=-x;return true;
}
template<typename T> void print_int(T x)
{
	if(x<0)putchar('-'),x=-x;
	short a[20]= {},sz=0;
	while(x>0)a[sz++]=x%10,x/=10;
	if(sz==0)putchar('0');
	for(int i=sz-1; i>=0; i--)putchar('0'+a[i]);
}
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define get1(a) get_int(a)
#define get2(a,b) (get1(a)&&get1(b))
#define get3(a,b,c) (get1(a)&&get2(b,c))
#define printendl(a) print_int(a),puts("")
typedef long long LL;
typedef unsigned long long uLL;
typedef pair<int,int> pii;
const int inf=0x3f3f3f3f;
const LL Linf=1ll<<61;
const double pi=acos(-1.0);

int n,a[100111];
int main()
{
	get1(n);
	for(int i=1;i<=n;i++)get1(a[i]);
	sort(a+1,a+n+1);reverse(a+1,a+n+1);
	int x=1,t1,t2;while(x<n&&a[x+1]>x)x++;x--;
	t1=a[x+1]-x;t2=0;while(x+2+t2<=n&&a[x+2+t2]>x)t2++;
	if(t1%2==1&&t2%2==0)puts("Second");
	else puts("First");
	return 0;
}

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

int primes[1000001];

void spf(){
    for(int i=2;i<=1000000;++i){
        if(!primes[i]){
            for(int j=i;j<=1000000;j+=i){
                if(!primes[j])
                    primes[j] = i;
            }
        }
    }
}


int main(){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    spf();
    // for(int i=1;i<=1000000;++i) if(primes[i] == 0) cout << i << ' ' << primes[i] << '\n';
    // cout << "res\n";
    int n; cin >> n;
    vector<int> vec(n); 
    for(int i=0;i<n;++i){
        cin >> vec[i];
    }
    int seen[1000001] = {0};
    vector<int> nums;
    for(int i=0;i<n;++i){
        int val = vec[i];
        set<int> current;
        while(val>1){
            int factor = primes[val];
            current.insert(factor);
            val/=factor;
        }
        for(int i : current) seen[i]+=1;
    }
    bool pairwise = true;
    bool notprime = false;

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

        if(seen[i] > 1) pairwise = false;
        if(seen[i] == n) notprime = true;
    }

    if(notprime) cout << "not coprime\n";
    else if(pairwise) cout << "pairwise coprime\n";
    else cout << "setwise coprime\n";

    return 0;
}

Measured memory_bytes: 14864
n = int(input())
A = list(map(int,input().split()))
four = 0
two = 0
other = 0

for i in A:
    if i%4==0:
        four +=1
    elif i%2 ==0:
        two +=1
    else:
        other +=1

other += two%2
if four+1 >= other:
    print('Yes')
else:
    print('No')

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;

int main() {
	int n,a;
	cin >> n;
	map<int, bool>mp;
	rep(i, n) {
		cin >> a;
		if (mp[a])mp.erase(a);
		else mp[a] = true;
	}
	cout << mp.size() << endl;
	return 0;
}


Measured memory_bytes: 8152
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    n = int(input())
    a = list(map(int, readline().split()))

    dp = [[0] * (n + 1) for _ in range(n + 1)]

    for i in range(n):
        val = max(a)
        idx = a.index(val)
        a[idx] = 0
        for j in range(i + 1):
            left = j
            right = i - j
            prev = dp[left][right]
            dp[left + 1][right] = max(dp[left + 1][right], prev + val * (idx - left))
            dp[left][right + 1] = max(dp[left][right + 1], prev + val * ((n - 1 - right) - idx))

    ans = 0
    for i in range(n):
        ans = max(ans, dp[i][n - i])

    print(ans)


if __name__ == '__main__':
    main()


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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int main() {
  in(ll, h, w);
  if (min(h, w) == 1) {
    out(1);
    return 0;
  }
  ll h_even = h / 2, h_odd = h - h_even;
  ll w_even = w / 2, w_odd = w - w_even;
  out(w_even * h_even + w_odd * h_odd);
}


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

int main() {
    string S;
    cin >> S;
    int mi = 1e9;
    for(int i = 0; i < S.length() - 2; ++i) {
        int n = 0;
        for(int j = 0; j < 3; ++j)
            n += (S[i + j] - '0') * pow(10, 2 - j);
        mi = min(abs(753 - n), mi);
    }
    cout << mi << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int gcd=0;
    for(int i=1;i<=n;i++)
    {
        for(int j=1;j<=n;j++)
        {
            for(int k=1;k<=n;k++)
            {
                gcd+=__gcd(i,__gcd(j,k));
            }
        }
    }
    cout<<gcd<<endl;
}


Measured memory_bytes: 3632