akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define MOD (1000000007)
#define vi vector<int>
#define vl vector<ll>
#define vb vector<bool>
#define vvi vector<vi>
#define vvl vector<vl>
#define pii pair<int, int>
#define pli pair<ll, int>
#define pb push_back

#define mp make_pair
#define all(a) (a).begin(),(a).end()

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

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

ll keta(ll n){
  string s = to_string(n);
  ll num = s.size();
  return num;
}

const ll INF = 1LL << 60;

const int dh[4] = {1,0,-1,0};
const int dw[4] = {0,1,0,-1};

struct Edge{
  int to;
  int weight;
  Edge(int t, int w) : to(t), weight(w){}
};
using Graph = vector<vector<Edge>>;
using P = pair<ll, int>;

const int MAX = 1e6;

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

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

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


int main(){
  ll n,p; cin >> n >> p;
  ll P = p;
  map<ll,ll> C;
  for(ll i = 2; i*i <= P; i++) {
    while(p%i == 0) {p /= i; C[i]++;}
  }
  if(p != 1) C[p]++;

  ll ans = 1LL;
  for(auto c : C) {
    ll q = c.second;
    ll num = q/n;
    //cout << c.first << " " << c.second << " " << num <<  endl;
    rep(i,num) ans *= c.first;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF=1e18;
int n;
ll x[15],y[15],p[15];
ll res[20][20],ans[20];
void dfs(int i,int num){
    if(i==n){
        ans[num]=min(ans[num],accumulate(res[n],res[n]+n,0LL));
        return ;
    }
    for(int j=0;j<n;j++) res[i+1][j]=res[i][j];
    dfs(i+1,num);
    for(int j=0;j<n;j++) res[i+1][j]=min(res[i][j],p[j]*abs(x[j]-x[i]));
    dfs(i+1,num+1);
    for(int j=0;j<n;j++) res[i+1][j]=min(res[i][j],p[j]*abs(y[j]-y[i]));
    dfs(i+1,num+1);
}
int main(){
    cin>>n;
    for(int i=0;i<n;i++) cin>>x[i]>>y[i]>>p[i];
    for(int j=0;j<n;j++){
        res[0][j]=p[j]*min(abs(x[j]),abs(y[j]));
        ans[j]=INF;
    }
    dfs(0,0);
    for(int i=0;i<=n;i++) cout<<ans[i]<<endl;
	return 0;
}


Measured memory_bytes: 3628
#include <algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;
int main(){
  int a,b,t,div;
  cin >> a >> b >> t;
  div = t / a;
  cout << b * div << endl;
  return 0;
}


Measured memory_bytes: 256
def examA():
    N, A, B = LI()
    ans = min(A*N,B)
    print(ans)
    return

def examB():
    N, D = LI()
    X = [LI() for _ in range(N)]
    ans = 0
    for i,j in itertools.combinations(X,2):
        cur = 0
        for k in range(D):
            cur += (i[k]-j[k])**2
        cur **=0.5
        if cur==int(cur):
            ans +=1
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,inf
mod = 10**9 + 7
inf = float('inf')

if __name__ == '__main__':
    examB()


Measured memory_bytes: 38384
#![allow(unused_imports)]
// using Rust(1.42.0)
// My Library Repo is at "https://github.com/Loptall/prcn_lib"
// check available crates on AtCoder at "https://atcoder.jp/contests/language-test-202001"

/*
    AtCoder Language Update 2020204 お疲れ様でした! 有難いです
*/

// Dep crates are...
use std::cmp::{max, min, Ordering};
use std::collections::{HashMap, HashSet, VecDeque};
use std::io::stdin;
use std::mem::swap;
use std::ops::*;
use std::str::FromStr;

fn input<T: FromStr>() -> Result<T, T::Err> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim().parse()
}

fn input_vec<T: FromStr>() -> Result<Vec<T>, T::Err> {
    let mut buf = String::new();
    stdin().read_line(&mut buf).unwrap();
    buf.trim().split_whitespace().map(|x| x.parse()).collect()
}

// code...
fn main() {
    let n: usize = input().unwrap();
    println!("{}", (n - 2) * 180);
}


Measured memory_bytes: 4352
h,w = map(int, input().split())
c = [list(map(int, input().split())) for i in range(10)]
a = [list(map(int, input().split())) for x in range(h)]

for k in range(10):
    for i in range(10):
        for j in range(10):
            c[i][j] = min(c[i][j], c[i][k]+c[k][j])

ans = 0

for i in range(h):
    for j in range(w):
        if a[i][j] != 1 and a[i][j] != -1:
            ans += c[a[i][j]][1]

print(ans)

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

using namespace std;
using ll = long long;

struct edge {
    ll cost;
    int tobasu;
    int to;
    edge(){}
    edge(ll cost,int tobasu,int to):cost(cost),tobasu(tobasu),to(to){}

    bool operator<(const edge& rhs) const{
        if(cost>rhs.cost)return true;
        else if(cost<rhs.cost)return false;
        else return to<rhs.to;
    }

    edge operator+(const edge rhs){
        return edge(cost+rhs.cost,tobasu+rhs.tobasu,rhs.to);
    }
};

vector<vector<edge>> G;
vector<vector<pair<ll,pair<int,int>>>> ishi;
vector<vector<ll>> dp;

int main() {
    while(true) {
        int n,m;
        cin>>n>>m;
        if(n==0)break;

        int vt=0;
        ishi.resize(n);
        for(int i = 0;i < n;++i) {
            int k;
            cin>>k;
            for(int j = 0;j < k;++j) {
                int a;
                ll c;
                cin>>a>>c;
                ishi[i].emplace_back(c,make_pair(a,vt));
                ++vt;
            }
        }

        G.resize(vt+2);
        for(int i = 0;i < n;++i) {
            for(auto v:ishi[i]) {
                if(i!=n-1) {
                    for(auto x:ishi[i+1]) {
                        ll cost=(v.first+x.first)*abs(v.second.first-x.second.first);
                        G[v.second.second].emplace_back(cost,0,x.second.second);
                    }
                }
                else {
                    G[v.second.second].emplace_back(0,0,vt);
                }

                if(i<n-2) {
                    for(auto x:ishi[i+2]) {
                        ll cost=(v.first+x.first)*abs(v.second.first-x.second.first);
                        G[v.second.second].emplace_back(cost,1,x.second.second);
                    }
                }
                else if(i==n-2){
                    G[v.second.second].emplace_back(0,1,vt);
                }
            }
        }

//cerr<<"OK"<<endl;

        priority_queue<edge> pq;
        for(auto v:ishi[0]) {
            pq.emplace(0LL,0,v.second.second);
        }

        for(auto v:ishi[1]) {
            pq.emplace(0LL,1,v.second.second);
        }

        dp.assign(vt+1,vector<ll>(m+1,1000000000000LL));

        while(!pq.empty()) {
            auto t=pq.top();
//cerr<<"cost:"<<t.cost<<" tobasu:"<<t.tobasu<<" to:"<<t.to<<endl;
            if(t.to==vt)break;
            pq.pop();
            for(auto v:G[t.to]) {
                auto te=t+v;
                if(te.tobasu>m)continue;
                if(dp[te.to][te.tobasu]<te.cost)continue;
                dp[te.to][te.tobasu]=te.cost;
                pq.push(te);
            }
        }

        cout<<pq.top().cost<<endl;

        G.clear();
        ishi.clear();
        dp.clear();
    }
    return 0;
}



Measured memory_bytes: 6696
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + (ll)b) % mod
#define MUL(a, b) a = (a * (ll)b) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = a; i < b; i++)
#define rer(i, a, b) for(int i = a - 1; i >= b; i--)
#define all(a) (a).begin(), (a).end()
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef pair<int, pi> ppi;
typedef vector<ll> vec;

