akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>
#include <assert.h>
#include <unordered_set>
#include <random>



using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e18;
// const ll MOD = 1e9 + 7;
const ll MOD = 998244353;

#define REP(i, n) for(ll i = 0; i < n; i++)











ll POW(ll n, ll m, ll p){
    ll res = 1, x = n;
    for(ll i = m; i > 0; i >>= 1){
        if(i & 1){
            res *= x;
            res %= p;
        }
        x *= x;
        x %= p;
    }
    return res;
}
 
int main(){
    ll n;
    cin >> n;
    vector<ll> d(n);
    bool f = false;
    REP(i, n){
        cin >> d[i];
        if(d[i] == 0){
            if(f){
                cout << 0 << endl;
                return 0;
            }
            else{
                f = true;
            }
        }
    }
    if(d[0] != 0){
        cout << 0 << endl;
        return 0;
    }
    sort(d.begin(), d.end());
    ll v = 1, c = 0, pre = 1, ans = 1;
    for(ll i = 1; i < n; i++){
        if(v == d[i]){
            c++;
        }
        else{
            ans *= POW(pre, c, MOD);
            ans %= MOD;
            v++;
            if(d[i] != v){
                cout << 0 << endl;
                return 0;
            }
            pre = c;
            c = 1;
        }
    }
    ans *= POW(pre, c, MOD);
    ans %= MOD;
    cout << ans << endl;
}

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

int main()
{
  int n;cin>>n;
  int ans=n*100/108;
  if(ans*108/100==n)cout<<ans<<endl;
  else if((ans+1)*108/100==n)cout<<ans+1<<endl;
  else if((ans-1)*108/100==n)cout<<ans-1<<endl;
  else cout<<":("<<endl;
}


Measured memory_bytes: 256
#!/mnt/c/Users/moiki/bash/env/bin/python
S = input()
T = input()
n = len(T)
from collections import defaultdict

diff = {}
diff2 = {}
same = set()
for i in range(n):
    if S[i] != T[i]:
        diff[S[i]] = T[i]
        diff2[T[i]] = S[i]
    else:
        same.add(S[i])

for i in range(n):
    if S[i] in diff and diff[S[i]] != T[i]:
        print("No")
        exit(0)
    elif T[i] in diff2 and diff2[T[i]] != S[i]: 
        print("No")
        exit(0)


print("Yes")
exit(0)


