akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cmath>
using namespace std;
int main(){
int N,D,ANS=0;
  cin>>N>>D;
  for(int i=0;i<N;i++){
    double X,Y;
    cin>>X>>Y;
    double z;
    z=sqrt((X*X)+(Y*Y));
    if(z<=D){
    ANS=ANS+1;
    }
  }
    cout<<ANS<<endl;
  return 0;
  }

Measured memory_bytes: 3672
// D.

#include <iostream>
#include <cstdio>
#include <set>
#include <vector>
#include <algorithm>

using namespace std;

vector<int> gen_primes(int m) {
	vector<int> primes;
	primes.push_back(2);
	for (int i = 3; i <= m; i += 2) {
		for (int prime : primes) {
			if (i < prime * prime) {
				primes.push_back(i);
				break;
			}
			if ((i % prime) == 0) {
				break;
			}
		}
	}
	return primes;
}

class BIT {
	std::vector<int> bit;
	int size;
public:
	BIT() { }
	BIT(int sz) { init(sz); }
	void init(int sz) {
		bit = std::vector<int>((size = sz) + 1);
	}
	int sum(int i) {
		int s = 0;
		while (i > 0) {
			s += bit[i];
			i -= i & -i;
		}
		return s;
	}
	void add(int i, int x) {
		while (i <= size) {
			bit[i] += x;
			i += i & -i;
		}
	}
};

int main(int argc, char *argv[]) {
	vector<int> primes = gen_primes(100000);
	set<int> s(primes.begin(), primes.end());
	BIT bit(100000);
	for (int i = 3; i <= 100000; i += 2) {
		if (s.find(i) != s.end() && s.find((i + 1) / 2) != s.end()) {
			bit.add(i, 1);
		}
	}
	int q;
	cin >> q;
	for (int i = 0; i < q; ++i) {
		int l, r;
		cin >> l >> r;
		int cnt = bit.sum(r) - bit.sum(l - 1);
		cout << cnt << endl;
	}
	return 0;
}


Measured memory_bytes: 1536
n=int(input())
town=[]
ans=0
for _ in range(n):
    town.append(list(map(int,input().split())))
for i in range(n):
    for j in range(n):
        ans+=((town[i][0]-town[j][0])**2+(town[i][1]-town[j][1])**2)**0.5
print(ans/n)

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

using namespace std;

#define gc getchar_unlocked
#define foi(i,n) for(int i=0;i<n;i++)
#define Foi(i,k,n) for(int i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define fol(i,n) for(ll i=0;i<n;i++)
#define Fol(i,k,n) for(ll i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)   scanf("%d",&x)
#define sl(x)   scanf("%lld",&x)
#define ss(s)   scanf("%s",s)
#define pi(x)   printf("%d\n",x)
#define pl(x)   printf("%lld\n",x)
#define ps(s)   printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>  pii;
typedef pair<ll, ll>    pl;
typedef vector<int>     vi;
typedef vector<ll>      vl;
typedef vector<pii>     vpii;
typedef vector<pl>      vpl;
typedef vector<vi>      vvi;
typedef vector<vl>      vvl;
int mpow(int base, int exp); 
void ipgraph(int m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int a[N];

int mpow(int base, int exp) {
    base %= mod;
    int result = 1;
    while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
    }
    return result;
}

void ipgraph(int n, int m){
    int i, u, v;
    while(m--){
        cin>>u>>v;
        g[u-1].pb(v-1);
        g[v-1].pb(u-1);
    }
}

