akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int GCD(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   if(_a % _b == 0){
      return _b;
   }
   else{
      return GCD(_b, _a % _b);
   }
}

int LCM(const int& a, const int& b){
   const int& _a = max(a,b);
   const int& _b = min(a,b);
   return (_a*_b)/(GCD(_a, _b));
}

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

   bool is_ok = false;
   if(a % 3 == 0){is_ok = true;}
   else if(b % 3 == 0){is_ok = true;}
   else if((a + b) % 3 == 0){is_ok = true;}

   cout << (is_ok ? "Possible" : "Impossible") << endl;

   return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String argv[]) throws IOException {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		String Array[]=new String[6];
		double a,b,c,d,e,f,x,y;
		while ((str = br.readLine()) != null) {
			Array=str.split(" ");
			a = Double.parseDouble(Array[0]);
			b = Double.parseDouble(Array[1]);
			c = Double.parseDouble(Array[2]);
			d = Double.parseDouble(Array[3]);
			e = Double.parseDouble(Array[4]);
			f = Double.parseDouble(Array[5]);
			y=(c*d/a-f)/((b*d/a)-e);
			x=(c/a-b*y/a);
			System.out.printf("%.3f %.3f\n",x,y);

		}
	}

}

Measured memory_bytes: 24544
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <numeric>
#include <functional>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <memory>
#include <thread>
#include <tuple>
#include <limits>

using namespace std;

int main() {
  int n;
  scanf("%d", &n);
  double sum = 0;
  for (int i = 0; i < n; i++) {
    int a;
    scanf("%d", &a);
    sum += 1.0 / a;
  }
  printf("%.10f\n", 1.0 / sum);
  return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<iomanip>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<cctype>
#define szxb 1000010
#define GO goto endreturn;
using namespace std;
int n,m;
struct ele{int cut;bool fly;}a[szxb];
inline bool cmp(ele x,ele y){return (x.cut>y.cut);}
int main()
{
	scanf("%d%d",&n,&m);int now(0);
	for(register int i(1);i<=n;i++){scanf("%d",&a[now++].cut);a[now].fly=1;scanf("%d",&a[now++].cut);}
	//for(register int i(0);i<=now-2;i++){for(register int j(0);j<=now-i-1;j++){if(a[j].cut<a[j+1].cut){swap(a[j],a[j+1]);}}}
	sort(a,a+now,cmp);
	int ans(0);
	for(register int i(0);i<=now-1;i++){if(a[i].fly){ans++;m-=a[i].cut;if(m<=0){GO}}else{if(!(m%a[i].cut)){ans+=(m/a[i].cut);}else{ans+=((m/a[i].cut)+1);}GO;}}
	endreturn:
		printf("%d",ans);return putchar(10),0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <functional>
#include <numeric>
#include <iomanip>
#define fi first
#define se second
#define fcout(n) cout<<fixed<<setprecision((n))
#define cinl(str) getline(cin,(str))
using namespace std;
bool value(int y,int x,int R,int C){return 0<=y&&y<R&&0<=x&&x<C;}
typedef pair<int,int> pii;
typedef long long ll;
typedef vector<int> vi;
typedef vector<long long > vll;
typedef vector< vi > vvi;
double pie=acos(-1);
int INF=1000000007;
int dx[4] = { 0,-1,0,1 };
int dy[4] = { -1,0,1,0 };
 
 
int main() {
	int n;
	int a[5000];
	int ans,x[9];
	ans=0;
	for(int i=0;i<9;i++){
		x[i]=0;
	}
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>a[i];
		if(a[i]<400){
			x[0]++;
		}
		else if(a[i]>=400 && a[i]<800){
			x[1]++;
		}
		else if(a[i]>=800 && a[i]<1200){
			x[2]++;
		}
		else if(a[i]>=1200 && a[i]<1600){
			x[3]++;
		}
		else if(a[i]>=1600 && a[i]<2000){
			x[4]++;
		}
		else if(a[i]>=2000 && a[i]<2400){
			x[5]++;
		}
		else if(a[i]>=2400 && a[i]<2800){
			x[6]++;
		}
		else if(a[i]>=2800 && a[i]<3200){
			x[7]++;
		}
		else if(a[i]>=3200){
			x[8]++;
		}
	}
	for(int i=0;i<9;i++){
		if(x[i]>0 && i<8){
			ans++;
		}
	}
	if(ans==0){
		ans++;
		x[8]--;
	}
	cout<<ans<<" "<<ans+x[8]<<endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringJoiner;
import java.util.StringTokenizer;
import java.util.function.IntUnaryOperator;
import java.util.function.LongUnaryOperator;

class Main {
    static In in = new In();
    static Out out = new Out();
    static long mod = 1000000007;
    static long inf = 0xfffffffffffffffL;

    void solve() {
        int n = in.nextInt();
        int[] a = in.nextIntArray(n);
        int p = 1;
        int i = 0;
        long ans = 0;
        while (i < n) {
            if (a[i] - p > p) {
                long k = (a[i] - 1) / p - 1;
                a[i] -= p * k;
                ans += k;
            } else if (a[i] - p > 0) {
                a[i] = 1;
                ans++;
            } else if (a[i] >= p) {
                p++;
            } else {
                i++;
            }
        }
        out.println(ans);
    }

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

class In {
    private BufferedReader reader = new BufferedReader(new InputStreamReader(System.in), 0x10000);
    private StringTokenizer tokenizer;

    String next() {
        try {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(reader.readLine());
            }
        } catch (IOException ignored) {
        }
        return tokenizer.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    char[][] nextCharArray(int n, int m) {
        char[][] a = new char[n][m];
        for (int i = 0; i < n; i++) {
            a[i] = next().toCharArray();
        }
        return a;
    }

    int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    int[] nextIntArray(int n, IntUnaryOperator op) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = op.applyAsInt(nextInt());
        }
        return a;
    }

    long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextLong();
        }
        return a;
    }

    long[] nextLongArray(int n, LongUnaryOperator op) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = op.applyAsLong(nextLong());
        }
        return a;
    }
}

class Out {
    private static PrintWriter out = new PrintWriter(System.out);

    void println(Object... a) {
        StringJoiner joiner = new StringJoiner(" ");
        for (Object obj : a) {
            joiner.add(String.valueOf(obj));
        }
        out.println(joiner);
    }

