akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>

using namespace std;

typedef long long llint;
typedef pair <int, int> pi;

const int MAXN = 200005;

llint n, sol;
llint a[MAXN], lef[MAXN], rig[MAXN];
vector <int> v;

void precompute () {
    v.push_back(0);
    for (int i = 1; i <= n; i++) {
        while (!v.empty() && a[v.back()] > a[i]) v.pop_back();
        lef[i] = v.back();
        v.push_back(i);
    }
    v.clear();
    v.push_back(n + 1);
    for (int i = n; i >= 1; i--) {
        while (!v.empty() && a[v.back()] > a[i]) v.pop_back();
        rig[i] = v.back();
        v.push_back(i);
    }
}

int main () {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    precompute();
    for (int i = 1; i <= n; i++) {
        sol += a[i] * (rig[i] - i) * (i - lef[i]);
    }
    cout << sol;
    return 0;
}


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

using namespace std;

int main() {
    int X, Y, Z;

    cin >> X >> Y >> Z;

    int width = X - Z;

    int ans = width / (Y + Z);

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

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

using namespace std;

#define loop(i,a,b) for(int i=(a); i<(int)(b); i++)
#define rep(i,b) loop(i,0,b)

typedef set<vector<int>> sv;

int main(){
    int n;
    while(cin>>n,n){
        sv prev; prev.insert(vector<int>(1,1));
        rep(i,n-1){
            sv next;
            for(auto v:prev){
                rep(i,v.size()){
                    if(i==0||v[i-1]>v[i]){
                        v[i]++;
                        next.insert(v);
                        v[i]--;
                    }
                }
                v.push_back(1);
                next.insert(v);
            }
            prev=next;
        }
        for(auto v=prev.rbegin(); v!=prev.rend(); ++v){
            rep(i,v->size()-1) cout<<(*v)[i]<<" ";
            cout<<v->back()<<endl;
        }
    }
}

Measured memory_bytes: 2252
N, = map(int, input().split())
import sys
sys.setrecursionlimit(10**6)
d = [set() for _ in range(N+1)]
Cs = [0 for _ in range(N+1)]
for _ in range(N-1):
    u, v, p = map(int, input().split())
    d[u].add((v, p))
    d[v].add((u, p))

def it(v, p):
    for u, c in d[v]:
        if u == p:
            continue
        Cs[u] = int(not Cs[v]) if c%2 else Cs[v]
        it(u, v)
it(1, None)
for i in range(1, N+1):
    print(Cs[i])


Measured memory_bytes: 90640
/* --- author: dxm --- */
#include<bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;

#define INF 1e9
#define Inf 1e18
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mp make_pair
#define pb push_back
#define fst first
#define snd second
typedef long long ll;
typedef double db;
typedef long double ldb;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;

void qread(int &x){
	int neg=1;x=0;
	char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')neg=-1;c=getchar();}
	while(c>='0'&&c<='9')x=10*x+c-'0',c=getchar();
	x*=neg;
}

const int maxn=200005;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};
const char s[]={'R','D','L','U'};
int h,w,n,x,y;
char c[maxn];
string s1,s2; 

int main(){
#ifdef FILE
	freopen("FILE.in","r",stdin);
	freopen("FILE.out","w",stdout);
#endif
	scanf("%d%d%d%d%d",&h,&w,&n,&x,&y);
	scanf("%s",c);s1=c;
	scanf("%s",c);s2=c;
	rep(d,4){
		int cx=x,cy=y;
		rep(i,n){
			if(s1[i]==s[d])cx+=dx[d],cy+=dy[d];
			if(cx<=0||cx>h||cy<=0||cy>w){
				puts("NO");
				return 0;
			}
			if(s2[i]==s[(d+2)%4]){
				int nx=cx+dx[(d+2)%4],ny=cy+dy[(d+2)%4];
				if(nx>0&&nx<=h&&ny>0&&ny<=w)cx=nx,cy=ny;
			}
		}
	}
	puts("YES");
#ifdef TIME
	printf("Running Time = %d ms\n",int(clock()*1000.0/CLOCKS_PER_SEC));
#endif
	return 0;
}

/*
Input:
-----------------
Output:
*/


Measured memory_bytes: 768
#include <iostream>
#include <vector>
#include <string>
using namespace std;
int main() {
    int n;
    cin >> n;

    while(n != 0) {
        vector<string> w(n);
        for (int i = 0; i < n; ++i) {
            cin >> w[i];
        }

        for (int j = 0; j < n; ++j) {
            int w_count = 0;
            int cur = j;

            while (w_count < 5 and cur < n) {
                w_count += w[cur].size();
                cur++;
            }
            if (w_count != 5) continue;

            w_count = 0;
            while (w_count < 7 and cur < n) {
                w_count += w[cur].size();
                cur++;
            }
            if (w_count != 7) continue;

            w_count = 0;
            while (w_count < 5 and cur < n) {
                w_count += w[cur].size();
                cur++;
            }
            if (w_count != 5) continue;


            w_count = 0;
            while (w_count < 7 and cur < n) {
                w_count += w[cur].size();
                cur++;
            }
            if (w_count != 7) continue;

            w_count = 0;
            while (w_count < 7 and cur < n) {
                w_count += w[cur].size();
                cur++;
            }
            if (w_count != 7) continue;

            cout << j+1 << endl;
            break;
        }
        cin >> n;

    }
}


Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<algorithm>
#define NMAX 105
#define WMAX 10005
#define DIAGONAL 1
#define TOP 0

using namespace std;

struct Item {
	int value, weight;
};

int N, W;
Item items[NMAX + 1];
int C[NMAX + 1][WMAX + 1], G[NMAX + 1][WMAX + 1];

