akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<ll, ll>;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
template<typename T> void chmin(T &a, const T &b) { a = min(a, b); }
template<typename T> void chmax(T &a, const T &b) { a = max(a, b); }
struct FastIO {FastIO() { cin.tie(0); ios::sync_with_stdio(0); }}fastiofastio;
#ifdef DEBUG_ 
#include "../program_contest_library/memo/dump.hpp"
#else
#define dump(...)
#endif
const ll INF = 1LL<<60;

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

    REP(i, 100000) {
        if((ll)(i*0.08) == a && (ll)(i*0.1) == b) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;

    return 0;
}

Measured memory_bytes: 256
n = int(input())
h = [int(item) for item in input().split()]
 
c = 0 #count
 
for i in range(n):
  flag=0
  if i==0:
    pass
  else:
    for j in range(i):
      if h[j] > h[i]:
        flag=1
        break
  if flag == 0:
    c+=1
print(c)

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

int main(){

	int N, M;
	scanf("%d %d", &N, &M);
	long long A[1000000];

	for(int i = 0; i < N; i++){
		scanf("%lld", &A[i]);
	}

	std::priority_queue<long long> q;

	for(int i = 0; i < N; i++){
		q.push(A[i]);
	}

	for(int i = 0; i < M; i++){
		q.push((q.top() / 2));
		q.pop();

	}

	long long sum = 0;
	for(int i = 0; i < N; i++){
		sum = sum + q.top();
		q.pop();
	}

	printf("%lld\n", sum);



}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); ++i)
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
using ll = long long;
using vi = vector<int>;
using vl = vector<ll>;
using Graph = vector<vi>;  // vi <=> vl
using vb = vector<bool>;
using boolGraph = vector<vb>;
using P = pair<int, int>;  // int <=> ll
const int MOD = 1e9+7;
const double EPS = 1e-9;

