akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,c=0;
    cin>>n;
    int a[n],b[n+1];

    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=0; i<n; i++)
    {
        b[a[i]]=i+1;
    }
    for(int i=1; i<=n; i++)
        cout<<b[i]<<" ";
    cout<<endl;
}


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

int main(void){
    int a, b;
    cin >> a >> b;
    int re = b-a;

    int sumb = 0;

    for(int i = 1; i <= re; i++)
        sumb += i;

    int ans = sumb - b;
    cout << ans << endl;

    return 0;
}

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

int main() {
    string s;
    cin >> s;
    bool result = true;
    
    for (int i = 0, len = s.length(); i < len; i++) {
        char c = s[i];
        if (i % 2 > 0) {
            if (c == 'R') {
                result = false;
                break;
            }
        } else {
            if (c =='L') {
                result = false;
                break;
            }
        }
    }
    if (result) {
        cout << "Yes";  
    } else {
        cout << "No";
    }
}

Measured memory_bytes: 256
import math
A,B,H,M = list(map(int,input().split()))
time = H * 60 + M
Arad = 360 * time/720
Brad = 360 * M / 60
ans = A*A + B*B - 2*A*B*math.cos(math.radians(abs(Arad-Brad)))
print(ans**(1/2))

Measured memory_bytes: 62380
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

import static java.lang.Integer.parseInt;

public class Main {
    public static void main(String[] args) throws Exception {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] padding = new String[]{"", "0", "00", "000", "0000", "00000"};
        StringTokenizer st = new StringTokenizer(br.readLine());
        int N = parseInt(st.nextToken());
        int M = parseInt(st.nextToken());
        int[][] cities = new int[M][4];//[p,y,index,sort]

        for (int i = 0; i < M; i++) {
            st = new StringTokenizer(br.readLine());
            cities[i][0] = parseInt(st.nextToken());
            cities[i][1] = parseInt(st.nextToken());
            cities[i][2] = i;
        }
        br.close();

        Arrays.sort(cities, (e1, e2) -> (e1[0] == e2[0]) ? (e1[1] - e2[1]) : (e1[0] - e2[0]));
        cities[0][3] = 1;
        for (int i = 1; i < M; i++) {
            cities[i][3] = (cities[i][0] == cities[i - 1][0]) ? cities[i - 1][3] + 1 : 1;
        }

        Arrays.sort(cities, (e1, e2) -> e1[2] - e2[2]);
        StringBuilder sb = new StringBuilder(100000 * 13);

        for (int[] city : cities) {
            sb.append(padding[getZeroCnt(city[0])]).append(city[0]);
            sb.append(padding[getZeroCnt(city[3])]).append(city[3]).append('\n');
        }
        System.out.println(sb.toString());
    }

    private static int getZeroCnt(int n) {
        if (n < 10) return 5;
        else if (n < 100) return 4;
        else if (n < 1000) return 3;
        else if (n < 10000) return 2;
        else if (n < 100000) return 1;
        else return 0;
    }
}

Measured memory_bytes: 51104
//Problem *
#include<bits/stdc++.h>
using namespace std;
const int N=3005;
int n;
double dp[N][N],a,s;
int main(){
	scanf("%d",&n);dp[0][0]=1;
	for(int i=1;i<=n;i++){
		scanf("%lf",&a);
		for(int j=0;j<i;j++){
			dp[i][j  ]+=dp[i-1][j]*(1-a);
			dp[i][j+1]+=dp[i-1][j]*a;
		}
	}
	for(int i=0;i<=n;i++)if(n-i<i)s+=dp[n][i];
	printf("%.12lf",s);
	return 0;
}

Measured memory_bytes: 68992
using System;
using System.Linq;

namespace A_____x
{
    class Program
    {
        static void Main(string[] args)
        {
            var line = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
            var max = 0;
            var a = line[0];
            var b = line[1];

            max = a + b;

            if (max < (a - b))
            {
                max = a - b;
            }
            if (max < (a * b))
            {
                max = a * b;
            }
            Console.WriteLine(max);
        }
    }
}


Measured memory_bytes: 13268
#include<bits/stdc++.h>				//edit by thidailoc
using namespace std;				//team three wolves
typedef long long ll;
typedef vector<ll> vi;
#define fu(i,a,b)   for(ll i=a;i<b;i++)
#define fd(i,b,a)   for(ll i=b;i>=a;i--)
#define pb(i)	    push_back(i)
#define popb()    	pop_back()
#define sc(a) 	    scanf("%lld",&a)
#define sc2(a,b)    scanf("%lld%lld",&a,&b)
#define pr(a)	    printf("%lld ",a)
#define pr2(a,b)    printf("%lld %lld",a,b)
#define lowb(a,n,x) lower_bound(a,a+n,x) -a
#define lowb2(a,x)	lower_bound(a.begin(),a.end(),x) -a.begin()
#define all(x) 		(x).begin(), (x).end()
#define sz(a) 		(ll)a.size()
#define le			length()						
#define re 			return 	
#define debug(x)    cerr << #x << " = " << x << endl
#define INPUT       freopen("locin.txt", "r", stdin)
#define OUTPUT      freopen("locout.txt", "w", stdout)

double const eps = 1e-6;	//dung trong sai so
ll const Base=1e9+7;
ll mark[1000000];
class cmp_big{
	public: bool operator()(ll a,ll b){
		return a<b;
	}
};
class cmp_small{
	public: bool operator()(ll a,ll b){
		return a>b;
	}
};
ll suml[(ll)3e5+5],sumr[(ll)3e5+5],arr[(ll)3e5+5];
ll Solves(){
//	INPUT;
	ll n,k,cnt=0,ans=-1e17,x;
	// PROCESSING IN HERE
	sc(n);
	fu(i,1,3*n+1)sc(arr[i]);
	priority_queue<ll,vi,cmp_small> pq_small;
	priority_queue<ll,vi,cmp_big> pq_big;
	ll sum=0;
	
	fu(i,1,3*n+1){
		pq_small.push(arr[i]);
		sum+=arr[i];
		if(pq_small.size()>n){
			
			sum-=pq_small.top();
			pq_small.pop();
		
		}
		suml[i]=sum;	
	}
	sum=0;
	fd(i,3*n,1){
		pq_big.push(arr[i]);
		sum+=arr[i];
		if(pq_big.size()>n){
			
			sum-=pq_big.top();
			pq_big.pop();
			
			//debug(sum);
		}
		sumr[i]=sum;
	}
	
	fu(i,n,2*n+1){
		ans=max(ans,suml[i]-sumr[i+1]);
		//if(ans==11){
		//	debug(suml[i]);
		//	debug(sumr[i+1]);
		//}
	}
	
	pr(ans);
	re 0;
}


