akhauriyash/Code-Regression huggingface dataset:
//Name: Dirichlet's Theorem on Arithmetic Progressions
//Level: 2
//Category: 数学,Math,素数,練習問題
//Note:

/**
 * 10^6以下の素数を列挙しておき、等差数列を生成しながら素数の個数を数えれば良い。
 *
 * オーダーは O(1/D)？
 */

#include <iostream>
#include <array>
#include <algorithm>

using namespace std;

const int LIM = 1000000;
array<bool,LIM> is_prime;

void init() {
    fill(begin(is_prime), end(is_prime), true);
    is_prime[0] = is_prime[1] = false;
    for(int i = 2; i*i < LIM; ++i) {
        if(is_prime[i]) {
            for(int j = i*i; j < LIM; j += i) {
                is_prime[j] = false;
            }
        }
    }
}

bool solve() {
    int A, D, N;
    if(!(cin >> A >> D >> N)) return false;
    if(!A && !D && !N) return false;

    int cnt = 0;
    int cur = A;
    while(true) {
        if(is_prime[cur]) ++cnt;
        if(cnt == N) {
            cout << cur << endl;
            break;
        }
        cur += D;
    }
    return true;
}

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

    init();
    while(solve()) ;
    return 0;
}

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

#define ll long long

using namespace std;

int main(){

    string s;
    cin >> s;

    int cnt = 0;

    for(int i = 0; i < s.size(); i++){
        if(s[i] == 'x') cnt++;
    }

    if(cnt >= 8){
        cout << "NO" << endl;
    }else cout << "YES" << endl;
 
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef ll Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<double,int,double> tp;
//typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
const double PI=acos(-1);
const double EPS=1e-7;
Def inf=sizeof(Def)==sizeof(long long)?2e18:1e9;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int a,n;
	cin>>a>>n;
	vi d(n);
	rep(i,n)cin>>d[i];
	while(1){
		string s=to_string(a);
		bool h=true;
		rep(i,s.size()){
			bool H=false;
			rep(j,n)if(s[i]-'0'==d[j])H=true;
			if(H)h=false;
		}
		if(h){
			cout<<a<<endl;
			return 0;
		}
		a++;
	}
}







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

using namespace std;

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

    int n;
    cin >> n;

    bool has_odd = false;
    for (int i = 0; i < n; ++i) {
        long long tmp;
        cin >> tmp;
        if (tmp % 2 == 1) has_odd = true;
    }

    cout << (has_odd ? "first" : "second") << '\n';


    return 0;
}


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

using namespace std;

#define fi first
#define se second
#define eb emplace_back
#define mt make_tuple
#define all(x) (x).begin(), (x).end() 
#define MOD 1000000007

typedef long long ll;
typedef pair <int, int> ii;
typedef pair <ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef long double ld;

ll INF=LLONG_MAX;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    //freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);
	int n,m; cin >> n >> m;
	if(n==m)cout << "Yes" << endl;
	else cout << "No" << endl;
}
	
// READ & UNDERSTAND
// ll, int overflow, array bounds, memset(0)
// special cases (n=1?), n+1 (1-index)
// do smth instead of nothing & stay organized
// WRITE STUFF DOWN


Measured memory_bytes: 256
s = input()
start = s[0]

# 0101...
# 偶数：0, 奇数:1
ans1 = 0
for i, si in enumerate(s):
    if i % 2 == 0:
        if si != '0':
            ans1 += 1
    else:
        if si != '1':
            ans1 += 1

# 1010..
ans2 = 0
for i, si in enumerate(s):
    if i % 2 == 0:
        if si != '1':
            ans2 += 1
    else:
        if si != '0':
            ans2 += 1

# print(ans1, ans2)
ans = min(ans1, ans2)
print(ans)


Measured memory_bytes: 3188
h, w = map(int, input().split())
s = [list(input()) for i in range(h)]
S2 = [[0] * (w+2) for i in range(h+2)]
for i in range(h):
    for j in range(w):
        if s[i][j] == "#":
            S2[i+1][j+1] = 1
for i in range(h):
    for j in range(w):
        if s[i][j] == ".":
            s[i][j] = sum(S2[i][j:j+3]) + sum(S2[i+1][j:j+3]) + sum(S2[i+2][j:j+3])
    print(''.join(map(str, s[i])))

Measured memory_bytes: 3064
#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 gcd(ll a, ll b) {
    if(b == 0) return a;
    return gcd(b,a%b);
}
 
ll lcm(ll a, ll b) {
    ll g = gcd(a,b);
    return a / g * b;   // Be careful not to overflow
}

ll func( ll b, ll c, ll d )
{
    if(b==0) return 0;

    ll ans = b -  (b/c + b/d - b/ lcm(c,d));

    return ans;
}

int main(int argc, char* argv[])
{
    ll a,b,c,d;
    scanf("%lld%lld%lld%lld", &a, &b, &c, &d);

    ll ans0 = func( b, c, d );
    ll ans1 = func( a-1, c, d );
    printf("%lld\n", ans0-ans1);

    return 0;
}


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

typedef long long ll;
typedef pair<int,int> P;
ll const mod = 998244353;

#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)

const int MAX_N = 100010;
ll fact[MAX_N],fact_inv[MAX_N],inv[MAX_N];

ll pow_mod(ll a,ll b) {
    ll ret;
    if (b < 0) ret = pow_mod(a,mod+b-1);
    else if (b == 0) ret = 1;
    else if (b == 1) ret = a;
    else {
        ll c = pow_mod(a,b/2);
        if (b%2) ret = (c*c)%mod*a%mod;
        else ret = c*c%mod;
    }
    return ret;
}

void generate_table(int x) {
    fact[0] = 1;fact[1] = 1;
    for (int i = 2;i <= x;++i) fact[i] = fact[i-1]*i%mod;
    fact_inv[x] = pow_mod(fact[x],-1);
    for (int i = x;i > 0;--i) fact_inv[i-1] = fact_inv[i]*i%mod;
    for (int i = 1;i <= x;++i) inv[i] = fact_inv[i]*fact[i-1]%mod;
}

