akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
using namespace std;



const long long int mod=1000000007;
const long long int INF=99999999999999999;

long long int n,m,res,di=1;
long double x[20],y[20],sum=0;
string str;
//階乗先に計算
long long int kaizyou[3000005] = { 1 };
long long int kai(long long int a, long long int b, long long int mod) {
	long long int tmp = 1;
	for (long long int i = a; i <= b; i++) {
		tmp *= i;
		tmp %= mod;

		kaizyou[i] = tmp;
	}
	return tmp;
}


//累乗(繰り返し2乗法)　aのb乗(mod)を求める。
long long int rui(long long int a, long long int b, long long mod) {
	int memo[65] = {};
	long long int A[65] = {};
	long long int tmp = 1;
	for (int i = 0; i < 65; i++) {
		memo[i] = b % 2;
		b /= 2;
	}

	A[0] = a;
	A[0] %= mod;

	for (int i = 1; i < 65; i++) {
		A[i] = A[i - 1] * A[i - 1];
		A[i] %= mod;
	}
	for (int i = 0; i < 65; i++) {
		if (memo[i] == 1) {
			tmp *= A[i];
			tmp %= mod;
		}
	}
	tmp %= mod;
	return tmp;
}

//コンビネーション計算
long long int comb(long long int n, long long int r, long long int mod) {
	long long int tmp;

	tmp = (kaizyou[n] * rui(kaizyou[r], mod - 2, mod)) % mod;
	tmp *= rui(kaizyou[n - r], mod - 2, mod);
	tmp %= mod;
	if (tmp < 0) { tmp = (mod - tmp) % mod; }
	return tmp;
}


int main() {
	cout << fixed << setprecision(10);
    cin>>n>>m;
    kai(1,3000000,mod);
    if((n+m)%3!=0||n>2*m||m>2*n){cout<<0;return 0;}
    sum=(n+m)/3;
    n-=sum;
    m-=sum;
    
    cout<<comb(n+m,n,mod);
} 


Measured memory_bytes: 23680
#include <stdio.h>

int main(void)
{
        int R;
        scanf("%d",&R);
        if(R<1200)printf("ABC\n");
        else if(R>=1200 && R<2800)printf("ARC\n");
        else if(R>=2800)printf("AGC\n");
        return 0;
}


Measured memory_bytes: 1648
#include <algorithm>
#include <iostream>
#include <string>
#include <random>
#include <cassert>
#include <cstring>
#include <chrono>
#include <set>
#include <map>

using namespace std;

typedef long long ll;

int main()
{
  string s;
  cin >> s;
  char cur = 'z';
  {
  int i = 0;
  while (i < s.size() && s[i] == 'z' - i) i++;
  if (i == 26) {
    cout << -1 << endl;
    return 0;
  }
  }

  vector<bool> used(256);
  for (char c : s) used[c] = true;
  char c = 'a';
  while (used[c]) c++;
  if (c <= 'z') {
    s += c;
    cout << s << endl;
    return 0;
  }

  used = vector<bool>(256);
  for (int i = s.size() - 1; i >= 0; --i) {
    for (char c = s[i] + 1; c <= 'z'; ++c) if (used[c]) {
      s[i] = c;
      for (int j = 0; j <= i; ++j) cout << s[j];
      cout << endl;
      return 0;
    }
    used[s[i]] = true;
  }

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
constexpr int64_t mod=1e9+7;

int main()
{
  int n;
  cin>>n;
  vector<pair<int,int>> pos(n);
  for(auto&& e: pos) 
  {
    cin>>e.first>>e.second;
  }
  vector<int> order;
  for (int i = 0; i < n; ++i)
  {
    order.push_back(i);
  }
  double sum;
  do{
    double dist=0;
    for (int i = 0; i < n-1; ++i)
    {
      pair<int,int> start,goal;
      start=pos[order[i]];
      goal=pos[order[i+1]];
      int dx=goal.first-start.first;
      int dy=goal.second-start.second;
      dist+=sqrt( dx*dx+dy*dy );
    }
    sum+=dist;
  }while(next_permutation(order.begin(), order.end()));
  int div=1;
  for (int i = 1; i <= n; ++i)
  {
    div*=i;
  }
  cout<<fixed<<setprecision(15);
  cout<<sum/div;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int n, i, j, ver, maior;
    cin >> n;
    int h[128];
    ver=1;
    for(i=0;i<n;i++){
        cin >> h[i];
    }

    maior=h[0];
    for(i=1;i<n;i++){
        if(h[i]>=h[i-1] and h[i]>=maior){
            ver++;
            maior=h[i];
        }
    }

    cout << ver << endl;

    return 0;
}



Measured memory_bytes: 256
q, w = map(int, input().split())
e, r = map(int, input().split())
t, y = map(int, input().split())
u, i = map(int, input().split())
a, s = map(int, input().split())
d, f = map(int, input().split())
g, h = map(int, input().split())


print(q - w)
print(e - r)
print(t - y)
print(u - i)
print(a - s)
print(d - f)
print(g - h)


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

namespace CPLib
{
    class Atria
    {
        static int x;
        static bool ans;
        static int[] dp;
        static int dpcnt;
        static void Main(string[] args)
        {
            x = int.Parse(ReadLine());
            ans = false;
            dp = Enumerable.Repeat(-1, x).ToArray();
            dpcnt = 0;
            dfs(x);
            WriteLine(ans?1:0);
        }

        static void dfs(int n )
        {
            if (n < 0) return;
            if (ans == true) return;
            if (dp.Contains(n)) return;
            if (n == 0)
            {
                ans = true;
                return;
            }
            dp[dpcnt] = n;dpcnt++;
            dfs(n - 100);
            dfs(n - 101);
            dfs(n - 102);
            dfs(n - 103);
            dfs(n - 104);
            dfs(n - 105);
        }
    }
}


Measured memory_bytes: 16056
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        AKIBA solver = new AKIBA();
        solver.solve(1, in, out);
        out.close();
    }

    static class AKIBA {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            String base = "KIHBR";
            String base2 = "KIH";
            String base3 = "AA";
            String fin = "AKIHABARA";
            String s = in.next();

            String T = s.replaceAll("A", "");
            boolean ans = true;
            ans &= s.length() <= fin.length();
            ans &= base.equals(T);
            ans &= !s.contains(base3);
            ans &= s.contains(base2);

            out.println(ans ? "YES" : "NO");
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

    }
}



