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



int sc1(){int x; scanf("%d",&x); return x;}

long long sc2(){long long x;scanf("%lld",&x);return x;}

#define  gcd(a,b)         __gcd(a,b)
#define  lcm(a,b)         (a*b)/gcd(a,b)
#define  Int              sc1()
#define  LL               sc2()
#define  For(n)           for(int i=0;i<n;i++)
#define  Forj(n)          for(int j=0;j<n;j++)
#define  Fork(n)          for(int k=0;k<n;k++)
#define  For1(n)          for(int i=1;i<=n;i++)
#define  ll               long long
#define  vi               std::vector<int>
#define  vll              std::vector<ll>
#define  qui              qu
#define  pb               push_back
#define  mpsi             std::map<string, int>







int main()
{
	//freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

    int n=Int;
    int arr[n+1];
    ll sum=0;
    For(n)arr[i]=Int;

    for(int i=0;i<n;i++)
    {
    	for( int j=i+1;j<n;j++)
    	{
    		sum+=(ll)(arr[i]*arr[j]);
    	}
    }

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




Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <string>
#include <stdio.h>
#include <cstdlib>
#include <iostream>
#include <cstdlib>
using namespace std;
using ll = long long;
#define mod 1000000007
 
int main()
{
    float r, circum;
	cin>>r;
	circum=2*3.141592653589*r;
	printf("%.4f\n",circum);
    return 0;
}

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

int main(){
    long int max,min;
    char s1[8];
    int n;
    cin >> n;
    while(n--){
        min = 0;
        max = 0;
        cin >> s1;
        sort(s1,s1 + 8);
        for(int i=7,ten=1;i>=0;i--,ten*=10) min += (s1[i]%'0')*ten;
        for(int i=0,ten=1;i<8;i++,ten*=10) max += (s1[i]%'0')*ten;
        cout << max - min << endl;
    }
}

Measured memory_bytes: 1180
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#define rep(i, s, g) for ((i) = (s); (i) < (g); ++(i))
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1e18) + 1;