void dfs(int u, int par){
    for(int v:g[u]){
        if (v == par) continue;
        dfs(v, u);
    }
}


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int x,n;
    cin>>x>>n;
    vector<int> a(n);
    set<int> s;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        s.insert(x-a[i]);
    } 
    for(int i=0;i<=n;i++)
    {
        if(s.find(i)==s.end())
        {
            cout<<x-i;
            break;
        }
        if(s.find(-i)==s.end())
        {
            cout<<x+i;
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 10688
#include <bits/stdc++.h>
using namespace std;
int main() {
  int num;
  string st;
  cin>>num>>st;
  if(st.size()<=num)cout<<st<<endl;
  else{
    for(int i=0;i<num;i++){
      cout<<st.at(i);
    }
    cout<<"..."<<endl;
  }
}

Measured memory_bytes: 3632
#include <iostream>
#include <stdio.h>
#include <vector> 
#include <math.h> 
using namespace std;

int main(void) {
    int a,b,t; cin >> a >> b >> t;
    int i = 1;
    int sum = 0;
    while (i <= t) {
        if (i % a == 0) {
            sum = sum + b;
        }
        i++;
    }
    cout << sum << endl;
}

Measured memory_bytes: 3628
#[allow(unused_imports)]
use std::cmp::{max, min, Ordering};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, BinaryHeap, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::{stderr, stdin, stdout, BufRead, BufWriter, Read, StdoutLock, Write};
#[allow(unused_imports)]
use std::iter::FromIterator;
#[allow(unused_imports)]
use std::{i64, u64, usize};
#[allow(unused_macros)]
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules !input {(source =$s :expr ,$($r :tt ) *) =>{let mut iter =$s .split_whitespace () ;input_inner !{iter ,$($r ) *} } ;($($r :tt ) *) =>{let mut s ={use std ::io ::Read ;let mut s =String ::new () ;std ::io ::stdin () .read_to_string (&mut s ) .unwrap () ;s } ;let mut iter =s .split_whitespace () ;input_inner !{iter ,$($r ) *} } ;}
#[allow(unused_macros)]
macro_rules !input_inner {($iter :expr ) =>{} ;($iter :expr ,) =>{} ;($iter :expr ,$var :ident :$t :tt $($r :tt ) *) =>{let $var =read_value !($iter ,$t ) ;input_inner !{$iter $($r ) *} } ;}
#[allow(unused_macros)]
macro_rules !read_value {($iter :expr ,($($t :tt ) ,*) ) =>{($(read_value !($iter ,$t ) ) ,*) } ;($iter :expr ,[$t :tt ;$len :expr ] ) =>{(0 ..$len ) .map (|_ |read_value !($iter ,$t ) ) .collect ::<Vec <_ >>() } ;($iter :expr ,chars ) =>{read_value !($iter ,String ) .chars () .collect ::<Vec <char >>() } ;($iter :expr ,usize1 ) =>{read_value !($iter ,usize ) -1 } ;($iter :expr ,$t :ty ) =>{$iter .next () .unwrap () .parse ::<$t >() .expect ("Parse error" ) } ;}
#[allow(unused_macros)]
macro_rules !dbg {($($a :expr ) ,*) =>{writeln !(&mut stderr () ,concat !($(stringify !($a ) ," = {:?}, " ) ,*) ,$($a ) ,*) .unwrap () ;} }
#[allow(dead_code)]
///refer to https://github.com/hatoo/competitive-rust-snippets
pub const MOD: u64 = 1_000_000_007;
#[allow(dead_code)]
pub fn gcd(a: u64, b: u64) -> u64 {
    if b == 0 {
        a
    } else {
        gcd(b, a % b)
    }
}
#[allow(dead_code)]
pub fn prime_factor(n: u64) -> HashMap<u64, u64> {
    let mut prime_factors: HashMap<u64, u64> = HashMap::new();
    let mut n = n;
    let mut i = 2;
    while i * i <= n {
        while n % i == 0 {
            *prime_factors.entry(i).or_insert(0) += 1;
            n /= i;
        }
        i += 1;
    }
    if n != 1 {
        prime_factors.insert(n, 1);
    }
    prime_factors
}
#[allow(non_snake_case)]
#[allow(dead_code)]
fn main() {
    input! {
        a: u64,
        b: u64,
    }
    let g = gcd(a, b);
    let p = prime_factor(g);
    println!("{}", p.len() + 1);
}

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

int main()
{
  int a[1001],n=-1;
  
  for( ; ; ){
    cin >> n;
    if(n==0) break;
    int sum=0;
    double avg=0,sumh=0;
    
    for(int i=0;i<n;i++){
      cin >> a[i];
      sum +=a[i];
    }
    avg=(double)sum/n;
    
    for(int i=0;i<n;i++){
      sumh += (double) (a[i]-avg)*(a[i]-avg);
    }
    cout.precision(10);
    cout << sqrt(sumh/n) << endl;
    
    n=-1;
  }
  return 0;
}

Measured memory_bytes: 1236
#define STOPIT
#include <bits/stdc++.h>
#define loop(n) for (lint ngtkana_is_a_genius = 0; ngtkana_is_a_genius < lint(n); ngtkana_is_a_genius++)
#define rep(i, begin, end) for (lint i = lint(begin); (i) < lint(end); i++)
#define all(v) v.begin(), v.end()
#define rand(l, r) std::uniform_int_distribution<>(l, r)(mt)
using lint = long long;
auto mt = std::mt19937_64(std::random_device{}());
auto cmn = [](auto&& a, auto b){ if (a > b) {a = b; return true;} return false; };
auto cmx = [](auto&& a, auto b){ if (a < b) {a = b; return true;} return false; };
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { std::cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
#define debug(...)\
  do {\
    std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
    debug_impl(__VA_ARGS__);\
    std::cerr << std::noboolalpha;\
  } while (false)
#else
#define debug(...) {}
#endif

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr>
std::istream& operator>> (std::istream& is, Container& v)
  { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr >
std::ostream& operator<< (std::ostream& os, Container const& v) {
 os << "{";
  for (auto it = v.begin(); it != v.end(); it++)
    {os << (it != v.begin() ? "," : "") << *it;}
  return os << "}";
}

/*
k で割った余りで別ゲーです。
それぞれは前回の手を出せないので、前回出した手を管理しながら最大スコアを見る DP です。
*/

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  int n, k; std::cin >> n >> k;
  int th = 3;
  std::vector<int> s(th); std::cin>>s;
  std::swap(s.at(1),s.at(2));
  std::vector<std::vector<int>> a(k);
  rep(i,0,n) {
    char c; std::cin >> c;
    int x = c == 'r' ? 0
      : c == 'p' ? 1
      : 2;
    x += 1;
    x %= 3;
    a.at(i%k).emplace_back(x);
  }
  debug(s,a);

  int ans = 0;
  for (auto&& v : a) {
    std::vector<int> dp(th,0);
    for (int x : v) {
      std::vector<int> b = {
        x, (x+1)%3, (x+2)%3
      };
      std::vector<int> new_dp(th,0);
      cmx(new_dp.at(x), s.at(x) + std::max(dp.at(b.at(1)), dp.at(b.at(2))));
      rep(i,1,3) {
        int j = 3 - i;
        debug(i,j);
        cmx(new_dp.at(b.at(i)), std::max(dp.at(b.at(0)), dp.at(b.at(j))));
      }

      new_dp.swap(dp);
      debug(dp);
    }
    int now = *std::max_element(all(dp));
    ans += now;
  }
  std::cout << ans << std::endl;
  return 0;
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
template <class T> vector<T> make_vec(size_t a, T val) {
    return vector<T>(a, val);
}
template <class... Ts> auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec(ts...))>(a, make_vec(ts...));
}
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
template <typename T> struct edge {
    int to;
    T cost;
    edge(int t, T c) : to(t), cost(c) {}
};
template <typename T> using WGraph = vector<vector<edge<T>>>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    ll a, b, c, d;
    cin >> a >> b >> c >> d;
    cout << max(a * c, max(b * d, max(b * c, a * d))) << endl;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

ll H, W;
ll input[10][10];
ll visited[10][10];

void dfs(ll x, ll y, ll dist){
	if(input[x][y]==0) return;
	visited[x][y] = max(visited[x][y], dist);
	if(x+1<H) dfs(x+1, y, visited[x][y]+1);
	if(y+1<W) dfs(x, y+1, visited[x][y]+1);
	return;
}

int main(){
	cin >> H >> W;
	string S;
	ll sum = 0;
	REP(i, H){
		cin >> S;
		REP(j, W){
			input[i][j] = (S[j]=='#'?1:0);
			if(S[j]=='#') sum++;
		}
	}

	REP(i, H)REP(j, W) visited[i][j] = -1;
	dfs(0, 0, 0);

	/*
	REP(i, H){
		REP(j, W){
			cout << visited[i][j] << " ";
		}
		cout << endl;
	}
	*/

	cout << (visited[H-1][W-1]==sum-1?"Possible":"Impossible") << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;

  for (long long int i = -1000; i <= 1000; i++) {
    for (long long int j = -1000; j <= 1000; j++) {
      if (i * i * i * i * i - j * j * j * j * j == n) {
        cout << i << " " << j << endl;
        return 0;
      }
    }
  }
}


Measured memory_bytes: 3572
#include <bits/stdc++.h>
using namespace std;
int n;
int main() {
    cin >> n;
    vector<long long> a(n+1, 0);
    vector<long long> sum(n+1, 0);
    for(int i = 0; i < n; ++i) cin >> a.at(i);
    sort(a.begin(), a.end());
    for(int i = 0; i < n; ++i) sum.at(i+1) = sum.at(i) + a.at(i+1);

    int t = 0;
    for(int i = n-1; i >= 1; --i) {
        if(2*sum.at(i) < a.at(i+1)) {
            t = i;
            break;
        }
    }

    cout << n-t << endl;
}

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

inline int read()
{
	int sum=0,ff=1; char ch=getchar();
	while(!isdigit(ch))
	{
		if(ch=='-') ff=-1;
		ch=getchar();
	}
	while(isdigit(ch))
		sum=sum*10+(ch^48),ch=getchar();
	return sum*ff;
}

char ch[10001];

int main()
{
	scanf("%s",ch+1);
	for ( int i=1;i<=strlen(ch+1);i++ )
		if(ch[i]=='7') 
			return printf("Yes\n"),0;
	printf("No\n");
	return 0;
}



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

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	vector<int> a(5);
	cin >> a[0] >> a[1] >> a[2] >> a[3] >> a[4];
	vector<int> p = { 0, 1, 2, 3, 4 };
	int final_answer = INT_MAX;
	do {
		int ans = 0;
		for (int i = 0; i < 5; i++) {
			while (ans % 10 != 0) {
				ans += 1;
			}
			ans += a[p[i]];
		}
		final_answer = min(final_answer, ans);
	} while (next_permutation(p.begin(), p.end()));
	cout << final_answer << '\n';
	
	return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int H,N,i,sum = 0;
    scanf("%d %d",&H,&N);
    int ar[N];
    for(i = 0;i<N;i++)
    {
        scanf("%d",&ar[i]);
    }
    for(i = 0;i<N;i++)
    {
        sum += ar[i];
    }
    if(sum >= H)
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }
    return 0;
}


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

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

  if(a.size()>b.size()) cout << "GREATER" << endl;
  else if(a.size()<b.size()) cout << "LESS" << endl;
  else{
    for (int i = 0; i < (int)a.size(); i++)
    {
      if(a[i]>b[i]) {
        cout << "GREATER" << endl;
        return 0;
      }
      else if(a[i]<b[i]) {
        cout << "LESS" << endl;
        return 0;
      }
    }
    cout << "EQUAL" << endl;    
  }
}

