akhauriyash/Code-Regression huggingface dataset:
//Program.cpp
//Problem Statement - 

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

//Author: Varun Goyal (@govarun)

#define f(i, n) for(int i=0;i<(n);++i)
#define fa(i, a, n) for(int i=(a);i<=(n);++i)
#define fd(i, a, n) for(int i=(a);i>=(n);--i)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define popb pop_back
#define ull unsigned long long
#define debug if(GOVARUN) cerr
#define d0(x) debug <<#x<<" = "<<x<<' '
#define d1(x) debug <<"> "<<#x<<" = "<<x<<'\n'
#define d2(x, y) debug <<"> "<<#x<<" = "<<x<<' '<<#y<<" = "<<y<<'\n'
#define d3(x, y, z) debug <<"> "<<#x<<" = "<<x<<' '<<#y<<" = "<<y<<' '<<#z<<" = "<<z<<'\n'
#define endl '\n'
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector< pair<int, int> > vpii;
inline bool EQ(double a, double b) { 
return fabs(a-b) < 1e-9; }
inline int two(int n) { return 1 << n; }

const ll mod = 1e9 + 7;
const int maxn = 1e5 + 5;

void pre(){

    
}


void solve();

int main(){
    ios::sync_with_stdio(0);    
    cin.tie(0); cout.tie(0);
    #ifdef GOVARUN
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #else 
    #define GOVARUN 0
    #endif
    int TC = 1;
    // cin >> TC;
    while(TC--){    
        solve();
    }

    return 0;
}

void solve(){
    int n, W; cin >> n >> W;
    int w[n], v[n];
    f (i, n) {
        cin >> w[i] >> v[i];
    }
    ll val[n + 1][W + 1];
    fill( val);
    fa (i, 0, n) {
        fa (j, 0, W) {
            if (i == 0 || j == 0) val[i][j] = 0;
            else if (j >= w[i - 1]) {
                val[i][j] = max(val[i - 1][j], val[i - 1][j - w[i - 1]] + v[i - 1]);
            }
            else val[i][j] = val[i - 1][j];
        }
    }
    cout << val[n][W];

}

Measured memory_bytes: 79232
N = list(map(int, input().split()))
N2 = [0,0,0]
ans = 0
while True:
    for i in range(3):
        if  not N[i] %2 == 0:
            print(ans)
            exit()
    N2[0] = (N[1] + N[2]) /2
    N2[1] = (N[0] + N[2]) /2
    N2[2] = (N[0] + N[1]) /2
    #print(N2)
    if N == N2:
        print('-1')
        exit()
    N = N2.copy()
    ans += 1


Measured memory_bytes: 3064
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <sstream>
#include <fstream>
#include <cmath>
#include <stack>
#include <queue>
#include <list>
#include <map>

using namespace std;

typedef vector<int> VI;
typedef vector<VI> VVI;

#define MAX(x,y) ( (x) > (y) ? (x) : (y) )
#define MIN(x, y) ( (x) < (y) ? (x) : (y) )
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n)  FOR(i,0,n)
#define IVFOR(p,a) for(vector<int>::iterator p = (a).begin(); p!=(a).end(); p++)
#define ILFOR(p,a) for(list<int>::iterator p = (a).begin(); p!=(a).end(); p++)
#define ALL(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define CHECK(x)  cout << #x << " = " << (x) << endl
#define FINA(y) cout << (y) << endl

int main(){

  int n;
 
  cin >> n;
  VI l(2*n);
  
  REP(i,2*n){
    cin >> l[i];
  }

  SORT(l);

  VI ll(l.rbegin(), l.rend());

  int ans = 0;

  for(int i = 0; i<2*n; i = i+2){
    ans += l[i];
  }

  FINA(ans);

 return 0;
}


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

using namespace std;

int main()
{
    int a,b,c,d,e;
    cin>>a>>b>>c;
    d = a-b;
    e = c-d;
    if(c>d)
        cout<<e<<endl;
    else
        cout<<"0"<<endl;

    return 0;
}


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

int main() {
	int N;
	cin>>N;
	vector<ll> a(N);
	for(int i=0;i<N;i++){
		cin >> a.at(i);
	}
	sort(a.begin(),a.end());
	ll ans=a.at(0);
	bool p=true;
	while(p){
		ans=a.at(0);
		for(int i=1;i<N;i++){
			a.at(i)=a.at(i)%ans;
			if(a.at(i)==0){
				// cout<<"erased;"<<a.at(i)<<endl;
				a.erase(a.begin()+i);
				i--;
				N--;
				if(a.size()==1){
					p=false;
					break;
				}
			}
		}
		
		if(p)sort(a.begin(),a.end());
	}
	ans=a.at(0);
	cout<<ans<<endl;
}


Measured memory_bytes: 1024
#include<stdio.h>
#include<string.h>
int main(){
    char s[100];
    int k;
    scanf("%d", &k);
    
    getchar();	//Getchar harus diatas string yg mau diinput
    scanf("%[^\n]", &s);
    
    
	if(strlen(s)<=k){
		printf("%s", s);
	}
	else{
    	int i=0;
    		for(i=0; i<k;i++){
				printf("%c", s[i]);
			}
	puts("...");
	}
	
    return 0;
}

Measured memory_bytes: 1732
n = int(input())
sn = list(input() for i in range(n))
m = int(input())
mn = list(input() for i in range(m))
ss = []
for i in range(len(sn)):
  ss.append(sn.count(sn[i])-mn.count(sn[i]))
print (max(max(ss),0))

