akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
#define X first
#define Y second
#define pb push_back
#define fastio ios_base::sync_with_stdio(false);cout.tie(0);cin.tie(0);

const ll mod=1e9+7;
const ll MAXN=1e6+5;
const ll inf=1e18;

vector<vector<ll > > adj(MAXN,vector<ll >());

int main()
{
    fastio;
    ll h,w;
    cin>>h>>w;
    vector<vector<char > > ch(h+2,vector<char >(w+2));
    for(int i=1;i<=h;i++){
        for(int j=1;j<=w;j++){
            cin>>ch[i][j];
        }
    }
    for(int i=1;i<=h;i++){
        for(int j=1;j<=w;j++){
            if(ch[i][j]=='.'){
                if(ch[i-1][j]=='.'){
                    adj[i*100+j].pb((i-1)*100+j);
                }
                if(ch[i+1][j]=='.'){
                    adj[i*100+j].pb((i+1)*100+j);
                }
                if(ch[i][j+1]=='.'){
                    adj[i*100+j].pb(i*100+j+1);
                }
                if(ch[i][j-1]=='.'){
                    adj[i*100+j].pb(i*100+j-1);
                }
            }
        }
    }
    ll mx=-inf;
    for(int i=1;i<2030;i++){
        if(adj[i].size()>0){
            queue<ll > q;
            vector<bool > used(2030,false);
            vector<ll > d(2030,inf);
            q.push(i);
            d[i]=0;
            used[i]=true;
            while(!q.empty()){
                ll u=q.front(); q.pop();
                for(auto to:adj[u]){
                    if(!used[to]){
                        d[to]=min(d[to],d[u]+1);
                        mx=max(mx,d[to]);
                        //cout<<u<<" "<<to<<" "<<d[to]<<" "<<mx<<endl;
                        used[to]=true;
                        q.push(to);
                    }
                }
            }
        }
    }
    cout<<mx<<endl;
}


Measured memory_bytes: 23680
#include <bits/stdc++.h>
using namespace std;
int main(){
    string N;cin>>N;
    if(N[N.size()-1]=='2'||N[N.size()-1]=='4'||N[N.size()-1]=='5'||N[N.size()-1]=='7'||N[N.size()-1]=='9')cout<<"hon";
    else if(N[N.size()-1]=='0'||N[N.size()-1]=='1'||N[N.size()-1]=='6'||N[N.size()-1]=='8')cout<<"pon";
    else cout<<"bon";
}

Measured memory_bytes: 3624
import std.stdio, std.conv, std.functional, std.string;
import std.algorithm, std.array, std.container, std.range, std.typecons;
import std.numeric, std.math, std.random;
import core.bitop;

string FMT_F = "%.10f";

static string[] s_rd;
T RD(T = long)() { while(!s_rd.length) s_rd = readln.chomp.split; string res = s_rd[0]; s_rd.popFront; return res.to!T; }
string RDR()() { return readln.chomp; }
T[] ARR(T = long)(in string str, T fix = 0) { auto r = str.split.to!(T[]); r[] += fix; return r; }
T[] RDA(T = long)(T fix = 0) { auto r = readln.chomp.split.to!(T[]); r[] += fix; return r; }
T[][] RDA2(T = long)(size_t n, T[] fix = []) { auto r = new T[][](n); foreach (i; 0..n) { r[i] = readln.chomp.split.to!(T[]); foreach (j, e; fix) r[i][j] += e; } return r; }
size_t[] MAKE_IDX(alias less = "a < b", Range)(Range range) { auto idx = new size_t[](range.length); makeIndex!(less)(range, idx); return idx;}
size_t MIN_POS(alias less = "a < b", Range)(Range range) { auto r = minPos!(less)(range); return range.length - r.length; }

bool inside(T)(T x, T b, T e) { return x >= b && x < e; }
long lcm(long x, long y) { return x * y / gcd(x, y); }

long mod = 10^^9 + 7;
//long mod = 998244353;
//long mod = 1_000_003;
void moda(ref long x, long y) { x = (x + y) % mod; }
void mods(ref long x, long y) { x = ((x + mod) - (y % mod)) % mod; }
void modm(ref long x, long y) { x = (x * y) % mod; }

void main()
{
	auto S = RD!string;
	auto T = S.idup;
	long ans = 1;
	auto last = [S[0]];
	S.popFront;
	while (!S.empty)
	{
		if (last.length == 2)
		{
			last = [S[0]]; S.popFront;
			++ans;
		}
		else if (S[0] == last[0])
		{
			if (S.length == 1)
			{
				break;
			}
			last = S[0..2];
			S    = S[2..$];
			++ans;
		}
		else
		{
			last = [S[0]]; S.popFront;
			++ans;
		}
	}

	long ans2 = 1;
	last = [T[0], T[1]];
	T = T[2..$];
	while (!T.empty)
	{
		if (last.length == 2)
		{
			last = [T[0]]; T.popFront;
			++ans2;
		}
		else if (T[0] == last[0])
		{
			if (T.length == 1)
			{
				break;
			}
			last = T[0..2];
			T    = T[2..$];
			++ans2;
		}
		else
		{
			last = [T[0]]; T.popFront;
			++ans2;
		}
	}

	writeln(ans);
	stdout.flush();
	debug readln();
}


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

typedef long long ll;
#define rep(i, n) for(ll i=0; i<n; i++)
#define FOR(i, a, b) for(ll i=a; i<b; i++)
#define sz(v) ll(v.size)

const long long MOD = 2;


