akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstring>

namespace IO {
    template <typename _T>
    inline bool read (_T& x) {
        x = 0;
        _T y = 1;
        char c = getchar();
        while ((c < '0' || '9' < c) && c != EOF) {
            if (c == '-') y = -1;
            c = getchar();
        }
        if (c == EOF) return false;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getchar();
        x *= y;
        return true;
    }

    template <typename _T>
    inline _T input () {
        _T x = 0, y = 1;
        char c = getchar();
        while ((c < '0' || '9' < c) && c != EOF) {
            if (c == '-') y = -1;
            c = getchar();
        }
        if (c == EOF) return 0;
        while ('0' <= c && c <= '9') x = x * 10 + c - '0', c = getchar();
        x *= y;
        return x;
    }
};
using namespace IO;

namespace modular {
    const int MOD = 1000000007;

    inline int add (int x, int y) { return (x += y) >= MOD ? x -= MOD : x; }

    inline void inc (int &x, int y) { (x += y) >= MOD ? x -= MOD : 0; }

    inline int mul (int x, int y) { return 1LL * x * y % MOD; }

    inline int qpow (int x, int y) {
        int ans = 1;
        for (; y; y >>= 1, x = mul(x, x)) if (y & 1) ans = mul(ans, x);
        return ans;
    }
};

#define reg register
#define MAX_N 200007
#define FIN(s) freopen(s, "r", stdin)
#define FOUT(s) freopen(s, "w", stdout)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define rep(i, l, r) for(int i = l; i <= r; ++i)
#define lep(i, l, r) for(int i = l; i < r; ++i)
#define irep(i, r, l) for(int i = r; i >= l; --i)
#define ilep(i, r, l) for(int i = r; i > l; --i)
typedef long long ll;

int N;
ll s[MAX_N], c[MAX_N];
int head[MAX_N], to[MAX_N << 1], nxt[MAX_N << 1], cap;
int deg[MAX_N];

inline void addE (int u, int v) {
    nxt[++cap] = head[u];
    head[u] = cap;
    to[cap] = v;
}

bool dfs (int x, int las) {
    int cnt = 0;
    ll tmp = 0;
    for (int i = head[x]; i; i = nxt[i]) if (to[i] != las) {
        cnt++;
        if (!dfs(to[i], x)) return false;
        tmp += c[to[i]];
    }
    if (!cnt) return c[x] = s[x], true;
    if (tmp > 2LL * s[x] || s[x] > tmp) return false;
    if (cnt == 1) return c[x] = tmp, s[x] == tmp;
    // printf("%d %d %d %d\n", x, cnt, tmp, s[x]);
    ll mx = 0;
    for (int i = head[x]; i; i = nxt[i]) if (to[i] != las) {
        mx = std::max(mx, c[to[i]]);
    }
    ll a = mx * 2 > tmp ? tmp - mx : tmp / 2LL;
    if (a < tmp - s[x]) return false;
    return c[x] = 2LL * s[x] - tmp, true;
}

int main () {
#ifdef LOCAL
    FIN("in");
#endif
    read(N);
    rep (i, 1, N) read(s[i]);
    if (N == 1) return puts(s[1] == 0 ? "YES" : "NO"), 0;
    if (N == 2) return puts(s[1] == 1 && s[2] == 1 ? "YES" : "NO"), 0;
    int u, v;
    rep (i, 2, N) {
        read(u), read(v);
        addE(u, v);
        addE(v, u);
        deg[u]++, deg[v]++;
    }
    int rt = 0;
    rep (i, 1, N) if (deg[i] > 1) rt = i;
    puts(dfs(rt, 0) && c[rt] == 0 ? "YES" : "NO");
    return 0;
}

Measured memory_bytes: 12032
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String a = sc.next();
        char c = 'A';
        boolean f = false;
        for(int i=0;i<26;i++){
            if(String.valueOf(c).equals(a)){
                f = true;
                break;
            }
            c++;
        }

        System.out.println(f?"A":"a");
    }

}


Measured memory_bytes: 35532
N, M, X = map(int, input().split())

A = [list(map(int, input().split())) for _ in range(N)]

ans = 10**30
for i in range(2**N):
  cost = 0
  gain = [0 for _ in range(M+1)]
  j = i
  keta = 0
  while j > 0:
    if j & 1:
      cost += A[keta][0]
      for l in range(1,M+1):
        gain[l] += A[keta][l]
        #print(i,j,l,gain)
    j = j >> 1
    keta += 1
    
  result = True
  for l in range(1,M+1):
    if gain[l] < X:
      result = False
      break
    
  if result == True:
    ans = min(ans, cost)
      
print(ans if ans < 10**30 else -1)
        
        
        



Measured memory_bytes: 74040
/*
　　　　　　 ＿＿
　　　　　／＞　　 フ
　　　　　| 　_　 _ l
　 　　　／` ミ＿xノ
　　 　 /　　　 　 |　見ちゃだめだよ！
　　　 /　 ヽ　　 ﾉ　　
　 　 │　　|　|　|　　
　／￣|　　 |　|　|
　| (￣ヽ＿_ヽ_)__)
　＼二つ
*/

#include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
const long long INF = 1LL << 60;

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  int total = pow(3, n);
  int total2 = 1;
  //偶数だったら1通り
  rep(i, n) if (a[i] % 2 == 0) total2 *= 2;
  cout << total - total2 << endl;
}

Measured memory_bytes: 256
from collections import defaultdict

n, x, m = map(int, input().split())

def f(X, M):
  return X % M

appr = defaultdict(int)
appr[x] = 0
cnt = 0
fs = [x]

ans = x
for i in range(1, n):
  x = f(x ** 2, m)
  fs.append(x)
  if x not in appr:
    appr[x] = i
  else:
    span = i - appr[x]
    start = appr[x]
    end = i - 1
    spanSum = sum([i for i in fs[start:end+1]])
    d, m = divmod(n - i - 1, span)
    ans += spanSum * d + sum([i for i in fs[start:start + m + 1]])
    break
  ans += x