    void flush() {
        out.flush();
    }
}


Measured memory_bytes: 35020
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

func main() {
	sc := NewScanner()
	A, P := sc.nextInt(), sc.nextInt()
	sum := A*3 + P
	fmt.Println(sum / 2)
}


Measured memory_bytes: 640
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;

class Main {
	public static void main(String[] args) {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String line;
		try {
			for (;;) {
				line = br.readLine();
				if ("0".equals(line)) {
					break;
				}

				Map<String, List<long[]>> sales = new LinkedHashMap<>();
				int size = Integer.parseInt(line);
				for (int i = 0; i < size; i++) {
					String[] v = br.readLine().split(" ");
					String id = v[0];

					if (!sales.containsKey(id)) {
						sales.put(id, new ArrayList<>());
					}

					sales.get(id).add(new long[] { Long.parseLong(v[1]), Long.parseLong(v[2]) });
				}

				boolean na = true;
				for (Entry<String, List<long[]>> entry : sales.entrySet()) {
					long total = 0;

					for (long[] p : entry.getValue()) {
						total += p[0] * p[1];
					}

					if (total >= 1000000) {
						System.out.println(entry.getKey());
						na = false;
					}
				}

				if (na) {
					System.out.println("NA");
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
		}
	}
}

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

using namespace std;

const int OO = 2e7;
const double EPS = 1e-9;

#define ndl cout << '\n'
#define sz(v) int(v.size())
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define present(a, x) (a.find(x) != a.end())
#define db(x) cout << "> " << #x << " = " \
	<< (x) << '\n'
#define db2(x, y) cout << "> " << #x << " = " \
	<< (x) << ", " << #y << " = " << (y) << '\n'
#define db3(x, y, z) cout << "> " << #x << \
	" = " << (x) << ", " << #y << " = " << \
	(y) << ", " << #z << " = " << (z) << '\n'

typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vii;
typedef vector<vector<int>> vvi;
typedef map<int, int> mii;
typedef set<int> si;

const int MX = 1e5 + 1;
int n, m, deg[MX];
vector<bool> vis;
vi st, low;
vvi adj(MX);
si cutPts;
int timer;

void dfs(int u, int p = -1) {
//	db2(u, p);
	vis[u] = true;
	st[u] = low[u] = timer++;
	int children = 0;
	for (auto& to : adj[u]) {
		if (to == p)
			continue;
		if (vis[to])
			low[u] = min(low[u], st[to]);
		else {
//			db2(u, to);
			dfs(to, u);
			low[u] = min(low[u], low[to]);
			if (low[to] >= st[u] && p != -1)
				cutPts.insert(u);
			++children;
		}
	}
	if (p == -1 && children > 1)
		cutPts.insert(u);
}

int main() {
	ios::sync_with_stdio(false);
	cout.precision(10);
	cin >> n >> m;
	int u, v;
	for (int i = 0; i < m; ++i) {
		cin >> u >> v;
		++deg[u], ++deg[v];
		adj[u].pb(v), adj[v].pb(u);
	}
	int four = 0, six = 0;
	for (int i = 1; i <= n; ++i) {
		if (deg[i] & 1) {
			cout << "No\n";
			return 0;
		}
		four += (deg[i] >= 4);
		six += (deg[i] >= 6);
	}
	if (six || four >= 3) {
		cout << "Yes\n";
		return 0;
	}
	if (four < 2) {
		cout << "No\n";
		return 0;
	}
	timer = 0;
	vis.assign(n + 1, false);
	st.assign(n + 1, -1);
	low.assign(n + 1, -1);
	dfs(1);
	for (auto& cutPt : cutPts) {
//		db2(cutPt, deg[cutPt]);
		if (deg[cutPt] == 4) {
			cout << "Yes\n";
			return 0;
		}
	}
	cout << "No\n";
	return 0;
}


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

int main() {
  int N,K;
  scanf("%d %d", &N,&K);
  int a[N];
  for(int i=0;i<N; ++i){
    scanf("%d" ,&a[i]);
  }

  long long min = 300000000;



  for(int i=0;i<N;++i){
    if(i+K-1>N-1) break;
    if(a[i]<=0 && a[i+K-1]>=0 && abs(a[i])*2+a[i+K-1]<min) min = abs(a[i])*2+a[i+K-1];
    if(a[i]<=0 && a[i+K-1]>=0 && abs(a[i])+a[i+K-1]*2<min) min = abs(a[i])+a[i+K-1]*2;
  }

  if(a[0]>=0) min = a[K-1];
  if(a[N-1]<=0) min = abs(a[N-K]);

  cout << min << endl;

}



Measured memory_bytes: 640
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        List<Integer> list = new ArrayList<>();
        list.add(s.nextInt());
        list.add(s.nextInt());
        list.add(s.nextInt());
        List<Integer> result = list.stream().distinct().collect(Collectors.toList());

        System.out.println(result.size());
    }

}


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

#define all(x)        (x).begin(),(x).end()
#define eb            emplace_back
#define mp            make_pair
#define pb            push_back
#define fi            first
#define se            second
#define sz(x)         ((int)(x).size())
#define rep(x,y,z)    for(int x=y;x<z;x++)
#define per(x,z,y)    for(int x=z-1;x>=y;x--)
#define trav(y,x)     for(auto& y:x)
#define pii           pair<int, int>
#define pll           pair<ll, ll>
#define vi            vector<int>
#define vll           vector<ll> 
#define vpi           vector<pii>

int dbg = 0;
#define cri           if(0)
#define shame         cri cerr<<(++dbg)<<"\n\n";

// aaaaaaaaaaaaaaaa
void solve() {
  int ans;
  vi x(5);
  rep(i,0,5) {
    cin>>x[i];
    if (!x[i])
      ans=(i+1);
  }
  cout<<ans<<'\n';
}

int main() {
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  // int _; cin >> _; while(_--)
  solve();
	return 0;
}


Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
#define ll long long
int a[maxn], n;

void slove()
{
    scanf("%d" ,&n);
    for (int i = 1; i <= n; ++ i)
    {
        scanf("%d" ,a + i);
    }
    sort (a + 1, a + 1 + n);
    int mid = n / 2;
    int l = a[mid],  r = a[mid + 1];
    printf("%d\n" ,r - l);
    return ;
}
signed main()
{
    slove();
    return 0;
}


