akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;
// ------------------------------

int main() {
    int D, T, S;
    cin >> D >> T >> S;
    if (D - T * S <= 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3628
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
#define REP(i,n) for (int i=0;i<(n);++i)
#define rep(i,a,b) for(int i=a;i<(b);++i)
template<class T> inline bool chmin(T &a, T b){ if(a > b) { a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b){ if(a < b) { a = b; return true;} return false;}
using ll = long long;
constexpr long long INF = 1LL << 62;
constexpr int MOD = 1e9 + 7;
constexpr double EPS = 1e-10;

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    boost::multiprecision::cpp_int a, b;
    cin >> a >> b;
    cout << a % b << endl;
    return 0;
}


Measured memory_bytes: 3252
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 300010


int main(){
  int n, d[SIZE];

  scanf("%d", &n);

  for(int i=0;i<n;i++) scanf("%d", d+i);


  for(int p=0;p<2;p++){
    int r  = 0;

    for(int i=0;i<n;i++){
      if(i > r){
        puts("no");
        return 0;
      }
      r = max(r, d[i]/10 + i);
    }

    reverse(d, d+n);
  }

  puts("yes");
  
  return 0;
}



Measured memory_bytes: 4260
import sys
import os
import re
import datetime
import bisect

def Test(value):
    a = [1,3,5]
    #x = 4

    insert_index = bisect.bisect_left(a, value)
    
    print("insert_index = ", insert_index)
    
if False:   
    while(True): 
        Test(int(input('? ')));
    sys.exit()
 
N = int(input())

partsNumA = sorted(map(int, input().split()))
partsNumB = sorted(map(int, input().split()))
partsNumC = sorted(map(int, input().split()))

# Bに対してAの個数のBによるループ
partsNumSumBa = []
sumA = 0
#for i in range(N):
for curPartsB in partsNumB:
    indexA = bisect.bisect_left(partsNumA, curPartsB)
    numA = indexA
    sumA += numA
    partsNumSumBa.append(sumA)

if False:
    print("Sorted A" , partsNumA)
    print("Sorted B" , partsNumB)
    print("Sorted C" , partsNumC)

    print("B loop" , partsNumSumBa)

# Cに対してBの個数のCによるループ
sumBAll = 0
for curPartsC in partsNumC:
    indexB = bisect.bisect_left(partsNumB, curPartsC)
    if indexB == 0:
        continue
    numB = partsNumSumBa[indexB - 1]
    sumBAll += numB
        
print(sumBAll)

Measured memory_bytes: 22944
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define pb push_back
#define mp make_pair
#define F .first
#define S .second 
using ll=long long;
using ld=long double;
const ll INF = 1LL<<60;
const ll mod=1e9+7;
using namespace std;
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

ll a[330000];
ll dp[3300][3300];
int main(){
    ll n,s;
    cin>>n>>s;
    rep(i,0,n)cin>>a[i];
    dp[0][0]=1;
    rep(i,0,n){
        rep(j,0,s+1){
            dp[i+1][j]+=dp[i][j]*2;
            dp[i+1][j]%=998244353;
            if(j+a[i]<=s){
                dp[i+1][j+a[i]]+=dp[i][j];
                dp[i+1][j+a[i]]%=998244353;
            }
        }
    }
    cout<<dp[n][s];
}


Measured memory_bytes: 80960
#include<bits/stdc++.h>
using namespace std;
const int mod = 200003;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define sortall(x) sort(all(x))
#define fr(s,n) for (int i=(int)(s);i<(int)(n);i++)
#define lc cout<<"\n"

int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int n;
    cin>>n;
    int s=n%10;
    if(s==2||s==4||s==5||s==7||s==9){
        cout<<"hon";
    }
    else if(s!=3){
        cout<<"pon";
    }
    else{
        cout<<"bon";
    }
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
using namespace std;
int a[10010];
int main(){
	int n;
	cin>>n;
	
	for(int i=1;i<=sqrt(n);i++){
		for(int j=1;j<=sqrt(n);j++){
			for(int k=1;k<=sqrt(n);k++){
				int temp=i*i+j*j+k*k+i*j+i*k+j*k;
				if(temp<=n){
					a[temp]++;
				}
			}
		}
	}
	for(int i=1;i<=n;i++)cout<<a[i]<<endl;
}

Measured memory_bytes: 3536
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;

int main(){
	int r, g, b;
	cin >> r >> g >> b;
	if ((100 * r + 10 * g + b) % 4 == 0){
		cout << "YES" << endl;
	}
	else{
		cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

def main():

	suits = ('S','H','C','D')
	cards = [[0 for i in xrange(13)] for i in xrange(4)]
	n = input()
	for i in xrange(n):
		suit,rank = raw_input().split()
		suit = suits.index(suit)
		rank = int(rank)
		cards[suit][rank-1] = 1

	for suit,ranks in enumerate(cards):
		for rank,flag in enumerate(ranks):
			if flag == 0:
				print(suits[suit]),
				print(rank+1)

if __name__ == "__main__":

	main()


Measured memory_bytes: 6468
n = int(input())

ans = ''
# 制約条件は高々 26 の 10 乗なので、取り合えずインデックスを13に設定して回す
for i in range(1, 13):
    if n <= 26**i:
        n -= 1
        for j in range(i):
            ans += chr(ord('a') + n%26)
            n //= 26
        break;
    else:
        n -= 26**i

print(ans[::-1])

Measured memory_bytes: 9048
class Dice:
    N = [0, 1, 5, 4]
    S = N[::-1]
    E = [0, 3, 5, 2]
    W = E[::-1]
    R = [1, 2, 4, 3]
    L = R[::-1]

    def __init__(self, numbers):
        self.numbers = numbers

    def __eq__(self, other):
        if isinstance(other, Dice):
            newdice = Dice(other.numbers.copy())
            for n in range(6):
                if 1 <= n <= 3:
                    newdice.toX('N')
                elif n == 4:
                    newdice.toX('N')
                    newdice.toX('E')
                elif n == 5:
                    [newdice.toX('E') for _ in range(2)]
                for _ in range(4):
                    if self.numbers == newdice.numbers:
                        return True
                    newdice.toX('R')

            else:
                return False

        else:
            return False

    def toX(self, x):
        data = getattr(self, x)
        self.numbers.append(0)
        for k in range(5):
            i1 = data[k - 1] if k != 0 else 6
            i2 = data[k] if k != 4 else 6
            self.numbers[i1] = self.numbers[i2]
        del self.numbers[6]

    def setTopandFront(self, top, front):
        while self.numbers[0] != top:
            if self.numbers.index(top) in self.N:
                self.toX('N')
            else:
                self.toX('E')
        while self.numbers[1] != front:
            self.toX('R')


dice1 = Dice([int(i) for i in input().split()])
dice2 = Dice([int(i) for i in input().split()])
if dice1 == dice2:
    print('Yes')
else:
    print('No')



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

int w, h;

void dfs(vector<vector<int>> &g,
         int v,
         vector<bool> &seen,
         vector<long long> &add_x,
         vector<long long> &count,
         long long add)
{
    seen[v] = true;
    add += add_x[v];
    count[v] += add;
    for (auto i : g[v])
    {
        if (seen[i])
        {
            continue;
        }
        dfs(g, i, seen, add_x, count, add);
    }
    add -= add_x[v];
}

int main()
{
    int N, Q;
    cin >> N >> Q;
    vector<vector<int>> g(N + 1);
    vector<bool> seen(N + 1, false);
    for (int i = 0; i < N - 1; i++)
    {
        int a, b;
        cin >> a >> b;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    vector<long long> add_x(N + 1, 0);

    for (int i = 0; i < Q; i++)
    {
        int p, x;
        cin >> p >> x;
        add_x[p] += x;
    }
    vector<long long> count(N + 1, 0);
    long long add = 0;
    dfs(g, 1, seen, add_x, count, add);
    for (int i = 1; i <= N; i++)
    {
        cout << count[i] << " ";
    }
}


Measured memory_bytes: 32128
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;

namespace AOJ
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        class node
        {
            public long[] ko = new long[]{-1,-1};
            public long oya = -1;
        }
        static void Main(string[] args)
        {
            var N = Sarray()[0];
            var nodes = new node[N];
            for (var i = 0; i < N; ++i)
                nodes[i] = new node();
            for (var i = 0; i < N; ++i)
            {
                var ninfo = Slist();
                nodes[ninfo[0]].ko[0] = ninfo[1];
                nodes[ninfo[0]].ko[1] = ninfo[2];
                if (ninfo[1] != -1)
                    nodes[ninfo[1]].oya = ninfo[0];
                if (ninfo[2] != -1)
                    nodes[ninfo[2]].oya = ninfo[0];
            }
            var root = -1;
            var Depth = new long[N];
            for (var i = 0; i < N; ++i)
            {
                if (nodes[i].oya == -1)
                {
                    root = i;
                    Depth[i] = 0;
                    break;
                }
            }
            var q = new Queue<long>();
            var Hight = new long[N];
            q.Enqueue(root);
            while (q.Any())
            {
                var n = q.Dequeue();
                if (n != root)
                { Depth[n] = Depth[nodes[n].oya] + 1; }
                if (nodes[n].ko[0] == -1 && nodes[n].ko[1] == -1)
                {
                    var oya = nodes[n].oya;
                    var h = 0;
                    Hight[n] = 0;
                    while (oya != -1)
                    {
                        ++h;
                        Hight[oya] = Math.Max(h, Hight[oya]);
                        oya = nodes[oya].oya;
                    }
                }
                if (nodes[n].ko[0] != -1)
                    q.Enqueue(nodes[n].ko[0]);
                if (nodes[n].ko[1] != -1)
                    q.Enqueue(nodes[n].ko[1]);
            }
            for (var i = 0; i < N; ++i)
            {
                var l = nodes[i].ko[0];
                var r = nodes[i].ko[1];
                var sts = nodes[i].oya == -1 ? "root" : (l == -1 && r == -1) ? "leaf" : "internal node";
                var deg = 0;
                if (l != -1) ++deg;
                if (r != -1) ++deg;
                var sib = -1L;
                var oya = nodes[i].oya;
                if (oya != -1)
                {
                    if (nodes[oya].ko[0] != i)
                        sib = nodes[oya].ko[0];
                    else
                        sib = nodes[oya].ko[1];
                }
                WriteLine($"node {i}: parent = {oya}, sibling = {sib}, degree = {deg}, depth = {Depth[i]}, height = {Hight[i]}, {sts}");
            }
        }
    }
}


Measured memory_bytes: 18924
n = int(input())
a = list(map(int, input().split()))
a.sort()
b = [0]
for i in range(n):
    b.append(b[-1] + a[i])
count = 1
for i in range(n - 1):
    if b[n - i - 1] * 2 >= a[n - i - 1]:
        count += 1
    else:
        break
print(count)

Measured memory_bytes: 20420
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int C = sc.nextInt();
        if (A+B+C == 17)
            System.out.println("YES");
        else
            System.out.println("NO");
        sc.close();
    }   
}

Measured memory_bytes: 21716
#include<iostream>
#include<vector>
#include<map>
#include<string>
#include<utility>
#include<algorithm>
#include<cstdio>
#include<iomanip>
#include<queue>
#include<stack>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)

using namespace std;

const int MAX = 510000;
const int MOD = 1000000007;

ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++) {
        fac[i] = fac[i-1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

ll COM (int n, int k) {
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

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

    ll N, M;
    cin >> N >> M;
    vector<ll> a(M);
    vector<bool> b(N+1, true);
    Rep (i, M) {
        cin >> a[i];
        b[a[i]] = false;
    }

    vector<ll> dp(N+1, 0);
    dp[0] = 1;
    Rep(i, N+1) {
        if (!b[i]) {
            dp[i] = 0;
            continue;
        }
        if (i >= 1) {
            dp[i] += dp[i - 1];
        }
        if (i >= 2) {
            dp[i] += dp[i - 2];
        }
        dp[i] %= MOD;
        // cout << "dp[" << i << "]=" << dp[i] << endl;
    }

    // for (auto e : dp) cout << e << "\n";

    cout << dp[N] << "\n";
}

Measured memory_bytes: 1792
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

#define ll long long

void swap (int *x, int *y) {
  int temp;

  temp = *x;
  *x = *y;
  *y = temp;

  return;
}


//naosu
long int gcd(long int a,long int b){
  long int c;

  while (b > 0){
    c = a % b;
    a = b;
    b = c;
  }

  return a;
}

int upll(const void*a, const void*b){
  return*(ll*)a<*(ll*)b?-1:*(ll*)a>*(ll*)b?1:0;
}

int downll(const void*a, const void*b){
  return*(ll*)a<*(ll*)b?1:*(ll*)a>*(ll*)b?-1:0;
}

void sortup(ll*a,int n){
  qsort(a,n,sizeof(ll),upll);
}

void sortdown(ll*a,int n){
  qsort(a,n,sizeof(ll),downll);
}

long int modpow(long int a,long int n,long int mod){
  long int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}

long int modinv(long int a,long int mod){
  return modpow(a,mod-2,mod);
}

int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}

int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}