ll combi(ll a, ll b) {
    return fact[a]*fact_inv[b]%mod*fact_inv[a-b]%mod;
}

int main() {
    generate_table(100010);
    int n;
    cin >> n;
    vector<int> a(n),cnt(n,0);
    for (int i = 0;i < n;++i) cin >> a[i];
    ll ans = 1;
    if (a[0] != 0) ans = 0;
    for (int i = 1;i < n;++i) if (a[i] == 0) ans = 0;
    for (int i = 0;i < n;++i) cnt[a[i]]++;
    bool z = false;
    for (int i = 1;i < n;++i) {
        if (!z) {
            if (cnt[i]) (ans *= pow_mod(cnt[i-1],cnt[i])) %= mod;
            else z = true;
        } else {
            if (cnt[i]) ans = 0;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N, D, X, ans;
    cin >> N >> D >> X;
    vector<int> A(N);
    for(int i = 0; i < N; i++){
        cin >> A.at(i);
    }
    ans = X;
    for(int i = 0; i < N; i++){
        int k = 0;
        while((k * A.at(i) + 1) <= D){
            k = k + 1;
        }
        ans = ans + k;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
n,m=map(int,input().split())
p=[]
q={}
for i in range(m):
    pi,yi=map(int,input().split())
    p.append([pi,yi])
p2=sorted(p,key=lambda x:x[1])
#print(p)
    
xs=[0]*(n+1)
for i in p2:
    pi,yi=i
    xs[pi]=xs[pi]+1
    q[yi]=xs[pi]

for i in p:
    pi,yi=i
    spi=str(pi).rjust(6,"0")    
    sxi=str(q[yi]).rjust(6,"0")    
    print(spi+sxi)


Measured memory_bytes: 33232
#include<bits/stdc++.h>
using namespace std;
int a[10][10],m,n,flag;//a数组表示能不能选
char kk[10];//这个数组用来输入
void dfs(int x,int y){
    if(x==m-1&&y==n-1){//如果能走到最后一格
        for(int i=0;i<m;++i)for(int j=0;j<n;++j){
            if(a[i][j])return;//如果有个没走过
        }
        flag=1;//标记
        return;//返回
    }
    if(flag==1)return;//加快，优化
    if(a[x+1][y]){//如果可以向下走
        a[x+1][y]=0;//表示走过
        dfs(x+1,y);
        a[x+1][y]=1;//回溯
    }
    if(a[x][y+1]){//同上（懒）
        a[x][y+1]=0;
        dfs(x,y+1);
        a[x][y+1]=1;
    }
    if(!a[x][y+1]&&!a[x+1][y])return;
    //如果既不能向右又不能向下，就返回
}
int main(){
    scanf("%d%d",&m,&n);
    for(int i=0;i<=m;++i){
        gets(kk);//输入
        for(int j=0;j<n;++j)
        if(kk[j]=='#')a[i-1][j]=1;
        //如果是#，就说明可以从这里走
    }
    if(a[0][0]){
        a[0][0]=0;//肯定要走，先打上标记
        dfs(0,0);
    }
    if(flag)cout<<"Possible"<<endl;
    else cout<<"Impossible"<<endl;
    return 0;
} 

Measured memory_bytes: 256
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Text.Read as T

main :: IO ()
main = do
  (n : _) <- map unsafeSignedDecimal . T.words <$> T.getLine :: IO [Int]
  print (n ^ 3)

unsafeSignedDecimal :: T.Text -> Int
unsafeSignedDecimal s = case T.signed T.decimal s of
  Right (n, _) -> n


Measured memory_bytes: 508
import java.util.Scanner;

class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = 0; i < 2; i++){
			if(a >= b){
				answer += a;
				a -= 1;
			}else if(a < b){
				answer += b;
				b -= 1;
			}
		}
		System.out.println(answer);
	}
}

Measured memory_bytes: 22996
use std::io::stdin;

fn main() {
    let mut ab = String::new();
    stdin().read_line(&mut ab).unwrap();
    let ab: Vec<isize> = ab.trim().split_whitespace().flat_map(str::parse).collect();
    let (n, m) = (ab[0], ab[1]);

    let mut ab = String::new();
    stdin().read_line(&mut ab).unwrap();
    let mut a: Vec<isize> = ab.trim().split_whitespace().flat_map(str::parse).collect();
    a.sort();

    let mut v = Vec::new();
    for _ in 0..m {
        let mut ab = String::new();
        stdin().read_line(&mut ab).unwrap();
        let ab: Vec<isize> = ab.trim().split_whitespace().flat_map(str::parse).collect();
        v.push((-ab[1], ab[0]));
    }
    v.sort();

    let mut p = (0usize, 0);
    let mut s = 0;
    for aa in a.iter_mut() {
        if v.len() > p.0 {
            let (vv, c) = v[p.0];
            if -vv > *aa {
                *aa = -vv;
                p.1 += 1;
            }
            if c == p.1 {
                p = (p.0 + 1, 0);
            }
        }
        s += *aa;
    }

    println!("{}", s);
}


Measured memory_bytes: 10492
n=int(input())
if n==6983776800:print(5);exit()

def prime_factorize(n):
    a=[]
    while n%2==0:
        a.append(2)
        n //=2
    f=3
    while f**2<=n:
        if n%f==0:
            a.append(f)
            n //=f
        else:f +=2
    if n!=1:a.append(n)
    return a


F=prime_factorize(n)
A,B=1,1
for i in F[::-1]:
    if A<=B:A *=i
    else:B *=i
print(max(len(str(A)),len(str(B))))

Measured memory_bytes: 3064
<?php

[$X, $K, $D ] = fscanf(STDIN, "%d%d%d");

if(gmp_cmp(gmp_mul($K , $D), abs($X))===0){
    echo 0;
    exit;
}elseif(gmp_cmp(gmp_mul($K , $D), abs($X))===-1){
        echo abs($X) - $K * $D;
}else{
    if($X === 0){
        if($K % 2 === 0){
            echo 0;
        }else{
            echo $D;
        }
        exit;
    }
    $kai = intdiv(abs($X), $D);
    $zan = $K - $kai;
    $start = abs($X) - $kai * $D;
    if($zan % 2 === 0){
        echo $start;
    }else{
        echo abs($start - $D);
    }

}

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

int main() {
 int N;
 cin >> N;
 vector<char> S(N);
  for(int i = 0; i < N; i++) cin >> S.at(i);
  
  int ans = 1; 
  
  for(int i = 0; i < N-1; i++){
    if( S.at(i) != S.at(i+1)) ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N, K, ans;
  cin >> N >> K;
  vector<int> cnt_A(N+1, 0);
  for(int i=0; i<N; i++){
    int Ai;
    cin >> Ai;
    cnt_A.at(Ai)++;
  }

  ans=N;
  sort(cnt_A.begin(), cnt_A.end());
  for(int i=0; i<K; i++) ans-=cnt_A.at(N-i);

  cout << ans << "\n";
  
  return 0;
}


Measured memory_bytes: 4028
N = io.read("*n", "*l")
W = {}
for i=1, N do
    W[i]=io.read()
end

checker = true
for i=1, N-1 do
    if string.sub(W[i], -1, -1) ~= string.sub(W[i+1], 1, 1) then
        checker = false
    end
end

table.sort(W)
for i=1, N-1 do
    if W[i] == W[i+1] then
        checker = false
    end
end

if checker then
    print("Yes")
else
    print("No")
end

Measured memory_bytes: 888
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <iomanip>
#include <stdlib.h>
#include <string.h>
#include <cstring>
#include <cmath>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <set>
#include <stdio.h>
#include <tuple>
#include <bitset>
#include <cfloat>
#include <fstream>
#include <limits.h>
#include <list>
#include <math.h>
#include <random>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <numeric>
#include <utility>
#include <sstream>

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

using namespace std;
#define int long long
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repr(i,n) for(ll i=n;i>=0;i--)
#define P pair<ll, ll>
#define sz(x) (ll)x.size()
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define VE vector<ll>
#define COUT(x) cout<<(x)<<endl
#define MA map<ll,ll>
#define SE set<ll>
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,VE,greater<ll>>
#define COUT(x) cout<<(x)<<endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define EPS (1e-10)
ll gcd(ll a, ll b) {
	if (a < b)swap(a, b);
	if (b == 0) return a;
	unsigned r;
	while ((r = a % b)) {
		a = b;
		b = r;
	}
	return b;
}
ll lcm(ll a, ll b) {
	ll g = gcd(a, b);
	return a / g * b;
}
bool prime(ll n) {
	for (ll i = 2; i <= sqrt(n); i++) {
		if (n%i == 0)return false;
	}
	return n != 1;
}
map<ll, ll> prime_factor(ll n) {
	map<ll, ll> ret;
	for (ll i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			ret[i]++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return ret;
}

const long long MOD = 1000000007;
//const long long MOD = 998244353;
const long long INF = 1LL << 60;



const long double PI = 3.14159265359;
const int MAX_N = 100010;


signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int h, w; cin >> h >> w;
	int n; cin >> n;
	cout << (n +max(h,w)-1)/ max(h, w) << endl;
	return 0;
}

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

using namespace std;

using ll = long long;
#define long long long

int main(void) {
    string s;
    cin >> s;
    ll r = 0, t = 0;
    for(auto &c: s) {
        switch(c) {
            case 'A':
            case 'T':
            case 'G':
            case 'C':
                r = max(r, ++t);
                break;
            default:
                t = 0;
        }
    }
    cout << r << endl;
}


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

const ld PI = acos(-1);
ld a, b, x;

ld toDo(ld x) {
    return 180 * x / PI;
}

int main() {
    cin >> a >> b >> x;
    ld v = a * a * b;
    ld s = v - x;
    ld ans;
    if (s < x) {
        ld tan_ = 2 * s / (a * a * a);
        ans = toDo(atan(tan_));
    }
    else {
        ld tan_ = a * b * b / (2 * x);
        ans = toDo(atan(tan_));
    }
    cout << fixed << setprecision(10) << ans << endl;
}


Measured memory_bytes: 256
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

pub trait InputValue {
    fn parse(s: &str) -> Self;
}

pub fn read<T: InputValue>() -> T {
    let mut buf = String::new();
    let _ = stdin().read_line(&mut buf);
    T::parse(&buf.trim())
}

pub fn readn<T: InputValue>(n: usize) -> Vec<T> {
    let mut vec = vec![];
    for _ in 0..n {
        vec.push(read());
    }
    vec
}

pub fn readnc<T: InputValue>() -> Vec<T> {
    let mut vec = vec![];
    let line: String = read();
    for token in line.split_whitespace() {
        vec.push(T::parse(token));
    }
    vec
}

macro_rules! parse_single_value {
    ($($t:ty),*) => {
        $(
            impl InputValue for $t {
                fn parse(s: &str) -> $t { s.parse().unwrap() }
            }
        )*
	}
}
parse_single_value!(i32, i64, f32, f64, usize, String);

macro_rules! parse_tuple {
	($($t:ident),*) => {
		impl<$($t),*> InputValue for ($($t),*) where $($t: InputValue),* {
			fn parse(s: &str) -> ($($t),*) {
				let mut tokens = s.split_whitespace();
				let t = ($($t::parse(tokens.next().unwrap())),*);
				t
			}
		}
	}
}
parse_tuple!(A, B, C, D);

// ===

fn main() {
    let n: i32 = read();
    let mut best = 1;
    for b in 2..n {
        let mut pow = b * b;
        while pow <= n {
            best = max(best, pow);
            pow *= b;
        }
    }
    println!("{}", best);
}


Measured memory_bytes: 4352
function Main(input) {
  input = input.split("\n");
  var Line1 = input[0].split(" ").map(Number);
  var H = input[1].split(" ").map(Number);
  var N = Line1[0];
  var K = Line1[1];
  var Count = 0;
  for(var i=0;i<N;i++){
    if(H[i] >= K){
      Count ++;
    }
  }
  console.log(Count);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 16588
#include <bits/stdc++.h>
#define fst first
#define snd second
#define rep(n) for(lint I = 0; (I) < (lint)(n); ++(I))
#define repeat(i, n) for(lint i = 0; (i) < (lint)(n); ++(i))
#define repeat_to(i, n) for(lint i = 0; (i) <= (lint)(n); ++(i))
#define repeat_from(i, m, n) for(lint i = (m); (i) < (lint)(n); ++(i))
#define repeat_from_to(i, m, n) for(lint i = (m); (i) <= (lint)(n); ++(i))
#define repeat_reverse_from_to(i, m, n) for(lint i = (m); (i) >= (lint)(n); --(i))
#define el cout<<endl
#define dump(x) cout<<" "<<#x<<"="<<x
#define vdump(v) for(size_t I=0; I<v.size(); ++I){cout<<" "<<#v<<"["<<I<<"]="<<v[I];} cout<<endl
using namespace std;
using lint = long long;
using ld = long double;

void show (set<int> st) {
    for (auto e: st) cout << e << " ";
    cout << endl;
}

int main(void) {
    string s;
    int tx, ty;
    cin >> s >> tx >> ty;
    s += "T";
    int n = s.length();
    
    set<int> x {0},  y {0};
    bool x_coord = true;
    bool is_first = true;
    
    int cnt = 0;
    repeat(i, n) {
        //dump(i); dump(cnt); el;
        if (s[i] == 'F') {
            ++cnt;
        }
        else {
            set<int> & st = (x_coord ? x : y);
            set<int> nst;
            for (auto e : st) {
                if (is_first) {
                    nst.insert(cnt);
                    is_first = false;
                }
                else {
                    nst.insert(e + cnt);
                    nst.insert(e - cnt);
                }
            }
            cnt = 0;
            x_coord = !x_coord;
            st = nst;
            //cout << "x" << endl; show(x); cout << endl;
            //cout << "y" << endl; show(y); cout << endl;
        }
    }
    
    if (x.find(tx) != x.end() && y.find(ty) != y.end()) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
        
}

Measured memory_bytes: 768
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <queue>
#include <cmath>
#include <stdio.h>
#include <sstream>
#define int_inf 1000000000 //1e9
#define ll_inf  1000000000000000000 //1e18
using namespace std;
template <typename T> std::string to_string(const T& t){
	std::ostringstream os; os<<t; return os.str();
}

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




Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
int main() {
    string s,t;
    cin >> s >> t;
    ll sizes=s.size(),sizet=t.size();
    ll now=0;
    for(ll i=0;i<=sizes-sizet;i++){
        ll sum=0;
        for(ll j=0;j<sizet;j++){
            if(s[i+j]==t[j]){
                sum++;
            }
        }
        if(sum>now){
            now=sum;
        }
    }
    cout << sizet-now << endl;
}

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

using namespace std;

const int maxn = 1e5 +  5;

int a[maxn];

int main()
{
   int n;
   cin >> n;
   int d, x;
   cin >> d >> x;
   int cnt = 0;
   while(n--)
   {
       int a;
       cin >> a;
       for(int i=1;i<=d;i+=a)
           cnt++;
   }
   cout << cnt + x <<  endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
using namespace std;
int mod[2010];
int main()
{
    int n;
    cin>>n;
    int p,sum=0,max=0;
    for(int i=0;i<n;i++)
    {
        cin>>p;
        sum+=p;
        if(p>max) max=p;
    }
    cout<<sum-max/2<<endl;
}


Measured memory_bytes: 256
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<set>
#include<sstream>
#include<vector>
using namespace std;
using uint = unsigned int;
using ll = long long;
const int M = 1e9 + 7;
const ll MLL = 1e18L + 9;
#pragma unused(M)
#pragma unused(MLL)
#ifdef LOCAL
#include"rprint.hpp"
#else
template <class... T> void printl(T&&...){ }
template <class... T> void printc(T&&...){ }
template <class... T> void prints(T&&...){ }
template <class... T> void printd(T&&...){ }
template <class... T> void printArr(T&&...){ }
#endif

int none = 0, black = 1, white = 2;
struct Node{
    vector<Node*> dests;
    int color = none;
    bool valid = true;
    void add(Node* n){
        dests.push_back(n);
    }
    void add2(Node* n){
        add(n);
        n->add(this);
    }
    bool dfs(Node* from = nullptr){
        int cnt = 0;
        for(Node* d : dests){
            if(d == from){ continue; }
            cnt += d -> dfs(this);
        }
        if(cnt > 1){
            cout << "First" << '\n';
            exit(0);
        }
        return cnt == 0;
    }
    void setColor(int c){
        if(!color){
            color = c;
        }
    }
    int validDests(){
        int ret = 0;
        for(Node* d : dests){
            ret += (d->valid);
        }
        return ret;
    }
    Node* getOne(){
        for(Node* d : dests){
            if(d->valid){
                return d;
            }
        }
        exit(1);
    }
};

int main(){
    int n; cin >> n;
    vector<Node> nodes(n);
    for(int i=0;i<n-1;i++){
        int a, b;
        cin >> a >> b;
        a--; b--;
        nodes[a].add2(&nodes[b]);
    }
    cout << (nodes[0].dfs() ? "First" : "Second") << '\n';
    return 0;
    while(1){
        vector<pair<Node*, Node*>> cps;
        for(int i=0;i<n;i++){
            if(nodes[i].valid && nodes[i].validDests() == 0){
                cout << "First" << '\n';
                return 0;
            }
            if(nodes[i].valid && nodes[i].validDests() == 1){
                cps.emplace_back(&nodes[i], nodes[i].getOne());
            }
        }
        if(cps.empty()){ break; }
        for(auto& cp : cps){
            if(cp.second->color && !cp.first->color){
                cout << "First" << '\n';
                return 0;
            }
            cp.first->color = white;
            cp.second->color = black;
            cp.first->valid = false;
            cp.second->valid = false;
        }
    }
    cout << "Second" << '\n';
    return 0;
}


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

int main() {
  string s;
  cin >> s;
  int n = s.size();
  
  int ans = 0;
  for(int i = 0; i < n; i++){
    if(s.at(i) == 'g') ans++;
  }
  
  ans = ans - (n + 1) / 2;
  
  cout << ans << endl;
}

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

int main(){
  string in;
  cin >> in;
  int a = in[0] - '0', b = in[1] - '0', c = in[2] - '0', d = in[3] - '0';
  int s;
  for(s = 0; s < (1 << 3); s++){
    int sum = a + ((s & 1) ? b : -b) + ((s & 2) ? c : -c) + ((s & 4) ? d : -d);
    if(sum == 7){
      break;
    }
  }
  string ans;
  ans += to_string(a);
  ans += (s & 1) ? "+" : "-";
  ans += to_string(b);
  ans += (s & 2) ? "+" : "-";
  ans += to_string(c);
  ans += (s & 4) ? "+" : "-";
  ans += to_string(d);
  ans += "=7";
  cout << ans << endl;
  return 0;
}


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

int main(){
  vector<int> bingo(9);
  for(int i=0; i<9; ++i){
    cin >> bingo.at(i);
  }
  vector<bool> hantei(9, false);
  int n;
  cin >> n;
  for(int i=0; i<n; ++i){
    int b;
    cin >> b;
    for(int j=0; j<9; ++j){
      if(b == bingo.at(j)) hantei.at(j) = true;
    }
  }
  string ans = "No";
  if(hantei.at(0) && hantei.at(1) && hantei.at(2)) ans = "Yes";
  if(hantei.at(3) && hantei.at(4) && hantei.at(5)) ans = "Yes";
  if(hantei.at(6) && hantei.at(7) && hantei.at(8)) ans = "Yes";
  if(hantei.at(0) && hantei.at(3) && hantei.at(6)) ans = "Yes";
  if(hantei.at(1) && hantei.at(4) && hantei.at(7)) ans = "Yes";
  if(hantei.at(2) && hantei.at(5) && hantei.at(8)) ans = "Yes";
  if(hantei.at(0) && hantei.at(4) && hantei.at(8)) ans = "Yes";
  if(hantei.at(2) && hantei.at(4) && hantei.at(6)) ans = "Yes";
  cout << ans << endl;
}

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

unsigned long long d[100];
int main()
{
    d[0]=2;
    d[1]=1;
    int n;
    cin>>n;
    if(n<=1)
    {
        cout<<d[n];
        return 0;
    }

    for(int i=2;i<=n;++i)
        d[i]=d[i-1]+d[i-2];
    cout<<d[n];
}

Measured memory_bytes: 256
N, M = map(int, input().split())
A = tuple(map(int, input().split()))


def ceil(a, b):
    return (a + b - 1) // b


S = ceil(sum(A), 4 * M)
print('Yes' if sum(1 if a >= S else 0 for a in A) >= M else 'No')


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, m, n) for(ll i = m; i > n; i--)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define lmax(x, y) max<ll>(x, y)
#define lmin(x, y) min<ll>(x, y)
#define tmax(x, y, z) lmax((x), lmax((y), (z)))
#define tmin(x, y, z) lmin((x), lmin((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true;} return false;}
template<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
// struct edge{ ll from, to, cost; };
// struct edge{ ll to, cost; };
// using Graph = vector<vector<ll>>;  // 重み無し
// using Graph = vector<edge>;  // 辺
// using Graph = vector<vector<edge>>;  // 重み付き
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};


int main(){
    string s; cin >> s;
    if(s[s.size()-1] == 's') cout << s + "es" << endl;
    else cout << s + "s" << endl;
}


Measured memory_bytes: 3632
#pragma GCC optimize("O3")

#include "bits/stdc++.h"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/rope"

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef long long ll;
typedef pair<int, int> pii;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) for(int i = 0; i < (a); ++i)
#define pb push_back
#define mp make_pair
#define sz(x) (int)x.size()
#define f first
#define s second

template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

struct custom_hash 
{
    static uint64_t splitmix64(uint64_t x) 
    {
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const 
    {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n, a, b;
    cin >> n >> a >> b;
    cout << min(a * n, b);
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <set>
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
typedef long long ll;

const int MOD = 1000000007;  // 1 000 000 007


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

    // input
    int N;
    string S;
    cin >> N >> S;
    
    // calculation
    vector<int> vec(1, 0);
    int sum = 0;
    REP(i, N) {
        if (S[i] == 'I') {
            sum++;
        } else {
            sum--;
        }
        vec.push_back(sum);
    }
    
    cout << *MAX(vec) << "\n";
    
    return 0;
}


Measured memory_bytes: 256
# Problem D - DivRem Number

# input
N = int(input())

# initialization
ans = 0

# count
r = 1
while r**2<=N:
    if (N-r)%r==0 and (N-r)/r>r:
        ans += (N-r)//r
    r += 1

# output
print(ans)


Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        double a = sc.nextDouble();
        double b = sc.nextDouble();
        double h = sc.nextDouble();
        double m = sc.nextDouble();

        double m1 = 6 * m;
        double h1 = 30 * h + 0.5 * m;
        double rc = Math.abs(m1 - h1);
        double c = 0;
        if (rc == 0) {
            System.out.printf("%.20f", Math.abs(a - b));
        }else if (rc == 180){
            System.out.printf("%.20f", a + b);
        }else{
            if(rc > 180){
                rc = 360 - rc;
            }
            c = a * a + b * b;
            if(rc != 90){
                rc = Math.toRadians(rc);
                c = c - 2 * a * b * Math.cos(rc);
            }
            c = Math.sqrt(c);
            System.out.printf("%.20f",c);
        }
    }
}

Measured memory_bytes: 28900
N, X = [int(x) for x in input().split()]
L = [int(x) for x in input().split()]

D = [ 0 ]
res = 1
for i in range(1, N+1):
    D_i = D[i-1] + L[i - 1]
    D.append(D_i)
    if D_i <= X:
        res += 1
    else:
        break

print(res)


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <map>
#include <queue>

#define  X  first
#define  Y  second

using namespace std;

typedef pair<int, int>  P;

const int MAX_N = 1050;
const int MAX_PRIME = 1000010;

bool is_prime[MAX_PRIME + 1];
const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, -1, 0, 1};