const int MAX_N = 310;
const double eps = 1e-6;
const ll mod = 1000000007;
const int inf = 1 << 30;

void Debug() {cout << '\n'; }

template<class FIRST, class... REST> 
void Debug(FIRST arg, REST... rest) { cout << arg << " "; Debug(rest...); }

template<class T>
ostream& operator<< (ostream& out, const vector<T>& v) {
	out << "[";
	if(!v.empty()) {
		rep(i, 0, (int)v.size() - 1) out << v[i] << ", ";
		out << v.back();
	}
	out << "]";
  return out;
}

template<class S, class T>
ostream& operator<< (ostream& out, const pair<S, T>& v) {
	out << "(" << v.first << ", " << v.second << ")";
	return out;
}

///g++ -g3 -std=c++0x -DLOCAL -Wall -ftrapv -D_GLIBCXX_DEBUG -Wl,-stack,268435456 -o
///g++ -O2 -std=c++0x -DLOCAL -Wall -Wl,-stack,268435456 -o

////////////////////////////////////////////////////////////////////////

int N, M;
ll dp[MAX_N][MAX_N][MAX_N];
vector<pi> I[MAX_N];

bool ok(int i, int j, int k) {
	int m = max(max(i, j), k);
	int size = (int)I[m].size();
	for(int l = size - 1; l >= 0; l--) {
		int cnt = 0;
		pi p = I[m][l];
		if(p.fst <= i) cnt++;
		if(p.fst <= j) cnt++;
		if(p.fst <= k) cnt++;
		if(cnt != p.sec) return false;
	}
	return true;
}

void solve() {
	cin >> N >> M;
	rep(i, 0, M) {
		int a, b, c;
		cin >> a >> b >> c;
		I[b].push_back(pi(a, c));
	}
	rep(i, 0, N + 1) sort(all(I[i]));
	dp[0][0][0] = 1;
	rep(i, 0, N + 1) {
		rep(j, 0, N + 1) {
			rep(k, 0, N + 1) {
				int l = max(max(i, j), k);
				if(ok(i, j, l + 1)) ADD(dp[i][j][l + 1], dp[i][j][k]);
				if(ok(i, l + 1, k)) ADD(dp[i][l + 1][k], dp[i][j][k]);
				if(ok(l + 1, j, k)) ADD(dp[l + 1][j][k], dp[i][j][k]);
			}
		}
	}
	ll res = 0;
	rep(i, 0, N + 1) {
		rep(j, 0, N + 1) {
			rep(k, 0, N + 1) {
				if(max(max(i, j), k) == N) ADD(res, dp[i][j][k]);
			}
		}
	}
	cout << res << "\n";
}

int main() {
	ios::sync_with_stdio(false);
    cin.tie(0);	
    cout << fixed;
	cout.precision(20);
#ifdef LOCAL
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}




Measured memory_bytes: 227584
use std::io;
use std::str::FromStr;

fn input<T:FromStr>() -> T {
  let mut line: String = String::new();
  io::stdin().read_line(&mut line);
  line.trim().parse().ok().unwrap()
}

fn input_int_vec() -> Vec<i32> {
  let mut line: String = String::new();
  io::stdin().read_line(&mut line);
  line.split_whitespace().map(|s| s.parse().unwrap()).collect()
}

fn main() {
  let N: u32 = input();
  let mut v = input_int_vec();
  v.sort();
  let mut ret = v[0] as f64;
  for i in v {
    ret = (ret + i as f64) / 2.0;
  }
  println!("{}", ret);
}


