akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <numeric>
#include <cstdlib>
#include <map>
#include <set>
#include <algorithm>
#include <math.h>
 
using namespace std;

int main(){
    int N;
    vector<pair<pair<string,int>, int>> S;

    cin >> N;

    for(int i = 0; i < N; i++){
        string s;
        int p;
        cin >> s >> p;

        p = 100-p;

        S.push_back(make_pair(make_pair(s,p), i+1));
    }

    sort(S.begin(), S.end());

    for(int i = 0; i < N; i++){
        cout << S[i].second << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int p,q,r;
	
	scanf("%d%d%d",&p,&q,&r);
	
	int a,b,c;
	
	a = p + q;
	b = p + r;
	c = q + r;
	
	int min = a;
	
	if(min > b){
		min = b;
	}
	
	if(min > c){
		min = c;
	}
	
	printf("%d\n",min);
	
	return 0;
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
	int n=sc.nextInt();

	System.out.print("Christmas");
	for(int i=1;i<=25-n;i++){
		System.out.print(" Eve");
	}
	System.out.println();
	}}

Measured memory_bytes: 21716
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  long int ans=1;
  map<int,int>prime;
  for(int i=2;i<=n;i++){
    int a=i;
    for(int j=2;j<=i;j++){
      for(;;){
        if(a%j==0){
          prime[j]++;
          a/=j;
        }
        else 
          break;
      }
    }
  }
  map<int,int>::iterator i=prime.begin();
  while(i!=prime.end()){
    ans*=i->second+1;
    ans%=1000000007;
    i++;
  }
  cout<<ans<<endl;
}
        

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const int MOD = 1000000007;
const double PI = acos(-1);
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};

void solve() {
	int n;
	cin >> n;
	vector<int> a(n), b(n), c(n);
	rep(i,n) cin >> a[i];
	rep(i,n) cin >> b[i];
	rep(i,n) cin >> c[i];

	sort(ALL(a));
	sort(ALL(b));
	sort(ALL(c));

	ll ans = 0;

	rep(i,n) {
		int t = b[i];
		int numA = max(0, (int) (lower_bound(ALL(a), t) - a.begin()));
		int numC =  max(0, (int) (c.end() - upper_bound(ALL(c), t)));
		ans += (ll) numA * numC;
	}

	cout << ans << endl;
}

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

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

#define rep(i,l,r) for(int i=l;i<=r;++i)
const int N=1e5+5;
int a[N];

void out()
{
	puts("No");
	exit(0);
}

int main()
{
	//freopen("1.in","r",stdin);
	int n;
	cin>>n;
	int mx=0;
	rep(i,1,n)
	{
		scanf("%d",a+i);
		mx=max(mx,a[i]);
	}
	int x=0,y=0;
	rep(i,1,n)
	if(a[i]==mx)++x; else
	if(a[i]==mx-1)++y; else
		out();
	if(x>1&&((mx>=y+1&&mx<=y+x/2)||(y==0&&mx==n-1)))puts("Yes");
	else out();
}

Measured memory_bytes: 640
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
//#include <utility>
#include <set>
#include <iostream>
//#include <memory>
#include <string>
#include <vector>
#include <algorithm>
//#include <functional>
#include <sstream>
//#include <deque>
#include <complex>
#include <stack>
#include <queue>
#include <cstdio>
//#include <cctype>
#include <cstring>
//#include <ctime>
#include <iterator>
#include <bitset>
//#include <numeric>
//#include <list>
//#include <iomanip>

#if __cplusplus >= 201103L
#include <array>
#include <tuple>
#include <initializer_list>
#include <unordered_set>
#include <unordered_map>
#include <forward_list>

#define cauto const auto&
#else

#endif

using namespace std;


namespace{
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;

#define VV(T) vector<vector< T > >

template <class T>
void initvv(vector<vector<T> > &v, int a, int b, const T &t = T()){
    v.assign(a, vector<T>(b, t));
}

template <class F, class T>
void convert(const F &f, T &t){
    stringstream ss;
    ss << f;
    ss >> t;
}


#define reep(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) reep((i),0,(n))
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define F first
#define S second
#define mkp make_pair
#define RALL(v) (v).rbegin(),(v).rend()


#define MOD 1000000007LL
#define EPS 1e-8
static const int INF=1<<24;

void mainmain(){
  int w,h;
  cin>>w>>h;
  int x,y,r;
  cin>>x>>y>>r;
  vector<pii> v;
  int d[]={-1,1,1,-1,-1};
  rep(i,4){
    v.PB(mkp(x+r*d[i],y+r*d[i+1]));
  }
  rep(i,4){
    if(v[i].F<0||v[i].F>w||v[i].S<0||v[i].S>h){
      puts("No");
      return;
    }
  }
  puts("Yes");
}



}
main() try{
    mainmain();
}
catch(...){
}

Measured memory_bytes: 1144
#include <iostream>
#include <queue>
#include <algorithm>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

struct NODE{ int x, y, cost, di; };
bool operator>(const NODE &a,const NODE &b){
	return a.cost > b.cost;
}

NODE move(int cmd,const NODE &n){
	NODE ret;
	
	ret.di = (n.di + cmd)%4;
	ret.x = n.x + dx[ret.di];
	ret.y = n.y + dy[ret.di];
	
	return ret;
}

int w,h;
bool check(const NODE &n){
	return n.x >= 0 && n.y >= 0 && n.x < w && n.y < h;
}
int main(){
	
	while(cin >> w >> h,w){
		int data[30][30],c[4];
		rep(i,h)rep(j,w)cin >> data[i][j];
		rep(i,4)cin >> c[i];
		
		priority_queue<NODE,vector<NODE>,greater<NODE> > Q;
		NODE t = {0,0,0,0}; Q.push(t);

		bool done[30][30][4] = {false};
		
		while(Q.size()){
			NODE q = Q.top(); Q.pop();
			if(done[q.y][q.x][q.di])continue;
			done[q.y][q.x][q.di] = true;
			
			if(q.x == w-1 && q.y == h-1){
				cout << q.cost << endl;
				break;
			}
			rep(i,4){
				NODE mv = move(i,q);
				mv.cost = q.cost;
				if(data[q.y][q.x] != i)mv.cost += c[i];
				if(check(mv))Q.push(mv);
			}
		}
	}
}
	