void compute(int &maxValue, vector<int> &selection) {
	for (int w = 0; w <= W; w++) {
		C[0][w] = 0;
		G[0][w] = DIAGONAL;
	}

	for (int i = 1; i <= N; i++)C[i][0] = 0;

	for (int i = 1; i <= N; i++) {
		for (int w = 1; w <= W; w++) {
			C[i][w] = C[i - 1][w];
			G[i][w] = TOP;
			if (items[i].weight > w)continue;
			if (items[i].value + C[i - 1][w - items[i].weight] > C[i - 1][w]) {
				C[i][w] = items[i].value + C[i - 1][w - items[i].weight];
				G[i][w] = DIAGONAL;
			}
		}
	}

	maxValue = C[N][W];
	selection.clear();
	for (int i = N, w = W; i >= 1; i--) {
		if (G[i][w] == DIAGONAL) {
			selection.push_back(i);
			w -= items[i].weight;
		}
	}

	reverse(selection.begin(), selection.end());
}

void input() {
	cin >> N >> W;
	for (int i = 1; i <= N; i++) {
		cin >> items[i].value >> items[i].weight;
	}
}

int main() {
	int maxValue;
	vector<int>selection;
	input();
	compute(maxValue, selection);

	cout << maxValue << endl;

	return 0;
}


Measured memory_bytes: 11036
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int count = 0;
		int y = 0;
		for (int j = 0; j < n; j++) {
			int z = 0;
			int x = scanner.nextInt();
			if (x == 2) {
				count += 1;
			} else if (x % 2 == 1) {
				double xx = Math.sqrt((double)x);
				for (int i = (int)xx; i >= 3; i--) {
					y = x % i;
					if (y == 0) {
						z += 1;
						break;
					}
				}
				if (z == 0) {
					count += 1;
				}
			}
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 44016
import sys
from collections import defaultdict


def input():
    return sys.stdin.readline().strip()


class UnionFind:
    def __init__(self, n_nodes):
        self.n_nodes = n_nodes
        self.parent = [i for i in range(n_nodes)]
        self.rank = [1] * n_nodes
        self.size = [1] * n_nodes

    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]

    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.rank[x] > self.rank[y]:
            self.parent[y] = x
            self.size[x] += self.size[y]
        else:
            self.parent[x] = y
            self.size[y] += self.size[x]
            if self.rank[x] == self.rank[y]:
                self.rank[y] += 1

    def check(self, x, y):
        return self.find(x) == self.find(y)

    def get_parent_list(self):
        return [i for i in range(self.n_nodes) if self.find(i) == i]

    def get_n_groups(self):
        return len(self.get_parent_list())

    def get_members(self, x):
        parent = self.find(x)
        return [i for i in range(self.n_nodes) if self.find(i) == parent]

    def get_members_dict(self):
        return {par: self.get_members(par) for par in self.get_parent_list()}


def main():
    N, K, L = map(int, input().split())
    Tree_road = UnionFind(N)
    Tree_train = UnionFind(N)
    for _ in range(K):
        p, q = map(int, input().split())
        Tree_road.unite(p - 1, q - 1)
    for _ in range(L):
        p, q = map(int, input().split())
        Tree_train.unite(p - 1, q - 1)
    DD = defaultdict(int)
    for i in range(N):
        DD[(Tree_road.find(i), Tree_train.find(i))] += 1
    answer = []
    for i in range(N):
        answer.append(DD[(Tree_road.find(i), Tree_train.find(i))])

    print(*answer, sep=" ")


if __name__ == "__main__":
    main()


Measured memory_bytes: 59360
import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long[] ar = new long[N];
        long[] dp = new long[N];
        for (int i = 0; i < N; i++) {
            ar[i] = sc.nextLong();
            if (i == 0) {
                dp[i] = ar[i];
            } else {
                dp[i] = dp[i-1]+ar[i];
            }
        }
        long sum = Arrays.stream(ar).sum();
        long min = Long.MAX_VALUE;
        for (int i = 0; i < N-1; i++) {
            long x = dp[i];
            long y = sum-x;
            min = Math.min(min, Math.abs(x-y));
        }
        System.out.println(min);
    }
    
}

Measured memory_bytes: 61740
import java.util.Scanner;

public class Main {

	static Scanner sc = new Scanner(System.in);

	public static void main(String[] args) {
		String q = sc.next();
		int N = sc.nextInt();
		int ans = 0;
		for (int i = 0; i < N; ++i) {
			String str = sc.next();
			str += str;
			if (str.indexOf(q) >= 0) ++ans; 
		}
		System.out.println(ans);
	}

}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using namespace std;
const int MAXN=1e5+7;
int f[MAXN],b[MAXN],n,m,q,l[MAXN],st,a[MAXN],A[MAXN];
int main()
{
	cin>>n>>m>>q;
	for(int i=1;i<=q;i++) cin>>a[i];
	for(int i=q;i>=1;i--){
		if(!b[a[i]]){
			A[++A[0]]=a[i];
			b[a[i]]=1;
		}
	}
	for(int i=1;i<=m;i++)
		if(!b[i]) A[++A[0]]=i;
	memset(b,0,sizeof(b));
	
	l[0]=n;
	for(int i=q;i>=1;i--){
		if(!b[a[i]]){
			st++;
			b[a[i]]=st;
			f[st]=a[i];
			l[st-1]--;l[st]++;
		} else if(l[b[a[i]]-1]){
			l[b[a[i]]-1]--;l[b[a[i]]]++;
		}
	}
	memset(b,0,sizeof(b));
	for(int i=0;i<st;i++){
		if(l[i]){
			st=i;
			for(int j=1;j<=i;j++){
				if(f[j]!=A[j]){
					cout<<"No"<<endl;
					return 0;
				}
				b[f[j]]=1;
			}
			for(int j=1;j<=m;j++){
				if(!b[j]){
					st++;
					if(j!=A[st]){
						cout<<"No"<<endl;
						return 0;
					}
				}
			}
			break;
		}
	}
	cout<<"Yes"<<endl;
}