int main(){
	Solves();
}

Measured memory_bytes: 10740
m;main(x,y,b,p,n){for(gets(&x);m=~scanf("%d%d%d%d",&x,&y,&b,&p);printf("%d\n",n<m?n:m))n=x*b+y*p,m=(x*(b>5?b:5)+y*(p>2?p:2))*4/5;}

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

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;

#define fill(a,x) memset(a,x,sizeof(a)) 
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end() 
#define F first
#define S second
#define FOR(i,a,b) for(int i = a; i<=b; ++i)
#define NFOR(i,a,b) for(int i = a; i>=b; --i)
#define fast ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
const ll INF = 1e18;
const int mod = 1e9+7;
const int N = 4e6+10; 
inline int add(int x,int y){
  x += y;
  if(x >= mod) x -= mod;
  return x;
}
inline int mul(int x,int y){
  x = (1LL * x * y) % mod;
  return x;
}
int fac[N],ifac[N],inv[N];
void FAC(int n){
  fac[0] = ifac[0] = inv[1] = 1;
  for(int i = 1; i < n; ++i)fac[i] = 1LL*i*fac[i-1] % mod;
  for(int i = 2; i < n; ++i)inv[i] = mod - ((mod/i)*1LL*inv[mod%i]) % mod;
  for(int i = 1; i < n; ++i)ifac[i] = 1LL*ifac[i-1]*inv[i] % mod;
}
inline int C(int n,int k){
  if(k > n)return 0;
  return  1LL * ifac[n-k]*( (1LL*fac[n]*ifac[k]) % mod ) % mod; 
}
int dp[2010][2010];
int k;
int DP(int x,int y){
	if(x > y)return 0;
	if(x < 0 || y < 0)return 0;
	if(x <= 1 && y == 1){
		return 1;
	}
	int &ret = dp[x][y];
	if(~ret)return ret;
	ret = 0;
	ret = add(ret,DP(x-1,y));
	int tmp = DP(x,y-1);
	tmp = mul(tmp,C(x + y*(k-1) -1 , k - 2));
	ret = add(ret,tmp);
	return ret;
}
int main(){
  fast;
  FAC(N);
  int n;cin >> n >> k;
  if(k == 1){
  	cout << 1 << "\n";return 0;
  }
  fill(dp,-1);
  cout << mul(DP(n,n),fac[n]) << "\n";
  return 0;
}

Measured memory_bytes: 63104
#include <iostream>
#include <iomanip>
#include <string>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)