void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }

  return;
}

void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }

  return;
}


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


long int f(long int n,long int c,long int d){
  long int cnt=n/c+n/d-n/lcm(c,d);
  return n-cnt;
}


/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/

int main(void){
  int a,b,c;
  scanf("%d%d%d",&a,&b,&c);
  int all=a+b+c;
  
  if(all>=22){
    printf("bust\n");
  }
  else{
    printf("win\n");
  }

  return 0;
}

Measured memory_bytes: 1592
use std::io::stdin;
use std::str::FromStr;
#[allow(dead_code, unused_mut)]
fn read<T: FromStr>() -> T {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim().parse().ok().expect("1")
}
#[allow(dead_code, unused_mut)]
fn read_vec<T: FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().expect("2"))
        .collect()
}
#[allow(dead_code, unused_mut)]
fn read_two<T: FromStr>() -> (T, T) {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    let mut x = s.split_whitespace().map(|x| x.parse().ok().unwrap());
    (x.next().unwrap(), x.next().unwrap())
}
#[allow(dead_code, unused_mut)]
fn read_three<T: FromStr>() -> (T, T, T) {
    let mut s = String::new();
    stdin().read_line(&mut s).unwrap();
    let mut x = s.split_whitespace().map(|x| x.parse().ok().unwrap());
    (x.next().unwrap(), x.next().unwrap(), x.next().unwrap())
}
#[allow(dead_code)]
fn remove_whitespace(s: &str) -> String {
    s.chars().filter(|c| !c.is_whitespace()).collect()
}