Measured memory_bytes: 42404
{-# OPTIONS_GHC -O #-}

import Control.Monad
import Control.Monad.ST
import Data.List
import qualified Data.Vector.Unboxed.Mutable as VM
import qualified Data.ByteString.Char8 as B
import qualified Data.IntMap as M

main = do
    (n:m:_)<-map read.words<$>getLine::IO [Int]
    lrds <- replicateM m $ unfoldr (B.readInt.B.dropWhile(==' ')) <$> B.getLine :: IO[[Int]]
    let grp = foldl (\m (l:r:d:_)->M.alter (ins l (-d)) r $ M.alter (ins r d) l m) M.empty lrds
    putStrLn $ if solve n grp lrds then "Yes" else "No"
--
ins ::Int -> Int -> Maybe [(Int,Int)] -> Maybe [(Int,Int)]
ins n w Nothing = Just [(n,w)]
ins n w (Just nws) = Just ((n,w):nws)
--
solve :: Int -> M.IntMap [(Int,Int)] -> [[Int]] -> Bool
solve n grp lrds = runST $ do
    ckd <- VM.replicate (n+1) False :: ST s (VM.STVector s Bool)
    dst <- VM.replicate (n+1) 0 :: ST s (VM.STVector s Int)
    fmap and $ forM [1..n] $ \i -> do
        d <- VM.unsafeRead dst i
        dfs grp ckd dst True (i,d)
--
dfs :: M.IntMap [(Int,Int)] -> VM.STVector s Bool -> VM.STVector s Int -> Bool -> (Int,Int) -> ST s Bool
dfs grp ckd dst ac (x,d) = do
    c <- VM.unsafeRead ckd x
    dd <- VM.unsafeRead dst x
    if c then return $ ac && dd==d
    else do
        VM.unsafeWrite ckd x True
        VM.unsafeWrite dst x d
        foldM (dfs grp ckd dst) ac $ map (\(u,v)->(u, v+d)) $ M.findWithDefault [] x grp


Measured memory_bytes: 145788
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<cassert>
#include<iostream>
#include<sstream>
#include<string>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<utility>
#include<numeric>
#include<algorithm>
#include<bitset>
#include<complex>

using namespace std;

typedef long long Int;
typedef vector<int> vint;
typedef pair<int,int> pint;
#define mp make_pair

template<class T> void pv(T a, T b) { for (T i = a; i != b; ++i) cout << *i << " "; cout << endl; }
template<class T> void chmin(T &t, T f) { if (t > f) t = f; }
template<class T> void chmax(T &t, T f) { if (t < f) t = f; }
int in() { int x; scanf("%d", &x); return x; }

int steps[40];

int main() {
	int i;
	steps[1]=1;
	steps[2]=2;
	steps[3]=4;
	for(i=4;i<=30;i++){
		steps[i]=steps[i-1]+steps[i-2]+steps[i-3];
	}
	int n;
	while(n=in()){
		cout<<~-steps[n]/365/10+1<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
use std::collections::*;

#[allow(unused_macros)]
macro_rules! get {
    ([$t:ty] ; $n:expr) => {
        (0..$n)
        .map(|_| get!([$t])).collect::<Vec<_>>()
    };
    ($($t:ty),+ ; $n:expr) => {
        (0..$n).map(|_| get!($($t),+)).collect::<Vec<_>>()
    };
    ([$t:ty]) => {
        rl().split_whitespace()
        .map(|x| x.parse().unwrap())
        .collect::<Vec<$t>>()
    };
    ($t:ty) => {
        rl().parse::<$t>().unwrap()
    };
    ($($t:ty),*) => {
        {
            let line =rl();
            let mut iter = line.split_whitespace();
            ($(iter.next().unwrap().parse::<$t>().unwrap()),*)
        }
    };
}
fn rl() -> String {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line).unwrap();
    line.trim().to_string()
}

fn main() {
    let _n = get!(usize);
    let v = get!([usize]);
    let mut map = HashMap::new();
    for i in 0..v.len() {
        let counter = map.entry(v[i]).or_insert(0);
        *counter += 1;
    }
    let mut rest = 0;
    for (_k, v) in map.iter() {
        rest += v - 1;
    }
    if rest % 2 == 0 {
        println!("{}", map.len());
    } else {
        println!("{}", map.len() - 1);
    }
}


Measured memory_bytes: 12540
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, gcd
from itertools import accumulate, permutations, combinations, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()
A = LIST()

if sum(A) > N:
	print(-1)
else:
	print(N-sum(A))


Measured memory_bytes: 10596
import java.util.Scanner;
class Main
{
    public static void main(String args[])
    {
	Scanner scan=new Scanner(System.in);
	while(true)
	    {
		int n,p,d1,d2,maxp=0,maxd=0;
		n=scan.nextInt();
		if(n==0)break;
		for(int i=0;i<n;i++)
		    {
			p=scan.nextInt();
			d1=scan.nextInt();
			d2=scan.nextInt();
			if(maxd<d1+d2)
			    {
				maxp=p;
				maxd=d1+d2;
			    }
		    }
		
		System.out.println(maxp+" "+maxd);
	    }
    }
}

Measured memory_bytes: 157768
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;

public class Main {
    public static void main(String args[]) throws Exception{
        BufferedReader stdR = new BufferedReader(new InputStreamReader(System.in));
        int N = Integer.parseInt(stdR.readLine());
        int[] a = new int[N];
        int[] sorteda = new int[N];
        for(int i = 0 ; i < N ; i++) {
            a[i] = Integer.parseInt(stdR.readLine());
            sorteda[i] = a[i];
        }
        Arrays.sort(sorteda);
        for(int i = 0 ; i < N ; i++) {
            if(a[i] == sorteda[N - 1]) {
                System.out.println(sorteda[N - 2]);
            }else {
                System.out.println(sorteda[N - 1]);
            }
        }
    }
}

Measured memory_bytes: 59724
import sys
range = xrange
input = raw_input

A = []
for _ in range(3):
    A.append([int(x) for x in input().split()])

C = [[False,False,False] for _ in range(3)]

n = int(input())
for _ in range(n):
    b = int(input())
    for x in range(3):
        for y in range(3):
            if A[x][y] == b:
                C[x][y] = True
def bingo():
    print 'Yes'
    sys.exit()

for x in range(3):
    if all(C[x]):
        bingo()

for y in range(3):
    if all(C[x][y] for x in range(3)):
        bingo()

if all(C[x][x] for x in range(3)):
    bingo()

if all(C[x][~x] for x in range(3)):
    bingo()

print 'No'



Measured memory_bytes: 28524
import sys
def side(p1, p2, p3):
  y1,x1=p1
  y2,x2=p2
  y3,x3=p3
  return (x3-x1)*(y2-y1)-(x2-x1)*(y3-y1)>0
while 1:
  n=input()
  if n==0:break
  D=[input() for i in range(n)]
  for p1 in D:
    c=0
    for p2 in D:
      if p1==p2:continue
      f=[0,0]
      for p3 in D:
        if p1==p3 or p2==p3: continue
        f[side(p1,p2,p3)]+=1
      if min(f)==0:
        n-=1
        break
  print n

Measured memory_bytes: 4260
MOD = 10**9 + 7

N, K = map(int, raw_input().split())
A = map(int, raw_input().split())

factorial = [1]
for i in range(1, N+1):
    factorial.append((i * factorial[-1]) % MOD)

def nCk(n, k):
    numerator = factorial[n]
    denominator = factorial[n-k] * factorial[k]
    return numerator * pow(denominator, MOD - 2, MOD)

ans = 0

A.sort()

A = A[::-1]
for i in range(N-K+1):
    best = A[i]
    contribution = (best * nCk(N-i-1, K-1))
    ans = (ans + contribution) % MOD

A.sort()
for i in range(N-K+1):
    best = A[i]
    contribution = (best * nCk(N-i-1, K-1))
    ans = (ans - contribution) % MOD

print ans


Measured memory_bytes: 12800
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,t;
	cin >> n>>t;
	if(t%n == 0) {
		cout << t/n << endl;
		return 0;
	}
	int m =t/n;
	vector<int> ret;
	for(int i=1 ; i*i<=t ; ++i)
	{
		if(t%i == 0)
		{
			ret.push_back(i);
			if(i!=1 && i*i!=t/n)
			{
				ret.push_back(t/i);
			}
		}
	}
	sort(ret.rbegin(),ret.rend());
  int i=0;	
  while(ret[i]>t/n)
    i++;
  cout<<ret[i]<<endl;
}

Measured memory_bytes: 256
import javax.print.DocFlavor;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.nio.charset.StandardCharsets;
import java.util.*;

public class Main {

    //グローバル変数を定義
    List<char[]> list = new ArrayList<>();

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

    void run() {
        Scanner sc = new Scanner(System.in);
        char[] input = sc.next().toCharArray();
        StringBuilder str = new StringBuilder();

        for(char c: input){
            if(c == '0'){
                str.append("0");
            } else if(c == '1'){
                str.append("1");
            } else {
                if(str.length() > 0){
                    str.deleteCharAt(str.length()-1);
                }
            }
        }

        System.out.println(str.toString());
    }
}


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


int main(){
	int a, b;
    int p, q, r;
    int ans;

    cin >> a >> b;
    p = a + b;
    q = a - b;
    r = a * b;
    ans = max(max(p, q), r);
    cout << ans << endl;	
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define DEBUG
#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
	template <typename Arg1>
	void __f(const char* name, Arg1&& arg1)
	{
		cerr << name << " = " << arg1 << endl;
	}
	template <typename Arg1, typename... Args>
	void __f(const char* names, Arg1&& arg1, Args&&... args)
	{
		const char* comma = strchr(names + 1, ','); cerr.write(names, comma - names) << " = " << arg1 << " || ";
		__f(comma+1, args...);
	}
#else
#define debug(...)
#endif

template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) {
    os << "{ ";
    for(auto& y : x) os << y << " ; ";
    return os << "}";
}

template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) {
	return os << "[ " << p.first << ", " << p.second << "]" ;
}