int main() {
  ll K; cin >> K;
  const int N = 50;
  int rest = K % N;
  ll x = K / N;
  vl arr(N, N-1 + x - rest);
  rep(i,rest) arr[i] += N+1;
  cout << N << endl;
  rep(i,N-1) cout << arr[i] << ' ';
  cout << arr[N-1] << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define f(i,a,b) for(int i(a);i<b;i++)
#define rep(i,n) for(int i(0);i<n;i++)
#define fast  ios_base::sync_with_stdio(0); cin.tie(0);
#define open freopen("input.txt","r",stdin) ; freopen("output.txt","w",stdout);
#define watch(x) cout<<(#x)<<" is "<<x<<"\n";
#define mod 1000000007
#define pres(x) cout<<fixed; cout<<setprecision(x);

int32_t main(){
	
	fast;
	//open;

	double w,h,x,y;
	cin>>w>>h>>x>>y;
	double ans = (w*h)/2;
	pres(10);
	cout<<ans<<" ";
	if((x==w/2)&&(y==h/2))cout<<"1";
	else cout<<"0";


	return 0;
}

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

int main() {
  char a1;
  cin >> a1;
  string b1;
  b1 = "ABCDEFGHIJKLNMOPQRSTUVWXYZabcdefghijklnmopqrstuvwxyz";
  if (a1 < b1.at(26)) {
    cout << 'A' << endl;
  }
  else {
    cout << 'a' << endl;
  }
}

Measured memory_bytes: 3616
def main():
    N = int(input())
    A = [0] * N
    node_info = [[-1, 0, 'internal node', None] for _ in range(int(1E5 + 1))]
    for i in range(N):
        A[i] = [int(i) for i in input().strip().split()]
    for line in A:
        if line[1] != 0:
            node_info[line[0]][3] = line[2:]
            for c in line[2:]:
                node_info[c][0] = line[0]

    for line in A:
        pid = node_info[line[0]][0]
        if pid == -1:
            node_info[line[0]][2] = 'root'
        else:
            if node_info[line[0]][3] is None:
                node_info[line[0]][2] = 'leaf'
        if node_info[line[0]][3] is None:
            node_info[line[0]][3] = ['']

        depth = 0
        while pid != -1:
            depth += 1
            pid = node_info[pid][0]
        node_info[line[0]][1] = depth

    for line in sorted(A, key=lambda a: a[0]):
        print('node {}: parent = {}, depth = {}, {}, [{}]'.format(
            line[0], node_info[line[0]][0],
            node_info[line[0]][1], node_info[line[0]][2], ', '.join([str(i) for i in node_info[line[0]][3]]))
        )


if __name__ == '__main__':
    main()

Measured memory_bytes: 56432
#include<bits/stdc++.h>
using namespace std ; 
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fast ios_base:: sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long int 
#define pb push_back
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
 
 
int main(){
    fast;
    string a,b; cin >> a >> b;
    int n1 = a.size();
    int n2 = b.size();
    a= "*" + a;
    b = "*" + b;
    int dp[n1+1][n2+1];
    memset(dp,0,sizeof(dp));
    string ans = "";
    for(int i=1 ; i<n1+1 ; i++){
        for(int j=1 ; j<n2+1 ; j++){
            if(a[i]==b[j]){
                dp[i][j] = dp[i-1][j-1] + 1;
            }
            else
                dp[i][j] = max(dp[i-1][j],dp[i][j-1]);
        }
    }
    int i= n1,j = n2;
    while(i>=1 && j>=1){
            if(dp[i-1][j-1] + 1 == dp[i][j]){
                if(a[i] == b[j]){
                    ans+= a[i];
                    i--,j--;
                }
                else{
                    if(dp[i-1][j] == dp[i][j]){
                        i--;
                    }
                    else
                        j--;
                }
            }
            else if(dp[i-1][j] == dp[i][j])
                    i--;
            else if(dp[i][j-1] == dp[i][j])
                    j--;
            
            
 
    }
    reverse(all(ans));
    cout << ans << endl;
}


Measured memory_bytes: 35456
/* ex4_1
   tamayama  */

#include<stdio.h>
int apple(int number_N,int number_D);

int main(void){
    int N;
    int D;
    int watchman;
    scanf("%d %d",&N,&D);
    watchman = apple(N,D);
    printf("%d\n",watchman);
    return 0;
}

int apple(int number_N,int number_D){
    int tree;
    tree = 2 * number_D + 1;    /*一人当たりが監視すべき木の数*/
    if(number_N % tree == 0){
        return(number_N / tree);    /*木の数をtreeで割り、割り切れない場合は一人追加*/
    }else{
        return(number_N / tree + 1);
    }
}


Measured memory_bytes: 128
/*
 * @Author: Kaizyn
 * @Date: 2020-04-04 20:41:03
 * @LastEditTime: 2020-04-04 20:41:50
 */
#include <bits/stdc++.h>

// #define DEBUG

using namespace std;

const int MOD = 998244353;
const int INF = 0x3f3f3f3f;
const double eps = 1e-7;
const double PI = acos(-1);
typedef pair<int, int> pii;

inline void solve()
{
    int x, y, z;
    cin >> x >> y >> z;
    cout << z << " " << x << " " << y << endl;
}

signed main()
{
    ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
    int testcase = 1;
    // cin >> testcase;
    for (int i = 1; i <= testcase; ++i) {
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
using namespace std;
int a[100010],a1[300030];
int sum[100010]={0};
int h=0;
int main()
{
	int N,max,j=0,a;
	int h=0;
	cin>>N;
	for(int i=0;i<N;i++)
	{
		cin>>a;
		sum[a-1]++;
		sum[a]++;
		sum[a+1]++;
	}
	sort(sum,sum+100001);
	cout<<sum[100000];
}


Measured memory_bytes: 640
K = int(input())
A = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(A[K - 1])


Measured memory_bytes: 2940
import sys

sys.setrecursionlimit(10 ** 7)
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b, c = map(int, input().split())

    if b - a == c - b:
        print("YES")
    else:
        print("NO")


if __name__ == '__main__':
    resolve()


Measured memory_bytes: 2940
<?php
    /*
        Problem URL : http://agc001.contest.atcoder.jp/

        Score  :
        Result :
        Time   : ms
        Memory : KB
     */

    fscanf(STDIN, "%d", $N);
    $L = explode(" ", trim(fgets(STDIN)));

    rsort($L);

    // var_dump($L);

    $answer = 0;

    for ($i = 0; $i < $N; $i++) {
        $answer += min($L[$i * 2], $L[$i * 2 + 1]);
    }

    echo $answer . PHP_EOL;




Measured memory_bytes: 3704
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;


int main()
{
   ll i,j,k,n,m;
   string s; cin>>s;
   n=s.length();
   ll dp[n+1][4]={0};
   dp[0][0]=1;
   for(i=1;i<=n;i++)
   {
       for(j=0;j<4;j++)
       {
           if(s[i-1]=='?') dp[i][j]=(dp[i][j]+3*dp[i-1][j])%mod;
           else dp[i][j]=(dp[i-1][j]+dp[i][j])%mod;
       }
       if(s[i-1]=='A' || s[i-1]=='?') dp[i][1]=(dp[i-1][0]+dp[i][1])%mod;
       if(s[i-1]=='B' || s[i-1]=='?') dp[i][2]=(dp[i-1][1]+dp[i][2])%mod;
       if(s[i-1]=='C' || s[i-1]=='?') dp[i][3]=(dp[i-1][2]+dp[i][3])%mod;
   }
   cout<<dp[n][3]<<endl;
   return 0;
}


Measured memory_bytes: 3584
//Author: ReseeCher
#include<bits/stdc++.h>
#define LL long long
#define F(x,y,z) for(int x=y;x<=z;++x)
#define D(x,y,z) for(int x=y;x>=z;--x)
#define ckmax(a,b) (a)=max(a,b)
#define ckmin(a,b) (a)=min(a,b)
#define pb push_back
using namespace std;
const int N=305;
const int P=998244353;
LL R(){
    LL ans=0,f=1;char c=getchar();
    for(;c<'0'||c>'9';c=getchar()) if (c=='-') f=-1;
    for(;c>='0'&&c<='9';c=getchar()) ans=ans*10+c-'0';
    return ans*f;
}
void Ad(LL &x,LL y){x=(x+y)%P;}
int n;
char s[N];
LL fn[N][N][N];
int g[N][N][N];
int main(){
	//freopen("1.in","r",stdin);freopen("1.out","w",stdout);
	cin>>(s+1);n=strlen(s+1);
	fn[n][0][0]=1;
	D(i,n,1)F(j,0,n)F(k,0,n){
		Ad(fn[i-1][j][k],fn[i][j][k]);
		if(s[i]=='0')Ad(fn[i][j][k+1],fn[i][j][k]);
		else Ad(fn[i][j+1][k],fn[i][j][k]);
	}
	memset(g,-1,sizeof(g));
	g[0][0][0]=0;
	F(i,0,n)F(j,0,n)F(k,0,n){
		if(g[i][j][k]==-1)continue;
		if(s[i+1]=='0')ckmax(g[i+1][j+1][k],g[i][j][k]-1);
		else ckmax(g[i+1][j][k+1],g[i][j][k]-1);
		if(s[i+1]=='0'||s[i+2]=='0')ckmax(g[i+2][j+1][k],g[i][j][k]);
		if(s[i+1]=='1'||s[i+2]=='1')ckmax(g[i+2][j][k+1],g[i][j][k]);
		ckmax(g[i+2][j][k],g[i][j][k]+1);
	}
	F(i,0,n)D(j,n,0)D(k,n,0){
		if(i)ckmax(g[i][j][k],g[i-1][j][k]);
		ckmax(g[i][j][k],g[i][j+1][k]);
		ckmax(g[i][j][k],g[i][j][k+1]);
	}
	LL an=0;
	F(i,0,n)F(j,0,n)F(k,0,n)
		if(g[i][j][k]!=-1&&(n-i)+j+k!=0&&fn[i][j][k]){
			//printf("%d %d %d\n",i,j,k);
			Ad(an,fn[i][j][k]);
		}
	cout<<an<<'\n';
	return 0;
}

Measured memory_bytes: 331936
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b;
    cin >> a >> b;
    cout << (max(a, b) <= 8 ? "Yay!" : ":(");
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <queue>
#include <stack>
#include <functional>
#include <list>
#include <utility>
#include <map>
#include <vector>
using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll, ll> Pll;
typedef pair<int, Pii > P1;

#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,x) for(int i=1;i<=x;i++)
#define rrep(i,x) for(int i=x-1;i>=0;i--)
#define rrep1(i,x) for(int i=x;i>0;i--)
#define sor(v) sort(v.begin(),v.end())
#define rev(s) reverse(s.begin(),s.end())
#define lb(vec,a) lower_bound(vec.begin(),vec.end(),a)
#define ub(vec,a) upper_bound(vec.begin(),vec.end(),a)
#define mp1(a,b,c) P1(a,P(b,c))
#define get_arsize(a) (sizeof(a)/sizeof(a[0]))
const ll mod = 1000000007;
const double eps = 1e-10;
const int MAX = 200000;

int main() {
	int n,a;
  int min = 1000000000;
	cin >> n;
  vector<int> v;
  rep(i,n) {
    cin >> a;
    v.push_back(a);
    //if (a < min && a > 0) min = a;
  }

  bool flag = true;
  while (min > 1 && flag) {
    flag = false;
    rep(i,n) {
      if (v.at(i) == 0) continue;
      v[i] = v.at(i) % min;
      if (v.at(i) < min && v.at(i) > 0) {
        min = v.at(i);
        flag = true;
      }
    }
  }
  cout << min << endl;
  return 0;
}

Measured memory_bytes: 892
#include<iostream>
using namespace std;
int like[100];
int main()
{
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++)
    {
        int a;cin>>a;
        for(int j=1;j<=a;++j)
        {
            int b;cin>>b;
            ++like[b];
        }
    }
    int ans=0;
    for(int i=1;i<=m;i++)
    {
        if(like[i]==n) ++ans;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<vector>
#include<algorithm>
#include<cmath>
#include<queue>
#include<stack>
#include<functional>
#include<string>
#include<cstring>
using namespace std;
#define LATTE 10000
 
int main(){
    int A[3];
    for(int i=0;i<3;i++) cin>>A[i];
    sort(A,A+3);
    printf("%d %d %d\n",A[0],A[1],A[2]);
    return 0;
}

Measured memory_bytes: 3236
def main():
    n = int(input())
    ans = 0
    for i in range(1, n + 1):
        if i <= 9:
            ans += 1
        elif 100 <= i <= 999:
            ans += 1
        elif 10000 <= i <= 99999:
            ans += 1
        else:
            continue
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#![allow(non_snake_case)]
use proconio::input;
// use std::collections::HashMap;

fn main() {
    input! {
        N: i32,
        K: i32,
        Hs: [i32; N],
    }

    let ans = Hs.iter().filter(|&h| *h >= K).count();
    println!("{}", ans);
}


Measured memory_bytes: 2796
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int x,c=0;
    cin>>x;
    if(x>=500)
    {
        c+=(x/500)*1000;
        x=x%500;
    }
    if(x>=5)
    {
        c+=(x/5)*5;
    }
    cout<<c;
    return 0;
}

Measured memory_bytes: 256
import sys
from itertools import permutations
n, c = [int(i) for i in sys.stdin.readline().split()]
D = dict()
C = dict()
MOD_dict = {i : [0 for j in range(30)] for i in range(3)}
INF = 10 ** 18
for i in range(c):
    inp = [int(i) for i in sys.stdin.readline().split()]
    D[i] = inp
for i in range(n):
    inp = [int(i) - 1 for i in sys.stdin.readline().split()]
    C[i] = inp
    for j, k in enumerate(inp):
        MOD_dict[(i+j) % 3][k] += 1
best = INF
for perm in permutations(range(c), 3):
    cost = 0
    for i in range(c):
        cost += MOD_dict[0][i] * D[i][perm[0]] +  MOD_dict[1][i] * D[i][perm[1]] + \
                MOD_dict[2][i] * D[i][perm[2]]
    best = min(cost, best)
print(best)

Measured memory_bytes: 44252
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <map>

using namespace std;

typedef pair<int, int> P;
typedef pair<int, P> P2;

int main(){
  int n;
  P2 team[11];
  map<int, char> names;
  while(cin >> n, n){
    names.clear();
    for(int i = 0 ; i < n ; i++){
      team[i].first = 0;
      team[i].second.first = 0;
    }
    int cnt = 0;
    char name;
    int op;
    for(int i = 0 ; i < n ; i++){
      cin >> name;
      team[i].second.second = cnt;
      names.insert(make_pair(cnt++, name));
      for(int j = 0 ; j < n-1 ; j++){
	cin >> op;
	if(op == 0) team[i].first++;
	if(op == 1) team[i].second.first++;
      }
    }
    
    for(int i = 0 ; i < n ; i++){
      team[i].first *= -1;
    }
    
    stable_sort(team, team+n);
    //reverse(team, team+n);
    
    for(int i = 0 ; i < n ; i++){
      cout << names[team[i].second.second] << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
#define MAXN	55
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
long long bnt[MAXN], cnt[MAXN];
long long num[MAXN];
long long func(long long x) {
	if (x < 0) return x % 10 + 10;
	else return x % 10;
}
long long work(long long delta, int i) {
	if (i < 0) return delta == 0;
	if (i == 0) return 10 * (delta == 0);
	if (delta % 10 == 0) return cnt[9] * work(delta / 10, i - 2);
	else {
		long long tmp = 10 - func(delta), ans = 0;
		ans += cnt[tmp + 9] * work((delta - tmp * num[i]) / 10, i - 2);
		ans += cnt[tmp - 1] * work((delta - (tmp - 10) * num[i]) / 10, i - 2);
		return ans;
	}
}
int main() {
	long long delta; read(delta);
	long long ans = 0;
	for (int i = 1; i <= 18; i++)
		num[i] = num[i - 1] * 10 + 9;
	for (int i = 0; i <= 9; i++)
	for (int j = 0; j <= 9; j++)
		cnt[i - j + 9]++;
	for (int i = 0; i <= 9; i++)
	for (int j = 1; j <= 9; j++)
		bnt[i - j + 9]++;
	for (int i = 1; i <= 18; i++)
		if (delta % 10 == 0) ans += bnt[9] * work(delta / 10, i - 2);
		else {
			long long tmp = 10 - func(delta);
			ans += bnt[tmp + 9] * work((delta - tmp * num[i]) / 10, i - 2);
			ans += bnt[tmp - 1] * work((delta - (tmp - 10) * num[i]) / 10, i - 2);
		}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <limits.h>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <string>
#include <string.h>
#include <tuple>
#include <vector>

#define REP(i,x) for(int i{ 0 }; i < (int)(x); i++)
#define REPC(i,x) for(int i{ 0 }; i <= (int)(x); i++)
#define RREP(i,x) for(int i{ (int)(x) - 1 }; i >= 0 ;i--)
#define RREPC(i,x) for(int i{ (int)(x)}; i >= 0; i--)
#define REP1O(i,x) for(int i{ 1 }; i < (int)(x); i++)
#define REP1C(i,x) for(int i{ 1 }; i <= (int)(x); i++)
#define REPIT(i,x) for(auto i{(x).begin()}; i != (x).end(); i++) 

#define PB push_back
#define MP make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(),(x).end()

using namespace std;

typedef int64_t ll;
typedef double dbl;
typedef vector<bool> Vb;
typedef vector<char> Vc;
typedef vector<double> Vd;
typedef vector<int> Vi;
typedef vector<ll> Vl;
typedef vector<string> Vs;
typedef vector<vector<int>> VVi;
typedef vector<vector<ll>> VVl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;

template<class T> inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
inline void swap(ll& a, ll& b) { a ^= b; b ^= a; a ^= b; }
inline void swap(int& a, int& b) { a ^= b; b ^= a; a ^= b; }
inline void YES() { cout << "YES" << endl; } inline void Yes() { cout << "Yes" << endl; }
inline void NO() { cout << "NO" << endl; } inline void No() { cout << "No" << endl; }

const int inf = 1 << 30;
const ll linf = 1LL << 60;
const int MOD = 1000000007;

int n;
Vi va, ans, vput;

void init()
{
	cin >> n;
	va.resize(n + 1, 0);
	vput.resize(n + 1, 0);
	REP1C(i, n)
		cin >> va[i];
}

int main()
{
	init();

	for (int i = n; i > 0; --i)
	{
		int cnt = 0;
		for (int j = i * 2; j <= n; j += i)
			cnt ^= vput[j];

		if (va[i] != cnt)
		{
			ans.PB(i);
			vput[i] = 1;
		}
	}

	cout << SZ(ans) << endl;
	REP(i, SZ(ans))
		cout << ans[i] << " ";
	cout << endl;
}


Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <ctype.h>
using namespace std;

int main(void){
	int count = 0;
	string str, W;

	cin >> W;
	
	while (true){
		cin >> str;

		if (str == "END_OF_TEXT") break;
		
		if (!isalpha(str[str.size() -1 ])) str.erase(str.size()-1);
		
		for (int i = 0; i < str.size(); i++){
			if (isupper(str[i]))str[i] = tolower(str[i]);
		}

		if (str == W) count++;
	}

	cout << count << "\n";

	return 0;
}

Measured memory_bytes: 1192
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<string>
#include<string.h>
#include<math.h>
#include<stdlib.h>
#include<vector>
#include<queue>
#include<map>
#include<iomanip>
#define rep(index,num) for(int index=0;index<num;index++)
#define rep1(index,num) for(int index=1;index<=num;index++)
#define scan(argument) cin>>argument
#define prin(argument) cout<<argument<<endl
#define kaigyo cout<<endl
#define eps 1e-7
#define mp(a1,a2) make_pair(a1,a2)
typedef long long ll;
using namespace std;
typedef pair<ll,ll> pll;
typedef pair<int,int> pint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<pint> vpint;
typedef vector<pll> vpll;
ll INFl=1e+18+1;
int INF=1e+9+1;
int main(){
	int N;
	ll K;
	ll A[100001];
	int ketawa[50]={};
	ll ans=0;
	scan(N);
	scan(K);
	rep(i,N){
		scan(A[i]);
		ll tmp=A[i];
		rep(k,INF){
			if(tmp==0) break;
			ketawa[k]+=(tmp&1);
			tmp>>=1;
		}
	}
	for(int i=41;i>=0;i--){
		ll now=((K>>i)<<i);
		for(int k=i-1;k>=0;k--){
			if(ketawa[k]<=N/2&&now+(1LL<<k)<K) now+=(1LL<<k);
		}
		ll nowans=0;
		rep(i,N) nowans+=(now^A[i]);
		ans=max(ans,nowans);
	}
	prin(ans);
	return 0;
}


Measured memory_bytes: 1024
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "\n" : " ");
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N, K;
	cin >> N >> K;

	vector<int> cnt(N);
	for (int i = 0; i < K; i++) {
		int d;
		cin >> d;
		for (int j = 0; j < d; j++) {
			int a;
			cin >> a;
			a--;
			cnt[a]++;

		}
	}

	int ans = 0;
	for (int i = 0; i < N; i++) {
		if (!cnt[i])ans++;
	}

	cout << ans << "\n";

	return 0;
}

Measured memory_bytes: 3644
import java.util.*;
class Main{
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] times = new int[5];
		int min = 123, ans = 0, sum = 0;

		for(int i=0; i<times.length; i++){
			times[i] = sc.nextInt();
			if((times[i]%10<min) && (times[i]%10!=0)){
				min = times[i]%10;
				ans = i;
			}
		}

		for(int i=0; i<times.length; i++){
			int sub = (times[i] / 10 + 1) * 10;
			if((i == ans) || (times[i]%10 == 0)){
				sum += times[i];
			}else{
				sum += sub;
			}
		}
		System.out.println(sum);
		// System.out.println("min = "+ans+"\nsum = "+sum+"\nans = "+ans);
	}
}

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

	public static void main(String[] args) {
	Scanner cin = new Scanner(System.in);
	while(true){
		if(!cin.hasNext()){
			break;
		}
		int ht=0,br=0;
		int[] a=new int[4];
		for(int i=0;i<4;i++){
			a[i]=cin.nextInt();
		}
		int[] b=new int[4];
		for(int i=0;i<4;i++){
			b[i]=cin.nextInt();
		}
		for(int q=0;q<4;q++){
			if(b[q]==a[q]){
				ht=ht+1;
			}
			else{
				for(int n=0;n<4;n++){
					if(b[q]==a[n]){
						br=br+1;
					}
				}
			}
		}
		System.out.println(ht+" "+br);
	}
	
	}

}

Measured memory_bytes: 18120
n, y = map(int, input().split())

for i in range(n+1):
    for j in range(n+1):
        k = n-i-j
        s = i*10000 + j*5000 + k*1000
        if s == y and k >= 0:
            print(i,j,k)
            exit()
print(-1,-1,-1)

Measured memory_bytes: 3060
import sys
from collections import deque

input = sys.stdin.readline


def bfs(G, v, visited):
    visited[v] = True
    queue = deque([v])
    while queue:
        v = queue.popleft()
        for u in G[v]:
            if visited[u]:
                continue
            visited[u] = True
            queue.append(u)


def main():
    N, M = map(int, input().split())
    G = [[] for _ in range(N)]
    a = [0] * M
    b = [0] * M
    for i in range(M):
        u, v = map(int, input().split())
        u -= 1
        v -= 1
        G[u].append(v)
        G[v].append(u)
        a[i] = u
        b[i] = v

    ans = 0
    for i in range(M):
        G[a[i]].remove(b[i])
        G[b[i]].remove(a[i])

        visited = [False] * N
        bfs(G, 0, visited)

        if not all(visited):
            ans += 1

        G[a[i]].append(b[i])
        G[b[i]].append(a[i])

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 3316
#include <iostream>
#include<bits/stdc++.h>
#define int long long int
#define e 1000000007
using namespace std;

 
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
 int t=1;
    // cin>>t;
  while(t--){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int a1 = a*c;
    int a2 = b*d;
    int a3 = a*d;
    int a4 = b*c;


    cout<<max({a1,a2,a3,a4});


  }
}

Measured memory_bytes: 3644
import sys

MOD = 10**9 + 7

def read_int():
    line = sys.stdin.readline().rstrip('\n')
    return int(line)

def read_int_list():
    line = sys.stdin.readline().rstrip('\n')
    return [int(e) for e in line.split(' ')]

def sign(n):
    if n > 0:
        return 1
    if n < 0:
        return -1
    return 0

def prod(A, K, add, remove):
    prod = 1
    for i in range(K):
        if i == remove:
            continue
        prod *= abs(A[i])
        prod %= MOD
    if add != None:
        prod *= abs(A[add])
        prod %= MOD
    return prod

N, K = read_int_list()
A = read_int_list()

A.sort(key=lambda i: -abs(i))

last_plus = None
last_minus = None
sig = 1
for i in range(K):
    sig *= sign(A[i])
    if A[i] > 0:
        last_plus = i
    if A[i] < 0:
        last_minus = i
remove_plus = None
add_plus = None
remove_minus = None
add_minus = None
if sig < 0:
    for i in range(K, N):
        if A[i] > 0 and last_minus != None and remove_minus == None:
            remove_minus = last_minus
            add_minus = i
            sig = 1
        elif A[i] < 0 and last_plus != None and remove_plus == None:
            remove_plus = last_plus
            add_plus = i
            sig = 1
        elif A[i] == 0:
            if sig < 0:
                sig = 0
            break

if sig == 0:
    print(0)
elif sig > 0:
    if remove_plus != None and remove_minus != None:
        if abs(A[remove_plus]*A[add_minus]) > abs(A[remove_minus]*A[add_plus]):
            ap = prod(A, K, add_minus, remove_minus)
        else:
            ap = prod(A, K, add_plus, remove_plus)
    elif remove_plus != None:
        ap = prod(A, K, add_plus, remove_plus)
    else:
        ap = prod(A, K, add_minus, remove_minus)
    print(ap)
else:
    ap = prod(A[::-1], K, None, None)
    print((MOD-ap) % MOD)


Measured memory_bytes: 33244
"use strict";
var input=require("fs").readFileSync("/dev/stdin","utf8");
var cin=input.split(/ |\n/),cid=0;
function next(){return +cin[cid++];}
function nextstr(){return cin[cid++];}
function nextbig(){return BigInt(cin[cid++]);}
function nexts(n,a){return a?cin.slice(cid,cid+=n):cin.slice(cid,cid+=n).map(a=>+a);}
function nextm(h,w,a){var r=[],i=0;if(a)for(;i<h;i++)r.push(cin.slice(cid,cid+=w));else for(;i<h;i++)r.push(cin.slice(cid,cid+=w).map(a=>+a));return r;}
function xArray(v){var a=arguments,l=a.length,r="Array(a["+--l+"]).fill().map(x=>{return "+v+";})";while(--l)r="Array(a["+l+"]).fill().map(x=>"+r+")";return eval(r);}

var myOut = main();
if(myOut !== undefined)console.log(String(myOut));

function main(){
  var s = nextstr(), sl = s.length;
  var t = nextstr(), tl = t.length;
  var a = xArray(0,sl+1);
  var b = xArray(0,tl+1);
  var z = {};
  z["A"] = 1, z["B"] = 2;
  for(var i = 0; i < sl; i++){
    a[i+1] = a[i] + z[s[i]];
  }
  for(var i = 0; i < tl; i++){
    b[i+1] = b[i] + z[t[i]];
  }
  var q = next();
  var ans = xArray("'YES'",q);
  for(var i = 0; i < q; i++){
    var [u,v,w,x] = nexts(4);
    u--, w--;
    var c = (a[v]-a[u]) % 3;
    var d = (b[x]-b[w]) % 3;
    if(c !== d)ans[i] = "NO";
  }
  return ans.join("\n");
}

Measured memory_bytes: 94192
N, A, B = map(int, input().split())
if A == 0:
  print(0)
elif A > N or B == 0:
  print(N)
else:
  M = N // (A + B)
  if N - M * (A + B) > A:
    print(A * M + A)
  else:
    print(N - M * B)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 10;
typedef long long ll;
int a[maxn * 2];
int b[maxn * 2];
int ans[maxn];
int cnt = 0;
int n;

int main()
{
  scanf("%d",&n);
  for(int i = 1; i <= n; i ++)
    scanf("%d",&a[i]);
  for(int i = n; i >= 1; i --){
    int sum = 0;
    for(int j = i + i; j <= n; j += i){
      sum += b[j];
    }
    if(sum % 2 != a[i]){
      b[i] = 1;
      ans[cnt ++] = i;
    }
  }
  printf("%d\n", cnt);
  for(int i = 0; i < cnt; i ++)
    printf("%d%c", ans[i] , i == cnt - 1? '\n' : ' ');
  return 0;
}

Measured memory_bytes: 2816
#include "bits/stdc++.h"
using namespace std;
typedef long long LL;
bool prime[100001];
bool like2017[100001];
int sum[100001];
int main() {
	fill(prime, prime + 100001, 1);
	prime[1] = 0;
	for (int i = 2; i <= 100000; i++) {
		if (!prime[i]) continue;
		for (int j = i * 2; j <= 100000; j += i) prime[j] = 0;
	}
	for (int i = 1; i < 100000; i += 2) {
		if (prime[i] && prime[(i + 1) / 2]) like2017[i] = 1;
	}
	for (int i = 1; i <= 100000; i++) {
		sum[i] = sum[i - 1] + like2017[i];
	}
	int Q;
	cin >> Q;
	for (int i = 0; i < Q; i++) {
		int l, r;
		cin >> l >> r;
		cout << sum[r] - sum[l - 1] << endl;
	}
}

Measured memory_bytes: 1152
A,B,C,X = tuple(int(input()) for i in range(4))
ans = 0
for a in range(51):
    for b in range(51):
        c = (X - 500*a - 100*b) // 50
        if c >= 0 and a <= A and b <= B and c <= C:
            ans += 1
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include<unordered_map>
#define ll long long
#define BUF 50
using namespace std;
ll MOD = 1e9 + 7;
ll A, B, C, D, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
ll ans = 0;

int main() {
	cin >> D >> G;
	ans = 1000;
	vector<int>p(D), c(D);
	for (int i = 0; i < D; i++) {
		cin >> p[i] >> c[i];
	}
	for (int bit = 0; bit < (1 << D); bit++) {
		int sum = 0;
		ll n = 0;
		for (int i = 0; i < D; i++) {
			if (bit&(1 << i)) {
				sum += 100 * (i + 1)*p[i] + c[i];
				n += p[i];
			}
		}
		if (sum < G) {
			bool flag = 0;
			ll cn = n;
			for (int i = 0; i < D; i++) {
				if (!(bit & (1 << i))) {
					ll tmp = ceil(double(G - sum) / (100 * (i + 1)));
					if (tmp < p[i]) { n = cn + tmp; flag++; }
				}
			}
			if (!flag)continue;
		}
		ans = min(ans, n);
	}
	cout << ans << endl;
}


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

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

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<ll,ll> pii;
const int MD = (int)1e9+7;
void dbg(){ cerr << "\n"; }  template <typename T,typename ...T2>
void dbg(const T& fst, const T2&...rst){ cerr << fst << ": "; dbg(rst...); }

ll gcd(ll x, ll y){ return y==0? x: gcd(y, x%y); }

ll f(const vector<ll>& ts, int s){
	ll ans = s? ts[0]: ts[1];
	rep(i,sz(ts)) if(i!=s) ans = gcd(ans, ts[i]);
	return ans;
}


int main(){
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int n;
	cin >>n;
	vector<ll> a(n);
	rep(i, n) cin>>a[i];
	if(n==1){cout << a[0] <<"\n"; return 0;}
	if(n==2){cout << max(a[0], a[1]) <<"\n"; return 0;}
	
	vector<ll> lck(n), rck(n);
	ll lmn=MD, rmn=MD;
	int lpt=-1, rpt=-1;
	rep(i, n){
		if(i==0) lck[i] = a[0];
		else lck[i] = gcd(lck[i-1], a[i]);
		if(lmn > lck[i]){ lmn = lck[i]; lpt=i;}
	}
	repr(i, n-1,0){
		if(i==n-1) rck[i] = a[n-1];
		else rck[i] = gcd(rck[i+1], a[i]);
		if(rmn > rck[i]){ rmn = rck[i]; rpt=i;}
	}
	auto ts =a;
	ll ans =0;

	
	rep2(j, -5, 6){
		ans = max(ans, f(ts, lpt+j));
		ans = max(ans, f(ts, rpt+j));
	}

	cout << ans <<"\n";
	return 0;
}

Measured memory_bytes: 3328
#include<stdio.h>
#include<vector>

#define pb push_back

using namespace std;

struct node{
	vector<int> vec;
};

int main()
{
//	int n = 3;
	int k = 38;
	int n = (k * (k-1)) + 1;
	printf("%d %d\n",n,k);
	
	node nodes[2000];
	for (int i = 1; i <= k; i++)
	{
		nodes[0].vec.pb(i);
	}
	
	for (int i = 0; i < k; i++)
	{
		for (int j = 0; j < k-1; j++)
		{
			nodes[j+(k-1)*i+1].vec.pb(i+1);
		}
	}
	
	int co = k+1;
	for (int i = 1; i < k; i++)
	{
		for (int j = 1; j < k; j++)
		{
			nodes[i].vec.pb(co);
			
//			int idx = 
			for (int l = 0; l < k-1; l++)
			{
//				printf("co %d l %d |i = %d j = %d| %d\n",co,l,i,j,k   +   (k-1)  *  l  +    ((j-1)+l*(i-1))%(k-1));
//				while(arr[])
				nodes[k   +   (k-1)  *  l  +    ((j-1)+l*(i-1))%(k-1)].vec.pb(co);
			}
			
			co++;
		}
	}
	
	for (int i = 0; i < n; i++)
	{
		for (int j = 0; j < nodes[i].vec.size(); j++)
		{
			printf("%d",nodes[i].vec[j]);
			if (j != nodes[i].vec.size()-1) printf(" ");
		}
		printf("\n");
	}
	return 0;
}

Measured memory_bytes: 1144
#include <iostream>
#include <vector>
#include <cstdio>
#include <cstring>
using namespace std;
typedef int intl;
struct query{
    int ini,fin,X;
    void Leer()
    {
        scanf("%d %d %d",&ini,&fin,&X);
    }
};
bool Cumple(query q, int r, int g, int b)
{
    int x = 0;
    if(q.ini<=r && r<=q.fin)
        x++;
    if(q.ini<=b && b<=q.fin)
        x++;
    if(q.ini<=g && g<=q.fin)
        x++;
    return x == q.X;
}
intl MOD = 1e9 + 7;
intl DP[320][320][320]; /// r g b
vector<query> Q[320];
int main()
{
    memset(DP,0,sizeof(DP));
    int N,M;
    cin>>N>>M;
    for(int i = 0;i<M;i++)
    {
        query q;
        q.Leer();
        Q[q.fin].push_back(q);
    }
    DP[1][0][0] = 1;
    DP[0][1][0] = 1;
    DP[0][0][1] = 1;

    intl R = 0;
    for(int i = 1;i<=N;i++)
    {
        for(int g = 0;g<i;g++)
            for(int b = 0;b<i;b++)
            {
                if(b!=g || b == 0 || g == 0)
                {
                    for(auto q : Q[i])
                        if(!Cumple(q,i,g,b))
                            DP[i][g][b] = 0;
 //                   cout<<i<<" - "<<g<<" - "<<g<<" : "<<DP[i][g][b]<<endl;
                    DP[i+1][g][b] = (DP[i+1][g][b] + DP[i][g][b])%MOD;
                    DP[i][i+1][b] = (DP[i][i+1][b] + DP[i][g][b])%MOD;
                    DP[i][g][i+1] = (DP[i][g][i+1] + DP[i][g][b])%MOD;
                    if(i == N)
                        R = (R+DP[i][g][b])%MOD;
                }
            }

        for(int r = 0;r<i;r++)
            for(int b = 0;b<i;b++)
            {
                if(b!=r || r == 0 || b == 0)
                {
                    for(auto q : Q[i])
                        if(!Cumple(q,r,i,b))
                            DP[r][i][b] = 0;
                    DP[i+1][i][b] = (DP[i+1][i][b] + DP[r][i][b])%MOD;
                    DP[r][i+1][b] = (DP[r][i+1][b] + DP[r][i][b])%MOD;
                    DP[r][i][i+1] = (DP[r][i][i+1] + DP[r][i][b])%MOD;
                    if(i == N)
                        R = (R+DP[r][i][b])%MOD;

                }
            }

        for(int r = 0;r<i;r++)
            for(int g = 0;g<i;g++)
            {
                if(g!=r || r == 0 || g == 0)
                {
                    for(auto q : Q[i])
                        if(!Cumple(q,r,g,i))
                            DP[r][g][i] = 0;
                    DP[i+1][g][i] = (DP[i+1][g][i] + DP[r][g][i])%MOD;
                    DP[r][i+1][i] = (DP[r][i+1][i] + DP[r][g][i])%MOD;
                    DP[r][g][i+1] = (DP[r][g][i+1] + DP[r][g][i])%MOD;
                    if(i == N)
                        R = (R+DP[r][g][i])%MOD;

                }
            }
    }
    cout<<R<<endl;
}


Measured memory_bytes: 128384
using System;

class Program
{
    static void Main(string[] args)
    {
        string[] sp = Console.ReadLine().Split(' ');
        float d = int.Parse(sp[0]);
        float t = int.Parse(sp[1]);
        float s = int.Parse(sp[2]);

        if (d / s <= t)
            Console.WriteLine("Yes");
        else
            Console.WriteLine("No");




    }



}




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


int main(){
    int A, B, C;
    cin >>A >> B >> C;

    if( A == B && B == C ){
        cout << "No" << endl;
    }else{
        if( A == B|| B == C || C == A){
            cout << "Yes" << endl;
        }else{
            cout << "No" << endl;
        }    
    }
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    int N,key;
    int R[100];
    int k;
    cin >> N;
    for(int i=0; i<N; i++)
        cin >> R[i];
    for(int i=0; i<N-1; i++)
        cout<<R[i]<<" ";
    cout<<R[N-1]<<endl;
    for(int i=1; i<N; i++)
    {
        key = R[i];
        k = i - 1;
        while(k >=0 && R[k] > key)
        {
            R[k+1] = R[k];
            k--;
        }
        R[k+1] = key;
        for(int i=0; i<N-1; i++)
            cout<<R[i]<<" ";
        cout<<R[N-1]<<endl;
    }

}



Measured memory_bytes: 3104
#include <iostream>
#include <vector>
#include <string>
#include <cctype>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cfloat>
#include <algorithm>
#include <memory>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef unsigned uint;
typedef long double l_double;

#define vtr vector
#define PB push_back
#define EB emplace_back
#define gcd __gcd
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define st_ct static_cast // <>
#define TEST uint _ {}; cin >> _; while (_--)
#define PI (3.1415926535897932384626433832795)
#define MOD st_ct<int>(1e9 + 7)
#define EPS 1e-9
#define deb1(x) cerr << #x << " -> " << x << endl;
#define deb2(x,y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ")" << endl;
#define deb3(x,y,z) cerr << "(" << #x << ", " << #y << ", " << #z << ") -> (" << x << ", " << y << ", " << z << ")" << endl;
#define debVV(V) cerr << #V << ":\n" << V << endl; // 2D

// 1D
template<typename T>
istream& operator>>(istream &is, vector<T> &A) {
    for (T &v: A)
        is >> v;
    return is;
}

template <typename T>
ostream& operator<<(ostream &os, const vector<T> &A) {
    for (T const &v: A)
        os << v << " ";
    return os;
}

template<typename T>
void vtrV(const vector<T> &A)
{ for (T const &val: A) cout << val << endl; }

// 2D
template<typename T>
istream& operator>>(istream &is, vector<vector<T>> &A) {
    for (vector<T> &i: A)
        for (T &j: i)
            is >> j;
    return is;
}

template <typename T>
ostream& operator<<(ostream &os, const vector<vector<T>> &A) {
    for (vector<T> const &i: A) {
        for (T const &j: i)
            os << j << " ";
        os << endl;
    }
    return os;
}

template<typename T>
void vvtrNS(const vector<vector<T>> &A) {
    for (vector<T> const &i: A) {
        for (T const &j: i)
            cout << j;
        cout << endl;
    }
}

template<typename T>
T cntDigits(const T &N) { return (floor(log10(N)) + 1); }

template<typename T>
bool isPowOfTwo(const T &N) { return (N && (!(N&(N-1)))); }

template<typename T>
T lcm(T a, T b) { return ((a*b)/gcd(a, b)); }
/* -------------------------------------------------------- */
/* -------------------------------------------------------- */

//

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // cout.setf(std::ios::boolalpha);
    cout<<std::fixed;
    cout<<std::setprecision(6); // default
    /* -------------------------------- */

    int s {}, w {};
    cin >> s >> w;

    if (s <= w) cout << "unsafe" << endl;
    else cout << "safe" << endl;
    return 0;
}