int main(){
    ll N, M;
    cin >> N >> M;
    vector<ll> K(M);
    vector<vector<ll>> S;
    vector<ll> P(M);
    rep(i, M) {
        cin >> K[i];
        vector<ll> s(K[i]);
        rep(j, K[i]) {
            cin >> s[j];
        }
        S.push_back(s);
    }
    rep(i, M) {
        cin >> P[i];
    }
    ll cc = 0;
    rep(i, 1 << N) {
        bool flag = true;
        rep(j, M) {
            ll counter = 0;
            rep(k, N) {
                if (i>>k&1 == 1 && find(S[j].begin(), S[j].end(), k+1) != S[j].end()) counter++;
            }
            if (counter % 2 != P[j]) flag = false;
        }
        if (flag) cc++;
    }
    cout << cc << endl;
    return 0;
}


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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 55;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

struct UnionFind
{
  vector<int> par;
  vector<int> siz;
  UnionFind(int N) : par(N), siz(N, 1) {for (int i = 0; i < N; i++) par[i] = i;}
  void init(int N) {
    siz.assign(N, 1);
    par.resize(N);
    for(int i = 0; i < N; ++i) par[i] = i;
  }
  int root(int x) {
    while(par[x] != x) {x = par[x] = par[par[x]];}
    return x;
  }
  bool unite(int x, int y)
  {
    x = root(x);
    y = root(y);
    if(x == y) return false;
    if(siz[x] < siz[y]) swap(x, y);
    siz[x] += siz[y];
    par[y] = x;
    return true;
  }
  bool isSame(int x, int y) {return root(x) == root(y); }
  int size(int x) { return siz[root(x)]; }
};

int main()
{
  char x, y; cin >> x >> y;
  if(x > y) cout << ">" << endl;
  else if(x < y) cout << "<" << endl;
  else cout << "=" << endl;
}


Measured memory_bytes: 3580
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define REP(X, Y, Z) for (ll(X) = (Y); (X) < (Z); (X)++)
#define REV(X, Y, Z) for (ll(X) = (Y); (X) > (Z); (X)--)

using namespace std;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;

constexpr ll kMod = 1e9 + 7;

ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

int main() {
  init();

  string S;
  cin >> S;
  vll V(S.size(), 0);

  REP(i, 0, S.size()) {
    int le = i;
    while (i + 1 < S.size() && S[i] == S[i + 1]) {
      i++;
    }

    int len = i - le + 1;
    if (S[i] == 'L') {
      V[le] += (len + 1) / 2;
      V[le - 1] += len / 2;
    } else {
      V[i] += (len + 1) / 2;
      V[i + 1] += len / 2;
    }
  }

  cout << V[0];
  REP(i, 1, S.size()) {
    cout << " " << V[i];
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 1488
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, from, to) for (int i = from; i < (to); ++i)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
using ll = long long;
using vin=vector<int>;
using vll=vector<ll>;
using P = pair<int, int>;
const int inf=1e9+7;
const ll INF=1e18;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

int main() {
  int n;
  cin>>n;
  map<int,int> cnt;
  rep(i,0,n){
   int a;
    cin>>a;
    cnt[a]++;
  }
  int sum=0;
  int ans=0;
  for(auto v:cnt){
    if(v.second>1)sum+=v.second-1;
  }
  int f=(sum+1)/2;
  ans=n-f*2;
  cout<<ans<<endl;
  ///
}

Measured memory_bytes: 8240
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define mod 1000000007
#define dbg(n) cout<<#n<<' '<<n<<endl;
#define dbg_v(v) cout<<#v<<":";for(int i=0;i<(int)v.size();i++) cout<<" "<<v[i]; cout<<endl;
int gcd(ll a,ll b){
	if(!a)
		return b;
	return gcd(b%a,a);
}
int main(){ 
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);	
	int t=1;
	//cin>>t;
	while(t--){
		ll n,m;
		cin>>n>>m;
		ll a[n];
		ll lc;
		cin>>a[0];
		a[0]/=2;
		lc=a[0];
		int f=0;
		for (int i = 1; i < n; i++)
		{
			cin>>a[i];
			a[i]/=2;
		}
		ll mx=-1e18;
		for(int i=1;i<n;i++){
			ll gc=gcd(lc,a[i]);
			lc=((lc/gc)*a[i]);
			mx=max(lc,mx);
			if(lc>m||lc<mx){
				f=1;
				break;
			}
		}
		if(f)
			cout<<0<<endl;
		else{
			f=0;
			for(int i=0;i<n;i++){
				if(lc/a[i]%2==0)
					f=1;
			}
			if(f)cout<<0<<endl;
			else{
			ll ans=(m/lc+1LL)/2LL;
			cout<<ans<<endl;
		}
		}
	}
}



Measured memory_bytes: 4436
#!/usr/bin/perl

$line = 0;
while (<>) {
    if ($line == 0) {
        ($n, $t) = split /\s/, $_;
    } else {
        @a = split /\s/, $_;
    }
    $line++;
}

foreach (@a) {
    if (!defined $min || $min > $_) {
        $min = $_;
    } else {
        $div = $_ - $min;
        if (!defined $divmax) {
            $divmax = $div;
            $divmaxs = 1;
        } elsif ($divmax < $div) {
            $divmax = $div;
            $divmaxs = 1;
        } elsif ($divmax == $div) {
            $divmaxs++;
        }
    }
}

print "$divmaxs\n";


Measured memory_bytes: 17228
require 'set'