Measured memory_bytes: 640
/*
 * ReversingNumbers.cpp
 *
 *  Created on: 2014/07/21
 *      Author: WanWan1985
 */
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

void disp(vector<int> a_vecValue) {
	vector<int>::reverse_iterator itr		= a_vecValue.rbegin();
	vector<int>::reverse_iterator itrEnd 	= a_vecValue.rend();

	for(; itr != itrEnd; itr++) {
		cout << *itr;
		if (itr != itrEnd - 1) {
			cout << " ";
		}
		if (itr == itrEnd - 1) {
			cout << endl;
		}
	}
}

int main(void) {

	int n = 0;
	cin >> n;
	vector<int> vecValue;
	for (int i = 0; i < n; i++) {
		int a = 0;
		cin >> a;
		vecValue.push_back(a);
	}
	disp(vecValue);

	return 0;
}

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

int main() {
  
  int n; cin >> n;
  
  for (int i = 3; i <= n; i++) {
    
    bool flag = false; int tmp = i;
    
    if (i % 3 == 0) flag = true;
    
    while (tmp != 0) {
      if (tmp % 10 == 3) {
        flag = true;
        break;
      }
      else tmp /= 10;
    }
    
    if (flag) cout << " " << i;
    
  }
  
  cout << endl;
  
}


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

ll n, x;
vector<ll> h(55), p(55);

ll dfs(ll cur)
{
  ll ret = 0;
  //cout << cur << " " << x << " / " << h[cur] << endl;
  
  if(cur == 0)
  {
    ret++;
  }
  else if(x == 1)
  {
    //none
  }
  else if(x <= h[cur-1] + 1)
  {
    x--;
    ret += dfs(cur-1);
  }
  else if(x == h[cur-1] + 2)
  {
    ret += p[cur-1] + 1;
  }
  else if(x <= h[cur] - 1)
  {
    x -= h[cur-1] + 2;
    ret += p[cur-1] + 1;
    ret += dfs(cur-1);
  }
  else if(x == h[cur])
  {
    ret += p[cur];
  }
  
  return ret;
}


int main()
{
  cin >> n >> x;
  p[0] = 1;
  rep(i, n) p[i+1] = p[i]*2+1;
  h[0] = 1;
  rep(i, n) h[i+1] = h[i]*2+3;
  
  cout << dfs(n) << endl;

  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("-O3")
#pragma GCC optimize("Ofast")

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

using l = long int;
using ll =long long int;
#define imax INT_MAX
#define lmax LLONG_MAX
#define pb push_back
#define ld long double
#define pii pair<l,l> 
#define pll pair<ll,ll>
#define v vector
#define vl vector<l>
#define vll vector<ll>
#define vvl vector<vector<l>>
#define vvll vector<vector<ll>>
#define vv(a) vector<vector<a>> 
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define mni(a,i,j) *min_element((a).begin()+i,(a).begin()+j)
#define mxi(a,i,j) *max_element((a).begin()+i,(a).begin()+j)
#define f first
#define se second
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define rep(i, begin, end) \
        for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define tc l t=0;cin>>t;while(t--)

// ONLINE JUDGE START
#ifndef ONLINE_JUDGE
    // FILE
    #define file ifstream cin; cin.open("input.txt");  ofstream cout; cout.open("output.txt");
    // DEBUG
    #define debug(x) cout<<"LINE NUMBER:     "<<__LINE__<<"\t :--> \t"<<#x<<"   =   "<<x<<endl;
#else 
    #define debug(x) 
#endif

// SYSTEM
#define DeBuG(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#define time__(d) for(long blockTime=NULL;(blockTime==NULL?(blockTime=clock())!=NULL:false); \
            DeBuG("%s:%.4f s\n",d,(double)(clock()-blockTime)/CLOCKS_PER_SEC))
// OVERLOADING
istream& operator >> (istream& cin,vll &a){
    for(auto &i:a)cin>>i;
    return cin;
}
ostream& operator << (ostream& cout,pll &a){
    cout<<a.f<<" "<<a.se<<"\t";
    return cout;
}
ostream& operator << (ostream& cout,vl &a){
    for(auto &i:a)cout<<i<<" ";
    return cout;
}
ostream& operator << (ostream& cout,vll &a){
    for(auto &i:a)cout<<i<<" ";
    return cout;
}
ostream& operator << (ostream& cout,v<pll> &a){
    for(auto &i:a)cout<<i<<"\t";
    return cout;
}
ostream& operator << (ostream& cout,vvl &a){
    for(auto &i:a){cout<<i<<endl;}
    return cout;
}
ostream& operator << (ostream& cout,vvll &a){
    for(auto &i:a){cout<<i<<endl;}
    return cout;
}
ostream& operator << (ostream& cout,unordered_map<ll,bool> &a){
    for(auto &i:a){cout<<i.f<<" "<<i.se<<"\t";}
    return cout;
}


// GLOBAL VARIABLE AND FUNTIONS
const ll inf = 1e9+7;

