akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for (int i = (a); i <= (b); ++i)
#define REPD(i,a,b) for (int i = (a); i >= (b); --i)
#define FORI(i,n) REP(i,1,n)
#define FOR(i,n) REP(i,0,int(n)-1)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vi vector<int>
#define ll long long
#define SZ(x) int((x).size())
#define DBG(v) cerr << #v << " = " << (v) << endl;
#define FOREACH(i,t) for (typeof(t.begin()) i=t.begin(); i!=t.end(); i++)
#define fi first
#define se second

int a[200200];
int main() {
	int n;
	int x=-1;
	scanf("%d", &n);
	FOR(i,n) scanf("%d", &a[i]);
	sort(a,a+n);
	for (int i=n-1; i>0; i--) {
		if (a[i]==a[i-1]) {
			if (x==-1) x=a[i];
			else {
				printf("%lld\n", 1LL*a[i]*x);
				return 0;
			}
			i--;
		}
	}
	printf("0\n");
	return 0;
}


Measured memory_bytes: 640
import scala.io.StdIn

object Main extends App {

  var ss = StdIn.readLine()
  val t = StdIn.readLine()
  var replaced = false

  def solve(i: Int): String = {
    if (i == -1) {
      ss
    } else {
      var k = 0
      while (k < t.length && 0 <= i - k && (ss(i - k) == t(t.length - k - 1) || ss(i - k) == '?')) {
        k += 1
      }
      if (k == t.length) {
        replaced = true
        val idx = i + 1 - k
        //println(s"idx: $idx")
        ss.take(idx) + t + ss.drop(idx + k)
      } else {
        solve(i - 1)
      }
    }
  }

  val r = solve(ss.length - 1)
  println(if (!replaced) "UNRESTORABLE" else r.replace("?", "a"))

}

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

typedef long long ll;
#define pa pair<int, int> 
#define pal pair<long long, long long>
#define pad pair<double, double>
#define pb push_back
#define mp make_pair
#define VIN(v) for(int64_t i=0;i<(v).size();i++){cin >> (v).at(i);}

typedef vector<bool> bvec;
typedef vector<int> ivec;
typedef vector<long long> lvec;
typedef vector<double> dvec;
typedef vector<pa> pvec;

typedef vector< vector<bool> > bmat;
typedef vector< vector<int> > imat;
typedef vector<string> svec;
typedef vector< vector<string> > smat;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    cin >> n >> k;
    ivec p(n);
    for (size_t i = 0; i < n; i++) cin >> p[i];
    double av=0;
    for (size_t i = 0; i < k; i++)
    {
        av+=(double)(p[i]+1)/2;
    }
    double ans = av;
    for (size_t i = k; i < n; i++)
    {   
        av-=(double)(p[i-k]+1)/2;
        av+=(double)(p[i]+1)/2;
        ans = fmax(ans, av);
    }
    
    cout << setprecision(10) << ans << endl;

}

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

int digit_sum(int num)
{
  int ans =0;
  int temp = num;
  while(temp !=0)
  {
    ans+= temp%10;
    temp = temp/10;
  }
  return ans;
}