N,M = gets.chomp.split.map(&:to_i)
P,S = M.times.map{gets.split.map(&:to_s)}.transpose
allac=Set.new
nowac=Set.new
wa=0

for m in 0..M-1
  if S[m] == "AC"
    allac.add(P[m])
  end
end
for m in 0..M-1
  if S[m] == "AC"
    nowac.add(P[m])
  elsif S[m] == "WA"
    if allac.include?(P[m])
      if !nowac.include?(P[m])
        wa += 1
      end
    end
  end
end
puts "#{allac.size} #{wa}"

Measured memory_bytes: 41596
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <functional>

using namespace std; using ll=long long; using ld=long double; using P=pair<ll,ll>; const int INF=1e9; const ll LINF=1e18;

template<typename T, typename U, typename O> void caut(T a, U b, O c){cout<<"("<<a<<","<<b<<","<<c<<") ";}
template<typename T, typename U> void caut(T a, U b){cout<<"("<<a<<","<<b<<") ";}
template<typename T> void caut(T a){cout<<"("<<a<<") ";}

int main() {
  int n,k; cin>>n>>k;
  int d[n]={};
  for(int i=0;i<n;i++) {
    int a; cin>>a; a--; d[a]++;
  }
  vector<int> v;
  int p=0;
  for(int i=0;i<n;i++) {
    if (d[i]>0) {
      p++; v.push_back(d[i]);
    }
  }
  sort(v.begin(),v.end());
  int an = 0;
  for(int i=0;i<p-k;i++) {
    an+=v[i];
  }
  cout<<an<<endl;
}

Measured memory_bytes: 2168
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int n,w;
	cin>>n>>w;
	long weight[n];
	long cost[n];
	for(long i=0;i<n;i++){
	    cin>>weight[i]>>cost[i];
	}long m=n*1000;
	long dp[n+1][m+1];
	for(long i=0;i<=n;i++){
	    dp[i][0]=0;
	}
	for(long i=0;i<=m;i++){
	    dp[0][i]=0;
	}
	for(long i=0;i<=m;i++){
	    dp[1][i]=INT_MAX;
	}
	dp[1][0]=0;
	dp[1][cost[0]]=weight[0];
	for(long i=2;i<=n;i++){
	    for(long j=1;j<=m;j++){
	        dp[i][j] = dp[i-1][j];
	        if(j>=cost[i-1]){
	            dp[i][j] = min(dp[i][j],weight[i-1]+dp[i-1][j-cost[i-1]]);
	        }
	    }
	}
	for(long i=m;i>=0;i--){
	    if(dp[n][i]<=w){
	        cout<<i<<'\n';
	        break;
	    }
	}
 
}

Measured memory_bytes: 82524
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stdlib.h>
#include <math.h>
#include <numeric>


int main() {
	int a, b;

	std::cin >> a >> b;

	std::cout << std::max(a * b, std::max(a - b, a + b));

	return 0;
}

Measured memory_bytes: 256
import sys
import heapq, math
from itertools import zip_longest, permutations, combinations, combinations_with_replacement
from itertools import accumulate, dropwhile, takewhile, groupby
from functools import lru_cache
from copy import deepcopy

N = int(input())

a, b = 2, 1


for i in range(1, N):
    a, b = b, a + b

print(b)

Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
using ll = long long;
const int INF = 2147483647;
const ll MOD = 1e9+7;
// const ll INF = 1000000000000000000LL;


 int main() {
	 ll x, k, d;
	 ll ans;
	 cin >> x >> k >> d;
	 ll abs_x = abs(x);
	//  abs_x -= k*d;
	// if(abs_x>0)
	 	// ans = abs_x;
	// else{
		ll k_num = abs(x) / d; //直前まで行く回数
		if(k_num+1>k){
			ans = abs_x-=k*d;
			cout << ans << endl;
			return 0;
		}
		k -= k_num;  //残りの移動回数
		if(k%2==0) ans = abs(x)-d*k_num;
		if(k%2==1) ans = abs(abs(x)-d*(k_num+1));
		// cout << k_num << endl;
	// }
	cout << ans << endl;
	 return 0;
 }

Measured memory_bytes: 3636
program main
    use,intrinsic :: iso_fortran_env
    implicit none
    integer(int32)::a,b,c,d
    read*, a,b,c,d

    if (a+b>c+d) then
        print'(a)', 'Left'
    else if (a+b<c+d) then
        print'(a)', 'Right'
    else
        print'(a)', 'Balanced'
    end if
    
end program main

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
using namespace std;
#define tubo 3.305785

double ans(int a , int b ){
  double res;

  res = (a*b)/tubo;

  return res;
}

int main(void){
  int a,b;

  cin >> a >> b;
  printf("%.6f\n" ,ans(a,b));

  return 0;
}

Measured memory_bytes: 1192
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














string S;
int N;
int dp[33][101010];
int ans[101010];
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> S;
	N = S.length();

	rep(i, 0, N) {
		if (S[i] == 'R') dp[0][i] = i + 1;
		else dp[0][i] = i - 1;
	}

	rep(p, 0, 32) rep(i, 0, N) dp[p + 1][i] = dp[p][dp[p][i]];

	rep(i, 0, N) ans[dp[32][i]]++;
	rep(i, 0, N) {
		if (i) printf(" ");
		printf("%d", ans[i]);
	}
	printf("\n");
}







Measured memory_bytes: 14032
def getN():
    return int(input())
def getNM():
    return map(int, input().split())
def getList():
    return list(map(int, input().split()))
def getArray(intn):
    return [int(input()) for i in range(intn)]
def input():
    return sys.stdin.readline().rstrip()
