akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<ctime>
#include<utility>
#include<cmath>
#include<functional>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
void sort(int &a,int &b)
{
	if(a>b)
		swap(a,b);
}
void open(const char *s)
{
#ifndef ONLINE_JUDGE
	char str[100];
	sprintf(str,"%s.in",s);
	freopen(str,"r",stdin);
	sprintf(str,"%s.out",s);
	freopen(str,"w",stdout);
#endif
}
int rd()
{
	int s=0,c;
	while((c=getchar())<'0'||c>'9');
	do
	{
		s=s*10+c-'0';
	}
	while((c=getchar())>='0'&&c<='9');
	return s;
}
int upmin(int &a,int b)
{
	if(b<a)
	{
		a=b;
		return 1;
	}
	return 0;
}
int upmax(int &a,int b)
{
	if(b>a)
	{
		a=b;
		return 1;
	}
	return 0;
}
int f[810];
int v[810];
int e[810];
int deg[810];
int find(int x)
{
	return f[x]==x?x:f[x]=find(f[x]);
}
int main()
{
	int n,h;
	scanf("%d%d",&n,&h);
	int i;
	for(i=1;i<=800;i++)
		f[i]=i;
	int a,b,c,d,l,r;
	for(i=1;i<=n;i++)
	{
		scanf("%d%d%d%d",&a,&b,&c,&d);
		if(c)
			l=-c;
		else
			l=a;
		if(d)
			r=d;
		else
			r=-b;
		l+=400;
		r+=400;
		deg[l]++;
		deg[r]--;
		v[l]=v[r]=1;
		f[find(r)]=find(l);
	}
	for(i=1;i<=400;i++)
		if(deg[i]>0)
		{
			printf("NO\n");
			return 0;
		}
	for(i=401;i<=800;i++)
		if(deg[i]<0)
		{
			printf("NO\n");
			return 0;
		}
	for(i=1;i<=800;i++)
		if(deg[i])
			e[find(i)]=1;
	for(i=1;i<=800;i++)
		v[find(i)]|=v[i];
	for(i=1;i<=800;i++)
		if(i==find(i)&&v[i]&&!e[i])
		{
			printf("NO\n");
			return 0;
		}
	printf("YES\n");
	return 0;
}

Measured memory_bytes: 128
#include<algorithm>
#include<iostream>
#include<set>
#include<string>
#include<math.h>

using namespace std;

class zahyo{
	public:
	int x;
	int y;
	zahyo(){
		x=0;
		y=0;
	}
	zahyo(int x_,int y_){
		x=x_;
		y=y_;
	}
	void print(){
		cout<<x<<" "<<y;
	}
	zahyo operator+(zahyo add){
		add.x=this->x+add.x;
		add.y=this->y+add.y;
		return add;
	}
	zahyo operator-(zahyo add){
		add.x=this->x-add.x;
		add.y=this->y-add.y;
		return add;
	}
	bool operator==(const zahyo add) const{
		if(add.x==this->x and add.y==this->y){return true;}
		else{return false;}
	}
	bool operator!=(const zahyo add) const{
		if(add.x==this->x or add.y==this->y){return false;}
		else{return true;}
	}
	bool operator<(const zahyo add) const{
		if(this->x<add.x){return true;}
		else if(this->x==add.x and this->y<add.y){return true;}
		else{return false;}
	}
	bool operator>(const zahyo add) const{
		if(this->x>add.x){return true;}
		else if(this->x==add.x and this->y>add.y){return true;}
		else{return false;}
	}
	void input(){
		cin>>x>>y;
	}
};

int main(){
	int n;
	int a[20];
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	int q;
	int m[200],mans[200];
	cin>>q;
	for(int i=0;i<q;i++){
		cin>>m[i];
		mans[i]=0;
	}
	for(int j=0;j<pow(2,n);j++){
			int temp=0;
			for(int k=0;k<n;k++){
				if(j&(1<<k)){
					temp+=a[k];
				}
			}
			for(int k=0;k<q;k++){
				if(m[k]==temp){
					mans[k]++;
				}
			}
			//cout<<j<<" "<<temp<<endl;
	}
	for(int k=0;k<q;k++){
		if(mans[k]!=0){
			cout<<"yes"<<endl;
		}
		else{
			cout<<"no"<<endl;
		}
	}
}



Measured memory_bytes: 3268
#include<iostream>
#include<string>
#include<vector>
#include<set>
using namespace std;
int main()
{
  string S;
  cin>>S;
  int len=S.size();
  set<char> se;
  for(char i = 'a';i<='z';i++)
  {
    se.insert(i);
  }
  for(int i=0;i<len;i++)
  {
    se.erase(S[i]);
  }
  if(se.empty())
  {
    cout<<"None"<<endl;
  }else{
  cout<<(*se.begin())<<endl;
  }
  return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define yes cout<<"Yes"<<endl;
#define no cout<<"No"<<endl;
#define ll long long int
#define tc ll tc;while(tc--)
using namespace std;
int main()
{
    ll a,b,c,d,n,x,y,z,cnt=0,sum=0,tot=0;
    string s,s1,s2;
    cin>>a>>b>>c>>d;
    cout<<min(a,b)+min(c,d)<<endl;


}



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

using namespace std;

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

const double PI = 3.1415926535897932384626433832795;

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

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

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

	int n, m;
	cin >> n >> m;

	vector<vector<int>> g(n);
	vector<int> indegree(n);
	for (int i = 0; i < m; i++) {
		int x, y;
		cin >> x >> y;
		x--; y--;

		g[x].push_back(y);
		indegree[y]++;
	}

	queue<int> que;
	for (int i = 0; i < n; i++) {
		if (indegree[i] == 0) {
			que.push(i);
		}
	}

	vector<int> dp(n);
	while (!que.empty()) {
		int now = que.front(); que.pop();

		for (auto next : g[now]) {
			indegree[next]--;
			if (indegree[next] == 0) {
				que.push(next);
			}

			dp[next] = max(dp[next], dp[now] + 1);
		}
	}

	int ans = 0;
	for (int i = 0; i < n; i++) {
		ans = max(ans, dp[i]);
	}

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


Measured memory_bytes: 6528
using System;
using System.Collections.Generic;

namespace A___Grouping
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var x = input[0];
            var y = input[1];
            var z = new List<string> { "1", "3", "5", "7", "8", "10", "12" };
            var a = new List<string> { "4", "6", "9", "11" };
            var b = "2";
            if (z.Contains(x) && z.Contains(y) || a.Contains(x) && a.Contains(y) || x == "2" && y == "2")
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}