print(ans)

Measured memory_bytes: 16612
n, k = map(int, input().split())
l = []
import collections
for i in range(k*2):
    if (i%2)!=0:
        a = list(map(int, input().split()))
        l.extend(a)
    else:
      b = int(input())

l = collections.Counter(l)

print(n-len(l))

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

int main(void){
    int N;
    int A,B;
    cin>>N;

    if(N==2){
      cin>>A>>B;
      cout<<A+B<<endl;
    }
    else{
      cout<<"Hello World"<<endl;
    }



    // vector<int> data(N);
    // sort(data.begin(),data.end());//昇順ソート


    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define repr(i, a, b) for(ll i = (a); i < (b); i++)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
const ll MOD = 1000000007;
const ll INF = 100000000000000000LL;
inline ll GCD(ll a, ll b){ return b?GCD(b, a % b):a; }
inline ll LCM(ll a, ll b){ return a/GCD(a, b)*b; }
inline ll powint(ll x, ll y){ ll r=1; while(y){ if(y&1) r*=x; x*=x; y>>=1; } return r; }
inline ll powmod(ll x, ll y, ll m = MOD){ ll r=1; while(y){ if(y&1) r*=x; x*=x; r%=m; x%=m; y>>=1; } return r; }
template<class T>bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n, m;
    cin >> n >> m;
    vp w(n);
    rep(i, n){
        cin >> w[i].first >> w[i].second;
    }
    sort(ALL(w));
    priority_queue<pll> Q;
    ll c = 0;
    ll ans = 0;
    repr(i, m-n+1, m+1){
        while(c < n && w[c].first <= i){
            Q.push(make_pair(w[c].second, w[c].first));
            c++;
        }
        if(Q.empty()) continue;
        else{
            ans += Q.top().first;
            Q.pop();
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3956
#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;

    for(auto& c : S){
        if(c == '9'){
            std::cout << "Yes" << std::endl;
            return 0;
        }
    }

    std::cout << "No" << std::endl;    
}


Measured memory_bytes: 384
import collections
import math
def combinations_count(n, r):
    return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

N = int(input())
A = list(map(int, input().split()))
ans = 0
Union = [0]
tot = 0
for i in A:
    tot += i
    Union.append(tot)

num = collections.Counter(Union).values()
for i in num:
    if i >= 2:
        ans += combinations_count(i, 2)
print(ans)

Measured memory_bytes: 41728
#include<bits/stdc++.h>
using namespace std;
int n,cnt,a[55];
int main()
{
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i];
        if(a[i]!=i)cnt++;
    }
    if(cnt>2)puts("NO");
    else puts("YES");
    return 0;
}

Measured memory_bytes: 256
// Gaurav Nuti
 
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii > vii;
typedef vector<pll > vll;
#define pb push_back
#define mp make_pair 
#define ar array
#define mod 1000000007
#define F first
#define S second
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define For(i, a, b) for(__typeof (a) i=a; i<=b; i++)
#define inp_arr(a,n) for(__typeof (n) i=0; i<n; ++i) {cin>>a[i];}
#define debug_arr(a,n) {{for(__typeof (n) i=0; i<n; ++i) {cout<<a[i]<<" ";}cout<<"\n";}}
#define INF 1e9 

ll power(ll x, ll y) 
{ 
    ll res = 1;   
    while (y > 0) { 
        if (y & 1) 
            res = (res*x)%mod; 
        y = y>>1;
        x = (x*x)%mod; 
    } 
    return res%mod; 
}

ll power_without_mod(ll x, ll y) 
{ 
    ll res = 1;   
    while (y > 0) { 
        if (y & 1) 
            res = (res*x); 
        y = y>>1;
        x = (x*x); 
    } 
    return res; 
}

bool comparep(pair<ll, ll> i1, pair<ll, ll> i2){
	return (i1.S < i2.S);
} 

ll modInverse(ll a)
{
    return power(a , mod - 2);
}

vector<vector<ll>> graph;
vector<bool> visited;
vector<ll> dist;
map<ll,ll> mymap;
ll max_dist = 1;

void bfs(int u1){
    visited[u1] = 1;
    dist[u1] = 1;
    mymap[1] = u1;
    queue<ll> q;
    q.push({u1});
    while(!q.empty()){
        ll u = q.front();
        q.pop();
        for(auto i=graph[u].begin();i!=graph[u].end();i++){
            if(!visited[*i]){
                dist[*i] = dist[u] + 1;
                visited[*i] = 1;
                max_dist = max(dist[*i],max_dist);
                mymap[dist[*i]] = *i;
                q.push({*i});
            }
        }
    }
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
 
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout); 
    #endif  
	
    ll t;
    // cin>>t;
    t = 1;
    for(ll z=0;z<t;z++){
        ll n;
        cin>>n; 
        ll sum = 0;
        for(ll i=1;i<=n;i++){
            for(ll j=1;j<=n;j++){
                for(ll k = 1;k<=n;k++){
                    sum += __gcd(i,__gcd(j,k));
                }
            }
        }
        cout<<sum;
    }
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
#include <array>
using namespace std;
#define rep(i, n) for(int i = 0; i < (n); i++)
using ULL = unsigned long long;
using UL = unsigned;
using LL = long long;

void Solve() {
	UL c[3] = {};
	UL a, b; cin >> a >> b;
	c[a-1] = c[b-1] = 1;
	rep(i, 3)if (c[i] == 0) cout << i + 1 << endl;
}
int main() { Solve(); return 0; }


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

static const int INF = 1000000007;
using ll = long long;
using u32 = unsigned;
using namespace std;