Measured memory_bytes: 3656
#include<iostream>
#include<string>
using namespace std;
string btn[10]={"",".,!? ","abc","def","ghi","jkl","mno","pqrs","tuv","wxyz"};
typedef pair<int,int> P;
int main(){
	string in;
	for(cin>>in;cin>>in;){
		string res;
		P b=P(0,0);
		for(int i=0;i<(int)in.size();i++){
			if(b.first==0&&in[i]>'0'){
				b.first=in[i]-'0';b.second=0;
			}else if(b.first==in[i]-'0'){
				b.second++;
			}else if(in[i]=='0'&&b.first>0){
				res+=btn[b.first][b.second%btn[b.first].size()];
				b=P(0,0);
			}
		}
		cout<<res<<endl;
	}
	return 0;
}

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

int v[200005], a[200005];

int main(){
	
    int n; cin >> n;
    for(int i = 0; i < n; i++){
        cin >> v[i];
        a[i] = v[i];
    }

    sort(a, a+n);

    int r1 = a[n/2-1], r2 = a[n/2];
    for(int i = 0; i < n; i++){
        if(v[i] < r2) cout << r2 << endl;
        else cout << r1 << endl;
    }
    
	return 0;
}


Measured memory_bytes: 3712
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < (int)(n); i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
using ll = long long;