Measured memory_bytes: 11092
#include<stdio.h>
int main(void)
{
  int n,i;
  long sam=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    if(i%3!=0&&i%5!=0)
      sam+=i;
  }
  printf("%ld",sam);
  return 0;
}


Measured memory_bytes: 1732
#include "bits/stdc++.h"
#define FOR(i, a, b) for (int i = a; i < b; i++)
#define mFOR(i, a, b) for (int i = a; i > b; i--)
#define MP make_pair
#define PB push_back
#define ALL(v) v.begin(), v.end()
#define N 100007
#define INF 1000000007
using namespace std;

typedef long long ll;

ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll fceil(ll a, ll b) { return (a % b == 0 ? a / b : a / b + 1); }
int main()
{
   int n, m, s, c, ans = 0, a[3] = {-1, -1, -1};
   cin >> n >> m;
   FOR(i, 0, m)
   {
      cin >> s >> c;
      if (a[s - 1] >= 0 && a[s - 1] != c || n > 1 && s == 1 && c == 0)
      {
         ans = -1;
         break;
      }
      a[s - 1] = c;
   }
   if (ans == 0)
   {
      if (a[0] == -1 && n > 1)
         a[0] = 1;
      FOR(i, 0, n)
      {
         ans = ans * 10 + (a[i] < 0 ? 0 : a[i]);
      }
   }
   cout << ans << endl;
   return 0;
}


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

int main() {
    int a, b;
    cin >> a >> b;

    if (a == b) {
        cout << "Draw" << endl;
    } else if (a == 1) {
        cout << "Alice" << endl;
    } else if (b == 1) {
        cout << "Bob" << endl;
    } else {
        cout << (a < b ? "Bob" : "Alice") << endl;
    }
}


Measured memory_bytes: 256
from math import sqrt
pf={}
m=int(input())
for i in range(2,int(m**0.5)+1):
    while m%i==0:
        pf[i]=pf.get(i,0)+1
        m//=i
if m>1:pf[m]=1
#print(pf)

cnt = 0
calc = lambda n: (sqrt(8 * n + 1) - 1) // 2
for i in pf:
    v = pf[i]
    n = 1
    while v >= n:
        v -= n
        cnt += 1
        n += 1
#    cnt += calc(pf[i])
print(int(cnt))


Measured memory_bytes: 9456
#include<bits/stdc++.h>
using namespace std;
const long long INF = (1LL << 32);
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;

#define Endl endl

/*--------------------template--------------------*/