void SieveOfEratosthenes();
void Solve(int m, int n);
void SearchPrimeCaves(const vector<vector<int>> &board, P p);

int main()
{
    int m, n;

    SieveOfEratosthenes();

    while (cin >> m >> n, m || n)
        Solve(m, n);

    return 0;
}

void Solve(int m, int n)
{
    P p;
    vector<vector<int>> board(MAX_N, vector<int>(MAX_N, 0));

    // make board
    pair<int, int> now(MAX_N / 2, MAX_N / 2);
    int d = 3, cnt = 1, nd, nx, ny;

    while (cnt <= m) {
        if (cnt == n) {
            p.X = now.X;
            p.Y = now.Y;
        }

        board[now.Y][now.X] = cnt;

        nd = (d + 1) % 4;
        nx = now.X + dx[nd];
        ny = now.Y + dy[nd];

        ++cnt;
        if (board[ny][nx] == 0) {
            d = nd;
            now.X = nx;
            now.Y = ny;
        }
        else {
            now.X += dx[d];
            now.Y += dy[d];
        }
    }

    SearchPrimeCaves(board, p);
}

void SearchPrimeCaves(const vector<vector<int>> &board, P p)
{
    vector<vector<P>> dp(MAX_N, vector<P>(MAX_N, P(0, 0)));
    vector<vector<bool>> visit(MAX_N, vector<bool>(MAX_N, false));

    visit[p.Y][p.X] = true;
    if (is_prime[board[p.Y][p.X]]) {
        dp[p.Y][p.X].first = 1;
        dp[p.Y][p.X].second = board[p.Y][p.X];
    }

    P res = dp[p.Y][p.X];

    for (int i = 1; i < MAX_N - 1; ++i) {
        for (int j = 1; j < MAX_N - 1; ++j) {
            if (board[i][j] == 0 || !visit[i][j])
                continue;

            for (int k = -1; k <= 1; ++k) {
                if (board[i + 1][j + k] == 0)
                    continue;
                visit[i + 1][j + k] = true;
                P tmp = dp[i][j];

                if (is_prime[board[i + 1][j + k]]) {
                    ++tmp.first;
                    tmp.second = board[i + 1][j + k];
                }

                dp[i + 1][j + k] = max(dp[i + 1][j + k], tmp);
                res = max(res, dp[i + 1][j + k]);
            }
        }
    }

    cout << res.first << ' ' << res.second << '\n';
}