int main() {
    int N; ll C; cin >> N >> C;
    vector<ll> X(N), V(N);
    REP(i, 0, N) cin >> X[i] >> V[i];


    vector<ll> R(N + 1, 0), Rmax(N + 1, 0); ll prev = 0;
    REP(i, 0, N) {
        R[i + 1] = R[i] + V[i] - (X[i] - prev);
        Rmax[i + 1] = max(R[i + 1], Rmax[i]);
        prev = X[i];
    }

    vector<ll> L(N + 1, 0), Lmax(N + 1, 0); prev = C;
    REP(i, 0, N) {
        L[i + 1] = L[i] + V[N - i - 1] - (prev - X[N - i - 1]);
        Lmax[i + 1] = max(L[i + 1], Lmax[i]);
        prev = X[N - i - 1];
    }

    ll ans = max(Rmax.back(), Lmax.back());
    REP(i, 0, N) {
        ans = max({
            ans,
            R[i + 1] - X[i] + Lmax[N - i - 1],
            L[i + 1] - (C - X[N - i - 1]) + Rmax[N - i - 1],
        });
    }
    cout << ans << endl;

    return 0;
}

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

int main()
{
	string s;
	cin >> s;

	while (true)
	{
		s.pop_back();

		if (s.size() % 2 == 0)
		{
			int l = s.size() / 2;
			if (s.substr(0, l) == s.substr(l, l)) {
				break;
			}
		}
	}
	cout << s.size() << endl;
	return 0;
}


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

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