int main() {
    cin >> n;
    FOR(i, 1, 100) {
        FOR(j, 2, 11) {
            ans = pow(i, j);
            if (ans > n) {
                break;
            }
            if (ans>cnt) {
                cnt = ans;
            }
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())
#define endl "\n"

template<typename T>
struct Diameter {
private:
    using Edge = pair<int, T>;
    vector<T> dp,ps;
    vector<vector<Edge>> G;
    
    void dfs(int v, int p, int &s) {
        ps[v] = p;
        if (p < 0) dp[v] = T(0);
        if (dp[s] < dp[v]) s = v;
        for(Edge e : G[v]) {
            int u = e.first;
            if(u == p) continue;
            dp[u] = dp[v] + e.second;
            dfs(u, v, s);
        }
    }
    
    pair<int, int> endPoints() {
        int s = 0;
        dfs(s, -1, s);
        int t = s;
        dfs(t, -1, t);
        return make_pair(s, t);
    }
    
public:
    Diameter(){}
    Diameter(int n) : dp(n), ps(n), G(n) {}
    
    void add_edge(int u, int v, T c) {
        G[u].emplace_back(v,c);
        G[v].emplace_back(u,c);
    }
    
    T build() {
        int t = endPoints().second;
        return dp[t];
    }
    
    vector<int> restore() {
        int t = endPoints().second;
        vector<int> seq;
        while(~t) {
            seq.emplace_back(t);
            t = ps[t];
        }
        return seq;
    }
    
    vector<T> distance(int v) {
        dfs(v, -1, v);
        return dp;
    }
    
    vector<T> farthest() {
        int t = endPoints().second;
        auto ds = dp;
        auto dt = distance(t);
        for(int i = 0; i < (int)ds.size(); i++) {
            if(ds[i] < dt[i]) ds[i] = dt[i];
        }
        return ds;
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    Diameter<ll> di(n);
    rep(i, n - 1) {
        ll s, t, w;
        cin >> s >> t >> w;
        di.add_edge(s, t, w);
    }
    cout << di.build() << endl;
    return 0;
}



Measured memory_bytes: 15356
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include <unordered_map>
#include<map>
 
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n; ++i)
#define ALL(a) (a).begin(),(a).end()
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)

#define MOD 1000000007
int vec[1010] = {};
void factor(ll n){
    for(int i = 2; i <= n; i++)if(n%i == 0){
            ll x = 1;
            while(n%i == 0)n/=i, vec[i]++;
    }
}
 
int  main(){
    int n;
    cin >> n;
    if(n == 1){
        cout << 1;
        return 0;
    }
    for(int i = 2; i <= n; ++i)factor(i);
    ll ans = 1;
    rep(i, 1010)ans=((ans)*(vec[i]+1))%MOD;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<31)-1;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
//int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};

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


string ss;
bool n,w,s,e;

int main(){
	cin>>ss;
	for(int i=0;i<ss.size();i++){
		if(ss[i]=='N')n=true;
		if(ss[i]=='W')w=true;
		if(ss[i]=='S')s=true;
		if(ss[i]=='E')e=true;
	}
	if(n==s&&w==e)
		cout<<"Yes"<<endl;
	else
		cout<<"No"<<endl;
	return 0;
}
			

Measured memory_bytes: 256
//#include"cpp_kyopro.h"
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <stdlib.h>
#include <math.h>
using namespace std;
signed main() {
	char s[4]; cin >> s;
	for (int i = 0; i < 3; ++i) {
		if (s[i] == s[i + 1]) {
			cout << "Bad" << endl;
			return 0;
		}
	}
	cout << "Good" << endl;
	return 0;
}

Measured memory_bytes: 256
a, b, h, m = gets.chomp.split.map(&:to_i)

kakudo_m = (m / 60.0) * 360
kakudo_h = (h / 12.0) * 360 + (m / 60.0) * 30

kakudo = (kakudo_h - kakudo_m).abs

kakudo = 360 - kakudo if kakudo > 180

rad = kakudo * Math::PI / 180
ans = a**2 + b**2 - 2 * a * b * Math.cos(rad)
puts Math.sqrt(ans)


Measured memory_bytes: 14712
import java.util.*;


public class Main {
    public static void main(String[] args) {
        // 自分の得意な言語で
        // Let's チャレンジ！！

        Scanner sc = new Scanner(System.in);
        String line = sc.nextLine();
        String s[]=line.split(" ",0);
        int n=Integer.parseInt(s[0]);
        int k=Integer.parseInt(s[1]);
        int a=0;
        while(a*(k-1)+1<n){
            a++;
        }
        System.out.println(a);
    }
}

Measured memory_bytes: 21332
var
 s:string[3];//省空间
begin
 readln(s);//读入s
 write('A');//先输出前一个字母
 if s[2]='B' then write('R')//如果为B，输出R
             else write('B');//否则输出B
 write('C');//输出最后一个
end.

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

#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define ALL(x) (x).begin(),(x).end()

typedef long long ll;
typedef unsigned long long ull;
 
const ll INF = 1LL<<60;
const int MINF = 1e9;
const int MOD = 1e9+7;

using vi = vector<int>;
using vii = vector<vi>;

template<typename T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<typename T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

template<typename T>
T GCD(T a,T b){ return b ? GCD(b,a%b) : a ;}
template<typename T>
T LCM(T a,T b){ return a*b / GCD(a,b) ;}

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

    int n;cin >> n;
    vi a1(n);rep(i,n)cin >> a1[i];
    vi a2(n);rep(i,n)cin >> a2[i];
    
    vi sum1(n+1);
    for(int i=1;i<n+1;i++){
        sum1[i] = a1[i-1];
        sum1[i] += sum1[i-1];
    }
    vi sum2(n+1);
    for(int i=1;i<n+1;i++){
        sum2[i] = a2[i-1];
        sum2[i] += sum2[i-1];
    }

    int ans = 0;
    for(int i=1;i<n+1;i++){
        int tmp = sum1[i];
        tmp += sum2.back() - sum2[i-1];
        ans = max(ans,tmp);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <utility>
#include <iomanip>
#include <cmath>
#include <bitset>
#include <string>
#define REP(i,n) for(int i=0;i<n;i++)
using Int = long long;
using namespace std;
int main()
{
    int A, B, C, D; cin >> A >> B >> C >> D;
    cout << max(A*B, C*D) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <vector>
#include <stack>
#include <cstdio>
#include <string>
#include <bitset>
#include <list>
#include <set>
#include <algorithm>
#include <numeric>
#include <tuple>
using namespace std;
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
int main() {
long long x, y;
cin>>x;
cin>>y;
long long res=x;
long ans=0;
while(res<=y){
res*=2;
ans++;
}
cout<<ans;
}

Measured memory_bytes: 256
import math
import time
from collections import deque
from collections import defaultdict
from copy import deepcopy
import heapq

mod = 10 ** 9 + 7
t = time.time()



def iip():
    ret = [int(i) for i in input().split()]
    if len(ret) == 1:
        return ret[0]
    return ret


def main():
    N, K = iip()
    S = input()
    happy = 0
    for i in range(N):
        if i != 0 and S[i] == "L" and S[i-1] == "L":
            happy += 1
            continue
        if i != N-1 and S[i] == "R" and S[i+1] == "R":
            happy += 1
            continue
    happy += 2*K
    happy = min(happy, N-1)

    print(happy)



main()

Measured memory_bytes: 40044
#include<bits/stdc++.h>
#define fi first
#define se second
#define bug cout<<"--------------"<<endl
using namespace std;
typedef long long ll;
const double PI=acos(-1.0);
const double eps=1e-6;
const int inf=1e9;
const ll llf=1e18;
const int mod=1e9+7;
const int maxn=2e5+10;
ll n;
ll a,b,c;
ll f[maxn];
ll ksm(ll a,ll b){
	ll ret=1;
	while(b){
		if(b&1) ret=ret*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return ret;
}
ll ks(ll a,ll b,ll mod){
	ll ret=1;
	while(b){
		if(b&1) ret=ret*a%mod;
		a=a*a%mod;
		b>>=1;
	}
	return ret;
}
ll C(ll n,ll m){
	return f[n]*ksm(f[m],mod-2)%mod*ksm(f[n-m],mod-2)%mod;
}
ll phi(ll n)
{
     ll i,rea=n;
     for(i=2;i*i<=n;i++)
     {
         if(n%i==0)
         {
             rea=rea-rea/i;
             while(n%i==0)
                 n/=i;
          }
     }
     if(n>1)
         rea=rea-rea/n;
     return rea;
}
int main(){
	//ios::sync_with_stdio(false);
	//freopen("in","r",stdin);
	f[0]=1;
	for(int i=1;i<=2e5+5;i++){
		f[i]=f[i-1]*i%mod;
	}
	cin>>n>>a>>b>>c;
	a=a*ksm((a+b),mod-2)%mod;
	b=(1-a+mod)%mod;
	c=c*ksm(100,mod-2)%mod;
	c=(1-c+mod)%mod;
	ll ans=0;
	for(ll i=n;i<=2*n-1;i++){
		ll k=i; 
		ans+=(k*ksm(a,n)%mod*ksm(b,k-n)%mod*C(k-1,n-1)%mod+k*ksm(b,n)%mod*ksm(a,k-n)%mod*C(k-1,n-1)%mod)%mod;
		ans%=mod;
	}
	cout<<ans*ksm(c,mod-2)%mod;
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
ll a[1000];
char s[1000];
int main(void){
    ll n;
    cin>>n;
    ll m=n;
    a[0]=1;
    for(int i=1;i<=13;i++){
        a[i]=a[i-1]*26;
    }
    int i=1;
    while(n>0){
        n-=a[i];
        i++;
    }
    n+=a[i-1];
    i--;
    int I=i;
    while(m>0){
        ll t=m%26;
        if(t==0){
            t=26;
        }
        m=m-t;
        m=m/26;
        s[i]='a'+t-1;
        //cout<<t<<" "<<m<<" "<<s[i]<<endl;
        i--;
    }
    for(int j=1;j<=I;j++){
        cout<<s[j];
    }
    cout<<endl;

}

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

typedef long long ll;
typedef unsigned long long ull;

class vertex{
    public:
    int node;
    int parent = -1;
    int depth;
    vector<int> children;
};
bool operator<(const vertex &a, const vertex &b){
    return a.node<b.node;
}

int main(){
    int n;
    vertex v[100000];
    cin >> n;
    for(int i=0;i<n;i++){
        int id, k;
        cin >> id >> k;
        v[i].node=id;
        for(int j=0;j<k;j++){
            int c;
            cin >> c;
            v[i].children.push_back(c);
        }
    }
    sort(v, v+n);
    for(int i=0;i<n;i++){
        for(int x:v[i].children) v[x].parent=i;
    }
    for(int i=0;i<n;i++){
        if(v[i].parent==-1){
            v[i].depth=0;
            queue<int> q;
            for(int x:v[i].children) q.push(x);
            while(!q.empty()){
                int t=q.front();
                q.pop();
                v[t].depth = v[v[t].parent].depth+1;
                for(int x:v[t].children) q.push(x);
            }
            break;
        }
    }
    for(int i=0;i<n;i++){
        //node 0: parent = -1, depth = 0, root, [1, 4, 10]
        cout << "node " << v[i].node << ": parent = " << v[i].parent << ", depth = " << v[i].depth << ", ";
        if(v[i].depth==0) cout << "root";
        else if(v[i].children.empty()) cout << "leaf";
        else cout << "internal node";
        cout << ", [";
        if(!v[i].children.empty()){
            cout << v[i].children[0];
            for(int j=1;j<v[i].children.size();j++) cout << ", " << v[i].children[j];
        }
        cout << "]" << endl;
    }

    
    return 0;
}


Measured memory_bytes: 7848
n = int(input())

ac, wa, tle, re = 0, 0, 0, 0
for _ in range(n):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    elif s == "RE":
        re += 1

print("AC x", ac)
print("WA x", wa)
print("TLE x", tle)
print("RE x", re)

Measured memory_bytes: 69876
#include<iostream> 
using namespace std;
int main (){
	int n;
	cin>>n ;
//	cout<<pls input 22<=D<=25
	if (n==22){
		cout<<"Christmas Eve Eve Eve";
	}
		
	if (n==23){
		cout<<"Christmas Eve Eve";
	}
	if (n==24){
		cout<<"Christmas Eve";
	}
	if (n==25){
		cout<<"Christmas";
	}
		
}


Measured memory_bytes: 768
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <numeric>

using namespace std;

int main(){
    int a,b;
    cin >> a >> b;
    if(a%3==0 || b%3==0 || (a+b)%3==0) cout << "Possible" << endl;
    else cout << "Impossible" << endl;
    return 0;
}

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

int main() {
	
	string s, t;
	cin >> s >> t;
	sort(all(s));
	sort(rbegin(t), rend(t));
	if(s < t) cout << "Yes" << endl;
	else cout << "No" << endl;
	
	return 0;
}

Measured memory_bytes: 256
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

use std::cmp::{max, min};

fn diff_abs(x: usize, y: usize) -> usize {
    max(x, y) - min(x, y)
}

const p: usize = 1000000007;

// fact(n) = n! mod p
fn fact(n: usize) -> usize {
    let mut acc = 1;
    for i in 1..n + 1 {
        acc = acc * i % p;
    }
    acc
}

fn mod_pow(b: usize, mut e: usize) -> usize {
    let mut base = b;
    let mut acc = 1;

    while e > 1 {
        if e % 2 == 1 {
            acc = acc * base % p;
        }
        e /= 2;
        base = base * base % p;
    }

    if e == 1 {
        acc = acc * base % p;
    }

    acc
}

fn comb(n: usize, r: usize) -> usize {
    // nCr = n! / (r! (n-r)!) = n! (r!)^(p-2) ((n-r)!)^(p-2)
    if n < r {
        0
    } else {
        fact(n) * mod_pow(fact(r), p - 2) % p * mod_pow(fact(n - r), p - 2) % p
    }
}

fn divide(n: usize, r: usize) -> usize {
    if n < r || r == 0 {
        0
    } else {
        comb(n - r + r - 1, r - 1)
    }
}

fn mul(x: usize, y: usize) -> usize {
    x * y % p
}

fn add(x: usize, y: usize) -> usize {
    (x + y) % p
}

fn main() {
    input! {
        n: usize,
        k: usize,
    }

    for i in 1..k + 1 {
        println!("{}", comb(n - k + 1, i) * comb(k - 1, i - 1) % p);
    }
}


Measured memory_bytes: 4352
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

class Main {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String input = br.readLine();
        String[] face = input.split(" ");
        String direction = br.readLine();

        Dice dice = new Dice();
        dice.setFace(face);
        dice.roll(direction);
        System.out.println(dice.getTop());
    }
}

class Dice {
    private String top;
    private String front;
    private String right;
    private String left;
    private String back;
    private String bottom;

    private char direction[];

    public void setFace(String[] face) {
        this.top = face[0];
        this.front = face[1];
        this.right = face[2];
        this.left = face[3];
        this.back = face[4];
        this.bottom = face[5];
    }

    public void roll(String directions) {
        this.direction = directions.toCharArray();

        String temp;
        for (int i = 0; i < direction.length; i++) {
            switch(direction[i]) {
                case 'N':
                    temp = this.top;
                    this.top = this.front;
                    this.front = this.bottom;
                    this.bottom = this.back;
                    this.back = temp;
                    break;
                case 'W':
                    temp = this.top;
                    this.top = this.right;
                    this.right = this.bottom;
                    this.bottom = this.left;
                    this.left = temp;
                    break;
                case 'E':
                    temp = this.top;
                    this.top = this.left;
                    this.left = this.bottom;
                    this.bottom = this.right;
                    this.right = temp;
                break;
                case 'S':
                    temp = this.top;
                    this.top = this.back;
                    this.back = this.bottom;
                    this.bottom = this.front;
                    this.front = temp;
                    break;
            }

        }

    }

    public String getTop() {
        return this.top;
    }

}



Measured memory_bytes: 24320
### inner class

class Fixnum
  def **(n)
    m = 1
    k = self
    while n > 0
      m = (m * k) % $pn if (n & 1) != 0
      k = (k * k) % $pn
      n >>= 1
    end
    m
  end

  def /(n)
    n %= $pn
    raise if n == 0
    (self * (n ** ($pn - 2))) % $pn
  end
end

### main

while true
  pnstr, exp = gets.strip.gsub(' ', '').split(':')
  $pn = pnstr.to_i
  break if $pn == 0

  begin
    ans = eval(exp) % $pn
    puts "#{exp} = #{ans} (mod #{$pn})"
  rescue
    puts 'NG'
  end
end

Measured memory_bytes: 15872
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define re(i,a,b) for(int i=(a);i<(b);i++)
#define repd(i,a,b) for(int i=(a);i>=(b);i--)
#define clr(a) memset(a,0,sizeof(a));
#define il inline
#define sz(a) ((int)a.size())
#define run(x) for(int k=head[x];k;k=e[k].ne)
#define all(a) a.begin(),a.end()
#define mp make_pair
#define pb push_back 
#define w1 first
#define w2 second
#define adm(a,b,c) {a=a+b;if(a>=c)a-=c;else if(a<0)a+=c;}
typedef double db;
typedef long long ll;typedef long double ld;typedef unsigned long long ull;
typedef pair<int,int> pa;
const int N=1e6+5,M=1e7+5,INF=1e9,mod=1e9+7;
const ll linf=1e18;const double eps=1e-8,pi=acos(-1);
il int gmin(int &a,int b){if(a>b)a=b;}il ll gmin(ll &a,ll b){if(a>b)a=b;}il int gmax(int &a,int b){if(a<b)a=b;}il ll gmax(ll &a,ll b){if(a<b)a=b;}
il void read(ll&x){ll f=1,t=0;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){t=t*10+ch-'0';ch=getchar();}x=t*f;}il ll read(ll&x,ll&y){read(x);read(y);}
il void read(int&x){int f=1,t=0;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){t=t*10+ch-'0';ch=getchar();}x=t*f;}il int read(int&x,int&y){read(x);read(y);}
il void read(int&a,int&b,int&c){read(a);read(b);read(c);}il void read(ll&a,ll&b,ll&c){read(a);read(b);read(c);}
il int read(){int x;read(x);return x;}
il ll qpow(ll a,ll b,ll p){ll ret=1;for(;b;b>>=1,a=a*a%p)if(b&1)ret=ret*a%p;return ret;}il ll qpow(ll a,ll b){ll ret=1;for(;b;b>>=1,a=a*a%mod)if(b&1)ret=ret*a%mod;return ret;}
il ll qmul(ll a,ll b,ll p){ll ret=0;for(;b;b>>=1,a=(a<<1)%p)if(b&1)adm(ret,a,p);return ret;}il ll qmul(ll a,ll b){ll ret=0;for(;b;b>>=1,a=(a<<1)%mod)if(b&1)adm(ret,a,mod);return ret;}
il void judge(){
	freopen("data.in","r",stdin);
	freopen("data.out","w",stdout);
}int n,x[N],v[N];
int bit[N],a[N],b[N],c[N];
void ad(int&x,int y){(x+=y)%=mod;}
void add(int x,int val){for(;x<=n;x+=x&(-x))ad(bit[x],val);}
int ask(int x){if(x<0)return 0;int res=1;for(;x;x-=x&(-x))ad(res,bit[x]);return res;}
bool o1(int i,int j){return v[i]<v[j];}
bool o2(pa a,pa b){return a.w2<b.w2||(a.w2==b.w2&&a.w1<b.w1);}
int mx[N],mn[N];
pa f[N];
#define mid (l+r>>1)
int main(){
	read(n);rep(i,1,n)read(x[i],v[i]),a[i]=i;
	sort(a+1,a+1+n,o1);
	rep(i,1,n)a[i]=x[a[i]];
	mx[1]=a[1];rep(i,2,n)mx[i]=max(mx[i-1],a[i]);
	mn[n]=a[n];repd(i,n-1,1)mn[i]=min(mn[i+1],a[i]);
	rep(i,1,n){
		int l=1,r=i,res;
		while(l<=r){
			if(mx[mid]>=a[i])res=mid,r=mid-1;else
				l=mid+1;
		}f[i].w1=res;
		l=i,r=n;while(l<=r){
			if(mn[mid]<=a[i])res=mid,l=mid+1;else
			 r=mid-1;
		}f[i].w2=res;
	}sort(f+1,f+1+n,o2);
	rep(i,1,n)
		add(f[i].w2,(ask(f[i].w2)-ask(f[i].w1-2)+mod)%mod);
	ll res=(ask(n)-ask(n-1)+mod)%mod;
	cout<<res<<endl;
}

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

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
#define TIME cerr << "\nTime elapsed: " << setprecision(5) <<1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define PI 3.14159265358979323846
#define ll long long

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cerr << "debug statement : " << *it << " = " << a << endl;
    err(++it, args...);
} 

void fastscan(int &number) { 
    bool negative = false; 
    register int c;
    number = 0; 
    c = getchar(); 
    if (c=='-'){
        negative = true;
        c = getchar(); 
    }
    for (; (c>47 && c<58); c=getchar()) 
        number = number *10 + c - 48;
    if (negative) 
        number *= -1; 
} 

class BIT{
public:
    int size;
    vector<int> v;
    BIT(int s){
        size = s;
        v.resize(s, 0);
    }
    void update(int i, int delta){
        while(i < size){
            v[i] += delta;
            i += i & (-i);
        }
    }
    int sum(int i){
        int s = 0;
        while(i > 0){
            s += v[i];
            i -= i & (-i);
        }
        return s;
    }
};

void testCase(){
	int a;
	cin>>a;
	ll coin1 = a/500;
	ll coin2 = (a%500)/5;
	cout<<coin1*1000+coin2*5<<endl;
}

int main(){
    FAST
    int t = 1;
    // cin>>t;
    while(t--){
        testCase();
    }
}



Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

int main() {
  char S[1001], T[1001];
  
  scanf("%s", S);
  scanf("%s", T);
  
  int min = strlen(T);
  for(int i=0; i<=strlen(S) - strlen(T); i++) {
    int counter = 0;
    for(int j=0; j<strlen(T); j++) {
      if(S[i+j] != T[j]) counter++;
    }
    if(min > counter)
      min = counter;
  }
  
  printf("%d", min);
  return 0;
}

Measured memory_bytes: 1684
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <tuple>
#include <numeric>
#include <stdlib.h>
#include <time.h>
#include <chrono>
#define rep(i, s, g) for ((i) = (s); (i) < (g); ++(i))
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1ll << 60);