int main()
{
  int n;
  cin>>n;
  if(n%digit_sum(n)==0) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

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

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

namespace FastIO {
struct Strs {
  char strs[10000 * 4];
  constexpr Strs() : strs() {
    for (int i = 0; i < 10000; ++i) {
      int j = i;
      for (int t = 3; t >= 0; --t) {
        strs[i * 4 + t] = j % 10 + '0';
        j /= 10;
      }
    }
  }
} constexpr strs;
static constexpr size_t buf_size = 1 << 18;
char buf_in[buf_size], buf_out[buf_size];
size_t pt_in = 0, pt_out = 0, tail_in = 0;
inline size_t num_digits(long long x) {
  if (x >= (long long)1e9) return 10;
  if (x >= (long long)1e8) return 9;
  if (x >= (long long)1e7) return 8;
  if (x >= (long long)1e6) return 7;
  if (x >= (long long)1e5) return 6;
  if (x >= (long long)1e4) return 5;
  if (x >= (long long)1e3) return 4;
  if (x >= (long long)1e2) return 3;
  if (x >= (long long)1e1) return 2;
  return 1;
}
inline void load() {
  memcpy(buf_in, buf_in + pt_in, tail_in - pt_in);
  size_t width = tail_in - pt_in;
  tail_in = width + fread(buf_in + width, 1, buf_size - width, stdin);
  pt_in = 0;
}
inline void flush() {
  fwrite(buf_out, 1, pt_out, stdout);
  pt_out = 0;
}
inline void scan(char& c) { c = buf_in[pt_in++]; }
template <class T>
inline void scan(T& x) {
  if (pt_in + 32 > tail_in) load();
  char c;
  bool minus = 0;
  x = 0;
  scan(c);
  while (c >= '0') {
    x = x * 10 + (c & 15);
    scan(c);
  }
  if (minus) x = -x;
}
inline void print(char c) { buf_out[pt_out++] = c; }
template <class T>
inline void print(T x) {
  if (pt_out > buf_size - 32) flush();
  if (x < 0) {
    print('-');
    x = -x;
  }
  size_t digits = num_digits(x);
  int i;
  for (i = pt_out + digits - 4; i > (int)pt_out; i -= 4) {
    memcpy(buf_out + i, strs.strs + (x % 10000) * 4, 4);
    x /= 10000;
  }
  memcpy(buf_out + pt_out, strs.strs + x * 4 + (pt_out - i), 4 + i - pt_out);
  pt_out += digits;
}
inline void print(const char* s) {
  if (pt_out > buf_size - 32) flush();
  for (int i = 0; s[i] != 0; ++i) print(s[i]);
}
template <class T>
inline void println(T x) {
  print(x);
  print('\n');
}
struct SetUp {
  SetUp() { load(); }
  ~SetUp() { flush(); }
} setup;
}  // namespace FastIO

using FastIO::print;
using FastIO::println;
using FastIO::scan;

int main() {
  int N;
  scan(N);
  int mn1 = INF, mx1 = -INF, mn2 = INF, mx2 = -INF;
  REP(i, N) {
    int x, y;
    scan(x);
    scan(y);
    int a = x + y, b = x - y;
    mn1 = min(mn1, a);
    mx1 = max(mx1, a);
    mn2 = min(mn2, b);
    mx2 = max(mx2, b);
  }
  println(max(mx1 - mn1, mx2 - mn2));
  return 0;
}

Measured memory_bytes: 3936
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <tuple>
using namespace std;

int dij[] = {0, 1, 0, -1, 0};
int main() {
    int h, w; cin >> h >> w;
    vector<string> grid(h);
    for (string &s: grid) cin >> s;
    vector<vector<int>> dist(h, vector<int>(w, -1));
    queue<pair<int, int>> que;
    int si = 0, sj = 0;
    grid[si][sj] = 's'; dist[si][sj] = 1; que.emplace(si, sj);
    while (!que.empty()) {
        int i, j;
        tie(i, j) = que.front(); que.pop();
        for (int k = 0; k < 4; k++) {
            int ni = i + dij[k];
            int nj = j + dij[k + 1];
            if (ni < 0 || ni >= h || nj < 0 || nj >= w) continue;
            if (grid[ni][nj] != '.') continue;
            grid[ni][nj] = '@';
            dist[ni][nj] = dist[i][j] + 1;
            que.emplace(ni, nj);
        }
    }
    if (dist[h - 1][w - 1] == -1) cout << -1 << endl;
    else {
        int bk = 0;
        for (int i = 0; i < h; i++) for (int j = 0; j < w; j++) {
            if (grid[i][j] == '#') bk++;
        }
        cout << h * w - dist[h - 1][w - 1] - bk << endl;
    }
    return 0;
}

Measured memory_bytes: 256
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)*}
    };
}

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)*}
    };
}

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")
    };
}
fn main() {
    input!{
        n: u64,
        k: u64,
    };
    println!(
        "{}",
        k * (k - 1).pow((n-1) as u32)
    );
}


Measured memory_bytes: 4352
import math
n=int(input())
x=list(map(int,input().split()))
y=list(map(int,input().split()))
p1=0
p2=0
p3=0
pinf=[]
for i in range(n):
	t=abs(x[i]-y[i])
	p1+=t
for i in range(n):
	t=(abs(x[i]-y[i]))**2
	p2+=t
p2=math.sqrt(p2)
for i in range(n):
	t=(abs(x[i]-y[i]))**3
	p3+=t
p3=p3**(1/3)
for i in range(n):
	pinf.append(abs(x[i]-y[i]))
p4=max(pinf)
print(p1)
print(p2)
print(p3)
print(p4)


Measured memory_bytes: 5692
import java.util.*;

class Main{

    void solve(){
        Scanner sc = new Scanner(System.in);

        long mod = (long)Math.pow(2,32);

        int dataset = sc.nextInt();
        while(dataset-->0){
            long[] N = new long[9];
            for(int i=0; i<9; i++){ 
                String s = sc.next();
                N[i] = Long.parseLong(s, 16);
            }

            long k = (long)0;

            for(int i=0; i<32; i++){
                long sum = (long)0;
                for(int j=0; j<8; j++) sum += N[j] ^ k;
                if((sum & (long)1<<i) != ((N[8] ^ k) & (long)1<<i)){
                    k |= (long)1<<i;
                }
            }
            System.out.println(Long.toString(k, 16));
        }
    }

    public static void main(String[] args){
        new Main().solve();
    }
}

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

using namespace std;