int main(void)
{
    int n;
    cin >> n;
    int i, j, k;
    int ans = 0;
    vector<int> l(n);

    rep(i, 0, n)
    {
        cin >> l[i];
    }

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

    rep(i, 0, n)
    {
        rep(j, i + 1, n)
        {
            ll ok = j, ng = n;
            ll mid;

            while (ng - ok > 1)
            {
                mid = (ok + ng) / 2;

                if (l[mid] < l[i] + l[j])
                {
                    ok = mid;
                }
                else
                {
                    ng = mid;
                }
            }

            ans += ok - j;
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template<class T> bool chmax(T& a,T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a,T b) { if (a > b) { a = b; return true; } return false; }

long long fast_pow(long long x, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 1) return (x * fast_pow(x, n - 1));
    long long t = fast_pow(x, n / 2);
    return (t * t);
}

int main() {
    long long n, p;
    cin >> n >> p;
    
    map<long long, long long> mp;
    for (long long i = 2; i * i <= p; i++) {
        while (p % i == 0) { mp[i]++; p /= i; }
    }
    if (p != 1) mp[p]++;
    
    long long ans = 1;
    for (const auto &e : mp) ans *= fast_pow(e.first, e.second / n);

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

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder171
{
    class Program
    {
        static void Main(string[] args)
        {


            var nk = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            var ps = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();

            var psOrdered = ps.OrderBy(x => x).ToArray();

            var sum = 0;
            for(var i = 0;i< nk[1]; i++)
            {
                sum += psOrdered[i];
            }
            Console.WriteLine(sum);
        }
    }
}

Measured memory_bytes: 28732
<?php
$n=fgets(STDIN);
$line=explode(" ",fgets(STDIN));
$max=0;
$result=0;
foreach($line as $a){
    if($a>$max){
        $max=$a;
    }else if($a<$max){
        $result+=($max-$a);
    }
}
echo $result."\n";

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

int main() {
  string s;
  cin >> s;
  int i, j;
  for (i = 0; i < s.length(); i++) {
    for (j = i + 1; j < s.length(); j++) {
      if (s.at(i) == s.at(j)) {
        cout << "no" << endl;
        return 0;
      }
    }
  }
  cout << "yes" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    vector<int> x(N), y(N);
    for(int i = 0; i < N; i++) cin >> x.at(i) >> y.at(i);
    
    vector<pair<int, int>> vec;
    for(int i = 0; i < N; i++) {
        for(int j = 0; j < N; j++) {
            int a = x.at(i) - x.at(j);
            int b = y.at(i) - y.at(j);
            vec.push_back(make_pair(a, b));
        }
    }
    sort(vec.begin(), vec.end());
    
    int ans = 0;
    int tmp = 0;
    pair<int, int> now = vec.at(0);
    for(int i = 0; i < vec.size(); i++) {
        if(vec.at(i).first==0 && vec.at(i).second==0) continue;
        
        if(now==vec.at(i)) tmp++;
        else {
            ans = max(ans, tmp);
            now = vec.at(i);
            tmp = 1;
        }
    }
    
    cout << N - ans << endl;
}


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

int main() {
  int H , W ;
  cin >> H >> W ;
  
  int i ;
  for(i=0 ; i<W+2 ;i++){
  cout << "#" ;
  }
  cout << endl ;
  
  
  string str ;
  int j ;
  for(j=0 ; j<H; j++){
    cin >> str ;
    cout << "#" << str <<"#" << endl;
  }
  
  
  for(i=0 ; i<W+2 ;i++){
  cout << "#" ;
  }
  
}
  



Measured memory_bytes: 256
def solve():
    A = int(input())
    B = int(input())

    isCorrect = [True] * 4
    isCorrect[A] = False
    isCorrect[B] = False

    for i in range(1,4):
        if isCorrect[i]:
            print(i)

if __name__ == '__main__':
    solve()

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


int main() {
    int n,m,x,y;
    cin >> n >> m >> x >> y;
    vector<int> _x(n,0);
    rep(i,n)cin >> _x[i];
    vector<int> _y(m,0);
    rep(i,m)cin >> _y[i];
    sort(_x.begin(),_x.end());
    sort(_y.begin(),_y.end());
    if(_x[n-1] < _y[0] && x < _y[0] && _y[0] <= y){
        cout << "No War" << endl;
    }else{
        cout << "War" << endl;
    }
    return 0;
}

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
import java.util.*;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = a;
		int sum = 0;
		
		while(a > 0) {
			sum += a % 10;
			a /= 10;
		}
		
		if(b % sum == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 21844
// AUTHOR : Kishan Srivastav
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define in freopen("input.txt", "r", stdin)
#define out freopen("output.txt", "w", stdout)
#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);


int main() {
	ios
#ifndef ONLINE_JUDGE
	in;
	out;
#endif
	char c;
	cin>>c;
	if(isupper(c)){
		cout<<"A"<<endl;
	}else{
		cout<<"a"<<endl;
	}


}

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

#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()

#define int long long
using namespace std;
const int INF = 2e18;
const int MOD = 1e9 + 7;
const int MB = 60;

void solve() {
	int n, k;
	cin >> n >> k;
	if (!k) {
		cout << 1;
		return;
	}
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	vector<int> dp(k + 1), pref(k + 1, 1);
	
	for (int i = 0; i < n; i++) {
		for (int j = k; j >= 0; j--) {
			dp[j] = (pref[j] - (j - a[i] - 1 >= 0 ? pref[j - a[i] - 1] : 0) + MOD) % MOD;
		}
		swap(dp, pref);
		for (int j = 1; j <= k; j++) {
			pref[j] = (pref[j - 1] + pref[j]) % MOD;
		}
	}

	cout << (pref[k] - pref[k - 1] + MOD) % MOD;
}

signed main() {
	/*
	freopen("search.in", "r", stdin);
	freopen("search.out", "w", stdout);
	*/
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	cout << fixed;
	cout.precision(12);
	solve();
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    int n;
    cin >> n;

    vector<ll> a(n);
    for (ll& x : a)
        cin >> x;
    sort(a.begin(), a.end(), greater<ll>());

    ll ans = a[0];

    priority_queue<ll> pq;
    pq.push(a[1]); pq.push(a[1]);

    for (int i = 2; i < n; ++i) {
        ans += pq.top();
        pq.pop();

        pq.push(a[i]);
        pq.push(a[i]);
    }
    cout << ans << "\n";
}

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

int main()
{
    long long int n,ans;
    cin>>n;
    ans=(n/1000);
    ans=(ans*1000)-n;
    if(ans<0)
    ans+=1000;
    cout<<ans;
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <assert.h>
#include <vector>
#include <unordered_map>
#include <queue>
#include <climits>
#include <cmath>
#include <algorithm>
using namespace std;

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

  string s, t;
  cin >> s >> t;
  unordered_map<char, vector<int>> idx_map;
  int slen = (int)s.size();
  int tlen = (int)t.size();
  for (int i = 0; i < slen; i++) {
    idx_map[s[i]].push_back(i);
  }
  for (int i = 0; i < tlen; i++) {
    if (idx_map.count(t[i]) == 0) {
      cout << -1 << endl;
      return 0;
    }
  }
  int offset = -1;
  int rep_cnt = 0;
  for (int i = 0; i < tlen; i++) {
    char c = t[i];
    auto it = upper_bound(idx_map[c].begin(), idx_map[c].end(), offset);
    if (it == idx_map[c].end()) {
      rep_cnt++;
      offset = -1;
      it = idx_map[c].begin();
    }
    offset = *it;
  }
  int64_t res = (int64_t) rep_cnt * slen + offset + 1;
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 1228
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <functional>
using namespace std;


int main()
{
	cin.tie(0);
	ios::sync_with_stdio(false);
    int d;
    cin >> d;
    switch(d){
        case 25: cout << "Christmas" << endl; break;
        case 24: cout << "Christmas Eve" << endl; break;
        case 23: cout << "Christmas Eve Eve" << endl; break;
        case 22: cout << "Christmas Eve Eve Eve" << endl; break;
    }
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import static java.lang.Math.*;

public class Main {
    public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		
		// 入力
		int n = sc.nextInt();
		int k = sc.nextInt();
		int x = sc.nextInt();
		int y = sc.nextInt();
		
		// 計算
		long result = 0;
		result = min(n, k)*x + max(0, n-k)*y;
		
		// 出力
		System.out.println(result);
	}
	
	public static class Scanner {
		private BufferedReader br; private StringTokenizer tok;
		public Scanner(InputStream is) throws IOException { br = new BufferedReader(new InputStreamReader(is));}
		private void getLine() throws IOException { while(!hasNext()) tok = new StringTokenizer(br.readLine());}
		private boolean hasNext() { return tok != null && tok.hasMoreTokens();}
		public String next() throws IOException { getLine(); return tok.nextToken();}
		public int nextInt() throws IOException { return Integer.parseInt(next());}
		public long nextLong() throws IOException { return Long.parseLong(next());}
		public double nextDouble() throws IOException { return Double.parseDouble(next());}
	}
}



Measured memory_bytes: 25368
#include<stdio.h>
#include<string.h>
#define M 1046527
#define NIL -1
#define L 14
 
char H[M][L];
 
int main(){
  int i,n,h;
  char s[L],c[9];
 
  for(i=0;i<M;i++)H[i][0]='\0';
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s %s",c,s);
 
    if(c[0]=='i'){
      insert(s);
    }
    else{
      if(find(s)){
	printf("yes\n");
      }
      else{
	printf("no\n");
      }
    }
  }
 
  return 0;
}

int getChar(char ch){
  if(ch=='A')return 1;
  else if(ch=='C')return 2;
  else if(ch=='G')return 3;
  else if(ch=='T')return 4;
  else return 0;
}
 
long long getkey(char str[]){
  long long sum=0,p=1,i;
  for(i=0;i<strlen(str);i++){
    sum+=p*(getChar(str[i]));
    p*=5;
  }
  return sum;
}
 
int h1(int key){
  return key%M;
}
 
int h2(int key){
  return 1+(key%(M-1));
}
 
int find(char str[]){
  long long key,i,h;
  key=getkey(str);
  for(i=0; ;i++){
    h=(h1(key)+i*h2(key))%M;
    if(strcmp(H[h],str)==0)return 1;
    else if(strlen(H[h])==0)return 0;
  }
  return 0;
}
 
int insert(char str[]){
  long long key,i,h;
  key=getkey(str);
  for(i=0; ; i++){
    h=(h1(key)+i*h2(key))%M;
    if(strcmp(H[h],str)==0)return 1;
    else if(strlen(H[h])==0){
      strcpy(H[h],str);
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 14916
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define EPS 1e-9
#define fst first
#define scd second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n,h;
  cin>>n>>h;
  int ans=0;
  pair<int,int> a[100000];
  int mx=0;
  rep(i,n){
    int aa,bb;
    cin>>aa>>bb;
    a[i]=make_pair(bb,aa);
    mx=max(a[i].scd,mx);
  }
  sort(a,a+n);
  repn(i,n-1){
    if(h<=0){break;}
    if(a[i].fst<=mx) break;
    h-=a[i].fst;
    ans++;
  }
  if(h>0){
    ans+=(h/mx);
    if(h%mx!=0) ans++;
  }
  
  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 1792
#pragma GCC optimize(2)
#include<bits/stdc++.h>
#define maxn 300100
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
const ll mod=1e9+7;

ll n, m, dp[55][55][2605];

int main()
{
    cin>>n>>m;
    if (m&1) {cout<<0; return 0;}
    m/=2;
    dp[1][0][0]=1;
    dp[1][1][1]=1;
    for (ll i=2; i<=n; i++)
        for (ll j=0; j<=min(i, n/2); j++)
            for (ll k=0; k<=m; k++)
            {
                ll temp=dp[i-1][j][k];
                //不配对
                dp[i][j+1][k+j+1]=(dp[i][j+1][k+j+1]+temp)%mod;
                //配对一个
                dp[i][j][k+j]=(dp[i][j][k+j]+temp*j*2%mod)%mod;
                //配对两个
                if (j) dp[i][j-1][k+j-1]=(dp[i][j-1][k+j-1]+temp*j%mod*j%mod)%mod;
                //配对当前列
                dp[i][j][k+j]=(dp[i][j][k+j]+temp)%mod;
            }
    cout<<dp[n][0][m];
    return 0;
}


Measured memory_bytes: 55552
#インポート
import sys

#入力用
def ILI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def ISI(): return map(int, sys.stdin.readline().rstrip().split())
def II(): return int(sys.stdin.readline().rstrip())
def ISS(): return sys.stdin.readline().rstrip().split()
def IS(): return sys.stdin.readline().rstrip()

S = IS()
T = IS()
cnt = 0
for i in range(3):
    if S[i] == T[i]:
        cnt += 1
print(cnt)

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

using namespace std;

typedef long long int ll;

int main() 
{

ll n;
cin>>n;
long double a[n];
ll i=0;long double s=0;
while(i<n)
{
    
    cin>>a[i];
    long double s1=a[i];
    long double s2=1;
    long double s3=s2/s1;
    s=s+s3;
    
    i++;
}
    long double k1=1;
    long double z=k1/s;
       cout.setf(ios::fixed,ios::floatfield);
    cout.precision(9);
    
cout<<z;


    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for(ut i=(a);i<(ut)(b);i++)
#define REP(i,b) FOR(i,0,b)
using namespace std;
typedef int ut;
typedef long long LL;
const int SIZE=305;
const LL INF=1<<30;
int maps[SIZE][SIZE];
int CAL[SIZE][SIZE];
int DP[SIZE][SIZE];
int H,W;
LL calc(int a,int b,int x){
	if(max(a,b)==H) return 0;
	if(CAL[a][b]!=-1) return CAL[a][b];
	return CAL[a][b]=calc(a+1,b+1,x)+(maps[a][x]==maps[b][x+1]);
}
LL solve3(int a,int b,int x){
	if(max(a,b)==H) return 0;
	if(DP[a][b]!=-1) return DP[a][b];
	int ans=0;
	ans=calc(a,b,x);
	return DP[a][b]=min(solve3(a,b+1,x),solve3(a+1,b,x))+ans;
}
LL solve2(int x){
	REP(i,SIZE) REP(j,SIZE) DP[i][j]=-1;
	REP(i,SIZE) REP(j,SIZE) CAL[i][j]=-1;
	return solve3(0,0,x);
}
LL solve(){
	cin >> H >> W;
	REP(i,H){
		string s;
		cin >> s;
		REP(j,W){
			maps[H-i-1][j]=s[j]-'a';
		}
	}
	int ans=0;
	REP(i,W-1) ans+=solve2(i);
	return ans;
}
int main(){
 
	cout << solve() << endl;
	return 0;
}

Measured memory_bytes: 1408
#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;
pair<ll,ll> P[101010];
ll A[101010],B[101010];

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N;
	ll ma=0;
	FOR(i,N) {
		cin>>x>>y;
		y++;
		ma=max(ma,(ll)y-x);
		P[i]={y,x};
	}
	
	sort(P,P+N);
	ll L=P[0].second,R=P[0].first;
	A[0]=R-L;
	for(i=1;i<N;i++) {
		L=max(L,P[i].second);
		R=min(R,P[i].first);
		A[i]=max(0LL,R-L);
	}
	L=P[N-1].second,R=P[N-1].first;
	B[N-1]=R-L;
	for(i=N-2;i>=0;i--) {
		L=max(L,P[i].second);
		R=min(R,P[i].first);
		B[i]=max(0LL,R-L);
	}
		
	FOR(i,N) {
		ma=max(ma,A[i]+B[i+1]);
	}
	
	FOR(i,N) swap(P[i].first,P[i].second);
	sort(P+1,P+N);
	ZERO(A);
	ZERO(B);
	L=P[0].first,R=P[0].second;
	A[0]=R-L;
	for(i=1;i<N;i++) {
		L=max(L,P[i].first);
		R=min(R,P[i].second);
		A[i]=max(0LL,R-L);
	}
	L=P[N-1].first,R=P[N-1].second;
	B[N-1]=R-L;
	for(i=N-2;i>=0;i--) {
		L=max(L,P[i].first);
		R=min(R,P[i].second);
		B[i]=max(0LL,R-L);
	}
	
	sort(P,P+N);
	ZERO(A);
	ZERO(B);
	L=P[0].first,R=P[0].second;
	A[0]=R-L;
	for(i=1;i<N;i++) {
		L=max(L,P[i].first);
		R=min(R,P[i].second);
		A[i]=max(0LL,R-L);
	}
	L=P[N-1].first,R=P[N-1].second;
	B[N-1]=R-L;
	for(i=N-2;i>=0;i--) {
		L=max(L,P[i].first);
		R=min(R,P[i].second);
		B[i]=max(0LL,R-L);
	}
	FOR(i,N) {
		ma=max(ma,A[i]+B[i+1]);
	}
	
	
	multiset<int> SL,SR;
	FOR(i,N) SL.insert(P[i].first),SR.insert(P[i].second);
	FOR(i,N) {
		SL.erase(SL.find(P[i].first));
		SR.erase(SR.find(P[i].second));
		
		int AL=*SL.rbegin();
		int AR=*SR.begin();
		ma=max(ma,P[i].second-P[i].first+max(0,AR-AL));
		SL.insert(P[i].first);
		SR.insert(P[i].second);
	}
	
	
	
	cout<<ma<<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: 12800
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(v) v.begin(), v.end()
typedef long long ll;

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

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

int main() {
  int n;
  cin>>n;
  set<string> s;
  rep(i,n){
    string x;
    cin>>x;
    s.insert(x);
  }
  cout << s.size() << endl;
  
  return 0;
}

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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(in.readLine());
    int[] a = new int[n];
    int max = 0;
    int min = 1000;
    String[] str = in.readLine().split(" ");
    for(int i=0; i<n; i++) {
      a[i] = Integer.parseInt(str[i]);
      min = Math.min(min,a[i]);
      max = Math.max(max,a[i]);
    }
    System.out.println(max-min);
  }
}

Measured memory_bytes: 32580
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <fstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <limits>

using namespace std;

//conversion
//------------------------------------------
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(); }

//math
//-------------------------------------------
template<class T> inline T sqr(T x) { return x * x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define EXISTch(s,c) ((((s).find_first_of(c)) != std::string::npos)? 1 : 0)//cがあれば1 if(1)
#define SORT(c) sort((c).begin(),(c).end())

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = (int)1000000007;
const LL MOD = (LL)1000000007;//10^9+7
const LL INF2 = (LL)100000000000000000;//10^18

int main() {

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

	int ans = 0;
	ans = max(ans, n + n - 1);
	ans = max(ans, n + m);
	ans = max(ans, m + m - 1);

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main(void){


 int a, b, c;
 int tmp;
 
 scanf("%d%d%d" , &a , &b , &c);
 
 if(a>b) tmp = a, a = b, b = tmp;
 
 if(b>c) { tmp = b, b = c, c = tmp;
             if(a>b) tmp = a, a = b, b = tmp;
 }
 
 printf("%d %d %d\n",a, b, c);
   
 return 0;
    
}



Measured memory_bytes: 2120
#include<bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define SCIN(n) string(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

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

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<int,int>
#define I vector<int>
#define S set<int>
#define pb(v) push_back(v)
#define V vector
#define rt return
#define rmsame(a) sort(ALL(a)),a.erase(unique(ALL(a)), a.end())
class Edge{
public:
    int from,to,value;
    Edge(int a,int b,int c){
        from = a;
        to = b;
        value = c;
    }
    Edge(int a,int b){
        from = a;
        to = b;
    }
};
int main(){
    CIN(N);
    I vec;
    int ins = 0;
    bool flag = false;
    REP(a,N){
        CIN(b);vec.push_back(b);
        if(a+1==b){
            ins++;
            if(flag){
                ins--;
                flag=false;
            }else{
                flag=true;
            }
        }else{
            if(flag)flag=false;
        }
    }
    COUT(ins);
    return 0;
}


Measured memory_bytes: 892
#include<bits/stdc++.h>
using namespace std;
long long n;
int main(){
    cin>>n;
    int k;
    for(long long i=sqrt(n);i>=1;i--){
        if(n%i==0){
            k=max(i,n/i);
            break;
        }
    }
	int sum=0;
    while(k!=0){
        sum++;
        k/=10;
    }
    cout<<sum;
    return 0;
}

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

int main(){
    int n,p[N+1],m[N+1][N+1],i,l,j,k;
    scanf("%d",&n);
    for(i = 1; i <= n; i++) scanf("%d%d",&p[i-1],&p[i]);
    for(i = 1; i <= n; i++) m[i][i] = 0;
    for(l = 2; l <= n; l++){
        for(i = 1; i <= n-l+1; i++){
            j = i + l - 1;
            m[i][j] = 100000000;
            for(k = i; k <= j-1; k++){
                if(m[i][j] > m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]) m[i][j] = m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j];
                //m[i][j] = min(m[i][j],m[i][k]+m[k+1][j]+p[i-1]*p[k]*p[j]);
            }
        }
    }
    printf("%d\n",m[1][n]);

    return 0;
}


Measured memory_bytes: 2088
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <queue>
#include <utility>
using namespace std;

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

#define For(i, a, b) for(int i = (a); i < (b); i++)
#define Rep(i, n) For(i, 0, (n))
#define Rrep(i, n) for(int i = (n - 1); i >= 0; i--)
#define pb push_back

const int inf = 999999999;
const int mod = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

int main(){
	int n; cin >> n; int a[n], mi = inf, ma = -inf, mi_i = 0, ma_i = 0;
	Rep(i, n){
		int x; cin >> x; a[i] = x;
		if(x < mi) mi = x, mi_i = i + 1;
		if(x > ma) ma = x, ma_i = i + 1;
	}
	if(mi < 0){
		if(abs(mi) > abs(ma)){
			cout << 2 * (n - 1) << endl;
			Rep(i, n ) if(i != mi_i - 1) cout << mi_i << " " << (i + 1) << endl;
			Rrep(i, n - 1) cout << (i + 2) << " " << (i + 1) << endl;
		}else{
			cout << 2 * (n - 1) << endl;
			Rep(i, n) if(i != ma_i - 1) cout << ma_i << " " << (i + 1) << endl;
			Rep(i, n - 1) cout << (i + 1) << " " << (i + 2) << endl;
		}
	}else{
		cout << n - 1 << endl;
		Rep(i, n - 1) cout << (i + 1) << " " << (i + 2) << endl;
	}
	return 0;
}

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

const int nmax=10010;

int N,Q;

int par[nmax];
void init(){rep(i,nmax) par[i]=i;}
int find(int x){return (par[x]==x)?x:par[x]=find(par[x]);}
void unite(int a,int b){a=find(a),b=find(b);par[a]=b;}
bool same(int a,int b){return find(a)==find(b);}

int main(void){
	cin >> N >> Q;
	init();
	rep(i,Q){
		int t,a,b;
		cin >> t >> a >> b;
		if(t)
			cout << same(a,b) << endl;
		else
			unite(a,b);
	}
	return 0;
}

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

int main() {
  char a[100];
  int length = 0;
  int counter = 0;
  
  cin >> a;
  length = strlen(a);
  
  for(int i=0; i<length/2; i++){
      if(a[i] != a[length-i-1]){
          counter++;
      }
  }
  cout << counter << endl;
}

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

using namespace std;

typedef long long lli;
typedef pair<int, int> P;

const lli N = 100000;
const lli M = 1000000007;

int n, h, data[N], a, b, size;
lli fact[N];
vector<int> vec;
vector<P> r;

int insert(int key){
  int res = 0;
  if(vec.size()){
    vector<int>::iterator ite = lower_bound(vec.begin(), vec.end(), key);
    res = distance(vec.begin(), ite);
    vec.insert(ite, key);
  }else vec.push_back(key);
  return res;
}

lli calc(){
  lli res = 0;
  vec.clear();
  vec.push_back(N);
  for(int i=0;i<n;i++) if(data[i] != i) r.push_back(P(data[i], i));
  for(int i=0;i<n;i++){
    lli tmp = insert(data[i]);
    //cout << i << ' ' << data[i] << ' ' << tmp << ' ' << n-1-i << endl;
    res += ((data[i] - tmp) * fact[n-1-i]) % M;
    res %= M;
  }
  return res;
}

main(){
  fact[0] = 1;
  for(int i=1;i<N;i++) fact[i] = (fact[i-1] * i) % M;
  while(cin >> n && n){
    for(int i=0;i<n;i++) data[i] = i;
    cin >> h;
    for(int i=0;i<h;i++){
      cin >> a >> b;
      a--; b--;
      swap(data[a], data[b]);
    }
    cout << calc() << endl;
  }
}

Measured memory_bytes: 2852
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int a = sc.nextInt();

        if (h % a == 0) {
            System.out.println(h / a);
        } else {
            System.out.println(h / a + 1);
        }
    }
}


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

long long P, Q, A, N;
long long ANS = 0;

void DFS(long long X, long long Y, long long L, long long M, long long C) { //X/Y, ...+1/L, Mul=M, Count=C
	if (C == N - 1) {
		if (Y % X == 0 && L <= (Y / X) && M * (Y / X) <= A) ANS++;
		return;
	}
	for (long long i = L; ; i++) {
		if (M * i > A) break;
		if (X * i - Y < 0) continue;
		if (X * i - Y == 0) {
			ANS++;
			continue;
		}
		DFS(X * i - Y, Y * i, i, M * i, C + 1);
	}
	return;
}

int main() {
	while (cin >> P >> Q >> A >> N) {
		if (P == 0 && Q == 0 && A == 0 && N == 0) return 0;
		ANS = 0;
		DFS(P, Q, 1, 1, 0);
		cout << ANS << endl;
	}
}


Measured memory_bytes: 3024
#include<stdio.h>
#define NIL -1
#define MAX 10010
struct Node{int p, l, r;
};
struct Node T[MAX];
int n,D[MAX], H[MAX];


int wowDep(int x){
  int depth = 0;
  while(1){
    x = T[x].p;
    if ( x == NIL ) break;
    depth++;
  }
  return depth;
} 

int wowSib(int x){
  if ( T[x].p == NIL ) return NIL;
  if ( T[T[x].p].l != x && T[T[x].p].l != NIL ) return T[T[x].p].l;
  if ( T[T[x].p].r != x && T[T[x].p].r != NIL ) return T[T[x].p].r;
  return NIL;
}

void print(int a){
      int d;
    d=0;
    printf("node %d: ", a);
  printf("parent = %d, ", T[a].p);
  printf("sibling = %d, ", wowSib(a));

  if ( T[a].l != NIL ) d++;
  if ( T[a].r != NIL ) d++;
  printf("degree = %d, ", d);
  printf("depth = %d, ", D[a]);
  printf("height = %d, ", H[a]);

  if ( T[a].p == NIL ){
    printf("root\n");
  } else if ( T[a].l == NIL && T[a].r == NIL ){
    printf("leaf\n");
  } else {
    printf("internal node\n");
  }
}


int main(){
  int i, v, l, r,n,m;
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ) {
    T[i].p = NIL;
  }

  for ( i = 0; i < n; i++ ){
    scanf("%d %d %d", &v, &l, &r);
    T[v].l = l;
    T[v].r = r;
    if ( l != NIL ) T[l].p = v;
    if ( r != NIL ) T[r].p = v;
  }

  for ( i = 0; i < n; i++ ){
    D[i] = wowDep(i);
    H[i] = 0;
  }

  for ( i = 0; i < n; i++ ){
    if ( T[i].l == NIL && T[i].r == NIL ) { // is leaf
      H[i] = 0;
      int p = T[i].p;
      int c = 1;
      while(1){
	if ( p == NIL ) break;
	if ( H[p] < c ) H[p] = c;
	c++;
	p = T[p].p;
      }
    }
  }

  for ( i = 0; i < n; i++ ) print(i);
  return 0;
}



Measured memory_bytes: 2088
import itertools
H, W = [int(_) for _ in input().split()]
S = [input() for _ in range(H)]
for i, j in itertools.product(range(H), range(W)):
    if S[i][j] == '#':
        cand = [i - 1, j], [i + 1, j], [i, j - 1], [i, j + 1]
        exist = False
        for x, y in cand:
            if x < 0 or H <= x or y < 0 or W <= y:
                continue
            else:
                if S[x][y] == '#':
                    exist = True
        if not exist:
            print('No')
            exit()
print('Yes')


Measured memory_bytes: 3064
//123 B
#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <math.h>
#include <vector>
using namespace std;

//B
int main(){
    int n; cin>>n;
    bool ok=false;
    //しらみつぶし
    for(int i=0;i<=n/4;i++){
        for(int j=0;j<=n/7;j++){
            if(4*i+7*j==n) ok=true;
        }
    }
    if(ok) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	long long c1, c5, c10, c50, c100, c500 , m;
	scanf("%llu%llu%llu%llu%llu%llu",&c1,&c5,&c10,&c50,&c100,&c500);
	m = c1 *1+ c5 *5+ c10 *10+ c50 *50+ c100 *100+ c500 *500;
	if (m >= 1000){
		printf("1\n");
	}
	else{
		printf("0\n");
	}
	return 0;
}

Measured memory_bytes: 1016
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

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

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

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

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

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

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

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

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

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

    println!("{}", solve(&s));
}

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
// r#"2018 218"# => "Yes",
// r#"2763 0"# => "No",
r#"5 3 2"# => "NO",

}