int main()
{
#ifndef ONLINE_JUDGE
    // file;
#endif 

    ll h,n;cin>>h>>n;
    // vll arr(n);cin>>arr;
    // ll sum=0;
    // for(auto i:arr)sum+=i;

    // cout<<(sum<h ? "No" : "Yes");
    if(h%n==0)cout<<h/n;
    else cout<<((h/n) +1);

#ifndef ONLINE_JUDGE
//    cerr << "Time elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << " ms.\n";
#endif
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint     = long long;
const lint inf = 1LL << 60;
const lint mod = 1000000007;

// list up all factors
template <typename T>
set<T> factors(T a) {
    set<T> facs;
    for (T i = 1; i * i <= a; ++i) {
        if (a % i == 0) {
            facs.insert(i);
            facs.insert(a / i);
        }
    }
    return facs;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    lint x;
    cin >> x;
    auto facs = factors(x);
    for (lint i = -1000; i < 1000; ++i) {
        for (auto &f : facs) {
            lint j = i - f;
            if (i * i * i * i * i - j * j * j * j * j == x) {
                cout << i << " " << j << "\n";
                return 0;
            }
        }
    }
    return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

ll p;
int t;

ll modpow(ll a, ll b, ll m){
  ll r = 1;
  while(b){
    if(b&1)r=r*a%m;
    a=a*a%m;
    b>>=1;
  }
  return r;
}
ll modinv(ll a, ll m){
  return modpow(a,m-2,m);
}

vl getPrimeFactors(ll x){
  vl ret;
  for(ll y=2; y*y<=x; y++)if(x%y==0){
    ret.push_back(y);
    while(x%y==0)x/=y;
  }
  if(x>1)ret.push_back(x);
  return ret;
}

ll getPrimitiveRoot(ll p){
  vl factors = getPrimeFactors(p-1);
  while(true){
    ll g = rand() % p;
    if(g<=1)continue;
    bool ok = true;
    for(ll q : factors){
      if(modpow(g,(p-1)/q,p) == 1){
        ok = false;
        break;
      }
    }
    if(ok)return g;
  }
}

const int B = 6000000;

const int ZZ = 20;
const int MM = 1<<ZZ;
const int MA = MM-1;
pii bsgsMap[B];
int bsgsHead[MM+1];
ll g, gmb;
void getBsgsMap(){
  ll x = 1;
  int sz = min((ll)B, p-1);
  REP(i,sz){
    bsgsMap[i] = pii(x,i);
    x = x*g%p;
  }
  sort(bsgsMap, bsgsMap+sz, [&](pii a, pii b){
    int s = a.first, t = b.first;
    if((s&MA) != (t&MA)) return (s&MA) < (t&MA);
    return a<b;
  });
  bsgsHead[0] = 0;
  int cur = 0;
  REP(i,sz){
    while((bsgsMap[i].first&MA) != cur){
      cur++;
      bsgsHead[cur] = i;
    }
  }
  while(cur != MM){
    cur++; bsgsHead[cur] = sz;
  }
  gmb = modinv(modpow(g,B,p),p);
}
ll calcBsgs(ll y){
  ll x = 1;
  for(int i=0; ; i++){
    int z = y * x % p;
    for(int id = bsgsHead[z&MA]; id < bsgsHead[(z&MA)+1]; id++){
      if(bsgsMap[id].first == z){
        int j = bsgsMap[id].second;
        return i*B+j;
      }
    }
    x = x * gmb % p;
  }
}

int main(){
  scanf("%lld%d",&p,&t);
  if(p==2){
    // all ok
    REP(i,t)puts("1");
    return 0;
  }

  // find primitive root
  g = getPrimitiveRoot(p);
  // prepare for baby-step giant-step
  getBsgsMap();
  
  REP(i,t){
    int sz; scanf("%d",&sz);
    int b = p-1;
    REP(j,sz){
      ll x;
      scanf("%lld", &x);
      x = calcBsgs(x);
      // x = __gcd(x, p-1);
      b = __gcd((ll)b, x);
    }
    ll A;
    scanf("%lld", &A);
    A = calcBsgs(A);
    if(A%b==0){
      puts("1");
    }else{
      puts("0");
    }
  }
  return 0;
}



Measured memory_bytes: 54160
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 10;
int a[maxn];

int main() {
    int n, k;
    scanf("%d %d", &n, &k);
    for(int i = 1; i <= n; ++i) scanf("%d", a + i);
    printf("%d\n", (n - 1 + k - 2) / (k - 1));
    return 0;
}

Measured memory_bytes: 640
sum1 = 0
Coin500 = 500
Coin100 = 100
Coin50 = 50
Coin10 = 10
Coin5 = 5
Coin1 = 1

x = int(input())

while True:
    if x - Coin500 >= 0:
        sum1 = sum1 + 1000
        x = x - Coin500
    else:
        break

while True:
    if x - Coin5 >= 0:
        sum1 = sum1 + 5
        x = x - Coin5
    else:
        break

print(sum1)

Measured memory_bytes: 3064
def main():
    from sys import stdin
    from math import sqrt

    readline = stdin.readline

    N,D = list(map(int,readline().rstrip().split()))
    count = 0

    for X in range(N):
        X1,X2 = list(map(int,readline().rstrip().split()))
        
        if sqrt(X1**2 + X2**2) <= D :
            count += 1

    print(count)

main()

Measured memory_bytes: 9172
#include<iostream>
#include<algorithm>
#include<string>
using namespace std;
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  while(1){
    int a,b[114]={};
    int c,d,e=0,f=0,g[114514],h=1;
    cin >>a;
    if(a==0) break;
    cin >>s;
    for(int n=0;n<100;n++){
      d=n%a;
      if(s[n]=='S') e+=b[d+1]+1,b[d+1]=0;
      if(s[n]=='L') b[d+1]+=e+1,e=0;
      if(s[n]=='M') b[d+1]+=1;
    }
    sort(b+1,b+a+1);
    for(int n=1;n<=a;n++){
      cout <<b[n]<<' ';
    }
    cout <<e<<'\n';
  }
  return(0);
}



Measured memory_bytes: 3224
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int M1,D1,M2,D2;
  cin >> M1 >> D2 >> M2 >> D2;
  
  if(M1 == M2){
    cout << 0 << endl;
  }
  else{
    cout << 1 << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define eps 1e-8
using namespace std;
double dp[3005][3005];
double p[3005];
int main()
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
		cin>>p[i];
	dp[1][0]=1.0-p[1];
	dp[1][1]=p[1];
	for(int i=2;i<=n;i++)
		for(int j=0;j<=n;j++)
		{
			if(j!=0)
			dp[i][j]=dp[i-1][j-1]*p[i]+dp[i-1][j]*(1.0-p[i]);
			else
			dp[i][j]=dp[i-1][j]*(1.0-p[i]);
		}
	double ans=0;
	for(int i=(n+1)/2;i<=n;i++)
		ans+=dp[n][i];
	cout<<fixed<<setprecision(10)<<ans<<endl;	
	return 0;
}

Measured memory_bytes: 70656
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using VI = vector<int>;

int main() {
#ifdef LOCAL_EXEC
//	freopen("sample.in", "r", stdin);
//	freopen("sample.out", "w", stdout);
#else
  ios_base::sync_with_stdio(false); cin.tie(NULL);
#endif

  int n; cin >> n;
  multiset<ll> a;
  for (int i = 0; i < n; i++) {
    ll x; cin >> x;
    a.insert(x);
  }

  int ans = 0;
  while (a.size() >= 2u) {
    auto it = a.end();
    it--;
    ll x = *it;
    a.erase(it);

    ll p = 1;
    while (p <= x) p *= 2;
    ll y = p - x;

    it = a.find(y);
    if (it != a.end()) {
      ans++;
      a.erase(it);
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 12984
n = int(input())
a = list(map(int, input().split()))
MOD = 10**9+7
ans = 0
plus = 0
for i in range(n-1):
    plus += a[n-i-1]
    plus %= MOD
    ans += a[n-i-2]*plus
    ans %= MOD
print(ans%MOD)

Measured memory_bytes: 31404
#include <stdio.h>
int binSearch(int);
 
int S[100000];
int n;
int main(){
  int i;
  int T[50000],q,C=0;
  scanf("%d",&n);
  for(i = 0; i < n; i++){
    scanf("%d",&S[i]);
  }
  scanf("%d",&q);
  for(i = 0; i < q; i++){
    scanf("%d",&T[i]);
  }
 
  for(i = 0; i < q; i++){
    if(binSearch(T[i])) C++;
  }
  printf("%d\n",C);
  return 0;
}
 
int binSearch(int key){
  int left = 0;
  int right = n;
  int mid;
  while( left < right){
    mid = (left + right) / 2;
    if(S[mid] == key) return 1;
    else if(key < S[mid]) right = mid;
    else left = mid + 1;
  }
  return 0;
}

Measured memory_bytes: 1180
#include "bits/stdc++.h"
using namespace std;
const int N = 2e3 + 3;
int n , z , w;
int arr[N];
int ans;
int dp[N][2];
int solve(int pos , int who){
	if(dp[pos][who] != -1){
		return dp[pos][who];
	}
	int res = abs(arr[n] - arr[pos - 1]);
	for(int i = pos ; i < n ; ++i){
		if(who){
			res = min(res , solve(i + 1 , !who));
		}
		else{
			res = max(res , solve(i + 1 , who));
		}
	}
	return dp[pos][who] = res;
}
int main(){
	scanf("%d %d %d" , &n , &z , &w);
	for(int i = 1 ; i <= n ; ++i){
		scanf("%d" , arr + i);
	}
	ans = abs(arr[n] - w);
	memset(dp , -1 , sizeof(dp));
	for(int i = 1 ; i < n ; ++i){
		ans = max(ans , solve(i + 1 , 1));
	}
	printf("%d\n" , ans);
}

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

int main ()
{
    int A, B;
    std::cin >> A >> B;
    
    if (A <= 8 and B <= 8 and A+B <= 16)
    {
        std::cout << "Yay!" << std::endl;
    }
    
    else std::cout << ":(" << std::endl;

    return 0;
}

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

int main(){
	ll a,b,k;
	while(cin>>a>>b>>k){
		for(ll i=1;i<=k;i++){
			if(i%2==1){
				b+=(a/2);
				a/=2;
			}
			else{
				a+=(b/2);
				b/=2;
			}
		}
		cout<<a<<' '<<b<<endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int fx4[] = {1 , -1 , 0 , 0};
int fy4[] = {0 , 0 , 1 , -1};
int Kfx[]= {-2,-2,2,2,1,1,-1,-1}; ///knight move x - exis
int Kfy[]= {1,-1,1,-1,2,-2,2,-2}; ///knight move y- exis
int fx8[]= {1,1,1,0,0,-1,-1,-1};
int fy8[]= {0,1,-1,1,-1,0,1,-1};
#define ll long long int
#define pii pair<int,int>
#define llu unsigned long long
#define inf 1<<28
#define gama 0.57721566490
#define PI              acos(-1.0)
#define INF             0x7fffffff
#define MOD             1000000007
#define EPS             1e-7
#define all(r)(r).begin(),(r).end()
/*
bool status[mx];
void sieve(){
   long long int  i,j;
    for(i=2;i<=mx;i++)
    {
        status[i]=0;
    }
    for( i=2;i<=sqrt(mx);i++){
        if(status[i]==0)
        {
            for(j=i*i;j<=mx;j+=i){
                status[j]=1;
            }
        }
    }
}*/
ll BM( ll a , ll b , ll m )
{
    if ( b == 0 ) return 1 ;
    ll x = BM(a,b/2,m);
    x = (( x % m) * (x % m))%m;

    if( b % 2 ) x = (( x % m) * (a %m)) % m ;
    return x ;
}
#define dd double
#define sc scanf
#define pr printf
#define VI vector<int>
#define VS vector<string>
#define VC vector<char>
#define VLL vector<long long int>
#define FILE freopen("input.txt","rt",stdin); freopen("output.txt","w",stdout);
#define p_b push_back
#define mem(x,y) memset(x,y,sizeof(x))
#define F(i,a,b) for(i=a;i<=b;i++)
#define sc1(a) scanf("%d",&a)
#define scL1(a) scanf("%lld",&a)
#define scL2(a,b) scanf("%lld%lld",&a,&b)
#define sc2(a,b) scanf("%d%d",&a,&b)
#define sc3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define scL3(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define fori(N)          for(int i = 0; i<(N); i++)
#define forj(N)         for(int j = 0; j<(N); j++)
#define fork(N)         for(int k = 0; k<(N); k++)
#define forl(N)         for(int l = 0; l<(N); l++)
#define ford(N)         for(int d = 0; d<(N); d++)
#define fori1(N)          for(int i = 1; i<=(N); i++)
#define forj1(N)         for(int j = 1; j<=(N); j++)
#define fork1(N)         for(int k = 1; k<=(N); k++)
#define ford1(N)         for(int d = 1; d<=(N); d++)
#define sqr(x)           (x)*(x)
#define TEST int test,te=0;cin>>test;
#define segment_tree int l=(n*2),r=(n*2)+1,mid=(l+r)/2
#define Mx 100005
#define mx 10005

int main()
{
ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);///Beware of use it, if u use it dont use scanf or printf
    int n;
    cin>>n;
    int arr[n+1];
    int cn=1;
    int cnt=0;
    fori(n)cin>>arr[i];
    fori(n){
    	if(arr[i]==cn){
    		cn++;
		}
		else cnt++;
	}
	if(cnt==n)cout<<"-1"<<endl;
	else cout<<cnt<<endl;
}


Measured memory_bytes: 1024
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define ff first
#define ss second
#define mod 1000000007
#define pb push_back
#define mp make_pair
#define int long long
#define all(a) a.begin(), a.end()
#define inf (1LL<<61)
#define print_time cerr << "Time elapsed: " << 1000.0 * clock() / CLOCKS_PER_SEC << "ms\n";
#define ull unsigned long long
#define debug1(x) cerr << #x << ": " << x <<'\n'
#define debug2(x, y) cerr << #x << ": " << x << '\t' << #y << ": " << y <<'\n'
#define debug3(x, y, z) cerr << #x << ": " << x << '\t' << #y << ": " << y << '\t' << #z << ": " << z <<'\n'
using namespace std;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
int gcd(int x,int y)
{
    if(y==0)
        return x;
    else
        return gcd(y,x%y);
}
int expo(int n,int m,int p)   //modULAR EXPONENTIATION
{
    int r=1;
    n=n%p;
    while(m>0)
    {
        if(m%2)
            r=(r*n)%p;
        n=(n*n)%p;
        m=m/2;
    }
    return r%p;
}
bool isPrime(int n)
{
    // Corner cases
    if (n <= 1)  return false;
    if (n <= 3)  return true;
 
    // This is checked so that we can skip 
    // middle five numbers in below loop
    if (n%2 == 0 || n%3 == 0) return false;
 
    for (int i=5; i*i<=n; i=i+6)
        if (n%i == 0 || n%(i+2) == 0)
           return false;
 
    return true;
}
int32_t main()
{
   IOS;
   /*#ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin); 
   freopen("output.txt","w",stdout);
   #endif
   /********************* Code starts here ***********************/	
   int a,b,c,x,y;
   cin>>a>>b>>c>>x>>y;
   int ans=inf;
   for(int i=0;i<=200000;i+=2)
   {
   	int ta=i/2,tb=i/2;
   	int la=max(0LL,x-ta),lb=max(0LL,y-tb);
   	ans=min(ans,i*c+la*a+lb*b);
   }
   cout<<ans<<endl;
} 

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {
	 public static void main(String args[]){
		 Scanner std = new Scanner(System.in);
		 int a = std.nextInt();
		 int b = std.nextInt();
		 int t = std.nextInt();
		 int count = t / a;
		 System.out.println(count * b);
	 }
}


Measured memory_bytes: 23252
#include<bits/stdc++.h>
#define ll long long int
#define ff first
#define ss second
#define eps 1e-9

using namespace std;

int main()
{

    ll t,n,m,f,a,b,c,l,r,q,k,x,y,z,ans,mn,mx,sum=0;
    //ios_base::sync_with_stdio(false);
    //cin.tie(NULL);
    cin>>t>>k;
    ll arr[t];
    for(int i=0;i<t;i++)
        cin>>arr[i];

    sort(arr,arr+t);

    for(int i=0;i<k;i++)
        sum+=arr[i];

    cout<<sum<<endl;


}


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

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

    for(int i=0;i<5;i++){
        for(int t=4;t>i;t--){
            if(a[t] - a[i]>a[5]){
                cout<<":("<<endl;
                return 0;
            }
        }
    }
    cout<<"Yay!"<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using lint = long long;
template<typename T = lint>inline T in() { T x; cin >> x; return x; }
#define INF           1e9
#define INFL          static_cast<lint>(INF)
#define REP(i,n)      for(lint i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)     for(lint i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)     for(lint i=n-1;i>=0;--i)
#define REPR1(i,n)    for(lint i=n;i>0;--i)
#define REPI(i,ini,n) for(lint i=(ini),i##_len=(n);i<i##_len;++i)
#define REPC(i,obj)   for(auto i:obj)
#define R_UP(a,b)     (((a)+(b)-1)/(b))
#define ALL(obj)      (obj).begin(),(obj).end()
int main()
{
	int n = in();
	vector<int>a(n);
	REPC(&i, a)i = in();
	int index = -1;
	REPR(i, n - 1)
	{
		if (a[i] > a[i + 1])
		{
			index = i;
			break;
		}
	}
	if (index != -1)
	{
		REP(i, index)cout << a[i] << ' ';
		vector<int>a_copy(a.begin() + index, a.end());
		vector<int>::iterator itr;
		for (int i = 1;; ++i)if ((itr = find(ALL(a_copy), a[index] - i)) != a_copy.end())break;
		cout << *itr << ' ';
		a_copy.erase(itr);
		sort(ALL(a_copy), greater<int>());
		REP(i, a_copy.size())
		{
			if (i != 0)cout << ' ';
			cout << a_copy[i];
		}
		cout << endl;
	}
	REP(i, a.size())
	{
		if (i != 0)cout << ' ';
		cout << a[i];
	}
	cout << endl;
	index = -1;
	REPR(i, n - 1)
	{
		if (a[i] < a[i + 1])
		{
			index = i;
			break;
		}
	}
	if (index != -1)
	{
		REP(i, index)cout << a[i] << ' ';
		vector<int>a_copy(a.begin() + index, a.end());
		vector<int>::iterator itr;
		for (int i = 1;; ++i)if ((itr = find(ALL(a_copy), a[index] + i)) != a_copy.end())break;
		cout << *itr << ' ';
		a_copy.erase(itr);
		sort(ALL(a_copy));
		REP(i, a_copy.size())
		{
			if (i != 0)cout << ' ';
			cout << a_copy[i];
		}
		cout << endl;
	}
}


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

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

  map<string, int> mp;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    mp[s]++;
  }

  vector<string> v{"AC", "WA", "TLE", "RE"};
  for (auto s : v) {
    cout << s << " x " << mp[s] << endl;
  }
  return 0;
}


Measured memory_bytes: 3640
#include<iostream>
#include<vector>
using namespace std;
int main() {
	int a;
	vector<int> s;
	while (cin >> a) {
		if (a != 0) {
			s.push_back(a);
		}
		else if (a == 0) {
			cout << s[s.size() - 1] << endl;
			s.pop_back();
		}
	}
	return 0;
}

Measured memory_bytes: 3012
#include<iostream>

using namespace std;

int main(){

	int H, W;

	while(1){

		cin >> H >> W;

		if( H == 0 && W == 0)break;

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

			for( int j = 0; j < W; j++){

				if( i == 0 || i == H - 1 || j == 0 || j == W - 1){

					cout << "#";

				}else{

					cout << ".";

				}

			}

			cout << "\n";

		}

		cout << endl;

	}

	return 0;

}

Measured memory_bytes: 1152
/*
*          Name : chaitanya
*
*     Institute : ANITS,Visakhapatnam
*
*/
#include<cstdio>
#include<iostream>
#include<sstream>
#include<fstream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<complex>
#include<cstring>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<bitset>
#include<numeric>
#include<limits>
#include<climits>
#include<cfloat>
#include<functional>
#include<iterator>
#include <random>
#define infy  1000000000
#define all(x) begin(x),end(x)
#define ll long long int
#define ff first
#define ss second
#define pb push_back
const ll mod = 1000000007;
#pragma GCC optimization ("O3")
const int N = 1000010;
using namespace std;
vector<string> vec_splitter(string s) {
  s += ',';
  vector<string> res;
  while(!s.empty()) {
    res.push_back(s.substr(0, s.find(',')));
    s = s.substr(s.find(',') + 1);
  }
  return res;
}
void debug_out(
vector<string> __attribute__ ((unused)) args,
__attribute__ ((unused)) int idx, 
__attribute__ ((unused)) int LINE_NUM) { cerr << endl; } 
template <typename Head, typename... Tail>
void debug_out(vector<string> args, int idx, int LINE_NUM, Head H, Tail... T) {
  if(idx > 0) cerr << ", "; else cerr << "Line(" << LINE_NUM << ") ";
  stringstream ss; ss << H;
  cerr << args[idx] << " = " << ss.str();
  debug_out(args, idx + 1, LINE_NUM, T...);
}
#ifndef ONLINE_JUDGE
#define debug(...) debug_out(vec_splitter(#__VA_ARGS__), 0, __LINE__, __VA_ARGS__)
#else
#define debug(...) 42
#endif
ll lcm(ll a,ll b)
{
  return (a*b)/__gcd(a,b);
}
int main()
{
  int x = -1, y = 10000;
  double z = 0.2;
  string s = "beginner1010";
  long long b = 1LL << 60;
    
  // debug(x, y, z, s, b);
    
  double aux = 1010.0;
  string code = "code";
    
  // debug(code + "forces",-aux / 10 * 2.3);
  // freopen("input.txt","r",stdin);
  // freopen("output.txt","w",stdout);
  //ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  ll n,m;
  cin >> n >> m;
  vector <ll> v(n);
  for (int i = 0; i < n; ++i)
  {
    cin >> v[i];
    v[i] = v[i]/2;
  }
  ll l = v[0];
  for (int i = 1; i < n; ++i)
  {
    l = lcm(l,v[i]);
  }
  if (l > m)
  {
    cout << 0;
    return 0;
  }
  for (int i = 0; i < n; ++i)
  {
    if ((l/v[i]) %2 == 0)
    {
      cout << 0;
      return 0;
    }
  }
  cout << m/l - m/(l*2);
  return 0;
}


Measured memory_bytes: 1024
#
# 10b
#
import math


def main():
    a, b, C, = map(float, input().split())
    d = math.radians(C)
    h = math.sin(d) * b
    S = a * h / 2
    L = a + b + math.sqrt(a**2+b**2-2*a*b*math.cos(d))
    print(f"{S: .4f}")
    print(f"{L: .4f}")
    print(f"{h: .4f}")


if __name__ == '__main__':
    main()


Measured memory_bytes: 5716
#include <stdio.h>
int N,t,i,j,a[10][20];
int main(){
    char c[2]="",s[5]="SHCD";
    for(scanf("%d",&N);N--;){
        scanf("%s%d",c,&t);
        switch(c[0]){
            case'S':a[0][t-1]=1;break;
            case'H':a[1][t-1]=1;break;
            case'C':a[2][t-1]=1;break;
            case'D':a[3][t-1]=1;break;
        }
    }
    for(i=0;i<4;i++){
        for(j=0;j<13;j++){
            if(a[i][j]==0)
            printf("%c %d\n",s[i],j+1);
        }
    }
}

Measured memory_bytes: 1800
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <complex>
#include <valarray>
#include <fstream>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <random>

using namespace std;

string S, T;


int main() {

    cin >> S >> T;

    cout << T + S << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  vector<int> number(N);
  
  for(int i=0; i<N; i++){
    int A;
    cin >> A;
    number.at(i) = A;
  }
  
  int button=0;
  int push=0;
  
  for(int j=0; j<N; j++){
    if(number.at(button) == 2){
      push = push + j + 1;
      break;
    }
    button = number.at(button) - 1;
  }
  if(push == 0) push = -1;
  cout << push << endl;
}

Measured memory_bytes: 640
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <map>
#include <set>
#include <deque>
#include <cstring>
#include <functional>
#include <climits>
#include <list>
#include <ctime>
#include <complex>

#define F1(x,y,z) for(int x=(y);x<(z);x++)
#define F2(x,y,z) for(int x=(y);x<=(z);x++)
#define F3(x,y,z) for(int x=(y);x>(z);x--)
#define F4(x,y,z) for(int x=(y);x>=(z);x--)
#define mp make_pair
#define pb push_back
#define LL long long
#define co complex<double>
#define fi first
#define se second

#define MAX 100005
#define AMAX 53
#define MOD 1000000007

#define f(c,d) ((1<<(c))*(d))

using namespace std;

int n;
LL x[MAX],y[MAX],z[MAX],ans=1;

int main(){
	scanf("%d",&n);
	F2(a,1,n)scanf("%d",x+a);
	F2(a,1,n)scanf("%d",y+a);
	x[0]=y[n+1]=0;
	x[n+1]=y[0]=INT_MAX;
	F2(a,1,n){
		if(x[a]<x[a-1]){
			printf("0\n");
			return 0;
		}else if(x[a]>x[a-1])z[a]=x[a];
	}
	F4(a,n,1){
		if(y[a]<y[a+1]){
			printf("0\n");
			return 0;
		}else if(y[a]>y[a+1]){
			if(z[a]&&z[a]!=y[a]){
				printf("0\n");
				return 0;
			}
			z[a]=y[a];
		}
	}
	F2(a,1,n){
		if(z[a]){
			if(z[a]>min(x[a],y[a])){
				printf("0\n");
				return 0;
			}
		}else ans=ans*min(x[a],y[a])%MOD;
	}
	printf("%lld\n",ans);
	#ifdef LOCAL_PROJECT
	system("pause");
	#endif
	return 0;
}

Measured memory_bytes: 2560
use std::io::prelude::*;

fn input<T>() -> T
where
    T: std::str::FromStr,
{
    let stdin = std::io::stdin();
    let token = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    token.parse().ok().unwrap()
}

fn main() {
    let n = input::<usize>();
    let a = (0..n).map(|_| input()).collect::<Vec<i64>>();

    let mut v = a
        .iter()
        .enumerate()
        .map(|(i, &a)| a - (i as i64 + 1))
        .collect::<Vec<i64>>();
    v.sort();
    let b = v[n / 2];
    println!("{}", v.iter().map(|v| (v - b).abs()).sum::<i64>());
}


Measured memory_bytes: 8444
args = [input() for _ in range(2)]

N = int(args[0])
H = [int(l) for l in args[1].split()]

max_len = 0
val = H[0]
st = 0
for i in range(1, N):
  next_val = H[i]
  if val < next_val:
    max_len = max(max_len, i - st - 1)
    st = i
    if st + max_len >= N:
      break
  val = next_val

if (N != 1) and (i == N - 1):
  max_len = max(max_len, N - 1 - st)
  
print(max_len)

Measured memory_bytes: 15192
import java.util.*;
public class Main {
	

	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		
		int a = sc.nextInt();
		
		int p = sc.nextInt();
		
		int ans = (a * 3 + p) /2;
		
		System.out.println(ans);
		
		
	}
	

}

Measured memory_bytes: 21844
s=input()
S=list(s)
cc=0
for i in range(2,len(S)-1):
  if S[i]=='C':
    cc=cc+1
if cc>=1:
  S.remove('C')
S.remove(S[0])
count=[]
if s[0]=='A':
  count.append(1)
if cc==1:
  count.append(2)
if ''.join(S).islower():
  count.append(3)

if count==[1,2,3]:
  print('AC')
else:
  print('WA')

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

int main(){
  long long L,R;
  cin >> L >> R;
  long long ans = 2020;
  for(long long i = L; i < R; i++){
    for(long long j = i+1; j <=R; j++){
      ans =min(ans,(i*j)%2019);
      if((i*j)%2019 == 0){
        cout << 0 << endl;
        return 0;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
// Goods things are coming, just keep believing 
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
 
#define FOR(i, x, n) for(ll i = x; i < n; i++) 
#define pb push_back
#define pf push_front
#define ll long long
#define hii cout << "hii" << endl
#define okay cout << "okay" << endl
// #define hey cout << "hey" << endl
#define pii pair<int, int>
#define pll pair<ll, ll>
// #define mpp make_pair
#define endl '\n'
#define ff first 
#define int long long
#define ss second
#define vi vector<int>
#define all(s) s.begin(), s.end()
#define si size()
 #define ld long double
#define INF 1000000000;
 
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << v.first << ' ' << v.second; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; } 
 
 
 
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <class Arg1> void __f(const char* name, Arg1&& arg1) { cerr << name << " : " << arg1 << endl; }
    template <class Arg1, class... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args) {
        const char* sep = strchr(names + 1, ',');
        cerr.write(names, sep - names) << " : " << arg1 << "  ";
        __f(sep + 1, args...);
    }
#else
#define trace(...) 0
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS
#endif // ifndef ONLINE_JUDGE
 
typedef tree<
int,
null_type,
less<int>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;
 
 
 
const int N = 5e5 + 5;
const int LG = 20;
const int mod = 1e9 + 7;

int arr[N];
int dp[N];
int sub[N];
int n, c;
vector<int> v[N];

void solve()
{
	int n, m;
	cin >> n >> m;
	int k;
	cin >> k;

	int steps = 0;
	if(n < m)
	{
		while(k > 0)
		{
			k -= m;
			steps++;
		}
	}
	else
	{
		while(k > 0)
		{
			k -= n;
			steps++;
		}
	}
	cout << steps << endl;
}
 
int32_t main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

	int t = 1;
	// cin >> t;
	while(t--)
	{
		solve();
	}
}

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

using namespace std;

int main() {
    int n, k;   cin >> n >> k;
    vector<int> v;
    for (int i = 0; i < n; i++) {
        int l;  cin >> l;
        v.push_back(l);
    }

    sort(v.begin(), v.end(), greater<int>());

    int ret = 0;
    for (int i = 0; i < k; i++) ret += v[i];

    cout << ret << endl;

    return 0;
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def ccw(a, b, c):
    ax = b[0] - a[0]
    ay = b[1] - a[1]
    bx = c[0] - a[0]
    by = c[1] - a[1]
    t = ax*by - ay*bx;
    if t > 0:
        return 1
    if t < 0:
        return -1
    if ax*bx + ay*by < 0:
        return 2
    if ax*ax + ay*ay < bx*bx + by*by:
        return -2
    return 0

def convex_hull(ps):
    n = len(ps)
    k = 0
    ps.sort()
    ch = [[-1,-1] for _ in range(n*2)]
    for i in range(n):
        while k >= 2 and ccw(ch[k-2], ch[k-1], ps[i]) <= 0:
            k -= 1
        ch[k] = ps[i]
        k += 1
    t = k + 1
    for i in range(n-2,-1,-1):
        while k >= t and ccw(ch[k-2], ch[k-1], ps[i]) <= 0:
            k -= 1
        ch[k] = ps[i]
        k += 1
    ch = ch[:k-1]
    return ch

def main():
    rr = []

    while True:
        n = I()
        if n == 0:
            break
        a = [list(map(float, S().split(','))) for _ in range(n)]
        r = convex_hull(a)
        rr.append(n-len(r))

    return '\n'.join(map(str,rr))


print(main())



Measured memory_bytes: 9056