#define FAST_IO std::ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll long long int
#define pb push_back
#define mp make_pair
#define ld long double
#define sz(a) (ll)(a).size()
#define endl "\n"

// priority_queue<ll, vector<ll>, less<ll>>pq;     // Max Heap
// priority_queue<ll, vector<ll>, greater<ll>>pq;  // Min Heap

typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
//K-th smallest
//cout << k << "kth (1 based indexing) smallest: " << *A.find_by_order(k - 1) << endl;
//NO OF ELEMENTS < X
//cout << "No of elements less than " << X << " are " << A.order_of_key(X) << endl;

int main()
{
	FAST_IO;

 	ll x, k, d;
 	cin >> x >> k >> d;
 	x = abs(x);
 	if(x >= d)
 	{
 		if(x / d >= k) cout << x - k * d << endl;
 		else
 		{
 			ll w = x / d;
 			k -= w;
 			x %= d;
 			if(k % 2 == 0) cout << x << endl;
 			else cout << d - x << endl;
 		}
 	}   
 	else
 	{
 		if(k % 2 == 0) cout << x << endl;
 		else cout << d - x << endl;
 	}
    return 0;
}

Measured memory_bytes: 3572
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
using namespace std;

typedef pair<int, int> P;

int h, w;
int a[555][555];
vector<pair<P, P> > ans;

int main(){
  ios_base::sync_with_stdio(false);

  cin >> h >> w;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      cin >> a[i][j];
    }
  }

  for(int i=0;i<h-1;i++){
    for(int j=0;j<w;j++){
      if(a[i][j] % 2 == 1){
        a[i+1][j] += 1;
        a[i][j] -= 1;
        ans.push_back(make_pair(make_pair(i, j), make_pair(i+1, j)));
      }
    }
  }
  
  for(int j=0;j<w-1;j++){
    if(a[h-1][j] % 2 == 1){
      a[h-1][j]--;
      a[h-1][j+1]++;
      ans.push_back(make_pair(make_pair(h-1, j), make_pair(h-1, j+1)));
    }
  }
 
  cout << ans.size() << endl;
  for(int i=0;i<ans.size();i++){
    cout << ans[i].first.first+1 << " " << ans[i].first.second+1 << " " << ans[i].second.first+1 << " " << ans[i].second.second+1 << endl;
  }

  return 0;
}



Measured memory_bytes: 5232
def main():
    n = int(input())
    A = []
    B = []
    for _ in range(n):
        a, b = map(int, input().split())
        A.append(a)
        B.append(b)

    btn_cnt = 0
    for i in range(n - 1, -1, -1):
        a, b = A[i] + btn_cnt, B[i]
        if b == 1 or a % b == 0:
            continue
        else:
            #print("a:", a + btn_cnt, "b:", b)
            need = b - a % b
            btn_cnt += need
            #print("need:", need)

    print(btn_cnt)


if __name__ == "__main__":
    main()


Measured memory_bytes: 11048
#!/usr/bin/env pypy3
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    N,M=MI()
    A=1900*M+100*(N-M)
    rep=pow(2,M)
    print(A*rep)

main()


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef complex<double> Point;

#define PI acos(-1.0)
#define EPS 1e-10
const ll INF = 1e16;
const ll MOD = 1e9 + 7;

#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rep(i,N) for(ll i=0;i<(N);i++)
#define ALL(s) (s).begin(),(s).end()
#define EQ(a,b) (abs((a)-(b))<EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )
#define fi first
#define se second
#define N_SIZE (1LL << 20)
#define NIL -1

ll mod_add(ll a, ll b) { return (a + b) % MOD; }
ll mod_sub(ll a, ll b) { return (a - b + MOD) % MOD; }
ll mod_mul(ll a, ll b) { return a*b % MOD; }

template<class T> 
class DK{
public:
    struct edge{
        ll to;
        T cost;
        edge(ll _to,T _cost):to(_to),cost(_cost){}
    };

    vector<T> d;
    vector<vector<edge>> G;

    DK(ll _n){
        d.resize(_n);
        G.resize(_n);
    }

    //無向辺
    void add_edge(ll from,ll to,T cost){
        G[from].push_back(edge(to,cost));
        G[to].push_back(edge(from,cost));
    }