Measured memory_bytes: 256
fun main(args : Array<String>) {
    val (islandsSize, requestsSize) = readLine()!!.split(" ").map { it.toInt() }
    val requests = (1..requestsSize).map {
        val input = readLine()!!.split(" ").map { it.toInt() }
        Pair(input.get(0), input.get(1))
    }

    val sortedByB = requests.sortedBy { it.second }

    var removedBridgeNumber = 0
    var lastRemovedBridge = -1
    sortedByB.forEach {
        val (a, b) = it
        if (a < lastRemovedBridge) {
            //do nothing
        } else {
            lastRemovedBridge = b
            removedBridgeNumber++
        }
    }

    println(removedBridgeNumber)
}

Measured memory_bytes: 80824
// In the name of Allah

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

#define X first
#define Y second
#define mp make_pair
#define pb push_back

const ll MAX = 1e2 + 5, mod = 1e9 + 7, inf = 1e17 + 100;

ll n, a[MAX], res = 1, z = 1;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
	cin >> n;
	for (int i = 0; i < n; i++)
		res *= 3;
	for (int i = 0; i < n; i++)
		cin >> a[i], z *= (a[i] & 1 ? 1 : 2);
	cout << res - z << endl;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var N, K int
	fmt.Scanln(&N, &K)

	var ans, tmp float64

	for i := 1; i <= N; i++ {
		now := i
		tmp = 1.0 / float64(N)
		for now < K {
			now *= 2
			tmp /= 2
		}
		ans += tmp
	}
	fmt.Println(ans)
}


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



int main()
{
    //ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    string s;
    cin >> s;
    long long int n=0;
    for(long long int i = 0; i < s.length(); i++)
    {
        n+= s[i] - '0';
    }
    if(n%9 == 0)
        cout << "Yes";
    else
        cout << "No";
}


Measured memory_bytes: 3488
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
string s;
int a[6],t,n;
void change(int b,int c,int d,int e){
  t=a[b];a[b]=a[c];a[c]=a[d];a[d]=a[e];a[e]=t;
}
int main(){
  while(cin>>n,n){
    int sum=0;
    r(i,6)a[i]=i+1;
    while(n--){
      cin>>s;
      if(s=="North")change(0,1,5,4);
      if(s=="East")change(0,3,5,2);
      if(s=="West")change(0,2,5,3);
      if(s=="South")change(0,4,5,1);
      if(s=="Right")change(1,2,4,3);
      if(s=="Left")change(1,3,4,2);
      sum+=a[0];
    }
    cout<<sum+1<<endl;
  }
}

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

#define dlog(str) cout << "====" << str << endl;
#define INF 999999999
#define MOD 1000000007
#define REP(i, n) for(int i = 0, i##_l = (n); i < i##_l; i++)
#define FOR(i, s, e) for(int i = s, i##_l = (e); i < i##_l; i++)
#define LLI long long int
#define _min(a, b) ((a < b) ? a : b)
#define _max(a, b) ((a < b) ? b : a)
#define chmax(a, b) a = _max(a, b)
#define chmin(a, b) a = _min(a, b)
#define bit(a, shift) ((a>>shift)&1))
#define pm(a) ((a) ? 1 : -1)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort((v).rbegin(), (v).rend())
// int 2.14E±9    lli 9.2E±18    double 1.7E±380