int main() {
    int n;
    map<string, int> v;
    cin >> n;
    string t;
    cin >> t;
    char x = t[t.length()-1];
    v[t]++;
    for (int i = 0; i < n-1; ++i) {
        string s;
        cin >> s;

        if(v[s] || (s[0] != x)) {
            cout << "No" << "\n";
            return 0;
        }else {
            v[s]++;
            x = s[s.length()-1];
        }
    }
    cout << "Yes" << "\n";
    return 0;
}


Measured memory_bytes: 256
using System;
class Program
{
	static void Main(string[] args)
	{
		string s = Console.ReadLine();
		int N = int.Parse(s);
		int [] P = new int[N];
		for(var i=0;i<N;i++){
			string t = Console.ReadLine();
			int m = int.Parse(t);
			P[m-1] = 1;
			if(m >= 2){
				if(P[m-2] >= P[m-1]){
					P[m-1] += P[m-2];
				} 
			}
		}
		var countmax = 0;
		for(var i=0;i<N;i++){
			countmax = Math.Max(countmax, P[i]);
		}
		Console.WriteLine(N-countmax);
	}
}

Measured memory_bytes: 17336
#include "bits/stdc++.h"
using namespace std;
#define rep(i, a, n) for(int i = a; i <= n; i++)
const int maxK = 1e5 + 10;
int n, k, a[110];
bool dp[maxK]; 
int main()
{
	cin >> n >> k;
	rep(i, 1, n) cin>>a[i];
	rep(i, 1, k)
	{
		bool flag = false;
		rep(j, 1, n) if(i >= a[j]) if(!dp[i - a[j]])
		{
			flag = true;
			break;
		}
		dp[i] = flag;
	}
	cout << (dp[k] ? "First" : "Second") << endl;
	return 0;
}

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

//#define int long long
#define reps(i,s,n) for(ll (i)=(s);(i)<(ll)(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) reps(i,0,n+1)
#define repst(i,s,n) reps(i,s,n+1)
#define reprt(i,n,t) for(ll (i)=(n);(i)>=t;--(i))
#define repr(i,n) reprt(i,n,0)
#define each(itr,v) for(auto (itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp(x,y) make_pair((x),(y))
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define dbg(x) cout<<#x" = "<<(x)<<ln
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<n;++i){cout<<x[i]<<(i==n-1?'\n':' ');}}

typedef long double ld;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<ld> vld;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

// "最大値をn減らしてそれ以外を1増やす" というのは "n以上の要素をn減らしそれ以外を1増やす" に置き換えても問題ない
// 最終状態がa[i]==49になることとして、そのk回前を復元したい
// まずk/n回全要素について逆操作をすると全要素はk/nだけ増える
// その後残りのk%n回だけ逆操作を行う

ll k, n = 50, a[50];

signed main() {
	cin >> k;
	rep(i,n) a[i] = 49 + k/n;
	k %= n;
	rep(i,k) {
		a[i] += n;
		rep(j,n) if (i!=j) a[j]--;
	}
	cout << n << ln;
	rep(i,n) cout << a[i] << (i==n-1 ? '\n' : ' ');
}

Measured memory_bytes: 384
import sys
stdin = sys.stdin
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()
sys.setrecursionlimit(10**6)
from fractions import gcd

mod = 10**9+7

n = ni()
a = na()
b,c = 1,0

def lcm(m,n):
    return (m*n)//gcd(m,n)

for i in a:
    b=lcm(b,i)

for i in a:
    c+=b//i

print(c%mod)

Measured memory_bytes: 6100
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,-1,0};
int dy[4]={1,0,0,-1};
long double eps = 1e-6;
long double pi = acos(-1);

ll mod = 998244353;
template<typename T> void add(T &a,T b){a=(a+b)%mod;}
template<typename T> void sub(T &a,T b){a=(a+mod-b)%mod;}



signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    int a,b,c,d;
    cin>>a>>b>>c>>d;
    ll dp[c+1][d+1]={};
    dp[a][b]=1;
    for(int i=a;i<=c;i++){
        for(int j=b;j<=d;j++){
            if(i+1<=c) add(dp[i+1][j],dp[i][j]*j);
            if(j+1<=d) add(dp[i][j+1],dp[i][j]*i);
            if(i+1<=c && j+1<=d)sub(dp[i+1][j+1],dp[i][j]*i*j%mod);
        }
    }
    cout << dp[c][d] << endl;
}

Measured memory_bytes: 74000
import java.util.*;
public class Main {
    public static void main(String args[]) {
       Scanner sc = new Scanner(System.in);
       String s = sc.nextLine();
       String t = sc.nextLine();
       int  n = t.length();
       int m = s.length();
       int ans = Integer.MAX_VALUE;
    for (int i = 0; i < m - n + 1; i++) 
    { 
        int minRemovedChar = 0; 
        for (int j = 0; j < n; j++)  
        { 
            if (t.charAt(j) != s.charAt(i + j))  
            { 
                minRemovedChar++; 
            } 
        } 
        ans = Math.min(minRemovedChar, ans); 
    } 
  System.out.println(ans);
} 
  
}

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

int main() {
    int a, b;
    cin >> a >> b;
    if (a == b) {
        cout << "a == b" << endl;
    } else if (a < b) {
        cout << "a < b" << endl;
    } else {
        cout << "a > b" << endl;
    }
    return 0;
}


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

/* typedef */
/* long系 */
typedef long long ll;   // long long
typedef long double ld; // long double
/* vector系 */
typedef vector<int> vi;                    // intのvector
typedef vector<double> vd;                 // doubleのvector
typedef vector<ll> vll;                    // llのvector
typedef vector<ld> vld;                    // ldのvector
typedef vector<vector<int>> vvi;           // intの2次元vector
typedef vector<vector<double>> vvd;        // doubleの2次元vector
typedef vector<vector<ll>> vvll;           // llの2次元vector
typedef vector<vector<ld>> vvld;           // ldの2次元vector
typedef vector<pair<int, int>> vi_i;       // i_iのvector
typedef vector<pair<double, double>> vd_d; // d_dのvector
typedef vector<pair<ll, ll>> vl_l;         // l_lのvector
typedef vector<pair<ld, ld>> vld_ld;       // ld_ldのvector
typedef vector<string> vs;                 // stringのvector
/* pair系 */
typedef pair<int, int> i_i;       // int同士のpair
typedef pair<double, double> d_d; // double同士のpair
typedef pair<ll, ll> l_l;         // ll同士のpair
typedef pair<ld, ld> ld_ld;       // ld同士のpair