def rand_N(ran1, ran2):
    return random.randint(ran1, ran2)
def rand_List(ran1, ran2, rantime):
    return [random.randint(ran1, ran2) for i in range(rantime)]
def rand_ints_nodup(ran1, ran2, rantime):
  ns = []
  while len(ns) < rantime:
    n = random.randint(ran1, ran2)
    if not n in ns:
      ns.append(n)
  return sorted(ns)

def rand_query(ran1, ran2, rantime):
  r_query = []
  while len(r_query) < rantime:
    n_q = rand_ints_nodup(ran1, ran2, 2)
    if not n_q in r_query:
      r_query.append(n_q)
  return sorted(r_query)

from collections import defaultdict, deque, Counter
from sys import exit
from decimal import *
import heapq
import math
from fractions import gcd
import random
import string
import copy
from itertools import combinations, permutations, product
from operator import mul
from functools import reduce
from bisect import bisect_left, bisect_right

import sys
sys.setrecursionlimit(1000000000)
mod = 10 ** 9 + 7


#############
# Main Code #
#############

N, T = getNM()
t = getList()
ans = 0
for i in range(1, N):
    opt = t[i] - t[i - 1]
    ans += min(opt, T)
ans += T
print(ans)

Measured memory_bytes: 110412
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
  int N;
  cin >> N;
  vector<long long> x(N),y(N),X(N),Y(N);
  int i,j;
  for(i=0;i<N;i++) {
    cin >> x[i] >> y[i];
    X[i] = x[i]-y[i];
    Y[i] = x[i]+y[i];
  }
  sort(X.begin(),X.end());
  sort(Y.begin(),Y.end());
  long long ans = 0;
  for(i=0;i<N;i++) {
    long long l = 0,m,r = 2000000000;
    while(r-l > 1) {
      m = (l+r)/2;
      if((X[0] > x[i]-y[i]-m) && (Y[0] > x[i]+y[i]-m) && (X[N-1] < x[i]-y[i]+m) && (Y[N-1] < x[i]+y[i]+m)) {
        r = m;
      }
      else l = m;
    }
    ans = max(ans,l);
  }
  cout << ans << endl;
}

Measured memory_bytes: 9588
/*input
atcoder begin contest
*/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
//loops
#define f(i,s,n) for(ll i=(ll)s;i<(ll)n;i++)
#define rf(i,n,s) for(ll i=(ll)(n-1);i>=(ll)s;i--)
//reset
#define ms0(X) memset((X), 0, sizeof((X)))
#define ms1(X) memset((X), -1, sizeof((X)))
//IO
#define bio ios_base::sync_with_stdio;cin.tie(NULL)
//STL
#define pb push_back
#define pii pair<ll,ll>
#define vll vector<ll>
#define vpii vector<pii >
#define mll map<ll, ll>
#define mpii map<pii,ll> 
#define msll map<string, ll> 
#define sortv(v) sort(v.begin(),v.end())
#define F first
#define S second
//standard values
#define mod (ll)(1e9+7)
#define INF (ll)1e16
#define MAXN (ll)(1e5+5)
//comparator
bool cmp(pii a,pii b){
  if(a.F==b.F) return a.S<b.S;
  else return a.F<b.F;
}
ll exp(ll a,ll b){ll ans=1;while(b!=0){if(b%2==1)ans=ans*a;a=a*a;b/=2;}return ans;}
/********************************************************************************************************/
int main() 
{
  bio;
  string s1,s2,s3;
  cin>>s1>>s2>>s3;
  cout<<char(s1[0]-('a'-'A'))<<char(s2[0]-('a'-'A'))<<char(s3[0]-('a'-'A'))<<endl;
  return 0;
}

Measured memory_bytes: 256
#code 
#c
n,m,x=map(int,input().split())
from itertools import combinations
l=[]
for i in range(n):
    l.append(list(map(int,input().split())))
l1=[]
for i in range(n):
    l1.append(i)
l2=[]
for i in range(1,n+1):
    lx=[0]*i
    lyy=[0]*m
    for lx in combinations(l1,i):
        ly=lyy.copy()
        a=0
        for p in range(1,m+1):
            for k in lx:
                ly[p-1]+=l[k][p]
        for k in lx:
            a+=l[k][0]
        for j in ly:
            if j<x:
                a=0
                break
        if a!=0:
            l2.append(a)
if len(l2)!=0:
    print(min(l2))
else:
    print(-1)
                
                
                
        
    
            
        
    

Measured memory_bytes: 9324
#pragma GCC optimize("O3,inline,unroll-loops")
#include <iostream>
#include <algorithm>
#include <cstdio>
#define N 1020
using namespace std;

void Solve(long long n)
{
    // cout<<n<<endl;
    if(n < 26)
        putchar(n + 'a');
    else
    {
        Solve(n / 26 - 1);
        putchar(n % 26 + 'a');
    }

    return;
}

int main(void)
{
    long long n;

    cin >> n;
    Solve(n - 1);

    return 0;
}


Measured memory_bytes: 3592
#include <cstdio>
#include <cmath>

int arr[15], n;

int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; ++i)
		scanf("%d", arr + i);
	int ans = pow(3, n), prd = 1;
	for (int i = 0; i < n; ++i)
		if (arr[i] % 2 == 0) prd *= 2;
	printf("%d", ans - prd);
	return 0;
}


