akhauriyash/Code-Regression huggingface dataset:
//g++ -std=gnu++14 a.cpp

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <istream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
#include <iomanip>
#include <random>
#include <math.h>
#include <stdio.h>

using namespace std;

#define ll long long
#define rep(i, n) for(ll i = 0; i < (n); i++)
ll MOD = 1e9 + 7;
int INF = 1 << 30;
ll INFL = 1LL << 60;

ll MODP = 998244353;


int main(){
  int N;
  cin >> N;
  vector<vector<pair<int,int>>> A(N);
  rep(i,N){
    int a;
    cin >> a;
    rep(j,a){
      int m,n;
      cin >> m >> n;
      A[i].push_back(make_pair(m,n));
    }
  }

  int ans = 0;
  int ad = 1;
  rep(i,N)ad *= 2;
  int ma = ad-1;

  for(int bit = 0;bit <= ma;bit++){
    vector<int> torf(N);
    for(int i = 0;i < N;i++){
      if(bit >> i & 1)torf[i] = 1;
      else torf[i] = 0;
    }
    bool hantei = true;
    rep(k,N){
      if(torf[k]){
        for(auto x : A[k]){
          if(torf[x.first - 1] != x.second){
            hantei = false;
            break;
          }
        }
      }
    }

    if(hantei){
      int add = 0;
      rep(k,N)if(torf[k] == 1)add++;
      ans = max(ans,add);
    }
  }
  cout << ans << endl;


  return 0;
}


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

vector<bool> r;
vector<vector<int>> rG;

void dfs(int v) {
    r[v] = true;
    for(int to : rG[v]) {
        if(!r[to]) dfs(to);
    }
}


/**********************************************/
template <typename T>
struct edge{
    int from;
    int to;
    T weight;
};

template <typename T>
class BellmanFord {
public:
    BellmanFord(int V, vector<edge<T>> E)
    :V(V), E(E), source(-1), INF(numeric_limits<T>::max()) {}

    // solve the single-source shortest path problem
    void build(int source) {
        // initialize
        this->source = source;
        dist.resize(V, INF);
        dist[source] = 0;
        pred.resize(V);
        pred[source] = {-1, source, 0};

        // relax
        for(int i = 1; i < V; ++i) {
            for(edge<T> e : E) {
                if(dist[e.from] == INF) continue;
                if(dist[e.to] > dist[e.from] + e.weight) {
                    dist[e.to] = dist[e.from] + e.weight;
                    pred[e.to] = e;
                }
            }
        }

        // negative-weight cycle check
        for(edge<T> e : E) {
            if(dist[e.from] == INF) continue;
            if(dist[e.to] > dist[e.from] + e.weight) {
                // detected a negative-weight cycle!
                if(!r[e.to]) continue;
                dist[source] = -1;
            }
       }
    }

    // return the distance between source and destination
    // build if necessary
    T distance(int source, int destination) {
        if(this->source != source) build(source);
        return dist[destination];
    }

    // return the path between source and destination
    // Return value holds the edges in the reverse order
    // build if necessary
    vector<edge<T>> shortest_path(int source, int destination) {
        if(this->source != source) build(source);
        
        if(dist[destination] == INF) {
            return vector<edge<T>>(0);
        } else {
            vector<edge<T>> path;
            int cur = destination;
            do {
                path.push_back(pred[cur]);
                cur = pred[cur].from;
            } while(cur != -1);
            return path;
        }
    }

private:
    int V;
    vector<edge<T>> E;
    vector<T> dist;
    vector<edge<T>> pred;
    int source;
    const T INF;
};
/**********************************************/


using pp = pair<int, long long>;
int main() {
    int N, M, P;
    cin >> N >> M >> P;
    rG.resize(N);
    vector<edge<long long>> E(M);
    for(int i=0; i<M; ++i) {
        int a,b,c;
        cin >> a >> b >> c;
        E[i] = {a - 1, b - 1, P - c};
        rG[b - 1].emplace_back(a - 1);
    }

    r.resize(N, false);
    dfs(N - 1);

    BellmanFord<long long> bf(N, E);
    if(bf.distance(0, 0) == -1) cout << -1 << endl;
    else cout << max(-bf.distance(0, N - 1), 0LL) << endl;
}


Measured memory_bytes: 640
#include <cstdio>           // printf(), scanf()
#include <vector>
#include <algorithm>        // min(), fill()

using namespace std;
static const int MAX_V = 100;
static const int INF = 100000000;

typedef struct edge_tbl
{
	int to, cap, cost;
	unsigned long rev;
} edge;

vector<edge> G[MAX_V];
int dist[MAX_V];
int prevv[MAX_V], preve[MAX_V];
int V;

int
min_cost_flow(int s, int t, int f)
{
	int res = 0;
	while (f > 0)
	{
		fill(dist, dist + V, INF);
		dist[s] = 0;
		bool update = true;
		while (update)
		{
			update = false;
			for (int v = 0; v < V; ++v)
			{
				if (dist[v] == INF)
					continue;

				for (unsigned int i = 0; i < G[v].size(); ++i)
				{
					edge &e = G[v][i];
					if (e.cap > 0 && dist[e.to] > dist[v] + e.cost)
					{
						dist[e.to] = dist[v] + e.cost;
						prevv[e.to] = v;
						preve[e.to] = i;
						update = true;
					}
				}
			}
		}

		if (dist[t] == INF)
			return -1;

		int d = f;
		for (int v = t; v != s; v = prevv[v])
			d = min(d, G[prevv[v]][preve[v]].cap);

		f -= d;
		res += d * dist[t];
		for (int v = t; v != s; v = prevv[v])
		{
			edge &e = G[prevv[v]][preve[v]];
			e.cap -= d;
			G[v][e.rev].cap += d;
		}
	}

	return res;
}