#define ED return 0;
#define SORT(vec) sort(vec.begin(),vec.end());
#define DOUBLECHANGE(count) cout << setprecision(count);
#define REV(vec) reverse(vec.begin(),vec.end());
#define ipow(x,y) int(pow(x,y))
const long mod = 1000000007;

int main() {
    int R;
    cin >> R;
    if(R > 2799){
        cout << "AGC" << endl;
        ED
    }
    else if(R < 1200){
        cout << "ABC" << endl;
        ED
    }
    cout << "ARC" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    ll a;
    double b;
    cin >> a >> b;
    ll c = b * 100 + 0.1;
    ll ans = a * c / 100;
    cout << ans << endl;
}

Measured memory_bytes: 3708
#include <bits/stdc++.h>
#include <iterator>
#include <tuple>
using namespace std;
using ll = long long;

int main()
{
  string s;
  cin >> s;
  bool flag = true;
  if (s[0] != 'A')
  {
    flag = false;
  }
  else
  {
    int cnt = 0;
    for (int i = 1; i < s.size(); ++i)
    {
      if (i > 1 && i < s.size() - 1)
      {
        if (s[i] == 'C')
          cnt++;
        else
        {
          if (s[i] < 'a' || 'z' < s[i])
          {
            flag = false;
          }
        }
      }
      else if (s[i] < 'a' || 'z' < s[i])
      {
        flag = false;
      }
    }
    if (cnt != 1)
    {
      flag = false;
    }
  }
  cout << (flag ? "AC" : "WA") << endl;

  return 0;
}