fn solve(src: &str) -> String {
    input! {
        source = src,
        a: i64,
        b: i64,
        x: i64,
    }

    if x >= a && a + b - x >= 0 {
        "YES"
    } else {
        "NO"
    }.to_string()
}

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

using namespace std;
using ll = long long;
using v1 = vector<int>;
using v2 = vector<vector<int>>;
using v3 = vector<vector<char>>;

int main(){
	string s;
	cin >> s;
	rep(i,3){
		cout << s.at(i);
	}
	cout << endl;
}


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

#define MAXN 100000000
int mins(int a,int b){
  if(a<0)return b;
  else if(b<0 || a<b)return a;
  else return b;
}
int main(void){
  int i=0,j=0,k=0;
  int e=0;
  scanf("%d",&e);

  while(e!=0){

 
    int gl[10][10]={0};
    int ma=0;
    for(i=0;i<10;i++){
      for(j=0;j<10;j++){
	gl[i][j]=MAXN;
      }
    }
    //memset(gl,MAXN,sizeof(gl));
    for(i=0;i<e;i++){
      scanf("%d%d",&j,&k);
      if(ma<j || ma<k)ma=(j<k)?k:j;
      scanf("%d",&(gl[j][k]));
      gl[k][j]=gl[j][k];
    }
    for(i=0;i<=ma;i++){
      gl[i][i]=0;
    }
    //printf("%d\n",ma);
    for(k=0;k<=ma;k++){
      for(i=0;i<=ma;i++){
	for(j=0;j<=ma;j++){
	  gl[i][j]=mins(gl[i][j],gl[i][k]+gl[k][j]);
	  //printf("%d\x0020%d%d\n",gl[i][j],i,j);
	}
      }
    }
    int sum=0;
    int summem=-1;
    int mn=0;
    for(i=0;i<=ma;i++){
      for(j=0;j<=ma;j++){
	sum+=gl[i][j];
      }
      if(summem==-1 || sum < summem){
	summem=sum;
	mn=i;
      }
      sum=0;
    }

    printf("%d\x0020%d\n",mn,summem);

    scanf("%d",&e);
  }
  return 0;
}