/* define */
#define all(v) v.begin(), v.end() // コンテナ全体
#define PI (acos(-1))             // 円周率pi

/* stringstream */
stringstream ss;
stringstream init_ss; // save default formatting

/* upper, lower */
struct ToUpper
{
    char operator()(char c)
    {
        return toupper(c);
    }
};
struct ToLower
{
    char operator()(char c)
    {
        return tolower(c);
    }
};

/* main */
void Main(void)
{
    ll a, b, c, x, y;
    cin >> a >> b >> c >> x >> y;
    ll ans;
    if (a + b < 2 * c)
    {
        ans = a * x + b * y;
    }
    else
    {
        ll cn = min(x, y);
        ll ans1 = 2 * c * cn + a * abs(x - cn) + b * abs(y - cn);
        ll ch = max(x, y);
        ll ans2 = 2 * c * ch;
        ans = min(ans1, ans2);
    }
    cout << ans << endl;
}

int main(int argc, char const *argv[])
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();

    return 0;
}


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



 class Program
{


	public static void Main()
	{
		
		int n;
		n = int.Parse(Console.ReadLine());
		int[] a = new int[n];
		int[] input = Console.ReadLine().Split(' ').Select(int.Parse).OrderBy(x=>x).ToArray();
		Console.Write(input.Where((item,index) => index % 2 == 0).Sum());
	}
}	
	
	
	

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

#define ll long long

int main(){

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

    int n;
    cin >> n;
    int arr[n];

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

    int sum = INT_MAX;
    for(int i=0; i<100; i++){
        int x=0;
        for(int j=0; j<n; j++){
            x+=(arr[j]-i-1)*(arr[j]-i-1);    
        }
        sum=min(sum,x);
    }

    cout << sum << "\n";

    return 0;
}

Measured memory_bytes: 256
def checkWays(n,x)
  count = 0
  catch(:stop) do
    n.downto(1) do |n1|
      (n1-1).downto(1) do |n2|
        n3 = x - n1 - n2
        throw :stop if (n3 >= n1)
        break if (n3 >= n2)
        count += 1 if (n3 > 0)
      end
    end
  end
  puts count
end

while ((n,x = gets.split(" ").map(&:to_i)).inject(:+) != 0) do
  max = 3*(n-1)
  if (x < 6) || (x > max)
    puts 0
    next
  end
  checkWays(n,x)
end

Measured memory_bytes: 8628
program main
	implicit none
	integer :: N, S, i
	integer, allocatable :: L(:)
	
	read(*, *) N
	allocate(L(1:2*N))
	read(*, *) L
	
	call heapsort(2*N, L)
	
	S = 0
	do i = 1, 2*N, 2
		S = S + L(i)
	end do
	write(*, *) S
	
	contains
	subroutine heapsort(n,array)
		implicit none
		integer,intent(in) :: n
		integer,intent(inout) :: array(1:n)
  
		integer ::i,k,j,l
		double precision :: t
  
		if(n.le.0)then
			write(6,*)"Error, at heapsort"; stop
		endif
		if(n.eq.1)return
 
		l=n/2+1
		k=n
		do while(k.ne.1)
			if(l.gt.1)then
				l=l-1
				t=array(L)
			else
				t=array(k)
				array(k)=array(1)
				k=k-1
				if(k.eq.1) then
					array(1)=t
					exit
				endif
			endif
			i=l
			j=l+l
			do while(j.le.k)
				if(j.lt.k)then
					if(array(j).lt.array(j+1))j=j+1
				endif
				if (t.lt.array(j))then
					array(i)=array(j)
					i=j
					j=j+j
				else
					j=k+1
				endif
			enddo
			array(i)=t
		enddo
 
		return
	end subroutine heapsort
end program main

Measured memory_bytes: 256
/*
    Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;

Then took the other, as just as fair,
And having perhaps the better claim,
Because it was grassy and wanted wear;
Though as for that the passing there
Had worn them really about the same,

And both that morning equally lay
In leaves no step had trodden black.
Oh, I kept the first for another day!
Yet knowing how way leads on to way,
I doubted if I should ever come back.

I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I—
I took the one less traveled by,
And that has made all the difference.
*/
#include<bits/stdc++.h>
using namespace std;
#define ll  long long
#define ld long double
map<ll , ll>M;

int main()
{
    ll n;
    cin >> n;
    ll cmp =1;
    for(ll i = 0; i <  n; i++)
    {
        ll x;
        cin >> x;
        if(cmp == x)
        cmp++;
    }

    ll ans =  (n - (cmp-1));
    if(ans == n)
    cout << -1;
    else
    cout << ans << "\n";
    
    
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  long long n,t,tmp=0,ans=0,MIN=10000000000;
  cin >> n >> t;
  long long a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
  }
  for(int i=0;i<n;i++){
    MIN=min(MIN,a[i]);  
    if(tmp<a[i]-MIN){
      ans=1;
      tmp=a[i]-MIN;
    }else if(tmp==a[i]-MIN){
      ans++;
    }    
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll H,W; cin >> H >> W;
  ll h,w; cin >> h >> w;
  ll ans = H*W - (H*w+W*h-w*h);
  cout << ans << endl;
  return 0;
}


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