Measured memory_bytes: 2176
--{-# LANGUAGE StandaloneDeriving #-}
--{-# LANGUAGE BangPatterns #-}

module Main where

import Debug.Trace
--import Data.List
--import Data.Char
--import qualified Data.Set.Strict as Set
--import qualified Data.Map.Strict as Map

main :: IO ()
main = do
  [l, r, d] <- map read . words <$> getLine
  --a `traceShow`
  print $ solve l r d

solve :: Int -> Int -> Int -> Int
solve l r d = length . filter ((== 0) . (`mod` d)) $ [l..r]


Measured memory_bytes: 3824
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())
#define FORV(i, v) for (auto i = v.begin(); i != v.end(); i++)
using namespace std;

typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
const int INF = 1001001001;
const ll INFL = 1LL<<60;


typedef pair<pair<ll, ll>, int> P;  // 最短距離(補給回数・燃料の残量)と頂点番号

void dijkstra(const int& n, const int& l, const vector<vector<int>>& cost, const int& s, vector<pair<ll, ll>>& d) {
  priority_queue<P, vector<P>, greater<P>> que;  // P#first が小さい順に取り出せる
  d[s] = {0, 0};
  que.push(make_pair(pair<ll, ll>(0L, 0L), s));

  while (!que.empty()) {
    P p = que.top(); que.pop();
    ll v = p.second;
    ll num_add = p.first.first;
    ll used = p.first.second;
    if (d[v] < p.first) continue;
    for (int j = 0; j < n; j++) {
      if (j == v) continue;
      if (cost[v][j] > l) continue;
      ll nused = used + cost[v][j];
      pair<ll, ll> np = {0, 0};
      if (nused > l) np = {num_add + 1, cost[v][j]};
      else np = {num_add, nused};
      if (chmin(d[j], np)) {
        que.push(make_pair(np, j));
      }
    }
  }
}

int main() {
  int n, m, l;
  cin >> n >> m >> l;
  vector<vector<int>> d(n, vector<int>(n,INF));
  rep(i,n) d[i][i] = 0;
  rep(i,m) {
    int a, b, c;
    cin >> a >> b >> c;
    --a; --b;
    d[a][b] = d[b][a] = c;
  }
  vector<vector<pair<ll, ll>>> dist(n, vector<pair<ll, ll>>(n, {INF, INF}));
  rep(s, n) {
    dijkstra(n, l, d, s, dist[s]);
  }

  int q;
  cin >> q;
  rep(i, q) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    ll res =  dist[a][b].first;
    if (res >= INF) cout << -1 << endl;
    else cout << res << endl;
  }

  return 0;
}


Measured memory_bytes: 3544
#include <cmath>
#include <cstdio>
#include <iostream>
#include<cstdlib>
using namespace std;


int main(){
int n,y;
cin >> n>>y;
int data[3]={-1,-1,-1};

for(int a=0;a<=n;a++){
  for(int b=0;b<=n-a;b++){
    if(y==1000*a+5000*b+10000*(n-a-b)){
      data[2]=a;
      data[1]=b;
      data[0]=n-a-b;
    }
  }
}


  cout << data[0]<<" "<<data[1]<<" "<<data[2]<<endl;

}

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

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
ll H[101010];
ll dp[101010];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	for(i=1;i<=N;i++) {
		dp[i]=1LL<<60;
		cin>>H[i];
	}
	dp[1]=0;
	for(i=1;i<N;i++) {
		dp[i+1]=min(dp[i+1],dp[i]+abs(H[i]-H[i+1]));
		dp[i+2]=min(dp[i+2],dp[i]+abs(H[i]-H[i+2]));
		
	}
	cout<<dp[N]<<endl;
	
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<queue>
#include<cmath>
#include<algorithm>
#include<iomanip>
#include<functional>
#include<set>
#include<map>
#include<climits>
#include<utility>
#define ul unsigned long long int
#define ll long long int
#define MAX 1000000+1
using namespace std;
#define F first
#define S second
#define pi 2*acos(0.0)
#define PB push_back
#define CL clear()







int main()
{
    ll arr[6];
    for(ll i = 0; i < 5; i++)
        arr[i] = 0;
    ll n ;
    cin >> n;
    string d;
    map<string, bool> v;
    v.clear();
    while(n--)
    {

        cin >> d;



        switch(d[0])
        {
        case 'A' :
            arr[0]++;
            break;
        case 'C':
            arr[1]++;
            break;
        case 'H':
            arr[2]++;
            break;
        case 'M' :
            arr[3]++;
            break;
        case 'R':
            arr[4]++;
            break;

        }

    }
    ll e = 0;
    for(int i = 0; i < 5-2; i++)
        for(int j = i+1; j < 5-1; j++)
            for(int k = j+1; k < 5; k++)
                e += (arr[i]*arr[j]*arr[k]);
    cout << e;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
 
int main(void) {
  unsigned long a;
  char b, b1, b2;
  scanf("%lu %c.%c%c", &a, &b, &b1, &b2);
  b -= '0'; b1 -= '0'; b2 -= '0';
  unsigned long ans = a * (unsigned long)b;
  unsigned long tmp = a * b1 + (a*b2)/10;
  tmp = tmp / 10;
  ans += (unsigned long)tmp;
  
  printf("%lu\n", ans);
  
  return 0;
}

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

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

    if((A=Y/1000)<1){
      x=-1;y=-1;z=-1;
        cout<<x<<" "<<y<<" "<<z<<"\n";
    }

    for(int x=0;x<=N;x++){
      for(int y=0;y<=N;y++){
          z = N - y - x;
          if(((10*x+5*y+z)==A)&&(z>=0)&&(y>=0)&&(x>=0)){
              cout<<x<<" "<<y<<" "<<z<<"\n";
              return 0;
          }
      }
    }

    x=-1;y=-1;z=-1;
    cout<<x<<" "<<y<<" "<<z<<"\n";

    return 0;
}


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

int main(){
    int M, D, res = 0;
    cin >> M >> D;
    rep(i, 1, M + 1)
    {
        rep(j,2,D+1){
            int temp1 = j % 10;
            int temp10 = j / 10;
            if(temp1*temp10 == i && temp1 > 1 && temp10 > 1){
                res++;
                //cout << temp1 << temp10 << endl;
                //cout << i << endl;
            }
        }
    }
    cout << res << endl;
}