Measured memory_bytes: 1028
#pragma warning(disable:4786)
#pragma warning(disable:4996)
#include<list>
#include<bitset>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<functional>
#include<string>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<utility>
#include<fstream>
#include<sstream>
#include<cmath>
#include<stack>
#include<assert.h>
using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))
#define CLR(a) memset(a, 0, sizeof(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(X) ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X) ( (X) * (X) )
#define SZ(V) (int )V.size()
#define FORN(i, n) for(i = 0; i < n; i++)
#define FORAB(i, a, b) for(i = a; i <= b; i++)
#define ALL(V) V.begin(), V.end()
#define IN(A, B, C)  ((B) <= (A) && (A) <= (C))

typedef pair<int,int> PII;
typedef pair<double, double> PDD;
typedef vector<int> VI;
typedef vector<PII > VP;

#define AIN(A, B, C) assert(IN(A, B, C))

//typedef int LL;
typedef long long int LL;
//typedef __int64 LL;

LL dig(LL A) {
	int cnt = 0;
	while (A) {
		cnt++;
		A /= 2;
	}
	return cnt;
}

LL solve(LL A, LL B) {
	if (A == 0) {
		if (B == 0) return 1;
		return 1 + solve(A + 1, B);
	}

	if (A == B) return 1;
	if (A > B) return 0;

	// 0 < A < B
	
	LL dgA = dig(A), dgB = dig(B);
	if (dgA == dgB) {
		return solve(A - (1LL << (dgA - 1)), B - (1LL << (dgB - 1)));
	}

	LL ret = 0;
	for (int i = dgA + 1; i < dgB; i++) {
		ret += (1LL << (i - 1)) * 2;
	}
	ret += ((1LL << dgA) - 1) - A + 1;

	LL last = B & ((1LL << dgA) - 1);
	if (B - (1LL << (dgB - 1)) >= A - 1) {
		ret += 1LL << dgA;
	}
	else {
		LL tmp = dig(last);
		if (tmp == dgA) {
			// first 1
			ret += 1LL << dgA;
		}
		else {
			ret += solve(0, last);
			ret += ((1LL << dgA) - 1) - A + 1;
		}
	}
	return ret;

}