int
main(int argc, char** argv)
{
	int E, F;
	int u, v, cap, cost;

	scanf("%d %d %d", &V, &E, &F);
	for (int i = 0; i < E; ++i)
	{
		scanf("%d %d %d %d", &u, &v, &cap, &cost);
		G[u].push_back((edge){v, cap, cost, G[v].size()});
		G[v].push_back((edge){u, 0, -cost, G[u].size() - 1});
	}

	printf("%d\n", min_cost_flow(0, V - 1, F));
	return 0;
}

Measured memory_bytes: 2824
#include <iostream>

using namespace std;
int n,q;
int a[20];
int m[200];

int solve(int k,int m){
    if(k>n){
        return 0;
    }
    if(m==0){
        return 1;
    }
    return solve(k+1,m)||solve(k+1,m-a[k]);
}

int main()
{
    int i,j;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    cin>>q;
    for(i=0;i<q;i++){
        cin>>m[i];
        if(solve(0,m[i])==1)cout<<"yes"<<endl;
        else cout<<"no"<<endl;
    }
    return 0;
}

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

class Program
{
    static void Main(string[] args)
    {
        new Program().Solve();
    }

    void Solve()
    {
        Scanner cin = new Scanner();
        int a = cin.NextInt();
        int p = cin.NextInt();

        Console.WriteLine((a * 3 + p) / 2);
    }
}


class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string Next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return Next();
        i = 0;
        return s[i++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public char[] ArrayChar()
    {
        return Next().ToCharArray();
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = NextInt() + add;
        }
        return Array;
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = NextLong() + add;
        }
        return Array;
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = NextDouble() + add;
        }
        return Array;
    }
}

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

#include <algorithm>
#include <iomanip>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

int main() {

    long long int n;
    cin >> n;

    long long int ans = 0;
    map< long long int, long long int > v;

    for ( long long int i = 0; i < n; i++ ) {
        long long int in;
        cin >> in;
        ans += v[ i - in ];
        v[ in + i ]++;
    }

    cout << ans << endl;

    return 0;

}


Measured memory_bytes: 26304
#include <algorithm>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <stack>
#include <vector>

#define repd(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) repd(i, 0, n)
typedef long long ll;

using namespace std;

int inputValue() {
    int a;
    cin >> a;
    return a;
};

void inputVector(vector<int> *p, int a) {
    rep(i, a) {
        int input;
        cin >> input;
        p->push_back(input);
    }
}

template <typename T> void output(T a, int precision) {
    if (precision > 0) {
        cout << setprecision(precision) << a << "\n";
    } else {
        cout << a << "\n";
    }
}

void make_primeMap(map<int, int> &m, int n) {
    repd(i, 1, n + 1) {
        int target = i;
        int cand = 2;
        while (target != 1) {
            if (target % cand == 0) {
                if (m[cand] == 0) {
                    m[cand] = 1;
                } else {
                    m[cand]++;
                }
                target /= cand;
                cand = 2;
            } else {
                cand++;
            }
        }
    }
    return;
}

int num(vector<int> &v, int n) {
    int result = 0;
    rep(i, v.size()) {
        if (v[i] >= n-1) {
            result++;
        }
    }
    return result;
}

int main(int argc, const char *argv[]) {

    // source code
    int n;
    cin >> n;
    map<int, int> prime;
    make_primeMap(prime, n);
    vector<int> primeVec;
    for (auto iter = prime.begin(); iter != prime.end(); iter++) {
        pair<int, int> p = *iter;
        primeVec.push_back(p.second);
    }
    int ans = 0;
    ans += num(primeVec, 75);
    ans += num(primeVec, 25) * (num(primeVec, 3) - 1);
    ans += num(primeVec, 15) * (num(primeVec, 5) - 1);
    ans += num(primeVec, 5) * (num(primeVec, 5) - 1) /2* (num(primeVec, 3) - 2);

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn=1e5;
int a[3];
int main()
{
    //freopen("ce.in","r",stdin);
    scanf("%d%d%d",&a[0],&a[1],&a[2]);
    sort(a,a+3);
    int ans=a[2]-a[1];
    a[0]+=ans;
    int b=a[2]-a[0];
    ans+=b/2;
    if(b%2==1) ans+=2;
    printf("%d\n",ans);
    return 0;
}


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

int	main()
{
	int64_t	A[300][300] = {};
	int	N;
	cin >> N;
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j)
			cin >> A[i][j];
	}
	int64_t	removable[300][300] = {};
	int64_t	tmp_cost;
	bool	feasible = true;
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			for (int k = 0; k < N; ++k) {
				if (k == i || k == j) continue;
				tmp_cost = A[i][k] + A[k][j];
				if (A[i][j] > tmp_cost) {
					feasible = false;
					break;
				}
				if (A[i][j] == tmp_cost)
					removable[i][j] = true;
			}
		}
	}
	if (!feasible) {
		cout << -1 << endl;
		return 0;
	}
	int64_t	sum_cost = 0;
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < N; ++j) {
			if (!removable[i][j])
				sum_cost += A[i][j];
		}
	}
	sum_cost /= 2;
	cout << sum_cost << endl;
}




Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long res, i,sum=0,n,m,ct=0;
    cin>>n>>m;
    long long ar[n],br[n],cr[n];
    for(i=0;i<n;i++)cin>>ar[i]>>br[i];
    sort(ar,ar+n);
    sort(br,br+n);
    int r=lower_bound(br,br+n,ar[n-1])-br;
    if(r>=n)r=r-1;
 
        for(i=n-1;i>=r;i--)
        {
            sum=sum+br[i];
            ct++;
            if(sum>=m)
            {
                cout<<ct<<endl;
                return 0;
            }
        }
            
            while(sum<m)
            {
                sum+=ar[n-1];
                ct++;
                
            }
            cout<<ct<<endl;
            //else cout<<i+res-1<<endl;
 
 
 
    return 0;
}