Measured memory_bytes: 256
#include <stdio.h>
int patition(int a[100000], int p, int r) {
	int x, i, j, tmp;

	x = a[r];
	i = p - 1;
	for (j = p; j < r; j++) {
		if (a[j] <= x) {
			i += 1;
			tmp = a[j];
			a[j] = a[i];
			a[i] = tmp;
		}
	}
	tmp = a[i+1];
	a[i+1] = a[r];
	a[r] = tmp;
	return i + 1;
}

int main(void) {
	int in[100000], n, i, p;
	const char *fmt = "%d";

	scanf("%d", &n);
	for (i = 0; i < n; i++) {
		scanf("%d", in+i);
	}
	p = patition(in, 0, n-1);

	for (i = 0; i < p; i++) {
		printf(fmt, in[i]);
		fmt = " %d";
	}
	printf(" [%d]", in[p]);
	for (i = p+1; i < n; i++) {
		printf(fmt, in[i]);
	}
	putchar('\n');
	return 0;
}

Measured memory_bytes: 992
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define sz(v) (v).size()
#define inf 1e18
#define md 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define tel(a){cout<<a<<"\n";}
#define tell(a,b){cout<<a<<" | "<<b<<"\n";}
#define telll(a,b,c){cout<<a<<" | "<<b<<" | "<<c<<"\n";}
#define teln(v,n){cout<<"v- ";rep(i,0,n)cout<<v[i]<<" ";cout<<"\n";}
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
#define M 1000010

int main(){
	IOS;
	ll n,ans=0;cin>>n;
	ll a[n];rep(i,0,n)cin>>a[i];
	rep(i,0,n)rep(j,i+1,n)ans+=a[i]*a[j];
	cout<<ans;
	
	
	
	
	return 0;
}



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

using namespace std;

#define rep(i,n) for(int i=0 ; i<(n) ; i++)
#define repr(i,n) for(int i=(n) ; i>=0 ; i--)
#define FOR(i,m,n) for(int i=(m) ; i<(n) ; i++)
#define FORR(i,m,n) for(int i=(m) ; i>=(n) ; i--)

#define All(x) (x).begin(),(x).end()
int GCD(int a,int b){ return b ? GCD(b,a%b) : a ;} 

typedef long long ll;
typedef unsigned long long ull;

const int INF = 1e9;

int main(){
   int n;
   cin >> n;
   string s;
   cin >> s;
   int ans = 0;
   int tmp = 0;
   for(int i=0;i<s.size();i++){
      if(s[i] == 'I')tmp++;
      else tmp--;
      ans = max(ans,tmp);
   }
   cout << ans << endl;
   return 0;
}

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

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

    if (a[a.length() - 1] == b[0] && b[b.length() - 1] == c[0])
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}

Measured memory_bytes: 256
#include<cstring>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<assert.h>
#include<ctime>
using namespace std;
#define LL long long
const int maxn = 2e5+10;
const int maxm = 1e5+10;
double pi = acos(-1.0);

//struct edge{
//    int from, to, cost, next;
//}e[maxn*2];
//int head[maxn], tot;
//inline void add(int a, int b, int c) {
//    e[tot].from = a, e[tot].to = b, e[tot].cost = c, e[tot].next = head[a], head[a] = tot++;
//}
//namespace fastIO {
//    #define BUF_SIZE 100000
//    //fread -> read
//    bool IOerror = 0;
//    inline char nc() {
//        static char buf[BUF_SIZE], *p1 = buf + BUF_SIZE, *pend = buf + BUF_SIZE;
//        if(p1 == pend) {
//            p1 = buf;
//            pend = buf + fread(buf, 1, BUF_SIZE, stdin);
//            if(pend == p1) {
//                IOerror = 1;
//                return -1;
//            }
//        }
//        return *p1++;
//    }
//    inline bool blank(char ch) {
//        return ch == ' ' || ch == '\n' || ch == '\r' || ch == '\t';
//    }
//    inline void read(int &x) {
//        char ch;
//        while(blank(ch = nc()));
//        if(IOerror)
//            return;
//        for(x = ch - '0'; (ch = nc()) >= '0' && ch <= '9'; x = x * 10 + ch - '0');
//    }
//    #undef BUF_SIZE
//};
//using namespace fastIO;

int x[maxn], y[maxn];

struct node{
    int x, y;
}p[maxn];

bool cmp1(node a, node b) {
    return a.y < b.y;
}

bool cmp2(node a, node b) {
    return a.y > b.y;
}

int val[maxn];

int main(){
    int n; int x1, y1, x2, y2;
    while(~scanf("%d%d%d%d", &x1, &y1, &x2, &y2)) {
        scanf("%d", &n);
        if(x1 > x2) {swap(x1, x2); swap(y1, y2);}
        int cnt = 0; int x, y;
        for(int i = 1; i <= n; i++) {
            scanf("%d%d", &x, &y);
            if(x <= x2 && x >= x1 && (y <= y1 && y >= y2 || y >= y1 && y <= y2)) {
                p[cnt++] = (node){x, y};
            }
        }
        if(y1 <= y2) sort(p, p+cnt, cmp1);
        else sort(p, p+cnt, cmp2);
        double ans = abs(x1-x2)+abs(y1-y2);
        ans = ans*100;
        int len = 0;
        memset(val, 0x3f, sizeof(val));
        for(int i = 0; i < cnt; i++) {
            int pos = lower_bound(val, val+cnt, p[i].x)-val;
            val[pos] = p[i].x; len = max(len, pos);
        }
        if(cnt) len++;
        ans += len*(pi*5-20);
        //printf("%d\n", len);
        if(len == min(abs(x1-x2), abs(y1-y2))+1) ans += pi*5;
        printf("%.15f\n", ans);
    }
}


Measured memory_bytes: 2560
N = gets.to_i
cs = {}
gets.split.map(&:to_i).each{ |a|
  cs[a] = (cs[a] || 0) + 1
}
Rest = cs.values.map{ |c| c - 1 }.inject(:+)
p cs.keys.size + (Rest % 2 == 0 ? 0 : -1)