int main()
{
	LL A, B;
	scanf("%lld %lld", &A, &B);
	LL ans = solve(A, B);
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 256
import math
import fractions
import sys
input = sys.stdin.readline

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors

def ValueToBits(x,digit):
    res = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        res[i]=now%2
        now = now >> 1
    return res

def BitsToValue(arr):
    n = len(arr)
    ans = 0
    for i in range(n):
        ans+= arr[i] * 2**i
    return ans

def ValueToArray10(x, digit):
    ans = [0 for i in range(digit)]
    now = x
    for i in range(digit):
        ans[digit-i-1] = now%10
        now = now //10
    return ans
'''
def cmb(n, r, p):
    if (r < 0) or (n < r):
        return 0
    r = min(r, n - r)
    return fact[n] * factinv[r] * factinv[n-r] % p

p = 2
N = 10 ** 6 + 2
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N + 1):
    fact.append((fact[-1] * i) % p)
    inv.append((-inv[p % i] * (p // i)) % p)
    factinv.append((factinv[-1] * inv[-1]) % p)

'''

#a = list(map(int, input().split()))

#################################################
#################################################
#################################################
#################################################


s = input()

if(s[0]=='7' or s[1]=='7' or s[2] =='7'):
    print('Yes')
else:
    print('No')



















Measured memory_bytes: 72776
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define elif else if
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
mt19937_64 rang(chrono::high_resolution_clock::now().time_since_epoch().count());
int rng(int lim) {
	uniform_int_distribution<int> uid(0,lim-1);
	return uid(rang);
}

const int N = 3e5, M = N;
//=======================
void solve() {
 int n,m,k,i;
 cin >> n >> m >> k;
 vi a(n),b(m);
 fo(i,n)  cin >> a[i];
 fo(i,m)  cin >> b[i];
 vl asum,bsum;
 asum.pb(0);
 bsum.pb(0);
 asum.pb(a[0]);
 bsum.pb(b[0]);
 Fo(i,1,n){
   asum.pb( asum.back() + a[i]);
 }
 Fo(i,1,m){
  bsum.pb( bsum.back() + b[i]);
 }
 int ans = 0;
 for(int cnt = 0; cnt < asum.size(); cnt++){
    if(k-asum[cnt] >=0){
    auto it = upper_bound(all(bsum),k-asum[cnt]);
    int d = (it-bsum.begin()) + cnt;
    ans = max(ans, d);
    }
  }
cout << ans-1;
}

int main() {
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());

    int t = 1;
    // cin >> t;
    while(t--) {
      solve();
    }

    return 0;
}