ll d;
vector<ll> c(26 + 1);
vector<vector<ll>> s(365 + 1, vector<ll>(26 + 1, 0));

ll scoring(vector<int> t)
{
    ll ans = 0;
    vector<ll> last(d + 1, 0);

    for (int i = 1; i <= d; i++)
    {
        ans += s[i][t[i]];
        last[t[i]] = i;

        for (int j = 1; j <= 26; j++)
        {
            ans -= c[j] * (i - last[j]);
        }
    }

    return ans;
}

int main(void)
{
    srand(time(NULL));
    cin >> d;

    for (int i = 1; i <= 26; i++)
    {
        cin >> c[i];
    }

    for (int i = 1; i <= d; i++)
    {
        for (int j = 1; j <= 26; j++)
        {
            cin >> s[i][j];
        }
    }

    vector<int> BestT(d + 1, 1);

    for (int i = 1; i <= d; i++)
    {
        BestT[i] = rand() % 26 + 1;
    }

    // printf("%lld\n", scoring(BestT));

    double BestScore = scoring(BestT);

    auto start = chrono::system_clock::now();
    vector<int> t(d + 1);

    double T0 = 1e6;
    double T1 = 1e3;
    double TL = 1950;

    ll count = 0;

    while (1)
    {
        ll msec;
        if (count % 100 == 0)
        {
            auto end = chrono::system_clock::now(); // 計測終了時刻を保存
            auto dur = end - start;                 // 要した時間を計算
            msec = chrono::duration_cast<chrono::milliseconds>(dur).count();

            if (msec >= TL)
            {
                break;
            }
        }

        double T = powf(T0, 1 - msec / TL) * powf(T1, msec / TL);

        t = BestT;

        t[rand() % d + 1] = rand() % 26 + 1;

        double score = scoring(t);

        if (exp((score - BestScore) / T) > 0.5)
        {
            BestT = t;
            BestScore = score;
        }
    }

    for (int i = 1; i <= d; i++)
    {
        printf("%d\n", BestT[i]);
    }

    // printf("%lld\n", scoring(BestT));
}