int main(){
  int n; cin >> n;
  int k; cin >> k;
  vector<int> h(n);
  rep(i,n){ cin >> h[i]; }

  int ans = 0;
  rep(i,n){
    if(h[i] >= k){
      ans++;
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 640
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <iomanip>
#include <stdio.h>
#include <numeric>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <array>
#include <vector>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <deque>
#include <queue>
#include <complex>
#define full(c) c.begin(), c.end()
#define vector2d(name,type,h,w,init) vector<vector<type>> name(h,vector<type>(w,init)) 
const int PRIME = 1000000007;
const int INT_INF = 2147483647;
const long long int LL_INF = 9223372036854775807;
const double PI = acos(-1);
const double EPS = 0.000000001;
typedef unsigned long long int ull;
typedef long long int ll;
using namespace std;

int main(){
	//ios_base::sync_with_stdio(false);
	//cin.tie(NULL);
	int n;
	set<ll> data;
	cin >> n;
	while (n--){
		ll a;
		cin >> a;
		if (data.find(a) == data.end()) data.insert(a);
		else data.erase(a);
	}
	cout << data.size() << endl;
	return 0;
}


Measured memory_bytes: 4864
#include <bits/stdc++.h>
using namespace std;
#define _MACRO(_1, _2, _3, NAME, ...) NAME
#define _repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define _rep(i,n) _repl(i,0,n)
#define rep(...) _MACRO(__VA_ARGS__, _repl, _rep)(__VA_ARGS__)
#define pb push_back
#define all(x) begin(x),end(x)
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cerr<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cerr<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream &o, const pair<T,U> &p){o<<"("<<p.first<<","<<p.second<<")";return o;}
template<class T> ostream& operator<<(ostream &o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}
#else
#define dbg(...) {}
#endif

#define long long long // for codeforces

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

  map<char, int> ma;
  rep(i,n) if(i%2==0){
    ma[s[i]]++;
  }

  map<int,int> cnt;
  for(auto p : ma) cnt[p.second]++;

  int ans = 0;
  for(auto p : cnt){dbg(p);
    ans += 1;
    int coeff = p.first;
    ans += p.second * 2 - 1;
    if (coeff > 1) {
      ans += to_string(coeff).size() + 1;
      if (p.second > 1) ans += 2;
    }
  }

  cout << ans - 1 << endl;

  return 0;
}



Measured memory_bytes: 3284
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cstdlib>
#include<cstdio>

using namespace std;
int po(int c)
{
    int i,a;
    for(i=1; i<=999; i++)
    {
        a=i*(i+1)/2;
        if(a==c)
            return i;
    }
    return 0;
}
int main()
{
    int a,b,i,c,d;
    scanf("%d %d",&a,&b);
    for(i=0; ; i++)
    {
        c=a+i;
        d=b+i;
        if(po(c)+1==po(d))
        {
            printf("%d\n",i);
            break;
        }
    }
    return 0;
}


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

int main() {
	int n, m;// n 個の都市 m 本の道路
	cin >> n >> m;
	int a, b;
    vector<int>	c (n);
    for (int i = 0; i < m; i++) {
    	cin >> a >> b ;
        c.at(a - 1)++;
        c.at(b - 1)++;
    }
    for (int j = 0; j < n; j++) {
    	cout << c.at(j) << endl;
    }
}

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

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

Measured memory_bytes: 3624
//#define _GLIBCXX_DEBUG
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, 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 1; } return 0; }
const int INF = 1000000000;

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

    int n = s.size();

    if (s[n-1] == 's')s += "es";
    else s += "s";

    cout << s << endl;
}