Measured memory_bytes: 2460
#include<bits/stdc++.h>
using namespace std;
char a[52],b[52];
int main()
{
    cin>>a;
    cin>>b;
    int la=strlen(a),lb=strlen(b);
    int l=min(la,lb),ll=max(la,lb);
    for(int i=0;i<=l-1;i++)
        cout<<a[i]<<b[i];
    if(la>lb)
        for(int i=l;i<=ll-1;i++)
            cout<<a[i];
    else
        for(int i=l;i<=ll-1;i++)
            cout<<b[i];
    cout<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n;
long long int dp[100009];
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int w;
    cin>>n>>w;
    dp[0]=0;
    for(int i=1;i<100009;i++) dp[i]=int(1e15);
    int tempv,tempw;
    for(int i=1;i<=n;i++){
        cin>>tempw>>tempv;
        for(int j=i*1001;j>=tempv;j--){
            dp[j]=min(dp[j],dp[j-tempv]+tempw);
        }
    }
    for(int i=100001;i>=0;i--) if(dp[i]<=w) {cout<<i<<endl; break;}
  
    return 0;
}


Measured memory_bytes: 1024
import math
import collections
import fractions
import itertools
import functools
import operator

def solve():
    a, b, c = map(int, input().split())
    if any([i%2==0 for i in (a, b, c)]):
        print(0)
    else:
        print(min(a*b, b*c, c*a))
    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 10312
N = int(input())
A = [int(input()) for _ in range(N)]

A.sort()
ans = 0
cnt = 1
temp = A[0]
for i in range(1, N):
    if A[i] == temp:
        cnt += 1
    else:
        ans += cnt%2
        cnt = 1
        temp = A[i]
        
ans += cnt%2
print(ans)

Measured memory_bytes: 50392
#include "bits/stdc++.h"

#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 INF 2e9
#define ALL(v) v.begin(), v.end()


using namespace std;

int main()
{
	int K, N;
	char S[100];

	cin >> N >> K;
	cin >> S;

	if (S[K - 1] >= 'z')
	{
		S[K - 1] = toupper(S[K - 1]);
	}
	else
	{
		S[K - 1] = tolower(S[K - 1]);
	}

	cout << S << endl;

	return 0;
}


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

int main(int argc, char const *argv[])
{
    int n;
    int integral=1;
    cin >> n;
    vector<double> a(n);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        integral *= a[i];
    }
    
    double deno = 0;
    for (int i = 0; i < n; i++)
    {
        deno += integral / a[i];
    }

    cout << setprecision(16) << integral / deno << endl;    

    return 0;
}


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

class Program
{
    static long mod = 1000000007;
    static void Main(string[] args) {
        int n = int.Parse(Console.ReadLine());
        string s = Console.ReadLine();
        Console.WriteLine(solve(s,n));
    }
    static long solve(string s, long n) {
        int[] chr = new int[26];
        long ans = 1L;
        for(int i = 0; i < n; i++) chr[s[i]-97] ++;
        for(int i = 0; i < 26; i ++) {
            ans *= chr[i]+1;
            ans %= mod;
        }
        return (ans+mod-1)%mod;
    }
}

Measured memory_bytes: 11360
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<limits.h>
#define MOD 1000000007
#define PI 3.14159265
#define seive_len 1000001
#define p_seive_len 1000001

typedef long long int lli;

int *array;
int seive[seive_len];
int pseive[p_seive_len];

long long int min(long long int a, long long int b) {
    return a<b?a:b;
}

long long int max(long long int a, long long int b) {
    return a>b?a:b;
}

int compare(const void* a, const void* b) {
    return *(int*)a-*(int*)b;
}

int cmp(const void *a, const void *b){
    int ia = *(int *)a;
    int ib = *(int *)b;
    return array[ia] < array[ib] ? -1 : array[ia] > array[ib];
}

long double abs1(long double n) {
    if(n < 0)
        return n*(-1.0);
    return n*1.0;
}

void swap(int *a, int *b) {
    *a = (*a)^(*b);
    *b = (*a)^(*b);
    *a = (*a)^(*b);
}

lli binSearch(lli a[], lli x, lli l, lli r) {
    if(r >= l) {
        lli mid = l + ((r-l)>>1);
        if(a[mid] == x)
            return mid;
        if(a[mid] > x) {
            return binSearch(a, x, l, mid-1);
        }
        else if(a[mid] < x) {
            return binSearch(a, x, mid+1, r);
        }
    }
    return -1;
}

void Primesieve()  { 
    lli i, j;
    pseive[1] = 1;
    printf("bhjnm");
    for(i=0;i<p_seive_len;i++)
        pseive[i] = i;
    for(i=4;i<p_seive_len;i+=2) 
        pseive[i] = 2;
    for(i=3;i*i<p_seive_len;i++) {
        if(pseive[i] == i) {
            for(j=i*i;j<p_seive_len;j+=i) {
                if(pseive[j] == j)
                    pseive[j] = i;
            }
        }
    }
} 

void makeSeive() {
    int i;
	seive[1] = 1;
    for(i=2;i<seive_len;i++) {
        if(seive[i] == 0) {
            long long int temp=(long long int)i*i;
            while(temp <= seive_len-1) {
                seive[temp] = 1;
                temp += i;
            }
        }
    }
}

int isPerfectSquare(lli n) {
    lli x = sqrt(n);
    if(x*x == n)
        return 1;
    return 0;
}

int isPrime(int n) {
    int i;
    for(i=2;i*i<=n;i++)  {
        if(n%i == 0)
            return 0;
    }
    return 1;
}

void getInput(lli a[], lli n) {
    for(lli i=0;i<n;i++)
        scanf("%lld", &a[i]);
}