Measured memory_bytes: 4404
#include <algorithm>
#include <cstdio>
#include <functional>
constexpr int maxn = 200005;

int A[maxn];
using LL = long long;
int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; i++)
        scanf("%d", &A[i]);
    std::sort(A + 1, A + n + 1, std::greater<int>());
    if (n & 1) {
        LL ans = A[1];
        for (int i = 2; i <= (n >> 1); i++)
            ans += A[i] << 1;
        ans += A[(n >> 1) + 1];
        printf("%lld\n", ans);
    }
    else {
        LL ans = A[1];
        for (int i = 2; i <= (n >> 1); i++)
            ans += A[i] << 1;
        printf("%lld\n", ans);
    }
    return 0;
}

Measured memory_bytes: 2512
package main

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

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	return n
}

func sum(n []int) int {
	a := 0
	for _, v := range n {
		a += v
	}
	return a
}

func main() {
	sc.Split(bufio.ScanWords)
	a := make([]int, 3)
	a[0], a[1], a[2] = getInt(), getInt(), getInt()
	sort.Ints(a)

	ans := int(math.Abs(float64(a[0]-a[1]))) + int(math.Abs(float64(a[1]-a[2])))
	fmt.Println(ans)
}


Measured memory_bytes: 640
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

int main(int argc, char* argv[]){
  std::ios::sync_with_stdio(false);
  int n;
  std::cin >> n;

  int s(0);
  int n_d = n;
  while(n_d !=0){
    s += n_d % 10;
    n_d /= 10;
  }
  if (n % s != 0){
    std::cout << "No" << std::endl;
  } else {
    std::cout << "Yes" << std::endl;
  }
  return 0;  
}


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