Measured memory_bytes: 3660
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//#include<boost/multiprecision/cpp_int.hpp>
//#include<boost/multiprecision/cpp_dec_float.hpp>
//namespace mp=boost::multiprecision;
//#define mulint mp::cpp_int
//#define mulfloat mp::cpp_dec_float_100
using namespace std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
constexpr int MOD=1000000007;
//constexpr int MOD=998244353;
#define INF (1<<30)
#define LINF (lint)(1LL<<56)
#define endl "\n"
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define reprev(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define Flag(x) (1<<(x))
#define Flagcount(x) __builtin_popcountll(x)
#define pint pair<int,int>
#define pdouble pair<double,double>
#define plint pair<lint,lint>
#define fi first
#define se second
typedef long long lint;
int dx[8]={1,1,0,-1,-1,-1,0,1};
int dy[8]={0,1,1,1,0,-1,-1,-1};
const int MAX_N=2e5+5;
struct edge{lint to,num;};

vector<edge> ed[MAX_N];
bool reach[MAX_N];
lint ans[MAX_N];

void dfs(int now,int color){
    if(reach[now]) return;
    reach[now]=true;
    int cl=1;
    rep(i,ed[now].size()){
        if(!reach[ed[now][i].to]){
            if(cl==color) cl++;
            ans[ed[now][i].num]=cl;
            dfs(ed[now][i].to,cl);
            cl++;
        }
    }
}


int main(void){
    int N;
    cin >> N;
    rep(i,N-1){
        int u,v;
        cin >> u >> v;
        u--,v--;
        ed[u].push_back({v,i});
        ed[v].push_back({u,i});
    }
    lint res=0;
    rep(i,N) res=max(res,(lint)ed[i].size());
    dfs(0,0);
    cout << res << endl;
    rep(i,N-1) cout << ans[i] << endl;
}

Measured memory_bytes: 16252
n=int(input())
a=list(map(int,input().split()))
for i in range(n-2,-1,-1):
    if a[i+1]<a[i]:
        a[i]-=1
for i in range(n-1):
    if a[i]>a[i+1]:
        print("No")
        exit()
print("Yes")

Measured memory_bytes: 14396
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
count = 0
ins = 100
for i in A:
  count += B[i-1]
  if ins == i-1 and C[i-2]:
    count += C[i-2]
  ins = i
print(count)
  

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

static MOD: u64 = 1_000_000_007;

fn input_tuple() -> (u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn binary_power(x: u64, n: u64) -> u64 {
    if n == 0 {
      return 1;
    }
    if n % 2 == 0 {
      return (binary_power(x, n / 2) % MOD).pow(2) % MOD;
    } else {
      return binary_power(x, n - 1) % MOD * x % MOD;
    }
}

fn main() {
    let (n, k) = input_tuple();
    let mut multiples: Vec<u64> = Vec::new();

    multiples.push(0);
    for i in 1..(k+1) {
        multiples.push(k / i);
    }

    let mut ans: Vec<u64> = Vec::new();
    ans.push(0);
    for i in 1..(k+1) {
        ans.push(binary_power(multiples[i as usize], n));
    }

    // println!("{:?}", multiples);

    // println!("{:?}", ans);

    for i in (1..(k+1)).rev() {
        let mut num = 2;
        for j in 2..(k/i+1) {
            ans[i as usize] = (ans[i as usize] + MOD - ans[(i * j) as usize]) % MOD;
        }
    }

    // println!("{:?}", ans);

    let mut sum = 0;
    for i in 1..ans.len() {
        sum += ans[i] * i as u64 % MOD;
        sum %= MOD;
    }
    println!("{}", sum);
}


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

int main() {
  int N;
  string S;
  cin >> N >> S;
  int n = S.size();
  for(int i=0;i<n;i++){
      S[i]+=N;
    if(S[i]>90){
      S[i]-=90;
      S[i]+=64;
    }
  }
  cout<< S <<endl;
}


Measured memory_bytes: 256
N = int(input())
task = []
for i in range(N):
  a,b = input().split()
  task.append([int(a),int(b)])
task.sort(key=lambda x:x[0])
task.sort(key=lambda x:x[1])
count = 0
sum = 0
for i in range(N):
  sum = sum + task[i][0]
  if sum > task[i][1]:
    count = 1
    break
if count == 0:
  print("Yes")
else:
  print("No")
  

Measured memory_bytes: 38044
#include <bits/stdc++.h>
#define debug(x) cerr << #x << ": " << x << '\n';
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = (int)1e9;

#ifndef SIEVE
#define SIEVE
// エラストテネスの篩, o(n)程度
// n以下の素数の数を返す, prime[i]: i番目の素数, is_prime[i]: iが素数であるか
int sieve(int n, int prime[] = nullptr, bool is_prime[] = nullptr){
	bool flag0 = false, flag1 = false;
	if(prime == nullptr){
		flag0 = true; prime = new int[n];
	}
	if(is_prime == nullptr){
		flag1 = true; is_prime = new bool[n + 1];
	}

	int p = 0;
	fill(is_prime, is_prime + n + 1, true);
	is_prime[0] = is_prime[1] = false;

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

	if(flag0) delete prime;
	if(flag1) delete is_prime;

	return p;
}
#endif

bool is_prime[100000];
int like_2017[100000]; 

int main(void){
    int Q;
    cin >> Q;

    sieve(100000, nullptr, is_prime);
    for(int i = 1; i < 100000; i++){
        if(is_prime[i] and is_prime[(i+1)/2]) like_2017[i] = like_2017[i-1] + 1;
        else like_2017[i] = like_2017[i-1];
    }

    // for(int i = 0; i < 30; i++) printf("like_2017[%d] = %d\n", i, like_2017[i]);

    vector<int> res(Q);
    for(int i = 0; i < Q; i++){
        int l, r;
        cin >> l >> r;
        res[i] = like_2017[r] - like_2017[l-1];
    }

    for(auto x: res) cout << x << '\n';

    return 0;
}

Measured memory_bytes: 1496
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define pli pair<ll, int>
#define pil pair<int, ll>
#define pll pair<ll, ll>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
#define endl '\n'
const int inf = 1000000007;
const ll INF = 1e18;
// int mod = 998244353;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { if (b == 0) return a; return gcd(b, a % b); }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
template<typename T, typename U> T pow_(T a, U b) { return b ? pow_(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { rep(i, sz(vec)) { if (i) os << " "; os << vec[i]; } return os; }
template<typename T> inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T, class T2> inline void add(T &a, T2 b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(11);
  int T;
  T = 1;
  while (T--) solve();
}

void solve() {
  auto calc = [&](int n, int m) {
    double n2 = 30.0 * (n % 12);
    n2 += 30.0 * m / 60;
    // cout << n2 << endl;

    double m2 = 360.0 * m / 60;

    double ans = abs(n2 - m2);
    chmin(ans, (360.0 - n2) + m2);
    chmin(ans, (360.0 - m2) + n2);
    return ans;
  };

  int a, b;
  cin >> a >> b;
  int h, w;
  cin >> h >> w;
  cout << sqrt(a * a + b * b - 2 * a * b * cos(calc(h, w) / 360.0 * 2 * M_PI)) << endl;
}


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

using namespace std;

int main()
{
    vector< vector<char> > c(3, vector<char>(3));
    for (int i = 0; i < 3; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin >> c[i][j];
        }
    }

    cout << c[0][0] << c[1][1] << c[2][2] << endl;

    return 0;
}

Measured memory_bytes: 256
# 入力
S=input()

# 先頭の文字が 'A'
if S[0]!='A':
  print('WA')
  exit()

# 先頭から3文字目と末尾から2文字目の間に
# 'C' が含まれる
if 'C' not in S[2:-1]:
  print('WA')
  exit()

# 上記2文字以外はすべて小文字である
s=list(S)
s.remove('A')
s.remove('C')

for x in s:
  if x not in 'abcdefghijklmnopqrstuvwxyz':
    print('WA')
    exit()

# チェックに一度もかからなかった場合
print('AC')

Measured memory_bytes: 3064
#include<cstdio>
#include<map>
#include<cmath>
#include<vector>
#include<cstring>
#include<algorithm>
#define ll long long
using namespace std;
const int N=202202;
int a[N];
int n,sum;
int main(){
	scanf("%d",&n);
	for (int i=1; i<=n; i++)
		scanf("%d",&a[i]),sum=sum^a[i];
	for (int i=1; i<=n; i++)
		printf("%d ",sum^a[i]);
    return 0;
}

Measured memory_bytes: 3224
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr

n = int(input())

cnt = 0
a = factorization(n)
if n == 1:
  print(0)
  exit()

for i in range(len(a)):
  a[i][1] -= 1
  cnt += 1
  b = 2
  while a[i][1] > 0:
    a[i][1] -= b
    if a[i][1] >= 0:
      cnt += 1
    b += 1
 
print(cnt)

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

int main() {
  double N,K;
  double p=0.0;
  cin >> N >> K;

  for(double i=1.0;i<=N;i=i+1.0){
    double k=1.0;
    while(k<K/i){
      k=k*2;
    }
    double l=N*k;
    p=p+(1.0/l);
  }
  cout << std::setprecision(13) << p << endl;
}




Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main() {
    int a, b;
    cin >> a >> b;

    if ((a + b) % 2 == 1){
      cout << (a + b) / 2 + 1 << endl;
    } else {
      cout << (a + b) / 2 << endl;
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>

using namespace std;

long long int n, sum=0;

int main() {
	cin >> n;
	
	for (long long int i = 1; i <= 1000001; ++i)
	{
		if ((n-i)%i==0 && (n-i)/i > i)
		{
			sum += (n-i)/i;
		}
	}

	cout << sum << endl;
}

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

#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int a, b, c; cin >> a >> b >> c;
    vector<int> vec(100);
    int cnt = 0;
    if(a>b){
        for(int i=1; i<=b; i++){
            if(a%i==0&&b%i==0){
                vec[cnt] = i;
                cnt++;
            }
        }
    }
    else{
        for(int i=1; i<=a; i++){
            if(a%i==0&&b%i==0){
                vec[cnt] = i;
                cnt++;
            }
        }
    }
    cout << vec[cnt-c] << endl;
    return 0;
}

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

int main() {
  int N = 0;
  int M = 0;
  int X = 0;
  std::cin >> N >> M >> X;
  std::vector<int> A(0, 0);

  for (int i = 0; i < M; i++) {
    int a = 0;
    cin >> a;
    A.push_back(a);
    //std::cout << A[i] << std::endl;
  }

  int right_cost = 0;
   int left_cost = 0 ;
  int i = 0;
   if(X < A[0]){
   left_cost=0;
     right_cost=M;
   }else if(X > A[M-1]){
   right_cost=M;
     left_cost=0;
   }else{
  for (;;) {
    if (A[i] < X && A[i + 1] > X) {
      break;
    }
    i += 1;
  }
      right_cost = M - (i+1 );
  left_cost = i+1 ;
   }
 
 //std::cout << left_cost << std::endl;
 //  std::cout << right_cost << std::endl;
  std::cout << min(left_cost, right_cost) << std::endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

int main() {
    int n;
    cin >> n;
    vector<int> v(n);
    int a = 0;
    for (auto &&i : v) scanf("%d", &i), a ^= i;
    for (int i = 0; i < n; ++i) {
        if(i) printf(" ");
        printf("%d", a^v[i]);
    }
    puts("");
    return 0;
}

Measured memory_bytes: 4044
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<string>
#include<map>
#include<set>
#include<functional>
#include<list>
#include<bitset>
using namespace std;
typedef long long ll;



int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int k;
	cin >> k;
	int g = k / 2;
	int ki;
	if (k % 2 == 0) {
		ki = g;
	}
	else {
		ki = g + 1;
	}
	cout << ki * g;
	return 0;
	
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int a, b;
  scanf("%d %d",&a,&b);
  if(a > b)
    printf("a > b\n");
  else if(a < b)
    printf("a < b\n");
  else
    printf("a == b\n");
  return 0;
}

Measured memory_bytes: 2596
#include<algorithm>
#include<iostream>

using namespace std;

int main() {
  int i;

  int a[3], b[3] = { };
  while(cin >> a[0] >> a[1] >> a[2]) {
    sort(a, a + 3);
    if(a[0] + a[1] <= a[2]) break;
    ++b[min(max(-1, a[0] * a[0] + a[1] * a[1] - a[2] * a[2]), 1) + 1];
  }
  while(cin >> a[0] >> a[0] >> a[0]) ;

  cout << b[0] + b[1] + b[2] << ' ' << b[1] << ' ' << b[2] << ' ' << b[0] <<
    endl;
  return 0;
}

Measured memory_bytes: 1176
import java.util.Scanner;

 class Main  {
     public static void main(String[]args){
         Scanner scan = new Scanner(System.in);
         int a = scan.nextInt();
         int b = scan.nextInt();
         int  x  =  999;
         int height[] =new int[1000];
         
         for(int i = 1 ; i <=999; i++){
             height[i] = (i*(i+1))/ 2 ;
         }
         for(int i = 1;i<=998 ; i++){
             if(height[i]>=a && height[i+1]>=b ){
                 if(height[i]-a == height[i+1]-b){
                     
                    System.out.println(height[i]-a);
                    break;
                 }  
            }
         }
           
     }
}


Measured memory_bytes: 22868
#include <iostream>
using namespace std;
 
int main(){
  	int N,X,C = 1,F = 0;
  	cin >> N >> X;
  	int L[N];
  	
  	for(int i = 0;i<N;i++){
    	cin >> L[i];
      	L[i] = L[i] + L[i-1];
    	if(X < L[i]){
          cout << C;
          F = 1;
          break;
        }
    	C++;
    }
	if(F == 0)
      cout << C;
 	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <iomanip>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

using namespace std;
 
#define ull unsigned long long
#define ll long long
#define mod 1000000007
#define fi first
#define se second
#define pb push_back
#define mkp make_pair
#define PI acos(-1.0)
const int N=5e5 + 5;
const int M=1e5 + 5;

char s[N]; 
 
int main()
{
    ios_base::sync_with_stdio(false);
    int i,n;
    vector <int> v;
    cin>>s;
    n=strlen(s);
    ll arr[N];
    ll val = 0;
    //cout << n << endl;
    for(i=0;i<n;i++){
        if(s[i]=='<'){
            arr[i]=val;
            val++;
        }
        else{
            val=0;
        }
    }
    if(s[n-1]=='<'){
        arr[n]=val;
    }
    val=0;
    for(i=n-1;i>=0;i--){
        if(s[i]=='>'){
            arr[i+1]=val;
            val++;
        }
        else{
            if(s[i+1]=='>')
            arr[i+1]=max(val,arr[i]+1);
            val=0;
        }
    }
    if(s[0]=='>'){
        arr[0]=val;
    }
    ll foo = 0;
    // for(i=0;i<=n;i++){
    //     cout << arr[i] << " ";
    // }
    // cout << endl;
    for(i=0;i<=n;i++) foo += arr[i];
    cout << foo << endl;



    return 0;
}

Measured memory_bytes: 4608
#pragma GCC target("avx")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
//#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
using ll = long long;
using vi = vector<int>;

int64_t f(int64_t n){
    return n*(n-1)/2;
}

int main(){
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin>>n;
    
    vector<int64_t> a(n);
    rep(i,n)cin>>a[i], a[i]--;
    
    vector<int64_t> m(n,0);
    rep(i,n)m[a[i]]++;
    
    int64_t ans = 0;
    rep(i,n)ans += f(m[i]);
    
    for(int i=0; i<n; i++){
        cout << ans -f(m[a[i]]) + f(m[a[i]]-1) << endl;
        //printf("%lld\n", ans -f(m[a[i]]) + f(m[a[i]]-1));
    }
    
    return 0;
}

Measured memory_bytes: 5760
#![allow(unused_imports)]
#![allow(unused_macros)]
// use proconio::input;
use std::cmp::{Ordering::*, Reverse};
use std::collections::{BTreeMap, BTreeSet};
use std::io::{self, BufWriter, Write};
use std::str::{self, SplitAsciiWhitespace};

// I have no idea what I'm doing

macro_rules! answer {
    ($out:ident, $ans:expr) => {
        writeln!($out, "{}", $ans)
    };
}

fn main() -> Result<(), io::Error> {
    let (stdin, stdout) = (io::stdin(), io::stdout());
    let mut scan = UnsafeScanner::new(stdin.lock());
    let mut out = BufWriter::new(stdout.lock());

    let n: usize = scan.token();
    let a: Vec<i32> = (0..n).map(|_| scan.token()).collect();
    let mut m = 0x3f3f3f3f;
    let mut ans = 0;
    for x in a {
        if x <= m {
            ans += 1;
        }
        m = m.min(x);
    }

    answer!(out, ans)
}

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

/// Mostly copied from https://github.com/EbTech/rust-algorithms/blob/master/src/scanner.rs
/// Same API as Scanner but nearly twice as fast, using horribly unsafe dark arts
/// **REQUIRES** Rust 1.34 or higher
pub struct UnsafeScanner<R> {
    reader: R,
    buf_str: Vec<u8>,
    buf_iter: SplitAsciiWhitespace<'static>,
}

impl<R: io::BufRead> UnsafeScanner<R> {
    pub fn new(reader: R) -> Self {
        Self {
            reader,
            buf_str: vec![],
            buf_iter: "".split_ascii_whitespace(),
        }
    }

    /// This function should be marked unsafe, but noone has time for that in a
    /// programming contest. Use at your own risk!
    pub fn token<T: str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buf_iter.next() {
                return token.parse().ok().expect("Failed parse [Scanner]");
            }
            self.buf_str.clear();
            self.reader
                .read_until(b'\n', &mut self.buf_str)
                .expect("Failed read");
            self.buf_iter = unsafe {
                let slice = str::from_utf8_unchecked(&self.buf_str);
                std::mem::transmute(slice.split_ascii_whitespace())
            }
        }
    }

    pub fn pair<T: str::FromStr>(&mut self) -> (T, T) {
        (self.token(), self.token())
    }
}

// aka #![feature(bool_to_option)]
trait BoolThen {
    fn then_<T>(self, f: impl FnOnce() -> T) -> Option<T>;
}

impl BoolThen for bool {
    fn then_<T>(self, f: impl FnOnce() -> T) -> Option<T> {
        if self {
            Some(f())
        } else {
            None
        }
    }
}

trait BoolToYes {
    fn yes(self) -> &'static str;
}

impl BoolToYes for bool {
    fn yes(self) -> &'static str {
        match self {
            true => "Yes",
            false => "No",
        }
    }
}


Measured memory_bytes: 3980
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin >> n;
     cout << fixed << setprecision(10);
 
  if(n % 2 == 0){
    
 
    cout << (double)1/2 << endl;
  }
	else{
      cout << (double)((n+1)/2)/n << endl;
    }

}

Measured memory_bytes: 256
from collections import Counter
c = Counter(list(input()))
if len(c) == 1:
  if list(c.values())[0] == 1:
    print('YES')
  else:
    print('NO')
elif len(c) == 2:
  if all(v == 1 for v in c.values()):
    print('YES')
  else:
    print('NO')
else:
  if max(c.values()) >= min(c.values()) + 2:
    print('NO')
  else:
    print('YES')

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

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;

const long long INF = 1LL << 60;

int main()
{
    int A, B;
    cin >> A >> B;

    if ((A * B) % 2 == 0) {
        cout << "No" << endl;
    }
    else {
        cout << "Yes" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
import collections
import math
import operator as op
from functools import reduce
from collections import Counter
import numpy as np
import math
import bisect
import heapq

MOD = 1000000007


def get_inputs(cast_func=None):
    if cast_func is None:
        return input().split()
    else:
        return list(map(cast_func, input().split()))


def get_input(cast_func=None):
    if cast_func is None:
        return input()
    else:
        return cast_func(input())


def main():
    # S, W = get_inputs(int)
    # if W >= S:
    #     print("unsafe")
    # else:
    #     print("safe")

    A, B, C, D = get_inputs(int)

    turn = 0
    while True:
        if turn == 0:
            # Takahashi
            C -= B
            if C <= 0:
                print('Yes')
                break
        else:
            A -= D
            if A <= 0:
                print('No')
                break

        turn ^= 1



if __name__ == '__main__':
    main()


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

// Begin {{{
using namespace std;
#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, b, e) for (i64 i = (b), i##_limit = (e); i <= i##_limit; ++i)
#define repr(i, b, e) for (i64 i = (b), i##_limit = (e); i >= i##_limit; --i)
#define var(Type, ...) Type __VA_ARGS__; input(__VA_ARGS__)
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T> using MaxHeap = priority_queue<T>;
template <class T> using MinHeap = priority_queue<T, vector<T>, greater<>>;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
inline i64 sigma(i64 n) { return n * (1 + n) >> 1; }
inline i64 updiv(i64 n, i64 d) { return (n + d - 1) / d; }
constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;
#ifndef DEBUG
#define dump(...)
#endif

inline void input() {}
template <class Head, class... Tail>
inline void input(Head&& head, Tail&&... tail) {
    cin >> head;
    input(forward<Tail>(tail)...);
}

inline void outs() { cout << "\n"; }
template <class Head, class... Tail>
inline void outs(Head&& head, Tail&&... tail) {
    cout << head << (sizeof...(tail) ? " " : "");
    outs(forward<Tail>(tail)...);
}

template <class T>
inline void outs(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e == &vec.back()]; }

template <class T>
inline void outs(vector<vector<T>> &df) { for (auto &vec : df) outs(vec); }

inline void outl() { cout << "\n"; }
template <class Head, class... Tail>
inline void outl(Head&& head, Tail&&... tail) {
    cout << head << (sizeof...(tail) ? "\n" : "");
    outl(forward<Tail>(tail)...);
}

template <class T>
inline void outl(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

inline void outn() {}
template <class Head, class... Tail>
inline void outn(Head&& head, Tail&&... tail) {
    cout << head;
    outn(forward<Tail>(tail)...);
}

template <class T>
inline void outn(vector<T> &vec) { for (auto &e : vec) cout << e; }

template <class T>
inline vector<T> make_v(const T &initvalue, size_t sz) {
    return vector<T>(sz, initvalue);
}

template <class T, class... Args>
inline auto make_v(const T &initvalue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initvalue, args...))>(sz, make_v<T>(initvalue, args...));
}
// }}} End

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    var(string, s);
    map<char, bool> exist;
    for (auto &e : s) exist[e] = true;
    for (char c = 'a'; c <= 'z'; ++c) {
        if (!exist[c]) {
            outn(s, c, "\n");
            return 0;
        }
    }
    repr(i, s.length() - 2, 0) {
        if (s[i] < s[i + 1]) {
            char best = s[i + 1];
            reps(j, i + 1, s.length() - 1) {
                if (s[j] > s[i]) {
                    chmin(best, s[j]);
                }
            }
            s[i] = best;
            outl(s.substr(0, i + 1));
            return 0;
        }
    }
    outl(-1);
    return 0;
}


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