int main() {
    string s;
    cin >> s;
    int cnt = 0;
    REP(i, s.size()) {
        if(s[i] == 'x') {
            cnt++;
        }
    }
    if(8 <= 15 - cnt) {
        cout << "YES";
    } else {
        cout << "NO";
    }
    return 0;
}

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

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

int main(){
    ll k;
    cin>>k;
    ll ans=0;
    for(ll i=1;i<=k;++i){
        for(ll j=1;j<=k;++j){
            for(ll t=1;t<=k;++t){
                ans+=gcd(gcd(i, j), t);
            }
        }
    }
    cout<<ans<<endl;

}

Measured memory_bytes: 3636
fun main (args : Array<String>) {
    val n = readLine()!!.toInt()
    val list = readLine()!!.split(" ")

    var xList : MutableList<Int> = mutableListOf()

    var calc1 : Int = 0
    var calc2 : Int = 0
    var minNum : Int = 0

    for (i in list) {
        xList.add(i.toInt())
    }

    var test : Int = xList.max()!!
    
    for (i in 1..test) {
        calc2 = 0
        for (j in 0..xList.size - 1) {
            calc1 = xList[j] - i
            calc2 += calc1 * calc1
        }

        if (i == 1) {
            minNum = calc2
            continue
        } 

        if (minNum > calc2) {
            minNum = calc2
        }

    }

    println("${minNum}")

}

Measured memory_bytes: 37844
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    String s=sc.next();
    for(int i=0;i<3;i++){
      System.out.print(s.charAt(i)=='1'?9:1);
    }
    System.out.println();
  }
}