Measured memory_bytes: 16900
import re
import sys
import math
import itertools
import bisect
from copy import copy
from collections import deque,Counter
from decimal import Decimal
import functools
def v(): return input()
def k(): return int(input())
def S(): return input().split()
def I(): return map(int,input().split())
def X(): return list(input())
def L(): return list(input().split())
def l(): return list(map(int,input().split()))
def lcm(a,b): return a*b//math.gcd(a,b)
sys.setrecursionlimit(10 ** 9)
mod = 10**9+7
cnt = 100000
ans = 0
inf = float("inf")
al = "abcdefghijklmnopqrstuvwxyz"

s = X()
t = X()

for j in range(len(s)-len(t)+1):
    ans = 0
    a = s[j:j+len(t)]
    for i in range(len(t)):
        if t[i] != a[i]:
            ans += 1
    cnt = min(cnt,ans)

print(cnt)

Measured memory_bytes: 10448
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		String a = sc.next();
		char b = a.charAt(0);
		char c = a.charAt(1);

		String ans = "No";

		if(b=='9'|c=='9'){
			ans = "Yes";
		}

		// 出力
		System.out.println(ans);
	}
}


Measured memory_bytes: 22868
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin.bytes().map(|c| c.expect("faild") as char).skip_while(|c| c.is_whitespace()).take_while(|c| !c.is_whitespace()).collect();
    token.parse().ok().expect("faild parse")
}
fn main(){
    let s: u32 = read();
    let h = s /3600;
    let m = s / 60 % 60;
    println!("{}:{}:{}",h,m,s%60);
}


Measured memory_bytes: 1052
N = int(input())
p_x = []
p_y = []
p_h = []
for i in range(N):
    x1,y1,h1 = [int(i) for i in input().split()]
    p_x.append(x1)
    p_y.append(y1)
    p_h.append(h1)


#h = H - |X-CX| - |Y-CY|　⇔　H = h + |X-CX| + |Y-CY|
#方針：上記式から与えられた全座標でHの値が一致する点を見つける。
for x in range(101):
    for y in range(101):
        #点を見つけたときにfor文から離脱
        hantei1 = 0
        #一致したときにカウント
        count = 0
        #判定用の変数
        tmp = -1
        #判定用の変数(0) or 判定する値（1）
        tmp_count = 0
        #h[i]==0の保留リスト
        horyu = []
        for i in range(N):
            if p_h[i] == 0:
                horyu.append(i)
            else:
                tmp1 = p_h[i] + abs(x - p_x[i]) + abs(y - p_y[i])
                if tmp1 < 0 :
                    break
                elif tmp_count == 0:
                    tmp = tmp1
                    tmp_count += 1
                elif tmp_count != 0 and tmp1 > 0:
                    if tmp == tmp1:
                        count += 1
            
        if count == N-1 or N-1 == count + len(horyu):
            if len(horyu) == 0:
                Cx = x
                Cy = y
                H = tmp
                hantei1 = 1
                break
            else:
                count2 = 0
                for j in range(len(horyu)):
                    if 0 == max(0, tmp -abs(p_x[horyu[j]] - x) -abs(p_y[horyu[j]] - y)):
                        count2 += 1
                if count2 == len(horyu):
                    Cx = x
                    Cy = y
                    H = tmp
                    hantei1 = 1
    if hantei1 == 1:
        break

print(Cx,Cy,H)

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

namespace Algorithm
{
    class Program
    {
        const int Mod = 1000000007;
        static long[,,,] dp = new long[101, 4, 4, 4];
        static void Main(string[] args)
        {
            // 写経
            var N = int.Parse(Console.ReadLine());
            dp[0, 0, 0, 0] = 1;

            for (var i = 0; i < N; i++)
                for (var a = 0; a < 4; a++)
                    for (var b = 0; b < 4; b++)
                        for (var c = 0; c < 4; c++)
                            for (var d = 0; d < 4; d++)
                            {
                                if (Ng(b, c, d) || Ng(c, b, d) || Ng(b, d, c)) continue;
                                if (Ng(a, c, d) || Ng(a, b, d)) continue;
                                Add(ref dp[i + 1, b, c, d], ref dp[i, a, b, c]);
                            }
            var ans = 0L;
            for (var a = 0; a < 4; a++)
                for (var b = 0; b < 4; b++)
                    for (var c = 0; c < 4; c++)
                        Add(ref ans, ref dp[N, a, b, c]);


            Console.WriteLine(ans);
        }

        static bool Ng(int a, int b, int c)
        {
            return (a == 1 && b == 2 && c ==3);
        }
        static void Add(ref long a, ref long b)
        {
            a = (a + b) % Mod;
        }
    }
}


Measured memory_bytes: 13268
#include <stdio.h>

int main(){
  int a[10];
  int i,d=10,min,i_min,sum=0,count=0;
  for(i =0;i<5;i++){
    scanf("%d",&a[i]);
    if(a[i]%10 == 0)count++;
    else if(a[i]%10 < d ){
      d = a[i]%10;
      min = a[i];
      i_min = i;
    }
    if(a[i]%10 == 0);
    else a[i] = a[i] + 10-a[i]%10 ; 
  }
  
  //for(i=0;i<5;i++) printf("%d\n",a[i]);
  //printf(" %d %d",min,i_min);
  if(count != 5)a[i_min] = min;
  
  for(i=0;i<5;i++) sum += a[i];
  printf("%d",sum);
  
  
  return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <set>
#include <stack>
#include <queue>
using namespace std;



int main() {
  //
  int N, T, A, h, min_i = -1;
  double min_diff = pow(10, 5);

  cin >> N;
  cin >> T >> A;

  for (int i = 0; i < N; ++i) {
    cin >> h;
    double c = T - h * 0.006;
    if(abs(c - A) < min_diff){
      min_diff = abs(c - A);
      min_i = i+1;
    }
  }



  cout << min_i << endl;

  return 0;

}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define RI register int
typedef long long LL;
#define lc (x << 1)
#define rc (x << 1 | 1)
#define int LL

#define FILEIO(name) freopen(name".in", "r", stdin), freopen(name".out", "w", stdout);

using namespace std;

char buf[1000000], *p1 = buf, *p2 = buf;
inline char gc() {
  if (p1 == p2) p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin);
  return p1 == p2 ? EOF : *(p1++);
}
template <class T> inline void read(T &n) {
  n = 0; RI ch = gc(), f;
  while ((ch < '0' || ch > '9') && ch != '-') ch = gc();
  f = (ch == '-' ? ch = gc(), -1 : 1);
  while (ch >= '0' && ch <= '9') n = n * 10 + (ch ^ 48), ch = gc();
  n *= f;
}

