akhauriyash/Code-Regression huggingface dataset:
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		String[] f = new String[n];
		Arrays.fill(f, "");
		int[][]p = new int[n][11];
		for(int i = 0; i < n; i++) for(int j = 0; j < 10; j++) f[i] += sc.next();
		for(int i = 0; i< n; i++) for(int j = 0; j < 11; j++) p[i][j] = sc.nextInt();
		int max = Integer.MIN_VALUE;
		for(int i = 1; i < 1024; i++){
			int[] count = new int[n];
			Arrays.fill(count, 0);
			for(int j = 0; j < f.length; j++){
				int num = Integer.parseInt(f[j], 2);
				String s = String.format("%11s", Integer.toBinaryString(num & i));
				s = s.replaceAll(" ", "0");
				for(int k = 0; k < 11; k++) if(s.charAt(k) == '1') count[j]++;
			}

			int v = 0;
			for(int j = 0; j < n; j++){
				int c = count[j];
				v += p[j][c];
			}
			if(max < v) max = v;
		}
		System.out.println(max);
	}
}

Measured memory_bytes: 102020
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
vector<vector<int>> vec;
int n,m,q;
void num(vector<int> v){
    if(v.size()==10){
        vec.push_back(v);
    }
    else if(v.size()==0){
        rep(i,m){
            v.push_back(i+1);
            num(v);
            v.pop_back();
        }
    }
    else{
        int x=v.size();
        int y=v[x-1];
        for(int i=y;i<=m;i++){
            v.push_back(i);
            num(v);
            v.pop_back();
        }
    }
}

int main() {

  cin >> n >> m >> q;
  vector<int> emp;
  num(emp);
  vector<vector<int>> qs(q,vector<int>(4));
  rep(i,q) cin >> qs[i][0] >> qs[i][1] >> qs[i][2] >> qs[i][3];
  int ans=0;
  for(vector<int> vv:vec){
      int count=0;
      rep(i,q){
          int a=qs[i][0];
          int b=qs[i][1];
          int c=qs[i][2];
          int d=qs[i][3];
          a--;b--;
          if(vv[b]-vv[a]==c) count+=d;
      }
      ans=max(ans,count);
  }
  cout << ans << endl;
}

Measured memory_bytes: 9852
str=gets.chomp
num=str.split
ad=num[0].to_i
bd=num[1].to_i
ans1=ad/bd
ans2=ad%bd
af=ad.to_f
bf=bd.to_f
ans3=af/bf
print "#{ans1} #{ans2} "
puts sprintf("%.8f",ans3)

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

int main() {
  int N, sum;
  sum = 0;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    int l, r;
    cin >> l >> r;
    sum += r - l + 1;
  }
  cout << sum << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long int
#define pb push_back
#define pii pair<int, int>
#define pll pair<ll, ll>
#pragma GCC optimize ("O3")
using namespace std;
int main () {
    ios::sync_with_stdio(false);
    cin.tie (0);    
    ll n; cin>>n;
    vector <ll> a (n), b (n, 0), ans;
    for (auto &i : a) cin>>i;
    for (ll i=n-1;i>=n/2;--i) {
        if (a[i]) b[i]=1;
    }
    for (ll i=n/2-1;i>=0;--i) {
        ll temp=0;
        for (ll j=i;j<n;j+=(i+1)) {
            if (b[j]) temp++;
        }
        if (temp%2!=a[i]) b[i]=1;
    }
    for (ll i=0;i<n;++i) {
        if (b[i]) ans.pb(i+1);
    }
    cout<<ans.size()<<'\n';
    if (ans.size()) {
        for (auto &i : ans) cout<<i<<' ';
    }
    return 0;
}

Measured memory_bytes: 5108
using System;

namespace A___Can_you_get_AC
{
    class Program
    {
        static void Main(string[] args)
        {
            bool ans = Console.ReadLine().Contains("AC");
            if(ans)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


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

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

    static class CChristmasEve {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int n = in.nextInt(), k = in.nextInt(), a[] = new int[n];
            for (int i = 0; i < n; ++i) a[i] = in.nextInt();
            Arrays.sort(a);
            int ans = Integer.MAX_VALUE;
            for (int i = 0; i < n - k + 1; ++i) ans = Math.min(ans, a[i + k - 1] - a[i]);
            out.println(ans);
        }

    }

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

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

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

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

    }
}



Measured memory_bytes: 36588
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
struct UnionFind {
    vector<int> par; // uf(x,y)->y
    UnionFind() {}
    UnionFind(int NV) { init(NV); }
    void init(int NV) { par.clear(); rep(i, 0, NV) par.push_back(i); }
    void reset() { rep(i, 0, par.size()) par[i] = i; }
    int operator[](int x) { return par[x] == x ? x : par[x] = operator[](par[x]); }
    void operator()(int x, int y) { x = operator[](x); y = operator[](y); if (x != y) par[x] = y; }
};
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　  |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/









int N;
double X[101], Y[101], Z[101], R[101];
//---------------------------------------------------------------------------------------------------
void _main() {
    while (cin >> N) {
        if (N == 0) return;
        rep(i, 0, N) cin >> X[i] >> Y[i] >> Z[i] >> R[i];

        vector<pair<double, pair<int, int>>> E;
        rep(a, 0, N) rep(b, a + 1, N) {
            double dx = X[a] - X[b];
            double dy = Y[a] - Y[b];
            double dz = Z[a] - Z[b];
            double d = sqrt(dx*dx + dy * dy + dz*dz);

            double c = max(0.0, d - R[a]- R[b]);

            E.push_back({ c, {a, b} });
        }
        sort(all(E));

        UnionFind uf(N);
        double ans = 0;
        fore(p, E) {
            double a; int b, c;
            a = p.first;
            b = p.second.first;
            c = p.second.second;

            if (uf[b] != uf[c]) {
                uf(b, c);
                ans += a;
            }
        }

        printf("%.3f\n", ans);
    }
}