#define MOD 1000000007
#define rep(i, n) for(ll i=0; i < (n); i++)
#define ALL(v) v.begin(),v.end()
#define FOR(i, j, k) for(ll i=j;i<k;i++)
#define DUMP(i, v)for(ll i=0;i<v.size();i++)cout<<v[i]<<" "

using namespace std;
typedef long long int ll;
typedef vector<ll> llvec;
typedef vector<double> dvec;
typedef pair<ll, ll> P;
typedef long double ld;
struct Edge{ll from, to, cost;};
struct node{ll cost, to;
  bool friend operator>(node a, node b){
    return a.cost>b.cost;
  }
};

ll mod(ll a, ll mod){
  ll res = a%mod;
  if(res<0)res=res + mod;
  return res;
}

ll modpow(ll a, ll n, ll mod){
  ll res=1;
  while(n>0){
    if(n&1) res=res*a%mod;
    a=a*a%mod;
    n>>=1;
  }
  return res;
}

ll modinv(ll a, ll mod){
  return modpow(a, mod-2, mod);
}

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

bool is_prime(ll n){
  ll i = 2;
  if(n==1)return false;
  if(n==2)return true;
  bool res = true;
  while(i*i <n){
    if(n%i==0){
      res = false;
    }
    i = i+1;
  }

  //if(i==1)res = false;
  if(n%i==0)res=false;
  return res;
}