#[allow(unused_imports)]
use std::io::{stdout, Write};
#[allow(unused_imports)]
use std::collections::HashMap;
fn gcd(mut x: u64, mut y: u64) -> u64 {
    let mut z = x;
    let mut gcd_num = x;
    while z != 0 {
        gcd_num = z;
        z = y % x;
        y = x;
        x = z;
    }
    gcd_num
}
fn main() {
    let (n, k) = read_two::<usize>();
    let mut v: Vec<i32> = vec![0;n];
    for i in 0..k {
        let d:usize = read();
        let vv: Vec<usize> = read_vec();
        for j in vv {
            v[j - 1] += 1;
        }
    }
    let v: Vec<i32> = v.into_iter().filter(|x| *x == 0).collect();
    println!("{}", v.len());
}


Measured memory_bytes: 2168
#include<stdio.h>
using namespace std;
int main()
{
	int A,B,Sn=0;
	scanf("%d %d",&A,&B);
	if(A>B) 
	{
		Sn=Sn+A;
		A=A-1;
		if(A>B) 
		{
			Sn=Sn+A;
			A=A-1;		
		} 
		else if(A==B)
		{
			Sn=Sn+A;
			A=A-1;		
		} 
		else if(A<B)
		{
			Sn=Sn+B;
			B=B-1;		
		}				
	} 
	else if(A==B)
	{
		Sn=Sn+B;
		B=B-1;
		Sn=Sn+A;
		A=A-1;							
	} 
	else if(A<B)
	{
		Sn=Sn+B;
		B=B-1;
		if(A==B)
		{
			Sn=Sn+A;
			A=A-1;		
		} 
		else if(A<B)
		{
			Sn=Sn+B;
			B=B-1;		
		}						
	}

	printf("%d",Sn);
}

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

int main(void){
    string s;
    int ans;
    cin >> s;
    if(s == "SSS") ans = 0;
    else if(s == "RSS" || s == "SRS" || s == "SSR" || s == "RSR") ans = 1;
    else if(s == "RRS" || s == "SRR") ans = 2;
    else if(s == "RRR") ans = 3;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3616
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long a[] = new long[n];
		long sum = 1;
		boolean ch = false;
		long max = 1000000000000000000l;

		for(int i = 0; i < n; i++) {
			a[i] = sc.nextLong();
			if(a[i] == 0) {
				System.out.println("0");
				return;
			}
		}

		for(int i = 0; i < n; i++) {
			if(max/sum < a[i]) {
				System.out.println("-1");
				return;
			}
			sum *= a[i];
			if(sum > max) {
				System.out.println("-1");
			}

		}
		System.out.println(sum);

	}

}