Measured memory_bytes: 23380
using System;
using System.Collections.Generic;

namespace abc142_d
{
  class Program
  {
    static void Main(string[] args)
    {
      var a = CIn.ReadLong();
      var b = CIn.ReadLong();

      var gcd = Gcd(a, b);
      var primeFactors = PrimeFactors(gcd);

      var ans = 1;

      if (primeFactors.Count > 0)
      {
        ans++;
      }

      for (var i = 1; i < primeFactors.Count; i++)
      {
        if (primeFactors[i - 1] != primeFactors[i])
        {
          ans++;
        }
      }

      Console.WriteLine(ans);
    }

    static long Gcd(long a, long b)
    {
      while (b != 0)
      {
        var mod = a % b;

        a = b;
        b = mod;
      }
      return a;
    }

    static List<long> PrimeNumbers(long n)
    {
      var list = new List<long>();
      var sieve = new bool[n + 1];

      for (var i = 2; i <= n; i++)
      {
        if (!sieve[i])
        {
          list.Add(i);

          for (var j = i * 2; j <= n; j += i)
          {
            sieve[j] = true;
          }
        }
      }

      return list;
    }

    static List<long> PrimeFactors(long n)
    {
      var list = new List<long>();
      var primeNumbers = PrimeNumbers((long)Math.Sqrt(n));

      foreach (var p in primeNumbers)
      {
        if (n == 1)
        {
          break;
        }

        while (n % p == 0)
        {
          n /= p;
          list.Add(p);
        }
      }

      if (n > 1)
      {
        list.Add(n);
      }

      return list;
    }
  }

  class CIn
  {
    private static readonly Queue<string> fieldBuffer = new Queue<string>();

    public static string Read()
    {
      if (fieldBuffer.Count == 0)
      {
        foreach (var field in Console.ReadLine().Split())
        {
          fieldBuffer.Enqueue(field);
        }
      }

      return fieldBuffer.Dequeue();
    }

    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());

    public static string[] ReadStringArray(long n)
    {
      var array = new string[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = Read();
      }

      return array;
    }

    public static int[] ReadIntArray(long n)
    {
      var array = new int[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadInt();
      }

      return array;
    }

    public static long[] ReadLongArray(long n)
    {
      var array = new long[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadLong();
      }

      return array;
    }
    public static double[] ReadDoubleArray(long n)
    {
      var array = new double[n];

      for (var i = 0; i < n; i++)
      {
        array[i] = ReadDouble();
      }

      return array;
    }
  }
}

Measured memory_bytes: 15712
s = input()

a = int(s[:2])
b = int(s[2:])

ans = []

if ((1 <= b) and (b <= 12)) and ((1 <= a) and (a <= 12)):
    print("AMBIGUOUS") 
elif (1 <= b) and (b <= 12):
    print("YYMM")
elif (1 <= a) and (a <= 12):
    print("MMYY")
else:
    print("NA")

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int n= scan.nextInt();
		scan.close();
		int cnt = 0;
		for(int i = 1; i <=n; i++) {
			int digit = String.valueOf(i).length();
			if(digit % 2 == 1) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}

}

Measured memory_bytes: 28244
N = int(input())
n = 1e5
for i in range(1, N):
    A = i
    B = N - A
    s = 0
    while A > 0:
        s += A % 10
        A = int(A / 10)
    while B > 0:
        s += B % 10
        B = int(B / 10)
    n = min(n, s)
print(n)

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz(x) (ll)((x).size())
#define pb push_back
#define mp make_pair 
#define bg begin()
#define ed end()
#define all(x) (x).bg,(x).ed
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
const ll MOD=1000000007;
const ll INF=1000000000000000;

struct UnionFind{
    vector<ll> par,Rank;

    UnionFind(ll N):par(N+1),Rank(N+1,0){
        rep1(i,N) par[i]=i; //親を自分自身として初期化
    }

    ll find(ll x){
        if(par[x]==x){
            return x;
        }
        else {
            return  par[x]=find(par[x]);
        }
    }
    void unite(ll x,ll y){
        x=find(x);
        y=find(y);
        if(x==y) return;

        if(Rank[x]<Rank[y]){
            par[x]=y;
        }
        else{
            par[y]=x;
            if(Rank[x]==Rank[y]) Rank[x]++;
        }
    }
    bool same(ll x,ll y){
        return find(x)==find(y);
    }
};