/**************************************
** A main function starts from here  **
***************************************/
int main(){
  ll N;
  ll T;
  cin >>N>>T;
  rep(i, N-1){
    ll t;cin >> t;
    t = t/gcd(t, T);
    T = t*T;
  }

  cout << T;
  
  return 0;
}


Measured memory_bytes: 256
from sys import exit, stdin
from collections import Counter
S = list(stdin.readline().rstrip())
T = list(stdin.readline().rstrip())
S, T = Counter(S).most_common(), Counter(T).most_common()
S, T = [t[1] for t in S], [t[1] for t in T]
if S == T:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 6824
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <climits>
using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> p(N);
    for(int i=0; i<N; i++) {
        cin >> p[i];
        p[i]--;
    }
    vector<int> a(N), b(N);
    const int max = 1000000000;
    int dif = max / N;
    for(int i=0; i<N; i++){
        a[i] = dif * i + 1;
        b[i] = dif * (N-i-1) + 1;
    }
    for(int i=0; i<N; i++){
        a[p[i]] += i;
    }
    for(int i=0; i<N; i++){
        cout << a[i] << " ";
    }
    cout << endl;
    for(int i=0; i<N; i++){
        cout << b[i] << " ";
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 896
using System;

    class Program
    {
        static void Main(string[] args)
        {
            String[] compare = Console.ReadLine().Split(' ');
            int a = int.Parse(compare[0]);
            int b = int.Parse(compare[1]);
            int c = int.Parse(compare[2]);

            if (a < b && b < c)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }   

Measured memory_bytes: 5296
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
  int ans_a = 0, ans_b = 0;
  for(;;){
    int a,b,c;
    if(scanf("%d,%d,%d",&a,&b,&c) == EOF){break;}
    if(a*a+b*b == c*c){ans_a++;}
    if(a == b){ans_b++;}
  }
  cout <<ans_a<<endl<<ans_b<<endl;
  return 0;
}

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

#define int long long
#define form2(i, a, b) for (int i = (a); i < (b); ++i)
#define ford2(i, a, b) for (int i = (a-1); i >= b; --i)
#define form(i, n) form2(i, 0, n)
#define ford(i, n) ford2(i, n, 0)

#define chmax(x, v) x = max(x, (v))
#define chmin(x, v) x = min(x, (v))
#define fi first
#define se second

const long long BIG = 1000000000000000000LL;

typedef long long ll;
typedef long double ld;

void cpr(string s, vector<int> v)
{ int i = 0; for (char c : s) { if (c == '$') cout << v[i++]; else cout << c; } cout << '\n'; }

void cpr(string s) { cpr(s, {}); }

void solve();
signed main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	solve();
	return 0;
}