Measured memory_bytes: 61108
/**
 * Created by hiramekun at 20:53 on 2020-05-02.
 */
#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using vl = vector<ll>;
using vvl = vector<vl>;
using vb = vector<bool>;
using P = pair<ll, ll>;
template<typename T> using pq = priority_queue<T>;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template<typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = ll(n - 1); i >= 0; i--)
#define each(i, mp) for(auto& i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template<class T>
ostream &operator<<(ostream &out, const vector<T> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << ' ';
    return out;
}

template<class T>
istream &operator>>(istream &in, vector<T> &list) {
    ll n = list.size();
    rep(i, n) in >> list[i];
    return in;
}

template<class T>
ostream &operator<<(ostream &out, const vector<vector<T>> &list) {
    ll n = list.size();
    rep(i, n) out << list[i] << '\n';
    return out;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

void solve() {
    ll k, a, b;
    cin >> k >> a >> b;
    for (ll i = a; i <=b ; ++i) {
        if (i%k== 0) {
            cout << "OK" << '\n';
            return;
        }
    }
    cout << "NG" << '\n';
}

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        solve();
#ifdef MY_DEBUG
    }
#endif
    return 0;
}

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

int n, d[100];
int ta = 0;

int main(){
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> d[i];
	}
	sort(d, d + n);
	for (int i = 0; i < n; i++) {
		if (d[i - 1] < d[i]) {
			ta++;
		}
	}
	cout << ta << endl;
	return 0;
}


Measured memory_bytes: 256
from collections import Counter

def parse_line(line, type=int):
	return [type(x) for x in line.split(' ')]


def euklide(a, b):
	while a and b:
		if a > b:
			a = a % b
		else:
			b = b % a
	return a + b


def main():
	n = parse_line(input())[0]
	numbers = parse_line(input())

	a = numbers[0]
	for i in range(n - 1):
		a = euklide(a, numbers[i + 1])

	print(a)



	

if __name__ == '__main__':
	main()



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

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

using namespace std;

//v.push_back(123);
//sort(v.begin(), v.end(),greater<int>());
//for(int x : v) {cout << x << endl;}

//for(int x: v) cout << x << endl;
//vector<vector<char>> v(H, vector<char>(W));
//vector<int> v(1000);
long long pow_mod(long long x, long long y, long long MOD){
	long long ret = 1;
	while(y){
		if (y & 1) ret = ret * x % MOD;
		x = x * x % MOD;
		y>>=1;
	}
	return ret;
}

signed main(){
  int N;
  cin>>N;
  int p[N];
  rep(i, N) cin >> p[i];

  int check[3];
  int count = 0;
  rep(i, N-2){
    check[0] = p[i];
    check[1] = p[i+1];
    check[2] = p[i+2];
    
    sort(check, check+3);
    if(check[1]==p[i+1]) count++;
  }

  cout << count << endl;

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <cmath>
using namespace std;
int main() {
	int n, a[3001],kotae=0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		kotae += a[i] - 1;
	}
	cout << kotae << endl;
	getchar();
	getchar();
	return 0;
}

Measured memory_bytes: 256
def two_int():
    N, K = map(int, input().split())
    return N,K

def one_int():
    return int(input())

def one_str():
    return input()

def many_int():
    return list(map(int, input().split()))
# import sys
# input = sys.stdin.readline

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

N=one_int()

dicts={}
for i in range(2,N+1):
    lists = factorization(i)
    for item in lists:
        if item[0] != 1:
            if item[0] in dicts:
                dicts[item[0]] += item[1]
            else:
                dicts[item[0]] = item[1]

div=10**9 + 7
ans=1

for k,v in dicts.items():
    ans *= (v+1)%div

print(ans%div)

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

int main() {
int k;
cin >> k;
int a;
a = (k + 1)/2;
 
cout << a* (k-a) << endl;
}
  


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int H,W,K;
int fld[50][50];
int memo[50][50][4][1<<12];
const int dy[]={0,1,-1,0};
const int dx[]={1,0,0,-1};
inline bool out(int y,int x){
    return y<0||y>=H||x<0||x>=W;
}

int dfs(int y,int x,int cnt,int S){
    if(memo[y][x][cnt][S]!=-1)return memo[y][x][cnt][S];

    if(y==H-1&&x==W-1&&cnt==K){
        return 0;
    }
    int ret=INT_MIN;
    int ty=y,tx=x;
    bool flag=true;
    for(int i=0;i<6;i++){
        int cur=(S>>(i*2))%4;
        ty-=dy[cur];
        tx-=dx[cur];
        if(out(ty,tx))break;
        if(ty==y&&tx==x)flag=false;
    }
    for(int i=0;i<4;i++){
        if(i>=2&&cnt==K)continue;
        ty=y+dy[i];
        tx=x+dx[i];
        if(out(ty,tx))continue;
        if(fld[ty][tx]==-1)continue;
        int tS=(S<<2)%(1<<(K*4));
        ret=max(ret,dfs(ty,tx,cnt+(i>=2?1:0),tS|i));
    }

    if(flag)ret+=fld[y][x];
    return memo[y][x][cnt][S]=ret;
}
int main(){
    scanf("%d%d%d",&H,&W,&K);
    for(int i=0;i<H;i++){
        char str[51];
        scanf("%s",str);
        for(int j=0;j<W;j++){
            int val;
            if(str[j]=='#')val=-1;
            else if(str[j]=='.')val=0;
            else val=str[j]-'0';
            fld[i][j]=val;
        }
    }
    fill_n(***memo,50*50*4*(1<<12),-1);
    printf("%d\n",dfs(0,0,0,0));

    return 0;
}

Measured memory_bytes: 161208
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
#define L 26
vector<int> a[L], b[L];