Measured memory_bytes: 21716
#include <bits/stdc++.h>
const double PI = acos(-1);
#define rep(i, n) for (int i = 0; i < (int)(n); i++ )
using namespace std;
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}
int main(){
    long long n;
    long  double d,dis;
    cin >> n >> d;
    vector<long long> x(n), y(n);
    rep(i,n) cin >> x.at(i) >> y.at(i);
    long long ans = 0;
    rep(i,n){
        dis = sqrt(x.at(i)*x.at(i) + y.at(i)*y.at(i) );
        if(dis <= d) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 6544
import math

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

sa = B - A + 1;

if sa % 2 == 1 :
	ans = min(N - A, B - 1);
	#chmin(ans, (B - A) / 2);
	ans = min(ans, (B - A) // 2)

	print(ans)
else :
	ans = 10**30;

	# A を 1 に移動させて1勝
	ca = A
	cb = B

	ca = 1;
	cb -= A;

	cand = (cb - ca) // 2 + A;
	ans = min(ans, cand);

	# B を N に移動させて1敗
	ca = A
	cb = B
	cb = N;
	ca += N - B + 1;
	cand = (cb - ca) // 2 + (N - B + 1);

	ans = min(ans, cand);


	print(ans)


Measured memory_bytes: 61796
#include <cstdio>
#include<cmath>
#include<cstring>

int main() {
	char chars[5];
	scanf("%s", chars);
	int flag = 0;
	if ((chars[0] == chars[1] && chars[1] == chars[2]) || (chars[1]== chars[2] && chars[2] == chars[3])) {
		flag = 1;
	}
	printf("%s\n",flag?"Yes":"No");
}

Measured memory_bytes: 128
#include<stdio.h>
int max;
void mo(int, int, int);
int d[100][100];
int main()
{
	int i, i2;
	int n, m;
	while (1){
		scanf("%d %d", &m, &n);
		if (m == 0 && n == 0)break;
		for (i = 0; i < n + 2; i++){
			d[i][0] = 0;
			d[i][m + 1];
		}
		max = 0;
		for (i = 1; i <= m; i++){
			d[0][i] = 0;
			d[n + 1][i] = 0;
			for (i2 = 1; i2 <= n; i2++){
				scanf("%d", &d[i][i2]);

			}
		}
		for (i = 1; i <= m; i++){
			for (i2 = 1; i2 <= n; i2++){
				if (d[i][i2] == 1)mo(i, i2, 0);
			}
		}
		printf("%d\n", max);
	}
	return 0;
}
void mo(int x, int y, int c){
	d[x][y] = 0;
	c++;
	if (d[x][y + 1] == 1)mo(x, y + 1, c);
	if (d[x][y - 1] == 1)mo(x, y - 1, c);
	if (d[x - 1][y] == 1)mo(x - 1, y, c);
	if (d[x + 1][y] == 1)mo(x + 1, y, c);
	d[x][y] = 1;
	if (c > max)max = c;
}

Measured memory_bytes: 636
while 1:
    m,f,r = map(int,raw_input().split())
    if m == f == r:
        break
    if m == -1:
        s = "F"
    elif f == -1:
        s = "F"
    elif m+f >= 80:
        s = "A"
    elif m+f >= 65:
        s = "B"
    elif m+f >= 50:
        s = "C"
    elif m+f >= 30:
        if r >= 50:
            s = "C"
        else:
            s = "D"
    else:
        s = "F"
    print s

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

int main() {
    int n, h, m,s;
    cin>>n;
    
    h = n / ( 60 * 60 );
    n -= h * 60 * 60;

    m = n / 60;
    n -= m * 60;

    s = n;

    cout<<h<<":"<<m<<":"<<s<<endl;

    return 0;
}

Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin>>N;
    vector<int>A(N);
    for(int i=0;i<N;i++)cin>>A[i];
    int minv=0;
    sort(A.begin(),A.end());
    minv=A[0];
    int maxv=0;
    reverse(A.begin(),A.end());
    maxv=A[0];
    cout<<maxv-minv<<endl;
}

Measured memory_bytes: 256
num = int(input())
 
vals = list(map(int,input().split()))
 
cnt = 0
flag = True
while(flag):
	for i in range(num):
		if vals[i] % 2 == 1:
			print(cnt)
			flag = False
			break
		else:
			vals[i] = vals[i] / 2
	cnt += 1

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

int main() {
    int A,B,C,X,Y;
    cin >> A;
    cin >> B;
    cin >> C;
    cin >> X;
    cin >> Y;

    int max_number = max(X, Y)*2;
    int min_cost = C*max_number;
    int num_A, num_B;
    int cost;
    //int min_A=0, min_B=0, min_C=0;
    for(int num_C=0; num_C < max_number; num_C++){
        num_A = max(X - num_C / 2, 0);
        num_B = max(Y - num_C / 2, 0);
        cost = A * num_A + B * num_B + C * num_C;
        if(cost < min_cost) {
            min_cost = cost;
            /*min_A =  num_A;
            min_B =  num_B;
            min_C  = num_C;*/
        }
    }
    cout << min_cost << endl;
    //cout << min_A <<  min_B << min_C  << endl;
    return 0;
}

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

template <typename T> void chmin(T&x,const T &y)
{
	if(x>y)x=y;
}
template <typename T> void chmax(T &x,const T &y)
{
	if(x<y)x=y;
}
typedef long long s64;
typedef unsigned long long u64;
typedef unsigned int u32;
typedef pair<int,int> pii;
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define per(i,r,l) for(int i=r;i>=l;--i)
#define rep0(i,l,r) for(int i=l;i<r;++i)
#define gc (c=getchar())
int read()
{
	char c;
	while(gc<'-');
	if(c=='-')
	{
		int x=gc-'0';
		while(gc>='0')x=x*10+c-'0';
		return -x;
	}
	int x=c-'0';
	while(gc>='0')x=x*10+c-'0';
	return x;
}
#undef gc

const int N=100+5;
int a[N],ans[N];

int main()
{
#ifdef kcz
	freopen("1.in","r",stdin);//freopen("1.out","w",stdout);
#endif
	int n;
	cin>>n;
	rep(i,1,n)cin>>a[i];
	per(i,n,1)
	{
		int j=i;
		while(a[j]!=j)--j;
		if(j==0)
		{
			puts("-1");
			exit(0);
		}
		ans[i]=j;
		rep(k,j,i-1)a[k]=a[k+1];
	}
	rep(i,1,n)printf("%d\n",ans[i]);
}


Measured memory_bytes: 256
#include <iostream>
#include <map>

using namespace std;

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

  map<int, int> mp;
  mp[0]++;

  long long ans = 0;
  int cur = 0, b = 1;
  for (int i = s.length() - 1; i >= 0; i--) {
    cur += (s[i] - '0') * b;
    cur %= 2019;
    ans += mp[cur]++;
    b = (b * 10) % 2019;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 3660
#include <iostream>
#include <algorithm>
using namespace std;
int d[10][10];
int sum[10];
const int INF=10000;
int main(void){
  while(1){
   int n;
   cin>>n;
   if(n==0)break;
   for(int i=0;i<10;i++){
       for(int j=0;j<10;j++){
           d[i][j]=INF;
           if(i==j)d[i][j]=0;
       }
   }
   for(int i=0;i<n;i++){
       int s,t,c;
       cin>>s>>t>>c;
       d[s][t]=d[t][s]=c;
   }
   for(int k=0;k<10;k++){
       for(int i=0;i<10;i++){
           for(int j=0;j<10;j++){
               d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
           }
       }
   }
   int ans=10000000,ansn=0;
   for(int i=0;i<10;i++)sum[i]=0;
      for(int i=0;i<10;i++){
          for(int j=0;j<10;j++){
              if(d[i][j]>=INF)continue;
              sum[i]+=d[i][j];
          }
          if(sum[i]==0)continue;
          if(ans>sum[i]){
              ansn=i;
              ans=sum[i];
          }
      }
      cout<<ansn<<' '<<ans<<endl;
  }
}

Measured memory_bytes: 3096
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>

using namespace std;
int main(int argc, char *argv[]) {
    	char S[3];
		int count = 0;
		scanf("%s",S);
		for(int i = 0; i < 3; i++){
			if(S[i] == 'o')
				count++;
		}
		printf("%d\n",700+count*100);
}

Measured memory_bytes: 256
/*input

*/

#include <bits/stdc++.h>
#include <unistd.h>

#define rep(i,j,n) for(i=j;i<n;i++)
#define repi(i,j,n) for(i=j;i>n;i--)
#define inf 1e18
#define M 1000000007
#define pie 3.141592653589793238
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>
#define pb push_back
#define F first
#define S second
#define endl '\n'
#define UQ(x) (x).resize(distance((x).begin(),unique(x.begin(),x.end())))

using namespace std;

mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
mt19937_64 rnd64(chrono::high_resolution_clock::now().time_since_epoch().count());

ll power(ll a,ll m,ll mod){
	ll ans=1;
	while(m){
		if(m%2) ans*=a, ans%=(mod);
		a=(a*a)%(mod);
		m>>=1;
	}
	return ans;
}


void init(ll* a,ll n,ll val){
	for(ll i=0;i<n;i++)
		a[i]=val;
}

void solve(){
	ll i,j,_;
	ll n,k;
	cin>>n>>k;
	ll a[n];
	rep(i,0,n) cin>>a[i], --a[i];
	ll ans[k];
	vector<pair<pll,ll> > v(k);
	rep(i,0,k) {
		cin>>v[i].F.F>>v[i].F.S;
		v[i].S = i;
		v[i].F.F--;
		v[i].F.S--;
	}
	ll sq = 800;
	sort(v.begin(),v.end(),[&](pair<pll,ll> &a, pair<pll,ll> &b){
		if(a.F.F/sq == b.F.F/sq) return a.F.S < b.F.S;
		return a.F.F/sq < b.F.F/sq; 
	});
	ll l = 0, r = 0, now = 1;
	ll c[n] = {0};
	c[a[0]] = 1;
	for(auto i : v) {
		while(r < i.F.S) {
			r++;
			c[a[r]]++;
			now += (c[a[r]] == 1);
		}
		while(l > i.F.F) {
			l--;
			c[a[l]]++;
			now += (c[a[l]] == 1);
		}
		while(l < i.F.F) {
			c[a[l]]--;
			now -= (c[a[l]] == 0);
			l++;
		}
		while(r > i.F.S) {
			c[a[r]]--;
			now -= (c[a[r]] == 0);
			r--;
		}
		ans[i.S] = now;
	}
	for(auto i : ans) cout << i << endl;
}	

int main()
{
	ios::sync_with_stdio(0);
 	cin.tie(0);
	ll T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}




Measured memory_bytes: 27160
#include <iostream>

using namespace std;

int main(){
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;
    int dx=tx-sx, dy=ty-sy;
    int i;
    for(i=dx;i>0;--i){
        cout << "R";
    }
    for(i=dy;i>0;--i){
        cout << "U";
    }
    for(i=dx;i>0;--i){
        cout << "L";
    }
    for(i=dy;i>0;--i){
        cout << "D";
    }
    cout << "D";
    for(i=dx+1;i>0;--i){
        cout << "R";
    }
    for(i=dy+1;i>0;--i){
        cout << "U";
    }
    cout << "L";
    cout << "U";
    for(i=dx+1;i>0;--i){
        cout << "L";
    }
    for(i=dy+1;i>0;--i){
        cout << "D";
    }
    cout << "R";
    return 0;
}

Measured memory_bytes: 256
#!python3

def resolve():
    N = int(input().rstrip())
    A = []

    ok = dict()
    ng = dict()
    for i in range(N):
        a = []
        for j in range(int(input().rstrip())):
            x, y = map(int, input().rstrip().split())
            a.append((x, y))

        A.append(a)

    def cbit(n):
        i = 0
        while n:
            if n & 1:
                i += 1
            n >>= 1
        return i

    def check(i, t):
        for x, y in t:
            ii = i & (1 << (x-1))
            if y == 1:
                if ii == 0: return False
            else:
                if ii != 0: return False
        return True

    n = -1
    for i in range(2**N-1, -1, -1):
        n0 = cbit(i)
        if n0 <= n: continue

        for j in range(N):
            k = 1 << j
            if not i & k:
                continue
            if not check(i, A[j]):
                break
        else:
            n = n0
    print(n)


if __name__ == "__main__":
    resolve()


Measured memory_bytes: 3064
#include<cstdio>

int main() {
   int a,b,c,d,e;
   d = 0, e = 0;
   scanf("%d %d %d",&a,&b,&c);
   for(int i = 1;i <= c;i++){
       if(c % i == 0&&i >= a){
           for(int d = a;d <= b;d++){
               if(d % i == 0){
                   e = e + 1;
                   break;
               }
           }
       }
   }
   printf("%d\n",e);


}



Measured memory_bytes: 2740
import java.io.*
import java.util.*

fun solve(N: Int, A: IntArray) {
    val a = A.toSet()
    val M = a.max()!!
    val M2 = if (A.count{ it == M } >= 2) M else (a - M).max()!!
    val ans = A.map{ if (it == M) M2 else M }.joinToString(separator="\n")
    println(ans)
    return
}

fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val N = sc.next().toInt()
    val A = IntArray(N)
    for (i in 0 until N) {
        A[i] = sc.next().toInt()
    }
    solve(N, A)
}


Measured memory_bytes: 72756
#include <iostream>
#include <cstring>
#include <vector>
using namespace std;
int N, H;
int LD[205], RD[205], LU[205], RU[205];
int Out[405], In[405], Use[405], ok;
vector <int> G[405];
const int add = 201;
void Read()
{
    cin >> N >> H;
    for(int i = 1; i <= N; i++)
    {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        int l, r;
        if(c > 0)
        {
            l = -c;
        }
        else
            l = a;
        if(d > 0)
        {
            r = d;
        }
        else
            r = -b;
        G[l + add].push_back(r + add);
        G[r + add].push_back(l + add);
        In[r + add]++;
        Out[l + add]++;
    }
}

void DFS(int node)
{
    Use[node] = 1;
    if(In[node] != Out[node])
    {
        ok = 1;
    }
    for(int i = 0; i < G[node].size(); i++)
    {
        int neighb = G[node][i];
        if(Use[neighb] == 0)
            DFS(neighb);
    }
}
int main()
{
    Read();
    for(int i = 1; i <= 402; i++)
        if(Use[i] == 0 && G[i].size() > 0)
        {
            ok = 0;
            DFS(i);
            if(ok == 0)
            {
                cout << "NO\n";
                return 0;
            }
        }
    for(int i = 1; i <= 402; i++)
    {
        if(i < add && In[i] < Out[i])
        {
            cout << "NO\n";
            return 0;
        }
        if(i > add && In[i] > Out[i])
        {
            cout << "NO\n";
            return 0;
        }

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


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <numeric>
#include <vector>
#include <map>

struct UnionFind {
    int n, gnum;
    std::vector<int> par;

    explicit UnionFind(int n) : n(n), gnum(n), par(n) {
        std::iota(par.begin(), par.end(), 0);
    }

    int find(int v) {
        return par[v] == v ? v : par[v] = find(par[v]);
    }

    void unite(int u, int v) {
        u = find(u);
        v = find(v);
        if (u == v) return;

        --gnum;
        par[v] = u;
    }
};

void fail() {
    std::cout << "No" << std::endl;
    std::exit(0);
}

void succ() {
    std::cout << "Yes" << std::endl;
    std::exit(0);
}

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

    std::vector<int> a(n), b(n);
    for (auto& x : a) std::cin >> x;
    for (auto& x : b) std::cin >> x;

    {
        // bを昇順にする
        std::vector<int> idx(n);
        std::iota(idx.begin(), idx.end(), 0);
        std::sort(idx.begin(), idx.end(),
                  [&](int i, int j) { return b[i] < b[j]; });

        auto oa = a, ob = b;
        for (int i = 0; i < n; ++i) {
            a[i] = oa[idx[i]];
            b[i] = ob[idx[i]];
        }
    }

    // そもそも達成可能か
    auto sa = a;
    std::sort(sa.begin(), sa.end());
    for (int i = 0; i < n; ++i) {
        if (sa[i] > b[i]) fail();
    }

    // 全体をソートしなくて良いか
    for (int i = 0; i + 1 < n; ++i) {
        if (sa[i + 1] <= b[i]) succ();
    }

    // 座圧して順列に変換
    std::map<int, int> reva;
    for (int i = 0; i < n; ++i) reva[sa[i]] = i;
    for (auto& x : a) x = reva[x];

    // 連結成分数でスワップ回数を判定
    UnionFind uf(n);
    for (int i = 0; i < n; ++i) uf.unite(i, a[i]);

    if (uf.gnum > 1) {
        succ();
    } else {
        fail();
    }
    return 0;
}


Measured memory_bytes: 6504
import collections

n, q = map(int, raw_input().split())
datalist = [raw_input().split() for i in range(n)]

datalist = collections.deque(datalist)

time = 0
while len(datalist):
	data = datalist.popleft()
	data[1] = int(data[1])
	
	if data[1] <= q:
		time += data[1]
		print data[0], time
		
	else:
		time += q
		data[1] = data[1] - q
		datalist.append(data)

Measured memory_bytes: 17940
from sys import stdin
n = int(stdin.readline().rstrip())
a = list(map(int, stdin.readline().rstrip().split()))
b = list(map(int, stdin.readline().rstrip().split()))
c = list(map(int, stdin.readline().rstrip().split()))

res = 0
predish = -999
for dish in a:
    res += b[dish - 1]
    if dish - predish == 1:
        res += c[predish - 1]
    predish = dish

print(res)

Measured memory_bytes: 38384
# 入力割り当て
N, A, B = map(int, input().split())

# 変数割り当て
n = 0
sum = 0

# nをNまでインクリメントし繰り返し処理
for n in range(N+1):
	# 各桁の和
	m = n//10000 + n%10000//1000 + n%1000//100 + n%100//10 + n%10
	if A <= m:
		if m <= B:
			# nの各桁がA以上B以下ならsumに加算
			sum += n
# nをインクリメント
n +=1

# 結果の表示
print(sum)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

int main() {
  int N;
  cin >> N;
  vector<ll> H(N);
  for (int i = 0; i < N; i++) cin >> H[i];
  ll ans = 0, cnt = 0, cur = H[0];

  for (int i = 1; i < N; i++) {
    if (H[i] <= cur)
      cnt += 1;
    else
      cnt = 0;

    cur = H[i];
    ans = max(ans, cnt);
  }
  cout << ans << endl;
  return 0;
}

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

const int BIT = 19;
const int N = 1 << BIT;
using pii = std::pair <int, int>;

int v[N], w[N];
pii a[N], b[N];
pii tmp[N];

int solve(const std::vector<pii> &vec, int l){
    auto build = [&](const std::vector<pii> &vec, pii *a){
        int cur = 1;
        a[0] = {0, 0};
        for (auto p : vec){
            for (int i = 0; i < cur; ++ i){
                a[i + cur].first = a[i].first + p.first;
                a[i + cur].second = a[i].second + p.second;
            }
            std::merge(a, a + cur, a + cur, a + 2 * cur, tmp);
            memcpy(a, tmp, sizeof(pii) * 2 * cur);
            cur <<= 1;
        }
    };
    if (vec.size() <= 1){
        build(vec, a);
        int ans = 0;
        for (int i = 0; i < 1 << vec.size(); ++ i){
            if (a[i].first <= l){
                ans = std::max(ans, a[i].second);
            }
        }
        return ans;
    }
    std::vector<pii> left, right;
    for (int i = 0; i < vec.size() / 2; ++ i){
        left.emplace_back(vec[i]);
    }
    for (int i = vec.size() / 2; i < vec.size(); ++ i){
        right.emplace_back(vec[i]);
    }
    build(left, a);
    build(right, b);
    int na = 1 << left.size(), nb = 1 << right.size();
    int max = -1, ans = 0;
    for (int i = 0, j = nb - 1; j >= 0; -- j){
        while (i < na && a[i].first + b[j].first <= l){
            max = std::max(max, a[i].second);
            ++ i;
        }
        if (max == -1){
            continue;
        }
        ans = std::max(ans, max + b[j].second);
    }
    return ans;
}

int main(){
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++ i){
        scanf("%d%d", &w[i], &v[i]);
    }
    int test;
    scanf("%d", &test);
    while (test --){
        int vertex, l;
        scanf("%d%d", &vertex, &l);
        std::vector <pii> vec;
        while (vertex){
            vec.emplace_back(v[vertex], w[vertex]);
            vertex /= 2;
        }
        printf("%d\n", solve(vec, l));
    }
    return 0;
}

Measured memory_bytes: 5872
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    ll a,b,c;
    cin>>a>>b>>c;
    if(b>=(a*c))
        cout<<c<<endl;
    else
        cout<<b/a<<endl;
    return 0;
}


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

#define rep(i,a,b)      for(int i=a;i<=b;i++)
#define revp(i,b,a)     for(int i=b;i>=a;i--)

int n,m,arr[32],temp,cnt=0,k;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    

    cin>>n>>m;
    rep(i,1,n)
    {
        cin>>k;
        rep(j,1,k)
            {
                cin>>temp;
                arr[temp]++;
            }
    }
    rep(i,1,m)
        if(arr[i]==n)
            cnt++;
    cout<<cnt;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
typedef pair<ll,string> Pls;
const ll INF=10000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};
struct pos{
	// 1 変数を入れる;
	ll x,cost;
};
int main() {

	int a,b;
	cin>>a>>b;
	if(a+b==15)cout<<"+"<<endl;
	else if(a*b==15)cout<<"*"<<endl;
	else cout<<"x"<<endl;

	return 0;
}