int main()
{
    int A, B;
    cin >> A >> B;
    string S;
    cin >> S;
    bool chk1 = false, chk2 = true;

    if (S[A] == '-') {
        chk1 = true;
    }
    for (int i = 0; i < A + B + 1; i++) {
        if (S[i] == '-' && i != A) chk2 = false;
    }

    if (chk1 && chk2) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3640
n, k = map(int, input().split())
s = list(input())
c = s[0]
con = 1
odd = []
even = []
now = 1
ans = 0

for i in range(1, n):
    if s[i] == c:
        con += 1
    else:
        c = s[i]
        if not con == 1:
            ans += con - 1
        if now == 1:
            odd += [con]
            now = 2
        elif now == 2:
            even += [con]
            now = 1
        con = 1
else:
    if not con == 1:
        ans += con - 1
    if now == 1:
        odd += [con]
    elif now == 2:
        even += [con]

odd_l = len(odd)
even_l = len(even)
length = min(odd_l, even_l)
if k >= length:
    print(n-1)
else:
    print(ans + k * 2)


Measured memory_bytes: 4740
MOD = 10 ** 9 + 7

N, K = map(int, input().split())

A = [list(map(int, input().split())) for _ in range(N)]

def mod_pow(matrix, n, mod): #行列累乗を求める
    # print (matrix)
    N = len(matrix[0])
    if n == 0:
        lst = [[1 if i == j else 0 for i in range(N)] for j in range(N)]
        return lst
    lst = [[0] * N for _ in range(N)]
    for i in range(N):
        for j in range(N):
            for k in range(N):
                # print (i, j, k)
                lst[i][j] += matrix[i][k] * matrix[k][j]
            lst[i][j] %= mod
    res = mod_pow(lst, n // 2, mod)

    lst = [[0] * N for _ in range(N)]
    if n % 2 == 1:
        for i in range(N):
            for j in range(N):
                for k in range(N):
                    lst[i][j] += res[i][k] * matrix[k][j]
                lst[i][j] %= mod
        return lst
    return res 

matrix = mod_pow(A, K, MOD)
# print (matrix)

ans = 0
for i in range(N):
    for j in range(N):
        ans += matrix[i][j]
        ans %= MOD

ans %= MOD
print (ans)

Measured memory_bytes: 71132
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007;
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string S;
	cin >> S;
	int N = S.size();
	char b = '0';
	int res = N;
	for (int i = 0; i < N; i++) {
		if (b == S[i]) {

		}
		else {
			res = min(res, max(i, N - i));
		}
		b = S[i];
	}
	cout << res << endl;
}

Measured memory_bytes: 512
import java.util.Scanner;

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

    char[] s = scanner.next().toCharArray();
    for (int i = 0; i < s.length; i++) {
      System.out.print(s[i]);
      if (i == 3) System.out.print(' ');
    }
    System.out.println();
  }
}


Measured memory_bytes: 21460
# -*- coding: utf-8 -*-
x,k,d=map(int,input().split())
m=abs(x)
n=m//d
j=k-n
if j>0:
  if x<0:
    if j%2==0:
      x+=d*n
    else:
      x+=d*(n+1)
  else:
    if j%2==0:
      x-=d*n
    else:
      x-=d*(n+1)
else:
  if x<0:
    x+=d*k
  else:
    x-=d*k
print(abs(x))

Measured memory_bytes: 9116
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
#include<string>
#include<set>
#include<climits>
#define ll long long
using namespace std;
int main() {
	ll a, b;
	cin >> a >> b;
	cout << max({ a + b,a - b,a*b }) << endl;
}


Measured memory_bytes: 256
import sys


def solve():
    readline = sys.stdin.buffer.readline
    mod = 10 ** 9 + 7
    n = int(readline())
    a = list(map(int, readline().split()))
    ac = [0] * n
    for i, v in enumerate(a):
        cnt = 0
        t = v
        while True:
            if t % 2 == 0 and cnt < 2:
                cnt += 1
                t //= 2
            else:
                ac[i] = cnt
                break
    if ac.count(0) == 0:
        print("Yes")
    else:
        if ac.count(1) == 0:
            if ac.count(0) - ac.count(2) <= 1:
                print("Yes")
            else:
                print("No")
        else:
            if ac.count(0) - ac.count(2) <= 0:
                print("Yes")
            else:
                print("No")


if __name__ == '__main__':
    solve()


Measured memory_bytes: 56944
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<cstdio>
#include<cmath>
#include<numeric>
#include<queue>
#include<stack>
#define repp(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define repm(i,a,b) for(int i=(int)a;i>(int)b;--i)
using ll=long long;
static const ll mod=1e9+7;
static const ll INF=1LL<<50;
using namespace std;

int main() {
	string s;
  cin>>s;
  int ans=15-s.size();
  repp(i,0,s.size())if(s[i]=='o')++ans;
  if(ans>=8)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
#define rep(i,n) for(int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z temp.cpp
//./a.exe


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

int n;
cin >> n;
cout << n*n*n << endl;


//////////////////////////////////////////////////////
return 0;}

Measured memory_bytes: 256
#pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std; typedef long double ld; typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define MP make_pair
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORR(x,arr) for(auto& x:arr)
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define VPII vector<PII>
#define VPLL vector<PLL>
#define FI first 
#define SE second
#define ALL(x) (x).begin(), (x).end()
constexpr int INF=1<<30; constexpr ll LINF=1LL<<60; constexpr ll mod=1e9+7; constexpr int NIL = -1;
template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
#pragma endregion
//-------------------

struct mint {
	ll x;
	mint(ll x=0):x(x%mod){}

	bool operator==(const mint a)const{return x==a.x;}
	bool operator!=(const mint a)const{return x!=a.x;}
	bool operator>=(const mint a){return (x >= a.x)? 1: 0;}
	bool operator<(const mint a){return !(*this>=a);}
	bool operator>(const mint a){return (x > a.x)? 1:0;}
	bool operator<=(const mint a){return !(*this>a);}
	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 t) const {
		if (!t) return 1;
		mint a = pow(t>>1);
		a *= a;  //2 square
		if (t&1) a *= *this; 
		return a;
	}
	// for prime mod
	mint inv() const {
		return pow(mod-2);
	}
	mint& operator/=(const mint a) {
		return (*this) *= a.inv();
	}
	mint operator/(const mint a) const {
		mint res(*this);
		return res/=a;
	}
};

struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
} comb(500005);

mint f(int n, int k) {
  if (n < 0) return 0;
  // nPk = nCk * k!
  mint res = comb(n,k);
  res *= comb.fact[k];
  return res;
}


int n,m;

int main(){
    cin.tie(0); ios::sync_with_stdio(false); //cout << fixed << setprecision(15);
    cin >> n >> m;
    mint ans(0);
    FOR(i,0,n) {
        if(i%2==0) ans += comb(m,i) * f(n,i) * f(m-i,n-i) * f(m-i,n-i);
        else ans -= comb(m,i) * f(n,i) * f(m-i,n-i) * f(m-i,n-i); 
    }
    
    cout << ans.x << endl;
    return 0;
}


Measured memory_bytes: 10960
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,k;
	cin>>n>>k;
	int a[n];
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
//	int dp[n]={INT_MAX};
vector<int> dp(n,1e9);
	dp[0]=0;
for(int i=0;i<n;i++){
	for(int j=i+1;j<=i+k;j++){
		if(j<n){
		
		dp[j]=min(dp[j],dp[i]+abs(a[j]-a[i]));
}
	}
}
	cout<<dp[n-1]<<" ";
	
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,a=1;
  string s;
  cin>>n;
  cin>>s;
  for(int i=0;i<n-1;i++){
      if(s[i]!=s[i+1]){a++;}
  }
  cout<<a;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll ar[20][20];

int main()
{
   ll n,m,a,b,i,j,k,total=0;

    cin>>n;

    for(i=1; i<=n; i++)
    {
        b=i;
        a=b%10;
        while(b>=10)
        {
            b/=10;
        }
        ar[a][b]++;
        //ar[b][a]++;

    }

    for(i=0; i<=9; i++)
    {
        for(j=0; j<=9; j++)
        {
            total+=ar[i][j]*ar[j][i];
        }
    }

    cout<<total<<endl;
}


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

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

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

	vector<int> A(n, 0);
	vector<int> B(n, 0);
	vector<int> C(n-1 , 0);

	rep(i, n)  cin >> A[i];
	rep(i, n)  cin >> B[i];
	rep(i, n - 1)  cin >> C[i];
	
	int sum = B[A[0] - 1];
	int t = A[0];
	for (int i = 1; i < n; i++) {
		int v = A[i] - 1;
		if (A[i] == t + 1) sum += B[v] + C[t - 1];
		else  sum += B[v]; 
		t = A[i];
	}
	cout << sum << endl;

}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	static char[] in;
	public static void main(String[] args) {
		while(read()){
			solve();
		}
	}
	
	static boolean read(){
		if(!sc.hasNext())return false;
		in = sc.nextLine().toCharArray();
		return true;
	}
	
	static void solve(){
		for(int i=0; i<in.length-4;i++){
			if(in[i]=='a'&&in[i+1]=='p'&&in[i+2]=='p'&&in[i+3]=='l'&&in[i+4]=='e'){
				in[i] = 'p';
				in[i+1] = 'e';
				in[i+2] = 'a';
				in[i+3] = 'c';
				in[i+4] = 'h';
			}
			else if(in[i]=='p'&&in[i+1]=='e'&&in[i+2]=='a'&&in[i+3]=='c'&&in[i+4]=='h'){
				in[i] = 'a';
				in[i+1] = 'p';
				in[i+2] = 'p';
				in[i+3] = 'l';
				in[i+4] = 'e';
			}
		}
		System.out.println(in);
	}

}

Measured memory_bytes: 0
#include <stdio.h>

int main() {

  int i, j, n, u, k, v;
  int M[100][100];

  scanf("%d", &n);

  for(i=0; i<n; i++){
    for(j=0; j<n; j++){
      M[i][j] = 0;
    }
  }

  for(i=0; i<n; i++){
    scanf("%d%d", &u, &k);
    u--;
    for(j=0; j<k; j++){
      scanf("%d", &v);
      v--;
      M[u][v] = 1;
    }
  }
  
  for(i=0; i<n; i++){
    for(j=0; j<n; j++){
      printf("%d", M[i][j]);
      if(j!=n-1) printf(" ");
    }
    printf("\n");
  }
  
  return 0;
}

Measured memory_bytes: 636
import math as m


EPS = 0.0000000001


def f(a, b, theta):
    if theta > m.pi/2 - EPS:
        return 0
    if a * m.tan(theta) <= b:
        ret = a * a * b - a * a * a * m.tan(theta) / 2
    else:
        ret = b * b / m.tan(theta) * a / 2
    return ret


def solve():
    a, b, x = map(int, input().split())
    ok = m.pi / 2
    ng = 0
    
    for _ in range(100):
        mid = (ok + ng) / 2
        if f(a, b, mid) < x:
            ok = mid
        else:
            ng = mid
    print(ok * 180 / m.pi)


if __name__ == "__main__":
    solve()

Measured memory_bytes: 62688
a,b = map(int,input().split(" "))
if a > 0 and b > 0:
  print("Positive")
elif a <= 0 and b >= 0:
  print("Zero")
else:
  if (abs(a-b)+1) % 2 == 0:
    print("Positive")
  else:
    print("Negative")