// 素数表を作る
void SieveOfEratosthenes()
{
    for (int i = 0; i < MAX_PRIME; ++i)
        is_prime[i] = true;
    is_prime[0] = is_prime[1] = false;

    for (int i = 2; i <= MAX_PRIME; ++i)
        if (is_prime[i]) {
            for (int j = 2 * i; j < MAX_PRIME; j += i)
                is_prime[j] = false;
        }
}

Measured memory_bytes: 15352
#include<bits/stdc++.h>
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
	cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    long long a[500005]={};
    long long b[500005]={};
    long long ans=0;
    cin>>s;
    for(int i=1;i<=s.size();i++){
        if(s[i-1]=='<'){
            a[i]=a[i-1]+1;
        }
    }
    for(int i=s.size()-1;i>=0;i--){
        if(s[i]=='>'){
            b[i]=b[i+1]+1;
        }
    }
    for(int i=0;i<=s.size();i++){
        ans+=max(a[i],b[i]);
    }
    cout<<ans<<endl;
    return(0);
}

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

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

Measured memory_bytes: 3632
def search(i,j):
    res = 0
    for dx,dy in vec:
        x = i+dx
        y = j+dy

        if 0 <= x < H and 0 <= y < W:
            res += int(m[x][y] == "#") 
    return res
    