Measured memory_bytes: 1792
#include <cstdio>
#include <iostream>
#include <cstring>
#include <vector>
#include <cmath>
#include <algorithm>
using namespace std;
#define ll long long
ll gcd(ll a, ll b)
{
    if (a < b)
        swap(a, b);

    if (b == 0)
        return a;
    else
        return gcd(b, a%b);
}

ll num[100005];
ll n;
int main()
{
    cin>>n;
    ll sum=0;
    ll pos=0;
    for(ll i=1;i<=n;i++){
        cin>>num[i];
        sum+=abs(pos-num[i]);
        pos=num[i];
    }
    sum+=abs(pos);


    for(int i=1;i<=n;i++){
        ll res=sum;
        pos=num[i-1];
        res -=abs(num[i]-pos);
        res-=abs(num[i+1]-num[i]);
        res+=abs(pos-num[i+1]);
        cout<<res<<endl;
    }
    return 0;
}

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

int N;
vector<bitset<10>> F;
vector<vector<int>> P;

int main () {
  cin >> N;

  F.resize(N);
  P.resize(N, vector<int>(11));

  rep(i,N) rep(j,5) rep(k,2) {
    int f;
    cin >> f;
    if(f) F[i].set(j*2+k);
  }
  rep(i,N) rep(c,11) {
    cin >> P[i][c];
  }

  ll ans = -1e9;
  for(int s = 1; s < (1<<10); s++) {
    auto j = bitset<10>(s);
    ll p = 0;
    rep(i,N) {
      p += P[i][(F[i] & j).count()];
    }
    ans = max(ans, p);
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <tuple>
#include <cstring>
#include <map>
#include <iomanip>
#include <ctime>
#include <complex>
#include <cassert>
#include <climits>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define _ << " " <<
#define all(X) (X).begin(), (X).end()
#define Pii pair<int, int>
#define Pll pair<ll, ll>
#define Tiii tuple<int, int, int>
#define Tlll tuple<ll, ll, ll>
#define PI 3.141592653589793

ll pw(ll x, ll y, ll mod) {
    if (y == 0) return 1;
    else if (y == 1) return x % mod;
    else if (y % 2 == 0) {
        ll p = pw(x, y / 2, mod);
        return p * p % mod;
    }
    else {
        ll p = pw(x, y / 2, mod);
        return p * p % mod * x % mod;
    }
}

ll dv(ll x, ll y, ll mod) {
    x %= mod;
    y %= mod;
    return x * pw(y, mod - 2, mod) % mod;
}

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    bool one = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == '2') one = 1;
    }
    if (one) {
        // 0 or 1
        int ans = 0;
        ll c = 1, two = 0, mod = 109103;
        for (int i = 0; i < n; i++) {
            if (char(s[i]) == '2') {
                if (two == 0) {
                    ans++;
                }
            }
            if (i == n - 1) break;
            int a = n - i - 1, b = i + 1;
            int ca = 0, cb = 0;
            while (a != 0 && a % 2 == 0) {
                a /= 2;  ca++;
            }
            while (b != 0 && b % 2 == 0) {
                b /= 2;  cb++;
            }
            two += ca - cb;
            if (i == n - 2) two = 0;
            cerr << two << " ";
            //cerr << i _ c _ ans << endl;
        }
        cerr << endl;
        cout << ans % 2 << endl;
    }
    else {
        // 0 or 2
        int ans = 0;
        ll c = 1, two = 0, mod = 109103;
        for (int i = 0; i < n; i++) {
            if (char(s[i]) == '3') {
                if (two == 0) {
                    ans++;
                }
            }
            if (i == n - 1) break;
            int a = n - i - 1, b = i + 1;
            int ca = 0, cb = 0;
            while (a != 0 && a % 2 == 0) {
                a /= 2;  ca++;
            }
            while (b != 0 && b % 2 == 0) {
                b /= 2;  cb++;
            }
            two += ca - cb;
            if (i == n - 2) two = 0;
            //cerr << i _ c _ ans << endl;
        }
        cout << (ans % 2) * 2 << endl;
    }
}

Measured memory_bytes: 1412
#include"bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const long long mod = 1000000007;
const long long inf = 1ll << 61;
typedef pair<int, int> P;
int p[55];
signed main() {
	int n; cin >> n;
	rep(i, n)cin >> p[i];
	int cnt = 0;
	rep(i, n)if (p[i] != i + 1)cnt++;
	if (cnt <= 2)puts("YES");
	else puts("NO");
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define pb push_back
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

int n, a[N];
int32_t main(){_

   int a, p;
   cin>>a>>p;

   cout<<(a*3 + p)/2; 
   

   return 0;
}

// Common sense: do smth instead of nothing
// Even a single second counts...
// If other's can do it, even I can do it. It wouldn't be that tough. Let me give it a try.
// Mistakes made in past
// -Ques. ask for max-min => think binary_search, DP, greedy
// -not reading question properly / skipping to read & understand all samples properly & wasting time in wrong direction.
// -Using wrong indexing in nested loops something like a[i], when it is supposed to be a[j](WA)
// -value of const int N is not correct (WA/RTE).
// -Did you memset dp to -1 ?
// -check for small edges cases and work on small test cases manually if WA
// -not deallocating memory to pointers can lead to MLE. Use delete :))
// -not reading problem statements of harder problems E,..., thinking it couldn't be solved, but it isn't the case.
// -Avoid using #define int long long as much as possible when it's dp problem and requires high memory say, O(N^2, N=5000) (MLE)
// -Check Bitwise Operator Precedence 
// -Use pragmas to optimize (by constant factor) when necessary..
// -Think before coding & starting to debug. Have patience to look inside code and actually see how it works

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

using namespace std;

int main(void){
	string a, b;

	cin >> a >> b;

	if (a.size() > b.size())
		cout << "GREATER" << endl;
	else if (a.size() < b.size())
		cout << "LESS" << endl;
	else {
		if (a > b)
			cout << "GREATER" << endl;
		else if (a < b)
			cout << "LESS" << endl;
		else
			cout << "EQUAL" << endl;
	}
}

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

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repto(i, n) for(int i = 0; i <= (n); i++)
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
#define _1 first
#define _2 second
#define pb push_back
#define mp make_pair
#define INF 1145141919
#define MOD 1000000007
#define DEBUG(x) cout << #x << ": " << x << endl;
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }

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

  int N;
  cin >> N;
  vector<ll> A(N);
  ll sum = 0;
  ll ans = 0;
  rep(i, N) {
    cin >> A[i];
    sum += A[i];
  }
  rep(i, N) {
    sum -= A[i];
    ans += (A[i]*(sum%MOD)%MOD);
    ans %= MOD;
  }
  cout << ans << endl;
}