Measured memory_bytes: 9528
#include <bits/stdc++.h>
#define MAX 100005
#define mp make_pair
using namespace std;

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

int cnt1[MAX], cnt2[MAX], arr[MAX], vis1[MAX], vis2[MAX];
priority_queue<ii> pq1, pq2;

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    #ifdef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
    #endif
    int n;

    cin>>n;

    for(int i = 0; i < n; i++){
        cin>>arr[i];
        (i % 2) ? cnt2[arr[i]]++ : cnt1[arr[i]]++;
    }

    for(int i = 0; i < n ; i++){
        if(i % 2 && !vis2[arr[i]]){
            vis2[arr[i]] = 1;
            pq2.push(mp(cnt2[arr[i]], arr[i]));
        }
        else if(i % 2 == 0 && !vis1[arr[i]]){
            vis1[arr[i]] = 1;
            pq1.push(mp(cnt1[arr[i]], arr[i]));
        }
    }

    ii u = pq1.top(), v = pq2.top();
    int ans;
    if(u.second != v.second){
        ans = (n / 2) - u.first + (n / 2) - v.first;
        cout<<ans<<endl;
        return 0;
    }

    int p = 0, q = 0, r = 0, s = 0;
    p = u.first;
    pq1.pop();
    q = v.first;
    pq2.pop();
    if(!pq1.empty())
        r = pq1.top().first;
    if(!pq2.empty())
        s = pq2.top().first;

    ans = (n / 2) - p + (n / 2) - s;
    ans = min(ans, (n / 2) - q + (n / 2) - r);

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