using namespace std;

#define REP(i,n) for(ll (i) = (0); (i) < (n); ++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define ALL(v) v.begin(),v.end()
#define INF 1100000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007
#define Decimal fixed << setpresicion(20)
#define SHOWP(x) cerr<<"["<<(x).FI<<", "<<(x).SE<<"]";
#define SHOWX(x) cerr<<#x<<": "<<x<<endl;
#define SHOWVEC(v, e) REP(i, e) cerr << (v[i]) << ' '; cerr << endl;
#define SHOW2D(a, h, w) REP(i, h){REP(j, w)cerr<<setw(3)<<(a[i][j])<<' ';cerr<<endl;}

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


int main()
{
  ll A, B, K;
  cin >> A >> B >> K;

  vector<int> v;
  for (int i = 1; i <= min(A, B); i++) {
    if (A % i == 0 && B % i == 0) v.PB(i);
  }
  reverse(ALL(v));
  cout << v[K - 1] << endl;

  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 = sc.nextInt();
        int num[] = new int[n];
        int i;
        int j;
        int minj;
        int a;
        int  count=0;
        for (i = 0; i < n; i++) {
            num[i] = sc.nextInt();
        }
        for (i = 0; i < n; i++) {
            minj=i;
            for (j = i; j < n; j++) {
                if (num[j] < num[minj]) {
                   minj=j;
                }
            }
            if(i!=n-1) {
                System.out.printf("%d ", num[minj]);
            }else{
                System.out.printf("%d",num[minj]);
            }
            a = num[i];
            num[i] = num[minj];
            num[minj] = a;
            if(num[i]!=a)count=count+1;
        }
        System.out.printf("\n");
        System.out.println(count);
    }
}