Measured memory_bytes: 3272
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
using namespace std;

int main()
{
    long long A, B;
    cin >> A >> B;
    long long ans = 0;
    for (long long i = 1; i <= B; ++i)
    {
        if((A*i)%B==0){
            ans = A * i;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

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

const int INF = 1e9;

int main()
{
	int N, M;
	cin >> N >> M;
	vector<vector<int>> G(N);
	for (int i = 0; i < M; i++) {
		int u, v;
		cin >> u >> v; --u, --v;
		G[u].push_back(v);
	}
	int dist = INF;
	vector<int> res;
	for (int i = 0; i < N; i++) {
		vector<int> d(N, INF);
		vector<int> pre(N);
		d[i] = 0;
		queue<int> q;
		q.push(i);
		bool ok = false;
		int x = -1;
		while (!q.empty() && !ok) {
			auto v = q.front(); q.pop();
			for (auto to : G[v]) {
				if (to == i) {
					x = v;
					ok = true;
					break;
				}
				if (d[to] == INF) {
					d[to] = d[v] + 1;
					pre[to] = v;
					q.push(to);
				}
			}
		}
		if (ok) {
			vector<int> vs = { i };
			while (x != i) {
				vs.push_back(x);
				x = pre[x];
			}
			sort(vs.begin(), vs.end());
			if (dist > (int)vs.size()) {
				res = vs;
				dist = vs.size();
			}
		}
	}
	if (dist == INF) {
		cout << -1 << endl;
	}
	else {
		cout << dist << endl;
		for (auto v : res) {
			cout << v + 1 << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>

using namespace std;

int main(){
    int n;
    cin>>n;
    vector<string> hoge(n);
    
    for(int i=0;i<n;i++){
        cin>>hoge.at(i);
    }
    
    sort(hoge.begin(),hoge.end());
    
    int count=0;
    int maxcount=0;
    
    for(int i=0;i<n-1;i++){
        count++;
        
        if(i==n-2){
            if(hoge.at(i)!=hoge.at(i+1)){
                maxcount=max(maxcount,count);
            }else{
                count++;
                maxcount=max(maxcount,count);
            }
            break;
        }
        
        if(hoge.at(i)!=hoge.at(i+1)){
            maxcount=max(count,maxcount);
            count=0;
        }
    }
    
    count=0;
    
    for(int i=0;i<n-1;i++){
        count++;
        
        if(i==n-2){
            if(hoge.at(i)!=hoge.at(i+1)){
                if(count==maxcount || maxcount==1){
                cout<<hoge.at(i)<<endl;
            }
            }else{
                count++;
                if(count==maxcount || maxcount==1){
                cout<<hoge.at(i)<<endl;
            }
            }
            break;
        }
        
        if(hoge.at(i)!=hoge.at(i+1)){
            if(count==maxcount || maxcount==1){
                cout<<hoge.at(i)<<endl;
            }
            count=0;
        }
    }
    
    if(maxcount==1){
        cout<<hoge.at(hoge.size()-1)<<endl;
    }
    
    return 0;
}

Measured memory_bytes: 14208
#include"bits/stdc++.h"
using namespace std;
using ll = int64_t;

//1点更新,区間和
class SegmentTree {
public:
    SegmentTree(ll n, ll value) {
        n_ = (ll)pow(2, ceil(log2(n)));
        nodes_.resize(2 * n_ - 1, value);
    }
    void update(ll x, ll v) {
        nodes_[x + n_ - 1] = v;
        for (ll i = (x + n_ - 2) / 2; i > 0; i = (i - 1) / 2) {
            nodes_[i] = nodes_[2 * i + 1] + nodes_[2 * i + 2];
        }
    }

    ll getSum(ll a, ll b, ll k = 0, ll l = 0, ll r = -1) {
        if (r < 0) {
            r = n_;
        }
        if (r <= a || b <= l) {
            return 0;
        }
        if (a <= l && r <= b) {
            return nodes_[k];
        }
        ll lv = getSum(a, b, 2 * k + 1, l, (l + r) / 2);
        ll rv = getSum(a, b, 2 * k + 2, (l + r) / 2, r);
        return lv + rv;
    }

private:
    //2のべき乗
    ll n_;
    vector<ll> nodes_;
};

int main() {
    ll N, Q;
    string S;
    cin >> N >> S >> Q;
    vector<ll> k(Q);
    for (ll i = 0; i < Q; i++) {
        cin >> k[i];
    }

    SegmentTree D(N, 0), C(N, 0);
    for (ll i = 0; i < N; i++) {
        if (S[i] == 'D') {
            D.update(i, 1);
        } else if (S[i] == 'C') {
            D.update(i, 1);
        }
    }

    for (ll i = 0; i < Q; i++) {
        ll ans = 0;
        ll C = 0, M = 0, MC = 0;
        for (ll j = 1; j < k[i]; j++) {
            if (S[j] == 'M') {
                M++;
            } else if (S[j] == 'C') {
                MC += M;
                C++;
            }
        }
        ans += (S[0] == 'D') * MC;
        for (ll j = 1; j < N; j++) {
            if (S[j] == 'M') {
                M--;
                MC -= C;
            } else if (S[j] == 'C') {
                C--;
            }

            //先を見る
            if (j + k[i] - 1 < N) {
                if (S[j + k[i] - 1] == 'M') {
                    M++;
                } else if (S[j + k[i] - 1] == 'C') {
                    C++;
                    MC += M;
                }
            }

            if (S[j] == 'D') {
                ans += MC;
            }
        }

        cout << ans << endl;
    }
}

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

bool acgt(char x){
    if (x == 'A' or x == 'C' or x == 'G' or x == 'T'){
        return true;
    }else{
        return false;
    }
}

int main(){
    string s;
    cin >> s;
    int ans = 0;
    int sum = 0;
    for (int i = 0; i < s.size(); i++){
        if (acgt(s[i])){
            sum++;
            ans = max(ans,sum);
        }else{
            sum = 0;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define ANS(ans) cout<<(ans)<<endl;
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
typedef vector<int> VI;

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  for (int i = 0; i < (n); ++i)

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

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

	long long sum = 0;
	FOR(i, 0, n - 2) {
		if (v[i + 1] - v[i] >= t) {
			sum += t;
		}
		else {
			sum += v[i + 1] - v[i];
		}
	}
	sum += t;

	ANS(sum);


	return 0;
}



Measured memory_bytes: 1024
#!ruby -na00F\n
a=[[z=?0]*12]+$F.map{|l|[z]+l.chars}+[[]]
c=0
x=(1..12)
x.map{|i|x.map{|j|q=[]
a[i][j]>z&&(c+=1;q<<[i,j])
(k,l=q.pop;a[k][l]=z;[[0,0],[1,0],[0,1],[-1,0],[0,-1]].map{|c,d|(a[k+c][l+d]||z)>z&&q<<[k+c,l+d]})while q!=[]}}
p c

Measured memory_bytes: 6116
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vvi vector<vector<int>> 
#define vi vector<int> 
#define vpii vector<pair<int,int>> 
#define ff first
#define ss second
#define all(x) x.begin(),x.end()
#define ffor(i,n) for(int i = 0; i < n; ++i)
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    string s;
    cin >> s;
    vi nxt(n + 1,-1);
    for(int i = n; i > 0; --i)
    {
        int j = i - 1;
        int jmpto = -1;
        while(j >= 0 && (i - j) <= m)
        {
            if(s[j] == '0')
            {
                jmpto = j;
            }
            --j;
        }
        if(jmpto == -1)
        {
            cout << -1;
            return 0;
        }
        nxt[jmpto] = i;
        i = jmpto + 1;
        // cout << jmpto << ' ';
    }
    int cur = 0;
    while(cur != n)
    {
        cout << (nxt[cur] - cur) << ' ';
        cur = nxt[cur];
    }
}

Measured memory_bytes: 1488
#include <iostream>

using namespace std;

int n , x , fr[1000005];

bool ok[1000005];

int main() 
{
    int mx = 0 , ans = 0;
    cin >> n;
    for(int i = 1 ; i <= n ; i++)
    {
        cin >> x;
        mx = max(mx , x);
        ++fr[x];
    }
    ///cout << mx << "\n";
    for(int i = 1 ; i <= mx ; i++)
        if(!ok[i] && fr[i])
        {
            if(fr[i] == 1)
                ans++;
            for(int j = 2 * i ; j <= mx ; j += i)
                ok[j] = true;
        }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 8524
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <deque>
using namespace std;
typedef long long ll;
const int INF = 1<<30; 
const int MOD = 1e9 + 7;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n; cin >> n;
    string s; cin >> s;
    string ans = "";
    int left = 0;
    for(int i = 0; i < s.size(); i++)
    {
        if(s[i] == ')')
        {
            if(left == 0) ans = '(' + ans;
            else left--;
        }
        else
        {
            left++;
        }
        ans += s[i];
    }
    while(left--) ans += ')';
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define itn int
#define rep(i, n) for (int i = 0; i < n; i++)

using namespace std;
typedef long long ll;

int main(){
    int n;
    double k;
    cin >> n >> k;
    double ans=0;
    rep(i,n){
        int detame=i+1;
        double kakuritu=1;
        while(detame<k){
            detame*=2;
            kakuritu/=2;
        }
        ans+=kakuritu/n;
    }
    cout << fixed << setprecision(12) << ans << endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <numeric>
#include <array>
#include <cmath>
#include <memory>
#include <iomanip>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define DEFOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin)-1; (LoopVariable) >= (numberOFend); (LoopVariable)--)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)

constexpr long long int linf = numeric_limits<long long int>::max()-5;
constexpr int inf= numeric_limits<int>::max()-5;
constexpr long long int mod = 1000000007;

int main(){

    int n, k;
    cin >> n >> k;
    double result = 0,this_prob;
    int now_score;
    FOR(i,1,n+1){
        this_prob = 1.0;
        now_score = i;

        while(now_score<k){
            now_score *= 2;
            this_prob /= 2.0;
        }
        result += this_prob;
    }
    cout<< std::fixed  << std::setprecision(10)<< result/n << endl;

    return 0;
}


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

int n, k, q, a[100010];

int main() {
    cin>>n>>k>>q;
    for(int i=1; i<=q; i++){
        int id;
        cin>>id;
        a[id]++;
    }
    for(int i=1; i<=n; i++){
        if(a[i]>=q-(k-1)) cout<<"Yes\n";
        else cout<<"No\n";
    }
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int n,a;
	cin >> n >> a;
	n= n% 500;
	if (n <= a){
		cout<<"Yes" <<endl;
	}
	else{
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
using namespace std;
 
#define MAX 15010
typedef pair<int,int> pii;
typedef pair<pii,int> P;
 
bool check(int a,int b,int c){
    if(a >= b+c || b >= a+c || c >= a+b) return false;
    return true;
}
 
int main(){
    vector<int> prime;
    bool p[MAX];
    fill(p,p+MAX,true);
    p[0] = p[1] = false;
    for(int i = 2 ; i < MAX ; i++){
	if(!p[i]) continue;
	prime.push_back(i);
	for(int j = 2*i ; j < MAX ; j += i){
	    p[j] = false;
	}
    }
    int T;
    while(cin >> T, T){
	int cnt = 0;
	set<P> st;
	int size = prime.size();
	for(int i = 0 ; i < size ; i++){
	    if(prime[i] > T) continue;
	    for(int j = i ; j < size ; j++){
		if(prime[i]+prime[j] > T) continue;
		int k = T-prime[i]-prime[j];
		if(k < 0 || k >= MAX || !p[k]) continue;
		int a[3] = {prime[i],prime[j],k};
		sort(a,a+3);
		if(st.count(P(pii(a[0],a[1]),a[2]))) continue;
		st.insert(P(pii(a[0],a[1]),a[2]));
		if(check(a[0],a[1],a[2])){
		    cnt++;
		}
	    }
	}
	cout << cnt << endl;
    }
    return 0;
}

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

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

int main() {
  int n, d;
  cin >> n >> d;
  if (n % (2 * d + 1) == 0) {
    cout << n / (2 * d + 1) << endl;
  } else {
    cout << (n / (2 * d + 1)) + 1 << endl;
  }
  return 0;
}


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

int main() {
  int N,M;
  cin >> N >> M;
  vector<int> A(M*2);
  for(int i=0; i<(M*2); i++){
    cin >> A.at(i) ;
  }
  
  vector<int> B(N);
  for(int i=0; i<(M*2); i++){
    B.at(A.at(i)-1) ++;
  }
  
  for(int i=0; i<N; i++){
    cout << B.at(i) << endl;
  }
  
    
}

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

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

  std::vector<int> an(n);

  for (auto &a : an) {
    std::cin >> a;
  }
  auto copy = an;

  std::sort(copy.begin(), copy.end());
  auto champ = *(copy.end() - 1);
  auto schamp = *(copy.end() - 2);

  for (const auto a : an) {
    auto result = champ;
    if (champ == a) {
      result = schamp;
    }
    std::cout << result << std::endl;
  }
  return 0;
}

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

int main()
{
    ll H,N;
    vector<int> vec;
    cin >> H >> N;
    ll t=N,sum=0;
    while(t--){
        int a;
        cin >> a;
        vec.push_back(a);
        sum+=a;
    }
    if(sum>=H)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;



    return 0;
}


Measured memory_bytes: 892
#include <cstdio>
#include <stack>
using namespace std;

int main() {
    int n, q, op, t, x;
    scanf("%d %d", &n, &q);
    stack<int> S[n];
    while (q--) {
        scanf("%d %d", &op, &t);
        if (op == 0) {
            scanf("%d", &x);
            S[t].push(x);
        } else if (op == 1) {
            if (!S[t].empty()) printf("%d\n", S[t].top());
        } else {
            if (!S[t].empty()) S[t].pop();
        }
    }
    return 0;
}


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

int main () {
    
    int a[3];
    for (int i = 0; i < 3; i++) {
        cin >> a[i];
    }
    
    sort(a, a + 3);
    for (int i = 0; i < 3; i++) {
        cout << a[i];
        if (i == 2) {
            cout << endl;
        }
        else {
            cout << " ";
        }
    }
}


Measured memory_bytes: 3160
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<map>
#include<queue>
#include<vector>
using namespace std;
#define inf 0x3f3f3f
typedef long long ll;
const int maxn = 1e5+5;
int x,y,z,X,Y,Z;
int main(){
	cin >> x >> y >> z;
	X = x;Y = y;Z = z;
	cout << Z << " " << X << " "<< Y << endl;
	return 0;
}

Measured memory_bytes: 888
# coding: utf-8
# Your code here!

class Queue:
    def __init__(self, n):
       
        self.head = 0
        self.tail = 0
        self.MAX = 100005
        self.queue = [Process()] * self.MAX 
        self.qtime = 0
        
    def isEmpty(self):
        return self.head == self.tail
        
    def isFull(self):
        return ( self.queue[self.tail].name != "" ) and (self.head == (self.tail + 1) % self.MAX ) 

    def enqueue(self, x):
        if self.isFull():
            print("error: overflow")
        self.queue[self.tail] = x
        if self.tail + 1 == self.MAX:
            self.tail = 0
        else:
            self.tail += 1
        
    def dequeue(self):
        if self.isEmpty():
            print("error: underflow")
            return
        
        x = self.queue[self.head]
        
        if self.head + 1 == self.MAX:
            self.head = 0
        else:
            self.head += 1
        return x
        
class Process:
    def __init__(self, name = "", time = 0):
        self.name = name
        self.time = time
        
        


tmpList = list(input().split())
N = int(tmpList[0])
qTime = int(tmpList[1])
Q = Queue(N)
Q.qtime = qTime
for i in range(N):
    tmpList = list(input().split())
    tmpProcess = Process(tmpList[0], int(tmpList[1]))
    #Q.queue[i] = tmpProcess
    Q.enqueue(tmpProcess)

cnt = 0
    
while Q.isEmpty() == False:
    process = Q.dequeue()
    
    if process.time > qTime:
        process.time -= qTime
        Q.enqueue(process)
        cnt += qTime
    else:
        cnt += process.time
        print(process.name ,cnt)

"""
    print(Q.head, Q.tail)
    if Q.queue[Q.head].time > qTime:
        Q.queue[Q.head].time -= qTime
    else:
        print(Q.queue[Q.head].name)
        Q.dequeue()
""" 
            










Measured memory_bytes: 17664
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        int h,m,s;
        Scanner sc = new Scanner(System.in);
        int S = sc.nextInt();
        h = S/3600;
        m = (S%3600)/60;
        s = S%60;
        System.out.println(h+":"+m+":"+s);
        }
}


Measured memory_bytes: 26356
#include<stdio.h>
int main(void)
{
	int i,a[10],x,x1;
	for(i=0;i<3;i++){
		scanf("%d",&a[i]);
	}
	x=0; x1=0;
	for(i=0;i<3;i++){
		if(a[i]==5){
			x++;
		}
		else if(a[i]==7){
			x1++;
		}
	}
	if(x==2&&x1==1){
		printf("YES\n");
	}
	else{
		printf("NO\n");
	}
	return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;

int n,pos;
vector<int> pre,in,post;

void rec(int l,int r){
  if(l >= r) return;
  int root = pre[pos++];
  int m = distance(in.begin(),find(in.begin(),in.end(),root));
  rec(l,m);
  rec(m+1,r);
  post.push_back(root);
}

void solve(){
  pos = 0;
  rec(0,pre.size());

  for(int i=0;i<n;i++){
    if(i) cout << " ";
    cout << post[i];
  }
  cout << endl;
}

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

  for(int i=0;i<n;i++)
  {
    cin >> k;
    pre.push_back(k);
  }
  for(int i=0;i<n;i++){
    cin >> k;
    in.push_back(k);
  }

  solve();

  return 0;
}



Measured memory_bytes: 3180
#include<bits/stdc++.h>
using namespace std;
typedef  long long ll;
using vll=vector<ll>;
using vvll=vector<vll>;
using vi=vector<int>;
using vvi=vector<vector<int>>;
using vb=vector<bool>;
using pii=pair<int,int>;
using vpii=vector<pair<int,int>>;
using plli=pair<ll,int>;
using vplli=vector<pair<ll,int>>;
using pllll=pair<ll,ll>;
using vpllll=vector<pair<ll,ll>>;

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

//pow(llpow,modpow)
template<class T> ll llpow(ll x,T n){ll ans=1;if(x==0)ans=0;while(n){if(n&1)ans*=x;x*=x;n>>=1;}return ans;}
long long modpow(long long a, long long n, long long mod) {long long res = 1;while (n > 0) {if (n & 1) res = res * a % mod;a = a * a % mod;n >>= 1;}return res;}
//最大公約数
template<class T> inline T gcd(T x,T y){if(y==0)return x; else {return gcd(y,x%y);}}
//最小公倍数
template<class T> inline T lcm(T x,T y){return x/gcd(x,y)*y;}
//逆元
long long modinv(long long a, long long m) {long long b = m, u = 1, v = 0;while (b) {long long t = a / b;a -= t * b; swap(a, b);u -= t * v; swap(u, v);}u %= m;if (u < 0) u += m;return u;}

#define rep(i, begin_i, end_i) for (ll i = (ll)begin_i; i < (ll)end_i; i++)
//試験導入
#define irep(i, end_i, begin_i) for (ll i = (ll)begin_i-1; i >= (ll)end_i; i--)

long long INF = 1LL<<60;
int main( ){
    set<int> s[50];
    string S,T;
    cin>>S>>T;
    int n=S.size();
    rep(i,0,n){
        s[S[i]-'a'].insert(i);
    }
    ll a=0,b=0;
    int ts=T.size();
    rep(i,0,ts){
        int c=T[i]-'a';
        if(s[c].empty()){
            cout<<-1<<endl;
            return 0;
        }
        auto pos=s[c].lower_bound(b);
        if(pos==s[c].end()){
            a++,b=0;
            pos=s[c].lower_bound(b);
        }
        b=*pos+1;
    }
    cout<<a*n+b<<endl;
    return 0;
}




Measured memory_bytes: 5120
N = int(input())
List = [int(i) for i in input().split()]


ans = 10**18
def rally(p):
    n = 0
    for a in range(N):
        n += (int(p)-List[a])**2
    return n

for i in range(1,101):
    ans = min(rally(i),ans)

print(ans)


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

int main(){
    int i;
  	std::cin>>i;
  	std::string str = std::to_string(i);
  	if (str.find('7') != std::string::npos){
    	std::cout<<"Yes"<<std::endl;
    }
	else{
    	std::cout<<"No"<<std::endl;
    }
}

Measured memory_bytes: 3660
N = int(input())
A = input().split(" ")
s = 1

for i in range(N):
  if int(A[i]) == 0:
    s = 0

for i in range(N):
  if s ==0:
    break
  if s > 10**18:
    break
  s = s*int(A[i])


if s > 10**18:
  print(-1)
else:
  print(s)

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

int main(){
    int n, q, a, b, c;
    ll s=0;
    cin >> n;
    vector<int> num(100001);
    rep(i, n){
        cin >> a;
        ++num[a];
        s += a;
    }
    cin >> q;
    rep(i, q){
        cin >> b >> c;
        s += num[b] * (c - b);
        num[c] += num[b];
        num[b] = 0;
        cout(s);
    }
}


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

int main(){
	int a,b,c;
	int ans;
	
	string cunning="7767555555";
	
	for(int i=0;i<104;i++){
		cin>>a>>b;c=a+b;
		//-----test-----
		if(i<cunning.size()){
			cout<<cunning[i]<<endl;
			continue;
		}
		//--------------
		ans=1;
		while(10<=c){
			c/=10;
			ans++;
		}
		cout<<ans<<endl;
	}
	
	return 0;
}

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

int main(){
	long long n,m;
	cin >> n >> m;
	if(n>=2 && m>=2){
		cout << (n-2)*(m-2) << endl;
	}else if(n==1 && m ==1){
		cout << 1 << endl;
	}else{
		cout << max(n-2,m-2) << endl;
	}
}
		

Measured memory_bytes: 256
#!/usr/bin/env python3
#C
def gcd(a, b):
    while b > 0:
        a, b = b, a%b
    return a

N = int(input())
A = list(map(int,input().split()))
L=[0]*(N+2)
R=[0]*(N+2)
L[0] = A[0]
R[N-1] = A[N-1]
for i in range(1,N):
    L[i] = gcd(L[i-1],A[i])
for i in range(N-2,-1,-1):
    R[i] = gcd(R[i+1],A[i])

ans = 0
for i in range(N):
    ans = max(ans,gcd(L[i-1],R[i+1]))
print(ans)


Measured memory_bytes: 63856
num = int(input())


if num == 1:
    print(1)
elif num == 2 | 3:
    print(2)
elif 4 <= num <= 7:
    print(4)
elif 8 <= num <= 15:
    print(8)
elif 16 <= num <= 31:
    print(16)
elif 32 <= num <= 63:
    print(32)
else:
    print(64)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl
#define INF 1000000;
#include <map>
#include <math.h>
 
using ll = long long;
using namespace std;

ll n, k;
const ll mod = 1000000007;

int main(){
    int n, a;
    cin >> n >> a;
    out(n*n-a);
}


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;
int main(){
  int n, i;
  cin >> n;
  int x[n], y[n];
  for(i=0; i<n; i++){
    cin >> x[i];
    y[i]=x[i];}
  
  sort(x, x+n);
  for(i=0; i<n; i++){
    if(y[i]<=x[n/2-1]) cout << x[n/2]<<endl;
    else cout << x[n/2-1]<<endl;
  }
  return 0;
}

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

int main() {
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;
    for(int i=0; i<ty-sy; i++) cout << 'U';
    for(int i=0; i<tx-sx; i++) cout << 'R';
    for(int i=0; i<ty-sy; i++) cout << 'D';
    for(int i=0; i<tx-sx+1; i++) cout << 'L';
    for(int i=0; i<ty-sy+1; i++) cout << 'U';
    for(int i=0; i<tx-sx+1; i++) cout << 'R';
    cout << "DR";
    for(int i=0; i<ty-sy+1; i++) cout << 'D';
    for(int i=0; i<tx-sx+1; i++) cout << 'L';
    cout << 'U' << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
#define int long
#define ll long long
#define rep(i, n) for(int i = 0; i < n; i++)
const int INF = 1e9;
using namespace std;

signed main() {
    int N;
    ll M;
    cin >> N >> M;
    int a[100010], b[100010];
    ll m[100010] = {0};
    for(int i = 0; i < N; i++) {
        cin >> a[i] >> b[i];
    }
    for(int i = 0; i < N; i++) {
        m[a[i]] += b[i];
    }
    for(int ans = 1; ans <= 100010; ans++) {
        if(M <= m[ans]) {
            cout << ans << endl;
            break;
        }
        M -= m[ans];
    }

    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define i64 long long
#define input freopen("input.txt", "r", stdin)
#define output freopen("output.txt", "w", stdout)
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);
#define mp make_pair
#define pb push_back

int main()
{
    fast_io

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

	cout <<((a*b)%2==0?"Even":"Odd")<<endl;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <string>
#include <cstring>
#include <queue>
#define myfor(i,N) for(i=0;i<N;i++)
#define myforFL(i,f,l) for(i=f;i<l;i++)
#define myforInv(i,N) for(i=N;i>=0;i--)
#define myforFLInv(i,f,l) for(i=f;i>l;i--)

using namespace std;

int main(){
	long N,K,i,loopSize;
	long nextCity;
	
	cin >> N >> K;
	vector <long> A(N),loop;
	vector <bool> isUsed(N,false);
	myfor(i,N)cin >> A[i];
	
	loop.push_back(1);
	isUsed[0] = true;
	nextCity = A[0];
	if(nextCity != 1)loop.push_back(nextCity);
	else{
		cout << 1 << endl;
		return 0;
	}
	
	while(K >= loop.size()){
		isUsed[nextCity-1]=true;
		nextCity = A[nextCity-1];
		if(isUsed[nextCity-1])break;
		loop.push_back(nextCity);
	}
	if(K+1 == loop.size()){
		cout << loop[K] << endl;
		return 0;
	}
	myforInv(i,loop.size()-1){
		if(loop[i] == nextCity){
			loopSize = loop.size() - i;
			cout << loop[(K - (loop.size() - loopSize))%loopSize + loop.size() - loopSize] << endl;
			return 0;
		}
	}


	return 0;
}

Measured memory_bytes: 6448
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long c,d,k;
    cin>>c>>d>>k;
    int l=min((c+k-1),d);
    for(long long i=c;i<=l;i++)
    {
        cout<<i<<endl;
    }
    if(l<d)
    {
        for(long long i=max((d-k+1),c+k);i<=d;i++)
        {
            cout<<i<<endl;
        }
    }
return 0;
}


Measured memory_bytes: 256
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<chrono>//実行時間計測
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm,accumulate
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
#include<unordered_map>//順序保持しないmap
#include<unordered_set>//順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列

using namespace std;
typedef long long ll;
//マクロ
//forループ
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=ll(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end()
#define SIZE(x) ll(x.size())
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define PI 3.14159265358979323846264338327950L

#define YESNO(T) if(T){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define yesno(T) if(T){cout<<"yes"<<endl;}else{cout<<"no"<<endl;}
#define YesNo(T) if(T){cout<<"Yes"<<endl;}else{cout<<"No"<<endl;}

#define int long long
#define Graph vector<vector<int> >
#define PII pair<int,int>
#define VI vector<int>
#define VVI vecotor<vector<int> >
#define VPII vector<pair<int,int> >

template<typename A, size_t N, typename T>

void Fill(A (&array)[N], const T &val) {
	std::fill( (T*)array, (T*)(array + N), val );
}


//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//ここにグローバル変数宣言
int H, W, sh, sw, gh, gw;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};//BFS関連







//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//ここに関数宣言
int ctoi(char c) {
	switch (c) {
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	default: return 0;
	}
}










//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
signed main() {
	//入力の高速化用のコード
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

int H,N,sum=0;
cin>>H>>N;
REP(i,N){
	int a;
	cin>>a;
	sum+=a;
}
YesNo(sum>=H)
















return 0;

}







Measured memory_bytes: 3644
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
long long int a[25000]={0};
long long int b[25000]={0};
int p[25000]={0};
int main()
{
    int n;
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
        scanf("%d",&p[i]);
    for(int i=1;i<=n;i++)
    {
        a[i]=a[i-1]+n+10;
    }
    for(int i=n;i>=0;i--)
    {
        b[i]=b[i+1]+n+10;
    }
    long long syg=0;
    for(int i=1;i<=n;i++)
    {
        a[p[i]]+=i;
    }
    for(int i=1;i<=n;i++)
        printf("%lld ",a[i]);
    printf("\n");
    for(int i=0;i<n;i++)
        printf("%lld ",b[i]);
    return 0;
}


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

int main() {
 int A, B;
  cin >> A >> B ;
  
  int sum = 0;
  if ( A < B) { 
    sum = B+ (B - 1);
  }
  else if (B < A) { 
    sum = A+(A-1);
  }
  else {
    sum = A+B;
  }
  cout << sum << endl;
}
 

Measured memory_bytes: 256
N = int(input())
s = input().split()
p = []
for i in range(N):
    p.append(int(s[i]))
count = 0
for i in range(2,N):
    if p[i] > p[i-1] and p[i-1] > p[i-2]:
        count = count+1
    if p[i] < p[i-1] and p[i-1]< p[i-2]:
        count = count+1
print(count)



Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<string>
#include<queue>
#include<stack>
#include<vector>
#include<list>
#include<math.h>
using namespace std;

#define ll long long
#define vecint vector<int>
#define listint list<int>

#define REP(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define print(a) cout << a << endl


int main(){
  int N,M;
  string pic1[50],pic2[50];
  string ans;
  cin >> N >> M;
  rep(i,N){
    cin >> pic1[i];
  }
  rep(i,M){
    cin >> pic2[i];
  }
  rep(i,N-M+1){
    rep(j,N-M+1){
      ans="Yes";
      rep(k,M){
        string x = pic1[i+k].substr(j,M);
        if(x!=pic2[k]) ans="No";
      }
      if(ans=="Yes") break;
    }
    if(ans=="Yes") break;
  }
  print(ans);
  return 0;
}


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

int main() {
 int n;
 cin >> n;
 
 vector<int> a(n);
 rep(i,n) {
  cin >> a.at(i);
  }
  
  vector<int> b(n);
  rep(i,n) {
  b.at(i) = a.at(i);
  }
  
  
  sort(a.begin(),a.end());
  
  int count = 0;
  rep(i,n) {
  if(a.at(i) != b.at(i)) {
  count++;
  }
  }
  
  if(count == 0 || count == 2){
  cout << "YES";
  }
  else {
  cout << "NO";
  }
  
  
 }

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

int main() {
    int n;
    cin >> n;
    vector<int> v;
    for(int i=0; i<n; i++){
        int a;
        cin >> a;
        v.push_back(a);
    }
    sort(v.begin(), v.end());
    decltype(v)::iterator result = unique(v.begin(), v.end());
    v.erase(result, v.end());
    if(n == v.size()){
        cout << "YES";
    }
    else{
        cout << "NO";
    }
}

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

W = input()

last = W[-1]
word_list = {W}
result = 'Yes'

for i in range(1, N):
    W = input()

    if W[0] == last:
        last = W[-1]
    else:
        result = 'No'

    if W in word_list:
        result = 'No'
    else:
        word_list.add(W)

print(result)


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

int main() {
    int n;
    cin>>n;
    int a[n],sum=0;
    for(int i=0;i<n;i++){cin>>a[i];sum+=a[i];}
    sort(a,a+n);
    int f=0;
    if(a[0]==a[n-1])f=1;
    int avg1,avg2;
    if(sum%n==0){avg1=sum/n;avg2=sum/2;}
    else {
        avg1=sum/n;
        avg2=avg1+1;
    }
    long tot1=0,tot2=0;
    for(int i=0;i<n;i++){
        int diff1=abs(a[i]-avg1);
        int diff2=abs(a[i]-avg2);
        tot1+=diff1*diff1;
        tot2+=diff2*diff2;
    }
    if(f==1)cout<<0<<endl;
    else cout<<min(tot1,tot2)<<endl;
	return 0;
}

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

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m;
	cin>>n>>m;
	int a[n+1],cnt=0,sum=0;
	
	for(int i=1; i<=n; i++)
	{
		cin>>a[i];
		sum+=a[i];
	}
	
	for(int i=1; i<=n; i++)
	{
		if(a[i]>=ceil(1.0*sum/(4*m)))
			cnt++;
	}
	
	if(cnt>=m)
		cout<<"Yes"<< endl;
	else
		cout<<"No"<< endl;
	
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
  int n,mi=10000000,ma=-10000000;
    long long sum=0;
  cin >> n;
  int i,b;
  for(i=0;i<n;i++){
    cin >> b;
    mi=min(mi,b);
    ma=max(ma,b);
    sum+=b;
  }
  cout << mi <<  " " << ma << " " << sum << endl;
  return 0;
}



Measured memory_bytes: 3100
import java.util.*;

public class Main {
    static Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] A = new int[N];
        int th = 0;
        for (int i = 0; i < N; i++) {
            A[i] = sc.nextInt();
            th += A[i];
        }
        th--;
        th /= 4 * M;
        int num = 0;
        for (int i = 0; i < N; i++) {
            if (A[i] > th) {
                num++;
                if (num >= M) {
                    System.out.println("Yes");
                    return;
                }
            }
        }
        System.out.println("No");
    }
}


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

int main(){
   int N , M;
   cin >> N >> M;
   vector<int> A(N);
   for(int i = 0; i < N; i++){
       cin >> A.at(i);
   }
   sort(A.begin(),A.end(),greater<int>());
   int sum = 0;
   for(int i = 0; i < N; i++){
       sum += A.at(i);
   }
   if(A.at(M - 1) < sum / (4.0 * M)){
       cout << "No" << endl;
   }else{
       cout << "Yes" << endl;
   }
}

Measured memory_bytes: 256
s = gets.chomp
z = "0"
cnt = 0
i = 0
while i < s.length
  if s[i] != z
    cnt += 1
    z = s[i]
  else
    if i == s.length - 1
      puts cnt
      exit
    end
    z = s[i] + s[i+1]
    i += 1
    cnt += 1
  end
  i += 1
end
puts cnt


Measured memory_bytes: 4220
from collections import Counter
import sys

sys.setrecursionlimit(10 ** 6)

mod = 1000000007
inf = int(1e18)

dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]


def inverse(a):
    return pow(a, -1, mod)


def main():
    n, x, t = map(int, input().split())
    print((n + x - 1) // x * t)


main()


Measured memory_bytes: 9456
#include <cstdio>
#include <algorithm>

using namespace std;

int gcd(int a, int b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}

const int N = 100'009;

char a[N];
char b[N];

int main() {
  int na, nb;
  scanf("%d %d", &na, &nb);
  scanf("%s %s", a, b);
  int g = gcd(na, nb);
  long long sa = nb / g;
  long long sb = na / g;
  int i = 0, j = 0;
  while (i < na && j < nb) {
    if (sa * i == sb * j) {
      if (a[i] != b[j]) {
        puts("-1");
        return 0;
      }
      ++i;
      ++j;
    } else
    if (sa * i < sb * j) {
      ++i;
    } else {
      ++j;
    }
  }
  printf("%lld\n", sb * nb);
}


Measured memory_bytes: 384
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7

#############
# Main Code #
#############

N = getN()
D = getList()
D = Counter(D)

l_1 = []
l_2 = []
for i in D.items():
    if i[0] == 0:
        print(0)
        exit()
    if i[1] >= 3:
        print(0)
        exit()
    if i[1] == 2:
        l_2.append(i[0])
        l_2.append(24 - i[0])
    elif i[1] == 1:
        l_1.append(i[0])

def judge(array):
    res = min(24 - array[-1], array[-1])
    for i in range(len(array) - 1):
        res = min(res, array[i + 1] - array[i])
    return res

ans = 0
# Dの要素の個数が１個の時のみ分岐する（最大2 ** 12)
N_1 = len(l_1)
for bit in range(1 << N_1):
    opt = copy.deepcopy(l_2)
    opt.append(0)
    for i in range(N_1):
        if bit & (1 << i):
            opt.append(l_1[i])
        else:
            opt.append(24 - l_1[i])
    opt.sort()
    ans = max(ans, judge(opt))
print(ans)


Measured memory_bytes: 10848
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
#define INF 200000000000
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; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}
#define all(x) x.begin(), x.end()

bool compare(pair<int, int> a, pair<int, int> b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}
// 入力



int main() {
    ll N;
    string S,T,ans;
    cin >>N>>S>>T;
    rep(i,N){
        ans+=S[i];
        ans+=T[i];
    }
    cout << ans << endl;


    return 0;
    

}

Measured memory_bytes: 3616
#include <stdio.h>
#include <ctype.h>

#define MAX_LEN 51

int main(void)
{
	int N, K;
	char S[MAX_LEN];
	scanf("%d %d %s", &N, &K, S);

	S[K - 1] = tolower(S[K - 1]);
	printf("%s\n", S);
	return 0;
}


Measured memory_bytes: 128