int const MAXN = 1e5 + 5;
int Be[MAXN * 4], En[MAXN * 4], Dis[MAXN * 4];
int a[MAXN];

void Add(int x, int len, int b, int e, int f) {
  Be[x] += b;
  En[x] += f * len;
  Dis[x] += f;
}
void Pushdown(int x, int l, int r) {
  int mid = (l + r) >> 1;
  Add(lc, mid - l + 1, Be[x], Be[x] + Dis[x] * (mid - l), Dis[x]);
  Add(rc, r - mid, Be[x] + Dis[x] * (mid - l + 1), En[x], Dis[x]);
  Be[x] = En[x] = Dis[x] = 0;
}
void Modify(int x, int l, int r, int i, int j, int b, int e) {
  if (i > j) return;
  if (i <= l && r <= j) return Add(x, r - l + 1, b, e, 1);
  Pushdown(x, l, r);
  int mid = (l + r) >> 1, fmid = b + mid - i;
  if (i <= mid) Modify(lc, l, mid, i, min(mid, j), b, min(e, fmid));
  if (j > mid) Modify(rc, mid + 1, r, max(i, mid + 1), j, max(b, fmid + 1), e);
}
int Query(int x, int l, int r, int to) {
  if (l == r) return Be[x];
  int mid = (l + r) >> 1;
  Pushdown(x, l, r);
  if (to <= mid) return Query(lc, l, mid, to);
  else return Query(rc, mid + 1, r, to);
}

signed main() {
  
#ifdef LOCAL
  FILEIO("a");
#endif

  int n, m, ans = 0; read(n), read(m);
  for (RI i = 1; i <= n; ++i) read(a[i]);
  for (RI i = 1; i < n; ++i)
    ans += (a[i + 1] - a[i] + m) % m;
  for (RI i = 1; i < n; ++i) {
    if (a[i + 1] > a[i]) Modify(1, 1, m, a[i] + 1, a[i + 1], 0, a[i + 1] - a[i]);
    else {
      Modify(1, 1, m, a[i] + 1, m, 0, m - a[i] - 1);
      Modify(1, 1, m, 1, a[i + 1], m - a[i], (a[i + 1] - a[i] + m) % m);
    }
  }
  int Max = 0;
  for (RI i = 1; i <= m; ++i)
    Max = max(Max, Query(1, 1, m, i));
  printf("%lld\n", ans - Max);

  return 0;
}

// created by Daniel yuan


Measured memory_bytes: 11008
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
signed main(){
    int n,a,arr[100000];
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a;
        arr[--a]=i;
    }
    for(int i=0;i<n;i++)
        cout<<arr[i]+1<<(i+1==n?'\n':' ');
}


Measured memory_bytes: 1536
package main

import (
    "fmt"
)

func main() {
    var n int
    var an int
    var min, max, sum int

    fmt.Scanf("%d", &n)

    min = 1000000
    max = -1000000
    sum = 0

    for i:=0 ; i<n ; i++ {
        fmt.Scanf("%d", &an)
        sum += an

        if an < min {
            min = an
        }

        if an > max {
            max = an
        }
    }

    fmt.Printf("%d %d %d\n", min, max, sum)
}


Measured memory_bytes: 1736
// header {{{
using namespace std;

// C++
#include <algorithm>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>

#pragma GCC optimization_level 3

// util {{{
#define print(x)	        cout << (x)
#define printvec(x)       for(int i = 0;i < (x).size();i++)cout << (x).at(i) << " ";cout << endl
#define println(x)	        cout << (x) << endl
#define printn		        cout << endl
#define read(x)	            cin >> (x)
#define readvec(x)        for(int i = 0; i < (x).size();i++)cin >> (x).at(i)

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

#define all(x) 		        (x).begin(),(x).end()
#define vint                vector<int>
#define outif(x,y,z)        if(x) cout<<(y)<<endl; else cout<<(z)<<endl
#define loop 		        while(true)

// }}}

// init {{{
struct ProconInit {
    static constexpr int IOS_PREC = 15;
    static constexpr bool AUTOFLUSH = false;

    ProconInit() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(IOS_PREC);
        if(AUTOFLUSH)
            cout << unitbuf;
    }
} PROCON_INIT;
// }}}

//--------------------------------------------------------------------

void solve() {
    long long int a,b;
    read(a);
    read(b);
    cout << a / b << " " << a % b << " " << double(a) / double(b) << endl;
}

signed main() {
    solve();
    return 0;
}


Measured memory_bytes: 3308
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,i,c[1010],s[1010],f[1010],hz,j;
int main()
{
	cin>>n;
	for(i=1;i<n;i++)
		cin>>c[i]>>s[i]>>f[i];
	for(i=1;i<=n;i++)
	{
		hz=0;
		for(j=i;j<n;j++)
		{
			hz=max(s[j],(ll)ceil((double)hz/(double)f[j])*f[j]);
			hz+=c[j];
		}
		cout<<hz<<"\n";
	}
}

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

int main() {
    int N, D, X;
    cin >> N >> D >> X;

    int A[N];
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }

    int b[N];

    for(int i = 0; i < N; i++) {
        b[i] = 1 + (D-1)/A[i];
    }

    int ans = X;

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

    cout << ans;

    cout << endl;
    return 0;
}