Measured memory_bytes: 3064
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Scanner;

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

        long N = sc.nextLong();
        int threshold = (int) Math.sqrt(N) + 100; // 値の平方数超過の範囲には素数は多くても1つ / doubleの誤差調整
        List<Integer> primeNumbers = new ArrayList<>();

        int devideNum = 2;
        while(N % devideNum == 0) {
            primeNumbers.add(devideNum);
            N /= 2;
        }

        devideNum++;
        while (devideNum <= threshold) {
            if (N % devideNum == 0) {
                primeNumbers.add(devideNum);
                N /= devideNum;
            } else {
                devideNum +=2; // 2以外に偶数の素数は存在しない
            }
        }

        if(N != 1) {
            primeNumbers.add((int)N);
        }

        int e = 1;
        int result = 0;
        int last = 0;

        main: for(int i=0; i<primeNumbers.size(); i++) {
            int current = primeNumbers.get(i);

            if(current == last) {
                e++;
            }else {
                e = 1;
            }
            last = current;

            for(int j=2; j<=e; j++) {
                if(i+j-1 >= primeNumbers.size()) {
                    continue main;
                }
                if(primeNumbers.get(i+j-1) != current) {
                    continue main;
                }
            }
            result++;
            i = i+e-1;
        }

        System.out.println(result);

    }
}

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

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<string> vst;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;


const ll mod=(1e+9)+7;
const ll inf=1e+16; 

#define rep(i,m,n) for(ll i=m;i<n;i++)
#define repr(i,m,n) for(ll i=m;i>=n;i--)

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

 ll n;
  cin >> n;
 vll a(n);
  rep(i,0,n) cin >> a[i];
  
 vll cnt(100005,0); 
  
  vll dp(n+1,0);
  
  dp[0]=1;
  
  rep(i,0,n){
   if(a[i]==0) dp[i+1]=(3-cnt[0])*dp[i];
   else if(cnt[a[i]-1]-cnt[a[i]]==1) dp[i+1]=dp[i];
   else if(cnt[a[i]-1]-cnt[a[i]]==2) dp[i+1]=2*dp[i]; 
   else if(cnt[a[i]-1]-cnt[a[i]]==3) dp[i+1]=3*dp[i];
    dp[i+1]%=mod;
    cnt[a[i]]++;
  }
  
 cout << dp[n] << endl;
}


Measured memory_bytes: 2560
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
#define DBG(X) cout << #X << "=" << (X) << '\n';
#define SAY(X) cout << (X) << '\n';
#else
#define DBG(X)
#define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

std::string pad(int num)
{
    char buffer[4];
    std::snprintf(buffer, sizeof(buffer), "%03d", num);
    return buffer;
}

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

int solve()
{
    int A, B, M;

    std::cin >> A >> B >> M;

    vector<int> va = fetch_vec<int>(A);
    vector<int> vb = fetch_vec<int>(B);

    int minA = *min_element(va.begin(), va.end());
    int minB = *min_element(vb.begin(), vb.end());

    int minSum = minA + minB;

    for (int i = 0; i < M; ++i){
        int xa, xb, c;

        cin >> xa >> xb >> c;

        minSum = std::min(minSum, va[xa-1] + vb[xb-1] - c);
    }

    cout << minSum << endl;

    return 0;
}

int main()
{
//    std::cout << solve() << std::endl;
    solve();

    return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int min_cost=100000000;
  for(int i=-100;i<=100;i++){
    int cost=0;
    for(int j=0;j<n;j++){
      int b=a[j]-i;
      cost+=pow(b,2);
    }
    min_cost=min(min_cost,cost);
  }
  cout<<min_cost<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	int a,b,c,count=0,i;
	
	scanf("%d %d %d",&a,&b,&c);
	
	for(i=a;i<=b;i++){
		if(c%i==0){
			count++;
		}
	}
	
	printf("%d\n",count);
	return 0;
}

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

Measured memory_bytes: 580
#include<bits/stdc++.h>
#define int long long
using namespace std;
constexpr int mod=1e9+7;
signed main(){
    int m,x[200],y[200],n,a,b;
    while(cin>>m,m){
    for(int i=0;i<m;i++)
        cin>>x[i]>>y[i];
    set<pair<int,int>>st;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a>>b;
        st.emplace(a,b);
    }
    for(auto e:st){
        bool ok=1;
        int dx=e.first-x[0],dy=e.second-y[0];
        for(int i=0;i<m;i++)
            if(!st.count(make_pair(dx+x[i],dy+y[i])))
                ok=0;
        if(ok){
            cout<<dx<<' '<<dy<<endl;
            break;
        }
    }}
}



Measured memory_bytes: 3148
#include<stdio.h>

int main(void){
    int n,i,j;
    scanf("%d",&n);
    int a[200]={0},b[200]={0},c[200]={0};
    for(i = 0;i < n;i++){
        scanf("%d %d %d\n",&a[i],&b[i],&c[i]);
    }
    int flag[101][4]={{0}};
    for(i = 0;i < n;i++){
        flag[a[i]][1]++;
    }
    for(i = 0;i < n;i++){
        if(flag[a[i]][1] >= 2){
            a[i] = 0;
        }
    }
    for(i = 0;i < n;i++){
        flag[b[i]][2]++;
    }
    for(i = 0;i < n;i++){
        if(flag[b[i]][2] >= 2){
            b[i] = 0;
        }
    }
    for(i = 0;i < n;i++){
        flag[c[i]][3]++;
    }
    for(i = 0;i < n;i++){
        if(flag[c[i]][3] >= 2){
            c[i] = 0;
        }
    }
    for(i = 0;i < n;i++){
        printf("%d\n",a[i]+b[i]+c[i]);
    }
    return 0;
}