template <class T> ll mergecount(vector<T> &a){
	ll cnt = 0;
	int n = a.size();
	if(n<=1) return 0;
	vector<T> b(a.begin(), a.begin()+n/2);
	vector<T> c(a.begin()+n/2, a.end());
	cnt += mergecount(b);
	cnt += mergecount(c);
	for(int i = 0, j = 0, k = 0; i < n; i++){
		if(k==c.size()) a[i] = b[j++];
		else if(j==b.size()) a[i] = c[k++];
		else if(b[j] <= c[k]) a[i] = b[j++];
		else { a[i] = c[k++]; cnt+=b.size()-j; }
	}
	return cnt;
}

int main(){
	string s;
	cin>>s;
	int n = s.size();
	rep(i, n) a[s[i]-'a'].push_back(i);
	int odd = n%2, c = -1;
	rep(i, L){
		if(a[i].size()%2){
			odd--;
			c = i;
		}
	}
	if(odd){
		cout<<-1<<endl;
		return 0;
	}
	vector<P> v[5];
	rep(i, L){
		int m = a[i].size();
		rep(j, m){
			P p = P(a[i][j], i);
			if(j<m/2){
				if(true || a[i][j]<(n+1)/2) v[0].pb(p);
				else v[1].pb(p);
			} else if(j>=(m+1)/2){
				if(true || a[i][j]>=n/2) v[4].pb(p);
				else v[3].pb(p);
			} else v[2].pb(p);
		}
	}
	rep(i, 5) sort(all(v[i]));
	//rep(i, v[3].size()) res += n/2-i-v[3][i].fst;
	//rep(i, v[1].size()) res += v[1][i].fst-(n+1)/2;
	{
		int t = 0;
		rep(i, 5){
			rep(j, v[i].size()){
				//cerr<<(char)(v[i][j].snd+'a')<<endl;
				//cerr<<t-v[i][j].fst<<endl;
				b[v[i][j].snd].pb(t);
				t++;
			}
		}
	}
	vector<int> x(n);
	rep(i, L){
		int m = b[i].size();
		rep(j, m/2){
			b[i][m-1-j] = n-1-b[i][j];
		}
		rep(j, m) x[a[i][j]] = b[i][j];
	}
	cerr<<x<<endl;
	ll res = mergecount(x);

	cout<<res<<endl;

	return 0;
}


Measured memory_bytes: 7796
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scanner = new Scanner(System.in);
		int n = Integer.parseInt(scanner.nextLine());
		String[] inputs = new String[n];
		for(int i = 0; i < n; i++){
			inputs[i] = scanner.nextLine();
		}

		Map<String, Integer> map = new HashMap<String, Integer>();
		map.put(inputs[0], 1);
		int max = 1;
		for(int i = 1;i < inputs.length;i++){
			if(map.containsKey(inputs[i])){
				int cnt = map.get(inputs[i]);
				map.put(inputs[i], cnt+1);
				max = Math.max(max, cnt+1);
			}else{
				map.put(inputs[i],1);
			}
		}
		List<String> rs = new ArrayList<String>();
		for(Entry<String, Integer> entry: map.entrySet()){
			if(max == entry.getValue()) rs.add(entry.getKey());
		}
		rs.sort(Comparator.comparing( String::toString ));
		for(String r : rs){
			System.out.println(r);
		}
	}

}


Measured memory_bytes: 176480
#include <cstdio>
using namespace std;