int main()
{
    int n, ans = 0;
    string s;
    cin >> n >> s;
    repi(i, 1000, 0)
    {
        int p = 0;
        int cnt = 0;
        string target = "00" + to_string(i);
        repi(j, target.size(), target.size() - 3)
        {
            repi(k, n, p)
            {
                if (target.at(j) == s.at(k))
                {
                    cnt++;
                    p = k + 1;
                    break;
                }
            }
        }
        if (cnt == 3)
        {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <utility>
#define ll long long int
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

using namespace std;

int main(){
	int N,K;
	cin >> N >> K;
	char S[N];
	cin >> S;
	vector<pair<int,int>> st(N); //first is num. second is count.
	rep(i,0,N){
		if(st.empty() || st.back().first != S[i]){
			st.emplace_back(S[i],1);
		}else{
			st.back().second++;
		}
	}
	int ret=0,ptr=0,sum = 0,all = 0;
	for(auto &p : st){
		while(ptr < st.size() && sum+(st[ptr].first == '0')<=K){
			sum += (st[ptr].first == '0');
			all += st[ptr].second;
			++ptr;
		}
		ret = max(ret,all);
		sum -= p.first == '0';
		all -= p.second;
	}
	cout << ret << endl;
}


Measured memory_bytes: 1920
/* *****fireice**** */

#include<bits/stdc++.h>

#define ll long long int
#define vi vector<int>
#define vc vector<char>
#define vl vector<ll>
#define vii vector<pair<int,int>>
#define vll vector<pair<ll,ll>>
#define pii pair<int,int>
#define pb push_back
#define el '\n'
#define N 1000000007
#define re return
#define F first
#define S second
#define L length
#define mp make_pair
#define PI 3.14159265
#define all(a) (a).begin(),(a).end()
#define forup(i,n) for(int i=0;i<n;i++)
#define forf(i,x,n) for(int i=x;i<n;i++)
#define ford(i,n) for(int (i)=(n)-1;i>=0;(i)--)
#define take(a,n) forup(i,n) cin>>a[i];
using namespace std;

int gcdExtended(int a, int b, int *x, int *y)
{
    // Base Case
    if (a == 0)
    {
        *x = 0, *y = 1;
        return b;
    }

    int x1, y1; // To store results of recursive call
    int gcd = gcdExtended(b%a, a, &x1, &y1);

    // Update x and y using results of recursive
    // call
    *x = y1 - (b/a) * x1;
    *y = x1;

    return gcd;
}

ll modInverse(int a, int m)
{
    int x, y;
    int g = gcdExtended(a, m, &x, &y);
        // m is added to handle negative x
    ll res = ((ll)x%m + (ll)m) % m;

    return res;
}

ll poww(ll x,ll n)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return poww(x*x,n/2);
    else                             //n is odd
        return x*poww(x*x,(n-1)/2);
}

ll modularExponentiation(ll x,ll n,ll M)
{
    ll result=1;
    while(n>0)
    {
        if(n % 2 ==1)
            result=(result * x)%M;
        x=(x*x)%M;
        n=n/2;
    }
    return result;
}

inline ll max(ll a, ll b)
{
  if(a>b) re a;
  else re b;
}

inline ll min(ll a, ll b)
{
  if(a>b) re b;
  else re a;
}

int gcd(int a, int b)
{
    if (a == 0)
       return b;
    if (b == 0)
       return a;

    if (a == b)
        return a;

    if (a > b)
        return gcd(a-b, b);
    else return gcd(a, b-a);
}

ll ncr(int n,int r)
{
  ll ans=1;
  r=min(r,n-r);
  forup(i,r)
  {
    ans=(ans*(n-i)/(i+1))%N;
  }
  re ans;
}

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

  int t=1;
  //cin>>t;
  while(t--)
  {
    ll n,m,k;
    cin>>k;
    cin>>n;
    int a[n];
    take(a,n);
    m=INT_MIN;
    forf(i,1,n)
    {
      m=max(m,abs(a[i]-a[i-1]));
    }
    m=max(m,a[0]);
    m=max(m,a[0]+k-a[n-1]);
    cout<<k-m<<el;
  }


  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>

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

using namespace std;

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


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
long N;
void solve()
{
    vector < long > tmp;
    vector < pair < long , long > > res;
    long i,len,ans=0;
    while(N--)
    {
        long x;
        cin>>x;
        tmp.push_back(x);
    }
    sort(tmp.begin(),tmp.end());
    tmp.push_back(1000000001);
    len=tmp.size();
    pair < long , long > temp;
    temp.first=tmp[0];
    temp.second=1;
    for (i=1;i<len;i++)
        if (tmp[i]==tmp[i-1]) temp.second++;
        else
        {
            res.push_back(temp);
            temp.first=tmp[i];
            temp.second=1;
        }
    len=res.size();
    for (i=0;i<len;i++)
        if (res[i].second%2) ans++;
    cout<<ans<<endl;
}
int main()
{
    while(cin>>N)
        solve();
}

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

const int MAX = 1e5 + 10;
const int INF = 1e9;
const int MOD = 1e9 + 7;
 
int N;

int main(){
    cin >> N;
    ll ans = 0;
    for(int i = 1; i <= N; ++i){
        int cnt = 0;
        for(int j = 1; j <= i; j *= 10) cnt++;
        if(cnt % 2) ans++;
    }

    cout << ans << endl;
}

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

int main()
{
	int a, b, c, x, tmp;
    int count = 0;

    cin >> a >> b >> c >> x;

    for (int i = 0; i <= a; i++)
    {
        for (int j = 0; j <= b; j++)
        {
            for (int k = 0; k <= c; k++)
            {
                tmp = i * 500 + j * 100 + k * 50;
                if (x == tmp)
                {
                    count++;
                }
            }
        }
    }

    cout << count << endl;
    return 0;
}



Measured memory_bytes: 3684
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
#include <queue>
using namespace std;
typedef long long ll;
using graph = vector<vector<int>>;
int main(){
    int x, y; cin >> x >> y;
    bool ok = false;
    for(int i=0; i<=x; ++i){
        int j = x-i;
        if(2*i+4*j==y){
            ok = true;
            break;
        }
    }
    if(ok){cout << "Yes" << endl;}
    else{cout << "No" << endl;}
    return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
using namespace std;
int main() {

	int n;
	int a[10000];

	int count = 0;

	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] % 2 == 0) {
			while (a[i] % 2 == 0) {
				a[i] = a[i] / 2;
				count++;
			}
		}
	}
	cout << count << endl;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
signed main(){
  ll n,c,k,time,cnt=1,ans=1;
  cin >> n >> c >> k;
  ll t[n];
  for(int i=0;i<n;i++){
    cin >> t[i];
  }
  sort(t,t+n);
  time = t[0]+k;
  for(int i=1;i<n;i++){
    if(cnt==c||time<t[i]){
      ans++;
      time = t[i]+k;
      cnt = 0;
    }
    cnt++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define rev(i,n) for(ll i=n-1;i>=0;i--)
#define rev1(i,n) for(ll i=n;i>0;i--)
#define pb push_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vpii vector<pair<int,int> >
#define vb vector<bool>
#define pii pair<int,int>
#define F first
#define S second
#define INF 1e9+7
typedef long long int ll;

void solve(){
    string s;cin>>s;
    ll l=s.length();
    rep(i,l){
        if(i%2==0 && s[i]=='L') {cout<<"No"; return;}
        else if(i%2==1 && s[i]=='R'){cout<<"No"; return;}
    }
    cout<<"Yes";
}
signed main() {
    // your code goes here
    IOS
    ll t=1;
    //cin>>t;
    rep1(i,t){
        solve(); 
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{

	public static void main(String args[]){
		new Main().mainrun();
	}

	private Scanner scan;
	private int N;


	private void mainrun() {
		scan = new Scanner(System.in);

		N = scan.nextInt();

		List L = new List();

		for(int i = 0;i < N;i++) {
			int num = scan.nextInt();
			switch(num) {
			case 0:
				L.insert(scan.nextInt());
				break;
			case 1:
				L.move(scan.nextInt());
				break;
			case 2:
				L.erase();
				break;
			}
		}

		L.setHead();

		while(L.cursor.lflag) {
			L.print();
		}

		scan.close();
	}
}

class List{
	Data last,cursor;

	public List() {
		last = new Data();
		cursor = last;
		last.next = last;
		last.prev = last;

		last.lflag = false;
	}

	public void insert(int x) {
		Data ndata = new Data(x);
		Data pdata = cursor.prev;

		ndata.next = cursor;
		cursor.prev = ndata;

		pdata.next = ndata;
		ndata.prev = pdata;

		cursor = ndata;
	}

	public void move(int d) {
		for(int i = 0;i < Math.abs(d);i++) {
			if(d > 0) {
				cursor = cursor.next;
				if(!cursor.lflag) {
					break;
				}
			}else {
				cursor = cursor.prev;
				if(!cursor.lflag) {
					cursor = cursor.next;
					break;
				}
			}
		}
	}

	public void erase() {
		Data ndata = cursor.next;
		Data pdata = cursor.prev;

		ndata.prev = pdata;
		pdata.next = ndata;

		cursor = ndata;
	}

	public void setHead() {
		cursor = last.next;
	}

	public void print() {
		System.out.println(cursor.num);

		move(1);
	}

	class Data{
		int num;
		boolean lflag = true;
		Data next = null,prev = null;

		Data(){
			next = null;
			prev = null;
		}

		Data(int num){
			this.num = num;
		}

	}
}


Measured memory_bytes: 314724
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		
		//In
		int n = scan.nextInt();
		String str = scan.next();
		char letter[] = new char[n];
		for(int i=0;i<n;i++) {
			letter[i] = str.charAt(i);
		}
		
		//Process and Out
		if(!(n%2 == 0)) {
			System.out.println("No");
		}else {
			for(int i=0;i<n/2;i++) {
				if(!(letter[i] == letter[n/2+i])) {
					System.out.println("No");
					break;
				}else if(i == n/2-1) {
					System.out.println("Yes");
				}
			}
		}
		
		
	}

}


Measured memory_bytes: 21076
using System;
using System.Collections.Generic;
using System.Linq;

namespace Test
{
    class Program
    {
        static void Main(string[] args)
        {
            long n = long.Parse(Console.ReadLine());
            long[] x = Console.ReadLine().Split().Select(long.Parse).ToArray();
            long[] min = new long[n]; long[] max = new long[n];
            min[n - 1] = x[n - 1]; max[n - 1] = x[n - 1] * 2 - 1;
            if (x[n - 1] == 2)
            {
                bool flag = true;
                for (long i = n - 1; i > 0; i--)
                {
                    if ((min[i] - 1) / x[i - 1] == max[i] / x[i - 1]) flag = false;
                    min[i - 1] = ((min[i] - 1) / x[i - 1] + 1) * x[i - 1];
                    max[i - 1] = (max[i] / x[i - 1] + 1) * x[i - 1] - 1;
                }
                Console.WriteLine(flag ? min[0] + " " + max[0] : "-1");
            }
            else
            {
                Console.WriteLine(-1);
            }
        }
    }
}

Measured memory_bytes: 32092
#include<bits/stdc++.h>
using namespace std;
int a[405];
long long int dp[405][405];

int main(){
      int n;
      cin>>n;
      for(int i=0; i<n; i++)
            cin>>a[i];
      long long int sum[n];
      sum[0]=a[0];
      for(int i=1; i<n; i++)
      {
            sum[i]=sum[i-1]+a[i];
      }
      for(int i=0; i<n; i++)
      {
            for(int j=0; j<n; j++)
                  dp[i][j]=LONG_LONG_MAX;
      }
      for(int i=0; i<n; i++)
            dp[i][i]=0;

      for(int i=n-1; i>=0; i--)
      {
            for(int j=i+1; j<n; j++)
            {
                  for(int k=i; k<j; k++)
                        dp[i][j]=min(dp[i][j], dp[i][k]+dp[k+1][j]+sum[j]-((i)?sum[i-1]:0));
            }
      }
      cout<<dp[0][n-1];
}

Measured memory_bytes: 4872
import java.util.Scanner;
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s=sc.next();
		String t=sc.next();
		int count=0;
		for(int i=0; i<s.length(); i++){
			if(s.charAt(i)==t.charAt(i)){
				count++;
			}
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 21588
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n;
  cin>>n;
  
  vector<pair<int,int>> p[16];
  int a,x,y;
  rep(i,n){
    cin>>a;
    rep(j,a){
      cin>>x>>y;
      p[i].push_back({x,y});
    }
  }
  
  int ma=0;
  for(int i=0;i<(1<<n);i++){
    bool b = true;
    int cnt=0;
    for(int j=0;j<n;j++){
      if((i>>j)&1){
        cnt++;
        for(auto u:p[j]){
          if(u.second==1 && ((1<<(u.first-1))&i)==0) b=false;
          if(u.second==0 && ((1<<(u.first-1))&i)>0) b=false;
        }
      }
    }
    if(b){
      if(cnt>ma) ma=cnt;
    }
  }
  
  cout<<ma<<endl;
    
  return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
	int a;
	cin >> a;
	if(a < 1200) {
		cout << "ABC";
		return 0;
	}else if(a < 2800) {
		cout << "ARC";
		return 0;
	}else{
		cout << "AGC";
		return 0;
	}
}


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

int main() {
	int n; cin >> n;
	bool flag = false;
	for (int i = 0; i <= n / 4; i++) {
		for (int j = 0; j <= n / 7; j++) {
			if (4 * i + 7 * j == n)flag = true;
		}
	}
	cout << (flag ? "Yes" : "No") << endl;

	return 0;
}

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

int main() {
    string a;
    cin >> a;
    int count = 0;
    for (int i = 0; i < a.size(); i++) {
        char n = a[i];
        if (n == '1') {
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int judge(char* type){
	if(!strcmp("A",type)){
		return 0;
	}else if(!strcmp("B",type)){
		return 1;
	}else if(!strcmp("AB",type)){
		return 2;
	}else if(!strcmp("O",type)){
		return 3;
	}
}
int main(){
	int blood[4]={0,0,0,0};//A,B,AB,O
	int i;
	char str[10],type[3];;
	int num;	
	while(~scanf("%s",str)){
		sscanf(str,"%d,%s",&num,type);
		blood[judge(type)]++;
	}
	for(i=0;i<4;i++){
		printf("%d\n",blood[i]);
	}
	return 0;
}

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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String str[] = br.readLine().split(" ");

		long a = Long.parseLong(str[0]);
		long b = Long.parseLong(str[1]);

		System.out.println(f(a - 1) ^ f(b));
	}

	static long f(long n) {
		if (n < 0) {
			return 0;
		}
		if (n % 4 == 0) {
			return n;
		} else if (n % 4 == 1) {
			return 1;
		} else if (n % 4 == 2) {
			return 1 ^ n;
		} else {
			return 0;
		}
	}
}

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

using namespace std;
using ll = long long;

int main()
{
    int n, ac = 0, wa = 0, tle = 0, re = 0;
    cin >> n;
    string AC = "AC", TLE = "TLE", RE = "RE", WA = "WA";
    for (int i = 0; i < n; i++)
    {
        string s;
        cin >> s;
        if (s == AC)
        {
            ac++;
        }
        else if (s == TLE)
        {
            tle++;
        }
        else if (s == WA)
        {
            wa++;
        }
        else
        {
            re++;
        }
    }
    cout << "AC x " << ac << endl;
    cout << "WA x " << wa << endl;
    cout << "TLE x " << tle << endl;
    cout << "RE x " << re << endl;
}

Measured memory_bytes: 3632
n=input()
if n[-1] == '2' or n[-1] == '4' or n[-1] == '5' or n[-1] == '7' or n[-1] == '9':
    print('hon')
elif n[-1] == '0' or n[-1] == '1' or n[-1] == '6' or n[-1] == '8':
    print('pon')
else:
    print('bon')

Measured memory_bytes: 9060
#include<stdio.h>
int main(void){
	int a, b, c, d;
	scanf("%d", &a);
	scanf("%d", &b);
	scanf("%d", &c);
	scanf("%d", &d);
	if((c+b-1)/b <= (a+d-1)/d){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 1656
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
const ll inf = (ll)1e9 + 7;
int main()
{
    ll i, j, k, n, a[200005], d[200005];
    cin >> k >> n;
    for (i = 0; i < n; i++)
        cin >> a[i];
    for (i = 0; i < n - 1; i++)
    {
        d[i] = a[i + 1] - a[i];
    }
    d[n - 1] = k - a[n - 1] + a[0];
    sort(d, d + n);
    cout << (k - d[n - 1]);
    return 0;
}

Measured memory_bytes: 3328
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<list>
#include<bitset>
#include<stack>
#include<memory>
#include<numeric>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=1000000007;
const llint big=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-12;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(const vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(const vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
//AGCばちゃ 1700~
llint solve(string S){
	char c='#';
	llint ans=0,gen=0;
	for(auto it:S){
		if(c==it){gen++;}
		else{ans+=(gen+1)/2;gen=0;}
		c=it;
	}
	ans+=(gen+1)/2;
	return ans;
}
int main(void){
	string s;llint i,K,ans;cin>>s>>K;
	if(s==string(s.size(),s[0])){cout<< (s.size()*K)/2<<endl;}
	else{cout<<(solve(s+s)-solve(s))*(K-1)+solve(s);}
	return 0;
}

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

using namespace std;
typedef long long ll;
vector<ll> v, w;
ll dp[10000][10010];
int main(){
    ll n, W, i, j, k, a, b, c;
    cin >> n >> W;
    for(i = 0; i < n;i++){
        cin >> a >> b >> c;
        ll cmpc = c;
        j = 1;
        while(cmpc >>= 1) {
            v.push_back(a * j);
            w.push_back(b * j);
            j <<= 1;
        }
        if(c - j + 1 > 0) {
            v.push_back(a * (c - j + 1));
            w.push_back(b * (c - j + 1));
        }
    }
    ll vs = v.size();
    for(i = 0; i < vs;i++){
        for(j = 0; j <= W;j++){
            dp[i + 1][j] = dp[i][j];
            if(j>=w[i]){
                dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - w[i]] + v[i]);
            }
        }
    }
    ll ret = 0;
    for(i = 0; i <= W; i++){
        ret = max(dp[vs][i], ret);
    }

    cout << ret << endl;
    return 0;
}


Measured memory_bytes: 112616
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	MyScanner sc = new MyScanner();
	Scanner sc2 = new Scanner(System.in);
	final int MOD = 1000000007;
	int[] dx = { 1, 0, 0, -1 };
	int[] dy = { 0, 1, -1, 0 };

	void run() {
		for (;;) {
			int n = sc.nextInt();
			int l = sc.nextInt();
			if ((n | l) == 0) {
				return;
			}
			Ant[] ant = new Ant[n];
			for (int i = 0; i < n; i++) {
				ant[i] = new Ant(i + 1, sc.next(), sc.nextDouble(), false);
			}
			int cnt = 0;
			int last = 0;
			double time = 0;
			double tmp = 0;
			while (cnt != n) {
				for (int i = 0; i < n; i++) {
					if (!ant[i].leave) {
						if (ant[i].dir.equals("R")) {
							ant[i].dis += 0.5;
						} else {
							ant[i].dis -= 0.5;
						}
					}
				}

				for (int i = 0; i < n; i++) {
					for (int j = i + 1; j < n; j++) {
						if (ant[i].leave || ant[j].leave) {
							continue;
						}
						if (ant[i].dis == ant[j].dis) {
							if (ant[i].dis * 10 % 10 != 5) {
								if (ant[i].dir.equals("R")) {
									ant[i].dir = "L";
								} else {
									ant[i].dir = "R";
								}
								if (ant[j].dir.equals("R")) {
									ant[j].dir = "L";
								} else {
									ant[j].dir = "R";
								}
							}
						}
					}
				}
				tmp = 0;
				for (int i = 0; i < n; i++) {
					if (!ant[i].leave && (ant[i].dis == 0 || ant[i].dis == l)) {
						ant[i].leave = true;
						cnt++;
						if (time == tmp && ant[i].dir.equals("L")) {
							last = ant[i].num;
						} else if (tmp == 0) {
							last = ant[i].num;
						}
						tmp = time;
					}
				}
				time += 0.5;
			}
			System.out.println((int) time + " " + last);
		}
	}

	class Ant {
		int num;
		String dir;
		double dis;
		boolean leave;

		public Ant(int num, String dir, double dis, boolean leave) {
			super();
			this.num = num;
			this.dir = dir;
			this.dis = dis;
			this.leave = leave;
		}

	}

	public static void main(String[] args) {
		new Main().run();
	}

	void debug(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}

	void debug2(int[][] array) {
		for (int i = 0; i < array.length; i++) {
			for (int j = 0; j < array[i].length; j++) {
				System.out.print(array[i][j]);
			}
			System.out.println();
		}
	}

	class MyScanner {
		int nextInt() {
			try {
				int c = System.in.read();
				while (c != '-' && (c < '0' || '9' < c))
					c = System.in.read();
				if (c == '-')
					return -nextInt();
				int res = 0;
				do {
					res *= 10;
					res += c - '0';
					c = System.in.read();
				} while ('0' <= c && c <= '9');
				return res;
			} catch (Exception e) {
				return -1;
			}
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		String next() {
			try {
				StringBuilder res = new StringBuilder("");
				int c = System.in.read();
				while (Character.isWhitespace(c))
					c = System.in.read();
				do {
					res.append((char) c);
				} while (!Character.isWhitespace(c = System.in.read()));
				return res.toString();
			} catch (Exception e) {
				return null;
			}
		}
	}
}

Measured memory_bytes: 23740
#include<cstring>
#include<iostream>
#include<algorithm>
#include<string>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using ll = long long;
using namespace std;

int main() {
    int a, b, c;
    cin >> a >> b;
    c = 6 - a - b;
    cout << c << endl;
    return 0;
}

Measured memory_bytes: 256
#[macro_use]
mod input {

use std;
use std::io;

const SPLIT_DELIMITER: char = ' ';

#[macro_export]
#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

#[allow(dead_code)]
pub fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
pub fn p<T>(t: T)
where
    T: std::fmt::Display,
{
    println!("{}", t);
}

#[allow(dead_code)]
pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let vec_line = input_vector();
        v.push(vec_line);
    }
    v
}

#[allow(dead_code)]
pub fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

#[allow(dead_code)]
pub fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}
}

use input::*;

fn f(v: &mut Vec<usize>, graph: &Vec<Vec<usize>>, k: usize) {
    let buf = v[k];
    for z in &graph[k] {
        v[*z] += buf;
        f(v, graph, *z);
    }
}

fn main() {
    let (n, q): (usize, usize);
    input!(n, q);
    let mut v = vec![0; n];
    let mut graph = vec![vec![]; n];
    for _ in 1..n {
        let (a, b): (usize, usize);
        input!(a, b);
        graph[a - 1].push(b - 1);
    }
    for _ in 0..q {
        let (p, x): (usize, usize);
        input!(p, x);
        v[p - 1] += x;
    }
    f(&mut v, &graph, 0);
    for z in v {
        print!("{} ", z);
    }
    println!("");
}

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

int main()
{
    int n, m, c;
    cin >> n >> m >> c;
    vector<int>b(m);
    for(auto & x: b){
        cin >> x;
    }
    vector<vector<int>>a(n);
    for(auto & x: a){
        x.resize(m);
        for(auto & y: x){
            cin >> y;
        }
    }
    auto ans = 0;
    for(auto i = 0; i < n; ++i){
        auto val = 0;
        for(auto j = 0; j < m; ++j){
            val += a[i][j]*b[j];
        }
        val += c;
        if(val > 0){
            ans++;
        }
    }
    cout << ans;
    return 0;
}



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

#define rep(i,s,n) for (int i = (int)s; i < (int)n; i++)
#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define All(x) x.begin(), x.end()
#define Range(x, i, j) x.begin() + i, x.begin() + j
#define lbidx(x, y) lower_bound(x.begin(), x.end(), y) - x.begin()
#define ubidx(x, y) upper_bound(x.begin(), x.end(), y) - x.begin()
#define llbidx(x, y, z) lower_bound(x.begin(), x.end(), z) - lower_bound(x.begin(), x.end(), y) // 二要素間の距離
#define deg2rad(deg) ((((double)deg)/((double)360)*2*M_PI))
#define rad2deg(rad) ((((double)rad)/(double)2/M_PI)*(double)360)
#define Find(set, element) set.find(element) != set.end()
#define Decimal(x) printf("%.10f\n", x) // 小数点を10桁まで表示
// debug用
#define PrintVec(x) for (auto elementPrintVec: x) { cout << elementPrintVec << " "; } cout << endl;
#define debug(x) cerr << #x << ": " << (x) << "\n";

typedef pair<int, int> PI;
typedef pair<ll, ll> PLL;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<int>>> vvvl;
typedef vector<PI> vpi;
typedef vector<vector<PI>> vvpi;
typedef vector<vector<vector<PI>>> vvvpi;
typedef vector<PLL> vpl;
typedef vector<vector<PLL>> vvpl;
typedef vector<vector<vector<PLL>>> vvvpl;

int POWINT(int x, int n) {
  int ret = 1;
  rep(i, 0, n) ret *= x;
  return ret;
};

ll POWLL(ll x, int n) {
  ll ret = 1;
  rep(i, 0, n) ret *= x;
  return ret;
};

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

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

const int INF = 1e9+7;

vvi graph(201, vi(201, INF));
void floyd(int n) {
  rep(i, 0, n) {
    graph[i][i] = 0;
  }
  rep(k, 0, n) {
    rep(i, 0, n) {
      rep(j, 0, n) {
        chmin(graph[i][j], graph[i][k]+graph[k][j]);
      }
    }
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m, r;
  cin >> n >> m >> r;
  vi R(r);
  rep(i, 0, r) {
    cin >> R[i];
    R[i]--;
  }
  sort(All(R));
  int a, b, c;
  rep(i, 0, m) {
    cin >> a >> b >> c;
    a--; b--;
    graph[a][b] = c;
    graph[b][a] = c;
  }

  floyd(n);
  int ans = INF;
  do {
    int tmp = 0;
    rep(i, 0, r-1) {
      tmp += graph[R[i]][R[i+1]];
    }
    ans = min(ans, tmp);
  } while (next_permutation(All(R)));

  cout << ans << endl;

  return 0;
};


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

int main(void)
{
    string t, s;
    cin >> s >> t;
    rep(i,s.length())
        if(s[i]!=t[i]){
        cout << "No" << endl;
        return 0;
    }
    cout << "Yes" << endl;

    return 0;
}

Measured memory_bytes: 3596
import java.util.*;

class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int W = sc.nextInt();
		int[] v = new int[N];
		int[] w = new int[N];
		for (int i=0;i<N;i++) {
			v[i] = sc.nextInt();
			w[i] = sc.nextInt();
		}

		int[][] dp = new int[N+1][W+1];
		for (int i=0;i<N;i++) {
			for (int b=0;b<W+1;b++) {
				if (b-w[i]>=0) {
					dp[i+1][b]=Math.max(dp[i][b],dp[i][b-w[i]]+v[i]);
				}else {
					dp[i+1][b]=dp[i][b];
				}
			}
		}
		System.out.println(dp[N][W]);
	}
}


Measured memory_bytes: 31224
import collections
n=int(input())
s = [0]*n
for i in range(n):
    s[i] = input()
c = collections.Counter(s).most_common()
maxn = c[0][1]
ans = []
for i in range(len(c)):
    if c[i][1] == maxn:
        ans.append(c[i][0])
print('\n'.join(sorted(ans)))

Measured memory_bytes: 45028
#include <stdio.h>
#include <stdint.h>
#include <stdbool.h>
#include <stdlib.h>

#define max(a,b) (((a) > (b)) ? (a) : (b))
#define min(a,b) ((a < b) ? a : b)
#define abs(a) ((a < 0) ? -(a) : a)

typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;

typedef struct {
	s64 x;
	s64 y;
	s64 z;
	int num;
} Cake;

static inline int ri() {
	int a;
	scanf("%d", &a);
	return a;
}

int comp_max(const void* a, const void* b) {
	const Cake* aa = (const Cake*) a;
	const Cake* bb = (const Cake*) b;
	
	s64 aaa = aa->x + aa->y + aa->z;
	s64 bbb = bb->x + bb->y + bb->z;
	
	return (aaa - bbb < 0) ? 1 : (aaa - bbb == 0) ? 0 : -1;
}

int main() {
	int n = ri();
	int m = ri();
	
	Cake cs[n];
	for (int i = 0; i < n; i++) {
		cs[i].num = i;
		
		scanf("%ld", &cs[i].x);
		scanf("%ld", &cs[i].y);
		scanf("%ld", &cs[i].z);
		/*
		scanf("%I64d", &cs[i].x);
		scanf("%I64d", &cs[i].y);
		scanf("%I64d", &cs[i].z);*/
	}
	
	u64 res = 0;
	// i : x
	// j : y
	// k : z
	// 0 : -, 1 : +
	for (int i = 0; i < 2; i++) {
		for (int j = 0; j < 2; j++) {
			for (int k = 0; k < 2; k++) {
				Cake css[n];
				for (int l = 0; l < n; l++) {
					css[l].x = cs[l].x * (i ? -1 : 1);
					css[l].y = cs[l].y * (j ? -1 : 1);
					css[l].z = cs[l].z * (k ? -1 : 1);
					css[l].num = cs[l].num;
				}
				qsort(css, n, sizeof(Cake), comp_max);
				s64 x_p = 0;
				s64 y_p = 0;
				s64 z_p = 0;
				for (int l = 0; l < m; l++) {
					x_p += css[l].x;
					y_p += css[l].y;
					z_p += css[l].z;
				}
				if (x_p < 0 || y_p < 0 || z_p < 0) continue;
				else res = (u64)max((s64)res, x_p+y_p+z_p);
			}
		}
	}
	
	printf("%lu", res);
	// printf("%I64u", res);
	
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
    unsigned short num;
    unsigned short i;
    unsigned short ielt[100];
    unsigned short work;
    for(i = 0;i < 100;i++){
        ielt[i] = 0;
    }
    scanf("%d", &num);
    for(i = 0;i < num;i++){
	scanf("%d", &ielt[i]);
    }
    for(i = 0;i < num - 1;i++){
        printf("%d ", ielt[num - 1 - i]);
    }
    printf("%d\n", ielt[0]);
    return 0;
}


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

int main(){
	string s;
  	cin>>s;
  	ll n = s.length(), sum=0;
    for (int i=0; i<n; i++) 
        sum += (s[i]-'0');
  	if(sum % 9 == 0){
    	cout<<"Yes";
    } else{
    	cout<<"No";
    }
  return 0;
}

Measured memory_bytes: 3736
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> V;
const long long MOD=1000000007LL;
const long long INFL=1LL << 60;
const int INF=1<<29;


int main() {
    string S;
    cin >>S;
    int cnt=0;
    for(int i=0;i<S.size();i++){
        if(S[i]=='x') cnt++;
    }
    if(cnt>=8) cout<<"NO";
    else cout<<"YES";
    return 0;
}

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

int main() {
  int n, k; cin >> n >> k;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  for (int i = 0; i < n-k; i++) {
    if (a[i] < a[i+k]) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 3996
#include<iostream>
using namespace std;
int main()
{
  int n;

  cin >> n;

  int ans = 100000;

  for(int i = 0;i < n;i++)
    {
      ans += ans*5/100;

      if(ans % 1000 != 0)
	{
	  ans += 1000 - ans % 1000;
	}
     
    }
  
  
  
  cout << ans << endl;
}

Measured memory_bytes: 1156
#include <cstdio>

using namespace std;

size_t num_digits(int n) {
    size_t k=1;
    while (n /= 10) ++k;

    return k;
}

int main() {
    while (true) {
        int a, b;
        if (scanf("%d %d", &a, &b) == EOF)
            break;

        printf("%zu\n", num_digits(a+b));
    }

    return 0;
}

Measured memory_bytes: 2708
n = int(input())
B = list(map(int, input().split()))

#print(len(B))
ans = []
while B:
    for i in reversed(range(len(B))):
        if B[i] == i+1:
            ans.append(B[i])
            del B[i]
            break
    else:
        print(-1)
        exit()
for i in reversed(range(len(ans))):
    print(ans[i])

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <array>
#include <tuple>
#include <random>

using namespace std;
typedef long long int ll;

#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); i++)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep,)(__VA_ARGS__)
#define all(x) (x).begin(), (x).end()

#define INF 10000000000

ll a, b, c, n, m, x, y, z, w, h, ans = 0, mx = 0, mn = INF;
string s;

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

	cin >> n;
    ll list[n];
    map<ll, ll> cnt;
	rep(i, n){
        cin >> list[i];
        cnt[list[i]]++;
    }
	for(auto p: cnt){
		ll x = p.first;
		ll n = p.second;
		if(n < x){
            ans += n;
        }else{
            ans += n - x;
        }
	}
	cout << ans << endl;
}

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

int n,k;
int dp[100005];
int a[100005];

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	dp[0] = 2e9;
	cin>>n>>k;
	for(int i=1;i<=n;i++) cin>>a[i];
	for(int i=2;i<=n;i++){
		dp[i] = 2e9;	
		for(int j=max(0,i-k);j<i;j++){
			dp[i] = min(dp[i],dp[j] + abs(a[i]-a[j]));
		}
	}
	cout<<dp[n];
	
	return 0;
}


Measured memory_bytes: 1024
S = input()

if S == "SUN":
    print(7)
if S == "MON":
    print(6)
if S == "TUE":
    print(5)
if S == "WED":
    print(4)
if S == "THU":
    print(3)
if S == "FRI":
    print(2)
if S == "SAT":
    print(1)


Measured memory_bytes: 3060
#include<algorithm>
#include<cmath>
#include<cstdint>
#include<cstdio>
#include<functional>
#include<iostream>
#include<list>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<vector>
using namespace std;

#define loop(i,a,b) for(int i=(a); i<(b); ++i)
#define rep(i,n) for(int i=0; i<n; ++i)
#define all(v) begin(v), end(v)
#define dump(a) cerr << #a << " = " << (a) << "(L:" << __LINE__ << ")" << endl

const double PI = acos(-1.0);

int main() {
  std::ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];

  sort(all(a));
  int m = a.back();
  int r = 0;
  double d = 1 << 30;
  rep(i,n-1) {
          if (abs(a[i] - m/2.0) < d) {
                  r = a[i];
                  d = abs(a[i] - m/2);
          }
  }

  cout << m << " " << r << endl;

  return 0;
}


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

int main() {
	int a,b,c;
	cin>>a>>b>>c;
	if(a==b&&b==c)cout << 1 << endl;
	else if(a==b||b==c||c==a)cout << 2 << endl;
	else cout << 3 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

double x[1100], y[1100];

void init()
{
    x[0] = y[0] = 0.0;
    x[1] = 1.0;
    y[1] = 0.0;

    for (int i = 2; i < 1100; i++) {
        double d = sqrt(x[i - 1] * x[i - 1] + y[i - 1] * y[i - 1]);
        double dx = -y[i - 1] / d;
        double dy = x[i - 1] / d;

        x[i] = x[i - 1] + dx;
        y[i] = y[i - 1] + dy;
    }
}


int main()
{
    int n;

    init();
    cout << setprecision(2) << setiosflags(ios::fixed);

    while (cin >> n, n != -1) {
        cout << x[n] << '\n' << y[n] << endl;
    }

    return 0;
}

Measured memory_bytes: 1252
import java.util.Scanner;


public class Main {
	public static void main(String[] args){

		Scanner sc = new Scanner(System.in);

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

		quick_sort(list, 0, list.length-1);

		boolean result = false;
		for(int i = 1; i < n; i++){
			if(list[i-1] == list[i]) {
				result = true;
				break;
			}
		}


		if(!result){
			System.out.println("YES");
		} else {
			System.out.println("NO");
		}
	}

	static void quick_sort(int[] d, int left, int right) {
        if (left>=right) {
            return;
        }
        int p = d[(left+right)/2];
        int l = left, r = right, tmp;
        while(l<=r) {
            while(d[l] < p) { l++; }
            while(d[r] > p) { r--; }
            if (l<=r) {
                tmp = d[l]; d[l] = d[r]; d[r] = tmp;
                l++; r--;
            }
        }
        quick_sort(d, left, r);  // ピボットより左側をクイックソート
        quick_sort(d, l, right); // ピボットより右側をクイックソート
    }
}


Measured memory_bytes: 84556
#include<stdio.h>
#define N 100

int main()
{
  int i,j,m,count=0,minj,tmp;
  int A[N];

  scanf("%d",&m);
  for(i = 0;i < m;i++){
    scanf("%d",&A[i]);
  }

  for(i = 0;i <=m-1;i++){
    minj = i;
    for(j = i;j <= m-1;j++){
      if(A[j] < A[minj]) {
	minj = j;   
      }
    }
    if(minj == i) continue;
    count++;

    tmp = A[i];
    A[i] = A[minj];
    A[minj] = tmp;
  }

  for(i = 0;i < m-1;i++){
    printf("%d ",A[i]);
  }
  printf("%d\n",A[m-1]);
  printf("%d\n",count);

  return 0;
}

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

int main(){
  string S;
  int K;
  cin >> S >> K;
  vector<vector<int>> rec(26);
  string A="abcdefghijklmnopqrstuvwxyz";
  int l=S.size();
  for (int i=0;i<l;i++){
    for (int j=0;j<26;j++){
      if (S[i]==A[j]){
        rec[j].push_back(i);
      }
    }
  }
  for (int i=0;i<26;i++){
    int x=rec[i].size();
    if (x>0){
      set<string> s;
      for (auto y : rec[i]){
        for (int j=1;j<min(K+1,l-y+1);j++){
          s.insert(S.substr(y,j));
        }
      }
      int z=s.size();
      if (z>=K){
        auto itr=s.begin();
        for (int i=0;i<K-1;i++){
          ++itr;
        }
        cout << *itr << endl;
        break;
      }
      else {
        K-=z;
      }
    }
  }
}

Measured memory_bytes: 384