Measured memory_bytes: 4352
#include <iostream>
using namespace std;
struct KURURU {
int a;
int b;
};
int main (){
while (1){
KURURU i;
int sum=0;
char j;
cin>>i.a>>j>>i.b;
if (j=='?')break;

else if (j=='+'){
        sum=i.a+i.b;
}
else if (j=='-'){
        sum=i.a-i.b;
}
else if (j=='*'){
        sum=i.a*i.b;
}
else if (j=='/'){
        sum=i.a/i.b;
}
cout<<sum<<endl;
}
return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define FOR(i, a, b) for (int i = a; i <= b; i++)
#define ROF(i, a, b) for (int i = a; i >= b; i--)
using namespace std;

using pii = pair<int, int>; using vpii = vector<pii>;
using vi = vector<int>; using vvi = vector<vi>;
using ll = long long;
using pll = pair<ll, ll>; using vpll = vector<pll>;
using vll = vector<ll>; using vvll = vector<vll>;

const int N = 1e5 + 5;
int n, q, f[N];

void add(int p, int val) {
    while (p <= n) {
        f[p] += val;
        p += p & -p;
    }
    return;
}

int qry(int p) {
    int rt = 0;
    while (p) {
        rt += f[p];
        p -= p & -p;
    }
    return rt;
}

int main() {
    cin >> n >> q;
    while (q--) {
        int c, x, y; cin >> c >> x >> y;
        if (!c) add(x, y);
        else cout << qry(y) - qry(x - 1) << endl;
    }
}


Measured memory_bytes: 3460
import java.io.*;
import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int m = in.nextInt();
        int d[] = new int[m];
        int t[] = new int[n+1];
        
        for (int i = 0; i < m; i++){
            d[i]=in.nextInt();
        }
        
        for (int i = 1; i <= n; i++){
            t[i]=Integer.MAX_VALUE;
        }
        t[0]=0;
        
        for(int i = 0; i < m; i++){
            for(int j = 0; j + d[i] <=n; j++){
                t[j + d[i]]=Math.min(t[j + d[i]],t[j]+1);
            }
        }
        
        System.out.println(t[n]);
    }  
}

Measured memory_bytes: 26664
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=100010;
const ll mod=1e9+7;

int main(){
  string s;
  cin >> s;
  if(s[0]!=s[1]||s[0]!=s[2]||s[1]!=s[2]){ cout << "Yes" << endl; }else{ cout << "No" << endl;}
  return 0;
}


Measured memory_bytes: 256
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto s = readln.chomp;
  int a, z;
  foreach (i, e; s) {
    if (e == 'A') {
      a = i.to!int;
      break;
    }
  }
  foreach_reverse(i, e; s) {
    if (e == 'Z') {
      z = i.to!int;
      break;
    }
  }
  writeln(z - a + 1);
}


Measured memory_bytes: 2684
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define REP2(i,x,n) for (int i = x; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);



int main(){
  string s;
  int k;
  cin >> s >> k;
  int n = s.size();

  map<char,int> mp;

  int cnt = 26;
  for(char al = 'a'; al <= 'z'; al++){
    mp[al] = cnt;
    --cnt;
  }
  mp['a'] = 0;


  //for( auto x : mp) cout << x.second << endl;


  REP(i,n){
    if(mp[s[i]] > k) continue;
    k -= mp[s[i]];
    s[i] = 'a';
    //cout << k << endl;
    if(k <= 0) break;
  }

  if(k > 0) {
    k %= 26;
    s[n-1] += k;
  }


  cout << s << endl;

  return 0;
}


Measured memory_bytes: 3764
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>

using namespace std;

#define MAX 100000

struct TRAMP{
    char mark;
    int number,inputed_order;
};

TRAMP cards[MAX];

int n;

int Partition(int left,int right){
    int i = left-1,pivot = cards[right].number;
    for(int start = left; start < right; start++){
        if(cards[start].number <= pivot){
                i++;
                std::swap(cards[i],cards[start]);
        }
    }

    std::swap(cards[i+1],cards[right]);

    return i+1;
}

void quickSort(int left,int right){
    if(left < right){
        int q = Partition(left,right);
        quickSort(left,q-1);
        quickSort(q+1,right);
    }
}


int main(){

    bool stableFLG = true;
    scanf("%d",&n);

    for(int i = 0; i < n; i++){
        scanf("%s %d",&cards[i].mark,&cards[i].number);
        cards[i].inputed_order = i;
    }

    quickSort(0,n-1);

    for(int i = 1; i < n; i++){
        if(cards[i].number == cards[i-1].number && cards[i].inputed_order < cards[i-1].inputed_order){
        	stableFLG = false;
        	break;
        }
    }

    if(stableFLG){
        printf("Stable\n");
    }else{
        printf("Not stable\n");
    }

    for(int i = 0; i < n; i++)   printf("%c %d\n",cards[i].mark,cards[i].number);
}


Measured memory_bytes: 4376
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second
 
const int mx=200010;
const ll mod=1e9+7;

int main(){
  int k,s;
  cin >> k >> s;
  ll ans=0;
  for(int i=0; i<=k; i++){
    for(int j=0; j<=k; j++){
      int tmp = s-i-j;
      if(tmp<=k && 0<=tmp){ ans++; }
    }
  }

  cout << ans << endl;
  return 0;
}

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