Measured memory_bytes: 26688
import java.io.PrintWriter;
import java.util.*;

public class Main {

    private static Scanner in = new Scanner(System.in);
    private static PrintWriter out = new PrintWriter(System.out);

    private static final long MOD = (long) 1e9 + 7;

    public static void main(String[] args) {
        solve();
        out.flush();
    }

    private static void solve() {
        int n = in.nextInt();
        int m = in.nextInt();

        long ans = 0;
        Map<Integer, List<Map.Entry<Integer, Integer>>> arbeits = new HashMap<>();
        for (int i=0; i < n; i++) {
            int a = in.nextInt();
            int b = in.nextInt();
            if (!arbeits.containsKey(a))
                arbeits.put(a, new ArrayList<>());
            arbeits.get(a).add(new AbstractMap.SimpleEntry<>(a, b));
        }

        arbeits.entrySet().forEach(e -> e.getValue().sort(((o1, o2) -> o2.getValue() - o1.getValue())));

        PriorityQueue<Map.Entry<Integer, Integer>> available = new PriorityQueue<>(new Comparator<Map.Entry<Integer, Integer>>() {
            @Override
            public int compare(Map.Entry<Integer, Integer> o1, Map.Entry<Integer, Integer> o2) {
                return o2.getValue() - o1.getValue();
            }
        });
        for (int i=1; i <= m; i++) {
            available.addAll(arbeits.getOrDefault(i, new ArrayList<>()));
            if (available.size() != 0) {
                ans += available.poll().getValue();
            }
        }
        out.println(ans);
    }

    private static class Arbeit {
        int a;
        int b;
        public Arbeit(int a, int b) {
            this.a = a;
            this.b = b;
        }

        @Override
        public boolean equals(Object obj) {
            return obj instanceof Arbeit && ((Arbeit) obj).a == this.a && ((Arbeit) obj).b == this.b;
        }

        @Override
        public int hashCode() {
            return super.hashCode();
        }
    }

}


Measured memory_bytes: 105312
#include<bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
typedef long long LL;
typedef pair<int,int> PII;
#define X first
#define Y second
inline int read()
{
	int x=0,f=1;char c=getchar();
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c)){x=x*10+c-'0';c=getchar();}
	return x*f;
}
const int maxN=1000000;
int n,a[maxN+10],have[maxN+10];
int gcd(int a,int b){return b==0 ? a : gcd(b,a%b);}
int isn[maxN+10],prime[maxN+10],len,GCD;
bool vis[maxN+10];
void init()
{
    for(int i=2;i<=maxN;i++)
    {
        if(!vis[i])prime[++len]=i,isn[i]=i;
        for(int j=1;j<=len;j++)
        {
            if(i*prime[j]>maxN)break;
            vis[i*prime[j]]=1;
            isn[i*prime[j]]=prime[j];
            if(i%prime[j]==0){
                break;
            }
        } 
    } 
//    for(int i=2;i<=100;i++)printf("%d %d\n",i,isn[i]);
}

int main()
{
	init();
	n=read();
	a[1]=read();GCD=a[1];
	for(int i=2;i<=n;i++)a[i]=read(),GCD=gcd(GCD,a[i]);
	if(GCD!=1)return puts("not coprime"),0;
	for(int i=1;i<=n;i++)
	{
		int tmp=a[i];
		while(tmp>1)
		{
			int h=isn[tmp];
			have[isn[tmp]]++;
			if(have[isn[tmp]]>1)return puts("setwise coprime"),0;
			while(isn[tmp]==h)tmp/=isn[tmp];
		}
	}
	puts("pairwise coprime");
	return 0;
}
/*

*/


Measured memory_bytes: 13012
#include <iostream>
using namespace std;
void test_case(){
	int n;
	cin >> n;
	while(n){
		int digit = n%10;
		if(digit == 7){
			cout << "Yes";
			return;
		}
		n /= 10;
	}
	cout << "No";
	
}
int main(){
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	test_case();
}


Measured memory_bytes: 3636
n = int(input())
H = list(map(int, input().split()))