Measured memory_bytes: 1044
from math import floor, ceil

H, W = [int(_) for _ in input().split()]


def f(H, W):
    res = 1e12
    for i in range(1, H + 1):
        a = i
        b = (H - a) // 2
        c = H - a - b
        d = max(a, b, c) - min(a, b, c)
        res = min(res, d * W)

        a = i * W
        H2 = H - i
        b = W // 2
        c = W - b
        b *= H2
        c *= H2
        d = max(a, b, c) - min(a, b, c)
        res = min(res, d)

    return res


ans = min(f(H, W), f(W, H))
print(ans)


Measured memory_bytes: 3064
using System;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int r = a[0];
        int D = a[1];
        int x = a[2];
        for(int i = 0;i < 10; i++)
        {

            x = r * x - D; 
            Console.WriteLine(x);
        }
        
    }
}

Measured memory_bytes: 11348
#include <iostream>
#include <fstream>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <functional>
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int L[2010];
    rep(i, N) cin >> L[i];
    sort(L, L + N);
    ll ans = 0;
    for(int i = 0; i < N; i++) {
        for(int j = i + 1; j < N; j++) {
            int ok1 = j;
            int ng1 = N;
            int ok2 = N;
            int ng2 = j - 1;
            while(abs(ok1 - ng1) > 1) {
                int mid = (ok1 + ng1) / 2;
                if(abs(L[j] - L[mid]) < L[i]) ok1 = mid;
                else ng1 = mid;
            }
            while(abs(ok2 - ng2) > 1) {
                int mid = (ok2 + ng2) / 2;
                if(L[i] < L[j] + L[mid]) ok2 = mid;
                else ng2 = mid;
            }
            //cout << ok1 << " " << ok2 << endl;
            ans += ok1 - ok2;
        }
    }
    cout << ans << endl;

    return 0;
}
// abs(b - c) < a < b + c, 

Measured memory_bytes: 3624
mod = 1000000007
eps = 10**-9


def main():
    import sys
    input = sys.stdin.readline

    S = input().rstrip('\n')

    ans = 1000
    for i in range(26):
        t = chr(i+97)
        if S == t*len(S):
            print(0)
            exit()
        if t not in S:
            continue
        cnt = 0
        S_tmp = S[:]
        while True:
            ok = 1
            cnt += 1
            new = []
            for j in range(len(S_tmp)-1):
                if S_tmp[j] != t and S_tmp[j+1] != t:
                    ok = 0
                    new.append(S_tmp[j])
                else:
                    new.append(t)
            if ok:
                break
            S_tmp = ''.join(new)
        ans = min(ans, cnt)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 39664
using System;

class Program
{
	static void Main(string[] args)
	{
		string[] strInput = Console.ReadLine().Split(' ');
		int a = int.Parse(strInput[0]);
		int b = int.Parse(strInput[1]);
		int h = int.Parse(strInput[2]);
		int m = int.Parse(strInput[3]);

		int elapsedMin = h * 60 + m;    //経過時間[min]

		double JishinDeg = (elapsedMin * 360.0 / 720.0) % 360.0;    //時針角度[deg.]
		double HunshinDeg = (elapsedMin * 360.0 / 60.0) % 360.0;    //分針角度[deg.]

		//Rθ→XY座標系
		double JiX = a * Math.Cos(JishinDeg * Math.PI / 180.0);
		double JiY = a * Math.Sin(JishinDeg * Math.PI / 180.0);
		double HunX = b * Math.Cos(HunshinDeg * Math.PI / 180.0);
		double HunY = b * Math.Sin(HunshinDeg * Math.PI / 180.0);

		double x = JiX - HunX;
		double y = JiY - HunY;

		double result = Math.Sqrt(x * x + y * y);
		Console.WriteLine(result.ToString("0.00000000000000000000"));
		return;
	}
}

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

int main() {
  char a, b;
  cin >> a >> b;
  char ans;
  
  if(a == 'H'){
    if(b == 'H')
      ans = 'H';
    else
      ans = 'D';
  }
  if(a == 'D'){
    if(b == 'H')
      ans = 'D';
    else
      ans = 'H';
  }
  
  cout << ans << endl;
}


Measured memory_bytes: 256
/*
数据不清空，爆零两行泪。
多测不读完，爆零两行泪。
边界不特判，爆零两行泪。
贪心不证明，爆零两行泪。
D P 顺序错，爆零两行泪。
大小少等号，爆零两行泪。
变量不统一，爆零两行泪。
越界不判断，爆零两行泪。
调试不注释，爆零两行泪。
溢出不 l l，爆零两行泪。
*/
#include<bits/stdc++.h>
using namespace std;
const int N=200000;
int n;
int a[N+1],b[N+1];
bool ok[N+1];
int _xor[N+1];
bool c[N+1],d[N+1],l[N+1];
int e[2*N+2],f[2*N+2],g[2*N+2],h[2*N+2];
void con(int x[],bool y[],bool z[]){
	for(int i=1;i<=n;i++)x[i]=y[i],x[i+n+1]=z[i];
	x[n+1]=2;
}
int z1[2*N+3],z2[2*N+3],z3[2*N+3],z4[2*N+3];
void z_init(int z[],int s[]){
	z[1]=n;
	int zl=0,zr=0;
	for(int i=2;i<=2*n+1;i++)
        if(zr<i){
            z[i]=0;
            while(i+z[i]<=2*n+1&&s[i+z[i]]==s[1+z[i]])z[i]++;
            if(z[i])zl=i,zr=i+z[i]-1;
        }
        else if(i+z[i-zl+1]<=zr)z[i]=z[i-zl+1];
        else{
            z[i]=zr-i+1;
            while(i+z[i]<=2*n+1&&s[i+z[i]]==s[1+z[i]])z[i]++;
            zl=i;zr=i+z[i]-1;
        }
}
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=n;i++)cin>>b[i];
	for(int i=0;i<n;i++)ok[i]=true;
	for(int i=0;i<=30;i++){
		for(int j=1;j<=n;j++)c[j]=a[j]&1<<i,d[j]=!c[j],l[j]=b[j]&1<<i;
		con(e,l,c);z_init(z1,e);
		con(f,c,l);z_init(z2,f);
		con(g,l,d);z_init(z3,g);
		con(h,d,l);z_init(z4,h);
		for(int j=0;j<n;j++)
			if(z1[1+j+n+1]==n-j&&z2[n-j+1+n+1]==j);
			else if(z3[1+j+n+1]==n-j&&z4[n-j+1+n+1]==j)_xor[j]|=1<<i;
			else ok[j]=false;
	}
	for(int i=0;i<n;i++)if(ok[i])printf("%d %d\n",i,_xor[i]);
	return 0;
}
/*1
3
0 2 1
1 2 3
*/
/*2
5
0 0 0 0 0
2 2 2 2 2
*/
/*3
6
0 1 3 7 6 4
1 5 4 6 2 3
*/
/*4
2
1 2
0 0
*/