Measured memory_bytes: 4780
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from fractions import gcd
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

a = INT()
s = input()

print("red" if a<3200 else s)

Measured memory_bytes: 5144
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.DecimalFormat;
import java.util.LinkedList;
import java.util.List;

/**
 * @author t.Tamegaya
 *
 *         2013/04/08
 */
public class Main {

    public static void main(String[] args) {

        List<String> inputDataList = new LinkedList<String>();
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));

        // 入力データをリストにセット
        String inputData = null;
        try {
            while ((inputData = in.readLine()) != null) {
                inputDataList.add(inputData);
            }
        } catch (IOException e) {
            e.printStackTrace();
            return;
        } finally {
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
                return;
            }
        }

        for (String data : inputDataList) {
            double[] result = calculate(data);

            // 表示用のフォーマットに変更
            DecimalFormat resultFormat = new DecimalFormat();
            resultFormat.setMaximumFractionDigits(3);
            resultFormat.setMinimumFractionDigits(3);

            System.out.println(resultFormat.format(result[2]) + " "
                    + resultFormat.format(result[5]));
        }
    }

    private static double[] calculate(String data) {

        // 配列に変換
        String[] numberStr = data.split(" ");

        // 計算用の配列を用意
        double[] number = new double[6];

        for (int i = 0; i < number.length; i++) {
            number[i] = Double.parseDouble(numberStr[i]);
        }

        // aの値が0の場合、(a,b,c)と(d,e,f)を入れ替える。
        if (number[0] == 0) {
            temp(number);
        }

        // 1番目の式を計算
        divided(number, number[0], 0);

        // 2番目の式を調整
        substract(number, number[3], 3, 0);

        // 2番目の式を計算
        divided(number, number[4], 3);

        // 1番目の式を調整
        substract(number, number[1], 0, 3);

        return number;
    }

    private static void substract(double[] number, double sub, int from, int to) {

        for (int i = 0; i < 3; i++) {
            number[from + i] = number[from + i] - number[to + i] * sub;
        }
    }

    private static void divided(double[] number, double divided, int i) {

        for (int j = i; j < i + 3; j++) {
            number[j] = number[j] / divided;
        }
    }

    private static void temp(double[] number) {
        for (int i = 0; i > 3; i++) {
            double temp = number[i];
            number[i] = number[i + 3];
            number[i + number.length] = temp;
        }
    }
}

Measured memory_bytes: 17164
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int z=a[0];
  int x=1;
  int ans=0;
  for(int i=1;i<=n;i++){
    if(i==n){
      ans+=(x/2);
    }
    else if(z==a[i]){
      x++;
    }
    else{
      z=a[i];
      ans+=(x/2);
      x=1;
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
int main(){
  string S;
  cin >> S;
  string T = S;
  reverse(T.begin(),T.end());
  bool flag = true;
  for(int i=0; i<S.size(); i++){
    if(T.at(i) == 'b'){
      if(S.at(i) != 'd'){
        flag = false;
      }
    }
    if(T.at(i) == 'd'){
      if(S.at(i) != 'b'){
        flag = false;
      }
    }
    if(T.at(i) == 'p'){
      if(S.at(i) != 'q'){
        flag = false;
      }
    }
    if(T.at(i) == 'q'){
      if(S.at(i) != 'p'){
        flag = false;
      }
    }
  }
  if(flag){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 512
//In the name of "ALLAH"
#include<stdio.h>
int main()
{
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);
    if((a+b)==c || (b+c)==a ||(a+c)==b)
    {
        printf("Yes\n");
    }
    else
    {
         printf("No\n");
    }
    return 0;
}


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

int main()
{

  int n, goukei;
  cin >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++){
    int A;
    cin >> A;
    a.push_back(A);

  }

  vector<int> aa(n);
sort(a.begin(), a.end(),greater<int>());

  for (int j = 0; j < n; j++){
    if (j % 2 == 0){
      goukei += a[j];
    }
    else{
      goukei -= a[j];
    }

  }

  cout << goukei << endl;

}


Measured memory_bytes: 256
#if defined(__GNUC__)
#include <bits/stdc++.h>
// __GNUC__
#else
#include "bits/stdc++.h"
#endif
using namespace std;

#define int long long

#if defined(__GNUC__)
#define __int32 __int32_t
#endif // __GNUC__

#define itn __int32
#define REP(i, n) for(itn (i) = 0; (i) < (n); ++(i))
#define REP2(i, x, n) for(itn (i) = x; (i) < (n); ++(i))
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define SORT(x) std::sort(ALL(x))
#define RSORT(x, T) std::sort(ALL(x), greater<T>())
#define REVERCE(x) std::reverce(ALL(x))
#define ACM(x, y) std::accumulate(ALL(x), y)

#define INT_POW(x, y) [](int a, int b) -> int {if(b == 0){return 1;} int c = a; REP(i, b - 1){c *= a;} return c;}(x, y)
#define INT_POWM(x, y, m) [](int a, int b, int m) -> int {if(b == 0){return 1;} int c = a; REP(i, b - 1){c *= a; c %= m;} return c;}(x, y, m)

itn main() {
	std::ios::sync_with_stdio(false);

	int kMod = 1000000007;

	int n;

	cin >> n;

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

	vector<int> a(n);

	REP(i, n) {
		cin >> a[i];
	}

	SORT(a);

	int check = (n + 1) % 2;

	REP(i, n) {
		if (a[i] != check) {
			cout << 0;
			return 0;
		}
		if (n % 2 != i % 2) {
			check += 2;
		}
	}

	n /= 2;

	int res = INT_POWM(2, n, kMod);

	cout << res;

	return 0;
}


Measured memory_bytes: 1024
#include <iostream>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define OUT(v) cout<<v<<"\n"

int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  int A, B, C, D, E, F;
  cin >> A >> B >> C >> D >> E >> F;

  // 操作1をa回、操作2をb回、操作4をd回行うときを考える
  int ans_water = 0;
  int ans_sugar = 0;
  REP(a, F / (100 * A) + 1) {
    REP(b, F / (100 * B) + 1) {
      int water = 100*A*a + 100*B*b;
      if (water > F)
        break;
      int max_sugar = min(water / 100 * E, F - water);
      int d = 0;
      while (water + D*d <= F && max_sugar >= D * d) {
        int sugar = (max_sugar - D * d) / C * C + D * d;
        // OUT(water << ", " << sugar);
        // if (ans_sugar / (ans_water + ans_sugar) < sugar / (water + sugar))
        if (ans_sugar * (water + sugar) < sugar * (ans_water + ans_sugar) ||
            (ans_sugar == 0 && ans_water == 0)) {
          ans_water = water;
          ans_sugar = sugar;
        }
        ++d;
      }
    }
  }
  OUT(ans_water + ans_sugar << " " << ans_sugar);

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = Integer.parseInt(sc.next());
    int result;
    if(n%2==1){
       result = n/2 + 1;
    }
    else{
      result = n/2;
    }
    System.out.println(result);
  }
}