    void dijkstra(ll start){
        fill(ALL(d),INF);
        d[start] = 0;

        typedef pair<T,ll> PP;
        priority_queue<PP, vector<PP>, greater<PP>> que;
        que.push(PP(0,start));

        while (!que.empty()){
            PP p = que.top();
            que.pop();
            ll v = p.second;
            T cost = p.first;
            if(cost > d[v])continue;
            rep(i,G[v].size()){
                edge e = G[v][i];
                ll to = e.to;
                T ncost = cost + e.cost;
                if (d[e.to] > ncost){
                    d[e.to] = ncost;
                    que.push(PP(d[e.to],to));
                }
            }
        }
    }
};

ll n,m,s,t;

int main(){
    cin >> n >> m >> s >> t;
    s--; t--;
    DK<ll> A(n),B(n);
    rep(i,m){
        ll u,v,a,b;
        cin >> u >> v >> a >> b;
        u--; v--;
        A.add_edge(u,v,a);
        A.add_edge(v,u,a);
        B.add_edge(u,v,b);
        B.add_edge(v,u,b);
    }
    A.dijkstra(s);
    B.dijkstra(t);
    ll ans = INF;
    vector<ll> out;
    for(ll i = n - 1;i >= 0;i--){
        ans = min(ans,A.d[i] + B.d[i]);
        out.push_back((ll)(1e15 - ans));
    }
    reverse(ALL(out));
    rep(i,n){
        cout << out[i] << endl;
    }
}

Measured memory_bytes: 27132
package main

import (
	"fmt"
	"math"
)

func main() {
	var K, X float64
	fmt.Scan(&K, &X)
	l := math.Max(-1000000, X-(K-1))
	r := math.Min(1000000, X+(K-1))
	for i := l; i <= r; i++ {
		fmt.Print(i)
		if i < r {
			fmt.Print(" ")
		} else {
			fmt.Println()
		}
	}
}


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

int main() {
  int a,b,c;
  cin>>a>>b;
  for(a;a<=b;a++){
    if(a/10000==a%10&&a/1000%10==a%100/10){
      c++;
    }
  }
  cout<<c<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include<stdio.h>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<algorithm>
#include<cstring>
#include<math.h>
#include<cmath>
#include<stack>
using namespace std;
int a[100010];
int main()
{
  int a[60000],b[10000],r,m=0,n,i,j,k,l,rmid,lmid;
  cin>>n;
  memset(a,0,sizeof(a));
  memset(b,0,sizeof(b));
  for(i=2;i<=60000;i++)
  {
      if(!a[i])
      {
          b[m++]=i;
      }
      for(j=0;j<m&&i*b[j]<=60000;j++)
      {
          a[i*b[j]]=1;
          if(i%b[j]==0)
            break;
      }
  }
  i=0;
  while(i<n)
  {
      if(b[i]%10==1)
        cout<<b[i]<<" ";
      else
      {
          n++;
      }
      i++;
  }
  return 0;
}


Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		int kakera = 0;
		int pie = 0;

		Scanner sc = new Scanner(System.in);

		int a = sc.nextInt();
		int p = sc.nextInt();

		kakera = a*3 + p;

		if(kakera > 0 && kakera % 2 == 0) {
			pie = kakera / 2;
		}else {
			kakera --;
			pie = kakera / 2;
		}

		System.out.println(pie);
	}
}


Measured memory_bytes: 24020
#include<bits/stdc++.h>
using namespace std;
#define fastio() ios::sync_with_stdio(0),cin.tie(0);
int main()
{
	int n;
	cin >> n;
	for(int i=111;i<1000;i+=111)
		if (n <= i)
		{
			cout << i;
			break;
		}
	return 0;
}

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

using namespace std;

using ll = long long;
using ld = long double;

using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vb = vector<bool>;
using vs = vector<string>;

typedef pair<ll, ll> P;

#define bit(n) (1LL << (n))

//#define int long long

#define all(v) v.begin(), v.end()
#define sortAl(v) sort(all(v))
#define sortAlr(v)          \
  sort(v.begin(), v.end()); \
  reverse(v.begin(), v.end())

#define rep(i, n) for (ll i = 0; i < n; i++)
#define REP(i, n) for (ll i = 1; i < n; i++)

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define FORm(i, m) for (auto i = m.begin(); i != m.end(); i++)

template <class T>
inline void chmax(T &a, T b) {
  a = std::max(a, b);
}
template <class T>
inline void chmin(T &a, T b) {
  a = std::min(a, b);
}

#define mod (ll)(1e9 + 7)
#define INF LLONG_MAX

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);

  ll n, t;
  cin >> n >> t;

  vector<P> way(n);

  rep(i, n) {
    cin >> way[i].first >> way[i].second;
  }

  ll ans = INF;
  FORm(it, way) {
    if (it->second <= t) {
      chmin(ans, it->first);
    }
  }

  if (ans == INF) {
    cout << "TLE" << endl;
  } else {
    cout << ans << endl;
  }
  return 0;
}


Measured memory_bytes: 256
s_list = list(input().split())

ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'

string = ''
for s in s_list:
    idx = ascii_lowercase.find(s[0])
    string += ascii_uppercase[idx]

print(string)

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