Measured memory_bytes: 604
import sys
s = [int(x) for x in input()]
n = len(s)-1
for i in range(2**n):
    op = ["-"]*n
    for j in range(n):
        if (i>>j)&1 == 1:
            op[n-1-j] = "+"
    ans = s[0]
    for j in range(n):
        if op[j] == '-':
            ans -= s[j+1]
        else:
            ans += s[j+1]
    if ans == 7:
        ans2 = str(s[0])
        for j in range(n):
            ans2 += op[j]
            ans2 += str(s[j+1])
        print(ans2+"=7")
        sys.exit()

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

int main() {
  int n, d, count;
  count = 0;
  cin >> n >> d;
  vector<vector<double>>  x(n, vector<double>(d));
  for (int i=0; i<n; i++) {
    for (int j=0; j<d; j++) {
    	cin >> x[i][j];
    }
  }
  
  for (int i=0; i<n; i++) {
  	for (int j=i+1; j<n; j++) {
      double f = 0;
      for (int k=0; k<d; k++) {
      	f += pow(x[i][k]-x[j][k], 2);
      }
      if (sqrt(f)==int(sqrt(f))) {
      	count++;
      }
    }
  }
  cout << count << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pi pair<int,int>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,a,b) for(int i = a ; i <= b;i++)
using namespace std;
void debug(int x){
    cerr<<x<<endl;
}
void debug(vector<int> v){
    for(int i = 0 ; i<v.size(); i++) cerr<<v[i]<<" ";
    cerr<<"\n";
}
void debug(int *A, int N){
    for(int i = 0 ; i < N;i++) cerr<<A[i]<<" ";
    cerr<<endl;
}
void debug(int *A, int i, int j){
    for(int k = i;k<=j;k++) cerr<<A[k]<<" ";
    cerr<<endl;
}
void scan(vector<int> &h,int N){
    for(int i = 0 ; i < N;i++){
        scanf("%d",&h[i]);
    }
}