ans = 0
i = 0
while i < n:
    pos_h = H[i]
    count = 0
    j = i + 1
    while j < n and H[j] <= pos_h:
        count += 1
        pos_h = H[j]
        j += 1

    ans = max(ans, count)
    i = j

print(ans)

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

using namespace std;

int main(){
  long long X;
  cin >> X;

  long long half = X/2;
  
  long long now = 100;
  long long count = 0;
  while(now < X){
    now = now * 1.01;
    ++count;
  }
  
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 3640
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
void *wmem;
char memarr[96000000];
template<class S, class T> inline S max_L(S a,T b){
  return a>=b?a:b;
}
inline void rd(int &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline int rd(char c[]){
  int i;
  int sz = 0;
  for(;;){
    i = getchar_unlocked();
    if(i!=' '&&i!='\n'&&i!='\r'&&i!='\t'&&i!=EOF){
      break;
    }
  }
  c[sz++] = i;
  for(;;){
    i = getchar_unlocked();
    if(i==' '||i=='\n'||i=='\r'||i=='\t'||i==EOF){
      break;
    }
    c[sz++] = i;
  }
  c[sz]='\0';
  return sz;
}
inline void rd(string &x){
  char *buf = (char *)wmem;
  rd(buf);
  x = buf;
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(const char c[]){
  int i=0;
  for(i=0;c[i]!='\0';i++){
    putchar_unlocked(c[i]);
  }
}
inline void wt_L(string &x){
  int i=0;
  for(i=0;x[i]!='\0';i++){
    putchar_unlocked(x[i]);
  }
}
int N;
string S[200000];
int cnt[200000];
int main(){
  wmem = memarr;
  int i;
  int k;
  rd(N);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=(0);Lj4PdHRW<(N);Lj4PdHRW++){
      rd(S[Lj4PdHRW]);
    }
  }
  sort(S,S+N);
  k = 0;
  for(i=(0);i<(N);i++){
    if(k && S[k-1] == S[i]){
      cnt[k-1]++;
    }
    else{
      S[k] = S[i];
      cnt[k++] = 1;
    }
  }
  N = k;
  {
    int RZTsC2BF;
    int FmcKpFmN;
    if(N==0){
      FmcKpFmN = 0;
    }
    else{
      FmcKpFmN = cnt[0];
      for(RZTsC2BF=(1);RZTsC2BF<(N);RZTsC2BF++){
        FmcKpFmN = max_L(FmcKpFmN, cnt[RZTsC2BF]);
      }
    }
    k =FmcKpFmN;
  }
  for(i=(0);i<(N);i++){
    if(cnt[i]==k){
      wt_L(S[i]);
      wt_L('\n');
    }
  }
  return 0;
}
// cLay varsion 20200214-1

// --- original code ---
// int N;
// string S[2d5];
// int cnt[2d5];
// {
//   int i, k;
//   rd(N,S(N));
//   sort(S,S+N);
// 
//   k = 0;
//   rep(i,N){
//     if(k && S[k-1] == S[i]){
//       cnt[k-1]++;
//     } else {
//       S[k] = S[i];
//       cnt[k++] = 1;
//     }
//   }
//   N = k;
// 
//   k = max(cnt(N));
//   rep(i,N) if(cnt[i]==k) wt(S[i]);
// }


Measured memory_bytes: 15488
#include <bits/stdc++.h>
#define kyopro ios::sync_with_stdio(false);cin.tie(NULL)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define rep(i, s, N) for(ll i{s}; i < N; i++)
#define rem(i, N, s) for(ll i{N}; i > s; i--)
using namespace std;using ll = long long int;using ld = long double;using P = pair<ll,ll>;const int MOD = (int)1e9+7;const string rt = "\n";const string sp = " ";/* 最大公約数 */template<typename T> T gcd(T a, T b){return b != 0 ? gcd(b, a % b) : a;}/* UnionFind */template<typename T> struct UnionFind{vector<T> par;UnionFind(T n) : par(n, -1){}void init(T n){par.assign(n, -1);}T root(T x){if (par[x] < 0) return x;else return par[x] = root(par[x]);}bool issame(T x, T y){return root(x) == root(y);}bool merge(T x, T y){x = root(x); y = root(y);if(x == y) return false;if(par[x] > par[y]) swap(x, y);par[x] += par[y];par[y] = x;return true;}int size(int x) {return -par[root(x)];}};/* コンビネーション */template<typename T> ll combpm(T N_, T C_) {const int NUM_=400001;static ll fact[NUM_+1],factr[NUM_+1],inv[NUM_+1];if (fact[0]==0) {inv[1]=fact[0]=factr[0]=1;for (int i=2;i<=NUM_;++i) inv[i] = inv[MOD % i] * (MOD - MOD / i) % MOD;for (int i=1;i<=NUM_;++i) fact[i]=fact[i-1]*i%MOD, factr[i]=factr[i-1]*inv[i]%MOD;}if(C_<0 || C_>N_) return 0;return factr[C_]*fact[N_]%MOD*factr[N_-C_]%MOD;}/* 多次元ベクター */template<class T>vector<T> multi_vector(size_t a){return vector<T>(a);}template<class T, class... Ts>auto multi_vector(size_t a, Ts... ts){return vector<decltype(multi_vector<T>(ts...))>(a, multi_vector<T>(ts...));}/* テスト関数 */void test(ll n){cout << "test" << n << endl;}/* 小数点以下 */void fixsp(ll n){cout << fixed << setprecision(n);}void defsp(ll n){cout << defaultfloat << setprecision(n);}

/* ここからコード開始 */

int main(){
  kyopro;
  ll N;
  while(cin >> N){
    if(N == 0) break;
    vector<ll> a(N);
    ll sum{};
    for(auto&& i : a){
      cin >> i;
      sum += i;
    }
    ll ave = sum / N;
    ll ans{};
    sort(all(a));
    for(auto&& i : a){
      if(i > ave) break;
      ans++;
    }
    cout << ans << rt;
  }
}


Measured memory_bytes: 3300