Measured memory_bytes: 3196
// priority_queue is generally max heap to make it min heap use priority_queue<int,vector<int>,greater<int>> pq;"
#include <bits/stdc++.h>
#define int                 long long int
#define double              long double
#define get(a,n)            for(int i=0;i<n;i++){cin>>a[i];}
#define maxm(a)             int maxi=LLONG_MIN;int index;for(int i=0;i<n;i++){if(maxi<a[i]){maxi=a[i];index=i;}}
#define minm(a)             int mini=LLONG_MAX;int index;for(int i=0;i<n;i++){if(mini>a[i]){mini=a[i];index=i;}}
#define db(x)               cout<<"["<<x<<"]"<<endl;
#define vv                  vector
#define endl                "\n"
#define PI                  acos(-1)
#define half(a)             a%2?(a/2+1):a/2
#define array               int a[n];for(int i=0;i<n;i++){cin>>a[i];}
#define pb                push_back
#define all(a)              a.begin(),a.end()
#define mod                 1000000007
#define no                  "NO"
#define yes                 "YES"
using namespace std;
template <typename T>
void printvec(vector<T>& vec){
	for(int i=0;i<vec.size();i++) cout<<vec[i]<<" ";
	cout<<endl;
}
vector<bool> is_prime(100000+1, true);
void seive(int n)
{
    is_prime[0] = is_prime[1] = false;
    for (int i = 2; i * i <= n; i++) {
        if (is_prime[i]) {
            for (int j = i * i; j <= n; j += i)
                is_prime[j] = false;
        }
    }
}
//this function returns 0 indexing array if the required element
//is less than minimum it returns -1 and greater than max it returns n.
int special_binary(int *a,int n,int x)
{
    int l=0;int r=n-1;int m=0;int f=x;int c=0;
     while(l<=r)
     {
       if(f>a[n-1])
        return n;
       m=(l+r)/2;
       if(a[m]<=f)
       {
           c=m+1;
           l=m+1;
       }
       else
       {
           r=m-1;
       }
     }
     return c-1;
}
void show(int *a,int n)
{
    int size = n;
    for(int i=0;i<size;i++)
    {
            cout<<a[i]<<" ";
    }   
    cout<<endl;
}
int binary_search(int *a,int n,int e)
{
    int f,l,m;f=0;l=n-1;
    while(f<=l)
    {//returns index of that value.
        m=(f+l)/2;
        if(e==a[m])
            return(m);
        else if(e>a[m])
                f=m+1;
            else
                l=m-1;
    }
    return -1;
}
bool cmp(const pair<int,int> &a,const pair<int,int> &b)
{
    return (a.second<b.second);
}
void solve()
{
    int n;
    cin>>n;
    int dp[n+1];
    int h[n+1];
    for(int i=1;i<=n;i++)
    {
        cin>>h[i];
    }
    dp[1]=0;
    dp[2]=dp[1]+abs(h[2]-h[1]);
    for(int i=3;i<=n;i++)
    {
        dp[i]=min(dp[i-1]+abs(h[i-1]-h[i]),dp[i-2]+abs(h[i-2]-h[i]));
    }
   cout<<dp[n]<<endl;
}

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout << fixed << setprecision(15);
    int t=1;
    //cin>>t;
    //seive(100000);
    while(t--)
    {
        solve();
        
    }
   

  
}