int main(){
  int n;
  cin >> n;
  vector<int> l(n);
  rep(i,n) cin >> l[i];
  sort(l.begin(),l.end());
  int res = 0;
  for (int i = 0; i < n; i++) {
    for (int j = i+1; j < n; j++) {
      auto itr = lower_bound(l.begin(),l.end(), l[i]+l[j]) - l.begin();
      int k = itr - (j + 1);
      res += max(k,0);
    }
  }
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//----***やべーやつら***----
using namespace std;
#define int long long

//----***型定義***----
using ll = long long;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
typedef long double lb;
typedef long double ld;
typedef pair<int,int> P;

//----***Like a Pythonista***----
#define REP(ii,jj,nn) for (ll ii=jj;ii<(nn);ii++)
#define RREP(ii,nn,jj) for (ll ii = nn; jj<ii;ii--)
#define each(i,...) for (auto&& i:__VA_ARGS__)
#define ALL(vec) (vec).begin(),(vec).end()
#define sum(...) accumulate(ALL(__VA_ARGS__),0LL)
#define dsum(...) accumulate(ALL(__VA_ARGS__),0.0L)
#define vec(type,name,...) vector<type> name(__VA_ARGS__)
template<class T> inline auto max(const T& a){ return *max_element(ALL(a)); }
template<class T> inline auto min(const T& a){ return *min_element(ALL(a)); }
inline ll gcd(ll a,ll b){if(b == 0) return a;return  gcd(b,a%b);}
inline ll lcm(ll a,ll b){ll g = gcd(a,b);return a / g * b;}

//----***定数***----
#define MOD 1e9+7;
#define INF 1e9;
#define EPS 1e-9;

//----***入出力***---
#define print(out) cout<< out  << "\n";
#define debug(var)  do{std::cerr << #var << " ↓ "<<"\n";view(var);}while(0);
#define dbg cerr<<"🥺🥺🥺🥺🥺🥺"<<endl;
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }

//----***初期時読み込み***----
struct initial{initial(){cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}initial_;

int N,M,K;
string S;
signed main(){
  cin>>K;
  int sum_=0;
  REP(i,1,K+1)REP(j,1,K+1)REP(k,1,K+1){
    sum_+=gcd(i,gcd(j,k));
  }
  print(sum_)

}


Measured memory_bytes: 3652
def f():
    n = int(input())
    x = int(1e18)
    arr = list(map(int, input().split(' ')))
    arr.sort()
    ans = 1
    for i in arr:
        # print(i)
        ans = ans * i
        if ans > x:
            print(-1)
            return
    print(ans)
f()


Measured memory_bytes: 21784
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n,cnt=0;
  string s;
  cin>>n>>s;
  for(int i=0;i<n-2;i++){
    if(s.at(i)=='A' && s.at(i+1)=='B' && s.at(i+2)=='C')cnt++;
  }
  cout<<cnt<<endl;
  return 0;
}


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

#define DEBUG(x) cout<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cout<<#v<<":";for(int i=0;i<v.size();i++) cout<<" "<<v[i]; cout<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
const int inf = 1000000001;
const ll INF = 2e18 * 2;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0,-1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };

int main() {
	int n, m, i;
	cin >> n >> m;
	vi num(n);
	for (i = 0; i < m; i++) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		num[a]++; num[b]++;
	}
	for (i = 0; i < n; i++) {
		if (num[i] % 2) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
}

Measured memory_bytes: 640
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()
def LS(): return list(input())
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(10**6)
MOD = 10**9+7
INF = 10**18
# ----------------------------------------------------------- #

n = I()
A = LI()
def lcm(a, b):
    g = gcd(a, b)
    return a*b//g
l = reduce(lcm, A) - 1
ans = 0
for a in A:
    ans += l % a
print(ans)

Measured memory_bytes: 66152
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int32_t, int32_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

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

  string S;
  cin >> S;
  const int32_t length = static_cast<int32_t>(S.length());
  vector<int32_t> lookup(256, 0);
  bool okay = true;
  for (int32_t i = 0; i < length; ++i) {
    lookup[S.c_str()[i]]++;
    if (lookup[S.c_str()[i]] >= 2) {
      okay = false;
      break;
    }
  }
  if (okay) {
    cout << "yes" << endl;
  } else {
    cout << "no" << endl;
  }

  return 0;
}


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


int main() {
    int n;
    cin >> n;
    vector<int> a(n - 1);
    rep(i, n - 1) {
        cin >> a[i];
        a[i]--;
    }

    map<int, int> cnt;
    rep(i, n) cnt[i] = 0;
    rep(i, n - 1) cnt[a[i]]++;

    for (auto e: cnt) cout << e.second << endl;
}


Measured memory_bytes: 13468
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int a,b,c,d,count;
    char e;
  count =0;
  	string s;
  	cin>>s;
  for(int i=0;i<3;i++){
	if(s.at(i)=='o')  
     count++;
  }  
  cout<<700+100*count<<endl;
 return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define loop(i,x,z) for (int i=x;i<z;i++)
int x, y;
int main()
{
	cin >> x >> y;
	if (y & 1)cout << "No";
	else
	{
		for (int i = 0; i <= x; i++)
		{
			if (i * 4 + (x - i) * 2 == y)
			{
				cout << "Yes";
				return 0;
			}
		}
		cout << "No";
	}
}

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

using i64 = int64_t;

#define rep(i, x, y) for (i64 i = i64(x), i##_max_for_repmacro = i64(y); i < i##_max_for_repmacro; ++i)
#define debug(x) #x << "=" << (x)

#ifdef DEBUG
#define _GLIBCXX_DEBUG
#define print(x) std::cerr << debug(x) << " (L:" << __LINE__ << ")" << std::endl
#else
#define print(x)
#endif

const int inf = 1.01e9;
const i64 inf64 = 4.01e18;
const double eps = 1e-9;