Measured memory_bytes: 19072
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define mod 1000000007
ll fact[50];
#define eps 1e-9
#define INF 1e18
ll power(ll a,ll b,ll c){
  ll ans=1;
  while(b){
    if(b&1){
      ans=ans*a%c;
    }
    a=a*a%c;
    b=b/2;
  }
  return ans;
}
ll ncr(ll n,ll r){
    if(r>n)return 0;
    if(r==n)return 1;
    ll z=fact[n];
    z=z*power(fact[r],mod-2,mod)%mod;
    z=z*power(fact[n-r],mod-2,mod)%mod;
    return z;
}
ll min(ll a,ll b){return a<b?a:b;}
ll max(ll a,ll b){return a>b?a:b;}
int main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int n; cin>>n;
        vector<int> v[n+1];
        for(int i=2;i<=n;++i){
            int x; cin>>x;
            v[x].push_back(i);
        }
        for(int i=1;i<=n;++i){
            cout<<v[i].size()<<endl;
        }
        
        return 0;
}


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

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            new Program().Solve(new MyInputStream(Console.In, ' '));
            Console.Out.Flush();
        }

        public void Solve(MyInputStream cin)
        {
            var N = cin.ReadInt();
            var K = cin.ReadInt();
            var a = 1;
            for (int i = 0; i < N; ++i)
                a = Min(a + K, a << 1);
            WriteLine(a);
        }
    }

    public class MyInputStream
    {
        private readonly System.IO.TextReader _stream;
        private char separator = ' ';
        private Queue<string> inputStream;
        public MyInputStream(System.IO.TextReader s, char separator = ' ')
        {
            this.separator = separator;
            this._stream = s;
            inputStream = new Queue<string>();
        }
        public string Read()
        {
            if (inputStream.Count != 0) return inputStream.Dequeue();
            string[] tmp = _stream.ReadLine().Split(separator);
            for (int i = 0; i < tmp.Length; ++i)
                inputStream.Enqueue(tmp[i]);
            return inputStream.Dequeue();
        }
        public string ReadLine() { return _stream.ReadLine(); }
        public int ReadInt() { return int.Parse(Read()); }
        public long ReadLong() { return long.Parse(Read()); }
        public double ReadDouble() { return double.Parse(Read()); }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read(); return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt(); return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong(); return ret;}
    }
}

Measured memory_bytes: 11220
<?php
  
  class Scanner {
    private $arr = [];
    private $count = 0;
    private $pointer = 0;
    public function next() {
        if($this->pointer >= $this->count) {
            $str = trim(fgets(STDIN));
            $this->arr = explode(' ', $str);
            $this->count = count($this->arr);
            $this->pointer = 0;
        }
        $result = $this->arr[$this->pointer];
        $this->pointer++;
        return $result;
    }
    public function hasNext() {
        return $this->pointer < $this->count;
    }
    public function nextInt() {
        return (int)$this->next();
    }
    public function nextDouble() {
        return (double)$this->next();
    }
}

class out {
    public static function println($str = "") {
        echo $str . PHP_EOL;
    }
}

$sc = new Scanner();

//ここまでテンプレ

$s = $sc->next();

$length = strlen($s);

$count = 0;

for($i = 0; $i < floor($length/2); $i++){
    if(strcmp(substr($s,$i,1),substr($s,$length-$i-1,1)) != 0){
        $count++;
    }
}


out::println($count);



?>

Measured memory_bytes: 3828
// Template from https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// input macro for competive-programming from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        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)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $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<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, bytes) => {
        read_value!($iter, String).into_bytes()
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    use std::io::Read;
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();

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

macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r#"a b c"# => r#"ABC"#,
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        a: isize,
        b: isize,
        c: isize,
    }

    if c >= a && c <= b {
        "Yes"
    } else {
        "No"
    }.to_string()
}

Measured memory_bytes: 4352
#include<iostream>
#include<vector>
#include<string>
#include<bitset>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
#define rep(i,n) for(int i=0;i<n;i++)

using namespace std;

int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};


int main() {
	int h, w;
	cin >> h >> w;
	vector<vector<char>> grid(h,vector<char>(w));
	queue<vector<int>> black;
	vector<vector<int>> dist(h, vector<int>(w, -1));
	
	rep(i, h)
		rep(j, w) {
		cin >> grid[i][j];
		if (grid[i][j] == '#') {
			black.push({ i, j });
			dist[i][j] = 0;
		}
		}
	
	int distance = 0;
	while(black.size()){
		int y = black.front()[0];
		int x = black.front()[1];
		black.pop();
		distance = dist[y][x];

		for(int i=0;i<4;i++){
			int new_y = y + dy[i];
			int new_x = x + dx[i];
			if (new_y < 0 || new_y >= h || new_x < 0 || new_x >= w)
				continue;
			if (dist[new_y][new_x] == -1) {
				dist[new_y][new_x] = distance + 1;
				black.push({ new_y,new_x });
			}
		}
	}
	cout << distance << endl;

	return 0;
}

