akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include<bitset>
#include<iostream>
using namespace std;
#include<math.h>
#include<map>
#include<vector>
#include<string>
#include<algorithm>
#define ll long long
#define ld double
#include<stdio.h>
#define f first
#define s second
#include<stack>
#include<queue>
#define its set<int>::iterator
#define itmp map<int,int>::iterator
#include<stack>
#define lp for(int i=0;i<n;i++)
#define dlp for(int i=0;i<n;i++) for(int j=0;j<n;j++)
#define mod 1000000009
//#define N 101
//#include <boost/functional/hash.hpp>
//bitset<1000> b;
//b.set();   all bit have 1
//seive of Erat
//totient theorm for co-prime
/*ll int N=1000;
	int p[1001]={0};
	p[2]=1;
		vector<int>v;
        for(ll int i=3;i<=N;i+=2)
        p[i]=1;
        v.push_back(2);
        for(ll int i=3;i<=N;i+=2)
        {
            if(p[i])
            {
			v.push_back(i);
                for(ll int j=i*i;j<=N;j+=2*i)
                p[j]=0;
            }
        }  */
/*
int gcd(int a, int b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} */
/*
stringstream ss;  
ss<<c;  
string s1;
ss>>s1;
*/
/*
int power(int x, unsigned int y) 
{ 
    int temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2); 
    if (y%2 == 0) 
        return temp*temp; 
    else
        return x*temp*temp; 
}*/
int main()
{
	ios_base::sync_with_stdio(false); 
    	cin.tie(NULL); 
	 
      	ll int t=1;
	//cin>>t;
	while(t--)
	{
        ll a,b,c,d;
        cin>>a>>b>>c>>d;
        ll x  = a*c;
        ll y  = a*d;
        ll z = b*c;
        ll w  = b*d;
        cout<<max(x,max(y,max(z,w)))<<endl;

	}
	return 0;
}

Measured memory_bytes: 3644
import java.awt.Point;
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.util.*;

public class Main {	
	Scanner in = new Scanner(System.in);
	public static void main(String[] args){
		new Main();
	}
	public Main(){
		new AOJ1180();
	}
	class AOJ1180{
		int max(int num,int keta){
			String a = Integer.toString(num);
			for(;keta>a.length();)a="0"+a;
			char[] b = a.toCharArray();
			Arrays.sort(b);a="";
			for(int i=b.length-1;i>=0;i--)a+=b[i];
			return Integer.parseInt(a);
		}
		
		int min(int num,int keta){
			String a = Integer.toString(num);
			for(;keta>a.length();)a="0"+a;
			char[] b = a.toCharArray();
			Arrays.sort(b);a="";
			for(int i=0;i<b.length;i++)a+=b[i];
			return Integer.parseInt(a);
		}
		
		
		public AOJ1180() {
			while(true){
				HashMap<Integer,Integer> map = new HashMap<Integer, Integer>();
				ArrayList<Integer> list = new ArrayList<Integer>();
				int num = in.nextInt();
				int keta = in.nextInt();
				if(num+keta==0)break;
				int cnt=0;
				while(!map.containsKey(num)){
					map.put(num,cnt);
					list.add(num);
					cnt++;
					int m1 = max(num,keta);
					int m2 = min(num,keta);
					num = m1-m2;
				}
				System.out.println(map.get(num)+" "+num+" "+(cnt-map.get(num)));
			}
		}
	}
}

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

typedef long long ll;

main()
{
    int n, c = 0;;
    cin >> n;
    int arr[n];
    for(int i = 0; i < n; i++){
        cin >> arr[i];
    }
    for(int i = 0; i < n - 2; i++){
        int arr1[] = {arr[i], arr[i+1], arr[i+2]};
        if(arr[i+1] != *max_element(arr1, arr1+3) && arr[i+1] != *min_element(arr1, arr1+3)){
            c++;
        }

    }
    cout << c;


}





///promy_pompom
//hello world


Measured memory_bytes: 3544
#include"bits/stdc++.h"
using namespace std;
int main(){
  int n;
  cin>>n;
  int ans=0,cnt=0;
  for(int i=1;i<=n;i+=2){
    cnt=0;
    for(int j=1;j<=i;j++)if(i%j==0)cnt++;
    if(cnt==8)ans++;
  }
  cout<<ans;
}

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

int main(){
  string o,e;
  cin>>o>>e;
  for(int i=0;i<e.size();i++){
    cout<<o.at(i)<<e.at(i);
  }
  if(o.size()-e.size()==1){
	int sz=o.size()-1;
    cout<<o.at(sz);
  }
  cout<<endl;
}


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