template <typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
    os << "(" << p.first << ", " << p.second << ")";
    return os;
}

template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
    os << "[";
    for (const auto &v : vec) {
        os << v << ",";
    }
    os << "]";
    return os;
}

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

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

void solve() {
    //const i64 mod = 1'000'000'007;
    i64 N,M;
    cin >> N >> M;

    vector<vector<bool>> like(N,vector<bool>(M));
    rep(i,0,N){
        i64 K;
        cin >> K;
        rep(j,0,K){
            i64 A;
            cin >> A;
            --A;
            like[i][A]=true;
        }
    }

    i64 ans=0;
    rep(j,0,M){
        bool ok=true;
        rep(i,0,N){
            if(!like[i][j]){
                ok=false;
                break;
            }
        }
        if(ok) ++ans;
    }

    cout << ans << endl;
}

int main() {
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <list>
#include <ctime>
#include <sstream>
#include <queue>
#include <stack>
#include <bitset>
#include <numeric>
#include <cassert>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
#define FOR(x, b, e) for(int x=(b); x<=(e); ++x)
#define FORD(x, b, e) for(int x=((int)(b))-1; x>=(e); --x)
#define REP(x, n) for(int x=0; x<(n); ++x)
#define ALL(c) c.begin(),c.end()
#define sz(x) ((int)((x).size()))
#define pb push_back
#define st first
#define nd second
#define mp(x,y) make_pair(x,y)
typedef short int sint;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it) {
	*this << ((it != d.b) ? ", " : "") << *it;
  }
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

int main() {
	ios_base::sync_with_stdio(false);
	vi a(3);
	REP(i, 3) cin >> a[i];
	sort(ALL(a));
	if (a[0] == a[1] && a[1] != a[2]) {
		cout << "Yes\n";
	} else if (a[0] != a[1] && a[1] == a[2]) {
		cout << "Yes\n";
	} else {
		cout << "No\n";
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std ;
typedef long long ll;
int main ()
{
 ll N  ,A,B , c=0 ;
cin >> N >>A >>B;
for(int i = 1; i <= N; i++){
        int sum=0  , w=i;

while ( w>0)
{
    sum=sum+ w%10;
    w=w/10;
}
if (sum >=A && sum <=B)
    c=c+i;

}
cout << c;

return 0 ;
}



Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<28;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-10;
const ll mod=1e9+7;
const vi emp;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,-0};
const int DX[8]={-1,-1,-1,0,0,1,1,1},DY[8]={1,0,-1,1,-1,1,0,-1};

int h,w,n;
vvc a;

int main(){
	cin>>h>>w>>n;
	a=vvc(h,vc(w));
	vector<vvi> s(1005,vvi(1005,vi(3)));
	for(int i=0;i<h;i++) for(int j=0;j<w;j++) cin>>a[i][j];
	for(int i=1;i<=h;i++) for(int j=1;j<=w;j++){
		for(int k=0;k<3;k++){
			s[i][j][k]=s[i-1][j][k]+s[i][j-1][k]-s[i-1][j-1][k];
		}
		char c=a[i-1][j-1];
		int I=2;
		if(c=='J') I=0;
		if(c=='O') I=1;
		s[i][j][I]++;
	}
	for(int i=0;i<n;i++){
		int a,b,c,d;
		cin>>a>>b>>c>>d;
		for(int j=0;j<3;j++){
			if(j) cout<<' ';
			cout<<s[c][d][j]-s[c][b-1][j]-s[a-1][d][j]+s[a-1][b-1][j];
		}
		cout<<endl;
	}
}

Measured memory_bytes: 59092
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;

string s;
int sum, ans;

int main() {
	cin >> s;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'R') {
			sum ++;
			ans = max(sum, ans);
		} else {
			ans = max(sum, ans);
			sum = 0;
		}
	}
	printf ("%d\n", ans);
	return 0;
} 

Measured memory_bytes: 3768
X = int(input())

import math

def is_not_prime(n):
    if n == 1: return True

    for k in range(2, int(math.sqrt(n)) + 1):
        if n % k == 0:
            return True

    return False

num = X
while is_not_prime(num):
  num = num+1

print(num)

Measured memory_bytes: 3060
#define _DEBUG 1

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

using ll = long long;

#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define check(s) cerr << s << endl
#else
#define dump(x)
#define dump2(x, y)
#define check(s)
#endif

#define rep(i, n) for (ll i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());

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