Measured memory_bytes: 256
'use strict'
const main = arg => {
	const input = arg.trim().split("\n");
	let c = input[0].split(' ')[0]
	const vowel = 'aiueo'.split('')
	if(vowel.some(v => v === c)) {
		console.log('vowel')
	} else {
		console.log('consonant')
	}
}   
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 21192
#include <stdio.h>
char txt[100001];
int dp[100001];
int main(){
	int N,Q;
	scanf("%d %d",&N,&Q);
	scanf("%s",txt);
	for(int i=1;i<N;i++){
		if(txt[i]=='C'&&txt[i-1]=='A') dp[i]++;
		dp[i]+=dp[i-1];
	}
	while(Q--){
		int l,r;
		scanf("%d %d",&r,&l);
		printf("%d\n",dp[l-1]-dp[r-1]);
	}
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formax=(b);i>=i##formax;i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max(x,y)
#define mins(x,y) x=min(x,y)
#define show(x) cout<<#x<<" = "<<x<<endl;
#define all(a) (a.begin()),(a.end())
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))
#define bitComb(a,n,k) for(int a##x,a##y,a=(1<<k)-1;a<(1<<n);a##x=a&-a,a##y=a+a##x,a=(((a&~a##y)/a##x)>>1)|a##y)
#define uniq(v) sort(all(v));v.erase(unique(all(v)), v.end())
#define bit(n) (1LL<<(n))
#define randInt(l,r) (uniform_int_distribution<ll>(l,r)(rnd))
#define randDouble(l,r) (uniform_real_distribution<double>(l,r)(rnd))
#define dout(d) printf("%.12f\n",d)

typedef long long ll;
typedef __int128_t lll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>ostream& operator<<(ostream& o,const pair<T,Y>& p){return o<<"("<<p.fi<<", "<<p.se<<")";}
template<typename A,size_t N,typename T>void Fill(A (&array)[N],const T&v){fill((T*)array,(T*)(array+N),v);}
lll gcd(lll a,lll b,lll &x,lll &y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll gcd(ll a,ll b){lll x=0,y=0;return gcd(a,b,x,y);}
ll modInv(ll a,ll m){lll x,y;gcd(a,m,x,y);return (x%m+m)%m;}
ll modPow(lll a,lll n,ll m){if(!a)return a;lll p=1;for(;n>0;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return(ll)p;}
bool isPrime(ll n){if(n<2||n%2==0)return n==2;lll t=n-1,d=t/(t&-t);for(lll a:{2,325,9375,28178,450775,9780504,1795265022})if(a%n){for(t=d,a=modPow(a,t,n);t!=n-1&&a!=1&&a!=n-1;a=a*a%n,t=t*2%n);if(a!=n-1&&t%2==0)return 0;}return 1;}
const int IINF = 1e9+6;
const ll LINF = 1e18;
const int MOD = 1e9+7;
const double PI = acos(-1);
const double EPS = 1e-10;
static random_device rd;
static mt19937 rnd(rd());

const int N = 1e5;
int h, w;
string s;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> h >> w;
  FOR(i, 0, h){
    cin >> s;
    cout << s << endl;
    cout << s << endl;
  }
}

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

using namespace std;

int main (void){
    vector<int> num;
    int Round_Count=0;
    for (; true ; )
    {
        int N;
        cin >> N;
        if (N==0) break;
        num.push_back(N);
        Round_Count++;
    }
    for (int i = 0; i < Round_Count; i++)
    {
        cout << "Case " << i+1 << ": " << num[i] << endl;
    }
}


Measured memory_bytes: 3220
//
//  main.cpp
//  CoderProj
//
//  Created by Minoru Hayashi on 2020/04/04.
//  Copyright © 2020 Minoru Hayashi. All rights reserved.
//
//  ABC16４4
//
//

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

#define REP(i,n) for (int i=0; i<(n); i++)
#define REP2(i,x,n) for (int i=x; i<(n); i++)
#define ALL(n) begin(n), end(n)

using ll = long long;

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

// const ll INF = 1LL<<60;
// const int INF = 1<<29;
// const int MOD = 1000000007;
//#define __DBG__


void solve(void){
  
  int S,W;
  cin >> S >> W;
  
  if(W>=S){
    cout << "unsafe" <<  endl;
  }
  else{
    cout << "safe" << endl;
  }
  
  return;
   
}



#define TESTCASES 1

int main() {


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

    REP(i,TESTCASES){
      solve();
    }
 
    return 0;
}



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

long factorial(int N){
    long ans = 1;
    for (int i = N; i > 0; i--)
    {
        ans *= i;
        ans %= (long)1e9+7;
    }
    return ans;
}

int main(void){
    int N;
    cin >> N;
    long ans = factorial(N);
    cout << ans << endl;
    return 0; 
}


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

#define SIZE 200000

typedef long long ll;

ll N, T;
ll res, idx;
ll t[SIZE];
ll diff[SIZE];

int main() {
    std::cin >> N >> T;
    for (int i=0; i<N; ++i) {
        std::cin >> t[i];
        if (i > 0) {
            diff[i-1] = t[i] - t[i-1];
            res += diff[i-1];
        }
    }
    res += T;
    std::sort(diff, diff+N-1, std::greater< ll >());
    while ( idx < N-1 && diff[idx] > T ) {
        res -= (diff[idx] - T);
        ++idx;
    }
    std::cout << res << std::endl;
    return 0;
}

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

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		String[] s = S.split("/");
		int[] date = new int[3];
		boolean tbd = false;
		for(int i = 0; i < 3; i++) date[i] = Integer.parseInt(s[i]);
		if(date[0] == 2019 && date[1] > 4) tbd = true;
		if(date[0] > 2019) tbd = true;
		if(tbd) System.out.println("TBD");
		else System.out.println("Heisei");
	}

}


Measured memory_bytes: 22612
#include <iostream>
#include <string>
#include <cstdio>

using namespace std;

int main() {
	string row, buf("");
	int a;
	char d;
	while(cin>>row, !cin.eof()){
		for(int i=row.size(); i>1; i--){
			for(int j=0; j<row.size()-1; j++){
				a = ((row.at(j) - '0') + (row.at(j+1) - '0')) % 10;
				sprintf(&d,"%d", a);
				buf += d;
			}
			row = buf;
			buf = "";
		}
		cout<<row<<endl;
	}
	return 0;
}