void solve()
{
	int n; cin >> n;
	multiset<int> a;
	form(i, n) {
		int x; cin >> x;
		a.insert(x);
	}
	int rep = 0;
	while (! a.empty()) {
		auto it = a.find(*(a.rbegin()));
		int val = *it;
		a.erase(it);
		int som = 1;
		while (som-val < 1) som *= 2;
		int req = som-val;
		auto it2 = a.find(req);
		if (it2 != a.end()) {
			a.erase(it2);
			++rep;
		}
	}
	cout << rep << "\n";
	
}


Measured memory_bytes: 9600
use proconio::input;

// ABC086C - Traveling
// https://atcoder.jp/contests/abs/fasks/arc089_a
fn gcd(a:usize, b:usize) -> usize {
    if b == 0 {
        return a
     } 
    gcd(b , a % b)
}
fn main() {
    input! {
        n: usize,
    }
    let mut result = 0;
    for a in 1..n+1{
        for b in 1..n+1{
            let d = if b < a { gcd(a,b) } else { gcd(b,a) };
            for c in 1..n+1{
                result += if c < d { gcd (d,c) } else { gcd(c, d)};
            }
        }
    }
    println!("{}",result);
}

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

int main(){
  int a;
  cin>>a;
  if(a%7==1){
    cout<<"fri"<<endl;
  }else if(a%7==2){
    cout<<"sat"<<endl;
  }else if(a%7==3){
    cout<<"sun"<<endl;
  }else if(a%7==4){
    cout<<"mon"<<endl;
  }else if(a%7==5){
    cout<<"tue"<<endl;
  }else if(a%7==6){
    cout<<"wed"<<endl;
  }else{
    cout<<"thu"<<endl;
  }
    
  
  return 0;
}




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