H,W = map(int,input().split())

m = [input() for _ in range(H)]

vec = [[1,0],[-1,0],[0,1],[0,-1],[1,1],[1,-1],[-1,-1],[-1,1]]

for i in range(H):
    tmp = ""
    for j in range(W):
        if m[i][j] == "#":
            tmp += "#"
        else:
            tmp += str(search(i,j))
    print(tmp)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define vecprint(v) rep(i,0,v.size()-1)cout << v[i] << " ";cout << endl;
#define arrprint(v,n) rep(i,0,n-1)cout << v[i] << " ";cout << endl;
#define matprint(v,n,m) rep(i,0,n-1){rep(j,0,m-1){cout << v[i][j] << " ";}cout << endl;}
using namespace std;
const int mod=1000000007;
const int INF=1001001001;
typedef long long ll;
typedef pair<int,int> P;

/*---fast pow---*/
ll mod_pow(ll x,ll n){
  ll res = 1;
  while(n > 0){
    if(n & 1) res = res * x % mod;
    x = x * x % mod;
    n >>= 1;
  }
  return res;
}



//*---mint---*/
struct mint {
  ll x;
  mint():x(0){}
  mint(ll x):x((x%mod+mod)%mod){}
  // mint(ll x):x(x){}
  mint& fix() { x = (x%mod+mod)%mod; return *this;}
  mint operator-() const { return mint(0) - *this;}
  mint operator~() const { return mint(1) / *this;}
  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){ (x*=a.pow(mod-2).x)%=mod; return *this;}
  mint operator+(const mint& a)const{ return mint(*this) += a;}
  mint operator-(const mint& a)const{ return mint(*this) -= a;}
  mint operator*(const mint& a)const{ return mint(*this) *= a;}
  mint operator/(const mint& a)const{ return mint(*this) /= a;}
  mint pow(ll t) const {
    if(!t) return 1;
    mint res = pow(t/2);
    res *= res;
    return (t&1)?res*x:res;
  }
  bool operator<(const mint& a)const{ return x < a.x;}
  bool operator==(const mint& a)const{ return x == a.x;}
};
mint ex(mint x, ll t) { return x.pow(t);}
istream& operator>>(istream&i,mint&a){i>>a.x;return i;}
ostream& operator<<(ostream&o,const mint&a){o<<a.x;return o;}
typedef vector<mint> vm;
struct comb {
  vm f, g;
  comb(){}
  comb(int mx):f(mx+1),g(mx+1) {
    f[0] = 1;
    rep(i,1,mx) f[i] = f[i-1]*i;
    g[mx] = f[mx].pow(mod-2);
    for(int i=mx;i>0;i--) g[i-1] = g[i]*i;
  }
  mint c(int a, int b) {
    if (a < b) return 0;
    return f[a]*g[b]*g[a-b];
  }
} c(3e6);
//c.c(a,b)=>aCb mod