int main(){
	ll N,M; cin>>N>>M;
	
	UnionFind tree(N);

	rep(i,M){
		ll x,y,z; cin>>x>>y>>z;
		if(!tree.same(x,y)) tree.unite(x,y);//元々違う属だったが、ここで併合
	}

	ll cnt=0;
	rep1(i,N){
		if(i==tree.find(i)) cnt++;//最終的な属の数
	}
	cout<<cnt;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <utility>
#include <functional>
#include <deque>
#include <cctype>
#include <stack>
#include <bitset>
#include <cstdio>
using namespace std;

int main() {
	int N,i,j,k,l,m,n,o,p,sum,cnt;
  long long int A[100000];
  long long int B[100000]={};
  scanf("%d",&N);
  cnt=0;
  sum=0;
  for(i=0;i<N;i++){
    scanf("%lld",&A[i]);}
  sort(A,A+N);
  for(i=0;i<N;i++){
    if(A[i]>N){
      cnt++;}
    else{
      B[A[i]]++;}}
  for(i=0;i<=N;i++){
    if(B[i]>i){
      sum+=B[i]-i;}
    else if(B[i]<i){
      sum+=B[i];}}
  printf("%d",sum+cnt);
  return 0;
}


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

int		main(void)
{
	int		A;
	char	op;
	int		B;

	cin>>A>>op>>B;
	if (op == '+')
		cout<<A + B<<endl;
	else
		cout<<A - B<<endl;
	return (0);
}

Measured memory_bytes: 256
red, green, blue = map(int, input().split())
k = int(input())

ans = 'No'

while k != 0:
    if blue > green > red:
        ans = 'Yes'
        break
    elif blue <= green or blue <= red:
        blue *= 2
    elif green <= red:
        green *= 2
    k -= 1

if blue > green > red:
    ans = 'Yes'

print(ans)


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

int main(){
	//cin.tie(0),ios::sync_with_stdio(false);
	int n;
	cin>>n;
	vector<int>v(n,0);
	for(int i=0,tmp;i<n;++i){
		cin>>tmp;
		++v.at(tmp);
	}
	int i,ans=1;
	if(n%2==1&&v.at(0)==1)i=2;
	else i=1;
	for(;i<n;i+=2){
		if(v.at(i)!=2||v.at(i-1)!=0)break;
		ans*=2;
		ans%=1000000007;
	}
	if(i-1==v.size())cout<<ans<<"\n"s;
	else cout<<"0\n"s;
}

Measured memory_bytes: 640
// #pragma GCC optimize(3, "Ofast", "inline")
#include <bits/stdc++.h>
#define String std::string
#define fi first
#define se second
#define mp std::make_pair
#define Pair std::pair<int, int>
#define Map std::map< int, int >
#define Vector std::vector<int>
 
using std::cin;
using std::cout;
using std::endl;
 
typedef long long ll;
typedef unsigned long long ull;
 
const int N = 100000 + 5;
const int M = 1000 + 5;
const int K = 1e7 + 5;
const int MOD = 1e9 + 7;
const int inv2 = 500000004;
const int LOG = 40;
const ull BASE = 19260817;
const int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };
const int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };
const double PI = acos(-1);
 
template<class T>
inline T readT() {
    T res = 0, f = 1;
    char ch = getchar();
    for (; !isdigit(ch); ch = getchar()) if (ch == '-') f = -1;
    for (; isdigit(ch); ch = getchar()) res = (res << 1) + (res << 3) + ch - '0';
    return res * f;
}
#define read readT<int>

struct Tuple {
    int be, yr, idx;
    bool operator<(const Tuple &other) {
        if (be != other.be) return be < other.be;
        return yr < other.yr;
    }
} t[N];

int n, m;
int fir[N];
Pair ans[N];

inline int calc(int x) {
    if (!x) return 1;
    int res = 0;
    while (x) {
        res++;
        x /= 10;
    }
    return res;
}

int main() {
    scanf("%d %d", &n, &m);
    for (int i = 1; i <= m; i++) {
        scanf("%d %d", &t[i].be, &t[i].yr);
        t[i].idx = i;
    }
    std::sort(t + 1, t + m + 1);
    for (int i = 1; i <= m; i++) {
        int be = t[i].be, yr = t[i].yr, idx = t[i].idx;
        if (!fir[be]) fir[be] = i;
        ans[idx].fi = be, ans[idx].se = i - fir[be] + 1;
    }
    for (int i = 1; i <= m; i++) {
        int la = calc(ans[i].fi), lb = calc(ans[i].se);
        for (int j = 1; j <= 6 - la; j++) putchar('0');
        printf("%d", ans[i].fi);
        for (int j = 1; j <= 6 - lb; j++) putchar('0');
        printf("%d\n", ans[i].se);
    }
    return 0;
}