Measured memory_bytes: 256
def scanf(scanstr,data_format):
    scanstr=scanstr.split(" ")
    if(type(data_format) is not list):
        print("data_format error")
    if(len(scanstr)!=len(data_format)):
        print("Error")
        return -1
    j=0
    for kata in data_format:
        if(kata=="str"):
            scanstr[j]=str(scanstr[j])
        if(kata=="int"):
            scanstr[j]=int(scanstr[j])
        j=j+1
    return scanstr
data=scanf(input(),["int","int"])
if data[0]==1 or data[1]==1:
    print(1)
elif (data[0]*data[0])%2==0:
    print(str(round((data[0]*data[1])/2)))
else:
    print(str(round((data[0]*data[1]+1)/2)))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
using namespace std;
typedef pair<ll,ll> pll;


ll n;
vector< ll > v[100005];
ll p[100005];
ll sz[100005];
ll fs(ll x)
{
        return p[x] == x ? x : p[x] = fs(p[x]);
}
inline void ms(ll x, ll y)
{
        x=fs(x); y=fs(y);
        if(x == y) return;
        sz[x] += sz[y];
        sz[y]=0;
        p[y] = x;
}
int main()
{
        ios_base::sync_with_stdio(false);
        cin.tie(NULL); cout.tie(NULL);
        cin >> n;
        for(ll i=1;i<=100001;i++) {
                p[i]=i;
                sz[i]=1;
        }
        for(ll i=1;i<=n;i++) {
                ll x , y;
                cin >> x >> y;
                v[y].pb(x);
        }
        for(ll i=0;i<=100000;i++) {
                if(v[i].size() > 1) {

                        for(ll j=1;j<v[i].size();j++) {
                                ms(v[i][j-1], v[i][j]);
                        }
                }
        }
        ll ans = 0;
        for(ll i=1;i<=100000;i++) {
                if(v[i].size() > 0) {
                        ans += sz[fs(v[i][0])] - (ll)v[i].size();
                }
        }
        cout << ans << endl;
        return 0;
}