Measured memory_bytes: 5164
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
 
#define FOR(i,k,n) for((i)=(k);(i)<(n);(i)++)
#define REP(i,n) for (int i=0;i<=(n);i++)
#define pb push_back
#define VSORT(S) sort(S.begin(), S.end());
using namespace std;
 
int main(){
	int S,K,i,j,count;
	count = 0;
	
	cin>>K; cin>>S;
 
	REP(i,K){
		REP(j,K)
		if((S-K<=i+j)&&(i+j<=S)) count++;
	}
 
	cout<<count<<endl;
	return 0;
}

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

using namespace std;

static const int INF = 100000000;

int d[101][101];

int main(int argc, char *argv[]) {
	int N, M;
	cin >> N >> M;

	vector<vector<pair<int, int>>> es(N+1);
	for (int i = 1; i <= N; i++)
		for (int j = 1; j <= N; j++)
			d[i][j] = (i == j) ? 0 : INF;

	for (int i = 0; i < M; i++) {
		int a, b, c;
		cin >> a >> b >> c;
		d[a][b] = d[b][a] = c;
		es[a].push_back(make_pair(b, c));
	}

	for (int k = 1; k <= N; k++)
		for (int i = 1; i <= N; i++)
			for (int j = 1; j <= N; j++)
				if (d[i][j] > d[i][k] + d[k][j])
					d[i][j] = d[i][k] + d[k][j];

	int ans = 0;
	for (int k = 1; k <= N; k++) {
		for (auto e : es[k]) {
			int l = e.first;
			int c = e.second;
			bool used = false;
			for (int i = 1; i <= N; i++) {
				for (int j = 1; j <= N; j++) {
					if (d[i][j] == d[i][k] + c + d[l][j]) used = true;
				}
			}
			if (!used) ans++;
		}
	}

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

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		int count = sc.nextInt();
		int sogaku = sc.nextInt();

		if((500 * count) >= sogaku) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 23124
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

int main() {
	int m, d; cin >> m >> d;
	int ans = 0;
	for(int i = 1; i <= m; ++i) {
		for(int j = 1; j <= d; ++j) {
			int a = j / 10;
			int b = j % 10;
			if(a < 2 or b < 2) continue;
			if(i == a * b) ++ans;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256