Measured memory_bytes: 21972
#include <cstdio>
#include <cstdlib>
#include <string>
#include <iostream>
using namespace std;
int main(){
  string S, T;
  cin >> S >> T;
  bool flag = true;
  for (int i= 0; i<S.length(); i++){
    if (S[i]!=T[i]) flag = false;
  }
  if(flag) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

Measured memory_bytes: 3628
#!/bin/bash
''':'
docker run --rm -it -v $(cd $(dirname $0) && pwd):/vo:ro pypy:3-2.4.0 \
   /bin/bash -c "pypy3 /vo/$(basename $0) < /vo/g.inp"
exit $?
'''
import sys


def _i(): return int(sys.stdin.readline().strip())


def _ia(): return [int(x) for x in sys.stdin.readline().strip().split()]


def judge(a):
    for aij in ai:
        if aij not in b:
            flag = False
            break


def main():
    a = [_ia() for _ in range(3)]

    n = _i()
    b = [_i() for _ in range(n)]
    f1 = True
    f4 = True
    for i in range(3):
        if a[i][i] not in b: f1 = False
        if a[i][-1-i] not in b: f4 = False

        f2, f3 = [True] * 2
        for j in range(3):
            if a[i][j] not in b: f2 = False
            if a[j][i] not in b: f3 = False
        if f2 or f3: return "Yes"
    return "Yes" if f1 or f4 else "No"


if __name__ == "__main__":
    print(main())


Measured memory_bytes: 38256
#ifdef ConanYu
#include "local.hpp"
#else
#pragma GCC optimize("-O3")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
void Main();
#define debug(...) do { } while(0)
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  Main();
}
#endif

int dp[2][2];

void Main() {
  string s; cin >> s;
  const int n = s.size();
  dp[n & 1][1] = 0x3f3f3f3f;
  for(int i = n - 1; i >= 0; i--) {
    dp[i & 1][0] = min(dp[~i & 1][0] + s[i] - '0', dp[~i & 1][1] + s[i] - '0' + 1);
    dp[i & 1][1] = min(dp[~i & 1][0] + 10 - (s[i] - '0'), dp[~i & 1][1] + 9 - (s[i] - '0'));
  }
  cout << min(dp[0][0], dp[0][1] + 1) << "\n";
}


Measured memory_bytes: 1948
#include <bits/stdc++.h>
using namespace std;
int main(){
string S; 
cin >> S; 
int N = S.size(); 
for (int i = N/2 - 1; i >= 1; i--) {
if(S.substr(0, i) == S.substr(i, i)){
cout << i * 2 << endl; 
break;  
}
}
}

Measured memory_bytes: 256
#include<stdio.h>
double dp[2][20];
int main(){
	while(1){
	int n;
	scanf("%d",&n);
	if(n==0)return 0;
	int i,j;
	double ans=0.0f;
	for(j=0;j<20;j++)dp[0][j]=0.0f;
	dp[0][1]=1.0f;
	for(i=0;i<n-1;i++){
		for(j=0;j<20;j++)dp[(i+1)%2][j]=0.0f;
		dp[(i+1)%2][1]+=dp[i%2][0];
		for(j=1;j<19;j++){
			double p=1.0f/(1<<j);
			dp[(i+1)%2][j+1]+=dp[i%2][j]*p;
			dp[(i+1)%2][0]+=dp[i%2][j]*(1-p);
			ans+=dp[i%2][j];
		}
	}
	for(j=1;j<20;j++)ans+=dp[(n+1)%2][j];
	printf("%lf\n",ans);
	}
}