using namespace std;

const int N = 309;

int a[N];
int b[N];
long long f[N][N];
long long nf[N][N];

int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; ++i) {
    scanf("%d", a + i);
    b[i] = a[i];
  }
  b[n] = 0;
  sort(b, b + n + 1);
  const long long inf = 1'000'000'000'000'000'000;
  for (int i = 0; i <= m; ++i) {
    for (int j = 0; j <= n; ++j) {
      f[i][j] = inf;
    }
  }
  f[0][0] = 0;
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j <= m; ++j) {
      for (int k = 0; k <= n; ++k) {
        nf[j][k] = inf;
      }
    }
    for (int j = 0; j <= m; ++j) {
      {
        long long mn = inf;
        for (int k = 0; k <= n; ++k) {
          if (j + 1 <= m) { 
            mn = min(mn, f[j][k]);
            nf[j + 1][k] = min(nf[j + 1][k], mn);
            if (k + 1 <= n) {
              mn += b[k + 1] - b[k];
            }
          }
        }
      } 
      {
        long long mn = inf;
        for (int k = n; k >= 0; --k) {
          if (j + 1 <= m) { 
            mn = min(mn, f[j][k]);
            nf[j + 1][k] = min(nf[j + 1][k], mn);
          }
        }
      }
      int p = -1;
      for (int k = 0; k <= n; ++k) {
        if (b[k] == a[i]) {
          p = k;
        }
      }
      for (int k = 0; k <= n; ++k) {
        nf[j][p] = min(nf[j][p], f[j][k] + max(0, b[p] - b[k]));
      }
    }
    for (int j = 0; j <= m; ++j) {
      for (int k = 0; k <= n; ++k) {
        f[j][k] = nf[j][k];
      }
    }
  }
  long long ans = inf;
  for (int i = 0; i <= m; ++i) {
    for (int j = 0; j <= n; ++j) {
      ans = min(ans, f[i][j]);
    }
  }
  printf("%lld\n", ans);
}


Measured memory_bytes: 1664