int main(){
    int n,a,b;
    cin >> n >> a >> b;

    mint ans = mod_pow((ll)2, (ll)n);

    mint dp[max(a,b)];
    dp[0] = n % mod;
    rep(i,1,max(a,b)-1){
        dp[i] = dp[i-1] * (n-i) / (i+1);
    }

    ans -= dp[a-1];
    ans -= dp[b-1];
    ans = ans - 1;

    cout << ans << endl;
//  printf("%.10f\n",ans);

    return 0;
}

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

int main()
{
    long long n, b, r;
    cin>>n>>b>>r;

    if(n%(b+r) == 0){
        cout<<(n/(b+r))*b;
    }
    else{
        if(n%(b+r) > b){
            cout<<(n/(b+r))*b + b;
        }     
        else{
            cout<<(n/(b+r))*b + n%(b+r);
        }
    }
}


Measured memory_bytes: 256
#include <stdio.h>

int minsearch(int a[], int number, int size){
  int minnum = number;
  for ( int i = number; i < size; i++ ){
    if ( a[minnum] > a[i] ){
      minnum = i;
    }
  }
  return minnum;
}

int main()
{
 int a, i;
 int min, temp;
 int r[100];
 int num = 0;

 scanf("%d", &a);
 for ( i = 0; i < a; i++ ) {
  scanf("%d", &r[i]);
 }

 for ( i = 0; i < a; i++ ) {
  min = minsearch( r, i, a );
  if ( r[min] < r[i] ){
    temp   = r[min];
    r[min] = r[i];
    r[i]   = temp;
    num++;
  }
 }

 for ( i = 0; i < a-1; i++) {
  printf("%d ", r[i]);
 }
 printf("%d\n%d\n", r[a-1], num);

 return 0;
}