Measured memory_bytes: 3840
x=int(input())
chk=0
ans=0
for i in range(1,(round(x**0.5)//1)+1):
	if x%i==0:
		chk=i
ans=x//chk
for i in range(10):
	if 10**i<=ans and 10**(i+1)>ans:
		print(i+1)
		break

Measured memory_bytes: 3060
# 14　Square869120Contest #4 B - Buildings are Colorful!
import itertools, math
n = int(input())
xy = [list(map(int, input().split())) for _ in range(n)]
ans = 0
for i in itertools.permutations(range(n)):
    for j in range(len(i)-1):
        ans += pow(pow(xy[i[j]][0]-xy[i[j+1]][0], 2) + pow(xy[i[j]][1]-xy[i[j+1]][1], 2), 0.5)
print(ans/math.factorial(n))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for (ll i = m; i < n; i++)
#define IFOR(i, m, n) for (ll i = n - 1; i >= m; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define FOREACH(x, a) for (auto&(x) : (a))
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) ll(x.size())

int main() {
  ll n, m;
  cin >> n >> m;
  cout << (n==m ? "Yes" :"No") << endl;
}

Measured memory_bytes: 256
#![allow(unused_imports)]

use std::{cmp, fmt};
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
use std::io::{self, BufRead, BufWriter, Write};
use std::ops::{Add, Div, Mul, Sub};
use std::str::{self, FromStr};

fn main() {
    let (n, a): (usize, Vec<i32>) = {
        let stdin = io::stdin();
        let mut sc = Scanner::new(stdin.lock(), 1024);
        let n = sc.next();
        (n, sc.vec(n))
    };
    let b = {
        let mut b: Vec<_> = vec![0];
        b.extend(&a);
        b.push(0);
        b
    };
    let s = (0..n + 1).map(|i| dist(b[i], b[i + 1])).sum::<u64>();
    for i in 1..n + 1 {
        let r = s - dist(b[i - 1], b[i]) - dist(b[i], b[i + 1]) + dist(b[i - 1], b[i + 1]);
        println!("{}", r);
    }
}

fn dist(a: i32, b: i32) -> u64 {
    (a - b).abs() as u64
}

struct Scanner<R: BufRead> {
    reader: R,
    buf: Vec<u8>,
    pos: usize,
}

#[allow(dead_code)]
impl<R: BufRead> Scanner<R> {
    fn new(reader: R, capacity: usize) -> Self {
        Scanner {
            reader: reader,
            buf: Vec::with_capacity(capacity),
            pos: 0,
        }
    }

    fn next<T: FromStr>(&mut self) -> T
    where
        T::Err: fmt::Debug,
    {
        if self.buf.is_empty() {
            self._read_next_line();
        }
        let mut start = None;
        loop {
            match (self.buf[self.pos], start.is_some()) {
                (b' ', false) => self.pos += 1,
                (b'\n', false) => self._read_next_line(),
                (_, false) => start = Some(self.pos),
                (b' ', true) | (b'\n', true) => break,
                (_, true) => self.pos += 1,
            }
        }
        let target = &self.buf[start.unwrap()..self.pos];
        unsafe { str::from_utf8_unchecked(target) }.parse().unwrap()
    }

    fn _read_next_line(&mut self) {
        self.buf.clear();
        self.reader.read_until(b'\n', &mut self.buf).unwrap();
        self.pos = 0;
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T>
    where
        T::Err: fmt::Debug,
    {
        (0..n).map(|_| self.next()).collect()
    }

    fn pairs<T1: FromStr, T2: FromStr>(&mut self, n: usize) -> Vec<(T1, T2)>
    where
        T1::Err: fmt::Debug,
        T2::Err: fmt::Debug,
    {
        (0..n).map(|_| (self.next(), self.next())).collect()
    }

    fn trios<T1: FromStr, T2: FromStr, T3: FromStr>(&mut self, n: usize) -> Vec<(T1, T2, T3)>
    where
        T1::Err: fmt::Debug,
        T2::Err: fmt::Debug,
        T3::Err: fmt::Debug,
    {
        (0..n)
            .map(|_| (self.next(), self.next(), self.next()))
            .collect()
    }

    fn mat<T: FromStr>(&mut self, m: usize, n: usize) -> Vec<Vec<T>>
    where
        T::Err: fmt::Debug,
    {
        (0..m).map(|_| self.vec(n)).collect()
    }

    fn strings_as_mat<T, F: FnMut(u8) -> T>(&mut self, h: usize, mut f: F) -> Vec<Vec<T>> {
        (0..h)
            .map(|_| {
                self._read_next_line();
                let n = self.buf.len();
                self.buf[..n - 1].iter().map(|&c| f(c)).collect()
            })
            .collect()
    }
}


Measured memory_bytes: 7036
import std.stdio, std.string, std.conv;
import std.typecons;
import std.algorithm, std.array, std.range, std.container;
import std.math;

void main() {
    auto N = readln.split[0].to!ulong;
    auto A = readln.split.to!(ulong[]);
    auto grps = sort(A.dup).group;
    size_t[ulong] nums;
    
    //grps.array.writeln;
    
    foreach (tup; grps) {
        nums[tup[0]] = tup[1];
    }
    //nums.writeln; 
    
    ulong all_num = grps.map!(a => a[1] * (a[1]-1)).sum / 2;
    ulong all_num_true = nums.values.dup.map!(a => a*(a-1)).sum / 2;
    
    int[] re; re.length = N;
    if (all_num > all_num_true) {
        re[N+1] = 1;    // run-time error
    }
    else if (all_num < all_num_true) {
        if (
            equal(
                 sort(grps.map!(a => a[1] * (a[1]-1)).array),
                 sort(nums.values.dup.map!(a => a*(a-1)).array)
             )
        )  writeln("WA");
    }
    
    foreach (k; 0 .. N) {
        writeln( all_num_true - (nums[A[k]] - 1) );
    }
}



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

int main() {
    int X;
    cin >> X;
    bool judge = false;
    for (int i = 0; i < 1e5; i++) {
        if (100*i <= X && X <= 105*i) { judge = true; break; }
    }
    
    cout << ((judge) ? 1 : 0) << endl;
    return 0;
}

Measured memory_bytes: 256
import fractions
n, m = [int(item) for item in input().split()]
s = input().rstrip()
t = input().rstrip()

length = n * m // fractions.gcd(n, m)
freq = (length // n * length // m) // fractions.gcd(length // n, length // m)
for i in range(length // freq):
    if s[i * (length//m)] != t[i * (length//n)]:
        print(-1)
        exit()
print(length)

Measured memory_bytes: 5344
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#define maxn 505
using namespace std;
typedef long long ll;
int H,W,h,w;
ll a[maxn][maxn];
int main()
{
    cin>>H>>W>>h>>w;
    for(int i=1;i<=H;i++)
    {
        for(int j=1;j<=W;j++)
        {
            if(i%h==0&&j%w==0)  a[i][j]=-4000*h*w+3999;
        }
    }
    long long sum=0;
    for(int i=1;i<=H;i++)
    {
        for(int j=1;j<=W;j++)
        {
            if(a[i][j]==0)  sum+=4000,a[i][j]=4000;
            else sum+=(ll)a[i][j];
        }
    }
    if(sum<=0)  puts("No");
    else{
        puts("Yes");
        for(int i=1;i<=H;i++)
        {
            for(int j=1;j<=W;j++)  printf("%d ",a[i][j]);
            puts("");
        }
    }
    return 0;
}

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

int main()
{
  int N,M;
  cin >> N >> M;
  vector<int> broken(N);
  rep(i,M) {
    int w;
    cin >> w;
    broken[w]=1;
  }
  vector<int> a(N+2);
  a[N]=1;
  for(int i=N-1;i>=0;i--){
    if(broken[i]){
      a[i]=0;
    }else{
      a[i]=(a[i+1]+a[i+2])%1000000007;
    }
  }
  int ans = a[0];
  cout << ans << endl;
}

Measured memory_bytes: 1024
// Package main provides
//
// File:  a.go
// Author: ymiyamoto
//
// Created on Wed Jan  9 09:18:51 2019
//
package main

import "fmt"

func abs(a int) int {
	if a < 0 {
		return -a
	}
	return a
}

func main() {
	var x, a, b int
	fmt.Scan(&x, &a, &b)
	if abs(x-a) < abs(x-b) {
		fmt.Println("A")
	} else {
		fmt.Println("B")
	}
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <cstring>
#include <sstream>
using namespace std;

int ar[11], ag[11], ab[11];
bool checked[59049];
int p3[11];
map<int,int> change = {
    {0,0}, {1,8}, {2,4}, {3,8}, {4,4}, {5,0}, {6,4}, {7,0}, {8,8}
};

int conv(string s) {
    int ret = 0;
    for (int i=0; i<(int)s.size(); ++i) {
        ret *= 3;
        if (s[i] == 'g') ret += 1;
        if (s[i] == 'b') ret += 2;
    }
    return ret;
}

int main() {
    p3[0] = 1;
    for (int i=1; i<=10; ++i) {
        p3[i] = p3[i-1] * 3;
    }
    ar[0] = ag[0] = ab[0] = 0;
    for (int i=1; i<=10; ++i) {
        ar[i] = ar[i-1];
        ag[i] = ag[i-1] * 3 + 1;
        ab[i] = ab[i-1] * 3 + 2;
    }
    string s;
    while (cin >> s, s != "0") {
        memset(checked, false, sizeof checked);
        int n = s.size();
        int first = conv(s);
        queue<pair<int,int> > q;
        q.push(make_pair(first, 0));
        checked[first] = true;
        int res = -1;
        while ( ! q.empty()) {
            int col = q.front().first;
            int t = q.front().second;
            q.pop();
            if (col == ar[n] || col == ag[n] || col == ab[n]) {
                res = t;
                break;
            }
            for (int i=0; i<n-1; ++i) {
                int replace = change[(col / p3[i]) % 9];
                int nx = (col / p3[i+2]) * p3[i+2] + replace * p3[i] + (col % p3[i]);
                if ( ! checked[nx]) {
                    q.push(make_pair(nx, t+1));
                    checked[nx] = true;
                }
            }
        }
        if (res < 0) {
            cout << "NA" << endl;
        } else {
            cout << res << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 1304
import java.math.BigInteger

val MOD = 1000000007L
val BMOD = BigInteger.valueOf(MOD)

fun main(args: Array<String>) {
    val (h, w, a, b) = readLine()!!.split(' ').map(String::toLong)
    var ans = 0L
    val n1 = h - a - 1 + b
    val n2 = w - b - 1 + a
    var k1 = b
    var k2 = a
    var c1 = c(n1, k1)
    var c2 = c(n2, k2)
    while (true) {
        ans = (ans + mult(c1, c2)) % MOD
        k1++; k2++
        if (k1 > n1 || k2 > n2) break
        c1 = div(mult(c1, n1 - k1 + 1), k1)
        c2 = div(mult(c2, n2 - k2 + 1), k2)
    }
    println(ans)
}

fun mult(a : Long, b : Long) = (a * b) % MOD
fun div(a : Long, b : Long) = mult(a, BigInteger.valueOf(b).modInverse(BMOD).toLong())

fun c(n : Long, k : Long) : Long {
    var ch = 1L
    var zn = 1L
    for (i in (n - k + 1)..n) ch = mult(ch, i)
    for (i in 1..k) zn = mult(zn, i)
    return div(ch, zn)
}


Measured memory_bytes: 37216
//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
//-----------------------------------------
#define ifYN(x) cout<<(x?"Yes":"No")<<"\n" 
#define dcml(n) fixed<<setprecision(n)

 
ll GCD(ll a,ll b) { return b ? GCD(b,a%b) : a; } 
ll LCM(ll a,ll b) { return a/GCD(a,b)*b; } 
ll Factorial(ll n){ ll m=1;while(n>=1)m*=n--;return m; } 
ll modPow(ll x,ll n,ll mod=MOD){ 
    return (!n?1:!n%2?modPow(x*x,n/2,mod)%mod:x%mod*modPow(x,n-1,mod)%mod); 
} 
using namespace std;
//-------------------------------------------
typedef pair<ll,ll> P;
int main(void){
    ll N;cin>>N;
    vector<ll> a(N);
    REP(i,N) cin >> a[i];
    ll cnt=0;
    REP(i,N)while(a[i]%2==0)a[i]/=2,cnt++;
    cout<<cnt<<"\n";
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
const int maxn=100010;
inline int BobEven(int n,int *A)
{
    int mid=n/2;
    int Ans=A[mid+1]-A[1];
    for(int i=2;i<=mid;i++)
        Ans=min(Ans,A[mid+i]-A[i]);
    return Ans;
}
inline int AliceOdd(int n,int *A)
{
    int mid=n/2;
    for(int i=mid+1;i<n;i++)A[i]=A[i+1];
    return BobEven(n-1,A);
}
inline bool Check(int n,int *A,int v)
{
    int cnt=0;
    for(int i=1,j=1;i<=n;i=j+1,j=i,cnt++)
        while(j<n && A[j+1]-A[i]<v)j++;
    return (cnt>(n/2));
}
inline int AliceEven(int n,int *A)
{
    int L=1,R=A[n]-A[1];
    while(L+1<R)
    {
        int mid=(L+R)>>1;
        if(Check(n,A,mid))L=mid;
        else R=mid-1;
    }
    return Check(n,A,R)?R:L;
}
inline int BobOdd(int n,int *A)
{
    
    return min(AliceEven(n-1,A),AliceEven(n-1,A+1));
}
int n;
int A[maxn];
int main()
{
    int n,Ans;
    string S;
    cin>>n>>S;
    for(int i=1;i<=n;i++)
        cin>>A[i];
    if(S[0]=='A')Ans=n&1?AliceOdd(n,A):AliceEven(n,A);
    else Ans=n&1?BobOdd(n,A):BobEven(n,A);
    cout<<Ans<<endl;
    return 0;
}
 

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define yorn(f) cout<<((f)?"Yes":"No")<<endl;
#define YORN(f) cout<<((f)?"YES":"NO")<<endl;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, n) for (int i = 1; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define put(x) cout << x << endl;
#define println(x) cout << x << endl;
using namespace std;
int main()
{
    ll n;
    cin >> n;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];

    while (true) {
        ll mind = -1;
        ll mi = 1e10;
        ll live = 0;

        rep (i, n) if (a[i] > 0) {
            live++;
            if (a[i] < mi) {
                mind = i;
                mi = a[i];
            }
        }

        if (live <= 1) {
            put(mi);
            return 0;
        }

        rep (i, n) { 
            if (i != mind) {
                a[i] = a[i] % mi;
            }
        }
    }

    return 0;
}

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

int main() {
    string S;
    int ans = 0;
    cin >> S;
    if (S.at(1) == 'S') {
        if (S.at(0) == 'R' || S.at(2) == 'R') ans = 1;
        else ans = 0;
    } else {
        for (int i=0;i<3;i++) {
            if (S.at(i) == 'R') ans += 1;
        }
    }
    cout << ans << endl;
    
}


Measured memory_bytes: 3512
"""
N = int(input())
A, B = map(int,input().split())
lst = [list(map(int,input().split())) for i in range(M)]
A = list(map(int,input().split()))
"""

N = int(input())
B = list(map(int,input().split()))

A = [B[0]]
for i in range(N-2):
  A.append(min(B[i], B[i+1]))
else:
  A.append(B[-1])
  
print(sum(A))

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

int main() {
  string s;
  cin >> s;

  int size = s.size();

  int ans = 0;
  int tmp = 0;
  for (int i = 0; i < size; i++) {
    if ((s[i] == 'A') || (s[i] == 'C') || (s[i] == 'G') || (s[i] == 'T')) {
      ans++;
      tmp = max(tmp, ans);
    } else {
      ans = 0;
    }
  }

  cout << tmp << endl;
  return 0;
}

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


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

  int x;
  cin >> x;
  if(x>=30) cout << "Yes" << endl;
  else cout << "No" << endl;
  
  
  return 0;
    

}


Measured memory_bytes: 3592
/*
confirm 0LL and 1LL
confirm cornercases such as 0
confirm times of cin < 10^6
*/
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<P>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using VecVec = vector<Vec>;
using Graph = vector<VecP>;
template <typename T>
using Vec1 = vector<T>;
template <typename T>
using Vec2 = vector<Vec1<T> >;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPN(i, m, n) for(ll (i) = (m); (i) <= (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m)-1; (i) >= (n); --(i))
#define REPNR(i, m, n) for(ll (i) = (m); (i) >= (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define repn(i, n) REPN(i, 1, n)
#define repr(i, n) REPR(i, n, 0)
#define repnr(i, n) REPNR(i, n, 1)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}
template <typename T>
ll pow2(const T n){return (1LL << n);}
template <typename T>
void cosp(const T n){cout << n << ' ';}
template <typename T>
void co(const T n){cout << n << endl;}
template <typename T1, typename T2>
void co(pair<T1, T2> p){cout << p.fs << ' ' << p.sc << endl;}
template <typename T>
void co(const Vec1<T> &v){for(T i : v) cosp(i); cout << endl;}
template <typename T>
void co(initializer_list<T> v){for(T i : v) cosp(i); cout << endl;}
template <typename T>
void ce(const T n){cerr << n << endl;}
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;

int main(void){
	string s, t;
	cin >> s >> t;
	ll a, b;
	cin >> a >> b;
	string u;
	cin >> u;

	if(s == u) a--;
	else b--;

	co({a, b});

	return 0;
}


Measured memory_bytes: 256
n, a, b = map(int, input().split(" "))

ans = 0
for i in range(1, n + 1):
    temp = str(i)
    sume = 0
    for j in range(len(temp)):
        sume += int(temp[j])
    if sume <= b and sume >= a:
        ans += i

print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
using namespace std;
int vx[4]={1,0,-1,0};
int vy[4]={0,1,0,-1};
int vx2[4]={2,0,-2,0};
int vy2[4]={0,2,0,-2};
int main(){
  string str;
  int x,y,s;
  int Map[10][10];
  for(int i=0;i<10;i++)
    for(int j=0;j<10;j++)
      Map[i][j]=0;
  while(cin>>str){
    x=str[0]-'0';
    y=str[2]-'0';
    s=str[4]-'0';
    switch(s){
    case 1:
      Map[x][y]++;
      for(int i=0;i<4;i++)
	if(x+vx[i]<=9&&x+vx[i]>=0&&y+vy[i]<=9&&y+vy[i]>=0)
	  Map[x+vx[i]][y+vy[i]]++;
      break;
    case 2:
      for(int i=-1;i<=1;i++){
	for(int j=-1;j<=1;j++){
	  if(x+i<=9&&x+i>=0&&y+j<=9&&y+j>=0)
	    Map[x+i][y+j]++;
	}
      }
      break;
    case 3:
      for(int i=-1;i<=1;i++){
	for(int j=-1;j<=1;j++){
	  if(x+i<=9&&x+i>=0&&y+j<=9&&y+j>=0)
	    Map[x+i][y+j]++;
	}
      }
      for(int i=0;i<4;i++)
	if(x+vx2[i]<=9&&x+vx2[i]>=0&&y+vy2[i]<=9&&y+vy2[i]>=0)
	  Map[x+vx2[i]][y+vy2[i]]++;
      break;
    }
    /* for(int i=0;i<10;i++){
      for(int j=0;j<10;j++){
	cout<<Map[i][j]<<" ";
      }
      cout<<endl;
      }*/
  }
  int white=0;
  int Max=0;
  for(int i=0;i<10;i++){
    for(int j=0;j<10;j++){
      if(Map[i][j]==0)
	white++;
      Max=max(Max,Map[i][j]);
    }
  }
  cout<<white<<endl<<Max<<endl;
  return 0;
}

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


class Program
{
    static void Main(string[] args)
    {
        var n = Console.ReadLine();
        var a = Console.ReadLine().Split(' ');

        var list = new SortedDictionary<int, int>();
        for (var i = 0; i < a.Length; i++)
        {
            list.Add(int.Parse(a[i]), i + 1);
        }

        Console.Write(string.Join(" ", list.Values));
    }
}

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

int func(int a, int b)
{
    if (a == 1) a += 13;
    if (b == 1) b += 13;

    if (a > b) return 0;
    if (a == b) return 1;
    return 2;
}

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

    const char str[3][6] = {"Alice", "Draw", "Bob"};
    cout << str[func(a, b)] << endl;

    return 0;
}

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

int main() {
  string s;
  cin >> s;

  int k;
  cin >> k;

  vector<string> c(k);
  int size = s.size();

  for(int i=0; i<k; i++) c[i] = "zzzzz";
  for(int i=0; i<size; i++){
    if(c[k-1] > s.substr(i,1)){
      for(int j=1; j<=k || i+j <= k; j++){
        if(c[k-1] > s.substr(i,j)){
          auto itr = find(c.begin(), c.end(), s.substr(i,j));
          if (itr == c.end()){
            c[k-1] = s.substr(i,j);
            sort(c.begin(), c.end());
          }
        }
      }
    }
  }
  cout << c[k-1] << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void _main()
{
    ll A, B, C;
    cin >> A >> B >> C;
    if (A % 2 == 0 || B % 2 == 0 || C % 2 == 0)
    {
        cout << 0 << endl;
    }
    else
    {
        if (max({A, B, C}) == A)
        {
            cout << B * C << endl;
        }
        else if (max({A, B, C}) == B)
        {
            cout << C * A << endl;
        }
        else
        {
            cout << A * B << endl;
        }
    }
}


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

int main(){
    int a, b, c, k;
    cin >> a >> b >> c >> k;

    queue<vector<int>> que;
    vector<int> vec = {a, b, c, k};
    que.push(vec);
    bool ans = false;

    while(!que.empty()){
        vector<int>v = que.front();
        que.pop();
        if(v[0] < v[1] && v[1] < v[2]){
            ans = true;
            break;
        }else if(v[3]>0){
            vector<int>v1 = {v[0]*2, v[1], v[2], v[3]-1};
            vector<int>v2 = {v[0], v[1]*2, v[2], v[3]-1};
            vector<int>v3 = {v[0], v[1], v[2]*2, v[3]-1};
            que.push(v1);
            que.push(v2);
            que.push(v3);
        }
    }

    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
    
}

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

int main() {
	int n;
	cin >> n;
	vector<int> A(n), B(n), perm(n);
	for (int i = 0; i < n; ++i)
		cin >> A[i];
	for (int i = 0; i < n; ++i)
		cin >> B[i];
	for (int i = 0; i < n; ++i)
		perm[i] = i + 1;
	
	int a, b, cnt = 1;
	do {
		if (A == perm)
			a = cnt;
		if (B == perm)
			b = cnt;
		cnt++;
	} while (next_permutation(perm.begin(), perm.end()));
	cout << abs(a - b) << endl;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define rint register int
#define rep(i,a,b) for (rint i=(a),_E=(b); i<=_E; ++i)
#define per(i,a,b) for (rint i=(a),_E=(b); i>=_E; --i)
#define REP(i,n) for (rint i=(0),_E=(n); i<_E; ++i)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

const int N = 100005;
priority_queue<int> Q;
int n, res;
pii a[N];
ll now;

int main() {
	scanf("%d", &n);
	rep (i, 1, n) {
		scanf("%d%d", &a[i].fi, &a[i].se);
		a[i].fi += a[i].se;
	}
	sort(a + 1, a + n + 1);
	rep (i, 1, n) {
		now += a[i].se;
		Q.push(a[i].se);
		if (now > a[i].fi) {
			now -= Q.top();
			Q.pop();
		}
	}
	cout << Q.size() << endl;
	return 0;
}

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

int main(void){
    vector<int> vec(3);
    cin >> vec.at(0) >> vec.at(1) >> vec.at(2);

    int ans = 0;

    while(1){
        sort(vec.begin(), vec.end());
        if(vec.at(1) - vec.at(0) > 1){
            vec.at(0) += 2;
            ans++;
            continue;
        }else if(vec.at(1) - vec.at(0) == 1){
            vec.at(1) -= 1;
            ans++;
            continue;
        }else if(vec.at(1) - vec.at(0) == 0){
            if(vec.at(2) - vec.at(1) > 1){
                vec.at(1) += 2;
                ans++;
                continue;
            }else if(vec.at(2) - vec.at(1) == 1){
                vec.at(2) -= 1;
                ans++;
                continue;
            }else{
                break;
            }
        }
    }

    cout << ans << endl;

    return 0;
}

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


/// File input & output /////
#define fRead(x)        freopen("x.txt","r",stdin)
#define fWrite(x)       freopen ("x.txt","w",stdout)

#define mt              make_tuple
#define ld              long double
#define ll              long long
#define ull             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define INF             2e16
#define PI              acos(-1.0)
#define mp              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>


#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())


#define FASTIO        ios_base::sync_with_stdio(0);cin.tie(nullptr);




///..................Sort by second element in a pair in decending order............. ///
bool SortbySecDesc(const pair<long long,long long > &a, const pair<long long,long long > &b)
{
    return a.second>b.second;
}

///.........................first element of pair in descending order..........................//////
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
    return (a.first > b.first);
}



///.............................................................TEMPLATE................................................./////


//long long  Prime[3000000],nPrime;
//long long  mark[10000002];
//
//void seive(long long int n)
//{
//	long long int i,j,limit=sqrt(n*1.0)+2;
//	mark[1]=1;
//	for(i=4; i<=n ;i+=2)
//	mark[i]=1;
//	Prime[nPrime++]=2;
//	for(i=3; i<=n; i+=2)
//	{
//		if(!mark[i])
//		{
//			Prime[nPrime++]=i;
//			if(i<=limit)
//			{
//				for(j=i*i; j<=n ;j+=i*2)
//				{
//					mark[j]=1;
//				}
//			}
//		}
//	}
//}


ll br[2000009];





int main()
{
    FASTIO;

    ll n;

    cin >> n;






    for(int i=0; i<n; i++)
    {
        ll a;

        cin >> a;

        br[a]++;
    }

    ll ans = 0;


    vector<ll>vis(1000005,0);





    for(int i=1; i<=1000000; i++)
    {
        if(br[i]==0 || vis[i])
        {
            continue;
        }

        if(br[i]==1 && !vis[i])
            ans++;

        for(int j=i; j<=1000000; j+=i)
            vis[j] = 1;
    }



    cout << ans << endl;




    return 0;
}



Measured memory_bytes: 18784
N = int(input())
S_list = list(input())

max_count = 0  
for i in range(N):
  l = S_list[i:]
  cs = set(S_list[0:i])
  
  count = 0
  for s in cs:
    if s in l:
      count += 1
    if count > max_count:
      max_count = count
print(max_count)
  

Measured memory_bytes: 2940
// If you want something you've never had, you must be willing to do something you've never done

#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

typedef pair<int,int> ii;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef tree<pair<int,int>, null_type,less<pair<int, int> >,rb_tree_tag,tree_order_statistics_node_update > pbds;

#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<endl;
#define debug4(x,y,z,w) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\t"<<#w<<" :: "<<w<<endl;
#define ROUNDOFFINT(d) d = (int)((double)d + 0.5)

#define pb push_back
#define ft first
#define sd second
#define all(c)    (c).begin(),(c).end()
#define tr(c,i)   for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x)   ((c).find(x) != (c).end())
#define IOS ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

ll poww(ll a,ll b){ll res=1;while(b){if(b&1){res*=a;}a=a*a;b>>=1;}return res;}
ll poww(ll a,ll b,ll mod){ll res=1;while(b){if(b&1){res*=a;res%=mod;}a=a*a;a%=mod;b>>=1;}return res;}

const int INF = 2e9 ;
const int dx[] = {-1,0,0,1};
const int dy[] = {0,-1,1,0};
const int lg = 21;
const ll MOD = 1e9 + 7;
#define int ll
int n, m;
const int N = 1e5 + 5;


signed main() {
    int n;
    cin >> n;
    double a[n + 4];
    for(int i=1; i<=n; i++) {
        cin >> a[i];
        a[i] = 1.0/a[i];
        a[i] += a[i-1];
    }
    ld ans = 1.0/a[n];
    cout << fixed << setprecision(10) << ans << '\n';
    return 0;
}


Measured memory_bytes: 256
N, T = map(int, input().split())
*t, = map(int, input().split())
ans = 0
s, e = t[0], t[0]+T
for i in range(1, N):
    if t[i] <= e:
        e = t[i] + T
    else:
        ans += e-s
        s, e = t[i], t[i]+T
ans += e-s
print(ans)


Measured memory_bytes: 96080
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(begin, i, end) for (int i = begin; i < (int)(end); i++)
#define all(v) v.begin(), v.end()
const int MOD = 1000000007;

int main()
{
    ll A, B, C, D;
    cin >> A >> B >> C >> D;
    cout << max((ll)0, min(B, D) - max(A, C)) << endl;
}

Measured memory_bytes: 3624
#include<iostream>
#include<vector>
#include <cmath>
#include <map>
#include <cctype>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    int A1, A2, A3;
   cin >> A1 >> A2 >> A3;
   cout << abs(A1 - A2) + abs(A2 - A3) + abs(A3 - A1) - max(abs(A1 - A2), max(abs(A2 - A3), abs(A3 - A1))) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <ctime>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int maxn=100+10;
const int maxm=10000+10;
const int mod=(int)1e9+7;
const int INF=0x3f3f3f3f;
const ll LINF=(1LL<<62);
const double PI=acos(-1.0);
#define mst(a,b) memset(a,b,sizeof(a))
#define rep(i,a,b) for (int i=(a);i<b;i++)
#define ALL(x) x.begin(),x.end()
#define pii pair<int,int>
#define lowbit(x) x&(-x)
#define X first
#define Y second
int dig_sum(int n){
    int res=0;
    while (n){
        res+=n%10;
        n/=10;
    }
    return res;
}
int main(){
#ifdef local
    freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
#endif
    //ios::sync_with_stdio(false); cin.tie(0);
    int n; scanf("%d",&n);
    if (n%dig_sum(n)==0) printf("Yes\n"); else printf("No\n");
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>
#define REP(i, n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)(x).size()
using namespace std;
using ll = long long;
constexpr ll INF = 3000000000000000000;

int main() {
    int X, Y, Z;
    cin >> X >> Y >> Z;
    cout << (X - Z) / (Y + Z) << "\n";
    return 0;
}


Measured memory_bytes: 3636