int main() {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  int k;
  cin >> k;
  if (k <= 9) {
    cout << k << endl;
    return 0;
  }
  vector<vector<ll> > dp(15, vector<ll>(15,1));
  ll sum = 9;
  for (int keta = 2; keta < 15; ++keta) {
    for (int x = 0; x <= 9; ++x) {
      if (x == 0) dp[keta][x] = dp[keta-1][0] + dp[keta-1][1];
      else if (x == 9) dp[keta][x] = dp[keta-1][9] + dp[keta-1][8];
      else {
        dp[keta][x] = dp[keta-1][x-1] + dp[keta-1][x] + dp[keta-1][x+1];
      }
      if (x > 0) sum += dp[keta][x];
      if (sum >= k) {
        int cur = x;
        sum -= dp[keta][x];
        while (keta >= 1){
          cout << cur;
          if (cur == 0) {
            if (sum + dp[keta-1][cur] >= k) {
              keta--;
              continue;
            }
            sum += dp[keta-1][cur];
            cur = cur+1;
            keta--;
            continue;
          }
          else if (cur == 9) {
            if (sum + dp[keta-1][cur-1] >= k) {
              cur = cur-1;
              keta--;
              continue;
            }
            sum += dp[keta-1][cur-1];
            if (sum + dp[keta-1][cur] >= k) {
              keta--;
              continue;
            }
          }
          if (sum + dp[keta-1][cur-1] >= k) {
            cur = cur-1;
            keta--;
            continue;
          }
          sum += dp[keta-1][cur-1];
          if (sum + dp[keta-1][cur] >= k) {
            keta--;
            continue;
          }
          sum += dp[keta-1][cur];
          cur = cur+1;
          keta--;
        }
        cout << endl;
        return 0;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
int a, b;
int main() {
  cin >> a >> b;
  if (abs(a)>1000 or abs(b)>1000){
  cout << "Unaccepted values";
  } else if (a>b){
    cout << "a > b";
  } else if (a<b){
    cout << "a < b";
  } else if (a==b){
    cout << "a == b";
  }
  cout << endl;
}


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

int N,bil [51],total=0;

int main () {
	cin >> N;
	for(int i=1;i<=N;i++)
		cin >> bil[i];
	for(int i=1;i<=N-1;i++) {
		for(int j=i+1; j<=N;j++) {
			total+=bil[i]*bil[j];
		}
	}
	cout << total << endl;
}


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

void modular_practice(){
    //freopen("in.txt", "r", stdin);
    int a, b;
    scanf("%d", &a);
    scanf("%d", &b);
    if((a*b)%2){
        cout << "Odd";
    } else {
        cout << "Even";
    }
}

int main() {
    modular_practice();
    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
if 0 in A:
    print(0)
else:
    answer = A[0]
    for i in range(N-1):
        answer *= A[i+1]
        if answer > 10**18:
            print(-1)
            break
    else:
        print(answer)

Measured memory_bytes: 21476
N = int(input())
A = list(map(int, input().split()))

i = 1
x = 0
result = []
for a in A:
    if i%2 == 0:
        x -= a
    else:
        x += a
    i += 1
result.append(x)
A.pop()
for a in A:
    tmp = 2*a - x
    result.append(tmp)
    x = tmp

print(*result)

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

using namespace std;

typedef pair<int, int> p;
typedef long long ll;
const int inf = 1000000007;

int main() {
  int n;
  cin >> n;
  ll res = 0;
  for (int c = 1; c <= n - 1; c++) {
    ll ans = 1;
    ll ab = n - c;
    for (int i = 2; i * i <= ab; i++) {
      ll cnt = 0;
      while (ab % i == 0) {
        cnt++;
        ab /= i;
      }
      ans *= (cnt + 1);
      // ans += cnt;
    }
    if (ab != 1) ans *= 2;
    // ans += cnt;
    res += ans;
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 3628
import java.util.*;
import java.math.*;

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

  int min =h*60+m;

  double aRad=(double)(0.5*min%360)*Math.PI/180;

  double bRad=(double)(6*min%360)*Math.PI/180;

  double ax=a*Math.sin(aRad);

  double ay=a*Math.cos(aRad);
  double bx=b*Math.sin(bRad);
  double by=b*Math.cos(bRad);

  double len=Math.pow(ax-bx,2)+Math.pow(ay-by,2);
  double lenans=Math.sqrt(len);
  System.out.println(lenans);




}
}


Measured memory_bytes: 36076
while True:
    n=int(input())
    x=[]
    if n==0:
        break
    else:
        for i in range(n):
            s=int(input())
            x.append(s)
        a=min(x)
        b=max(x)
        ave=(sum(x)-a-b)/(n-2)
        print(int(ave))


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

#define LL long long
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define ALL(x) (x).begin(),(x).end()
const int IINF = 1e9;
const LL LINF = 1e18;
const LL mod = 1e9+7;

int main() {
    LL N;
    cin >> N;
    map<string, LL> dic;
    REP(i, N) {
        string s;
        cin >> s;
        vector<char> vec;
        REP(j, 10) {
            vec.push_back(s[j]);
        }
        sort(ALL(vec));
        REP(j, 10) {
            s[j] = vec[j];
        }

        dic[s]++;
    }
    LL res = 0;
    for(auto i = dic.begin();i != dic.end();i++) {
        res += (i->second)*(i->second - 1)/2;
    }
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 11136
#include<iostream>
using namespace std;
int main(){
    long long n;
    cin>>n;
    long long sum=0;
    long long i=1;
    while(i<=n){
        if(i%3!=0 && i%5!=0){
            sum+=i;
        }
        i++;
    }
    cout<<sum;

}

Measured memory_bytes: 3632
package main

import (
	"fmt"
)

func main() {
	for {
		var s string
		var m, h int
		fmt.Scan(&s)
		if s == "-" {
			break
		}
		fmt.Scan(&m)
		for i := 0; i < m; i++ {
			fmt.Scan(&h)
			s = s[h:] + s[:h]
		}
		fmt.Println(s)
	}
}



Measured memory_bytes: 1136
import java.util.Scanner;

class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt(); 
        
        int ans = 0;
        for(int i = 1; i <= n; i++) {
            int sumDigit = 0;
            int t = i;
            while(t > 0) {
                sumDigit += t % 10;
                t /= 10;
            }
            if(a <= sumDigit && sumDigit <= b) {
                ans += i;
            }
        }

        System.out.println(ans);
    }
}


Measured memory_bytes: 21972
#include <iostream>
#include <string>
#include <vector>
#include <unordered_map>
#include <stack>
#include <algorithm>

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	string s;
	cin >> s;
	const int n = s.size();
	vector<int> b(n + 1);
	for(int i = 0; i < n; ++i){
		const int c = s[i] - 'a';
		b[i + 1] = b[i] ^ (1 << c);
	}
	unordered_map<int, stack<int>> mp;
	for(int i = n; i >= 0; --i){ mp[b[i]].push(i); }
	vector<int> dp(n + 1, n);
	dp[0] = 0;
	for(int i = 0; i < n; ++i){
		mp[b[i]].pop();
		{
			const auto& st = mp[b[i]];
			if(!st.empty()){
				const int t = st.top();
				dp[t] = min(dp[t], dp[i] + (i == 0 ? 1 : 0));
			}
		}
		for(int c = 0; c < 26; ++c){
			const auto it = mp.find(b[i] ^ (1 << c));
			if(it == mp.end()){ continue; }
			const auto& st = it->second;
			if(!st.empty()){
				const int t = st.top();
				dp[t] = min(dp[t], dp[i] + 1);
			}
		}
	}
	cout << dp[n] << endl;
	return 0;
}



Measured memory_bytes: 144604
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include <vector>
#include <list>
#include <string>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <climits>
#include <map>
#include <math.h>
#include <queue>
#include <stack>
#include <set>
#include <random>
using namespace std;


int main() {
	long int n;
	vector < long > v;

	cin >> n;

	for (auto i = 0; i < n; i++) {
		int tmp = 0;
		cin >> tmp;
		v.push_back(tmp);
	}

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

	long int aa[2] = { 0 };
	int f = 0;

	for (auto i = 0; i < v.size(); i++) {
		
		if (i+1 < v.size() && v[i] == v[i + 1]) {
			aa[f] = v[i];
			f++;
			i++;
		}

		if (f >= 2) {
			cout << aa[0] *  aa[1] << endl;
			return 0;
		}
	}

	cout << 0 << endl;

	return 0;
}

Measured memory_bytes: 1400
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <functional>
#include <bitset>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <numeric>
#define ll long long int
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
using namespace std;
int mx4[] = {0,1,0,-1};
int my4[] = {1,0,-1,0};
int mx2[] = {1,0};
int my2[] = {0,1};

class AKCity {
public:
	void solve(istream& in, ostream& out) {
        int n,m;
        in >> n >> m;
        n--; m--;
        out << n * m << endl;
	}
};

int main() {
	AKCity solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;}

int main() {
    int n,m;
    cin >> n >> m;
    cout << (1900*m+100*(n-m))*pow(2,m) << endl;
}

Measured memory_bytes: 4184
#ifdef loc
    #include "codes/loc_debug.h"
#else
    #include <bits/stdc++.h>
    #define pr(...)
    #define pra(a,n)
    #define praa(a,n,m)
    #define prl()
#endif
using namespace std;

typedef long long ll;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define sz(a) int(a.size())
const int N = 100005;


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int r;
    cin>>r;
    cout<<3*r*r<<endl;
}

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

using namespace std;
using LL = long long;

constexpr int N = 1e5 + 5;

int main() {
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x; cin >> x;
		if (x % 2 == 0 && x % 3 && x % 5) return cout << "DENIED\n", 0;
	}
	cout << "APPROVED\n";
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
 
int main () {
ll A,B,r ;
ll k ;
cin >> A >> B;
ll p = A ;
ll l = B ;
while( (r = A % B) != 0 ) {
A = B;
B = r;
}
cout << (p / B) * l << endl;
  

return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<algorithm>
using namespace std;
int a[109],b[109],c[109];
int main()
{
    int n,i,x,y;
    scanf("%d",&n);
    memset(b,0,sizeof(b));
    memset(c,0,sizeof(c));
    for(i=1; i<=n; i++)
    {
        scanf("%d",&a[i]);
        b[i]+=b[i-1]+a[i];
    }
    for(i=1; i<=n; i++)
    {
        x=b[n]-b[i];
        c[i]=x-b[i];
    }
    y=100;
    for(i=1; i<=n; i++)
    {
        if(c[i]>=0&&c[i]<=y)
            y=c[i];
        if(c[i]<0&&(-c[i])<=y)
            y=-c[i];
    }
    printf("%d\n",y);
    return 0;
}


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

string board[10];

//jfenを元の記号列に戻す
string decode(string in)
{
	string ret;
	for(int i=0;i<in.size();i++)
	{
		if(in[i]=='b')
			ret+='b';
		else{
			int n=in[i]-'0';
			for(int j=0;j<n;j++)
				ret+='.';
		}
	}
	return ret;
}

//記号列をjfenに直す
string encode(string in)
{
	string ret;
	int ind=0;
	while(ind<in.size())
	{
		//cerr<<ind<<endl;
		if(in[ind]=='b')
		{
			ret+='b';
			ind++;
		}else{
			int cnt=0;
			while(ind<in.size() && in[ind]=='.')
			{
				cnt++;
				ind++;
			}
			ret+=(char)('0'+cnt);
		}
	}
	return ret;
}

int main()
{
	while(1)
	{
		string s;
		cin>>s;
		if(s[0]=='#')
			break;
		for(int i=0;i<10;i++)
			board[i].clear();
		//行ごとに分解
		int i=0;
		int h=0;
		string tmp;
		while(i<s.size())
		{
			if(s[i]!='/')
				tmp+=s[i];
			else{
				board[h]=tmp;
				h++;
				tmp.clear();
			}
			i++;
		}
		board[h]=tmp;
		h++;
		//cerr<<h<<endl;
		for(int i=0;i<h;i++)
		{
			board[i]=decode(board[i]);
			//cerr<<board[i]<<endl;
		}
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		a--;b--;c--;d--;
		board[c][d]='b';
		board[a][b]='.';
		string ans;
		for(int i=0;i<h;i++)
		{
			//cerr<<board[i]<<endl;
			ans+=encode(board[i]);
			if(i<h-1)
				ans+='/';
		}
		cout<<ans<<endl;
	}
	return 0;
}


Measured memory_bytes: 3152
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll ;

int main()
{
     int n;
     cin>>n;
     int a[n];
     for(int i=0; i<n; i++){
       cin >> a[i];
       
     }
     int fl=0;
     sort(a,a+n);
     for(int i=1; i<n; i++){
       if(a[i]==a[i-1]) {
         
       cout<<"NO";
       return 0;
       }
      
     }
     cout<<"YES";
     
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <math.h>
int main(void){
    int x,i,j,k,ans=1;
    scanf("%d",&x);
    for(i=1;i<1001;i++){
        for(j=2;j<10;j++){
            k=pow(i,j);
            if(k>x) break;
            if(ans<=k) ans=k;
        }
    }
    printf("%d\n",ans);
}

Measured memory_bytes: 128
#define ALL(obj) (obj).begin(), (obj).end()

#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <bitset>
#include <algorithm>
#include <complex>
#include <array>
#include <functional>

using namespace std;
typedef long long ll;
const ll INF = 1e18;

ll N;
ll M;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    cin >> N >> M;
    if (N == M) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<stack>
#include<vector>
#include<algorithm>
/*
    size()
    front()
    pop()
    push(x)
    empty()
*/
using namespace std;

int main() {
    int i;
    int j = 0;
    int sum = 0;
    int a = 0;
    char c;
    stack<int> S;
    stack<pair<int, int> > Area;
    vector<int> answer;
    for(i = 0; cin >> c; i++) {
        if(c == '\\') {
            S.push(i);
        }
        else if(c ==  '/' && !S.empty()){
            j = S.top();
            S.pop();
            sum += i - j;
            a = i - j;
            while(Area.size() > 0 && Area.top().first > j) {
                a += Area.top().second;
                Area.pop();
            }
            Area.push(make_pair(j, a));
        } 
    }
    while(Area.size() > 0) {
        answer.push_back(Area.top().second);
        Area.pop();
    }
    reverse(answer.begin(), answer.end());
    
    cout << sum << endl;
    cout << answer.size();
    for(i = 0; i < answer.size(); i++) {
        cout << " ";
        cout << answer[i];
    }
    cout << endl;
}


Measured memory_bytes: 3172
import Control.Applicative
import Control.Monad.State

step :: [Int] -> State Int [Int]
step []     = return []
step (x:[]) = return [x]
step (x:xs)
    | minimum xs < x = modify (+1) >> step (lpart ++ (x : rpart)) >>= \ms -> return (m:ms)
    | otherwise      = step xs >>= \rest -> return (x:rest)
        where m     = minimum xs
              lpart = takeWhile (m/=) xs
              rpart = tail (dropWhile (m/=) xs)

sSort :: [Int] -> State Int [Int]
sSort [] = return []
sSort xs = step  xs >>= \(y:ys) ->
           sSort ys >>= \zs ->
           return (y:zs)

main = do
    getLine
    xs <- map read . words <$> getLine
    let (ys, n) = runState(sSort xs) 0
    putStrLn $ unwords $ map show ys
    print n


Measured memory_bytes: 4088
#include <stdio.h>
#define N 6
int main(){
  int i,j,n;
  int data[N]={0,0,0,0,0,0};
  double height;
  scanf("%d",&n);
  for (i=0;i<n;i++){
    scanf("%lf",&height);
    if (height<165.0)
      data[0]++;
    else if (height<170.0)
      data[1]++;
    else if (height<175.0)
      data[2]++;
    else if (height<180.0)
      data[3]++;
    else if (height<185.0)
      data[4]++;
    else
      data[5]++;
  }
  for (i=0;i<N;i++){
    printf("%d:",i+1);
    for (j=0;j<data[i];j++)
      printf("*");
    printf("\n");
  }
  return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define ll long long int 
#define f first
#define s second
#define pb push_back
#define mod 1000000007
#define mp make_pair
#define fast 
#define f first
#define s second
#define endl "\n"
#define pie 3.1415926535

int main(){
  int n,flag=0;
  cin >> n;
  while(n>0){
    int temp = n%10;
    if(temp==7){
      cout << "Yes";
      flag = 1;
      break;
    }
    n= n/10;
  }
  if(flag==0)
    cout << "No";
  return 0;
  
}






Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(int i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(int i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(int i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define uniq(x) (x).erase(unique((x).begin(), (x).end()), (x).end())

vector<pair<ll, int>> factorize(ll n) {
    vector<pair<ll, int>> res;
    for (ll i = 2; (i * i) <= n; i++) {
        if (n % i) continue;
        res.emplace_back(i, 0);
        while((n % i) == 0) {
            n /= i;
            res.back().second++;
        }
    }
    if (n != 1) res.emplace_back(n, 1);
    return res;
}

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // std::ifstream in("input.txt");
    // std::cin.rdbuf(in.rdbuf());
    ll n, k;
    cin >> n >> k;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    ll ans = a[0];
    rep(i, n) ans = gcd(ans, a[i]);
    ll asum = accumulate(all(a), 0LL);
    auto f = factorize(asum);
    set<ll> fac;
    rep(i, sz(f)) {
        rep(ii, f[i].second) {
            set<ll> add;
            add.insert(f[i].first);
            for (auto x : fac) add.insert(x * f[i].first);
            for (auto x : add) fac.insert(x);
        }
    }
    map<ll, vector<ll>> surplus;
    for (auto x : fac) {
        surplus[x].resize(n);
        rep(i, n) surplus[x][i] = a[i] % x;
        sort(all(surplus[x]));
    }
    map<ll, vector<ll>> minusdp, plusdp;
    for (auto x : fac) {
        minusdp[x].resize(n);
        rep(i, n) {
            if (i == 0) minusdp[x][i] = surplus[x][i];
            else minusdp[x][i] = minusdp[x][i - 1] + surplus[x][i];
        }
        plusdp[x].resize(n);
        rep(i, n) {
            if (i == 0) plusdp[x][i] = x - surplus[x][i];
            else plusdp[x][i] = plusdp[x][i - 1] + x - surplus[x][i];
        }
    }
    reps(i, 1, n) {
        for (auto x : fac) {
            ll minus = minusdp[x][i - 1], plus = plusdp[x][n - 1] - plusdp[x][i - 1];
            if (abs(minus - plus) % x != 0) continue;
            if (max(minus, plus) > k) continue;
            ans = max(ans, x);
        }
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

typedef long long ll;

int main(){
	ll a, b;
	cin >> a >> b;
	if(a*b <= 0)cout << "Zero" << endl;
	else{
		if((b-a)%2 || a > 0)cout << "Positive" << endl;
		else cout << "Negative" << endl;
	}
    return 0;
}

Measured memory_bytes: 384
n = int(input())
a = list(map(int, input().split()))
b = [0 for i in range(n)]
b[0] = sum(a) - sum(a[1::2]) * 2
b[1] = a[0] * 2
for i in range(2, n):
  b[i] = b[i-2] + a[i-1] * 2
c = [0 for i in range(n)]
c[0] = b[0]
for i in range(1, n):
  c[i] = b[i] - b[i-1]

ans = map(str, c)
print(" ".join(ans))

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

void rengeSwap(int b,int e,int* ans){
  int tmp[b];
  b--;
  for(int i=0;i<b;i++){
    tmp[i]=ans[i];
  }
  for(int i=b;i<b+e;i++){
    ans[i-b]=ans[i];
  }
  for(int i=e;i<b+e;i++){
    ans[i]=tmp[i-e];
  }
}

int main(){
  int n,r;
  while(cin>>n>>r,n){
    int ans[n];
    for(int i=0;i<n;i++){
      ans[i]=n-i;
    }

    for(int i=0;i<r;i++){
      int b,e;
      cin>>b>>e;
      rengeSwap(b,e,ans);
    }
cout << ans[0] << endl;
  }
  return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define int long long
typedef long long ll;
const int MOD = 1000000007;
const int INF = 1010000000;
const double EPS = 1e-10;
using namespace std;
const pair<int,int> fd[] = {make_pair(1,0),make_pair(-1,0),make_pair(0,1),make_pair(0,-1)}; 

signed main() {
  int n;cin>>n;
  int dp[110000][3];
  int a[110000], b[110000], c[110000];
  rep(i,n)cin>>a[i]>>b[i]>>c[i];
  dp[0][0] = a[0];dp[0][1] = b[0];dp[0][2] = c[0];
  rep(i,n-1){
    dp[i+1][0] = max(dp[i][1], dp[i][2]) + a[i+1];
    dp[i+1][1] = max(dp[i][0], dp[i][2]) + b[i+1];
    dp[i+1][2] = max(dp[i][0], dp[i][1]) + c[i+1];
  }
  cout << max(dp[n-1][0], max(dp[n-1][1], dp[n-1][2])) << endl;
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;

int main() {
	int N;
	string s[2];
	cin >> N >> s[0] >> s[1];
	
	ll ans;
	int itr = 0;

	if(s[0][0] == s[1][0]) {
		ans = 3;
		itr++;
	}else {
		ans = 6;
		itr += 2;
	}

	while(itr < N) {
		if(s[0][itr] == s[1][itr]) {
			if(s[0][itr-1] == s[1][itr-1]) {
				ans *= 2;
			} else {
				ans *= 1;
			}
			itr++;
		} else {
			if(s[0][itr-1] == s[1][itr-1]) {
				ans *= 2;
			} else {
				ans *= 3;
			}
			itr += 2;
		}
		ans %= MOD;
	}

	cout << ans << endl;
}

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

#define REP(i, m, n) for (int i = (m); i < (int)(n); i++)
#define REPS(i, m, n) for (int i = (m); i <= (int)(n); i++)
#define rep(i, n) REP(i, 0, n)
#define reps(i, n) for (int i = 0; i <= (int)(n); i++)
#define rrep(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define rreps(i, x) for (int i = (int)(x); i >= 0; i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb push_back
#define fi first
#define se second
typedef long long ll;
typedef pair<int, int> P;
const int inf = INT_MAX;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;
const double EPS = 1e-10;
const double PI = acos(-1.0);
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) { fill( (T*)array, (T*)(array+N), val ); }


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

    int n; cin >> n;
    vector<int> x(n);
    rep(i, n) cin >> x[i];
    sort(all(x));

    ll ans = inf;
    rep(j, 10000) {
        ll sum = 0;
        rep(i, n) {
            sum += (x[i] - j) * (x[i] - j);
        }
        ans = min(ans, sum);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mem(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define int long long
#define gcd __gcd
const int inf = 0x3f3f3f3f;
const int maxn = 201110;
const int M = 1e9+7;
int n,m;

map<int,bool> mp;

signed main()
{
    bool flag = 1;
    cin>>n;
    for(int i = 1; i <= n; i++) 
    {
        cin>>m;
        if(mp[m]) flag = 0;
        else mp[m] = 1;
    }
    if(flag) puts("YES");
    else puts("NO");
    return 0;
}

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

using namespace std;

#define fRead(x)        freopen(x,"r",stdin)
#define fWrite(x)       freopen (x,"w",stdout)

#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 mk              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 FastRead        ios_base::sync_with_stdio(0);cin.tie(nullptr);

int main()
{
    LL a,b;
    cin >> a >> b;
    LL g = __gcd(a,b);
    LL ans = 0;
    LL sq = sqrt(g);
    for(int i = 2;i <= sq;i++){
        if(g % i == 0){
            ans++;
            while(g % i == 0)g/=i;
        }
    }
    if(g > 1)ans++;
    cout << ans + 1 << "\n";
}




Measured memory_bytes: 256
function Main(input){
  var result = BigInt('1');
  const max_result = BigInt('1000000000000000000');
  var flg = 1;
  const values = input.trim().split('\n');
  const N = parseInt(values[0]);
  var A = values[1].split(' ');
  if(A.indexOf('0') >= 0){
    result = 0;
  } else {
    A = A.map((str)=> BigInt(str));
    for(var data of A){
      result *= data;
      if(result > max_result){
        result = -1;
        break;
      }
    }  
  }
  console.log(String(result));
}

//固定
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

using namespace std;
using ll = long long;
using ld = long double;

//#define int long long
//signed main(){
int main() {
//    ios_base::sync_with_stdio(false);
//    cin.tie(NULL);
    int d,tg;
    cin >> d >> tg;
    vector<int> p(d);
    vector<int> c(d);
    for(int i = 0; i < d; i++) {
        cin >> p[i] >> c[i];
    }


    int ans=1e9;
    for(int bit = 0; bit < (1<<d); bit++) {
        int pt=0;
        int cnt=0;
        for(int i = 0; i < d; i++) {
            if(bit & (1<<i)){
                cnt+=p[i];
                pt+=p[i]*(i+1)*100+c[i];
            }
        }

//        cout << bit << " " << bitset<16>(bit) << "\n";

        if(pt<tg){
            int j=d-1;
            while(bit & (1<<j)) j--;
            int add=min(p[j]-1,(tg-pt+((j+1)*100)-1)/((j+1)*100));
            cnt+=add;
            pt+=add*(j+1)*100;
        }

        if(pt>=tg){
            ans=min(ans,cnt);
        }
    }
    cout << ans << "\n";


    return 0;
}

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

using ll = long long;
using pp = pair<ll,ll>;
const ll amari = 1e9+7;
const char BC = 'A' - 'a';
#define ben(a) a.begin(),a.end()
#define pb(a,b) a.push_back(b)
//fixed << setprecision(20)
int main(){
	vector<int> v(3);
	cin >> v[0] >> v[1] >> v[2];
	sort(ben(v));
	if(v[2] == v[0] + v[1])cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

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

using namespace std;

typedef long long llint;
typedef long double ld;
typedef pair<llint, llint> point;

const ld pi = 3.1415926535897932384626433L;

point P;
pair<point, int> arr[101];
point points[101];
ld sol[101];
int _pos[101];
int pos[101];

#define x first
#define y second

llint ccw(const point& a, const point& b, const point& c)
{
	return (b.x - a.x) * (c.y - a.y) - (c.x - a.x) * (b.y - a.y);
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int n, m, i;
	ld sum = 0;
	
	cin>>n;
	
	for (i = 0; i < n; ++i)
	{
		cin>>arr[i].first.x>>arr[i].first.y;
		arr[i].second = i;
	}
	sort(arr, arr + n);
	for (i = 0; i < n; ++i)
	{
		_pos[i] = arr[i].second;
		points[i] = arr[i].first;
	}
	
	vector<point> hull;
	for (i = 0; i < n; ++i)
	{
		while (hull.size() >= 2 && ccw(hull[hull.size() - 2], hull[hull.size() - 1], points[i]) <= 0)
			hull.pop_back();
		pos[hull.size()] = i;
		hull.push_back(points[i]);
//		cout<<i<<' '<<hull.size()<<'\n';
	}
	m = hull.size();
	for (i = n - 2; i > 0; --i)
	{
		while (hull.size() >= 2 && hull.size() > m && ccw(hull[hull.size() - 2], hull[hull.size() - 1], points[i]) <= 0)
			hull.pop_back();
		pos[hull.size()] = i;
		hull.push_back(points[i]);
//		cout<<i<<' '<<hull.size()<<'\n';
	}
	while (hull.size() >= 3 && hull.size() > m && ccw(hull[hull.size() - 2], hull[hull.size() - 1], points[0]) <= 0)
		hull.pop_back();
	m = hull.size();
	
//	cout<<m<<'\n';
	
	for (i = 0; i < m; ++i)
	{
		point& a = hull[(i + m - 1) % m];
		point& b = hull[(i + 1) % m];
		ld p = atan2(-(hull[i].x - a.x), hull[i].y - a.y);
		ld q = atan2(-(b.x - hull[i].x), b.y - hull[i].y);
		ld r = q - p;
		while (r < 0)
			r += 2 * pi;
		while (r >= 2 * pi)
			r -= 2 * pi;
//		cout<<points[i].x<<' '<<points[i].y<<' '<<p<<' '<<q<<' '<<r<<'\n';
		sol[_pos[pos[i]]] = r;
		sum += r;
	}
	
//	print:
	for (i = 0; i < n; ++i)
		cout<<fixed<<setprecision(17)<<sol[i] / sum<<'\n';
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <array>
#include <atomic>
#include <bitset>
#include <deque>
#include <forward_list>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <utility>
#include <vector>
using namespace std;

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

typedef long long ll;

void result() {
    ll n, k, q;
    cin >> n >> k >> q;
    vector<int> a(q), cont(n, 0);
    rep(i, 0, q-1) {
        cin >> a[i];
        cont[a[i]-1]++;
    }

    rep(i, 0, n-1) {
        cout << (0<k-(q-cont[i]) ? "Yes" : "No") << endl;
    }
}

int main() {	
    std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
    result();
}

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

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

	vector<int> a(n);
	vector<bool> b(n, false);

	string ans = "APPROVED";

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

		if (a[i] % 2 == 0) b[i] = true;

	}

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

		if (b[i]) {

			if ( !( a[i] % 3 == 0 || a[i] % 5 == 0 ) ) ans = "DENIED";

		}

	}
	
	cout << ans << endl;

	return 0;
}

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

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

  int n;
  cin >> n;

  string ans = "";

  while (n != 0) {
    if (n % 2 != 0) {
      n--;
      ans = "1" + ans;
    } else {
      ans = "0" + ans;
    }
    n /= -2;
  }

  if (ans == "") ans = "0";

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {

        Scanner sc = new Scanner(System.in);
        
        int N = sc.nextInt();
        int K = sc.nextInt();
        int ans = 1;
        
        //「2倍する」とは「ans自身を足す」に等しい。
        //よって、ansとKのうち小さい方を足せばよい。
        while(N > 0){
            ans += Math.min(ans, K);
            N--;
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 25172