Measured memory_bytes: 1220
#include<bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define MOD	1000000007
#define int	long long
#define pii pair<int,int> 
#define vi vector<int>
using namespace std;

int32_t main(){
	string s;
	cin >> s;
	
	if(s.find('7') != string::npos){
		cout << "Yes";
	}
	else
		cout << "No";

	return 0;
}



Measured memory_bytes: 3596
#include <string.h>
#include <stdio.h>
#define SIZE 1000

int main(){

	int  i=0,j,k,n,cnt,tmp,max,num[SIZE];
	char str[SIZE];
	char *argv[SIZE];
  
	fgets(str,sizeof(str),stdin);
	argv[i] = strtok(str, " ");
	do{
		argv[++i] = strtok(NULL, " \n");
	}while ( (i<SIZE) && (argv[i] != NULL));
	num[0]=(int)strlen(argv[0])-1;
	max = num[0];  tmp = 0;	
	for(j=1;j<i;j++){
		num[j]=(int)strlen(argv[j])-1;
		if(num[j]>max){
			max=num[j];
			tmp=j;
		}
	}
	cnt=0; max=0;
	for(k=0;k<i;k++){
		if(strcmp(argv[0],argv[k])==0)
			cnt++;
	}
	max=cnt;  n = 0;
	for(j=1;j<i;j++){
		cnt=0;
		for(k=0;k<i;k++){
			if(strcmp(argv[j],argv[k])==0)
				cnt++;
		}
		if(cnt>max){
			max=cnt;
			n = j;
		}
	}
	printf("%s %s\n",argv[n],argv[tmp]);
	return 0;
}

Measured memory_bytes: 536
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int r = scan.nextInt();
		int c = scan.nextInt();
		int mat[][] = new int[r + 1][c + 1];
		for(int i = 0; i < r; i++){
			for(int j = 0; j < c; j++){
				mat[i][j] = scan.nextInt();
				mat[i][c] += mat[i][j];
				mat[r][j] += mat[i][j];
				mat[r][c] += mat[i][j];
			}
		}
		for(int i = 0; i < r + 1; i++){
			for(int j = 0; j < c + 1; j++){
				System.out.print(mat[i][j]);
				if(j != c){
					System.out.print(" ");
				}
			}
			System.out.println();
		}
		scan.close();
	}
}

Measured memory_bytes: 42372
using System;
using System.Collections;
using System.Linq;

namespace atcoder_BegginerContest89_B
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var s = Console.ReadLine().Split().ToArray();
            ArrayList sl = new ArrayList();
            foreach (var a in s)
            {
                if (!sl.Contains(a))
                {
                    sl.Add(a);
                }
            }
            Console.WriteLine(sl.Count == 3 ? "Three" : "Four");
        }
    }
}


Measured memory_bytes: 13268
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <string>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <list>
#include <tuple>
#include <bitset>
#include <ciso646>
#include <cassert>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;

inline bool check(ll x, ll y, ll xMax, ll yMax) { return x >= 0 && y >= 0 && xMax > x && yMax > y; }
inline int toint(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string tostring(T x) { ostringstream sout; sout << x; return sout.str(); }
template<class T> inline T sqr(T x) { return x*x; }
template<class T> inline T mypow(T x, ll n) { T res = 1; while (n > 0) { if (n & 1)res = res * x;	x = x * x;	n >>= 1; }return res; }
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

#define For(i,a,b)	for(ll (i) = (a);i < (b);(i)++)
#define rep(i,n)	For(i,0,n)
#define rFor(i,a,b)	for(ll (i) = (a-1);i >= (b);(i)--)
#define rrep(i,n)	rFor(i,n,0)
#define each(i,n)	for(auto &i : n)
#define clr(a)		memset((a), 0 ,sizeof(a))
#define mclr(a)		memset((a), -1 ,sizeof(a))
#define all(a)		(a).begin(),(a).end()
#define sz(a)		(sizeof(a))
#define tostr(a)	tostring(a)
#define dump(val) 	cerr << #val " = " << val << endl;
#define Fill(a,v)	fill((int*)a,(int*)(a+(sz(a)/sz(*(a)))),v)

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

const ll mod = 1e9 + 7;
const ll INF = 1e17 + 9;

#define int ll
#define double ld

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

	string s;
	cin >> s;
	map<char, int> mp;
	each(c, s) {
		mp[c]++;
	}
	bool ok = true;
	each(i, mp) {
		if (i.second % 2) {
			ok = false;
		}
	}
	if (ok) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

	return 0;
}

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

  int i,j,k,l,m;
  int n,e,s,w,un,up;
  int a[7];
int t;


void input() {
 for(i=0;i<6;i++){
  
    scanf("%d",&a[i+1]);
  
  }
}

 void N() {
   t = a[1];
   a[1] = a[2];
   a[2] = a[6];
   a[6] = a[5];
   a[5] = t;
 }

 void S() {
   t = a[1];
   a[1] = a[5];
   a[5] = a[6];
   a[6] = a[2];
   a[2] = t;
}

 void E() {
   t = a[1];
   a[1] = a[4];
   a[4] = a[6];
   a[6] = a[3];
   a[3] = t;
 }

 void W() {
   t = a[1];
   a[1] = a[3];
   a[3] = a[6];
   a[6] = a[4];
   a[4] = t;
 }

int main() {

  input();
  //  strlen(?) 文字の長さ(数)を表示
 char str[110];  
 scanf("%s",str);

 for(i=0;i<strlen(str);i++) {

   if(str[i] == 'N') {
     N();
   } else if(str[i] == 'S') {
     S();
   } else if(str[i] == 'W') {
     W();
   } else if(str[i] == 'E') {
     E();
   }
 }

 printf("%d\n",a[1]);

 return 0;
}



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

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

    static class CGacha {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            int n = in.nextInt();
            HashSet<String> hs = new HashSet<>();

            for (int i = 0; i < n; i++) {
                hs.add(in.nextLine().trim());
            }

            out.print(hs.size());
        }

    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader(InputStream inputStream) {
            br = new BufferedReader(new
                    InputStreamReader(inputStream));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}



Measured memory_bytes: 58304