int main(){
             int N;
             scanf("%d",&N);
             vector<int> dp(3,0);
             //dp[i] is the maximum cost given that last activity was i
             for(int days = 0; days<N; days++){
                  int a, b,c;
                  cin>>a>>b>>c;
                  int temp_a = max({dp[0], dp[1] + a, dp[2] + a});
                  int temp_b= max({dp[1], dp[0] + b, dp[2] + b});
                  int temp_c = max({dp[2], dp[0] + c, dp[1] + c});
                  dp[0] = temp_a; dp[1] = temp_b; dp[2] = temp_c;
              //   cout<<endl; debug(dp);
             }
             cout<<max({dp[0],dp[1],dp[2]});    
}


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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { cout << #a << " = " << a << endl; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T> void operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) cin >> e; }

typedef long long ll;

int64_t Q, H, S, D, N;
int64_t const Alpha = 2;

int main() {
  cin >> Q >> H >> S >> D >> N;
  auto precost = min(2 * Q, H);
  auto cost = min(2 * precost, S);
  cout << min(N * cost, N / 2 * D + (N % 2 == 1 ? cost : 0)) << "\n";
}


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

const ll mod = 1e9 + 7;
const int maxn = 1e4 + 10;

ll DP[maxn][105][2];
string s;
int N , D;

int main(){
    cin >> s;
    cin >> D;
    N = s.size();
    reverse(s.begin() , s.end());
    DP[0][0][1] = 1;
    for(int i = 0; i < N; ++i){
        for(int d = 0; d <= 9; ++d){
            for(int j = 0; j < D; ++j){
                int nj = (j + d) % D;
                for(int k = 0; k < 2; ++k){
                    int nk = d == s[i] - '0' ? k : d < s[i] - '0';
                    DP[i + 1][nj][nk] += DP[i][j][k];
                    DP[i + 1][nj][nk] %= mod;
                }
            }
        }
    }
    cout << (DP[N][0][1] - 1 + mod) % mod << endl;
}


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

using namespace std;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define INF (1LL << 55)
#define MOD (1000 * 1000 * 1000 + 7)
#define maxn 200111

typedef long long ll;
typedef long double ld;

map<ll, ll> m;
vector<ll> v;

int main(){
	int n;
	ll ans = 0;
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		ll a;
		scanf("%lld", &a);
		m[a]++;
	}

	for(auto i : m){
		for(int j = 0; j < i.se / 2; j++)
			v.pb(i.fi);
	}

	sort(v.begin(), v.end());
	reverse(v.begin(), v.end());

	if(v.size() >= 2)
		ans = v[0] * v[1];

	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 6528
<?php

$N = trim(fgets(STDIN));
$t = [];
for ($i = 0; $i < $N; $i++) {
    $t[] = explode(" ", trim(fgets(STDIN)));
}

$t_pre = 0;
$x_pre = 0;
$y_pre = 0;

for ($i = 0; $i < $N; $i++) {
    $tmp = ($t[$i][0] - $t_pre) - abs($t[$i][1] - $x_pre) - abs($t[$i][2] - $y_pre);
    if ($tmp >= 0 && $tmp % 2 == 0) {
        $t_pre = $t[$i][0];
        $x_pre = $t[$i][1];
        $y_pre = $t[$i][2];
    } else {
        echo "No".PHP_EOL;
        exit;
    }
}

echo "Yes".PHP_EOL;


Measured memory_bytes: 84724
#! /usr/bin/env python3
# -*- coding: utf-8 -*-

# Input line num
num = int(input())
# Input rates
rates = [int(input()) for i in range(num)]

maxv = -100000000000
minv = 100000000000

for i in range(len(rates)):
  maxv = max(maxv, rates[i] - minv)
  minv = min(minv, rates[i])

print(maxv)



Measured memory_bytes: 13604
using System;
using System.IO;
using System.Linq;

class Program
{
    static void Solve()
    {
        var S = Read();

        var s0diff = 0;
        var s1diff = 0;

        for (var i = 0; i< S.Length; i++)
        {
            var d = i % 2;

            if (d == 0)
            {
                if (S[i] == '0') s1diff++;
                else s0diff++;
            } else
            {
                if (S[i] == '0') s0diff++;
                else s1diff++;
            }
        }

        Console.WriteLine(Math.Min(s0diff, s1diff));
    }

    static void Main(string[] args)
    {
        var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
        Console.SetOut(sw);
        Solve();
        Console.Out.Flush();
    }

    public static string Read() { return Console.ReadLine(); }
    public static int ReadInt() { return int.Parse(Read()); }
    public static long ReadLong() { return long.Parse(Read()); }
    public static double ReadDouble() { return double.Parse(Read()); }

    public static string[] Reads() { return Console.ReadLine().Split(' '); }
    public static int[] ReadInts() { return Reads().Select(_ => int.Parse(_)).ToArray(); }
    public static long[] ReadLongs() { return Reads().Select(_ => long.Parse(_)).ToArray(); }
    public static double[] ReadDoubles() { return Reads().Select(_ => double.Parse(_)).ToArray(); }
}

Measured memory_bytes: 13116
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <set>
using namespace std;
typedef long long ll;

const int ms = 200005;

int main()
{
    string s;
    cin >> s;
    if (s == "Sunny")
    {
        cout << "Cloudy";
    }
    else if (s == "Cloudy")
    {
        cout << "Rainy";
    }
    else
    {
        cout << "Sunny";
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <set>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <stack>
#include <complex>
#include <stdlib.h>
#include <stdio.h>
#include <functional>
#include <cfloat>
#include <math.h>


#define fs first
#define sc second

using namespace std;

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

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


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


int main(){
    int N;
    cin >> N;

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

    ll fr[101000], ba[101000];
    fr[0] = a[0];
    ba[N-1] = a[N-1];
    for(int i = 1; i < N; i++){
        fr[i] = gcd(a[i], fr[i-1]);
    }
    for(int i = N-2; i >= 0; i--){
        ba[i] = gcd(a[i], ba[i+1]);
    }

    ll ma = 0;
    ma = max(ma, ba[1]);
    for(int i = 1; i < N-1; i++){
        ma = max(ma, gcd(fr[i-1], ba[i+1]));
    }
    ma = max(ma, fr[N-2]);

    cout << ma << endl;




    return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rep(i,N) for(ll i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

ll a,b;

int main(){
    cin >> a >> b;
    if((a*b)%2)cout << "Odd" << endl;
    else cout << "Even" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
#include<queue>
#include<map>
#include<vector>
#include<cmath>
#include<fstream>
#include <set>
//freopen(".in","r",stdin);
//freopen(".out","w",stdout);
//freopen("input.txt","r",stdin);
//freopen("output.txt","w",stdout);
const int  MAXN =2e5+10;
const long long  mod = 1e14 ;
const long long INF = 0x7f7f7f7f7f7f7f7f;
const int inf= 0x3f3f3f3f;
#define eps 1e-8
#define PI 3.1415926535898
#define lowbit(x) (x&(-x))
using namespace std ;
//getline(cin,s);
//set<ll>::iterator it;
//map<int,int>::iterator it;
typedef long long ll;
typedef unsigned long long ull;
//unordered_map<int,int>mp;
//int need[MAXN];
//map<int,int>mp;
//TLE了 可能思路：每个数*一个数的形式 判断所得的num 然后与n比较 
//这道题注意点：O() 在数据范围小的情况下 尽量开普通数组 然后 是unordered_map（查找快，无序） 最后是map
//自己老是习惯开map 然后tle 不知所措 
int main()
{
	//c^2=a^2+b^2-2*a*b*cos(x);
	double a,b,h,w;
	scanf("%lf%lf%lf%lf",&a,&b,&h,&w);
	double ans1=0,ans2=0,ans;
	ans1=30*h;ans2=6*w;
	ans=abs(ans1-ans2+w/2);
	if(ans>=180) ans=360-ans;
//	printf("%lf\n",cos(PI*ans/180));
	double result;
	result=sqrt(a*a+b*b-2*a*b*cos(PI*ans/180));
	printf("%.10lf",result);
	return 0;	
} 

Measured memory_bytes: 4116
n = int(input())
lev = [int(i) for i in input().split()]

lev_s = sorted(lev)
ans = 0

if lev_s[n//2] == lev_s[n//2 - 1]:
  print(0)
else:
  print(abs(lev_s[n//2] - lev_s[n//2 - 1]))

Measured memory_bytes: 20796
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>

using namespace std;

int main() {
    int n;

    cin >> n;

    vector<int> v(n,0);

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

    int count = 0;
    for(int i = 1 ; i < n-1; i++) {
        if(max({v[i-1], v[i], v[i+1]}) != v[i] && min({v[i-1], v[i], v[i+1]}) != v[i]) count++;
    }

    cout << count << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

typedef struct LLIST LList;
struct LLIST {
  LList *prev, *next;
  int v;
};

void add(LList *prev, LList *e) {
  e->next = prev->next;
  e->prev = prev;
  prev->next->prev = e;
  prev->next = e;
}

void removeElem(LList *e) {
  LList *prev = e->prev, *next = e->next;
  prev->next = next;
  next->prev = prev;
  free(e);
}

LList *findElem(LList *root, int v) {
  LList *p = root->next;
  while (p != root) {
    if (p->v == v) return p;
    p = p->next;
  }
  return NULL;
}

void printList(LList *root) {
  LList *p = root->next;
  while (p != root) {
    printf("%d", p->v);
    p = p->next;
    if (p != root) putchar(' ');
  }
  putchar('\n');
}

int main(int argc, char *argv[]) {
  int n;
  char s[16];
  scanf("%d", &n);
  LList root;
  root.next = &root;
  root.prev = &root;

  for (int i = 0; i < n; i++) {
    scanf("%s", s);
    if (s[0] == 'i') {
      LList *e = malloc(sizeof(LList));
      scanf("%d", &e->v);
      add(&root, e);
    } else if (s[0] == 'd') {
      if (s[6] == 'F') {
        removeElem(root.next);
      } else if (s[6] == 'L') {
        removeElem(root.prev);
      } else {
        int v;
        scanf("%d", &v);
        LList *e = findElem(&root, v);
        if (e) {
          removeElem(e);
        }
      }
    }
  }
  printList(&root);
  return 0;
}

Measured memory_bytes: 32976
'use strict'

const INF = 900719925474099;
function mapint(temp){
    return temp.split(' ').map((v)=>parseInt(v));
}
function lower_bound(d,a,b,e){for(var c;1<b-a;)d[c=0|(a+b)/2]<e?a=c:b=c;return d[a]<e?b:a};
const MOD = 1000000007;

function Main(input){
    let temp = input.trim();
    let temp2 = mapint(temp);
    let w = temp2.shift();
    let h = temp2.shift();
    let x = temp2.shift();
    let y = temp2.shift();

    let ans = w * h / 2;
    let ans2;
    if( w/2 == x && h/2 == y) ans2=1;
    else ans2=0 
    console.log(ans,ans2);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

int main(){
    int N;
    cin >> N;
    vector<long long> R(N);
    long long maxv = -1000000007;
    long long minv;

    cin >> R.at(0);
    minv = R.at(0);

    for ( int i = 1; i < N; i++ ){
        cin >> R.at(i);
        maxv = max( maxv, R.at(i) - minv );
        minv = min( minv, R.at(i) );
    }

    cout << maxv << endl;

    return 0;
}



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

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

//infinity
#define INF 999999999

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

int main(){
	int n, m; cin >> n >> m;
	long long x[n], y[n], z[n];
	REP(i, n) cin >> x[i] >> y[i] >> z[i];

	long long ans = 0;
	REP(i, 8){
		vector<long long> v;
		REP(j, n){
			long long xx = ( i & 1 ) ? x[j] : -x[j];
			long long yy = ( i & 2 ) ? y[j] : -y[j];
			long long zz = ( i & 4 ) ? z[j] : -z[j];
			v.push_back( xx + yy + zz );
		}
		sort(v.begin(), v.end(), greater<long long>());

		long long tmp = 0;
		REP(j, m) tmp += v[j];
		ans = max(ans, tmp);
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;
 
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key
 
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int n; ll x; cin>>n>>x;
	for(ll i=0;i<=n;i++)
	{
		for(ll j=0;i+j<=n;j++)
		{
			ll k=n-i-j;
			if(i*10000+j*5000+k*1000==x)
			{
				cout<<i<<' '<<j<<' '<<k<<'\n'; return 0;
			}
		}
	}
	cout<<-1<<' '<<-1<<' '<<-1<<'\n';
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define _GLIBCXX_DEBUG
const ll MOD = 1000000007;
const ll mod = 998244353;
const int MAX = 510000;

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

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, N) for(int i = 0; i < N; i++)
#define rep2(i, N, a, b) for(int i = a; i < N; i += b)
typedef long long ll;

int main(){
	string S;
	ll K;
	cin >> S >> K;

	if (K == 1){
		cout << S.at(0) << endl;
		return 0;
	}
	int cnt = 0;
	rep(i, (int)(S.size())){
		// cout <<"in" << endl;
		if (S.at(i) == '1') cnt++;
		else break ;
	}
	// cout << S <<endl;
	// cout <<"cnt: " << cnt << endl;
	if (cnt >= K) cout << 1 << endl;
	else if (cnt > 0) cout << S.at(cnt) << endl;
	else cout << S.at(0) << endl;
}




Measured memory_bytes: 256
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
 
using namespace std;
typedef long long ll;
 
 
typedef pair<ll,ll> P;
long long int INF = 1e18;
double Pi = 3.141592653589;
const int mod = 1000000007;
// memset(a,0,sizeof(a)); →全部０にする
 
vector<ll> G[100005];
vector<P> tree[100010];
 
int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
 
#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<x<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<x;
#define re(i,a,b) for(i=a;i<=b;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
 
ll rui(ll abc,ll bed){
	//aのb乗を計算する
	if(bed==0){return 1;}
	else{
		ll ced = rui(abc,bed/2);
		ced *= ced;
		ced %= mod;
		if(bed%2==1){ced*=abc; ced%=mod;}
		return ced;
	}
}

ll i,j,k,ii,jj;
ll n,m,sum,num;
ll a,b,c,d,e,ans;
ll x[500005],y[500005];

bool used[500005];
string s,t;

int main(){
	cin>>n;
	for(i=0;i<n;i++){
		cin>>x[i];
		y[i]=x[i];
	}
	sort(y,y+n);
	for(i=0;i<n;i++){
		a = lb(y,y+n,x[i])-y;
		ans += (abs((a-i))%2);
	}
	p(ans/2);
	return 0;
}

Measured memory_bytes: 7936
n = gets.to_i # n <= 50
a = gets.chars.take(n)

result = 0

(n - 2).times do |i|
  next unless a[i] == 'A'
  next unless a[i+1] == 'B'
  next unless a[i+2] == 'C'
  result += 1
end

puts result

Measured memory_bytes: 1788
s = list(input())

a = ['R', 'U', 'D']
b = ['L', 'U', 'D']

def solve(s):
    for i in range(len(s)):
        if i % 2 == 0:
            if (s[i] not in a):
                return False
        else:
            if (s[i] not in b):
                return False
    return True

if (solve(s)):
    print("Yes")
else:
    print("No")

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

typedef long long int ll;
typedef pair<int,int> pi;
priority_queue<pi, vector<pi>, greater<pi> > pq; //min heap

ll mini(ll a,ll b){	return a<b?a:b;}
ll maxi(ll a,ll b){	return a>b?a:b;}
ll gcd(ll a,ll b){	if(b == 0)	return a;return gcd(b,a%b);}
ll binpow(ll n,ll x){	ll ans = 1;while(x){if(x & 1)	ans *= n;n *= n;x >>= 1;}return ans;}

#define INF 1e15+10

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

    ll n,w;
    cin>>n>>w;
    vector<ll> dp(n*1e3 +10, INF); // dp on the possible values and task is to minimize this dp[] which will be the sum of the weights 
    dp[0] = 0;

    ll rows[n][2];
    for(int i=0;i<n;++i)    cin>>rows[i][0]>>rows[i][1];
    ll tot = 0;
    for(int i=0;i<n;++i)    tot += rows[i][1];

    for(int i=0;i<n;++i){
        for(int j=tot - rows[i][1];j>=0;--j){
            dp[j + rows[i][1]] = min(dp[j + rows[i][1]], dp[j] + rows[i][0]);
        }
    }

    ll answer = 0;

    for(ll j=0;j<=tot; ++j){
        if(dp[j] <= w){
            answer = max(answer, j);
        }
    }

    cout<<answer<<"\n";

    return 0;
}

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

class Program
{
    void Run()
    {
        var sc = new Scanner();
        long a = sc.NextLong();
        long b = sc.NextLong();
        long c = sc.NextLong();
        long d = sc.NextLong();

        long l = Lcm(c, d);
        long div = Count(b, c) - Count(a - 1, c) + Count(b, d) - Count(a - 1, d) - (Count(b, l) - Count(a - 1, l));
        Console.WriteLine(b - a + 1 - div);
    }

    static long Count(long a, long b)
    {
        return a / b;
    }

    static void Main(string[] args)
    {
        new Program().Run();
    }

    static long Gcd(long a, long b)
    {
        if (a < b) return Gcd(b, a);
        if (b == 0) return a;
        return Gcd(b, a % b);
    }

    static long Lcm(long a, long b)
    {
        long d = Gcd(a, b);
        return a * b / d;
    }
}

class Scanner
{
    int index = -1;
    string[] buf;

    public Scanner()
    {
    }

    public int NextInt()
    {
        CheckNext();
        return int.Parse(buf[index++]);
    }

    public long NextLong()
    {
        CheckNext();
        return long.Parse(buf[index++]);
    }

    public double NextDouble()
    {
        CheckNext();
        return double.Parse(buf[index++]);
    }

    public string NextString()
    {
        CheckNext();
        return buf[index++];
    }

    private void CheckNext()
    {
        if (index >= 0 && index < buf.Length) return;

        buf = Console.ReadLine().Split(' ');
        index = 0;
    }
}


Measured memory_bytes: 13140
#include "bits/stdc++.h"
#define PRECISION(x) cout << fixed << setprecision(x)
#define FAST_IO ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define ALLR(X) (X).rbegin(), (X).rend()
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define F first
#define S second

using namespace std;
 
template<class T> void max_self(T & a, const T & b) { if(a < b) a = b; }
template<class T> void min_self(T & a, const T & b) { if(a > b) a = b; }
typedef long long LL;
const int INF = 1e9 + 7;
const double PI = acos(-1.0);
const double EPS = (1e-9);


int main(){
  FAST_IO  
  int a, b; cin >> a >> b;
  if(a & 1 && b & 1) cout << "Odd\n";
  else cout << "Even\n";
  return 0;
}

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

struct Node {
    int key;
    Node *right, *left, *parent;
};

Node *root, *NIL;

Node * treeMinimum(Node *x) {
    while (x->left != NIL) x = x->left;
    return x;
}

Node * find(Node *u, int k) {
    while (u != NIL && k != u->key) {
        if (k < u->key) u = u->left;
        else u = u->right;
    }
    return u;
}

Node * treeSuccessor(Node *x) {
    if (x->right != NIL) return treeMinimum(x->right);
    Node *y = x->parent;
    while (y != NIL && x == y->right) {
        x = y;
        y = y->parent;
    }
    return y;
}

void treeDelete(Node *z) {
    Node *y;
    Node *x;
    
    if (z->left == NIL || z->right == NIL) y = z;
    else y = treeSuccessor(z);
    
    if (y->left != NIL) {
        x = y->left;
    } else {
        x = y->right;
    }
    
    if (x != NIL) {
        x->parent = y->parent;
    }
    
    if (y->parent == NIL) {
        root = x;
    } else {
        if (y == y->parent->left) {
            y->parent->left = x;
        } else {
            y->parent->right = x;
        }
    }
    
    if (y != z) {
        z->key = y->key;
    }
    
    free(y);
}

void insert(int k) {
    Node *y = NIL;
    Node *x = root;
    Node *z;
    
    z = (Node *)malloc(sizeof(Node));
    z->key = k;
    z->left = NIL;
    z->right = NIL;
    
    while (x != NIL) {
        y = x;
        if (z->key < x->key) {
            x = x->left;
        } else {
            x = x->right;
        }
    }
    
    z->parent = y;
    if (y == NIL) {
        root = z;
    } else {
        if (z->key < y->key) {
            y->left = z;
        } else {
            y->right = z;
        }
    }
}

void inorder(Node *u) {
    if (u == NIL) return;
    inorder(u->left);
    printf(" %d", u->key);
    inorder(u->right);
}
void preorder(Node *u) {
    if (u == NIL) return;
    printf(" %d", u->key);
    preorder(u->left);
    preorder(u->right);
}

int main() {
    int n, i, x;
    string com;
    
    scanf("%d", &n);
    
    for (i = 0; i < n; i++) {
        cin >> com;
        if (com[0] == 'f') {
            scanf("%d", &x);
            Node *t = find(root, x);
            if (t != NIL) printf("yes\n");
            else printf("no\n");
        } else if (com == "insert") {
            scanf("%d", &x);
            insert(x);
        } else if (com == "print") {
            inorder(root);
            printf("\n");
            preorder(root);
            printf("\n");
        } else if (com == "delete") {
            scanf("%d", &x);
            treeDelete(find(root, x));
        }
    }
    
    return 0;
}


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

char a;
int n,m,f=1;

int main()
{
	cin>>n>>m;
	for(int i=1;i<=n+m+1;i++)
	{
		cin>>a;
		if(a=='-' && i!=n+1 || i==n+1 && a!='-') f=0;
	}
	puts(f?"Yes":"No");
	return 0;
}

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

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

const ll INF = LLONG_MAX;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

#define int long long

inline void my_io() {

	std::ios::sync_with_stdio(false);

	std::cin.tie(0);

	cout << fixed << setprecision(16);

	//cout << setprecision(10) << scientific << ans << endl;
}

vector<ll> v;

ll n, k;

bool solve(ll g) {
	vector<ll> vv;
	ll sum = 0;

	REP(i, n) {
		ll x = v[i] % g;
		if (x != 0) {
			sum += x;
			vv.push_back(x);
		}
	}

	ll x = sum / g;

	sort(vv.begin(), vv.end(), greater<ll>());

	ll ans = 0;

	REP(i, x) {
		ans += g - vv[i];
	}

	return ans <= k;
}

//約数の列挙
vector<ll> divisor(ll n) {
	vector<ll> res;
	for (int i = 1; i * i <= n; i++) {
		if (n % i == 0) {
			res.push_back(i);
			if (i != n / i) {
				res.push_back(n / i);
			}
		}
	}
	return res;
}

signed main() {
	ll a;

	cin >> n >> k;

	ll sum = 0;

	REP(i, n) {
		cin >> a;
		v.push_back(a);
		sum += a;
	}

	vector<ll> res = divisor(sum);

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

	ll ans = 0;

	REP(i, res.size()) {
		if (solve(res[i])) {
			ans = res[i];
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 384
#include <algorithm>
#include <cstring>
#include <iostream>
#include <vector>
#include <cmath>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <functional>
#define rep(i,n) for (int i = 0; i < (n); ++i)

using namespace std;
const int MOD = 1000000007;


typedef long long int ll; 
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;

void floatOutPutSetup(){
    cout << fixed;
    cout << setprecision(10);
}

int main(){
    int a, t=400;
    cin >> a;

    if(a>=t&&a<=t+199){
        cout<<8;
    }
    t=600;
    if(a>=t&&a<=t+199){
        cout<<7;
    }
    t=800;
    if(a>=t&&a<=t+199){
        cout<<6;
    }
    t=1000;
    if(a>=t&&a<=t+199){
        cout<<5;
    }
    t=1200;
    if(a>=t&&a<=t+199){
        cout<<4;
    }
    t=1400;
    if(a>=t&&a<=t+199){
        cout<<3;
    }
    t=1600;
    if(a>=t&&a<=t+199){
        cout<<2;
    }
    t=1800;
    if(a>=t&&a<=t+199){
        cout<<1;
    }

    return 0;
}

Measured memory_bytes: 3632
w = input()
mp = dict()

for c in w:
    if c in mp:
        mp[c] += 1
    else:
        mp[c] = 1

def check(w):
    c = "Yes"
    for i in w:
        if i % 2 == 0:
            continue
        else:
            c = "No"
            break
    return c

print(check(mp.values()))

Measured memory_bytes: 2940
#include <stdio.h>
int main()
{
	int n;
	scanf("%d",&n);
	int a[n];
	for(int i=0;i<n;i++){
		scanf("%d",a+i);
	}
	for(int i=n-1;i>=1;i--){
		printf("%d ",a[i]);
	}
	printf("%d\n",a[0]);
	return 0;
}


Measured memory_bytes: 2048
#include<iostream>
#include<math.h>
#include<iomanip>
#include<vector>
#include<algorithm>
#include<queue>
#include<string>
#include<stdlib.h>
using namespace std;
#define PI 3.14159265358979
typedef  long long ll;
#define rep(i,n) for(int i=0;i<n;i++)
#include<set>
//---------------------------------------------
 
int main(void)
{
string s;

cin>>s;

if(s[0]=='7'||s[1]=='7'||s[2]=='7')
{
    cout<<"Yes"<<endl;
}
    else cout<<"No"<<endl;


}

Measured memory_bytes: 3624
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
typedef vector<int> vi;
#define mp make_pair
#define MAX 1e13
typedef long long ll;
typedef pair<int, int> pi;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<pi> vii;
#define LSOne(S) (S & (-S))
int main()
{
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	set<char> st;
	for (int i = 0; i < s.size(); i++)
	{
		st.insert(s[i]);
	}
	if (st.size() == 2)
		cout << "Yes";
	else
		cout << "No";
}

Measured memory_bytes: 256
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

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

fn main() {
    input!{
        s: String,
    };
    if s == "ABC" {
        println!("ARC");
    } else {
        println!("ABC");
    }
}


Measured memory_bytes: 2116
#include <iostream>
#include <vector>
#include <unordered_set>
using namespace std;
int main() {
    int N, M;
    cin >> N >> M;
    vector<unordered_set<int>> adjs(N);
    for (int i = 0, a, b; i < M; i++) {
        cin >> a >> b;
        adjs[a - 1].insert(b - 1);
        adjs[b - 1].insert(a - 1);
    }
    unordered_set<int> possible;
    for (auto i : adjs[0]) {
        for (auto j : adjs[i]) possible.insert(j);
    }
    cout << (possible.find(N - 1) == possible.end() ? "IMPOSSIBLE" : "POSSIBLE") << endl;
}


Measured memory_bytes: 31944
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>
using namespace std;
namespace adaptor = boost::adaptors;


#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
typedef long long ll;


void Main()
{
  int H, A;
  cin >> H >> A;
  int ans = (H-1)/A +1;
  cout << ans << endl;

 return;
}


int main()
{
 cin.tie(nullptr);
 ios_base::sync_with_stdio(false);
 cout << fixed << setprecision(15);
 Main();
 return 0;
}


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

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

using namespace std;

int main(){
	for(int m,n;scanf("%d%d ",&m,&n),m;){
		char s[10][128];
		rep(i,m){
			fgets(s[i],128,stdin);
			int l=strlen(s[i]);
			if(s[i][l-1]=='\n') s[i][--l]='\0';
		}

		int indent[10];
		rep(i,m){
			int j;
			for(j=0;s[i][j]=='.';j++);
			indent[i]=j;
		}

		vector<int> c1_ans,c2_ans,c3_ans;
		for(int c1=1;c1<=20;c1++) for(int c2=1;c2<=20;c2++) for(int c3=1;c3<=20;c3++) {
			bool ok=true;
			int a1=0,a2=0,a3=0; // (, {, [ の個数
			rep(i,m){
				if(c1*a1+c2*a2+c3*a3!=indent[i]){ ok=false; break; }
				for(int j=0;s[i][j];j++){
					if(s[i][j]=='(') a1++;
					if(s[i][j]=='{') a2++;
					if(s[i][j]=='[') a3++;
					if(s[i][j]==')') a1--;
					if(s[i][j]=='}') a2--;
					if(s[i][j]==']') a3--;
				}
			}

			if(ok){
				c1_ans.push_back(c1);
				c2_ans.push_back(c2);
				c3_ans.push_back(c3);
			}
		}

		int a1=0,a2=0,a3=0;
		rep(i,n){
			char t[128];
			fgets(t,128,stdin);
			int l=strlen(t);
			if(t[l-1]=='\n') t[--l]='\0';

			set<int> S;
			rep(j,c1_ans.size()) S.insert(c1_ans[j]*a1+c2_ans[j]*a2+c3_ans[j]*a3);
			printf("%d%c",S.size()==1?*S.begin():-1,i+1<n?' ':'\n');

			for(int j=0;t[j];j++){
				if(t[j]=='(') a1++;
				if(t[j]=='{') a2++;
				if(t[j]=='[') a3++;
				if(t[j]==')') a1--;
				if(t[j]=='}') a2--;
				if(t[j]==']') a3--;
			}
		}
	}

	return 0;
}

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

using namespace std;

using u32 = uint32_t;
using u64 = uint64_t;
using i64 = int64_t;

#define FOR(i,a,b) for (int i = (a); i < (b); i++)
#define F0R(i,b) FOR(i,0,b)
#define RFO(i,a,b) for (int i = (b-1); i >= a; i--)
#define RF0(i,b) RFO(i,0,b)
#define F first
#define S second
#define ADD(a,b) (((u64)a + b)%MOD)
#define MUL(a,b) (((u64)a * b)%MOD)

constexpr int MOD = 998244353;

#if 1
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N, S;
  cin >> N >> S;

  vector<int> A(N);
  F0R(i, N) {
    cin >> A[i];
  }

  // dp[N][S]<patternCount, patternCountIncrement>
  vector<vector<pair<u32, u32>>> dp(N, vector<pair<u32, u32>>(S + 1));

  F0R(i, N) {
    int num = A[i];
    F0R(j, S + 1) {
      if (i > 0) {
        dp[i][j].first = dp[i - 1][j].first + dp[i - 1][j].second;
        dp[i][j].second = dp[i - 1][j].second;

        if (j > num) {
          dp[i][j].first += dp[i - 1][j - num].second;
          dp[i][j].second += dp[i - 1][j - num].second;
        }
      }

      if (j == num) {
        dp[i][j].first += i + 1;
        dp[i][j].second += i + 1;
      }

      dp[i][j].first %= MOD;
      dp[i][j].second %= MOD;

      //cout << dp[i][j].first << "+" << dp[i][j].second << ' ';
    }
    //cout << '\n';
  }

  cout << dp[N - 1][S].first;
}

#else
// テストデータを生成する
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  constexpr int N = 100;
  constexpr int S = 100;

  cout << N << ' ' << S << '\n';

  // Generate Random
#if 0
  int rmin = (int)(S / N), rmax = (int)(S * 3 / N);

  random_device seedGen;
  mt19937 engine(seedGen());
  uniform_int_distribution<> dist(rmin, rmax);

  F0R(i, N) {
    cout << dist(engine) << ' ';
  }
#endif

  // Generate Shorter
#if 1
  int a = 1, ap = max(1, S / N);
  F0R(i, N) {
    cout << (a++) << ' ';
  }
#endif

  cout << '\n';
}
#endif

Measured memory_bytes: 70784