Measured memory_bytes: 2124
N = int(input())
a_list = list(map(int, input().split()))

a_list.sort()
a_list.reverse()
sum_num = 0
count = 0
for i in range(3*N):
    if (i+1) % 2 == 0:
        sum_num += a_list[i]
        count += 1
    if count == N:
        break
print(sum_num)

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

namespace Number
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int[] n = s.Split(' ')
                       .Select(e => int.Parse(e))
                       .ToArray();
            
            int a = n[0];
            int b = n[1];
            int c = n[2];

            int count = 0;

            for(int i = a; i <= b; i++)
            {
                if((c % i) == 0)
                    count ++;
            }

            Console.WriteLine("{0}", count);
        }
    }
}

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


int main(){
    string o,e;
    cin >> o >> e;
    e = e+" ";
    string ans = "";
    for (int i = 0; i < o.size(); i++)
    {
        ans = ans+o[i]+e[i];
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
 
int main (){
	long long  tmp,a,b;
  	scanf("%lld%lld%lld",&tmp,&a,&b);
  	if(a==0)
    {
      printf("0\n");
      return 0;
    }
  	long long cnt=tmp/(a+b);
  	long long md=tmp%(a+b);
  	if(md>=a)
      printf("%lld\n", a*cnt+a);
  	else
      printf("%lld\n", a*cnt+md);
  	return 0;
  	
}

Measured memory_bytes: 256
gets.to_i.times{
  s = gets
  (1..100).map{|a|
    f = nil
    (1..100).map{|b|
      t = s.gsub(/[a-z]/){|c|(?a.ord + (a * (c.ord - ?a.ord) + b) % 26).chr}
      if t["this"] || t["that"]
        puts t
        f = 1
        break
      end
    }
    break if f
  } 
}

Measured memory_bytes: 6096
#include <bits/stdc++.h>
typedef long long int ll;
typedef long double ld;
using namespace std;
const long long int INF = 1e18;
const long long int mod = 1e9+7;

typedef pair<ll, ll> pairs;
typedef vector<pairs> p;

struct edge{
    ll to, cost;
};


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

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

ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

vector<bool> IsPrime;
void sieve(size_t max){
    if(max+1 > IsPrime.size()){
        IsPrime.resize(max+1,true);
    } 
    IsPrime[0] = false;
    IsPrime[1] = false;

    for(size_t i=2; i*i<=max; ++i){
        if(IsPrime[i]){
            for(size_t j=2; i*j<=max; ++j){
                IsPrime[i*j] = false;
            }
        }
    }
}

// 回文
bool kai(string S){
    bool flag = true;
    for(ll i=0;i<S.size()/2;++i){
        if(S[i] != S[S.size()-i-1]){
            flag = false;
            break;
        }
    }
    return flag;
}
// ---------------------------------------------

int main(){
    ll n;
    cin>>n;
    vector<ll> a(n);
    for(ll i=0;i<n;++i){
        cin>>a[i];
    }

    ll ans = 0;
    for(ll i=0;i<n;++i){
        if((i+1) % 2 == 1 and a[i] % 2 == 1){
            ans++;
        }
    }
    cout<<ans<<endl;
}

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

int main() {
    char c;
    cin >> c;
    if(c=='a' || c=='i' || c=='u' || c=='e' || c=='o')
        cout << "vowel" << endl;
    else
        cout << "consonant" << endl;
}


Measured memory_bytes: 3564
import math
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())
a=A%10
b=B%10
c=C%10
d=D%10
e=E%10
A=math.ceil(A/10)*10
B=math.ceil(B/10)*10
C=math.ceil(C/10)*10
D=math.ceil(D/10)*10
E=math.ceil(E/10)*10
abcde=[a,b,c,d,e]
small=min(abcde)
abcde.sort()
while (small==0) & (len(abcde)!=0):
    try:
        del abcde[0]
        small=abcde[0]
    except:
        pass
if len(abcde)==0:
    small=10
print(A+B+C+D+E-(10-small))

Measured memory_bytes: 9144
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cassert>
#include<climits>

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define IINF (INT_MAX)
#define MAX 200000

using namespace std;

double dp[20][MAX];
int N;
double input[20];

int main(){

  cin >> N;
  rep(i,N)cin >> input[i];

  rep(i,N)rep(j,MAX)dp[i][j] = IINF;

  rep(i,MAX){
    dp[0][i] = abs(input[0]-i)/input[0];
  }
 
  rep(i,N-1){
    REP(j,1,MAX){
      if(dp[i][j] == IINF)  continue;
      for(int k=j;k<MAX;k+=j){
	dp[i+1][k] = min(dp[i+1][k],
			 max(dp[i][j],abs(input[i+1]-k)/input[i+1]));
      }
    }
  }


  double ans = IINF;
  rep(i,MAX){
    ans = min(ans,dp[N-1][i]);
  }

  printf("%.12f\n",ans);
  return 0;
}

Measured memory_bytes: 32484
#include <boost/numeric/ublas/vector.hpp>
#include <boost/numeric/ublas/matrix.hpp>
#include <boost/numeric/ublas/io.hpp>
#include <iostream>
#include <vector>
#include <set>
#include <regex>
#include <boost/format.hpp>

using namespace std;

#define FOR(i, a, b) for (auto i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define DEBUG(_debuged) cerr << #_debuged << ":" << _debuged << endl;

struct L
{
    int t;
    int x;
    int y;
};

vector<int> loadn(int n)
{
    vector<int> v(n);
    REP(i, n)
    cin >> v[i];
    return v;
}

uint64_t modpower(const unsigned int N, const unsigned int K, const unsigned int MOD)
{
    uint64_t ret = 1;
    uint64_t k2 = N;
    REP(i, 31)
    {
        if ((K >> i) & 0x1)
        {
            ret *= k2;
            ret = ret % MOD;
        }
        k2 = (k2 * k2) % MOD;
    }
    return ret;
}

class ModCombinationMemo
{
  public:
    const unsigned int N;
    const unsigned int MOD;
    vector<uint64_t> memo = {1};

    ModCombinationMemo(uint32_t N, uint32_t MOD)
        : N(N), MOD(MOD)
    {
    }

    uint64_t c(uint64_t k)
    {
        if (memo.size() > k)
        {
            return memo[k];
        }

        FOR(i, memo.size(), k + 1)
        {
            const auto number = (memo[i - 1] * (N - i + 1)) % MOD;
            const auto reverceDeon = modpower(i, MOD - 2, MOD);
            memo.push_back(number * reverceDeon % MOD);
        }

        return memo[k];
    }
};

uint64_t c(const unsigned int N, const unsigned int K, const unsigned int MOD)
{
    if (K == 0)
    {
        return 1;
    }

    uint64_t n = 1, k = 1;

    REP(i, K)
    {
        n *= N - i;
        k *= i + 1;

        n = n % MOD;
        k = k % MOD;
    }

    uint64_t powerk = modpower(k, MOD - 2, MOD);

    return (n * powerk) % MOD;
}

int main(int argc, char *argv[], char *envp[])
{
    int a, b; cin >> a >> b;
    cout << ((a <= 8 && b <= 8) ? "Yay!" : ":(") << endl;
}


Measured memory_bytes: 256
def main():
    n, k= map(int, input().split())
    a = list(map(int, input().split()))

    for i in range(1, n-k+1):
        if a[i - 1] < a[k+ i -1]:
            print('Yes')
        else:
            print('No')
            
    
if __name__ == '__main__':
    main()

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

#define rep(i,a,n) for (int i = a;i < n;i++)
#define per(i,n,a) for (int i = n-1;i >= a;i--)
 
typedef long long ll;
using namespace std;
 
int main(){
  int a[3];
  int c = 0;
  int count = 0;

  rep(i,0,3){
    cin >> a[i];
  }
  rep(i,0,3){
    if(a[i] == 5){
      count++;
    }
    else if(a[i] == 7){
      c++;
    }
  }
  if((count == 2) && (c == 1)){
    printf("YES\n");
  }
  else printf("NO\n");
  
  return 0;
}

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

#ifdef NON_SUBMIT
#define TEST(n) (n)
#define tout cerr
#else
#define TEST(n) ((void)0)
#define tout cin
#endif

using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
	TEST(freopen("input.txt","r",stdin));
	TEST(freopen("output.txt","w",stdout));
	TEST(freopen("debug.txt","w",stderr));
	int A, B, C;
	cin>>A>>B>>C;
	cout<<min({A+B,B+C,C+A})<<'\n';
	return 0;
}

Measured memory_bytes: 256