Measured memory_bytes: 6016
#include <cstdio>
#include <algorithm>

using namespace std;

typedef long long int llint;

const int N = 1e5 + 500;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;

llint n,m,sol;

int main(){
    scanf("%lld %lld",&n,&m);
    llint c = min(n , m / 2);
    sol += c;
    n -= c;
    m -= 2 * c;
    sol += m / 4;
    printf("%lld\n",sol);
}


Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define int ll
typedef vector<int> vi;
typedef pair<int,int> pii;
int sx,sy,gx,gy;

bool range(int x,int y){
  if(min(sx,gx)<=x && x<=max(sx,gx) && 
     min(sy,gy)<=y && y<=max(sy,gy))
    return true;
  return false;
}

signed main(void) {
  int i,j;
  int x1,x2,y1,y2,n;
  cin>>x1>>y1>>x2>>y2;
  sx=min(x1,x2);
  gx=max(x1,x2);
  sy=min(y1,y2);
  gy=max(y1,y2);
  cin>>n;
  pii p[200000];
  rep(i,n){
    cin>>p[i].first>>p[i].second;
    if(!range(p[i].first,p[i].second))i--,n--;
  }
  if(x1>x2)rep(i,n)p[i].first*=-1;
  if(y1>y2)rep(i,n)p[i].second*=-1;
  int num=0;
  if(n){
    sort(p,p+n);
    vi v(n);
    rep(i,n)v[i]=p[i].second;
    int dp[100000]; 
    fill(dp,dp+n,INF);
    rep(i,n) *lower_bound(dp,dp+n,v[i])=v[i];
    num=lower_bound(dp,dp+n,INF)-dp;
  }
  ld ans=(ll)(abs(sx-gx)+abs(sy-gy))*100;
  if(abs(num-abs(sx-gx)-1)<EPS || abs(num-abs(sy-gy)-1)<EPS)
    ans+=5*3.141592653589793238;
  cout<<shosu(13)<<ans-20*num+num*5*3.141592653589793238<<endl;
}


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