Measured memory_bytes: 3060
fn calc_all(s: &Vec<char>) -> Vec<usize> {
    let mut ret: Vec<usize> = Vec::with_capacity(s.len());
    let mut cnt = 0;
    let mut prev: char = ' ';
    for c in s {
        match (prev, *c) {
            ('A', 'C') => { cnt += 1; },
            _          => {},
        }
        ret.push(cnt);
        prev = *c;
    }
    ret
}

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let n: usize = iter.next().unwrap().parse().unwrap();
    let q: usize = iter.next().unwrap().parse().unwrap();

    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    let s: Vec<char> = buf.trim().chars().collect();

    let cnts = calc_all(&s);

    for i in 0..q {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let mut iter = buf.split_whitespace();
        let l: usize = iter.next().unwrap().parse().unwrap();
        let r: usize = iter.next().unwrap().parse().unwrap();


        println!("{}", cnts[r-1]-cnts[l-1]);
    }
}


Measured memory_bytes: 4860
#      
import collections, atexit, math, sys, bisect 

sys.setrecursionlimit(1000000)
def getIntList():
    return list(map(int, input().split()))    

try :
    #raise ModuleNotFoundError
    import numpy
    def dprint(*args, **kwargs):
        #print(*args, **kwargs, file=sys.stderr)
        # in python 3.4 **kwargs is invalid???
        print(*args,  file=sys.stderr)
    dprint('debug mode')
except Exception:
    def dprint(*args, **kwargs):
        pass



inId = 0
outId = 0
if inId>0:
    dprint('use input', inId)
    sys.stdin = open('input'+ str(inId) + '.txt', 'r') #标准输出重定向至文件
if outId>0:
    dprint('use output', outId)
    sys.stdout = open('stdout'+ str(outId) + '.txt', 'w') #标准输出重定向至文件
    atexit.register(lambda :sys.stdout.close())     #idle 中不会执行 atexit
    
H, W = getIntList()
#print(N)
zs = []
dprint(H,W)
for i in range(H):
    s = input()
    zs.append(s)
    dprint(s)
zu = [  [(i,j) for j in range(W) ]  for i in range(H) ]
dprint(11111)
def getr(p):
    #dprint('?', p)
    if p == zu[ p[0] ] [p[1] ]:
        return p
    np = getr(zu[ p[0] ] [p[1] ])
    zu[ p[0] ] [ p[1] ] = np
    return np
dprint(11111)
def uuu( p0, p1) :
    p0 = getr(p0)
    p1 = getr(p1)
    #dprint(p0, p1)
    zu[ p0[0] ] [p0[1] ] =  p1
dprint(zu)
dprint(zs)
for i in range(H):
    for j in range(W): 
        if i>0:
            if zs[i-1][j] != zs[i][j]:
                uuu( (i-1,j), (i,j) )
        if j>0:
            if zs[i][j-1] != zs[i][j]:
                uuu( (i,j-1), (i,j) )
         
dprint(11111) 
zr = dict()
dprint(11111)
for i in range(H):
    for j in range(W):
        p = (i,j)
        p = getr(p)
        if p not in zr:
            zr[p] = [0,0]
        if zs[i][j] == '.':
            zr[p][0] +=1
        else:
            zr[p][1] +=1
dprint(zr)            
r = 0
for x in zr:
    r += zr[x][0] * zr[x][1]
    
print(r)


Measured memory_bytes: 133612
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define sb __builtin_popcount
#define MOD (ll)1000000007
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
using namespace std;

int main()
{
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
     string s;
     cin >> s;
     for (auto i : s)
     {
          if (i == '7')
          {
               cout << "Yes" << endl;
               return 0;
          }
     }
     cout << "No" << endl;
     return 0;
}


Measured memory_bytes: 3648
#include<iostream>
#include<vector>
#include<math.h>
#include<algorithm>

using namespace std;
typedef long long ll;

int main(){
    ll N,n,div=2,cnt=0;
    cin>>N;
    n=N;

    if(N==1){
        cout<<0<<endl;
        return 0;
    }

    vector<ll> div_memo;
    vector<ll> div_cnt;

    for(int i=2; i<sqrt(N)+1; i++){
        cnt=0;
        //cout<<i<<endl;
        while(n%i==0){
            cnt++;
            n/=i;
        }
        if(cnt!=0){
            div_memo.push_back(i);
            div_cnt.push_back(cnt);
        }
    }
    if(n!=1){
            div_memo.push_back(n);
            div_cnt.push_back(1);        
    }
/*
    for(int i=0; i<div_memo.size(); i++){
        cout<<div_memo[i]<<"^"<<div_cnt[i]<<" ";
    }
    cout<<endl;
*/
    cnt=0;
    for(int i=0; i<div_memo.size(); i++){
        ll tmp=div_cnt[i];
        int j=1;
        while(tmp>0){
            //cout<<tmp<<endl;
            tmp-=j;
            if(tmp<0){
                break;
            }
            j++;
            cnt++;
        }
    }
    
    if(cnt==0){
        cout<<1<<endl;
    }else{
        cout<<cnt<<endl;
    }

    return 0;
}

Measured memory_bytes: 3720
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0,i##_len=int(n);i<i##_len;++i)
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define All(x) (x).begin(),(x).end()
#define rAll(x) (x).rbegin(),(x).rend()
using namespace std;
using ll = long long;

int main(){
    string a,b,c;
    cin>>a>>b>>c;
    cout<<'A'<<b.front()<<'C'<<endl;
}


Measured memory_bytes: 256
import java.io.*;

class Main{
    public static void main(String[]args)throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        StringBuilder sb = new StringBuilder();

        String[] str1 = br.readLine().split(" ");
        int r = Integer.parseInt(str1[0]);
        int c = Integer.parseInt(str1[1]);
        int[][] data = new int[r][c];
        int[] sumR = new int[r];
        int[] sumC = new int[c];
        int sumX = 0;

        // r x c ????????????????¨??????\???????????????????´???????
        for(int i=0; i<r; i++){
            String[] str2 = br.readLine().split(" ");
            for(int k=0; k<c; k++){
                data[i][k] = Integer.parseInt(str2[k]);
            }
        }