Measured memory_bytes: 256
const main = input =>{
    const IN = input.split("\n");
    const N = parseInt(IN[0]);
    const A = IN[1].split(" ");


    var array1 = new Array(N);

    for(var i=0; i<N; i++){

        array1[A[i]- 1] = i + 1;
    }
   // console.log(array1);
  console.log(array1.join(' '));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 34160
y1, y2, y3, y4, a, m1, m2, b, d1, d2 = input()

m1 = int(m1)
m2 = int(m2)

if(m1==1):
    print("TBD")
else:
    if(m2>=5):
        print("TBD")
    else:
        print("Heisei")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define pll pair<ll,ll>
#define fr first
#define se second
#define ull unsigned long long
#define getbit(x,i) (x>>i)&1

void solve(){
    ll n,m,k;cin>>n>>m>>k;
    vector<ll> a(n+1),b(m+1);
    for(ll i=1;i<=n;i++) cin>>a[i];
    for(ll i=1;i<=m;i++) cin>>b[i];
    for(ll i=1;i<=n;i++){
        a[i]+=a[i-1];
    }
    for(ll i=1;i<=m;i++){
        b[i]+=b[i-1];
    }
    ll ans=0,j=m;
    for(ll i=0;i<=n;i++){
        if(a[i]>k) break;
        while(b[j]>k-a[i]){
            j--;
        }
        ans = max(ans,i+j);
    }
    cout<<ans<<endl;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);cout.tie(0);
    ll qu=1;
    // cin>>qu;
    for(ll cas=1;cas<=qu;cas++){
        // cout<<"Case #"<<cas<<": ";
        solve();
    }
}