Measured memory_bytes: 63584
#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(){
    int n;
    string s;
    cin>>n>>s;
    int cnt = 0;

    for(int i=0;i<n;i++){
        if(s[i] == 'A'){
            
            if(s[i+1]=='B'&&s[i+2]=='C'){
                cnt++;
            }
        }
    } 
    cout<<cnt<<endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <queue>
#include <cmath>
#include <map>
#include <iomanip>
#include <unordered_map>

using namespace std;
typedef long long  ll;

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

int main()
{
	ll N;
	cin >> N;
	vector<ll> t(N);
	for (ll i = 0; i < N; i++)
	{
		cin >> t[i];
	}
	ll lms = 1;
	for (ll i = 0; i < N; i++)
	{
		ll g = gcd(lms, t[i]);
		lms = lms / g * t[i];
	}
	cout << lms << endl;
	return 0;
}

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

  static class A {
    public void solve(int testNumber, Scanner in, PrintWriter out) {
      int R = in.nextInt();

      double res = R * 2 * Math.PI;

      out.print(res);

    }

  }
}



Measured memory_bytes: 36048
N, M = map(int, input().split())
H = list(map(int, input().split()))
l = [1] * N
for i in range(M):
    A, B = map(int, input().split())
    if H[A - 1] > H[B - 1]:
        l[B - 1] = 0
    elif H[A - 1] < H[B - 1]:
        l[A - 1] = 0
    elif H[A - 1] == H[B - 1]:
        l[A - 1], l[B - 1] = 0, 0
print(l.count(1))


Measured memory_bytes: 20120
#include <stdio.h>

enum direction {left, right};

int main(void)
{
    int ball[10], fall[2][10] = {0};
    int i, leftheight, rightheight, data, j;
    
    scanf("%d", &data);

    while (data--){
        for(j = 0; j < 10; j++) fall[left][j] = 0;
        for(j = 0; j < 10; j++) fall[right][j] = 0;
        for(i = 0; i < 10; i++) scanf("%d", &ball[i]);
        leftheight = 0;
        rightheight = 0;
        for(i = 0; i < 10; i++){
            if(leftheight == 0){
                fall[left][leftheight] = ball[i];
                leftheight++;
            }else if(fall[left][leftheight - 1] < ball[i]){
                fall[left][leftheight] = ball[i];
                leftheight++;
            }else if(rightheight == 0){
                fall[right][rightheight] = ball[i];
                rightheight++;
            }else if(fall[right][rightheight - 1] < ball[i]){
                fall[right][rightheight] = ball[i];
                rightheight++;
            }else {
                printf("NO\n");
                goto ERROR;
                
            }
        }
        
        printf("YES\n");
        ERROR:;
    }

    return (0);
}



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

int main(){
  int n,m;
  cin>>n>>m;
  int a[3];
  rep(i,3) a[i]=-1;
  rep(i,m){
    int s,c;
    cin>>s>>c; s--;
    if(a[s]!=c&&a[s]!=-1){
      cout<<-1<<endl;
      return 0;
    }
    a[s]=c;
  }
  rep(i,n){
    if(a[i]==-1){
      if(i==0&&n!=1) a[i]=1;
      else a[i]=0;
    }
    else if(a[i]==0&&i==0&&n!=1){
      cout<<-1<<endl;
      return 0;
    }	
  }
  rep(i,n){
    cout<<a[i];
  }
  return 0;
}





Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define REP1(i, n) for(int i=1; i<=(n); i++)
#define RREP1(i, n) for(int i=(n); i>=1; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define out(...) printf(__VA_ARGS__)
#if DEBUG
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...) /* ... */
#endif
template<class T>bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>bool chmin(T &a,const T &b){if(b<a){a=b;return true;}return false;}
void _OUT() {}; template<class H, class... T> void _OUT(H &h, T &... t) { cout<<' '<<h; _OUT(t...); };
template<class H, class... T> void _P(H &h, T &... t) { cout<<h; _OUT(t...); };
#define _PN(...) _P(__VA_ARGS__); cout << endl;
#define EXEC(...) void exec() { (__VA_ARGS__ - 1) ? multi() : solve(0); }

void exec();
void solve(int t);
void multi() { int TT; cin>>TT; REP1(t,TT) solve(t); }
signed main()
{
#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    exec();
    return 0;
}

/*================================*/
#if DEBUG
#define SIZE 100
#else
#define SIZE 1234560
#endif

int N,M;
vector<int> A(SIZE);

pair<int,int> count(string s) {
    pair<int,int> ret = {0,0};
    for (char c:s) {
        if (c=='(') {
            ret.first++;
        } else if (ret.first) {
            ret.first--;
        } else {
            ret.second++;
        }
    }
    return ret;
}

void solve(int _t) {
    cin>>N;
    string s;
    map<int,vector<pair<int,int>>> B;
    vector<pair<int,int>> S,E;
    REP(i,N) {
        cin>>s;
        auto r = count(s);
        if (r.second <= r.first) {
            S.push_back({r.second,r.first});
        }
        else {
            E.push_back(r);
        }
    }
    sort(ALL(S));
    sort(ALL(E));
    reverse(ALL(E));
    int cnt=0;
    for (auto q:S) {
        cnt -= q.first;
        if (cnt < 0) {
            _PN("No");
            return;
        }
        cnt += q.second;
    }
    for (auto q:E) {
        cnt -= q.second;
        if (cnt < 0) {
            _PN("No");
            return;
        }
        cnt += q.first;
    }
    string ans = (!cnt ? "Yes" : "No");
    _PN(ans);
}
EXEC(1)



Measured memory_bytes: 28712
#include <cstdio>
#include <iostream>
#include <iomanip>

#include <string>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <tuple>

using namespace std;
typedef long long ll;

#define MAX_N 10000
char c[MAX_N];