int main(){
	string temp;
	int count=0;
	cin >> temp;
	if(temp[0]!='A'){
		cout << "WA" << endl;
		return 0;
	}
	for(int i=2;i<temp.length()-1;i++){
		if(temp[i]=='C'){
			count++;
		}
	}
	if(count!=1){
		cout << "WA" << endl;
		return 0;
	}
	int bsr =0;
	for(int i=0;i<temp.length();i++){
		if(temp[i]>='A' && temp[i]<='Z'){
			bsr++;
		}
	}
	if(bsr!=2){
		cout << "WA" << endl;
		return 0;
	}
	cout << "AC" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std ;

int main()
{
string s;
cin>>s;
if(s[0]+s[1]+s[2]==146)
    cout<<2;
else if(s[0]+s[1]+s[2]==147)
    cout<<3;
    else if(s[0]+s[1]+s[2]==145)
    cout<<1;
    else cout<<0;
    return 0;
}



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

using namespace std;

int main()
{
    int n,ans;
    cin >> n ;
    cin >> ans;
    for (int i=1;i<n;i++)
    {
        int x;
        cin >> x;
        ans=__gcd(ans,x);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
#include <memory.h>

char cache[2000+1];

inline void create_cache(int A[], int n, int flag) {
	int i, s;
	for(i=0,s=0;i<n;i++) {
		if((flag&(1<<i)) != 0) {
			s += A[i];
		}
	}
	cache[s] = 1;
}

int main(void) {
	int i, j, n, q, size, t, f;
	int A[20];
	int M[200];
	memset(cache, 0x00, sizeof(cache));

	scanf("%d\n", &n);
	for(i=0;i<n;i++) {
		scanf("%d", &A[i]);
	}
	size=pow(2, n);
	for(i=0;i<size;i++) {
		create_cache(A, n, i);
	}

	scanf("%d\n", &q);
	for(i=0;i<q;i++) {
		scanf("%d", &M[i]);
		if(cache[M[i]]) {
			printf("yes\n");
		} else {
			printf("no\n");
		}
	}
	
	return 0;
}

Measured memory_bytes: 620
#include <bits/stdc++.h>
using namespace std;
const int maxn=1e6+7;
int n,sum[maxn],pre[maxn];
vector<int>v[maxn],mp;
void dfs(int u,int fa){
    sum[u]=1,pre[u]=fa;
    for(int i=0;i<v[u].size();i++)
    	if(v[u][i]!=fa){
        	dfs(v[u][i],u);
        	sum[u]+=sum[v[u][i]];
    	}
}
int main(){
    scanf("%d",&n);
    for(int i=1;i<n;i++){
    	int a,b;
    	scanf("%d%d",&a,&b);
		v[a].push_back(b);
		v[b].push_back(a);
    }
    dfs(1,0);
    for(int i=n;i;i=pre[i])mp.push_back(i);
    reverse(mp.begin(),mp.end());
    int r2=sum[mp[(mp.size()+1)/2]];
    int r1=n-r2;
    if(r1>r2) puts("Fennec");
    else puts("Snuke");
}




Measured memory_bytes: 36860
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
using namespace std;
int main() {
	int
		a, b;
	//string s="error";
	cin >> a; //cin >> b; //cin >> c;
	1200>a?cout <<"ABC"<< endl: cout << "ARC" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <sstream>
#include <string>
#include <algorithm>

using namespace std;

class Solver {
typedef vector<int> V;
typedef vector<V> VV;
    private:
        string i2s(int n) {
            stringstream ss;
            ss << n;
            return ss.str();
        }
    public:
        int mn, tn, pn, rn;
        int m[2000], t[2000], p[2000], j[2000];
        string solve() {
            string retval;
            VV last_solved(tn, V(pn, -1));
            VV answer(tn, V(pn, 0));
            VV score(tn, V(3, 0));
            for (int i = 0; i < rn; ++i) {
                last_solved[t[i] - 1][p[i] - 1] = (j[i] == 0? m[i]: -1);
                ++answer[t[i] - 1][p[i] - 1];
            }
            for (int ti = 0; ti < tn; ++ti) {
                score[ti][2] = -ti - 1;
                for (int pi = 0; pi < pn; ++pi) {
                    if (last_solved[ti][pi] >= 0) {
                        --score[ti][0];
                        score[ti][1] += last_solved[ti][pi] + 20 * (answer[ti][pi] - 1);
                    }
                }
            }
            sort(score.begin(), score.end());
            retval = i2s(-score[0][2]);
            for (int i = 1; i < tn; ++i) {
                if (score[i][0] == score[i - 1][0] && score[i][1] == score[i - 1][1]) {
                    retval += "=";
                } else {
                    retval += ",";
                }
                retval += i2s(-score[i][2]);
            }
            return retval;
        }
};

int main() {
    while (true) {
        Solver s;
        cin >> s.mn >> s.tn >> s.pn >> s.rn;
        if (s.mn == 0) {
            return 0;
        }
        for (int i = 0; i < s.rn; ++i) {
            cin >> s.m[i] >> s.t[i] >> s.p[i] >> s.j[i];
        }
        string answer = s.solve();
        cout << answer << endl;
    }
}

Measured memory_bytes: 1292
package main

import "fmt"

const n int = 5000000000000000

func main() {
	var (
		s string
		k int
	)
	fmt.Scan(&s, &k)

	first := s[0]
	if k == 1 {
		fmt.Printf("%c\n", first)
		return
	}

	if first != '1' {
		fmt.Printf("%c\n", first)
		return
	}

	var end int
	maxEnd := len(s) - 1
	for end < maxEnd && s[end] == '1' {
		end++
	}
	if k <= end {
		fmt.Printf("%c\n", '1')
		return
	}
	fmt.Printf("%c\n", s[end])
	return
}

Measured memory_bytes: 512
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		String[] s = sc.next().split("");
		long[] a = new long[n + 1];
		long[] b = new long[n + 2];
		for (int i = 0; i < n; i++){
			if (s[i].equals("W"))
				a[i + 1] = a[i] + 1;
			else
				a[i + 1] = a[i];
		}
		for (int i = n - 1; i >= 0; i--){
			if (s[i].equals("E"))
				b[i + 1] = b[i + 2] + 1;
			else
				b[i + 1] = b[i + 2];
		}
		long ans = Long.MAX_VALUE;
		for (int i = 1; i <= n; i++) {
			ans = Math.min(ans, a[i] + b[i] - 1);
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 54788
#include<bits/stdc++.h>
using namespace std;
#define nl '\n' 
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long int


int main()
{
	fast;
	int n;cin>>n;
	int a[n];
	for(int i=0;i<n;i++)cin>>a[i];
	int c=0;
	vector<int>v;
	v.push_back(a[0]);
	for(int i=1;i<n;i++)
	{
		if(a[i]!=a[i-1])
			v.push_back(a[i]);
	}
	for(int i=1;i<v.size()-1;i++)
	{
		if((v[i]>=v[i+1] && v[i]>v[i-1])|| (v[i]>v[i+1] && v[i]>=v[i-1]) )
		{
			c++;
			i++;
		}
		else if((v[i]<=v[i+1] && v[i]<v[i-1])|| (v[i]<v[i+1] && v[i]<=v[i-1]) )
		{
			c++;
			i++;
		}
	}
	cout<<c+1<<nl;
}

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

#define rep(i, n) for(int i = 0; i < n; ++i)
typedef long long ll;
using namespace std;

int main(){
    int x, y, z, k;
    cin >> x >> y >> z >> k;
    vector<ll> a(x), b(y), c(z);
    vector<ll> ab;
    vector<ll> ans;
    rep(i, x) cin >> a[i];
    rep(i, y) cin >> b[i];
    rep(i, z) cin >> c[i];
    rep(i, x){
        rep(j, y){
            ab.push_back(a[i] + b[j]);
        }
    }
    sort(ab.rbegin(), ab.rend());
    sort(c.rbegin(), c.rend());
    rep(i, min(x*y, k)){
        rep(j, min(z, k)){
            ans.push_back(ab[i] + c[j]);
        }
    }
    sort(ans.rbegin(), ans.rend());
    rep(i, k) cout << ans[i] << '\n';
}


Measured memory_bytes: 42856
#include <iostream>

using namespace std;

int main() {
    int m[] = { 1, 5, 10, 50, 100, 500 };
    int sum = 0, v;
    for (int i = 0; i < 6; i++) {
        cin >> v;
        sum += v * m[i];
    }
    cout << (sum >= 1000 ? 1 : 0) << endl;

    return 0;
}

Measured memory_bytes: 1160
#include <iostream>

using namespace std;

int main(int argc, char* argv[]) {
  long long A, B, C;
  cin >> A >> B >> C;



  long long res = 0;
  while (true) {
    if (A % 2 == 1)
      break;
    if (B % 2 == 1)
      break;
    if (C % 2 == 1)
      break;

    if (A == B && B == C) {
      cout << -1 << endl;
      return 0;
    }

    long long tmp_a, tmp_b, tmp_c;

    tmp_a = (B + C) / 2;
    tmp_b = (A + C) / 2;
    tmp_c = (A + B) / 2;

    A = tmp_a;
    B = tmp_b;
    C = tmp_c;

    ++res;
  }

  cout << res << endl;

  return 0;
}

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

int main() {
  int n;
  scanf("%d", &n);
  vector<int> a(n + 1);
  for (int i = 0; i <= n; i++) scanf("%d", &a[i]);

  vector<long long> s(n + 1);
  for (int i = n - 1; i >= 0; i--) s[i] = s[i + 1] + a[i + 1];

  long long ans = 0, now = 1;
  bool f = true;
  for (int i = 0; i <= n; i++) {
    if (now < a[i]) {
      f = false;
      break;
    }

    now -= a[i];
    if (now > s[i]) now = s[i];
    ans += a[i] + now;
    now <<= 1;
  }

  if (f)
    printf("%lld\n", ans);
  else
    printf("-1\n");

  return 0;
}


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

using namespace std;

int main(){
    int K;
    cin >> K;
    string S;
    cin >> S; 
    
    if(S.size() <= K ) {
        cout << S << endl;
        return 0;
    }

    string sub = S.substr(0,K);
    cout << sub << "..." <<  endl;
    return 0;
}

Measured memory_bytes: 3608
use proconio::{fastout, input};

use proconio::marker::Usize1;

#[fastout]
fn main() {
    input! {
        n: usize,
        uv: [(Usize1, Usize1); n - 1],
    }
    let mut ans: i64 = 0;
    for k in 0..n {
        ans += (k + 1) as i64 * (n - k) as i64;
    }
    for (u, v) in uv {
        let (u, v) = if u < v { (u, v) } else { (v, u) };
        ans -= (u + 1) as i64 * (n - v) as i64;
    }
    println!("{}", ans);
}


Measured memory_bytes: 7796
#include <iostream>
#include <unordered_set>
#include <cstdint>
#include <vector>
#include <sstream>
#include <string>
#include <climits>
#include <set>
#include <array>
#include <algorithm>
#include <math.h>
#include <cmath>
#include <iomanip>
#include <numeric>
#include <map>
using namespace std;

int main()
{
	int n;
	string str;
	cin >> n >> str;

	int cnt = 0;
	for (int i = 0; i < n - 2; i++)
	{
		if (str[i] == 'A' && str[i + 1] == 'B' && str[i + 2] == 'C')
		{
			cnt++;
			i += 2;
		}
	}

	cout << cnt;
}

Measured memory_bytes: 3504
a = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
k = gets.to_i
puts a[k-1]

Measured memory_bytes: 1788
n = int(input())
a = list(map(int, input().split()))

def gcd(a, b):
    if a < b:
        a, b = b, a
    while b:
        a, b = b, a % b
    return a

def main():
    l = [0] * n
    r = [0] * n
    ans = [0] * n
    l[0] = a[0]
    r[n-1] = a[n-1]
    for i in range(1, n):
        l[i] = gcd(l[i-1], a[i])
    for i in range(n-2, -1, -1):
        r[i] = gcd(a[i], r[i+1])
    for i in range(n):
        if i == 0:
            ans[i] = r[i+1]
        elif i == n-1:
            ans[i] = l[i-1]
        else:
            ans[i] = gcd(l[i-1], r[i+1])
    print(max(ans))

if __name__ == '__main__':
    main()


Measured memory_bytes: 14488
#include<stdio.h>
#include<string.h>
int main()
{
	char a[1000000],b[1000000];
	int i,c=0;
	scanf("%s",a);
	scanf("%s",b);
	int l=strlen(a);
	for(i=0;i<l;i++)
	{
		if(a[i]!=b[i])
		{
			c++;
		}
	}
	printf("%d\n",c);
}

Measured memory_bytes: 2124
#include<bits/stdc++.h>
using namespace std;
int a[5],b[5],c[5][5];
int main() {
	ios::sync_with_stdio(false);
	for(int i = 1; i <= 3; i++)
		for(int j = 1; j <= 3; j++)
			cin >> c[i][j];
	for(a[1] = 0; a[1] <= 100; a[1]++) {
		b[1] = c[1][1] - a[1];
		b[2] = c[1][2] - a[1];
		b[3] = c[1][3] - a[1];
		for(a[2] = 0; a[2] <= 100; a[2]++)
			if(a[2] + b[1] == c[2][1] && a[2] + b[2] == c[2][2] && a[2] + b[3] == c[2][3])
				for(a[3] = 0; a[3] <= 100; a[3]++)
					if(a[3] + b[1] == c[3][1] && a[3] + b[2] == c[3][2] && a[3] + b[3] == c[3][3]) {
						cout << "Yes\n";
						return 0;
					}
	}
	cout << "No\n";
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<numeric>
#include<map>
#include<queue>
using namespace std;

int main(){
    int N,M,ans=1;cin>>N>>M;
    pair<int,int>p[100010];
    for(int i=0;i<M;i++){
        int a,b;cin>>a>>b;
        p[i].first=a;
        p[i].second=b;
    }
    sort(p,p+M);
    int A=p[0].first;
    int B=p[0].second;
    for(int i=1;i<M;i++){
        if(p[i].first>=B){
            ans++;
            A=p[i].first;
            B=p[i].second;
        }
        else{
            A=p[i].first;
            if(p[i].second<B)
                B=p[i].second;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024
use POSIX;
($N,$A,$B,@@)=glob`dd`;
$a=$%=1<<30;
map{
  $==$i=$a-$%;
  $=-=ceil(($-=$_-$B*$i)/($A-$B))for@@;
  $a-=$%*($=>=0);
  $%/=2;
  # print"$% $a $i $=$/";
}1..32;
print$i;

Measured memory_bytes: 28684
#include <bits/stdc++.h>
using namespace std;
 
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << "\n";
}
template <typename Arg1, typename... Args>
void __f(const char* na, Arg1&& arg1, Args&&... args) {
  const char* c = strchr(na + 1, ',');
  cerr.write(na, c - na) << " : " << arg1 << " , ";
  __f(c + 1, args...);
}
#define endl "\n"
#define all(v) v.begin(), v.end()
#define UNIQUE(v) sort(all(v)),v.erase(unique(all(v)),v.end())
typedef long long LL;
typedef pair <int,int> pii;
const double pi = acos(-1.0);
const double eps = 1e-8;
const int mod = 1e9 + 7;
const int inf = 1e9;
const LL INF = 1e18;
const int N = 1e5 + 5;
 
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0); cout.tie(0);
  #ifdef LOCAL
    //freopen("input.txt", "r", stdin);
  #endif // LOCAL
  double r;
  cin >> r;
  cout << setprecision(10) << fixed;
  cout << 2.0 * pi * r << endl;
  return 0;
}

Measured memory_bytes: 3804
#include<bits/stdc++.h>   //AA06( 19/ 04/ 20) If u see my code, Have a Good Day! (^_^)

using namespace std;

int main()
{
    int N, M, i, sum = 0, A;

    cin >> N >> M;


    for(i = 0; i < M; ++i) {
        cin >> A;

        sum = sum + A;

    }

    if(sum > N) {
        cout << -1 << endl;
    }

    else {
        cout << N - sum << endl;
    }


    return 0;
}


Measured memory_bytes: 3624
fun main(args: Array<String>){
    val (a, b) = readLine()!!.split(" ").map{it.toInt()}
    var r = mutableListOf<String>()

    for(i in 0 until a){
        r.add(readLine()!!)
    }
    r.sort()
    val str = r.joinToString(separator = "")
    println(str)
}


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

int main() {
	long long ans = 0;
	long long N; cin >> N;
	for (int i = 1; i <= N; i++)
	{
		if (i % 3 != 0 && i%5 != 0)ans += i;
	}
	cout << ans << endl;
}

Measured memory_bytes: 3620
#include "stdio.h"
#include <iostream>
#include <vector>
#include <string>

#include <string>
#include <sstream>

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

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

//typedef
//------------------------------------------
typedef std::vector<int> VI;
typedef std::vector<VI> VVI;
typedef std::vector<std::string> VS;
typedef std::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 SORT(c) sort((c).begin(),(c).end())

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

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

using namespace std;

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    int a_max = a * c;
    int result;
    if (a_max < b) {
        result = c;
    } else {
        result = (int)(b / a);
    }
    cout << result;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<string>
#include<vector>
#include<algorithm>
#include<queue>
#include<functional>
#include<cstring>

using namespace std;

int main()
{
	char input[11];
	string str;

	scanf("%s", input);
	str = input;

	if (str.size() % 2)
	{
		printf("No\n");

		return 0;
	}

	for (int i = 0; i < str.size(); i++)
	{
		if (!(i % 2))
		{
			if (str[i] != 'h')
			{
				printf("No\n");

				return 0;
			}
		}

		else
		{
			if (str[i] != 'i')
			{
				printf("No\n");

				return 0;
			}
		}
	}

	printf("Yes\n");

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    sort(all(A));
    int a = A[N - 1];
    int b = A[0];
    rep(i, N - 1){
        if(min(A[i], A[N - 1] - A[i]) > min(b, A[N - 1] - b)) {
            b = A[i];
        }
    }
    cout << a <<  " " << b << endl;
    
    return 0;
}


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

using namespace std;

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

const ll INF=1e9+7;
int a,b,x,y;
int main()
{
	/*freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);*/
	cin>>a>>b>>x>>y;
	rep(i,x-a){
		cout<<"R";
	}
	rep(i,y-b){
		cout<<"U";
	}
	rep(i,x-a){
		cout<<"L";
	}
	rep(i,y-b){
		cout<<"D";
	}
	cout<<"L";
	rep(i,y-b+1){
		cout<<"U";
	}
	rep(i,x-a+1){
		cout<<"R";
	}
	cout<<"DR";
	rep(i,y-b+1){
		cout<<"D";
	}
	rep(i,x-a+1){
		cout<<"L";
	}
	cout<<"U";
	return 0;
}

Measured memory_bytes: 256
#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 FORR(i, m, n) for (int i = (m); i >= (n); --i)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;

int main() {
  int n;
  cin >> n;
  vector<int> h(n+1);
  int maxh = 0;
  rep(i, n) {
    cin >> h[i];
    maxh = max(maxh, h[i]);
  }
  int ans = 0;
  rep(i, maxh) {
    int t = 0;
    rep(j, n) {
      if (h[j] && !h[j+1]) t++;
      if (h[j]) h[j]--;
    }
    ans += t;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{

    int H,W;
    while(true)
    {
    scanf("%d%d",&H,&W);
    if(H==0&&W==0)
        break;
    for(int i=0;i<H;i++)
    {
        for(int j=0;j<W;j++)
        {
             printf("#");
        }
printf("\n");
    }
   printf("\n");
    }
}


Measured memory_bytes: 2612
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <cstdio>
#include <vector>
#include <bitset>
#include <cstring>
#include <utility>
#include <iostream>
#include <algorithm>
#define LL long long
#define Rg register
#define RI register LL
#define RC register char
#define ed puts("") 
#define pair pair<LL,LL>
#define space putchar(' ') 
#define lson l,mid,rt<<1 
#define rson mid+1,r,rt<<1|1  
using namespace std;   
template <typename tp> inline void read(tp & x) 
{	
    x=0;
    RI f=1; 
    RC c=getchar();  
    while(c<'0' || c>'9'){if(c=='-') f=-1;c=getchar(); } 
    while(c>='0' && c<='9'){x=(x<<1)+(x<<3)+(c^48);c=getchar();} 
 	x*=f;
} 	
    	
template <typename Tp> inline void print(Tp x)  
{			
    if(x<0) x=-x,putchar('-'); 
    if(x>9) print(x/10);
    putchar(x%10+'0');
} 

int n;
int a[1000005];
int b[1000005];

int main()
{
	read(n);
	for(RI i=1;i<=n;++i)
		read(a[i]),b[i]=a[i];
	sort(a+1,a+n+1);
	for(RI i=1;i<=n;++i)
	{
		if(b[i]==a[n])
		{
			print(a[n-1]),ed;
		}
		else
		{
			print(a[n]),ed;
		}
	}
	return 0;
}

Measured memory_bytes: 6528
#include <iostream>
#include <string>
#include <cstring>
using namespace std;

int main()
{
    string s, t;
    cin >> s >> t;
    int counter;
    counter = 0;
    for ( int i = 0; i < s.length(); i++) {
        if(s[i] != t[i]) counter ++;
    }
    cout << counter;
    return 0;
}


Measured memory_bytes: 3924
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll n = 0;
  cin >> n;
  string res = "";
  while(1){
    if(n == 0)break;
    n--;
    res += char('a' + n % 26);
    n /= 26;
  }
  reverse(res.begin(),res.end());
  cout << res << endl;
}



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

#define rep(i,n) for(long long i = 0; i < (long long)(n); i++)
template<class T1, class T2> bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

using ll = long long; using ld = long double; using vld = vector<ld>; 

int main(void) {
    ll n; 
    while (cin >> n && n) {
        vld x(n), y(n); rep(i, n) cin >> x[i] >> y[i];
        auto d = [&](ll i, ll j) { return (x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]); };
        ll ret = 1;
        for (int i = 0; i < n-1; i++) {
            for (int j = i+1; j < n; j++) {
                ld dij = d(i, j);
                if (dij >= 4.0l) continue;
                ld x1 = x[i], y1 = y[i], x0 = x[j], y0 = y[j];
                for (auto dir : {1.0l, -1.0l}) {
                    ld xc = x0 + (x1 - x0) / 2.0l + (-(y1 - y0)) * dir 
                        * sqrtl(1.0l - ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) / 4.0l) 
                        / sqrtl((y1 - y0) * (y1 - y0)  + (x1 - x0) * (x1 - x0));
                    ld yc = y0 + (y1 - y0) / 2.0l + (+(x1 - x0)) * dir 
                        * sqrtl(1.0l - ((x1 - x0) * (x1 - x0) + (y1 - y0) * (y1 - y0)) / 4.0l) 
                        / sqrtl((y1 - y0) * (y1 - y0)  + (x1 - x0) * (x1 - x0));
                    ll m = 2;
                    rep(k, n) {
                        if (k == i || k == j) continue;
                        if ((xc - x[k]) * (xc - x[k]) + (yc - y[k]) * (yc - y[k]) < 1.0l) 
                            m++;
                    }
                    chmax(ret, m);
                }
            }
        }
        cout << ret << endl;
    }
    return 0;
}

Measured memory_bytes: 3144
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
ll n,m;
cin >> n >> m;
cout << (n - 1) * (m - 1) << endl;
}

Measured memory_bytes: 3604
//In the name of Allah
#include <bits/stdc++.h>
using namespace std;

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

const int maxN = 8 + 1; 

string a[maxN]; 

int main() { 
	ios::sync_with_stdio(false); cin.tie(0); 
	int n,m; cin >> n >> m ;
	int v = n + m - 2; 
	int cnt = 0; 
	for( int i = 0 ;i< n ; i++ ) { 
		cin >> a[i];
		for( int j = 0 ; j < m ; j++ ) 
			cnt += a[i][j] == '#' ; 
	}

	bool canDo = false; 
	if( cnt == n + m - 1 && a[0][0] == '#' ) 
		for( int mask = 0 ; mask < (1<<v) ; mask++ ) 
			if( __builtin_popcount( mask ) == n - 1 ) { 
				bool good = true;
				int i=0,j=0; 
				for( int k = 0 ; k < v ; k++ ) { 
					if( (mask>>k) & 1 ) 
						i++; 
					else
						j++; 
					if( a[i][j] != '#' ) good = false; 
				}
				canDo |= good; 
			}
	if( canDo ) cout << "Possible" << endl;
	else cout << "Impossible" << endl;
}



Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
class unionfind {
    vector<int> par, rank, size_;//速度ではなくメモリ効率を考えるならrankのかわりにsizeを使う
public:
    unionfind(int n) :par(n), rank(n), size_(n, 1) {
        iota(all(par), 0);
    }
    int find(int x) {
        if (par[x] == x)return x;
        return par[x] = find(par[x]);
    }
    void unite(int x, int y) {
        x = find(x), y = find(y);
        if (x == y)return;
        if (rank[x] < rank[y])swap(x, y);
        par[y] = x;
        size_[x] += size_[y];
        if (rank[x] == rank[y])rank[x]++;
    }
    bool same(int x, int y) {
        return find(x) == find(y);
    }
    int size(int x) {
        return size_[find(x)];
    }
};
int main(){
    int n,k,l;
    cin>>n>>k>>l;
    unionfind c(n+1),t(n+1);
    vi v(n+1),u(n+1);
    rep(i,k){
        pii hoge; cin>>hoge.first>>hoge.second;
        c.unite(hoge.first,hoge.second);
    }
    rep(i,l){
        pii hoge; cin>>hoge.first>>hoge.second;
        t.unite(hoge.first,hoge.second);
    }
    vector<pii>p(n+1);
    for(int i=1; i<=n;i++){
        v[i]=c.find(i);
        u[i]=t.find(i);
        p[i]=make_pair(v[i],u[i]);
    }
    map<pii,int>mp;
    for(int i=1;i<=n;i++)mp[p[i]]++;
    for(int i=1; i<=n;i++){
        if(i!=1)cout<<" ";
        cout<<mp[p[i]];
    }
    cout<<endl;
}

Measured memory_bytes: 19584
N, M = map(int, input().split())
A = [int(a) for a in input().split()]    
L = [2, 5, 5, 4, 5, 6, 3, 7, 6]
B = [[A[i], L[A[i]-1]] for i in range(M)]

X = [0] + [-1] * N
for i in range(1, N+1):
    for b in B:
        if b[1] <= i:
            X[i] = max(X[i], X[i-b[1]]*10 + b[0])

print(X[N])

Measured memory_bytes: 14516
// abc129b.cpp : Balance
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
#define rp(i,n) for(int i=0;i<(n);i++)

int main(){
	int n; cin>>n;
	vi w(n);
	int s = 0;
	rp(i,n){
		cin>>w[i];
		s += w[i];
	}

	int s1 = 0;
	int ans = 100000;
	rp(i,n){
		s1+=w[i];
		int diff = abs(s-s1-s1);
		if(ans>diff) ans = diff;
	}

	cout<< ans <<endl;

}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int i, N;
  long int ene;
  scanf("%d", &N);

  int A[N+1], B[N];
  for (i = 0; i < N + 1; i++)
    scanf(" %d", &A[i]);
  for (i = 0; i < N; i++)
    scanf(" %d", &B[i]);

  ene = 0;
  for (i = 0; i < N; i++) {
    if (A[i] >= B[i]) {
      ene += B[i];
    } else if (A[i] + A[i+1] >= B[i]) {
      ene += B[i];
      A[i+1] = A[i+1] + A[i] - B[i];
    } else {
      ene += A[i] + A[i+1];
      A[i+1] = 0;
    }
  }
  printf("%ld\n", ene);
  return 0;
}


Measured memory_bytes: 896
#include <stdio.h>

#define EXIST 1
#define MISSING 0

int main(void)
{
    int i, j;
    int n;
    int cards[4][14];
    /*cards[suit][rank]
        suit 0: Spade, 1: Heart, 2: Club, 3: Diamond
        rank = 1, 2, ..., 13*/
    char suit[2];
    int rank;

    /*initialize*/
    for (i = 0; i < 4; i++){
        cards[i][0] = EXIST;
        for (j = 1; j < 14; j++){
            cards[i][j] = MISSING;
        }
    }

    /*input*/
    scanf("%d", &n);
    for (i = 1; i <= n; i++){
        scanf("%s %d", suit, &rank);
        switch (suit[0]){
            case 'S':
                cards[0][rank] = EXIST;
                break;
            case 'H':
                cards[1][rank] = EXIST;
                break;
            case 'C':
                cards[2][rank] = EXIST;
                break;
            case 'D':
                cards[3][rank] = EXIST;
                break;
            default:
                printf("ERROR!\n");
                break;
        }
    }

    /*output*/
    for (j = 1; j < 14; j++){
        if (cards[0][j] == MISSING){
            printf("S %d\n", j);
        }
    }

    for (j = 1; j < 14; j++){
        if (cards[1][j] == MISSING){
            printf("H %d\n", j);
        }
    }

    for (j = 1; j < 14; j++){
        if (cards[2][j] == MISSING){
            printf("C %d\n", j);
        }
    }

    for (j = 1; j < 14; j++){
        if (cards[3][j] == MISSING){
            printf("D %d\n", j);
        }
    }

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define fir first
#define sec second
#define all(x) (x).begin(),(x).end()
#define debug(x) cerr<<#x<<": "<<x<<endl;
#define ll long long
using namespace std;

const int maxn=1e6+7;
ll a[maxn];

int dig(ll x){
	ll ans=0;
	while(x) x/=10,ans++;return ans;
}

int solve(int T){


	int a[222];
	int aa=0;
	for(int i=0;i<3;i++) {
		cin>>a[i];aa+=a[i];
	}
	if(aa>=22) cout<<"bust\n";
	else cout<<"win";

    return 0;
}
int main(){
    int T=1;
    //scanf("%d",&T);
    for(int cas=1;cas<=T;cas++) solve(T);
	return 0;
}


Measured memory_bytes: 256
def main():
    n = int(input())
    i = 2
    minv = int(10**12)
    while i*i <= n:
        if n % i == 0:
            a = i
            b = int(n / i)
            minv = min(minv, a+b-2)
        i += 1
    if minv < int(10**12):
        print(minv)
    else:
        print(n-1)

if __name__ == '__main__':
    main()

Measured memory_bytes: 9172
#include <cstdio>
#include <iostream>
#include <string>
using namespace std;
int main()
{
    int n,m=0,t;
    cin>>n;
    t=n;
    while(t>0){
        m+=t%10;
        t=t/10;
    }
    if(n%m==0) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

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

using namespace std;

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = long long;
using P = std::tuple<int,int>;

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

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

    string S;
    std::cin >> S;

    int digitSum = 0;
    for(char c : S){
        digitSum += c - '0';
    }

    int n = stoi(S);

    if(n % digitSum == 0){
        std::cout << "Yes" << std::endl;
    }else{
        std::cout << "No" << std::endl;
    }
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<queue>
#include<vector>
#include<cstdlib>

using namespace std;

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

int main(){
    int a, b, c, d;
    cin >> a >> b >> c >> d;
    if (abs(a - c) <= d || (abs(a - b) <= d && abs(b - c) <= d)){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    
}

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

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;
const int inf = (1 << 30) - 1;
const int64 infll = (1LL << 61) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

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

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

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

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

int main() {
  int H, W;
  cin >> H >> W;
  auto mat = make_v< int >(H, W);
  cin >> mat;

  auto dp = make_v< int >(H + 1, W + 1);

  int ret = 0;
  for(int i = 1; i <= H; i++) {
    for(int j = 1; j <= W; j++) {
      if(mat[i - 1][j - 1] == 1) continue;
      dp[i][j] = min({dp[i - 1][j], dp[i - 1][j - 1], dp[i][j - 1]}) + 1;
      chmax(ret, dp[i][j]);
    }
  }

  cout << ret * ret << endl;
}



Measured memory_bytes: 18428
#include <bits/stdc++.h>
  
using namespace std;
  
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
  
#define pb push_back
#define mp make_pair
#define cotu cout
#define itn int
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
  
#define ordered_set tree<int , null_type,less<int >, rb_tree_tag,tree_order_statistics_node_update> 
  
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
  
typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
  
const int inf = int(1e9);
const int mod = inf + 7;
const int N = 1e6 + 555;
const double PI = acos(-1.0);

void solve()
{
	int m;
	cin >> m;
	cout << 48 - m;
}
 
int main()
{
    Red;
    solve();
    return 0;
}

Measured memory_bytes: 256
s=input()
q=int(input())
cnt=0
from collections import deque
s=deque(s)
for i in range(q):
    j=tuple(input().split())
    if  len(j)==3 :
        if (cnt+int(j[1]))%2:
            s.appendleft(j[2])
        else:
            s.append(j[2])
    else:
        cnt+=1
if cnt%2==0:
    print("".join(s))
else:
    print("".join(reversed(list(s))))


Measured memory_bytes: 75224
from collections import defaultdict
from string import ascii_uppercase
import sys, bisect, math
stdin = sys.stdin
read_int = lambda : list(map(int,stdin.readline().split()))
read_str = lambda : stdin.readline().rstrip()

N = read_int()[0]

# 約数列挙 return 配列
def divisor(n):
    res = []
    i = 1
    while i**2 <= n:
        if n % i == 0:
            res.append(i)
            if i != n // i:
                res.append(n // i)
        i += 1
    return res

div = sorted(divisor(N))
def solve():
    ans = 0
    for d in div:
        if d == N: continue
        x = (N - d) // d
        if N % x == d:
            # print(x, d)
            ans += (N - d) // d
    return ans

if __name__ == "__main__":
    res = solve()
    print(res)

Measured memory_bytes: 3900
#include <iostream>
#define FAST ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#include <algorithm>
#include <bits/stdc++.h>
#define MOD 1000000007
#define ll long long
#define l long
#define mm(arr) memset(arr, 0, sizeof(arr))
#define scanArray(a,n) for(int i = 0; i < n; i++){cin >> a[i]}
using namespace std;
int main(){
    FAST
    int n; cin >> n;
    int x;
    int result=0;
    while(n!=0){
        x=n%10;
        if(x==7){
            result=1;
        }
        n=n/10;
    }
    if(result==1){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repi(i, 0, n)
#define SZ(x) ((int)(x).size())
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int uint;
// using P = pair<int, int>;
struct Vec
{
    double x, y;
};
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
using namespace std;

const int mod = 1000000007;
class mint
{
public:
    ll x;
    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*(const mint &a) const
    {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll a) const
    {
        if (a == 0)
            return 1;
        mint b = pow(a >> 1);
        b *= b;
        if (a & 1)
            b *= (*this);
        return b;
    }
    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;
    }
    friend ostream &operator<<(ostream &os, const mint &m)
    {
        os << m.x;
        return os;
    }
};
int main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    // cout << fixed << setprecision(15);
    ll n;
    cin >> n;

    cout << mint(10).pow(n) - mint(2) * mint(9).pow(n) + mint(8).pow(n)<< endl;

    // cout << ans.x << endl;
    return 0;
}

Measured memory_bytes: 3624
#include<cstdio>
#include<algorithm>
#include<functional>
using namespace std;
const int MAX = 100000 + 10;

pair<int,int> rec[MAX];

int main(){
  int n;
  scanf("%d", &n);
  for(int i = 0 ; i < n ; i++){
    int t;
    scanf("%d", &t);
    rec[i] = make_pair(t, i);
  }
  sort(rec, rec+n);
  int ans = 0;
  for(int i = 0 ; i < n ; i++){
    if(rec[i].second % 2 != i % 2) ans ++;
  }
  ans /= 2;
  printf("%d\n", ans);
  return 0;
}


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

int main()
{
    char s[6];
    for(int i=0;i<6;i++)
    {
        scanf("%c",&s[i]);
    }
    if((s[2]==s[3]) && (s[4]==s[5]))
    {
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    return 0;
}


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

using namespace std;

#define loop(i, n) for(int i = 0;i < int(n);i++)
#define rloop(i, n) for(int i = int(n);i >= 0;i--)
#define range(i, a, b) for(int i = int(a);i <= int(b);i++)
#define SZ(c) int(c.size())
#define ALL(c) c.begin(), c.end()
#define RALL(c) c.rbegin(), c.rend()
#define PI acos(-1)
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define sfi1(v) scanf("%d",&v)
#define sfi2(v1, v2) scanf("%d %d",&v1,&v2)
#define sfi3(v1, v2, v3) scanf("%d %d %d",&v1,&v2,&v3)
#define sfll1(v) scanf("%I64d",&v);
#define sfll2(v1, v2) scanf("%I64d %I64d",&v1,&v2)
#define sfll3(v1, v2, v3) scanf("%I64d %I64d %I64d",&v1,&v2,&v3)
#define endl '\n'

typedef vector<int> vi;
typedef vector<pair<int, int> > vii;
typedef long long ll;
typedef pair<int, int> pii;

const int N = 1e5 + 5;
ll arr[N];
int n;

bool valid(ll step) {
    if (step < 0)return 0;
    ll extra = 0;
    loop(i, n) {
        ll val = arr[i] + step - (n - 1);
        if (val > 0) {
            ll d = n + 1;
            extra += (val + d - 1) / d;
        }
    }
    return extra <= step;
}

ll bs(ll st, ll ed) {
    while (st < ed) {
        ll mid = st + (ed - st) / 2;
        bool flag = false;
        loop(i, n + 1)flag |= valid(mid - i);
        if (flag)
            ed = mid;
        else
            st = mid + 1;
    }
    return st;
}

int main() {

#ifndef ONLINE_JUDGE
    freopen("in.in", "r", stdin);
    //freopen("out.in", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    cin >> n;
    loop(i, n)cin >> arr[i];
    cout << bs(0, 1e18) << endl;


    return 0;
}

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

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pl; 
typedef double db;
typedef complex<db> cd;

ll qpow(ll x,ll k,ll mod)
{
    ll ret=1;
	while(k)
	{
	   if(k&1)	
	   {
	   	 ret=ret*x;
	   	 ret=ret%mod;
	   }
	   x=x*x;
	   x=x%mod;
	   k=(k>>1);
	}
	return ret;	
}
#define MP make_pair
#define FF first
#define SS second
#define LB lower_bound
#define UB upper_bound
#define PB push_back
#define lc ((p<<1)+1)
#define rc ((p<<1)+2)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define rrep(i,b,a) for(int i=b;i>=a;i--)
#define all(v) (v).begin(),(v).end()
#define clean(v,a) memset(v,a,sizeof(v))
#define PQ priority_queue

/*
 * high precision: printf("%.12lf",(db)ans);
 *
 * clear output buffer: fflush(stdout);
 *
 * sync off: ios::sync_with_stdio(false);
 *
 */

int l;
int from[70],to[70],w[70];

int main()
{
	scanf("%d",&l);
	int m=0,n=20;
	for(;m<19;)
	{
		m++;
		from[m]=m;
		to[m]=m+1;
		w[m]=0;
	}
	int i=1,cur=1;
	while(i*2<=l)
	{
		m++;
		from[m]=cur;
		to[m]=cur+1;
		w[m]=i;;
		i=i*2;
		cur++;
	}
	int res=l-i,wgt=i,now=1;
	cur=1;
	while(res)
	{
		int x=res%2;
		if(x)
		{
			m++;
			from[m]=cur;
			to[m]=20;
			w[m]=wgt;
			wgt+=now;
			res--;
		}
		res/=2;
		cur++;
		now*=2;
	}
	printf("%d %d\n",n,m);
	for(int i=1;i<=m;i++)
	{
		printf("%d %d %d\n",from[i],to[i],w[i]);
	}
	return 0;
}

Measured memory_bytes: 256
n,k = map(int,input().split())

ans = 0
if k == 0 :
    print(n*n)
else:
    for b in range(k+1,n+1):
        la = int((n+1)/b)
        ans += (la)*(b-k)
        if  (la*b+k) <= n:
            ans += n-(la*b+ k) + 1

    print(ans)


Measured memory_bytes: 39280