        // ????¨????sumR????¨??????????
        for(int i=0; i<r; i++){
            for(int k=0; k<c; k++){
                sumR[i] += data[i][k];
            }
            sumX += sumR[i];
        }
        // ????¨????sumC????¨??????????
        for(int i=0; i<c; i++){
            for(int k=0; k<r; k++){
                sumC[i] += data[k][i];
            }
        }

        //??????
        for(int i=0; i<r; i++){
            for(int k=0; k<c; k++){
                sb.append(data[i][k]).append(" ");
            }
            sb.append(sumR[i]).append("\n");
        }
        for(int k=0; k<c; k++){
            sb.append(sumC[k]).append(" ");
        }
        sb.append(sumX).append("\n");

        System.out.print(sb);
    }
}

Measured memory_bytes: 27112
#include<iostream>
using namespace std;
int main(){
	int w,h;
	char a[101];
	cin>>w>>h;
	for(int i=0;i<w;i++){
		cin>>a;
		for(int j=0;j<h;j++){
			cout<<a[j];
		}
		cout<<endl;
		for(int j=0;j<h;j++){
			cout<<a[j];
		}
		cout<<endl;
	}
return 0;
}


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

int n;//縦線の本数
int m;//選んだ縦線
int g;//ゴール
int d;//段数
int amd[32][12];

int chk(){
	int x=m;
	for(int i=1;i<=d;i++){
		if(amd[i][x]){
			x++;
		}
		else if(amd[i][x-1]){
			x--;
		}
	}
	if(x==g)return 1;
	return 0;
}

int main(){
	
	while(cin>>n,n){
		cin>>m>>g>>d;
		memset(amd,0,sizeof(amd));
		for(int i=1;i<=d;i++){
			string s;
			cin>>s;
			for(int j=1;j<n;j++){
				amd[i][j]=s[j-1]-'0';
			}
		}
		if(chk()){
			cout<<0<<endl;
			continue;
		}
		int flg=1;
		for(int i=1;i<=d && flg;i++){
			for(int j=1;j<n && flg;j++){
				if(amd[i][j-1]==0 && amd[i][j]==0 && amd[i][j+1]==0){
					amd[i][j]=1;
					if(chk()){
						cout<<i<<" "<<j<<endl;
						flg=0;
					}
					amd[i][j]=0;
				}
			}
		}
		if(flg)cout<<1<<endl;
	}
	
	
	return 0;
}


Measured memory_bytes: 1208
n = int(input())
a = [int(x) for x in input().split()]
c = 0
for i in range(n):
  for j in range(i+1,n):
    if a[i] == a[j]:
      continue
    for k in range(j+1,n):
      if a[i] == a[k] or a[j] == a[k]:
        continue
      if a[i] + a[j] > a[k] and a[j] + a[k] > a[i] and a[k] + a[i] > a[j]:
        c += 1
        
print(c)

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

#define ll long long
#define llong long long
#define REP(i,n) for(auto i=0;i<n;++i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define FOR(i,a,b) for(auto i=a;i<b;++i)
#define ALL(v) v.begin(),v.end()
#define pb push_back

using namespace std;

bool isKaibun(string s){
  int len = s.length();
  REP(i,len / 2){
    if(s[i] != s[len - i - 1]){
      return false;
    }
  }
  return true;
}

int main(){

  int n;
  cin >> n;
 
  if(isKaibun(to_string(n))){
    cout << n << endl;
    return 0;
  }

  int i = 1;
  bool f = false;
  while(true){
    string plus = to_string(n + i), minus = to_string(n - i);
    if(isKaibun(minus)){
      cout << minus << endl;
      f = true;
    }else if(isKaibun(plus)){
      cout << plus << endl;
      f = true;
    }
    if(f) break;
    i++;
  }

  return 0;
}



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

int main() {
    ll x;
    cin >> x;
    for (ll a = -120; a < 120; a++) {
        for (ll b = -120; b < 120; b++) {
            if (pow(a, 5) - pow(b, 5) == x) {
                cout << a << " " << b << endl;
                return 0;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3992
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 

typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;

ll near( const vector<ll>& t, ll val, ll ans[2], int nearid[2] )
{
    ans[0]=ans[1]=LINF;
    nearid[0]=nearid[1]=-1;
    int k=lower_bound(t.begin(), t.end(), val)-t.begin();
    ll ans0=LINF,ans1=LINF;
    if(k<(int)t.size()) {
        nearid[0]=k;
        ans[0]=abs(t[k]-val);
    }
    if(k-1>=0) {
        nearid[1]=k-1;
        ans[1]=abs(t[k-1]-val);
    }
    return MIN(ans[0], ans[1]);
}

int main(int argc, char* argv[])
{
    int a,b,q;
    scanf("%d%d%d", &a,&b,&q);
    vector<ll> s(a),t(b),x(q);
    int i;
    for(i=0; i<a; i++) {
        scanf("%lld", &s[i]);
    }
    for(i=0; i<b; i++) {
        scanf("%lld", &t[i]);
    }
    for(i=0; i<q; i++) {
        scanf("%lld", &x[i]);
    }

    vector<ll> st(a);
    for(i=0; i<a; i++) {
        ll  ans[2];
        int tmp[2];
        st[i] = near(t, s[i], ans, tmp);
    }

    vector<ll> ts(b);
    for(i=0; i<b; i++) {
        ll  ans[2];
        int tmp[2];
        ts[i] = near(s, t[i], ans, tmp);
    }

    int k;
    for(i=0; i<q; i++) {
        ll ans=LINF;
        ll  ans0[2];
        int tmp0[2];
        near(s, x[i], ans0, tmp0);
        for(k=0; k<2; k++) {
            if(tmp0[k]>=0) {
                ans = MIN(ans, ans0[k]+st[tmp0[k]]);
            }
        }

        near(t, x[i], ans0, tmp0);
        for(k=0; k<2; k++) {
            if(tmp0[k]>=0) {
                ans = MIN(ans, ans0[k]+ts[tmp0[k]]);
            }
        }

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

    return 0;
}


Measured memory_bytes: 5248