void solve(ll X, ll A, ll B) {
  if (A - B >= 0) {
    cout << "delicious" << endl;
    // } else if (B - A <= X) {
  } else if (A - B + X >= 0) {
    cout << "safe" << endl;
  } else {
    cout << "dangerous" << endl;
  }
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You
// use the default template now. You can remove this line by using your custom
// template)
int main() {
  ll X;
  scanf("%lld", &X);
  ll A;
  scanf("%lld", &A);
  ll B;
  scanf("%lld", &B);
  solve(X, A, B);
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
int main(){
	int h[5],f[4],w,c;
	while(cin>>h[0],h[0]){
		rep(i,4)f[i]=0; f[h[0]]=1;
		rep(i,4)cin>>h[i+1],f[h[i+1]]=1;
		c=0; rep(i,4)c+=f[i];
		if(c==1||c==3)w=0;
		else{
			if(!f[1])w=2;
			if(!f[2])w=3;
			if(!f[3])w=1;
		}
		rep(i,5)cout<<(w?h[i]==w?1:2:3)<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
/*                        ______
 _______   /\     |``\   |        |  /
    |     /  \    |__/   |____    |/
    |    / _ _\   |  \   |        |\
    |   /      \  |   \  |______  |  \

            Dept. of CSE
        Comilla  University

*/
#include<bits/stdc++.h>
#define pi 2*acos(0.0)
#define ll long long
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Node struct node
#define spc " "
#define  E  2.71828182845904523536
#define pb push_back
#define pp pop_back
#define valid(nx,ny) nx>=0 && nx<n && ny>=0 && ny<m
#define ee endl
#define pii pair<int,int>
#define infinity 10000000000000000
#define mod 1000000007
int fx[]={0,0,+1,-1};
int fy[]={+1,-1,0,0};

using namespace std;
///check n=1;
///check corner case;
const int maX=1e5+1;
vector<ll>Graph[maX],cost[maX];
ll visit[maX];


int main()
{
   ll x;
   cin>>x;
   for(ll i=x;;i++){
        ll cc=0;
      for(ll j=2;j*j<=i;j++){
        if(i%j==0){
            cc=1;break;
        }

      }
      if(cc==0){
        return cout<<i<<endl,0;
      }
   }
return 0;
}


Measured memory_bytes: 4992
#include <cstdio>

constexpr long long MOD = 1000000007;
long long dp[101][8];
int p[8][8];
int main()
{
  int h, w, k;
  scanf("%d%d%d", &h, &w, &k);
  
  for (int i = 0; i < 1 << (w - 1); ++i)
  {
    bool ng = false;
    for (int j = 0; j < w - 2; ++j)
    {
      if (((i >> j) & 0b11) == 0b11)
      {
        ng = true;
        break;
      }
    }
    if (ng) continue;
    for (int j = 0; j < w; ++j)
    {
      switch (((i << 1) >> j) & 3)
      {
        case 0b00:
          {
            p[j][j] += 1;
            break;
          }
        case 0b01:
          {
            p[j - 1][j] += 1;
            break;
          }
        case 0b10:
          {
            p[j + 1][j] += 1;
            break;
          }
      }
    }
  }
  dp[0][0] = 1;
  for (int i = 0; i < h; ++i)
  {
    for (int j = 0; j < w; ++j)
    {
      dp[i + 1][j] = (
          (j > 0 ? dp[i][j - 1] * (long long)p[j - 1][j] % MOD : 0) +
          (dp[i][j] * (long long)p[j][j] % MOD) +
          (j < w - 1 ? dp[i][j + 1] * (long long)p[j + 1][j] % MOD : 0)
        ) % MOD;
    }
  }
  printf("%lld\n", dp[h][k - 1]);
  return 0;
}


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

typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define DECIM8  fixed<<setprecision(8) 
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

using namespace std;
int addtax(int a,int p)
{
  return a*(p+100)/100;
}
int main(void)
{
  for(;;){
    int x,y,s;
    int answer=0;
    cin >> x >> y >> s;
    if(!x&&!y&&!s) return 0;
    FOR(i,1,s){
      FOR(j,1,s){
	if(addtax(i,x)+addtax(j,x)==s) answer=max(answer,addtax(i,y)+addtax(j,y));
      }	
    }
    cout << answer << endl;
  }
}

Measured memory_bytes: 1160
#include <iostream>
#include <string>

#define set(v, vt, vx, vy, vz) { v.t = vt; v.x = vx; v.y = vy; v.z = vz; }

using namespace std;

struct Vector3 {
	char t;
	short x;
	short y;
	short z;
};

int main( void )
{
	int n, h;
	Vector3 pos[200];

	while(cin >> n >> h, n | h) {
		string c;
		short a, b;
		int count = 0;
		for(int i=0; i < h; ++i) {
			cin >> c >> a >> b;
			if(c == "xy") {
				set(pos[i], 'A', a, b, -1);
			}
			else if(c == "xz") {
				set(pos[i], 'B', a, -1, b);
			}
			else if(c == "yz") {
				set(pos[i], 'C', -1, a, b);
			}
			count += n;
		}
		int cnt = 0;
		for(int i=0; i < h-1; ++i) {
			int m = 0;
			switch(pos[i].t) {
				case 'A':
					for(int j=i+1; j < h; ++j) {
						if(pos[i].t == pos[j].t) continue;
						if(pos[i].x == pos[j].x) {
							--count;
							for(int k=0; k < h; ++k) {
								if(i == k || j == k) continue;
								if(pos[i].y == pos[k].y && pos[j].z == pos[k].z) { cnt++; break; }
							}
						}
						else if(pos[i].y == pos[j].y) {
							--count;
							for(int k=0; k < h; ++k) {
								if(i == k || j == k) continue;
								if(pos[i].x == pos[k].x && pos[j].z == pos[k].z) { cnt++; break; }
							}
						}
					}
					break;
				case 'B':
					for(int j=i+1; j < h; ++j) {
						if(pos[i].t == pos[j].t) continue;
						if(pos[i].x == pos[j].x) {
							--count;
							for(int k=0; k < h; ++k) {
								if(i == k || j == k) continue;
								if(pos[i].z == pos[k].z && pos[j].y == pos[k].y) { cnt++; break; }
							}
						}
						else if(pos[i].z == pos[j].z) {
							--count;
							for(int k=0; k < h; ++k) {
								if(i == k || j == k) continue;
								if(pos[i].x == pos[k].x && pos[j].y == pos[k].y) { cnt++; break; }
							}
						}
					}
					break;
				case 'C':
					for(int j=i+1; j < h; ++j) {
						if(pos[i].t == pos[j].t) continue;
						if(pos[i].y == pos[j].y) {
							--count;
							for(int k=0; k < h; ++k) {
								if(i == k || j == k) continue;
								if(pos[i].z == pos[k].z && pos[j].x == pos[k].x) { cnt++; break; }
							}
						}
						else if(pos[i].z == pos[j].z) {
							--count;
							for(int k=0; k < h; ++k) {
								if(i == k || j == k) continue;
								if(pos[i].y == pos[k].y && pos[j].x == pos[k].x) { cnt++; break; }
							}
						}
					}
					break;
			}
		}
		cout << n*n*n - (count + (cnt/3)) << endl;
	}
	return 0;
}

Measured memory_bytes: 0
n=int(input())
L=list(map(int,input().split()))
ans=0
for i in range(len(L)):
    for j in range(1,len(L)):
        for k in range(2,len(L)):
            if L[i]!=L[j] and L[i]!=L[k] and L[j]!=L[k]:               
                if i<j<k:
                    if L[k]<L[i]+L[j]:
                        a=max(L[i],L[j],L[k])
                        if a<L[i]+L[j]+L[k]-a:
                            ans+=1
print(ans)

Measured memory_bytes: 9060
#include <iostream>

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

    int mul = a * b;
    bool isEven = ((mul & 0x01) == 0);

    if (isEven) {
        std::cout << "Even" << std::endl;
    }
    else {
        std::cout << "Odd" << std::endl;
    }

    return 0;
}

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()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair<ll, ll>
#define F first
#define S second
const int MOD = 1000000007;
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 (a>b) { a=b; return true; } return false; }
//sort(all(x))とするとソートできるよ
// 10^x は pow(10,(x)) 
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main(){
    LL N;cin >> N;

    LL ans = INF;

    for(LL i = 1;i <= sqrt(N);++i){
        if(N % i == 0){
            LL tmp = i-1;
            tmp += (N / i - 1);
            chmin(ans,tmp);
        }
    }
    chmin(ans,N-1);

    cout << ans << endl;
}


Measured memory_bytes: 256
import math

def culc(t):
    return math.degrees(math.atan(t))

a,b,x=map(int,input().split())
V=a**2*b

if x>=V/2:
    T=2*((b/a)-(x/(a**3)))
    print(culc(T))
else:
    T=(a*(b**2))/(2*x)
    print(culc(T))



Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
//#include <windows.h>
#include <algorithm>
#include <cstdio>
#include <list>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstring>
#include <cmath>
#include <fstream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cstdlib>
#include <cmath>
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
#define INF 1000000007
using namespace std;
typedef long long LL;
typedef pair<int,int> P;
typedef priority_queue<P, vector<P>, greater<P> > minPQ;
struct edge {int to,cost;};
//const int SIZE = 1<<18;
 
LL X[100010];
int main() {
	LL N,A,B;
	cin >> N >> A >> B;
	REP(i,N) cin >> X[i];
	LL ans = 0;
	REP(i,N-1) {
		if((X[i+1]-X[i])*A > B) {
			ans += B;
		} else {
			ans += (X[i+1]-X[i])*A;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <ctype.h>

int main(void)
{
    int str[26] = {0};
    char ch;
    int num;

    while(scanf("%c", &ch) != EOF){
        if(islower(ch)){
            num = ch - 'a';
        }else if(isupper(ch)){
            num = ch - 'A';
        }else{
            continue;
        }
        str[num]++;
    }

    int i;
    char a[] = "abcdefghijklmnopqrstuvwxyz";
    for(i = 0; i < 26; i++){
        printf("%c : %d\n", a[i], str[i]);
    }
    
    return 0;
}


Measured memory_bytes: 2144
/*
Miles Morales : When will I know I'm ready?
Peter B. Parker : You won't. It's a leap of faith. That's all it is, Miles. A leap of faith.
*/
//KEEP IT SIMPLE STUPID
#include<string>
#include<bits/stdc++.h>

#define mp make_pair
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define print(v) for(auto it=(v).begin();it!=(v).end();it++) {cout<<*it<<" ";}
#define ll long long
#define w(t) ll t;cin>>t;while(t--)

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
using namespace std;

int main()
{
    ll n;
    cin>>n;
    vector<pii > v(n);
    forn(i,n)
    {
        cin>>v[i].fi;
        v[i].se=i+1;
    }
    sort(all(v));
    forn(i,n)
    {
        cout<<v[i].se<<" ";
    }
    return 0;
}

/* stuff you should look for
	* int overflow, array bounds
	* special cases (n=1?)
	* do smth instead of nothing and stay organized
	* WRITE STUFF DOWN
*/


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int main(){
    int N; cin>>N;
    vector<int64_t> A(N),B(N);
    rep(n,0,N) cin>>A.at(n)>>B.at(n);

    int64_t ans=0;
    _rep(i,N-1,0){
        if((A.at(i)+ans)%B.at(i)) ans+=B.at(i)-(A.at(i)+ans)%B.at(i);
    }

    cout<<ans<<endl;
}

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

#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(),i.rend()
#define INF 1e9
#define LINF 1e18
const int mod = 1e9+7;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pi;
typedef long long i64;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n, m;
  cin >> n >> m;
  int ans = (1900 * m + 100 * (n - m)) * (1 << m);
  cout << ans << endl;
}


Measured memory_bytes: 384
//B
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll n,a,b;
	ll ans = 0;
	cin >> n >> a >> b;
	ans += n/(a+b)*a;
	ans += min(a,n-n/(a+b)*(a+b));
	cout << ans;
	return 0;
}


Measured memory_bytes: 256