Measured memory_bytes: 1060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B;
  cin >> A >> B;
  if (A == 1) {
    if (B == 2) {
      cout << 3 << endl;
    }
    else {
      cout << 2 << endl;
    }
  }
  else if (A == 2) {
    if (B == 1) {
      cout << 3 << endl;
    }
    else {
      cout << 1 << endl;
    }
  }
  else {
    if (B == 1) {
      cout << 2 << endl;
    }
    else {
      cout << 1 << endl;
    }
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for (ll i=1; i<n; ++i)
#define all(c) begin(c),end(c)
/*
*/
int main(){
  ll N; cin>>N;
  vector<ll> ans(10010,0);
  rep(x,101) rep(y,101) rep(z,101){
    ll d=x*x+y*y+z*z+x*y+y*z+z*x;
    if(d > N) break;
    ans[d]++;
  }
  rep(i,N+1) cout<<ans[i]<<endl;
}

Measured memory_bytes: 3712
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define rn return
#define fi first
#define se second
typedef std::pair<int,int> P;
using namespace std;
using ll = long long;


vector<int> uf(2000,-1);

int root(int v){
    rn (uf[v]<0? v: uf[v] = root(uf[v]));
}
bool join(int a, int b){
    int p = root(a);
    int q = root(b);
    if (p!=q){
        uf[p] += uf[q];
        uf[q] = p;
    }
    else{
        rn false;
    }
    rn true;
}


int main(){
    int N;
    cin >> N;
    vector<string> a;
    string add;
    rep(i,N) {cin >> add;a.emplace_back(add);}
    
    rep(i,N){
        rep(j,N){
            if (a[i][j] == '1'){
                join(i,j+N);
            }
        }
    }
    if (root(0)==root(0+N)){
        cout << "-1" << endl;
        rn 0;
    }
    
    vector<vector<int>> distance(N,vector<int>(N,10000000));
    rep(i,N){
        rep(j,N){
            if (a[i][j] == '1') distance[i][j] = 1;
        }
    }
    

    
    rep(k,N){
        rep(i,N){
            rep(j,N){
                distance[i][j] = min(distance[i][k]+distance[k][j],distance[i][j]);
            }
        }
    }

    int ans = 0;
    rep(i,N){
        rep(j,N){
            if (i!=j) ans = max(ans,distance[i][j] );
        }
    }
    
    cout << ans + 1;
    rn 0;
}

// watch out for (a+b)/2*c order. c*(a+b)/2 is different from (a+b)/2*c!!!
int mainA(){
    string S;
    ll K;
    cin >> S >> K;
    ll ans = 0;
    ll len = 1;
    rep(i,S.size()-1){
        if (S[i] != S[i+1]) {ans += len/2; len = 1;}
        else{
            len++;
        }
    }
    
    if (len == S.size()){
        cout << (K*len)/2 << endl;
        rn 0;
    }
    

    
    if (S[0] == S[S.size()-1]){
        ll l0 = 1;
        rep(i,S.size()-1){
            if (S[i] == S[i+1]){l0++;}
            else break;
        }
        ans -= l0/2;
        ans *= K;
        ans += (l0+len)/2*(K-1) + len/2 + l0/2;
    }
    else{
        ans += len/2;
        ans *= K;
    }
    
    cout << ans << endl;
    rn 0;
}


Measured memory_bytes: 512
(defun input (n)
  (let ((A (make-array n)))
    (dotimes (i n)
      (setf (aref A i) (read)))
    A))
(defun solve (A)
  (if (evenp (count-if #'oddp A))
    "YES" "NO"))
(let* ((n (read))
       (A (input n)))
  (format t "~A~%" (solve A)))

Measured memory_bytes: 67304
#include<iostream>
using namespace std;
int main() {
	int tate, yoko;
	cin >> tate >> yoko;
	while (tate != 0 || yoko != 0) {
		for (int i = 0; i < tate; i++) {
			for (int j = 0; j < yoko; j++) {
				cout << '#';
			}
			cout << endl;
		}
		cout << endl;
		cin >> tate >> yoko;
	}
	return 0;
}

Measured memory_bytes: 3076
x,n=list(map(int,input().split()))
if(n==0):
    print(x)
else:
    p=list(map(int,input().split()))
    mini=min(p)-1
    maxi=max(p)+1

    m=abs(maxi-x)
    val=maxi
    i=maxi
    while(i>=mini):
        if(i in p):
            pass
        else:
            
            
            if(abs(i-x)<=m):
                m=abs(i-x)
                val=i
        i-=1        

    print(val)

# x,y=list(map(int,input().split()))

# t=y/2-x
# c=x-t

# if(t<0 or c<0 or abs(t)!=t or abs(c)!=c):
#   print("No")
# else:
#   print("Yes")

Measured memory_bytes: 9208
#include <bits/stdc++.h>
#define foi for(int i=0; i<n; i++)
#define foj for(int j=0; j<n; j++)
#define vi  vector<int>
#define ll  long long int
using namespace std;

int main() {
    int n,x,ans,tmp;
    vi a;
    cin >> n >> x;
    a.resize(n);
    foi cin >> a[i];
    sort(a.begin(),a.end());
    ans=0; tmp=0;
    foi {
        if (x==0) break;
        if (x >= a[i]) {
            if (i==n-1) {
                if (x!=a[i])
                    break;
                else {
                    ans++;
                    x-=a[i];
                }
            }
            else {
                x -= a[i];
                ans++;
            }
        }
        else
            continue;
    }
    cout << ans << '\n';
}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<double> vd;
typedef vector<ll> vl;
typedef vector<string> vs;
#define fo(i, a, b) for (int i = a; i < b; i++)
#define re(i, n) fo(i, 0, n)
#define pb push_back
#define all(s) s.begin(), s.end()
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { ll g = gcd(a, b); return a / g * b; }
ll p(ll n)
{
  return n * n * n * n * n;
}

int main()
{
  ll x;
  cin >> x;

  int a, b;
  re(i, 1000) {
    re(j, 1000) {
      if(x == p(i) - p(j)) {
        a = i;
        b = j;
      } else if(x == p(i) + p(j)) {
        a = i;
        b = -j;
      }
    }
  }

  cout << a << ' ' << b << endl;

  return 0;
}


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

class UnionFind {
	vector<int>par, sz;
public:
	UnionFind() {}
	UnionFind(int n) {
		par = sz = vector<int>(n);
		for (int i = 0; i < n; i++) {
			par[i] = i;
			sz[i] = 1;
		}
	}
	int find(int x) {
		if (par[x] == x)return x;
		return par[x] = find(par[x]);
	}
	void unite(int x, int y) {
		x = find(x); y = find(y);
		if (x == y)return;
		if (sz[x] > sz[y]) {
			par[y] = x;
			sz[x] += sz[y];
		}
		else {
			par[x] = y;
			sz[y] += sz[x];
		}
	}
	bool same(int x, int y) {
		return find(x) == find(y);
	}
	int size(int x) {
		return sz[find(x)];
	}
};
int main(){
	int n,m;cin>>n>>m;
	UnionFind uf(n);
	rep(i,m){
		int a,b;cin>>a>>b;a--;b--;
		uf.unite(a,b);
	}
	int ans=0;
	rep(i,n){
		ans=max(ans,uf.size(i));
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 4832
import numpy as np
import itertools

n, m = list(map(int, input().split()))

ss = []
for i in range(m):
	tmp = list(map(int, input().split()))
	s = [0 for _ in range(n)]
	for t in tmp[1:]:
		s[t - 1] = 1
	ss.append(s)
ss = np.array(ss)
#print(ss)

ps = list(map(int, input().split()))

ans = 0
for x in itertools.product(range(2), repeat = n):
	lights = np.dot(ss, np.array(x))
	if sum([1 for i in range(m) if lights[i] % 2 == ps[i]]) == m:
		ans += 1

print(ans)

Measured memory_bytes: 21792
/// Thank you tanakh!!!
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

fn main() {
    input!(k: usize);
    let n = 50;
    let mut b = vec![k / n; n];
    for i in 0..(k % n) {
        b[i] += 1;
    }

    assert_eq!(b.iter().sum::<usize>(), k);
    let mut upper_a = vec![0; n];
    let mut lower_a = vec![0; n];
    for i in 0..n {
        lower_a[i] = if (n + 1) * b[i] < k {
            0
        } else {
            (n + 1) * b[i] - k
        };
        upper_a[i] = (n + 1) * b[i] + (n - 1) - k;
    }
    println!("{}", n);
    for i in 0..n {
        if i > 0 {
            print!(" ");
        }
        print!("{}", upper_a[i]);
    }
    println!();
}


Measured memory_bytes: 4476
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;

void solve() {
    int n, h, w; cin >> n >> h >> w;

    cout << (n-h+1) * (n-w+1) << endl;
}

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

    solve();
    return 0;
}
 


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

using namespace std;

#define mod 1000000007

int getgcd(int m, int n)
{
	if(n == 0) return m;
	return getgcd(n, m % n);
}

int main()
{
	int n, k;
	cin >> n >> k;
	int gcd;
	int maxnum;
	for(int i = 0; i < n; i++){
		int a;
		cin >> a;
		if(i == 0){
			gcd = a;
			maxnum = a;
		} else {
			gcd = getgcd(max(gcd, a), min(gcd, a));
			maxnum = max(maxnum, a);
		}
	}
	if(k % gcd == 0 && k <= maxnum) cout << "POSSIBLE" << endl;
	else cout << "IMPOSSIBLE" << endl;

}


Measured memory_bytes: 256
O = input()
E = input()

l = len(O) + len(E)
oc = 0
ec = 0
for i in range(1, l+1):
    if i % 2 == 1:
        print(O[oc], end="")
        oc += 1
    else:
        print(E[ec], end="")
        ec += 1

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

using namespace std;

int main() {
    string S, T;
    cin >> S >> T;
    map<char, int> m_s, m_t;
    for (int c = (int)'a'; c <= (int)'z'; ++c) {
        m_s[(char)c] = 0;
        m_t[(char)c] = 0;
    }
    for (int i = 0; i < S.size(); ++i) {
        ++m_s[S[i]];
        ++m_t[T[i]];
    }
    bool flag = false;
    for (int i = 0; i < S.size(); ++i) {
        if (m_s[S[i]] != m_t[T[i]]) flag = true;
    }
    if (flag) cout << "No" << endl;
    else cout << "Yes" << endl;
}

Measured memory_bytes: 776
#include <algorithm>
#include <iostream>
#include <string>

int main(int argc, char* argv[]) {
  std::string S;
  std::cin >> S;

  int ret = 0;
  int cnt = 0;
  for (auto&& s : S) {
    if (s == 'A' || s == 'C' || s == 'G' || s == 'T') {
      cnt++;
      ret = std::max(ret, cnt);
    } else {
      cnt = 0;
    }
  }
  std::cout << ret << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    int m;
    cin>>m;
    for(int i=1;i<=m;i++)
    {
        int t,x,y;
        cin>>t>>x>>y;
        if(t-x-y<0||(t-x-y)%2!=0)
        {cout<<"No";return 0;}
    }
    cout<<"Yes";return 0;
}

Measured memory_bytes: 256
from collections import Counter
n = int(input())
lst = [(input()) for _ in range(n)]
c = Counter(lst)
d = c.most_common()
e = d[0][1]
lst_new = []
for f in c.keys():
    if c[f] == e:
        lst_new.append(f)
lst_new.sort()
for g in lst_new:
    print(g)        
        

    
    

Measured memory_bytes: 47672
/************************************
/ AUTHOR : YATHARTH GOSWAMI         /  
/ ALIAS : hacker_yg                 /
/ INSTITUTE : IIT Kanpur            /
************************************/
//          TEMPLATE                //

#include <bits/stdc++.h>

#define ll long long
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second

using namespace std;

int main(){
    int n, k;
    cin >> n >> k;
    vector <ll> v(n);
    for (int i = 0; i < n; i++) cin >> v[i];
    sort(v.begin(), v.end(), greater <int> ());
    ll ans = 0;
    for (int i = k; i < n; i++) ans += v[i];
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 1792
#[allow(unused_imports)]
use itertools::Itertools;
#[allow(unused_imports)]
use num::Integer;
#[allow(unused_imports)]
use proconio::derive_readable;
use proconio::fastout;
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::*;
#[allow(unused_imports)]
use std::cmp;
#[allow(unused_imports)]
use std::collections::*;

fn solve(k: usize) -> i64 {
    let mut visited = vec![false; k];
    let mut current = 7 % k;
    for i in 1.. {
        if current == 0 {
            return i;
        }
        if visited[current] {
            return -1;
        }
        visited[current] = true;
        current = (current * 10 + 7) % k;
    }
    unreachable!()
}

#[fastout]
fn main() {
    input! {
        k: usize,
    }

    println!("{}", solve(k));
}


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

struct Node{
	Node(){
		parent = -1;
		left = -1;
		right = -1;
		sibling = -1;
		degree = 0;
		depth = 0;
		height = 0;
	}
	int parent;
	int left;
	int right;
	
	int sibling;
	int degree;
	int depth;
	int height;
};

void calc_height(Node Tree[], int id)
{
	int l = Tree[id].left, r = Tree[id].right;
	int l_height = -1, r_height = -1;
	if (l != -1) l_height = Tree[l].height;
	if (r != -1) r_height = Tree[r].height;
	
	Tree[id].height = max(l_height, r_height) + 1;
	
	if (Tree[id].parent != -1) calc_height(Tree, Tree[id].parent);
}

void calc_depth(Node Tree[], int id)
{
	int pa = Tree[id].parent;
	if (pa != -1)
	{
		Tree[id].depth = Tree[pa].depth + 1;
	}
	
	int l = Tree[id].left, r = Tree[id].right;
	if (l != -1) calc_depth(Tree, l);
	if (r != -1) calc_depth(Tree, r);
}

void set_node(Node Tree[], int id, int l, int r)
{
	int deg = 0;
	if (l != -1)
	{
		deg++;
		Tree[l].sibling = r;
		Tree[l].parent = id;
	}
	if (r != -1)
	{
		deg++;
		Tree[r].sibling = l;
		Tree[r].parent = id;
	}
	
	Tree[id].degree = deg;
	Tree[id].left = l;
	Tree[id].right = r;
	
	calc_height(Tree, id);
	calc_depth(Tree, id);
}


void Print(Node Tree[], int n)
{
	for (int i = 0;i < n;i++)
	{
		printf("node %d: parent = %d, sibling = %d, "
			   "degree = %d, depth = %d, height = %d, ",
				i, Tree[i].parent, Tree[i].sibling,
				Tree[i].degree, Tree[i].depth, Tree[i].height);
				
		if (Tree[i].parent == -1)
		{
			printf("root\n");
		}
		else if (Tree[i].degree == 0)
		{
			printf("leaf\n");
		}
		else
		{
			printf ("internal node\n");
		}
	}
}

int main ()
{
	int n;
	cin >> n;
	Node *B_Tree = new Node [n];
	
	for (int i = 0;i < n;i++)
	{
		int id, left, right;
		cin >> id >> left >> right;
		
		set_node(B_Tree, id, left, right);
	}
	
	Print(B_Tree, n);
	
	return 0;
 } 


Measured memory_bytes: 3232
#include<bits/stdc++.h>
using namespace std;
int dp[1001][1001]={0};
int main(void){
	string s,t;
	int i,j;
	int n,m;
	int ans;
	int sum;
	const int MM=1000000007;
	cin>>s>>t;
	n=(int)s.size();
	m=(int)t.size();
	// cout<<s<<endl;
	// cout<<t<<endl;
	for(i=0;i<n;i++){
		if(t[0]==s[i]){
			dp[0][i]=1;
		}
	}
	for(i=1;i<m;i++){
		sum=0;
		for(j=0;j<n;j++){
			if(t[i]==s[j]){
				dp[i][j]=sum;
			}
			if(t[i-1]==s[j])	sum=(sum+dp[i-1][j])%MM;
		}
	}
	// for(i=0;i<m;i++){
		// for(j=0;j<n;j++){
			// cout<<dp[i][j]<<" ";
		// }
		// cout<<endl;
	// }
	ans=0;
	for(i=0;i<n;i++){
		if(t[m-1]==s[i])	ans=(ans+dp[m-1][i])%MM;
	}
	cout<<ans<<endl;
	return 0;
}
				


Measured memory_bytes: 7088
#include <iostream>
#include <string>
using namespace std;
int main()
{
    string s;
    cin >> s;
    int cnt = 0;
    if (s[0] == '1')
        ++cnt;
    if (s[1] == '1')
        ++cnt;
    if (s[2] == '1')
        ++cnt;
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(ll i=0;i<n;i++)
const ll INF=1e18;
const int inf=2e9;
const ll MOD=1000000007;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};

int main(){
    char s;cin>>s;
    s++;
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <iostream>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <queue>
#include <cstring>
using namespace std;

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 main() {
	int N, W,ans=0,x=0; cin >> N >> W;
	vector<int>w(N), v(N);
	for (int i = 0; i < N; i++) {
		cin >> w[i] >> v[i]; x += v[i];
	}
	vector<vector<long long>> dp(N+1,vector<long long>(x+1,1e14));
	dp[0][0] = 0;
	for (int i = 0; i < N; i++) {
		for (int j = 0; j <= x-v[i]; j++) {
			chmin(dp[i + 1][j + v[i]], dp[i][j] + w[i]);
			chmin(dp[i + 1][j], dp[i][j]);
		}
	}
	for (int i = x; i >= 0; i--) {
		if (dp[N][i] <= W) { cout << i << endl; return 0; }
	}
}





Measured memory_bytes: 80256
N = int(input())

f = [0] * (10 ** 4 + 1)

for x in range(1, 100):
    for y in range(1, 100):
        for z in range(1, 100):
            n = x ** 2 + y ** 2 + z ** 2 + x * y + y * z + z * x
            if n <= 10000:
                f[n] += 1

for ans in f[1:N + 1]:
    print(ans)


Measured memory_bytes: 9268