// ワーシャルフロイド法
// 頂点が制限された状態での最短コスト(最短経路)を計算し、dp で記録、負のコストでも解ける O(n^3)
// 参考資料：https://qiita.com/ageprocpp/items/cdf67e828e1b09316f6e#%E3%83%AF%E3%83%BC%E3%82%B7%E3%83%A3%E3%83%AB%E3%83%95%E3%83%AD%E3%82%A4%E3%83%89%E6%B3%95

#define INF 2147483647
#define KNUM 10

int main() {
    // マス目の大きさ入力
    int nHeight, nWidth;
    cin >> nHeight >> nWidth;
    // 魔力入力
    vector<vector<int>> cost(KNUM, vector<int>(KNUM));
    for (int i = 0; i < KNUM; i++){
        for (int j = 0; j < KNUM; j++){    
            cin >> cost.at(i).at(j);
        }
    }
    // マス目に書かれた数字の情報
    vector<vector<int>> a(nHeight, vector<int>(nWidth));
    for (int i = 0; i < nHeight; i++){
        for (int j = 0; j < nWidth; j++){    
            cin >> a.at(i).at(j);
        }
    }
    
    // 魔力の最小値を調べる
    vector<vector<int>> dp(KNUM, vector<int>(KNUM, INF));
    for (int k = 0; k < KNUM; k++){
        dp[k][k] = min(dp[k][k], cost[k][k]);
        for (int i = 0; i < KNUM; i++){
            dp[i][k] = min(dp[i][k], cost[i][k]);
            for (int j = 0; j < KNUM; j++){
                dp[k][j] = min(dp[k][j], cost[k][j]);
                if (dp[i][k] != INF && dp[k][j] != INF){
                    dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j]);
                }
            }
        }        
    }

    int costSum = 0; 
    for (int i = 0; i < nHeight; i++){
        for (int j = 0; j < nWidth; j++){
            if (a[i][j] != -1){
                costSum += dp[a[i][j]][1];
            }
        }
    }

    cout << costSum << endl;

    return 0;
}


Measured memory_bytes: 3780
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define fi first
#define sc second
#define pb push_back
#define COUT(x) cout << (x) << "\n"
#define COUTF(x) cout << setprecision(15) << (x) << "\n"
#define ENDL cout << "\n"
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SZ(x) (ll) x.size()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define MAX(x, y, z) max(a, max(b, c))
#define MIN(x, y, z) min(a, min(b, c))
#define ANS cout << ans << "\n"
#define RETURN(x)    \
  cout << x << "\n"; \
  return 0
clock_t CLOCK;
#define START_TIMER CLOCK = clock()
#define SHOW_TIMER cerr << "time: " << (ld)(clock() - CLOCK) / 1000000 << "\n"
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define LINE cerr << "[debug] line: " << __LINE__ << "\n";
#define debug(x) cerr << "[debug] " << #x << ": " << x << "\n";
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << "\n";
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll, ll>;
using qll = queue<ll>;
using P = pair<ll, ll>;

constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

signed main() {
  init();
  ll X, t;
  cin >> X >> t;
  ll ans = max(0ll, X - t);
  ANS;
  return 0;
}

Measured memory_bytes: 3656