void testCase() {
    lli n, x, t;
    scanf("%lld%lld%lld", &n, &x, &t);
    lli a = n/x;
    if(a*x != n)
        a++;
    printf("%lld", a*t);
}

int main() {
    int t=1;
    // scanf("%d", &t);
    // makeSeive();
    // Primesieve();
    while(t--) {
        testCase();
        printf("\n");
    }
    return 0;
}


Measured memory_bytes: 2152
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<list>
#include<bitset>
#include<stack>
#include<memory>
#include<numeric>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define REP(i, n) for(int i = 0;i < (n);i++)
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=998244353;
const llint inf=2.19e15+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-10;
template <class T,class U>bool chmin(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool chmax(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(const vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(const vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}
llint solve(vector<pair<llint,int>>&in){
	int i,n=in.size();
	SO(in);REV(in);
	set<int>is;
	for(i=1;i<=n;i++){is.ins(i);}
	llint ans=0;
	for(auto it:in){
		auto itr=is.upper_bound(it.sec);
		if(itr==is.begin()){continue;}
		is.erase(prev(itr));
		ans+=it.fir;
	}
	return ans;
}
int main(void){
	int T;cin>>T;
	while(T--){
		int i,n;cin>>n;
		llint ans=0;
		vector<pair<llint,int>>Lc;
		vector<pair<llint,int>>Rc;
		for(i=0;i<n;i++){
			int K;llint L,R;cin>>K>>L>>R;
			if(L>R){
				ans+=R;
				Lc.pub(mp(L-R,K));
			}else{
				ans+=L;
				Rc.pub(mp(R-L,n-K));
			}
			
		}
		cout<<ans+solve(Lc)+solve(Rc)<<endl;
	}
	return 0;
}


Measured memory_bytes: 11240
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
typedef long long ll;


int main()
{
    int n, u, v;
    cin >> n >> u >> v;
    u--; v--;
    vector<vector<int>> a(n);
    rep(i, n - 1){
        int tmpa, tmpb;
        cin >> tmpa >> tmpb;
        tmpa--; tmpb--;
        a[tmpa].push_back(tmpb);
        a[tmpb].push_back(tmpa);
    }

    vector<pair<int, int>> score(n);
    vector<bool> isSearch1(n, false),isSearch2(n, false);
    queue<int> q;
    q.push(u);
    score[u].first = 0;
    isSearch1[u] = true;
    while(!q.empty()){
        int x = q.front();
        isSearch1[x] = true;
        q.pop();
        for(auto l: a[x]){
            if (isSearch1[l] == true) continue;
            q.push(l);
            score[l].first = score[x].first + 1;
        }
    }

    q.push(v);
    score[v].second = 0;
    isSearch2[v] = true;
    while(!q.empty()){
        int x = q.front();
        isSearch2[x] = true;
        q.pop();
        for(auto l: a[x]){
            if (isSearch2[l] == true) continue;
            q.push(l);
            score[l].second = score[x].second + 1;
        }
    }

    int ans = 0;
    rep(i,n){
        //cout << i+1 << ":" <<score[i].first << ":"<< score[i].second <<endl;
        if (score[i].first < score[i].second){
            ans = max(ans, score[i].second);
        }
    }

    cout << max(ans - 1, 0) << endl;

}


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

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

int main(void){
	int a, c;
	char b;
	scanf("%d %c %d", &a, &b, &c);
	printf("%d\n", b == '+' ? a+c : a-c);
	
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
	int N; cin >> N;
	string W[110];
	map<string, int> mp;
	rep(i, N) {
		cin >> W[i];
		mp[W[i]]++;
		if (mp[W[i]] == 2) {
			cout << "No" << endl;
			return 0;
		}
	}
	rep(i, N - 1) {
		int last = (int)W[i].length() - 1;
		if (W[i][last] != W[i + 1][0]) {
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr int Inf = 2000000010;
constexpr ll INF= 2000000000000000000;
constexpr ll MOD = 1000000007;
const double PI = 3.1415926535897;
typedef pair<ll,ll> P;

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

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

ll mod(ll val, ll M) {
    ll res = val % M;
    if(res < 0) {
        res += M;
    }
    return res;
}

// N^P mod M（ただしM == -1の時はmodを取らない）
template<typename T>
T RS(T N, T P, T M){
    if(P == 0) {
        return 1;
    }
    if(P < 0) {
        return 0;
    }
    if(P % 2 == 0){
        ll t = RS(N, P/2, M);
        if(M == -1) return t * t;
        return t * t % M;
    }
    if(M == -1) {
        return N * RS(N,P - 1,M);
    }
    return N * RS(N, P-1, M) % M;
}

//頂点fromから頂点toへのコストcostの辺
struct edge{
	int from,to;
    ll cost;
};

edge es[100010]; //辺
ll d[100010]; //最短距離
int N,M; //頂点数、辺数

//s番目の頂点から各頂点への最短距離を求める
void shortest_path(int s) {
	for(int i = 0;i < N;i++) {
		d[i] = INF;
	}
	d[s] = 0;
	while(true) {
		bool update = false;
		for(int i = 0;i < M;i++) {
			edge e = es[i];
			if(d[e.from] != INF && d[e.to] > d[e.from] + e.cost) {
				d[e.to] = d[e.from] + e.cost;
				update = true;
			}
		}
		if(update == false) {
			break;
		}
	}
}

//trueなら負の閉路が存在する
bool find_negative_roop() {
	memset(d,0,sizeof(d));
	for(int i = 0;i < N;i++) {
		for(int j = 0;j < M;j++) {
			edge e = es[j];
			if(d[e.to] > d[e.from] + e.cost) {
				d[e.to] = d[e.from] + e.cost;
				if(i == N - 1) return true;
			}
		}
	}
	return false;
}

ll find_negative_roop2(int s,int g) {
	for(int i = 0;i < N;i++) {
		d[i] = INF;
	}
	d[s] = 0;
	for(int i = 0;i < N * 2;i++) {
		for(auto& e:es) {
			if(d[e.from] < INF && d[e.from] + e.cost < d[e.to])  {
				if(i >= N - 1 && e.to == g) {
					return INF;
				}
				else if(i == N - 1) {
					d[e.to] = -INF;
				} 
				else {
					d[e.to] = d[e.from] + e.cost;
				}
			}
		}
	}
	return d[g];
}

int main() {
    cin >> N >> M;
    ll P;
    cin >> P;
    for(int i = 0;i < M;i++) {
        int A,B;
        ll C;
        cin >> A >> B >> C;
        A--;
        B--;
        C -= P;
        C = -C;
        es[i] = edge{A,B,C};
    }
    ll ret = find_negative_roop2(0,N - 1);
    if(ret == INF) {
        cout << -1 << endl;
    }
    else {
        cout << max(0ll,-ret) << endl;
    }
}          

Measured memory_bytes: 3796
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */


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

    int n; cin >> n;
    vector<vector<int>> a(n, vector<int>(n, 0));
    rep(i, n) rep(j, n) cin >> a[i][j];
    
    vector<ll> dp(1<<n, 0);
    dp[0] = 1;
    repr(S, 1, 1<<n){
        int i = 0;
        rep(j, n) if(S&1<<j) ++i;
        rep(j, n) if(S&1<<j && a[i-1][j]==1){
            dp[S] += dp[S^(1<<j)];
            chmod(dp[S]);
        }
    }
    cout << dp[(1<<n)-1] << endl;

    return 0;
}

Measured memory_bytes: 16640
import sys
sys.setrecursionlimit(1 << 25)
read = sys.stdin.readline
ra = range
enu = enumerate


def read_ints():
    return list(map(int, read().split()))


def read_a_int():
    return int(read())


def read_tuple(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(tuple(map(int, read().split())))
    return ret


def read_col(H):
    '''
    H is number of rows
    A列、B列が与えられるようなとき
    ex1)A,B=read_col(H)    ex2) A,=read_col(H) #一列の場合
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return tuple(map(list, zip(*ret)))


def read_matrix(H):
    '''
    H is number of rows
    '''
    ret = []
    for _ in range(H):
        ret.append(list(map(int, read().split())))
    return ret
    # return [list(map(int, read().split())) for _ in range(H)] # 内包表記はpypyでは遅いため


MOD = 10**9 + 7
INF = 2**31  # 2147483648 > 10**9
# default import
from collections import defaultdict, Counter, deque
from operator import itemgetter
from itertools import product, permutations, combinations
from bisect import bisect_left, bisect_right  # , insort_left, insort_right
# https://atcoder.jp/contests/abc154/tasks/abc154_a

S, T = input().split()
A, B = read_ints()
U = input()

print(A - (S == U), B - (T == U))


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

int main() {
int n,k;
cin >> n >> k;
vector<int> a(n);
rep(i,n) cin >> a.at(i);

int ans = 0;
rep(i,n){
  ans += 2*min(abs(a.at(i)-0),abs(a.at(i)-k));
}
cout << ans << endl;
 }


Measured memory_bytes: 3600
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
    int N , M , count = 0;
    cin >> N >> M;
    vector <int> H(N) , A(M) , B(M) , T(N);
    for (int i = 0; i < N; ++i) {
        cin >> H.at(i);
        T.at(i) = H.at(i);
    }
    for (int i = 0; i < M; ++i) {
        cin >> A.at(i) >> B.at(i);
    }
    for(int i = 0; i < M; i++){
        if(H.at(A.at(i) - 1) < H.at(B.at(i) - 1)){
            T.at(A.at(i) - 1) = H.at(B.at(i) - 1);
        }
        else if(H.at(A.at(i) - 1) > H.at(B.at(i) - 1)){
            T.at(B.at(i) - 1) = H.at(A.at(i) - 1);
        }
        else{
            T.at(A.at(i) - 1) = 0;
            T.at(B.at(i) - 1) = 0;
        }
    }
    for(int i = 0; i < N; i++){
       if(H.at(i) == T.at(i)){
           count++;
       }
    }
    cout << count << endl;
}

Measured memory_bytes: 4844
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
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
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        MyScanner in = new MyScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        A solver = new A();
        solver.solve(1, in, out);
        out.close();
    }

    static class A {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            String N = in.next();
            out.println(N.indexOf('7') != -1 ? "Yes" : "No");
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return st.nextToken();
        }

    }
}



Measured memory_bytes: 32880
#include <iostream>

using namespace std;

int main(){
	int H, W;
	cin >> H >> W;
	char S[51][51];
	for (int i=0; i<H; i++) {
		cin >> S[i];
	}

	for (int i=0; i<H; i++) {
		for (int j=0; j<W;j++) {
			if (S[i][j] ==  '.') {
				int count = 0;
				for (int itex=-1; itex<=1; itex++) {
					for (int itey=-1; itey<=1; itey++) {
						int _x = j+itex;
						int _y = i+itey;
						if (_x < 0 || _x >= W || _y < 0 || _y >= H) {
							continue;
						}
						if (S[_y][_x] == '#') {
							count++;
						}
					}
				}
				S[i][j] = 0x30 + (char)count;
			}
		}
	}

	for (int i=0; i<H; i++) {
		for (int j=0; j<W; j++) {
			cout << S[i][j];
		}
		cout << endl;
	}
	return 0;
}



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

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] s = Console.ReadLine().Split(' ');
            int D = int.Parse(s[0]);
            int T = int.Parse(s[1]);
            int S = int.Parse(s[2]);

            string ans;
            if ((double)D/S <= (double)T)
                ans = "Yes";
            else ans = "No";

            Console.WriteLine(ans);
        }
    }
}


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

using namespace std;
typedef unsigned int uint;
typedef long long int ll;
typedef unsigned long long int ull;

#define debugv(v) printf("L%d %s => ",__LINE__,#v);for(auto e:v){cout<<e<<" ";}cout<<endl;
#define debugm(m) printf("L%d %s is..\n",__LINE__,#m);for(auto v:m){for(auto e:v){cout<<e<<" ";}cout<<endl;}
#define debuga(m,w) printf("L%d %s is => ",__LINE__,#m);for(int x=0;x<(w);x++){cout<<(m)[x]<<" ";}cout<<endl;
#define debugaa(m,w,h) printf("L%d %s is..\n",__LINE__,#m);for(int y=0;y<(h);y++){for(int x=0;x<(w);x++){cout<<(m)[x][y]<<" ";}cout<<endl;}
#define ALL(v) (v).begin(),(v).end()
#define BIGINT 0x7FFFFFFF
#define E107 1000000007
void printbit(int u){if(u==0)cout<<0;else{int s=0,k=0;for(;0<u;u>>=1,k++)s=(s<<1)|(u&1);for(;0<k--;s>>=1)cout<<(s&1);}}

#define TIME chrono::system_clock::now()
#define MILLISEC(t) (chrono::duration_cast<chrono::milliseconds>(t).count())

template<typename T1,typename T2>
ostream& operator <<(ostream &o,const pair<T1,T2> p){o<<"("<<p.first<<":"<<p.second<<")";return o;}

int m,n;

int main(){
    int i,j,k,l;
    
    cin >> n >> m;
    
    if (m == 1 || m == 2*n-1){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
        for (i=0;i<n*2-1;i++){
            printf("%d\n",(m-1-(n-1)+i+(n*2-1))%(n*2-1)+1);
        }
    }

    return 0;
}

Measured memory_bytes: 1536
#include <iostream>
#include <string>

using namespace std;

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

// ABC101-A - Eating Symbols Easy
int main()
{
    string S;
    cin >> S;

    int output = 0;
    RPT(4) {
        output += (S[i] == '+') ? 1 : -1;
    }

    cout << output << endl;

    return 0;
}


Measured memory_bytes: 256
'use strict'

function main(s) {
  const str = s.split('\n')[0].split('');

  const before_len = str.length;
  const after_len = [...new Set(str)].length;

  const ans = (before_len === after_len) ? 'yes' : 'no';
  console.log(ans);
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
import java.io.*;
import java.util.*;
import java.util.regex.*;


public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static long cnt=0;
	public static PrintWriter pw = new PrintWriter(System.out);
	public static void main(String[] args) throws Exception {
		solutionA(args);
		if(in!=null){
			in.close();
		}
		pw.flush();
		pw.close();
	}

	public static void solutionA(String[] args) throws Exception{

		long N = nextLong();
		TreeMap<Long,Long> map = primeFactorize(N);

		long[][] x = new long[map.size()][2];
		int idx=0;
		for(long key : map.keySet()) {
			long val = map.get(key);
			x[idx][0]=key;
			x[idx][1]=val;
			idx++;
		}
		pw.println(dfs(1,1,0,x));
	}

	public static int dfs(long A , long B ,int idx ,long[][] lst) {
		if(idx==lst.length-1&&lst[idx][1]==0) {
			return A<B?String.valueOf(B).length():String.valueOf(A).length();
		}
		if(lst[idx][1]==0) {
			idx++;
		}

		lst[idx][1]--;
		int ans = Math.min(dfs(A*lst[idx][0],B,idx,lst),dfs(A,B*lst[idx][0],idx,lst));
		lst[idx][1]++;
		return ans ;
	}

	public static TreeMap<Long, Long> primeFactorize(long N) {
		TreeMap<Long, Long> map = new TreeMap<>(Comparator.comparing(Long::longValue,Comparator.reverseOrder()));
		for (long i = 2; i * i <= N; i++) {
			long k = 0;
			while (N % i == 0) {
				k++;
				N /= i;
			}
			if(k!=0)
				map.put(i, k);
		}
		map.put(N, 1L);
		return map;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}

}



Measured memory_bytes: 47136
#include<bits/stdc++.h>
    using namespace std;
    /*
        By: Umang Srivastava
    */
    #define lli long long int
    #define ld long double
    #define mod 1e9+7
    #define lp(var,start,end,inc) for (var = start; var <end ; var=var+inc)
    #define pb push_back
    #define mp make_pair
    #define pf push_front
    #define ff first
    #define ss second
    #define vll vector<lli>
    #define pll pair<lli,lli> 

#define vpll vector<plli>
#define max(a,b) a>b?a:b
#define min(a,b) a<b?a:b
 
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    lli d,t,s;
    cin>>d>>t>>s;
    if(t*s >= d)
        cout<<"Yes";
    else
        cout<<"No";
}

Measured memory_bytes: 3600