int main() {
	int n,x;
	scanf("%d",&n);
	for(int i=1;i<=n;++i) {
		if(i%3==0) {
			printf(" %d",i);
		} else {
			for(x=i;x>0;x/=10) {
				if(x%10==3) {
					printf(" %d",i);
					break;
				}
			}
		}
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 2704
#include <iostream>
#include <cmath>

int main(){
  int n;
  std::cin >> n;
  int cnt = 1;
  int temp = n;
  while(temp>9){
    ++cnt;
    temp /= 10;
  }
  int ans = 0;
  for(int i=1; i<cnt; ++i)
    if(i %2 == 1)
      ans += 9*std::pow(10,i-1);
  if(cnt %2 == 1)
    ans += n-std::pow(10,cnt-1)+1;
  std::cout << ans << std::endl;
  return 0;
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <string>
#include <bitset>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>

using namespace std;

#define f first
#define s second
#define pb push_back
#define pp pop_back
#define mp make_pair
#define ll long long

const int N = 123;
const int inf = 1e9;
const int mod = 1e9 + 7;

int n, dp[N][N], m;

void upd(int &a, int b) {
	a = min(a, b);
}
struct edge {
	int from, to, cost;
} e[N * N];

int main() {
	#ifdef wws
		freopen("in", "r", stdin);
	#endif
	ios_base::sync_with_stdio(0);
	cin >> n >> m;
	for (int i = 1;i <= n;i++)
		for (int j = 1;j <= n;j++)
			if (i != j)
					dp[i][j] = inf;
	for (int i = 1;i <= m;i++) {
		int a, b, c;
		cin >> a >> b >> c;
		upd(dp[a][b], c);
		upd(dp[b][a], c);
		e[i] = {a, b, c};
	}
	for (int k = 1;k <= n;k++)
		for (int i = 1;i <= n;i++)
			for (int j = 1;j <= n;j++)
				upd(dp[i][j], dp[i][k] + dp[k][j]);
	int ans = 0;
	for (int i = 1;i <= m;i++) {
		bool fail = 0;
		for (int from = 1;from <= n;from++) {
			for (int to = 1;to <= n;to++) {
				int now = dp[from][e[i].from] + e[i].cost + dp[e[i].to][to];
				now = min(now, dp[from][e[i].to] + e[i].cost + dp[e[i].from][to]);
				if (now == dp[from][to]) {
					fail = 1;
					break;
				}
			}
		}
		if (!fail) ans++;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(int i=(n);i<(k);i++)
#define ALL(a)  (a).begin(),(a).end()
ll ans=0;
void Main(){
    ll k;cin>>k;
    queue<ll> que;
    For(i,1,10) que.push(i);
    For(i,0,k-1){
        ll t=que.front();
        que.pop();
        ll last=t%10;
        if(last>0) que.push(t*10+last-1);
        que.push(t*10+last);
        if(last<9) que.push(t*10+last+1);
    }
    cout<<que.front()<<endl;
}
int main(){
    Main();
    /*
    東方風神録は神が出てくるので当然神ゲー
    */
    return 0;
}

Measured memory_bytes: 1792
N,K = gets.split.map(&:to_i)

greedy = (0..N-1).map{gets.split.map(&:to_i)}.sort_by{|e| -e[1]}

kiso = 0
set = [] #削除候補
neta = Hash.new{|h,k| h[k] = false}

K.times do |i|
  kiso += greedy[i][1]

  if neta[greedy[i][0]]
    set << greedy[i][1]
  else
    neta[greedy[i][0]] = true
  end

end

# p set
# p neta

deletable = -1

syurui = neta.count{|k,v| v }
ans = kiso + syurui*syurui

K.upto(N-1) do |i|
  t, d = greedy[i]
  next if neta[t]
  break if set.empty?

  kiso += d - set.pop
  syurui += 1
  tmp = kiso + syurui**2
  neta[t] = true

  # puts "kiso=#{kiso}"
  # puts "syurui=#{syurui}"
  # puts "tmp=#{tmp}"

  ans = tmp if tmp > ans
end

puts ans


Measured memory_bytes: 14672
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    //int a,b,c,k; cin >> a >> b >> c >> k;
    int m = 0;
    int ans = 0;
    rep(i,3) {
        int a; cin >> a;
        ans += a;
        m = max(a,m);
    }
    int k; cin >> k;
    ans -= m;
    ans += m*pow(2,k);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin >> s;
  long k;
  cin >> k;
  int i = 0;
  int n = s.length();
  while(k>0 && i<n){
    int tmp = (26-(int)(s[i]-'a'))%26;
    if(tmp<=k){
      k-=tmp;
      s[i] = 'a';
    }
    i++;
  }
  if(k>0)s[n-1]=(char)((int)(s[n-1])+k%26);
  cout << s << endl;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
ll mod=1e9+7;

int main(){
  int a,b;
  cin>>a>>b;
  int cnt(0);
  for (int i(a);i<=b;i++){
    bool flag(true);
    string s=to_string(i);
    for (int j(0);j<s.size()/2;j++){
      if (s[j]!=s[s.size()-1-j]) flag=false;
    }
    if (flag==true) cnt++;
  }
  cout << cnt << endl;
  return 0;
}


Measured memory_bytes: 256
N = gets.chomp.to_i

list = (2..55555).to_a
primes = []

n = list.first
while list.first < Math.sqrt(55555) do
  n = list.first
  primes << n
  list.select! do |v|
    v % n != 0
  end
end

primes.concat(list)

primes.select! do |v|
  v % 5 == 1
end

puts "#{primes.take(N).join(" ")}"

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

#define DUMP(x) cerr << #x << "=" << x << endl
#define DUMP2(x, y) cerr<<"("<<#x<<", "<<#y<<") = ("<<x<<", "<<y<<")"<< endl
#define BINARY(x) static_cast<bitset<16> >(x)

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

#define in_range(x, y, w, h) (0<=(int)(x) && (int)(x)<(int)(w) && 0<=(int)(y) && (int)(y)<(int)(h))
#define ALL(a) (a).begin(),(a).end()

typedef long long ll;
const int INF   = 1e9;
const ll  INFLL = 1e18;
typedef pair<int, int> PII;
typedef vector<vector<int>> Graph;
int dx[4]={0, -1, 1, 0}, dy[4]={-1, 0, 0, 1};

struct Edge { int to, cost; };

bool dfs(vector<vector<Edge>> &G, int v, int p, vector<int> &d, vector<int> &color)
{
#ifdef DEBUG
    DUMP2(v, p);
#endif
    color[v] = 1;
    bool res = true;

    for (auto e : G[v]) {
        int u = e.to;
        if (u == p) continue;

        if (color[u] == 1) return false;
        if (color[u] == 2 && d[v] + e.cost != d[u]) return false;
        if (color[u] == 0) {
            d[u] = d[v] + e.cost;
            res &= dfs(G, u, v, d, color);
        }
    }

    color[v] = 2;
    return res;
}

bool solve(vector<vector<Edge>> G, vector<int> in_deg)
{
    int N = G.size();
    vector<int> d(N, -1), color(N);
    bool ans = true;
    rep(i, N) {
        if (in_deg[i] == 0) {
            d[i] = 0;
            ans &= dfs(G, i, -1, d, color);
        }
    }
    rep(i, N) ans &= (color[i] != 0);

#ifdef DEBUG
    rep(i, N) cerr << d[i] << " ";
    cerr << endl;
#endif
    return ans;
}

int main()
{
    ios::sync_with_stdio(false);

    int N, M;
    cin >> N >> M;
    vector<vector<Edge>> G(N);
    vector<int> in_deg(N);
    rep(i, M) {
        int L, R, D;
        cin >> L >> R >> D;
        L--, R--;
        G[L].push_back({R, D});
        in_deg[R]++;
    }
    cout << (solve(G, in_deg) ? "Yes" : "No") << endl;
}

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

int main() {
	ios_base::sync_with_stdio( false );

	int N, K;
	cin >> N >> K;

	vector<int> h( N );
	for( auto& v: h ) { cin >> v; }
	sort( h.begin(), h.end() );

	int result = INT_MAX;
	for( int i = 0; i < N-K+1; ++i ) {
		int x = h[i+K-1] - h[i];
		if( x < result ) {
			result = x;
		}
	}

	cout << result << endl;

	return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#define int long long
using namespace std;

signed main() {
  int N, C, K; cin >> N >> C >> K;
  vector<int> T(N);
  vector<bool> used(N, false);
  for(int i = 0; i < N; ++i) {
    cin >> T[i];
  }
  sort(T.begin(), T.end());
  int ans = 0, cur = 0, num = 0;
  for(int i = 0; i < N; ++i) {
    if(T[i] > cur || num >= C) {
      ans++;
      cur = T[i] + K;
      num = 1;
    } else {
      num++;
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <set>
#include <cmath>
#include <map>
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define show(x) cout << #x << " = " << x << endl;
#define maxn 300000
int par[maxn];
int ra[maxn];

void init(int n){
    rep(i,n){
        par[i] = i;
        ra[i] = 0;
    }
}

int find(int x){
    if(par[x] == x){
        return x;
    }else{
        return par[x] = find(par[x]);
    }
}

void unite(int x, int y){
    x = find(x);
    y = find(y);
    if(x == y) return;
    
    if(ra[x] < ra[y]){
        par[x] = y;
    }else{
        par[y] = x;
        if(ra[x] == ra[y]) ra[x]++;
    }
}

bool same(int x, int y){
    return find(x) == find(y);
}
int main(){
    int n,m;
    cin >> n >> m;
    int k;
    int l;
    init(maxn-1);
    rep(i,n){
        cin >> k;
        rep(j,k){
            cin >> l;
            unite(i,l+1e5+1);
        }
    }
    for(int i=0;i<n;i++){
        if(same(0,i)==false) {
            cout << "NO" << endl;
            //cout << i << endl;
            return 0;
        }
    }
    /*rep(i,n){
        cout << find(i+1) << endl;
    }*/
    cout << "YES" << endl;
    return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int ar[n+9];
    int xr=0;
    for(int i=1;i<=n;i++)
    {
        cin >> ar[i];
        xr^=ar[i];
    }
    for(int i=1;i<=n;i++)
    {
        int ans=xr^ar[i];
        cout << ans << " ";
    }
}


Measured memory_bytes: 4380
fn count_balls() -> Result<u64, &'static str> {
    let mut input = String::new();
    std::io::stdin().read_line(&mut input)
        .map_err(|_| "input error")?;

    let nab: Vec<u64> = input.trim_right().split_whitespace()
        .map(|n| n.parse::<u64>().unwrap())
        .collect();

    let n = nab[0] / (nab[1] + nab[2]);
    let m = nab[0] % (nab[1] + nab[2]);

    Ok(nab[1] * n + std::cmp::min(m, nab[1]))
}

fn main() {
    println!("{}", count_balls().unwrap());
}

Measured memory_bytes: 4352
def main():
    s=input()
    n=len(s)
    if n == 1:
        print(0)
        return
    t=s[0]
    for _ in range(n-1):
        i = _ + 1
        if s[i] != s[i-1]:
            t += s[i]

    w,b = 0,0
    for c in t:
        if c == 'W':
            w = w + 1
        else:
            b = b + 1
    print(w+b-1)
            
if __name__ == "__main__":
    main()
        

Measured memory_bytes: 3188
unittest
{
	assert( [ "5 2", "1 1 2 2 5" ].parse.expand.solve == 1 );
	assert( [ "4 4", "1 1 2 2" ].parse.expand.solve == 0 );
	assert( [ "10 3", "5 1 3 2 4 1 1 2 3 4" ].parse.expand.solve == 3 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto nk = input.front.split.to!( long[] );
	input.popFront;
	auto as = input.front.split.to!( long[] );
	return tuple( nk[ 1 ], as );
}

auto solve( long k, long[] as )
{
	as.sort();
	auto gs = as.group.map!( ( a ) => a[ 1 ] ).array;
	
	if( gs.length <= k ) return 0;
	
	gs.sort();
	auto ds = gs.take( gs.length - k );
	
	return ds.sum;
}


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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int x, y;
  cin >> x >> y;
  bool t = true;
  for(int i = 0; i <= y / 4; ++i) {
    if(i * 4 + (x - i) * 2 == y) {
      puts("Yes");
      t = false;
      break;
    }
  }
  if(t) puts("No");
  return 0;
}

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

int main() {
    std::string N;
    std::cin >> N;

    if (N[0] == '7' || N[1] == '7' || N[2] == '7') {
        std::cout << "Yes\n";
    } else {
        std::cout << "No\n";
    }

    return 0;
}


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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pld;
typedef vector<ll> vll;
typedef vector<ld> vld;
typedef vector<pll> vpl;
typedef vector<pld> vpd;
typedef vector<vll> vvll;

#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define no cout<<"No"<<endl
#define NO cout<<"NO"<<endl
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

ll mpow(ll m, ll p){
  ll power = m;
  ll res = 1;
  while(p>0){
    if(p&1)
      res = res*power%MOD;
    power = (power*power)%MOD;
    p /= 2;
  }

  return res;
}

ll gcd(ll a, ll b){
  if(b==0)
    return a;
  if(a<b)
    return gcd(b,a);

  return gcd(b,a%b);
}

pll relativePrimes(ll a, ll b){
  if(a==0&&b==0)
    return pll(0,0);
  else if(a==0)
    return pll(0,1);
  else if(b==0)
    return pll(1,0);

  ll x=a;
  ll y=b;
  if(y<0){
    x*=-1;
    y*=-1;
  }
  ll z=gcd(abs(x),abs(y));

  return pll(x/z,y/z);
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);

  ll n;
  cin>>n;
  vll a(n),b(n);
  REP(i,n)cin>>a[i]>>b[i];

  map<pll,ll> m;
  vpl x;

  REP(i,n){
    pll t=relativePrimes(a[i],b[i]);
    m[t]+=1;
    x.push_back(t);
  }
  SORT_UNIQUE(x);


  ll ans=1;
  ll k=x.size();

  vector<bool> visited_x(k, false);
  REP(i,k){
    if(visited_x[i])
      continue;

    ll q=mpow(2,m[x[i]]);
    ll w=0;
    visited_x[i]=true;

    pll target;
    if(x[i].FI==0&&x[i].SE==0)
      continue;
    else if(x[i].FI==0||x[i].SE==0){
      target.FI=x[i].SE;
      target.SE=x[i].FI;
    }
    else{
      target.FI=-x[i].SE;
      target.SE=x[i].FI;
      if(target.SE<0){
        target.FI*=-1;
        target.SE*=-1;
      }
    }

    auto it=lower_bound(ALL(x),target);
    if(it!=x.end()){
      ll index=it-x.begin();
      if(*it==target){
        visited_x[index]=true;
        w=mpow(2,m[target])-1;
      }
    }

    ans=ans*(q+w)%MOD;
  }
  //remove no choise
  ans=(ans-1+m[pll(0,0)]+MOD)%MOD;

  cout<<ans<<endl;


}



Measured memory_bytes: 21976
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <math.h>
typedef long long ll;
using namespace std;

int main()
{
	int n, k;
	cin >> n >> k;
	int cnt = 0;
	while (n / k != 0)
	{
		cnt++;
		n /= k;
	}
	cout << cnt + 1 << endl;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define vcout(v) rep(i,v.size()) cout << v[i] << " "; cout << endl
#define mcout(m) rep(j,m.size()){vcout(m[j]);}
const ll MOD = 1e9 + 7;

struct magic{ ll a; ll b; double ef;
	bool operator<(const magic& o) const{
		return ef < o.ef;
	}
};
void mainsolve(){

	ll h,n;
	cin >> h >> n;
	vector<magic> mm(n);
	vector<ll> aa(n);
	rep(i,n){
		ll a,b;
		cin >> a >> b;
		aa[i] = a;
		mm[i] = magic{a,b,(double)a/b};
	}

	sort(mm.begin(), mm.end());
	reverse(mm.begin(), mm.end());
/*
	ll maxa = 0;
	rep(i,n) maxa = max(maxa, aa[i]);

	vector<ll> dp(maxa+1, 1e9); // 必要な魔力
	dp[0] = 0;
	rep(i,maxa+1){
		rep(j,n){
			dp[i] = min(dp[i], dp[max(i - mm[j].a, 0ll)] + mm[j].b);
		}
		
	}




	ll res = 0;
	while(h > 0){

		ll p = 0;
		if(maxa >= h){
			break;
		}
		else{
			p = mm[0].a;
			res += mm[0].b;
		}

		h -= p;
	}

	res += dp[h];
	*/
	vector<ll> dp(h+1, 1e9); // 必要な魔力
	dp[0] = 0;
	rep(i,h+1){
		rep(j,n){
			dp[i] = min(dp[i], dp[max(i - mm[j].a, 0ll)] + mm[j].b);
		}
		
	}

	cout << dp[h] << endl;
	return;
}

int main(){
	
	//ll TC;cin>>TC;rep(I,TC){cout<<"case:"<<I+1<<"---"<<endl; // comment out!
		mainsolve();
	//} // comment out!
	return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
/*#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/rational.hpp>
namespace mp = boost::multiprecision;
using Bint = mp::cpp_int; //任意長整数 
using Real32 = mp::number<mp::cpp_dec_float<32>>;
using Real1024 = mp::number<mp::cpp_dec_float<1024>>;
using Rat = boost::rational<Bint>;//有理数*/
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
ll mod = 1000000007;
ll INF = 1000000099;
//cin.tie(0);
//ios::sync_with_stdio(false);

ll gcd(ll a,ll b){//最大公約数を求める
    if(a<b){
        swap(a,b);
    }

    if(a%b == 0){
        return b;
    }else{
    return gcd(b,a%b);
    }
}

signed main(){
    ll a,b,c,d,ans,l;
    cin>>a>>b>>c>>d;
    l=(c*d)/gcd(c,d);
    ans=b;
    ans-=b/c;
    ans-=b/d;
    ans+=b/l;
    ans-=(a-1 -(a-1)/c -(a-1)/d +(a-1)/l);
    cout << ans << endl;
}

Measured memory_bytes: 256
N = int(input())
L = list(map(int, input().split()))
L.insert(0,0)
L.append(0)
distance = []
for i in range(N+1):
    distance.append(abs(L[i+1]-L[i]))
                    
res = sum(distance)
                    
for i in range(1, N+1):
    print(res + abs(L[i+1]-L[i-1]) - abs(L[i+1]-L[i]) - abs(L[i]-L[i-1]))
                

Measured memory_bytes: 13920
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
#define ll long long
ll gcd(ll a, ll b)
{
    if (a < b)
    {
        a ^= b;
        b ^= a;
        a ^= b;
    }

    return b ? gcd(b, a % b) : a;
}

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

int main(){
    ll N;
    cin >> N;
    ll sum = 0;
    int A;
    for (int i = 0; i < N;i++)
    {
        cin >> A;
        sum += A - 1;
    }
    cout << sum << endl;
}

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

int main()
{
    string s;
    vector<char> A;
    while(cin>>s)
    {
        int a=s.size();
        for(int i=0;i<a;i++)
        {
            if(s[i]=='0')
            {
            A.push_back('0');
            }
            else if(s[i]=='1')
                    {
                    A.push_back('1');
                    }
                    else if(!A.empty())
                        {
                        A.pop_back();
                        }
        }
        int b=A.size();
        for(int i=0;i<b;i++)
        {
            cout<<A[i];
        }
A.clear();
        cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 384