int main() {

  // -----------------------------
  cin.tie(nullptr);
  ios::sync_with_stdio(false);

  // input
  int N;
  cin >> N;

  string S;
  cin >> S;

  // -----------------------------

  int l = S.size();
  
  for (int i = 0; i < l; i++) {

    for (int j = 0; j < N; j++) {
      if(S[i] == 'Z') S[i] = '@';
      S[i]++;
    }
    cout << S[i];
    //if(S[i]=='Z') cout << 'A';
    //else cout << ++S[i];
  }
  cout << endl;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
const long double PI = (acos(-1));
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int ctoi(char c)
{
    switch (c)
    {
    case '0':
        return 0;
    case '1':
        return 1;
    case '2':
        return 2;
    case '3':
        return 3;
    case '4':
        return 4;
    case '5':
        return 5;
    case '6':
        return 6;
    case '7':
        return 7;
    case '8':
        return 8;
    case '9':
        return 9;
    default:
        return 0;
    }
}
int main()
{
    string o, e;
    cin >> o >> e;
    if (o.size() - e.size() == 1)
    {
        for (int i = 0; i < e.size(); i++)
        {
            cout << o[i] << e[i];
        }
        cout << o[e.size()] << endl;
    }
    else
    {
        for (int j = 0; j < e.size(); j++)
        {
            cout << o[j] << e[j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();

        double sum = 0;
        for(int i = 0; i < n; i ++) sum += 1.0 / sc.nextInt();
        sc.close();

        sum = 1.0 / sum;

        System.out.println(String.format("%f", sum));


    }
}


Measured memory_bytes: 21716
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int X = sc.nextInt();
		
		int A = 0;
		int cost1 = 0;
		int cost2 = 0;
		
		for(int i = 1; i < M + 1; i++) {
			A = sc.nextInt();
			if(A < X) {
				cost1++;
			} else {
				cost2++;
			}
		}
		
		System.out.println(Math.min(cost1, cost2));
		
	}
}


Measured memory_bytes: 21844
//
#include <bits/stdc++.h>
using namespace std;
#define INF 1000000000
#define PI 3.14159265
#define EPS 1e-9
#define Pi acos(-1.0)
typedef pair<int, int> ii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll,ll> pll;
#define forr(i,a,b) for(int i=(a); i<(b); i++)
#define clean(arr,val) memset(arr,val,sizeof(arr))
#define forn(i,n) forr(i,0,n)
#define PB push_back
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<pll> vpll;

/*CODE START HERE*/

ii initial, final;
int n, x, y, w;

int main(){
    ios::sync_with_stdio(0);
    initial = ii(0,0);
    cin >> final.first >> final.second >> n;
    forn(i,n){
        cin >> x >> y >> w;
        if(w == 1){
            initial.first = max(initial.first,x);
        }else if(w == 2){
            final.first = min(final.first,x);
        }else if(w == 3){
            initial.second = max(initial.second,y);
        }else{
            final.second = min(final.second,y);
        }
    }

    if(initial.first > final.first || initial.second > final.second){
        cout << "0\n";
    }else{
        cout << (final.first - initial.first) * (final.second - initial.second);
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printInt(a) printf("%d\n", a)
#define scanInt(a) scanf("%d", &a)
#define scan2Int(a, b) scanf("%d %d", &a, &b)
#define scan3Int(a, b, c) scanf("%d %d %d", &a, &b, &c)
using namespace std;

int main() {
    int s, w;
    scan2Int(s, w);
    if (s <= w) printf("unsafe\n");
    else printf("safe\n");
    return 0;
}


Measured memory_bytes: 3680
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

#define MOD 1000000007
#define MOD2 998244353
#define int long long
#define EPS 1e-9
//#define PI 3.14159265358979

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

using namespace std;

template < typename T >
ostream &operator<<(ostream &os, const vector< T > &A) {
	for (int i = 0; i < A.size(); i++)
		os << A[i] << " ";
	os << endl;
	return os;
}
template <>
ostream &operator<<(ostream &os, const vector< vector< int > > &A) {
	int N = A.size();
	int M;
	if (N > 0)
		M = A[0].size();
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++)
			os << A[i][j] << " ";
		os << endl;
	}
	return os;
}

typedef pair< int, int > pii;
typedef long long ll;

struct edge {
	int from, to, d, c;
	edge(int _from = 0, int _to = 0, int _d = 0, int _c = 0) {
		from = _from;
		to = _to;
		d = _d;
		c = _c;
	}
	bool operator<(const edge &rhs) const {
		return (d == rhs.d) ? (c < rhs.c) : (d < rhs.d);
	}
};
struct aabb {
	int x1, y1, x2, y2;
	aabb(int x1, int y1, int x2, int y2) : x1(x1), y1(y1), x2(x2), y2(y2) {}
};

typedef vector< edge > edges;
typedef vector< edges > graph;
struct flow {
	int to, cap, rev, cost;
	flow(int to = 0, int cap = 0, int rev = 0, int cost = 0) : to(to), cap(cap), rev(rev), cost(cost) {}
};
typedef vector< vector< flow > > flows;

const int di[4] = {0, -1, 0, 1};
const int dj[4] = {-1, 0, 1, 0};
const int ci[5] = {0, 0, -1, 0, 1};
const int cj[5] = {0, -1, 0, 1, 0};
const ll LINF = LLONG_MAX / 2;
const int INF = INT_MAX / 2;
const double PI = acos(-1);

int pow2(int n) { return 1LL << n; }
template < typename T, typename U >
bool chmin(T &x, const U &y) {
	if (x > y) {
		x = y;
		return true;
	}
	return false;
}
template < typename T, typename U >
bool chmax(T &x, const U &y) {
	if (x < y) {
		x = y;
		return true;
	}
	return false;
}

struct initializer {
	initializer() {
		cout << fixed << setprecision(20);
	}
};
initializer _____;

int N, M, K, T, Q, H, W;
signed main() {
	cin >> N >> M;
	vector< pii > A(M);
	rep(i, M) {
		cin >> A[i].first >> A[i].second;
		--A[i].first;
		--A[i].second;
	}
	sort(A.begin(), A.end());
	int r = LINF;
	int j = 0;
	int ans = 0;
	rep(i, N - 1) {
		while (j < M && A[j].first <= i)
			chmin(r, A[j++].second - 1);
		if (r <= i) {
			ans++;
			r = LINF;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
#!/usr/bin/perl -w

chomp($n=<>);
$max=0;
$c=0;
for($i=0;$i<$n;$i++){
    chomp($line=<>);
    $p[$i]=$line;
    if($line>$max){
        $max=$line;
        $c=$i
    }
}
$p[$c]/=2;
$value=0;
for($i=0;$i<$n;$i++){
    $value+=$p[$i];
}
print $value;

Measured memory_bytes: 640
N = int(input())
A = list(map(int,input().split()))
def gcd(x,y):
    if x<y:
        z = x
        x = y
        y = z
    if y==0:
        return x
    return gcd(y, x%y)
for i in range(N):
    if i==0:
        all_gcd = gcd(A[i],A[i+1])
    else:
        all_gcd = gcd(all_gcd,A[i])
for i in range(50):
    if all_gcd<2**i:
        print(i-1)
        break

Measured memory_bytes: 3064
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <cstring>
#include <utility>
#include <vector>
#include <climits>
#include <cstdio>
#include <cmath>
#include <unordered_map>
using namespace std;



void solve()
{
	int n,k;
	cin>>n>>k;
	int arr[n],dp[n],m=1e9,l;
	for(int i=0;i<n;i++) {cin>>arr[i];}
	dp[0]=0;
	dp[1]=abs(arr[1]-arr[0]);
	for(int i=2;i<n;i++)
	{
		dp[i]=m;
		for(int j=max(0,i-k);j<i;j++)
		{
			dp[i]=min(dp[i],dp[j]+abs(arr[i]-arr[j]));	
		}
	}
	cout<<dp[n-1]<<'\n';
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
    solve();
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int n; cin >> n;
  vector<long long> x(n), y(n), h(n);

  long long xx, yy, hh; // h[i] != 0 のときの (x, y, h), すべての h[i] = 0 はありえない
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i] >> h[i];
    if (h[i] != 0) {
      xx = x[i]; yy = y[i]; hh = h[i];
    }
  }
  for (int cx = 0; cx <= 100; cx++) {
    for (int cy = 0; cy <= 100; cy++) {
      bool is_ok = true;
      // H: 中心座標における高さ
      long long H = abs(cx-xx) + abs(cy-yy) + hh;
      for (int i = 0; i < n; i++) {
        if (h[i] != max(H - abs(x[i]-cx) - abs(y[i]-cy), 0LL)) {
          is_ok = false;
          break;
        }
      }
      if (is_ok) {
        cout << cx << " " << cy << " " << H << endl;
        return 0;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 256
//{{{
#include<algorithm>
#include<cmath>
#include<deque>
#include<fstream>
#include<iomanip>
#include<iostream>
#include<map>
#include<numeric>
#include<queue>
#include<random>
#include<set>
#include<sstream>
#include<sys/time.h>
#include<unordered_map>
#include<unordered_set>
#include<vector>
using ll = long long;
enum : int { M = (int)1e9 + 7 };
enum : ll { MLL = (ll)1e18L + 9 };
using namespace std;
#ifdef LOCAL
#include"rprint2.hpp"
#else
#define FUNC(name) template <ostream& out = cout, class... T> void name(T&&...){ }
FUNC(printde) FUNC(printdbe) FUNC(printdwe) FUNC(printdu);
#endif
template <template <class T, class = std::allocator<T>> class V, class E>
istream& operator >> (istream& in, V<E>& v){ for(auto& e : v){ in >> e; } return in; }
//}}}

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    int n; cin >> n;
    cout << (n - 1) / 2 << '\n';
}


Measured memory_bytes: 888
#include <iostream>
#include <vector>
#include <cmath>
#include <set>
#include <queue>
#include <map>
#include <cstdio>
#include <cstring>
#include <string>
#include <stack>
#include <algorithm>
#include <limits.h>
#include <bits/stdc++.h>
#define fw(x) freopen("x.txt","w",stdout)
#define For(i,a,b,c) for(int i = a;i < b;i+=c)
#define REP(i,n) for(int i = 0;i < n;++i)
#define REP1(i,n) for(int i = 1; i<=n;i++)
#define mem(a,s) memset(a,s,sizeof a)
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL)
#define pf printf
#define sc scanf
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(v) v.begin(),v.end()
#define vii vector<int>
#define vll vector<ll>
#define vss vector<string>
#define debug(x)  cout<<#x"="<<(x)<<endl
#define pb push_back


using namespace std;


// moves

//int dx[]= {0,0,1,-1};/*4 side move*/
//int dy[]= {-1,1,0,0};/*4 side move*/
//int dx[]= {1,1,0,-1,-1,-1,0,1};/*8 side move*/
//int dy[]= {0,1,1,1,0,-1,-1,-1};/*8 side move*/
//int dx[]={1,1,2,2,-1,-1,-2,-2};/*knight move*/
//int dy[]={2,-2,1,-1,2,-2,1,-1};/*knight move*/


//big_mod

//ll bigmod(ll a,ll b,ll m)
//{if(b == 0) return 1%m;ll x = bigmod(a,b/2,m);x = (x * x) % m;if(b % 2 == 1) x = (x * a)% m;return x;}
//ll BigMod(ll B,ll P,ll M){ ll R=1%M; while(P>0) {if(P%2==1){R=(R*B)%M;}P/=2;B=(B*B)%M;} return R;} /// (B^P)%M

//ll getBit(ll num, int idx) {return ((num >> idx) & 1ll) == 1ll;}
//ll setBit1(ll num, int idx) {return num or (1ll<<idx);}
//ll setBit0(ll num, int idx) {return num & ~(1ll<<idx);}
//ll flipBit(ll num, int idx) {return num ^ (1ll<<idx);}

const int mod = 1000000007;
ll qpow(ll n,ll k)
{
    ll ans=1;
    assert(k>=0);
    n%=mod;
    while(k>0)
    {
        if(k&1)
            ans=(ans*n)%mod;
        n=(n*n)%mod;
        k>>=1;
    }
    return ans%mod;
}
ll dp[401][401];
ll ans[401][401];
int main()
{
    fast;
    int n;
    cin>>n;
    int arr[n+1];
    REP1(i, n) cin>>arr[i];
    REP1(i, n){
      for(int j=1; j<=(n-i+1); j++){
        for(int k=j; k<=(j+i-1); k++){
          dp[j][k] = 1e18;
          ans[j][k] = 1e18;
          if(j==k){
              dp[j][k] = arr[j];
              ans[j][k] = 0;
          }
          else{
            for(int k2=j; k2<k; k2++){
              ll newSum = dp[j][k2] + dp[k2+1][k];
              ll newCost = dp[j][k2]+dp[k2+1][k] + ans[j][k2]+ans[k2+1][k];
              //if(j==1&&k==2) cout<<"here: "<<newColor<<' '<<newSmoke<<' '<<ans[j][k]<<' '<<dp[j][k]<<'\n';
              if(ans[j][k]>newCost||(ans[j][k]==newCost && newSum<dp[i][j])){
                dp[j][k] = newSum;
                ans[j][k] = newCost;
              }
              //if(j==1&&k==2) cout<<dp[j][k]<<' '<<ans[j][k]<<'\n';
            }
          }
          //cout<<j<<' '<<k<<' '<<dp[j][k]<<' '<<ans[j][k]<<'\n';
        }
      }
    }
    cout<<ans[1][n]<<'\n';
    return 0;
}


Measured memory_bytes: 6164
#include <iostream>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>

using namespace std;
typedef long long int ll;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)

ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
typedef pair <ll,ll> P;
ll MOD = 1000000007;

int main()
{
    ll A, B;
    char op;
    cin >> A >> op >> B;
    if (op == '+') {
        cout << A + B  << endl;
    } else {
        cout << A - B << endl;
    }

    return 0;
}


Measured memory_bytes: 256
import math
def factrization_prime(number):
    factor = {}
    div = 2
    s = math.sqrt(number)
    while div < s:
        div_cnt = 0
        while number % div == 0:
            div_cnt += 1
            number //= div
        if div_cnt != 0:
            factor[div] = div_cnt
        div += 1
    if number > 1:
        factor[number] = 1
    return factor
N, P = map(int, input().split())
d = factrization_prime(P)
a = 1
for p in d:
    a *= p**(d[p]//N)
print(a)


Measured memory_bytes: 63340
#include <vector>
#include <iostream>
#include <algorithm>

typedef char                SINT8;
typedef unsigned char       UINT8;
typedef short               SINT16;
typedef unsigned short      UINT16;
typedef int                 SINT32;
typedef unsigned int        UINT32;
typedef long long           SINT64;
typedef unsigned long long  UINT64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

using namespace std;

int main() {
	SINT32 N;
	SINT32 MAX = 0;
	SINT32 SUM = 0;
	cin >> N;

	vector<int> DATA(N);
	for (SINT32 i = 0; i < N; i++) {
		cin >> DATA[i];
		if (DATA[i] > MAX) {
			SUM = SUM + MAX;
			MAX = DATA[i];
		} else {
			SUM = SUM + DATA[i];
		}
	}

	if (MAX < SUM) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
/// However long the night,
///     The dawn will break
/// ICPC next year

#include<bits/stdc++.h>
using namespace std ;
const int N = 1e5+5 ;

int l ,r ;
int main(){
    cin >> l >> r ;
    int cnt = r/2019 - (l-1)/2019 ;
    if(cnt>=2) return cout << 0,0 ;
    int mn = 2019 ;
    for(int i=l;i<=r;++i){
        for(int j=i+1;j<=r;++j){
            int x = 1ll*i%2019*j%2019 ;
            mn = min(mn,x);
        }
    }
    cout << mn ;
    return 0;
}


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

using namespace std;

int main(){
  int N;
  cin >> N;
  map<long long int,int> joisino;
  for(int i = 0; i < N; i++){
    long long int t;
    cin >> t;
    joisino[t]++;
  }
  
  auto iter = joisino.begin();
  int counter = 0;
  while(iter != joisino.end()){
    if(iter->second % 2 == 1) counter++;
    iter = next(iter , 1);
  }
  cout << counter;
}

Measured memory_bytes: 6528
#include <iostream>
#include <climits>
#include <algorithm>
using namespace std;
 
int main() {
	long long n,w;
	cin>>n>>w;
	
	long long weight[n], value[n], totalVal = 0;
	for(int i=0; i<n; i++) {
		cin>>weight[i]>>value[i];
		totalVal += value[i];
	}
	
	long long memo[totalVal+1];
	for(int i=0; i<=totalVal; i++) {
		memo[i] = INT_MAX;
	}
	memo[0] = 0;
	
	for(int i=0; i<n; i++) {
		for(int j=(totalVal-value[i]); j>=0; j--) {
			memo[j+value[i]] = min(weight[i] + memo[j], memo[j+value[i]]);
		}
	}
	
	long long ans=0;
	for(int i=0; i<=totalVal; i++) {
		if(memo[i] <= w) {
			ans = i;
		}
	}
	
	cout<<ans;
	
	return 0;
}

Measured memory_bytes: 4400
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
using namespace std;
using ll=long long;
#define mod  1000000007

int main(int argc, char const *argv[]) {
  int a,b;
  char s;
  std::cin >> a >> s >> b;
  if(s=='+') std::cout << a+b << '\n';
  else std::cout << a-b << '\n';
  return 0;
}

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

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

    long long int x, y;
    x=c;
    y=d;
    long long int r=y%x;
    while(r!=0){
        y=x;
        x=r;
        r=y%x;
    }

    long long int z=c*d/x;

    long long int cnt=(b-a+1)-b/c-b/d+b/z+(a-1)/c+(a-1)/d-(a-1)/z;
    cout<<cnt<<endl;

}

Measured memory_bytes: 256
from sys import stdin 
a = stdin.readline().rstrip()
n = len(a)
k = [0]*26
a = sorted(a)
t = "a"
tmp = 0
for i in range(n):
    if t == a[i]:
        k[tmp] += 1
    else:
        t = a[i]
        tmp += 1
        k[tmp] += 1
answer = (n*(n-1)) // 2
for i in range(26):
    if k[i] > 1:
        answer -= (k[i]*(k[i]-1)) // 2
print(answer + 1)

Measured memory_bytes: 63088
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()

inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}

typedef long long lint;
typedef vector<int> vi;
typedef vector<lint> vl;
typedef vector<vector<int> > Mat;
typedef tuple<int, int, int, int> T;

const int MOD = (int)1e9 + 7;
const int INF = (int)1e9;
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

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

  int N;
  lint K;
  cin >> N >> K;
  vector<lint> A(N);
  rep(i, N) cin >> A[i];

  lint res = 0;
  for (int d = 60; d >= -1; d--) {
    if (d != -1 && !(K & (1LL << d))) continue;

    lint tmp = 0;
    for (int e = 60; e >= 0; e--) {
      lint mask = 1LL << e;
      int num = 0;
      for (int i = 0; i < N; i++)
        if (A[i] & mask) num++;

      if (e > d) {
        if (K & mask)
          tmp += mask * (N - num);
        else
          tmp += mask * num;
      } else if (e == d) {
        tmp += mask * num;
      } else {
        tmp += mask * max(num, N - num);
      }
    }
    res = max(res, tmp);
  }

  cout << res << endl;

  return 0;
}

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

#define REP(i,n) for(ll i=0;i<ll(n);++i)
#define RREP(i,n) for(ll i=ll(n)-1;i>=0;--i)
#define FOR(i,m,n) for(ll i=m;i<ll(n);++i)
#define RFOR(i,m,n) for(ll i=ll(n)-1;i>=ll(m);--i)
#define ALL(v) (v).begin(),(v).end()
#define UNIQUE(v) v.erase(unique(ALL(v)),v.end());
#define DUMP(v) REP(aa, (v).size()) { cout << v[aa]; if (aa != v.size() - 1)cout << " "; else cout << endl; }
#define INF 1000000001ll
#define MOD 1000000007ll
#define EPS 1e-9

const int dx[8] = { 1,1,0,-1,-1,-1,0,1 };
const int dy[8] = { 0,1,1,1,0,-1,-1,-1 };


using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll max(ll a, int b) { return max(a, ll(b)); }
ll max(int a, ll b) { return max(ll(a), b); }
ll min(ll a, int b) { return min(a, ll(b)); }
ll min(int a, ll b) { return min(ll(a), b); }


int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s;
	cin >> s;
	REP(i, s.size() - 8)cout << s[i];
	cout << endl;

}


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

int ans, cnt[12], len;
long long n, p[12];

void split(long long n){
	len = 0;
	for(int i = 2; 1ll * i * i <= n; i++) if(n % i == 0){
		p[len] = i, cnt[len] = 0;
		do n /= i, cnt[len]++; while(n % i == 0);
		len++;
	}
	if(n != 1) cnt[len] = 1, p[len++] = n;
}

long long mul = 1;
void dfs(int i){
	if(i == len){
		if(mul == 1) return;
		long long tmp = n;
		do tmp /= mul; while(tmp % mul == 0);
		ans += tmp % mul == 1;
		return;
	}
	dfs(i + 1);
	for(int j = 0; j < cnt[i]; j++)
		mul *= p[i], dfs(i + 1);
	for(int j = 0; j < cnt[i]; j++) mul /= p[i];
}

int main(){
	scanf("%lld", &n);
	split(n), dfs(0), split(n - 1);
	for(int i = 0; i < len; i++) mul *= cnt[i] + 1;
	printf("%lld", ans + mul - 1);
	return 0;
}

Measured memory_bytes: 128
//#pragma warning disable
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System;
using System.Numerics;
using System.Threading.Tasks;
using static System.Math;
using static System.Console;
class E { static void Main() => new K(); }
class K
{
	int F() => int.Parse(ReadLine());
	long FL() => int.Parse(ReadLine());
	int[] G() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(int.Parse).ToArray();
	long[] GL() => ReadLine().Split(new char[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries).Select(long.Parse).ToArray();
	public const int MOD = 1000000007;
	public K()
	{
		SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
		Solve();
		Out.Flush();
	}
	void Solve()
	{
		var N = F();
		var a = G();
		var t = new List<P>();
		var n = new long[N];
		for (var i = 0; i < N; i++) t.Add(new P(a[i], i));
		t.Sort();
		var m = N + 1;
		for (var i = 0; i < N; i++)
		{
			var d = i < N - 1 ? t[i].H - t[i + 1].H : t[i].H;
			m = Min(m, t[i].I);
			n[m] += (i + 1L) * d;
		}
		for (var i = 0; i < N; i++) WriteLine(n[i]);
	}
}
struct P : IComparable<P>
{
	public int H, I;
	public P(int h, int i)
	{
		H = h;
		I = i;
	}
	public int CompareTo(P x)
	{
		var c = x.H.CompareTo(H);
		return c == 0 ? x.I.CompareTo(I) : c;
	}
}

Measured memory_bytes: 33116
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
char a[1005][1005];
ll dp[1005][1005];
int mod=1e9+7;
int main(){
	int h,w;
	cin>>h>>w;
	memset(dp,0,sizeof(dp));
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			cin>>a[i][j];
			}
		}
		dp[1][1]=1;
	for(int i=1;i<=h;i++){
		for(int j=1;j<=w;j++){
			if(a[i][j]=='.'){
				dp[i][j]=(dp[i][j]+(dp[i][j-1]+dp[i-1][j]))%mod;
				
			}
			}
		}
		cout<<dp[h][w];
	return  0;
	}


Measured memory_bytes: 9088