Measured memory_bytes: 6380
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using V = vector<ll>;
#define _GLIBCXX_DEBUG
#define rep(i, a) for(int i = 0; i < a; i++)
#define ALL(v) v.begin(), v.end()

int main(){
    int n; cin>>n;
    cout<<n/3<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define LL long long
using namespace std;
int Ans,n,A[100005],B[100005];
int Cnt;
bool Mark[100005];
int main() {
	scanf("%d",&n);
	int Min=1e9;
	for(int i=1; i<=n; ++i)scanf("%d",A+i);
	for(int i=n; i>=1; --i) {
		Min=min(Min,A[i]);
		if(Min<A[i]-1)return !puts("No");
	}
	puts("Yes");
}

Measured memory_bytes: 640
line=int(input())
x = list(map(int,input().split()))
max=-10000000
min=10000000
sum=0
for i in range(line):
    if x[i] > max:
        max = x[i]
    if x[i] < min:
        min = x[i]
    sum = sum + x[i]
print(f"{min} {max} {sum}")


Measured memory_bytes: 6600
#include<stdio.h>
#include<string.h>
int main()
{
  int K; char S[110]={0};
  scanf("%d\n",&K);
  scanf("%s",S);
  
  if(strlen(S)<=K){
    printf("%s",S);
  }else{
    for(int i=0;i<K;i++){
      printf("%c",S[i]);
    }
    printf("...");
  }
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    int p_a = 0, p_b = 0;
    for(int i=0; i<n; i++){
        string str_a, str_b;
        cin >> str_a >> str_b;
        if(str_a > str_b) {p_a += 3;}
        else if(str_a==str_b) {
            p_a++;
            p_b++;
        }
        else {p_b += 3;}
    }
    cout << p_a << " " << p_b << endl;
    return 0;
}


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

int main() {
  vector<int> x(3);
  rep(i,0,3) cin >>x[i];

  sort(x.begin(),x.end());

  cout <<(x[0]+x[1]==x[2] ? "Yes":"No") <<endl;
}


Measured memory_bytes: 256
maisu = gets.chomp.to_i
num = gets.chomp.split(" ").map(&:to_i)
num.sort!.reverse!
alice = 0
bob = 0
for i in 0..maisu - 1 do
    if i % 2 == 0
        alice += num[i]
    else
        bob += num[i]
    end
end
puts alice - bob

Measured memory_bytes: 1788