akhauriyash/Code-Regression huggingface dataset:
package main

import (
	"fmt"
	"math"
	"strings"
)

func main() {
	n, k := SInt(), SInt()

	nn := make([]int, 0, n)
	for index := 0; index < n; index++ {
		nn = append(nn, SInt())
	}

	var re int
	for _, item := range nn {
		if item >= k {
			re++
		}
	}
	fmt.Println(re)
}

func SInt() int {
	var n int
	fmt.Scan(&n)
	return n
}

func DInt() (int, int) {
	var n int
	fmt.Scan(&n)

	var m int
	fmt.Scan(&m)
	return n, m
}

func SStr() string {
	var s string
	fmt.Scan(&s)
	return s
}

func SIntSlice(n int) []int {
	re := make([]int, 0, n)
	for i := 0; i < n; i++ {
		re = append(re, SInt())
	}
	return re
}

func StrSlice() []string {
	var s string
	fmt.Scan(&s)
	return strings.Split(s, "")
}

func Min(nums ...int) int {
	if len(nums) == 0 {
		panic("function min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func Max(nums ...int) int {
	if len(nums) == 0 {
		panic("function max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

type Int64Slice []int64

func (p Int64Slice) Len() int           { return len(p) }
func (p Int64Slice) Less(i, j int) bool { return p[i] < p[j] }
func (p Int64Slice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }

type IntSlice []int

func (p IntSlice) Len() int           { return len(p) }
func (p IntSlice) Less(i, j int) bool { return p[i] < p[j] }
func (p IntSlice) Swap(i, j int)      { p[i], p[j] = p[j], p[i] }

// An IntHeap is a min-heap of ints.
type IntHeap []int

func (h IntHeap) Len() int           { return len(h) }
func (h IntHeap) Less(i, j int) bool { return h[i] > h[j] }
func (h IntHeap) Swap(i, j int)      { h[i], h[j] = h[j], h[i] }

func (h *IntHeap) Push(x interface{}) {
	// Push and Pop use pointer receivers because they modify the slice's length,
	// not just its contents.
	*h = append(*h, x.(int))
}

func (h *IntHeap) Pop() interface{} {
	old := *h
	n := len(old)
	x := old[n-1]
	*h = old[0 : n-1]
	return x
}


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

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

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

int par[10000];
int ran[10000];

void init(int n){
	for(int i=0;i<n;i++){
		par[i]=i;
		ran[i]=0;
	}
}

int find(int x){
	if(par[x]==x){
		return x;
	}else{
		return find(par[x]);
	}
}

void unit(int x,int y){
	x=find(x);
	y=find(y);
	if(x==y)return ;
	if(ran[x]<ran[y]){
		par[x]=y;
	}else{
		par[y]=x;
		if(ran[x]==ran[y])ran[x]++;
	}
}

bool same(int x,int y){
	return find(x)==find(y);
}
struct edge{
	int u,v;
	double cost;
};

bool comp(const edge& e1,const edge& e2){
	return e1.cost<e2.cost;
}


edge es[10000];
int V,E;

double kruskal(){
	sort(es,es+E,comp);
	init(V);
	double res=0.0;
	for(int i=0;i<E;i++){
		edge e=es[i];
		if(!same(e.u,e.v)){
			unit(e.u,e.v);
			res+=e.cost;
		}
	}
	return res;
}
double x[1000],y[1000],z[1000],r[1000];
int main(){
	while(1){
		cin>>V;
		if(V==0)break;
		E=V*(V-1)/2;
		REP(i,V){
			cin>>x[i]>>y[i]>>z[i]>>r[i];
		}
		int cc=0;
		for(int i=0;i<V-1;i++){
			for(int j=i+1;j<V;j++){
				double t=sqrt((x[j]-x[i])*(x[j]-x[i])+(y[j]-y[i])*(y[j]-y[i])+(z[j]-z[i])*(z[j]-z[i]))-r[i]-r[j];
				if(t<=0)t=0.0;
				es[cc]=edge{i,j,t};
				cc++;
			}
		}
		printf("%.3f\n",kruskal());
	}
	return 0;
}


Measured memory_bytes: 3288
from __future__ import print_function

from functools import reduce
from operator import mul
from collections import Counter
from collections import deque
from itertools import accumulate
from queue import Queue
from queue import PriorityQueue as pq
from heapq import heapreplace
from heapq import heapify
from heapq import heappushpop
from heapq import heappop
from heapq import heappush
import heapq
import time
import random
import bisect
import itertools
import collections
from fractions import Fraction
import fractions
import string
import math
import operator
import functools
import copy
import array
import re
import sys
sys.setrecursionlimit(500000)


input = sys.stdin.readline


def eprint(*args, **kwargs):
    print(*args, file=sys.stderr, **kwargs)
    return

# from fractions import gcd
# from math import gcd

# def lcm(n, m):
#     return int(n * m / gcd(n, m))


# def coprimize(p, q):
#     common = gcd(p, q)
#     return (p // common, q // common)


# def find_gcd(list_l):
#     x = reduce(gcd, list_l)
#     return x


def combinations_count(n, r):
    r = min(r, n - r)
    numer = reduce(mul, range(n, n - r, -1), 1)
    denom = reduce(mul, range(1, r + 1), 1)
    return numer // denom


def main():
    n, m = map(int, input().strip().split())
    g = [[] for _ in range(n)]
    for i in range(m):
        a_temp,b_temp = map(lambda x: int(x) - 1, input().strip().split())
        g[a_temp].append(b_temp)
        g[b_temp].append(a_temp)
    
    usedlist=[-100 for _ in range(n)]
    Q=Queue()

    #
    Q.put(0)
    usedlist[0] = -1
    while not(Q.empty()):
        u=Q.get()
        for v in g[u]:
            if usedlist[v]==-100:
                usedlist[v] = u # usedlist[u] + 1
                Q.put(v)
            else:
                pass
    eprint('g ',end=':\n')
    eprint(g)
    eprint('usedlist ',end=':\n')
    eprint(usedlist)
    print("Yes")
    for i in range(1,n):
        print( usedlist[i]+1)
    
        

if __name__ == '__main__':
    main()


Measured memory_bytes: 132884
#include <stdio.h>

int main(int argc, const char * argv[])
{
  
    double m, max = 0, min = 10000, sa;
    
    while(scanf("%lf", &m) != EOF) {
        if (m > max) {
            max = m;
        } else if (min > m) {
            min = m;
        }
    }
    
    sa = max - min;
    
    printf("%.1lf\n", sa);
    
    return 0;
}

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

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

Measured memory_bytes: 3632
#include <stdio.h>



int main()
{
  int h,a,b,c;
  scanf("%d%d",&h,&a);
  if(h<=a){
    printf("1");
  }
  else if(h>a){
  b=h/a;
  c=h%a;
  if(c!=0)
  b++;
  printf("%d\n",b);
  }
  return 0;
}

Measured memory_bytes: 128
// -*- mode:c++; coding:utf-8; c-basic-offset:2; -*-
// ALDS1_5-C: Koch Curve

#include <cstdio>
#include <cmath>

struct Point {
  const double x, y;
  Point(double x, double y) : x(x), y(y) { }
  Point rotate(double degree) const;
};

Point Point::rotate(double degree) const
{
  auto sin = std::sin(M_PI*degree/180.0);
  auto cos = std::cos(M_PI*degree/180.0);
  return Point(x*cos - y*sin, x*sin + y*cos);
}

Point operator +(const Point& a, const Point& b) { return Point(a.x+b.x, a.y+b.y); }
Point operator -(const Point& a, const Point& b) { return Point(a.x-b.x, a.y-b.y); }
Point operator *(const double a, const Point& b) { return Point(a*b.x, a*b.y); }
Point operator /(const Point& a, const double b) { return Point(a.x/b, a.y/b); }

void print_point(const Point& p) { std::printf("%.8f %.8f\n", p.x, p.y); }

void print_koch(unsigned int n, const Point& a, const Point& b)
{
  if (n == 0) return;

  Point s = (2.0*a + 1.0*b)/3.0;
  Point t = (1.0*a + 2.0*b)/3.0;
  Point u = (t-s).rotate(60) + s;

  print_koch(n-1, a, s); print_point(s);
  print_koch(n-1, s, u); print_point(u);
  print_koch(n-1, u, t); print_point(t);
  print_koch(n-1, t, b);
}

int main()
{
  unsigned int n;
  std::scanf("%d", &n);

  auto a = Point(0.0, 0.0);
  auto b = Point(100.0, 0.0);

  print_point(a);
  print_koch(n, a, b);
  print_point(b);
}

// eof

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

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<map>
#include<set>
#include<iomanip>

using namespace std;
using ll = long long;

const int MOD = 1e9 + 7;
const int INF = numeric_limits<int>::max();
const ll LLINF = numeric_limits<ll>::max();
const double PI = acos(-1.0);

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

int main() {
    int x, y, z; cin >> x >> y >> z;

    cout << x * y / 2 << endl;
    return 0;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
XYZ = []
for _ in range(N):
    x, y, z = map(int, input().split())
    XYZ.append((x, y, z))

ans = 0
for sx in (1, -1):
    for sy in (1, -1):
        for sz in (1, -1):
            arr = [sx * x + sy * y + sz * z for x, y, z in XYZ]
            arr.sort(reverse=True)
            ans = max(ans, sum(arr[:M]))
print(ans)


Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vec;
typedef vector<vec> mat;

void pr(mat a){
  int h=a.size(),w=a[0].size();
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cout<<a[i][j];
    }
    cout<<endl;
  }
  cout<<endl;
}


mat cut(mat a){
  
  int h=a.size(),w=a[0].size();
  int ay=1e9,ax=1e9,by=0,bx=0;
  for(int i=0;i<h;i++)
    for(int j=0;j<w;j++)
      if(a[i][j]!=0){
        ay=min(ay,i);
        ax=min(ax,j);
        by=max(by,i);
        bx=max(bx,j);
      }
  
  mat res=mat(by-ay+1,vec(bx-ax+1));
  for(int y=ay;y<=by;y++)
    for(int x=ax;x<=bx;x++)
      res[y-ay][x-ax]=a[y][x];
  return res;
}


int main(){
  int Tc;cin>>Tc;
  cin.ignore();
  while(Tc--){

    int F;
    string s;
    getline(cin,s);
    
    F=s.size()+2;
    int py=F,px=F;
    mat A(F+F,vec(F+F,0));
    A[py][px]=1;
    for(int i=0;i<(int)s.size();i++){
      if(s[i]=='a')px++;
      if(s[i]=='b')py--;
      if(s[i]=='c')py--,px--;
      if(s[i]=='d')px--;
      if(s[i]=='e')py++;
      if(s[i]=='f')py++,px++;
      A[py][px]=1;
    }
    A=cut(A);

    getline(cin,s);
    bool ans=false;
    for(int T=0;T<6;T++){
      F=s.size()+2;
      mat B(F+F,vec(F+F,0));
      py=F,px=F;
      B[py][px]=1;
              
      for(int i=0;i<(int)s.size();i++){
        if(s[i]=='a')px++,s[i]='b';
        else if(s[i]=='b')py--,s[i]='c';
        else if(s[i]=='c')py--,px--,s[i]='d';
        else if(s[i]=='d')px--,s[i]='e';
        else if(s[i]=='e')py++,s[i]='f';
        else if(s[i]=='f')py++,px++,s[i]='a';
        B[py][px]=1;
      }

      B=cut(B);
      if(A==B)ans=true;
    }
    cout<< (ans?"true":"false") <<endl;
    string tmp;
    getline(cin,tmp);
    assert(tmp=="-");

  }
  return 0;
}

Measured memory_bytes: 1532
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
   string a,b;
   cin>>a>>b;
   ll ans=INT_MAX;
   for(int i=0;i+b.size()-1<a.size();i++)
   {
       ll cnt=0;
       for(int j=0;j<b.size();j++)
       {
           if(a[i+j]!=b[j])
           {
               cnt++;
           }

       }
       ans = min(ans,cnt);
   }
   cout<<ans<<endl;
}


Measured memory_bytes: 3524
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    string s;
    cin >> s;
    ll n = s.size();

    cout << s[0] << n-2 << s[n-1];
    re0;
}

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



int main (void){
  int n,m,k;
  cin >> n >> m;
  vector <int> p(m+5);
  vector <vector<int>> suichi(m+5);

  rep(i,m){
      cin >> k;
      rep(j,k){
          int s;
          cin >> s;
          suichi[i].push_back(s);
        }
    }

  rep(i,m){
      cin >> p[i];
  }

  ll sum=0;
  for(int bit =0;bit<(1<<n);bit++){
      bool ok=true;


        for(int i=0;i<m;i++){
            ll count=0;

            for(auto v:suichi[i]){

              if(bit&(1<<(v-1))){
                  count++;
                }
            }


            if(count%2!=p[i]){
                  ok=false;
            }
        
        }

        if(ok){
            sum++;
        }
    } 


    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 256
def main():
    import sys
    input = sys.stdin.readline
    
    n = int(input())
    arr = list(map(int, input().split()))
    b = list(map(int, input().split()))
    
    ans = 0
    for i in range(n):
        if arr[i] <= b[i]:
            ans += arr[i]
            b[i] -= arr[i]
            if arr[i + 1] <= b[i]:
                ans += arr[i + 1]
                arr[i + 1] = 0
            else:
                ans += b[i]
                arr[i + 1] -= b[i]
        else:
            ans += b[i] 
    
    print(ans)
    
    return 0

main()

Measured memory_bytes: 19376
# -*- coding: utf-8 -*-

N = int(input().strip())
#-----

ans = ""

while N > 0:
    digit_int = (N-1) % 26
    digit_str = chr( ord("a")  + digit_int )

    ans += digit_str
    N = (N-1) // 26

print(ans[::-1])


Measured memory_bytes: 9076
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
const long double PI=(acos(-1));
using namespace std;
typedef long long ll;

int maxtime(int x){
  return (x+9)/10*10;
}
int remtime(int x){
  return maxtime(x)-x;
}
int main(){
  int a,b,c,d,e;
  cin>>a>>b>>c>>d>>e;
  int sum=maxtime(a)+maxtime(b)+maxtime(c)+maxtime(d)+maxtime(e);
  sum-=max({remtime(a),remtime(b),remtime(c),remtime(d),remtime(e)});
  cout<<sum<<endl;
}

Measured memory_bytes: 256
s = input()
t = "AKIHABARA"
idx = 0
ok = 1
for i in range(len(s)):
    if idx == len(t):
        ok = 0
        break
    if s[i] == t[idx]:
        idx += 1
    elif s[i] != 'A' and t[idx] == 'A':
        idx += 1
        if idx < len(t) and s[i] == t[idx]:
            idx += 1
        else:
            ok = 0
    else:
        ok = 0
if idx != len(t) and idx != len(t)-1:
    ok = 0
print("YES"*ok or "NO")


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

using namespace std;
#define REP(i, n) for(int i=0; i < (int)(n); ++i)
#define REPR(i, n) for(int i=n; i>= 0; --i)
#define FOR(i, m, n) for(int i=m; i<(n); ++i)

using ll = long long;

int main(){
    int N,x;
    cin >> N >> x;
    vector<int> a(N);
    REP(i, N){
        cin >> a[i];
    }

    ll ans = 0;
    FOR(i, 1, N){
        if(a[i-1] + a[i] > x){
            ll diff = (a[i-1] + a[i])-x;
            ans +=diff;
            if(diff <= a[i]){
                a[i] -= diff;
            }
            else{
                a[i]=0;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

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

void pri(int x){
    if(x == 1){
        cout << 9;
    }
    else if(x == 9){
        cout << 1;
    }
}

int main(){
    int n;
    cin >> n;
    
    int a = n / 100;
    int b = n % 100 / 10;
    int c = n % 10;

    pri(a);
    pri(b);
    pri(c);
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>

const int maxn = 1000;
char buf[maxn];

int main() {
    scanf("%s", buf);
    int len = strlen(buf);
    bool hasC = false, y = false;
    for (int i = 0; i < len; i++) {
        if (buf[i] == 'C') hasC = true;
        else if (hasC && buf[i] == 'F') {
            y = true;
            break;
        }
    }
    puts(y ? "Yes" : "No");
    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <set>
using namespace std;
int main(void){
  int n,p;
  while(cin>>n,n){
    set<int> a;
    while(n--){
      cin>>p;
      a.insert(p);
    }
    for(set<int>::iterator it=a.begin();it!=a.end();++it){
      int back,f=0;
      cout<<*it;
      do{
      	back=*it;
      	++it;++f;
     	}while(*it==back+1);
     	if(f>1)cout<<"-"<<back<<((it==a.end())?"\n":" ");
     	else cout<<((it==a.end())?"\n":" ");
     	--it;
    }
  }
  return 0;
}

Measured memory_bytes: 1192
import sys
sys.setrecursionlimit(10**9)
input = sys.stdin.readline
MOD = 10**9+7

S = input()[:-1]
#dp[文字列をしたの桁からI番目まで見て][あまりがjになる数] = のこすう
dp = [[0]*13 for _ in range(len(S)+1)]
dp[0][0] = 1

# 文字列を逆順から見ていく
S = list(reversed(S))
for i in range(len(S)):
    if S[i] == "?":
        dig = pow(10, i, 13)
        # ?だと新しく追加する数を10通り試す
        for k in range(10):  # 新しく追加する数
            for j in range(13):  # 各あまりからの遷移
                dp[i+1][(k*dig+j) % 13] += dp[i][j]
                dp[i+1][(k*dig+j) % 13] %= MOD
    else:
        dig = pow(10, i, 13)
        #dig = 10**i
        for j in range(13):
            dp[i+1][(int(S[i])*dig+j) % 13] += dp[i][j]
            dp[i+1][(int(S[i])*dig+j) % 13] %= MOD

print(dp[-1][5])


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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template <typename T1, typename T2> 
inline bool chmax(T1 &a, T2 b) {
  return a < b && (a = b, true);
}

template <typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {
  return a > b && (a = b, true);
}

int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  VLL a(n);
  rep(i, n) cin >> a[i];
  VLL f;
  VLL s;
  map<ll, ll> fmap;
  map<ll, ll> smap;

  rep(i, n) {
    if(i%2==0) {
      f.push_back(a[i]);
      fmap[a[i]]++;
    } else{
      s.push_back(a[i]);
      smap[a[i]]++;
    }
  }
  vector<pair<ll, ll>> ss;
  vector<pair<ll, ll>> ff;
  rep(i, n / 2) ff.push_back(PLL(fmap[f[i]], f[i]));
  rep(i, n / 2) ss.push_back(PLL(smap[s[i]] ,s[i]));
  sort( all(ff) , greater<>() );
  sort( all(ss) , greater<>() );

  ff.erase(unique(ff.begin(), ff.end()), ff.end());
  ss.erase(unique(ss.begin(), ss.end()), ss.end());

  if(ff[0].second != ss[0].second){
    cout << n - (ff[0].first + ss[0].first) << endl;
  }else{
    ll tmp = max(ff[0].first, ss[0].first);
    
    if (ff.size() > 1) chmax(tmp, ff[1].first + ss[0].first);
    if(ss.size() > 1)chmax(tmp, ff[0].first + ss[1].first);
    cout << n - tmp << endl;
  }
  return 0;
}


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

int main()
{
  int a, b, c;
  cin >> a >> b >> c;
  if(a+b+c>=22)
    cout << "bust";
  else
  {
    cout << "win";
  }

}


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

sn = []
for i in range(n):
    sn.append(input())
    
import collections
c = collections.Counter(sn)

max = c.most_common()[0][1]

keys = [k for k, v in c.items() if v == max]

keys.sort()
for k in keys:
    print(k)

Measured memory_bytes: 45072
//ノードが持つ情報→子のノードの情報
//ノードが子を持たないときはからのvectorを保持する
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<algorithm>

using namespace std;

//このようにクラスやストラクトなどで一括で管理してしまえば良い
class Node{//普通の木用のデータ
//ノードはポインタでもっておこう
public:
  ///ノードの番号
  int num;
  //そのノードの親
  Node* p;
  //そのノードの子
  vector<Node*> v;
  //そのノードの発見時刻と完了時刻(これは分けて配列の方がいいかもしれない)
  //int d=0;int f=0;
};

//木じゃないのでrootがあるわけじゃない(重要)

//見つからなかったら-1
//非連結な場合もあるので
int find_next_root(vector<int> va){
  int l= int(va.size());
  for(int i=0;i<l;i++){
    if(va[i]==0){return i;}
  }
  return -1;
}


//Nは始まりのNode
//tはmainで管理しするので
void depth_search(Node& N,int& t,vector<int>& va,vector<int>& vf){
  //呼ばれた前の時点での時間が与えられる
  //子を全部見終わったら、そのノードも足し算してそこで終了する
  t++;
  va[N.num]=t;
  int l=N.v.size();
  for(int i=0;i<l;i++){
    if(va[N.v[i]->num]==0) depth_search(*(N.v[i]),t,va,vf);
  }
  t++;
  vf[N.num]=t;
}


int main(){
  int n;cin>>n;
  vector<Node> V(n);for(int i=0;i<n;i++){V[i].num=i;}
  vector<int> Va(n,0);vector<int> Vf(n,0);

  for(int i=0;i<n;i++){
    int k;cin >> k >> k;
    for(int j=0;j<k;j++){
      int l;cin >>l;l-=1;
      V[l].p=&V[i];
      V[i].v.push_back(&V[l]);
    }
  }
  //初めは一つのグラフだと思ってたけど非連結な場合もある
  int t=0;
  int x=0;
  while(x!=-1){
    depth_search(V[x],t,Va,Vf);
    x=find_next_root(Va);
  }
  for(int i=0;i<n;i++){
    cout << i+1 << " " << Va[i] << " " << Vf[i] << endl;
  }
}



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

#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ALL(a) (a).begin(),(a).end()
#define Yes(hoge) cout<<((hoge)?"Yes":"No")<<endl;
#define YES(hoge) cout<<((hoge)?"YES":"NO")<<endl;
using namespace std;
const int MAX_V=310;
ll d[MAX_V][MAX_V];
ll V;
void warshall_floyd(){
  for(int k=0;k<V;k++)
    for(int i=0;i<V;i++)
      for(int j=0;j<V;j++)
	d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
}
ll cnt=0;
bool flag=false;
void warshall_floyd2(){
  for(int k=0;k<V;k++)
    for(int i=0;i<V;i++)
      for(int j=i+1;j<V;j++){
	if(d[i][j]!=llINF&&d[i][j] == d[i][k]+d[k][j]&&i<j&&i!=k&&j!=k){
	  //cout<<d[i][j]<<endl;
	  flag=true;
	  cnt+=d[i][j];
	  //cout<<d[i][j]<<endl;
	  d[i][j]=llINF;
	}
      }
	
}
int main(){
  cin>>V;
  ll ori[MAX_V][MAX_V]={}; 
  for(int i=0;i<V;i++)
    for(int j=0;j<V;j++){
      cin>>d[i][j];
      ori[i][j]=d[i][j];
    }
  warshall_floyd();
  bool flag=false;
  for(int i=0;i<V;i++){
    for(int j=0;j<V;j++){
      if(ori[i][j]!=d[i][j]){
	flag=true;
	break;
      }
    }
    if(flag)break;
  }
  if(flag){
    cout<<-1<<endl;
    return 0;
  }
  while(1){
    warshall_floyd2();
    if(!flag)break;
    flag=true;
  }
  ll ans=0;
  for(int i=0;i<V;i++){
    for(int j=i+1;j<V;j++){
      if(d[i][j]!=llINF)
	ans+=d[i][j];
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 1664
#include <iostream>

using namespace std;

int main(){
 int A,B,keta[5],answer = 0;
 cin >> A >> B;
 
 for (int i = A; i <= B ; i++){
   keta[0] = i/10000;
   keta[1] = (i - keta[0]*10000)/1000;
   keta[2] = (i - keta[0]*10000 - keta[1]*1000)/100;
   keta[3] = (i - keta[0]*10000 - keta[1]*1000 - keta[2]*100)/10;
   keta[4] = i - keta[0]*10000 - keta[1]*1000 - keta[2]*100 - keta[3]*10;
 if (keta[0] == keta[4] && keta[1] == keta[3]){
  answer ++;
 }
}
cout << answer <<endl;
}

Measured memory_bytes: 256
# https://atcoder.jp/contests/dwacon5th-prelims/tasks/dwacon5th_prelims_b
# 解説見てしまった
# N≤1000の性質をうまく使う必要はない。O(N^2)で全部書き出せばいい。完全に引っ掛け。
# 答えの仮定、bitごとに見る、上位桁からのgreedyらへんがキーワード

from itertools import combinations
N, K = map(int, input().split())
A = list(map(int, input().split()))
B = [sum(A[s:t]) for s, t in combinations(range(N + 1), 2)]

l = max(B).bit_length()  # 何桁扱えば十分か？
x = 0  # 初期値
for i in range(l, -1, -1):  # 上位桁からgreedyに決定
    # 候補のうち i bit目=1がK個以上あれば答えに計上できる
    x_tmp = x + (1 << i)
    if sum((x_tmp & b) == x_tmp for b in B) >= K:  # 確定した桁+i桁を1としたときに答えになり得るか？
        x = x_tmp
print(x)


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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define MOD 1000000007

typedef long long int ll;

const ll INF=(ll)1e18;
//const int INF=(1<<30);

void print_lcs(string &s, string &t, vector<vector<int>> &dp, int i, int j){
  if(i==-1 || j==-1)return;

  if(s[i] == t[j]){
    print_lcs(s,t,dp,i-1,j-1);
    cout << s[i];
  }else if(dp[i+1][j] > dp[i][j+1]){
    print_lcs(s,t,dp,i,j-1);
  }else{
    print_lcs(s,t,dp,i-1,j);
  }
}

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

  vector<vector<int>> dp(s.size()+1, vector<int>(t.size()+1, 0));

  REP(i,s.size())REP(j,t.size()){
    if(s[i]==t[j]){
      dp[i+1][j+1] = dp[i][j]+1;
    }else{
      dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
    }
  }

  print_lcs(s,t,dp,s.size()-1,t.size()-1);
  cout << endl;
}



Measured memory_bytes: 35840
#include<cstdio>

using ll=long long;

int main(void)
{
	ll x, y;

	while(scanf("%lld%lld", &x, &y)==2)
	{
		int i;
		for(i=0;(x<<i)<=y;i++)
			;
		printf("%d\n", i);
	}

	return 0;
}


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

#define long long long

using namespace std;

long f(long x) 
{
    if (x <= 0) return 0;
    return min(x, 2 + f((x - 2) / 3) + (x - 2) % 3);
}

int main()
{
    long x;
    cin >> x;
    cout << f(x + 1) - 1 << '\n';
    return 0;
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
  
using namespace std;
 
#define endl "\n"
#define JAM(x) cout<< #x <<" = "<<x<<"\n"
#define II() ( { int a ; read(a) ; a; } )
#define LL() ( { ll a ; read(a) ; a; } )
#define DD() ({double a; scanf("%lf", &a); a;})
 
 
//Fast Reader
template<class T>inline bool read(T &x){
    int c=getchar();int sgn=1;
    while(~c&&c<'0'||c>'9'){if(c=='-')sgn=-1;c=getchar();}
    for(x=0;~c&&'0'<=c&&c<='9';c=getchar())x=x*10+c-'0'; 
    x*=sgn; return ~c;
}
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
typedef vector<PII> VPI;
 
const int INF=2e9;
const int MX=100005;
const int MOD=1000000007;
const double PI=acos(-1.0);




long long int power(long long int a,long long int b)
{
    a %= MOD;
    long long int res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        b >>= 1;
    }
    return res;
}
bool isprime(int n)
{
    if(n==1)
    return 0;
    int i;
    for(i=2;i*i<=n;i++)
    {
        if(n%i==0)
        return false;
    }
    return true;
}



/*_______________________________________________*/





int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s,t;
    cin>>s>>t;
    int i,j,n,m;
    n=s.length();
    m=t.length();
    int ans=INT_MAX;
    int count=0;
    for(i=0;i<=n-m;i++)
    {
        string temp=s.substr(i,m);
        count=0;
        for(j=0;j<m;j++)
        {
            if(temp[j]!=t[j])
            count++;
        }
        ans=min(ans,count);
    }
    cout<<ans;
}


Measured memory_bytes: 3660
import math
a,b,x=map(int,input().split())
v=a*a*b
if v <= 2*x:
    b1=(v-x)/a*2/a
    c=math.sqrt(a**2+b1**2)
    print(math.degrees(math.acos(a/c)))
else:
    a1=((x/a)*2)/b
    c=math.sqrt(a1**2+b**2)
    print(math.degrees(math.asin(b/c)))


Measured memory_bytes: 38384
# 153b

def atc_153b(a: str, b: str) -> str:
    HN = a.split(" ")
    H = int(HN[0])
    N = int(HN[1])

    A = b.split(" ")
    A_int = [int(ai) for ai in A]
    damage = sum(A_int)

    if (H - damage) <= 0:
        return "Yes"
    else:
        return "No"


a = input()
b = input()
print(atc_153b(a, b))


Measured memory_bytes: 21128
import heapq
n,m=map(int,input().split())
A=list(map(lambda x:int(x)*-1,input().split()))
heapq.heapify(A)
for k in range(m):
    a=heapq.heappop(A)
    heapq.heappush(A, -1*(-a//2))
print((sum(A))*-1)

Measured memory_bytes: 14180
#pragma GCC optimize("Ofast",3,"inline")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, (n) + 1)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1e9+7;
int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> w(m + 1, vector<int>());
    int a, b;
    REP(i, n) {
        cin >> a >> b;
        if (a > m) continue;
        w[a].push_back(b);
    }
    ll t = 0;
    priority_queue<int> q;
    REP1(i, m) {
        for (int x:w[i]) {
            q.push(x);
        }
        if (q.size()) {
            t+=q.top(); 
			q.pop();
        }
    }
    cout<<t; 
      return 0;
}


Measured memory_bytes: 5504
/*
        HELLO WORLD
        -----------
        SHUBHAM
        -----------
        :) CODING
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define ff                                         first
#define ss                                         second
#define pb                                         push_back
//#define int                                        long long
#define mp                                         make_pair
#define pii                                        pair<int,int>
#define vi                                         vector<int>
#define mii                                        map<int,int>
#define umii                                       unordered_map<int,int>
#define pqb                                        priority_queue<int>
#define pqs                                        priority_queue<int,vi,greater<int>>
#define setbits(x)                                 __builtin_popcountll(x)
#define zerobits(x)                                 __builtin_ctzll(x)
#define mod                                        1000000007
#define inf                                        1e18
#define ps(x,y)                                    fixed<<setprecision(y)<<x
#define mk(arr,n,type)                             type *arr=new type[n]
#define test(t)                                    int t;cin>>t;while(t--)
#define rep(i,n)                                   for(int i=0;i<n;i++)
#define rep1(i,n)                                  for(int i=1;i<=n;i++)
#define fio                                        ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define SIZE                                       100001
#define all(x)                                     (x).begin(),(x).end()
#define sclk()                                     auto start_time = Clock::now()
#define eclk()                                     auto end_time = Clock::now();  cout << "\nTime Taken : " << chrono::duration_cast<chrono::milliseconds>(end_time    - start_time).count() << " ms"
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef std::chrono::high_resolution_clock Clock;

int powmod(int a,int b) {int res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
int gcd(int a,int b) { return b?gcd(b,a%b):a;}

void f_io()
{
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif // ONLINE_JUDGE
}
double dp[3001][3001];
double arr[3001];
double solve(int n,int x)
{
    if(x<=0)
        return 1;
    if(n==0)
        return 0;
    if(dp[n][x] > -0.9)
    {
        return dp[n][x];
    }
    return dp[n][x]=arr[n]*solve(n-1,x-1)+(1-arr[n])*solve(n-1,x);
}
int32_t main()
{
    {
        memset(dp,-1,sizeof(dp));
        int n;
        cin>>n;
        rep(i,n)
        cin>>arr[i+1];
        double ans=solve(n,(n+1)/2);
        cout<<ps(ans,11);
    }
    return 0;
}


Measured memory_bytes: 70784
/**
 * C - Bridge
 * https://atcoder.jp/contests/abc075/tasks/abc075_c
 **/
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<numeric>
#include<functional>
#include<sstream>
#include<iomanip>
#include<queue>

using namespace std;

typedef pair<int, int> edge;

bool is_reach(int a, int b, vector<vector<int>> nodes) {
    // a => b のルートがあるか探索する
    queue<int> que;
    for(auto ai:nodes[a]) {
        if(ai==b) continue;
        que.push(ai);
    }
    vector<int> visited;
    visited.push_back(a);
    while(!que.empty()) {
        int n = que.front();
        que.pop();
        if(n==b) return true;
        for(auto i:nodes[n]) {
            if(count(visited.begin(), visited.end(), i)>0) continue;
            que.push(i);
            visited.push_back(i);
        }
    }
    return false;
}

int main() {
    int n, m; cin >> n >> m;
    vector<edge> edges(m);
    vector<vector<int>> nodes(n+1);
    for(int i=0; i<m; i++) {
        int ai, bi; cin >> ai >> bi;
        edges[i] = make_pair(ai, bi);
        nodes[ai].push_back(bi);
        nodes[bi].push_back(ai);
    }
    int ans = 0;
    for(auto e:edges) {
        if(!is_reach(e.first, e.second, nodes)) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner scanner = new Scanner(System.in);
        
        int input = scanner.nextInt();

        String ans = "No";
        for(;;){
            if(input == 0) break;
            
            int a = input % 10;
            input = input / 10;
            
            if(a == 7){
                ans = "Yes" ;
                break;
            }
        }
        
        System.out.println(ans);

    }
}


Measured memory_bytes: 35668
#include <stdio.h>

int main(){
int a,b,c,max;
scanf("%d %d %d",&a,&b,&c);
	if(a > b && a > c){
		max = a;
		a = 0;}
	else if(b >= a && b > c){
		max = b;
		b = 0;}
	else{
		max = c;
		c = 0;}
	printf("%d",a + b + c + max * 10);

return 0;
}

Measured memory_bytes: 128
#include<cstdio>

const int go[8][2] = {-1, -1, -1, 0, -1, 1, 0, -1, 0, 1, 1, -1, 1, 0, 1, 1};

int n, m;
char s[111][111];

int main() {
	scanf("%d%d", &n, &m);
	for(int i=0;i<n;i++)
		scanf("%s", s[i]);
	for(int i=0;i<n;i++)
		for(int j=0;j<m;j++)
			if (s[i][j]=='.') {
				int v=0;
				for(int k=0;k<8;k++) {
					int x = i+go[k][0], y = j+go[k][1];
					if (x<0||x>=n||y<0||y>=m) continue;
					if (s[x][y]=='#') v++;
				}
				s[i][j] = v+'0';
			}
	for(int i=0;i<n;i++)
		printf("%s\n", s[i]);
	
	return 0;
}

Measured memory_bytes: 128
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;

public class Main {

	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
		BufferedReader in = new BufferedReader(reader);
		String[] tokens = in.readLine().split(" ");
		int A = Integer.parseInt(tokens[0]);
		int B = Integer.parseInt(tokens[1]);
		int T = Integer.parseInt(tokens[2]);

		in.close();

		double t = (double) T + 0.5;
		int result = (int) Math.floor(t / (double) A);
		System.out.println(result * B);
	}

}


Measured memory_bytes: 21076
#include <bits/stdc++.h>
//#define int long long

using namespace std;
using LL = long long;
using P = pair<int, int>;
using Tapris = tuple<int, int, int>;

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

#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

const int INF = (int)1e9;
const LL INFL = (LL)1e15;
const int MOD = 1e9 + 7;

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

template <typename Monoid>
class SegmentTree{
    private:
        using Func = function<Monoid(Monoid, Monoid)>;
        int n; // 最下段の数
        vector<Monoid> segmentTree; // セグ木本体
        const Func f; // 二項演算
        const Monoid identityElement; // モノイドの単位元

    public:
        SegmentTree(vector<Monoid> vec, const Func f, const Monoid identityElement);
        void Update(int x, Monoid val);
        Monoid Query(int a, int b, int k = 0, int l = 0, int r = -1); // 使う時は区間[a, b)のみ指定すれば良い
        void Print(){
            REP(i, segmentTree.size()) cout << segmentTree[i] << " ";
            cout << endl;
        }
};

template <typename Monoid>
SegmentTree<Monoid>::SegmentTree(vector<Monoid> vec, const Func f, const Monoid identityElement) :
    f(f), identityElement(identityElement)
{
    int sz = vec.size();
    n = 1;
    while(n < sz) n *= 2;
    segmentTree.assign(2*n-1, identityElement);
    for(int i = 0; i < sz; i++) segmentTree[i+n-1] = vec[i];
    for(int i = n-2; i >= 0; i--) segmentTree[i] = f(segmentTree[2*i+1], segmentTree[2*i+2]);
}

template <typename Monoid>
void SegmentTree<Monoid>::Update(int x, Monoid val){
    x += n - 1;
    segmentTree[x] += val;
    while(x > 0){
        x = (x - 1) / 2;
        segmentTree[x] = f(segmentTree[2*x+1], segmentTree[2*x+2]);
    }
}

template <typename Monoid>
Monoid SegmentTree<Monoid>::Query(int a, int b, int k, int l, int r){
    if(r < 0) r = n;

    if(r <= a || b <= l) return identityElement;

    if(a <= l && r <= b) return segmentTree[k];

    int vl = Query(a, b, 2*k+1, l, (l+r)/2);
    int vr = Query(a, b, 2*k+2, (l+r)/2, r);
    return f(vl, vr);
}

/*************** using variables ***************/
int n, q;
/**********************************************/

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

    cin >> n >> q;
    vector<int> a(n, 0);
    SegmentTree<int> st(a, [](int a, int b){return a + b;}, 0);
    REP(i, q){
        int comp, x, y;
        cin >> comp >> x >> y;
        if(comp == 0) st.Update(x-1, y);
        else cout << st.Query(x-1, y) << endl;
    }
}



Measured memory_bytes: 4676
#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>
#include <set>
#include <map>
#include <iomanip>
#include <cassert>
#include <functional>
#include <cstring>

using namespace std;

#define mp make_pair
#define FOR(i, a, b) for(int (i)=a;(i)<(b);++(i))
#define rep(i, n)  FOR(i,0,n)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort((v).begin(), (v).end());					//小さい順
#define rvsort(v) sort(v.begin(), v.end(),greater<>());		//大きい順
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define all(c) (c).begin(),(c).end()
#define ll long long
#define lb long double
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define Print(p) cout<<(p)<<endl
#define F first
#define S second
#define pb push_back
#define mod 1000000007LL
#define INF 1234567890123456
typedef pair<int, int> P;
typedef pair<int, P> PP;

const int maxn =1e3 + 10;

//initialization here
//

//
//initialization finish


// your function is here
//

//
// your function finished



int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	// your code is here
	//
	int a, b; cin >> a >> b;

	if (a < 0 && b < 0)
	{
		if ((b - a) % 2==0) Print("Negative");
		else Print("Positive");
	}
	else if (a < 0 && b >= 0) Print("Zero");
	else if (a == 0) Print("Zero");
	else Print("Positive");



	//
	// your code finished


	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define endl '\n'

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N = 0;
    cin>>N;
    while(N > 1){
        int re = N % 10;
        if(re == 7){
            cout<<"Yes"<<endl;
            return 0;
        }
        N = N / 10;
    }
    cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 3648
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int x = scanner.nextInt();
		int sum = 0;
		int min = 10000;
		for (int i=0; i<n; i++) {
			int m = scanner.nextInt();
			sum += m;
			min = Math.min(m, min);
		}
		System.out.println(n+((x-sum)/min));
	}

}

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

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

#define RFOR(i, b, a) for(int(i)=(b); (i)>=(a); (i)--)
#define RREP(i, n) FOR((i), (n), 0)

#define pb push_back
#define mp make_pair 

using namespace std;

const int INF=INT_MAX/4;
const int MOD=1000000007;
const double EPS=1e-14;

const bool debug_flag=true;

void debug(string str){
	if(debug_flag){
		cout<<str<<endl;
	}
}

void debugs(string str){
	if(debug_flag){
		cout<<str;
	}
}

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cout.precision(10);
	
	int N;
	cin>>N;
	vector<int> L(2*N);
	for(int i=0; i<2*N; i++){
		cin>>L[i];
	}
	sort(L.begin(), L.end());
	int ans=0;
	for(int i=0; i<2*N; i+=2){
		ans+=L[i];
	}
	cout<<ans<<endl;

	return 0;
}



Measured memory_bytes: 256
import java.util.Scanner

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextInt()
    val m = sc.nextInt()

    val likes = (0 until n).map {
        val length = sc.nextInt()
        parseList(sc, length)
    }
    val result = likes.flatten().groupBy { it }
    // 人数分好きと言われてるものに絞って数を数える
    val count = result.filter { it.value.size == n }.size
    println(count)
}

private fun parseList(scanner: Scanner, length: Int): List<Int> {
    return (0 until length).map {
        scanner.nextInt()
    }
}


Measured memory_bytes: 31256
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

int main(){
	int n;
	cin >> n;
	int x,y,z,ans;
	z=0;
	ans=1;
	cin >> x;
	for(int i=1;i<n;i++){
		cin >> y;
		if(z==0&&x==y){
			continue;
		}else if(y>=x&&z>=0){
			z=1;
			x = y;
		}else if(y<=x&&z<=0){
			z = -1;
			x = y;
		}else{
			z=0;
			x = y;
			ans +=1;
		}
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;
#define ll long long
#define sz(x) (ll)(x.size())
#define f first
#define se second
const ll N = 2e5+100;
int main() {
    ios::sync_with_stdio(0);
    ll n;
    cin >> n;
    ll a[n][3];
    for(ll i = 0; i < n; i++){
        cin >> a[i][0] >> a[i][1] >> a[i][2];
    }
    ll dp[n][3];
    dp[0][0] = a[0][0];
    dp[0][1] = a[0][1];
    dp[0][2] = a[0][2];
    for(ll i = 1; i < n; i++){
        dp[i][0] = max(dp[i - 1][1], dp[i - 1][2]) + a[i][0];
        dp[i][1] = max(dp[i - 1][2], dp[i - 1][0]) + a[i][1];
        dp[i][2] = max(dp[i - 1][0], dp[i - 1][1]) + a[i][2];
    }
    cout << max(dp[n -1][0], max(dp[n - 1][1], dp[n - 1][2])) << "\n";
}

Measured memory_bytes: 4992
#include <stdio.h>
 
int main()
{
  int N,M;
  scanf("%d%d",&N,&M);
  int A[N];
  int i,k,sum,tmp = 0;
  while (i < N)
  {
    scanf("%d",&A[i]);
    sum += A[i];
    i++;
  }
  i = 0;
  while (i < N)
  {
    k = i+1;
    while (k < N)
    {
      if (A[i] < A[k])
      {
        tmp = A[i];
        A[i] = A[k];
        A[k] = tmp;
      }
      k++;
    }
    i++;
  }
  k = 0;
  i = 0;
  while (i < N)
  {
    if (A[i] >= (float)sum/4/M)
    {
      k++;
    }
    else
      break;
    i++;
  }
  if (M <= k)
  {
    printf("Yes");
  }
  else
    printf("No");
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl "\n"
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define F first
#define S second
#define bitcnt(v) __builtin_popcount(v)
#define all(v) v.begin(), v.end()


void solution(){

	int n; cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	vector<int> c(n);
	for(int i = 0; i < n; i++){
		cin >> a[i] >> b[i] >> c[i];
	}
	vector<vector<int>> dp(3,vector<int>(n+1,0));

	dp[0][1] = a[0];
	dp[1][1] = b[0];
	dp[2][1] = c[0];

	for(int i = 2; i <= n; i++){
		dp[0][i] = a[i-1] + max(dp[1][i-1], dp[2][i-1]);
		dp[1][i] = b[i-1] + max(dp[0][i-1], dp[2][i-1]);
		dp[2][i] = c[i-1] + max(dp[0][i-1], dp[1][i-1]);
	}

	cout << max({dp[0][n], dp[1][n], dp[2][n]}) << endl;




	
}	

int main(){ 

	fio; // fast input output
	int t;
	t = 1;
	// cin >> t;
	for(int i = 1; i <= t; i++){
		// GOOGLE //
		// cout << "Case #" << i << ": ";

		solution();
	} 
	return 0;
}


Measured memory_bytes: 5788
#include<bits/stdc++.h>
#define ALL(c) begin(c), end(c)
using namespace std;
using ll = long long;
using ld = long double;

const int N = 1e6+6;


int main(){
	//freopen("input.txt","r",stdin); //freopen("output.txt","w",stdout);
	ios::sync_with_stdio(0);cin.tie(0);//cout.precision(12);cout<<fixed;
	
	ll a,b,n;
	
	cin>>a>>b>>n;
	
	//for(ll x=0;x<=100;++x) cout<<a*x/b - a*(x/b)<<endl;
	
	ll x = n<b-1 ? n : (n+1) - (n+1)%b - 1;
	
	ll ans = a*x/b - a*(x/b);
	
	cout<<ans<<endl;
	
	return 0;
}


Measured memory_bytes: 3652
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1000000000;

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

    for (int k=0; k<=B+1; k++){
        if (A*k%B == C){
            cout << "YES" << endl;
            exit(0);
        }
    }
    cout << "NO" << endl;
}

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

int main(){
    int n,x,y;
    cin >> n >> x >>y;
    --x;--y;
    // グラフを作らない
    vector<int> ans(n);
    rep(sv,n){
        vector<int>dist(n,INF);
        queue<int> q;
        auto push = [&](int v, int d){
            if(dist[v] != INF)return;
            dist[v] = d;
            q.push(v);
        };
        push(sv,0);
        while(!q.empty()){
            int v = q.front();q.pop();
            int d = dist[v];
            if(v==x)push(y,d+1);
            if(v==y)push(x,d+1);
            if(v-1>=0)push(v-1,d+1);
            if(v+1 < n)push(v+1,d+1);
        }
        rep(i,n)ans[dist[i]]++;
    }
    rep(i,n)ans[i]/=2;
    for(int i = 1;i<=n-1;++i){
        cout << ans[i] << endl;
    }
    return 0;
}

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

int main() {
	int A, B, C, X, Y, a=0,b=0;
	long long int sum=0;
	cin >> A >> B >> C >> X >> Y;
	if(A+B<=C*2){
		while(a<X && b<Y){
			a++; b++;
			sum += A + B;
		}
	}
	if(A+B>C*2){
		while(a<X && b<Y){
			a++; b++;
			sum += C*2;
		}
	}
	if(a<X){
		if(A<=C*2){
			while(a<X){
				a++;
				sum += A;
			}
		}
		if(A>C*2){
			while(a<X){
				a++; b++;
				sum += C*2;
			}
		}
	}
	if(b<Y){
		if(B<=C*2){
			while(b<Y){
				b++;
				sum += B;
			}
		}
		if(B>C*2){
			while(b<Y){
				a++; b++;
				sum += C*2;
			}
		}
	}
	
	cout << sum;
	return 0;
}

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

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define ll long long
#define P pair<int, int>

using namespace std;
int mod = 1000000007;

int N;

int main() {
  cin >> N;
  int mina = INT_MAX;
  int maxa = 0;
  rep(i, N) {
    int a;
    cin >> a;
    mina = min(a, mina);
    maxa = max(a, maxa);
  }
  cout << maxa - mina << endl;
}

Measured memory_bytes: 256