akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <cmath>
#include <set>
#include <stack>
#include <queue>
#include <numeric>
#include <deque>
#include <cstring>
#include <iterator>
#include <map>
#include <cstdlib>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <complex>
#include <bitset>
#include <chrono>
#include <random>
using namespace std;

#define pb push_back
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define eb emplace_back
#define el '\n'
typedef  long long  ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<pll> vpll;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef vector<bool> vb;


//const int mod=1000000007;
const int mod=998244353;



int main()
{   ios_base::sync_with_stdio(false);cin.tie(NULL);
    ll t,n,m,k,q,x,a,b,c,d,y,l,r;
    long double bb;
    cin >> a >> bb;
    bb*=a;
    cout << (ll)floor(bb) << el;
    return 0;
}


Measured memory_bytes: 3740
#include <stdio.h>
#define max(x,y) ((x)>(y)?(x):(y))
#define min(x,y) ((x)<(y)?(x):(y))
#define FOR(i,m,n) for(i=m;i<n;i++)

int main(void)
{
	int a,b;
	scanf("%d",&a);
	if(a==25){
		printf("Christmas");
	}
	if(a==24){
		printf("Christmas Eve");
	}
	if(a==23){
		printf("Christmas Eve Eve");
	}
	if(a==22){
		printf("Christmas Eve Eve Eve");
	}
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <string>
#include <cctype>
#include <map>
#include <queue>

using namespace std;

const int mod = 1000000007;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define ll long long

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

    if (n == 1)
    {
        cout << 1 << endl;
        return 0;
    }
    

    ll beforeNum = 1;
    ll ans = 3;
    for (ll i = 2; i < n; i++)
    {
        ll tmp = ans;
        ans += beforeNum;
        beforeNum = tmp;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
ll int INF=numeric_limits<ll int>::max();
int main()
{
	ll int a,b,c,d;
	cin >> a >> c;
	vector<ll int> v,res;
	for(ll int i=0;i<a;i++)
	{
		cin >> b;
		v.push_back(b);
	}
	res.assign(a,0);
	res[1]=abs(v[1]-v[0]);
	for(ll int i=2;i<a;i++)
	{
		ll int mi=INF;
		if(i<c)
		{
			for(ll int j=1;j<=i;j++)
			{
				mi=min(mi,res[i-j]+abs(v[i]-v[i-j]));
			}
		}
		if(i>=c)
		{
			for(ll int j=1;j<=c;j++)
			{
				mi=min(mi,res[i-j]+abs(v[i]-v[i-j]));
			}
		}
		res[i]=mi;
	}
	cout << res[a-1];
}

Measured memory_bytes: 1908
#include <bits/stdc++.h>
using namespace std;
#define elif else if
typedef long long ll;
typedef unsigned long long ull;
#define DEBUG(x) cout << (x) << endl
#define TGET(a, b) get<b>(a)

struct Apple
{
    int color;
    ll value;
    bool operator<(const Apple b) const
	{
		return this->value < b.value;
	}
    bool operator>(const Apple b) const
	{
		return this->value > b.value;
	}
};

priority_queue<Apple> pend;

int main()
{
    int x, y, a, b, c;
    scanf("%d %d %d %d %d", &x, &y, &a, &b, &c);
    Apple tmp;
    tmp.color = 1;
    for (int i = 0; i < a;i++)
    {
        scanf("%lld", &tmp.value);
        pend.push(tmp);
    }
    tmp.color = 2;
    for (int i = 0; i < b;i++)
    {
        scanf("%lld", &tmp.value);
        pend.push(tmp);
    }
    tmp.color = 0;
    for (int i = 0; i < c;i++)
    {
        scanf("%lld", &tmp.value);
        pend.push(tmp);
    }
    ll ans = 0;
    int colorlesscnt = 0;
    ll colorlessval = 0;
    while(x+y-colorlesscnt>0)
    {
        if(pend.top().color==1&&x>0)
        {
            ans += pend.top().value;
            x -= 1;
        }
        elif(pend.top().color==2&&y>0)
        {
            ans += pend.top().value;
            y -= 1;
        }
        if(pend.top().color==0)
        {
            colorlesscnt += 1;
            colorlessval += pend.top().value;
        }
        pend.pop();
    }
    printf("%lld\n", ans + colorlessval);
    return 0;
}

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

#define int long long

void solve() {
	int n;
	cin>>n;
	int sum=0;
	for(int i=1;i<=n;i++) {
		if(i%3!=0 && i%5!=0) sum+=i; 
	}
	cout<<sum<<"\n";
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t=1;
	//cin>>t;
	while(t--) {
		solve();
	}
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pair<int, int> > piii;
#define pb push_back
#define NeedForSpeed ios_base::sync_with_stdio(0), cin.tie(0)
#define PI acos(-1)
#define all(c) c.begin(), c.end()
#define SET(x, y) memset((x), y, sizeof(x))
const int MOD = 1e9 + 7;
const int INF = 1e9 + 5;
const ll INF64 = 1e18;

template <typename T>
string to_string(const vector<T> &v) {
  string ret = "<";
  for (auto it : v)
    ret += to_string(it) + ", ";
  ret.pop_back(); ret.pop_back();
  ret += ">";
  return ret;
}

string to_string(const string &s) {
  return '"' + s + '"';
}

string to_string(bool b) {
  return b ? "true" : "false";
}

template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

void debug_print() { cerr << endl; }

template <typename T, typename ...U>
void debug_print(T t, U... u) {
  cerr << " " << to_string(t);
  debug_print(u...);
}

#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_print(__VA_ARGS__)
const int N = 1e5 + 5;

string s, t;

int main() {
  cin >> s >> t;
  int ans = INF;
  for (int i = 0; i < s.size(); i++) {
    if (i + t.size() - 1 >= s.size())
      break;
    int cur = 0;
    for (int j = 0; j < t.size(); j++) {
      if (s[i + j] == t[j])
        continue;
      cur++;
    }
    ans = min(ans, cur);
  }
  cout << ans << '\n';
  //If you dont need Flush Stream, dont use endl
  return 0;
}


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

using namespace std;

#define debug(n) cerr << #n << ':' << n << endl;
#define dline    cerr << __LINE__ << endl;

using ll = long long;
template<class T, class U> using P = pair<T,U>;
template<class T> using Heap = priority_queue<T>;
template<class T> using heaP = priority_queue<T,vector<T>,greater<T>>;
template<class T,class U> using umap = unordered_map<T,U>;
template<class T> using uset = unordered_set<T>;

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

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

template<class T, size_t N, class U>
void Fill(T (&a)[N], const U&v){
    fill((U*)a,(U*)(a+N),v);
}

template<class T>
istream& operator >> (istream&is, vector<T>&v){
  for(auto&e:v)is >> e;
  return is;
}

int main(){
  int h,w,n;cin >> h >> w >> n;
  vector<int> v(h*w);
  {
    int idx = 0;
    for(int i = 0; i < n; ++i){
      int x; cin >> x;
      for(int j = 0; j < x; ++j){
	v[idx] = i+1;
	idx++;
      }      
    }
  }
  int a[100][100] = {};
  int idx = 0;
  for(int i = 0; i < w; ++i){
    if(i%2 == 0){
      for(int j = 0; j < h; ++j){
	a[j][i]  = v[idx];
	idx++;
      }
    } else {
      for(int j = h-1; j >= 0; --j){
	a[j][i] = v[idx];
	idx++;
      }
    }
  }
  for(int i = 0; i < h; ++i){
    for(int j = 0; j < w; ++j){
      if(j) cout << ' ';
      cout << a[i][j];
    }
    cout << endl;
  }
  return 0;
}


Measured memory_bytes: 384
open System
open System.Collections.Generic

module InputUtility =
    let InputTokens = new Queue<string>()

    let EnsureInput () =
        if InputTokens.Count = 0 then
            let input = Console.ReadLine ()
            let s = input.Split ([|' '|], StringSplitOptions.RemoveEmptyEntries)
            if s.Length > 0 then
                for x in s do InputTokens.Enqueue(x)
                true
            else false
        else true

    let rec ReadNext () =
        if EnsureInput () then InputTokens.Dequeue ()
        else ReadNext ()

    let ReadNextInt () = ReadNext () |> int

    let Read2Int () = ReadNextInt (), ReadNextInt ()

    let ReadListOf f n =
        let rec loop acc = function
            | 0 -> List.rev acc
            | c -> loop ((ReadNext () |> f) :: acc) (c-1)
        loop [] n

    let MultipleCaseWithId f =
        let caseNum = ReadNextInt ()
        let rec loop index =
            if index = caseNum then ()
            else
                f index
                loop (index + 1)
        loop 0

    let MultipleCase f = MultipleCaseWithId (fun _ -> f ())

open InputUtility

module AGC015 =
    let private ``A or...or B Problem`` () =
        let ub = 60
        let left x b = b - x + 1L
        let rec cal x y i =
            if i < 0 then 1L
            else
                let b = 1L <<< i
                let bx, by = x &&& b, y &&& b
                if bx = by then cal x y (i - 1)
                elif i = 0 then 2L
                else
                    let nb = 1L <<< (i - 1)
                    let c = b - 1L
                    let f z isLeft =
                        let e = z &&& c
                        let rec inner x =
                            let s = x &&& -x
                            if x > s then inner (x - s)
                            elif x = 0L then 1L
                            elif isLeft then c - e + 1L
                            else 2L * x
                        inner (e ^^^ c)
                    let fy () = f (~~~y) false
                    let nx, ny = x &&& nb, y &&& nb
                    if ny = nb then 2L * b - (x &&& c)
                    elif nx = 0L then
                        let rx = nb - (x &&& c)
                        let ry = fy () + rx |> min <| nb
                        rx + b + ry
                    else 2L * f x true + fy ()
        let g = ReadNext >> int64
        let a, b = g (), g ()
        cal a b ub |> printfn "%d"

    let Entry = ``A or...or B Problem``

AGC015.Entry ()

Measured memory_bytes: 14160
import java.util.*;
 
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int Num = sc.nextInt();
    int Dis = sc.nextInt();
    int[] Xa = new int[Num];
    int[] Ya = new int[Num];
    for(int i=0;i<Num;i++){
      Xa[i] = sc.nextInt();
      Ya[i] = sc.nextInt();
    }
    int R = 0;
    for(int k=0;k<Num;k++){
      if(Math.pow(Xa[k],2)+Math.pow(Ya[k],2)<=Math.pow(Dis,2))R++;
    }
    System.out.println(R);
  }
}

Measured memory_bytes: 62616
#include<iostream>
#include<cstdio>
using namespace std;
typedef long long int llint;

llint gdc(llint a, llint b){
  if(a%b == 0) return b;
  else return gdc(b, a%b);
}

int main (void){
  int N;
  llint T[100]={};
  int i=0;
  
  cin >> N;
  for(int j=0; j<N; j++)
    cin >> T[j];
  
  while(T[i]){
    if(T[i]!=0 && T[i+1]!=0)
      T[i+1] = T[i] / gdc(T[i],T[i+1]) * T[i+1];
    else break;
    i++;
  }
  cout << T[i] << endl;
  return 0;
}


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

int main() {
  char c;
  cin >> c;

  if (c == 'a' || c == 'e' || c == 'i' || c == 'o' || c == 'u') {
    cout << "vowel" << endl;
  } else {
    cout << "consonant" << endl;
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		int[] a = new int[n];
		for(int i=0;i<n;i++) {
			a[i] = in.nextInt();
		}
		int[] b = new int[n];
		if(n%2==0) {
			for(int i=0;i<n/2;i++) {
				b[i] = a[n-1-2*i];
			}
			for(int i=n/2;i<n;i++) {
				b[i] = a[(i-n/2)*2];
			}
		}else {
			for(int i=0;i<=n/2;i++) {
				b[i] = a[n-1-2*i];
			}
			for(int i=n/2+1;i<n;i++) {
				b[i] = a[(i-n/2)*2-1];
			}
		}
		
		for(int i=0;i<n;i++) {
			System.out.print(b[i]+" ");
		}
		in.close();

	}

}


Measured memory_bytes: 96504
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <algorithm>
#include <sstream>
#include <istream>

using namespace std;

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

int main(){
	int a, b, x, y;
	scanf("%d%d%d%d", &a, &b, &x, &y);
	printf("%lf %d\n", double(a) * double(b) / 2, x + x == a && y + y == b);

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <cmath>

using namespace std;
#define inf 101010
#define mp make_pair
typedef pair<int,int> pii;
typedef pair<pii,pii> pp;

int dy[4] = {-1, 0, 1, 0};
int dx[4] = { 0, 1, 0,-1};
int w, h;
int g[31][31];
int dp[31][31][4];
int c[4];

bool r(int y, int x) {
    if (y >= 0 && y < h && x >= 0 && x < w) return true;
    else return false;
}

int main(void){
    while (cin>>w>>h && w) {
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                cin >> g[i][j];
                for (int k = 0; k < 4; k++) dp[i][j][k] = inf;
            }
        }
        for (int i = 0; i < 4; i++) cin >> c[i];
        
        dp[0][0][1] = 0;
        priority_queue<pp, vector<pp>, greater<pp> > que;
        que.push(mp(mp(0,1), mp(0,0)));
        
        int ans;
        while (!que.empty()) {
            pp p = que.top(); que.pop();
            int ty = p.second.first, tx = p.second.second;
            int tc = p.first.first, td = p.first.second;
            if (tc > dp[ty][tx][td]) continue;
            if (ty == h-1 && tx == w-1) {
                ans = tc;
                break;
            }
            
            for (int i = 0; i < 4; i++) {
                int nd = (td+i)%4;
                int ny = ty + dy[nd], nx = tx + dx[nd];
                if (!r(ny,nx)) continue;
                
                int cost = c[i];
                if (g[ty][tx] == i) cost = 0;
                
                if (dp[ny][nx][nd] > dp[ty][tx][td]+cost) {
                    dp[ny][nx][nd] = dp[ty][tx][td]+cost;
                    que.push(mp(mp(dp[ny][nx][nd],nd), mp(ny,nx)));
                }
            }
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 3128
public class Main{
  public void run(java.io.InputStream in, java.io.PrintStream out){
    java.util.Scanner sc = new java.util.Scanner(in);
    int[] d = new int[6];
    int i, q, a, b;
    for(i = 0;i < 6;i++)d[i] = sc.nextInt();
    for(q = sc.nextInt();q-- > 0;out.println(solve(d, a, b))){
      a = sc.nextInt(); b = sc.nextInt();
    }

    sc.close();
  }
  private static int solve(int[] d, int a, int b){
    int i, j;
    for(i = 0;i < 6;i++){
      for(j = 0;j < 4;j++){
        if(d[0] == a && d[1] == b)return d[2];
        rroll(d);
      }
      if(d[0] == a && d[1] == b)return d[2];
      if(i % 2 == 0)nroll(d);
      else eroll(d);
    }
    return -1;
  }
  public static void main(String[] args){
    (new Main()).run(System.in, System.out);
  }
  private static void nroll(int[] dice){ //(1265)
    int tmp;
    tmp = dice[0]; dice[0] = dice[1]; dice[1] = dice[5];
    dice[5] = dice[4]; dice[4] = tmp;
    return;
  }
  private static void eroll(int[] dice){ //(1463)
    int tmp;
    tmp = dice[0]; dice[0] = dice[3]; dice[3] = dice[5];
    dice[5] = dice[2]; dice[2] = tmp;
    return;
  }
  private static void rroll(int[] dice){ //(2354)
    int tmp;
    tmp = dice[1]; dice[1] = dice[2]; dice[2] = dice[4];
    dice[4] = dice[3]; dice[3] = tmp;
    return;
  }
}

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

using namespace std;

#define int long long 
#define INF 1e9
#define LINF 1e18

typedef unsigned long long ull;
typedef pair<int, int> P;
typedef pair<int, P> Pi;
typedef pair<P, P> PP;

const int MOD = 1e9 + 7;
const int dy[] = { 0, 0, 1, -1 };
const int dx[] = { 1, -1, 0, 0 };

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

int N, M;
P p[100000];

int node[100000];
int par[100000];
int Rank[100000];

void init(int n) {
    for(int i = 0; i < n; ++i) {
        par[i] = i;
        Rank[i] = 0;
        node[i] = 1;
    }
}

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

void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if(x == y) return;

    if(Rank[x] < Rank[y]) par[x] = y;
    else {
        par[y] = x;
        if(Rank[x] == Rank[y]) ++Rank[x];
    }
}

bool same(int x, int y) {
    return find(x) == find(y);
}


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

    cin >> N >> M;
    for(int i = 0; i < M; ++i) {
        cin >> p[i].first >> p[i].second;
        --p[i].first; --p[i].second;
    }
    int res = 0;
    for(int i = 1; i < N; ++i) res += i;
    init(N);
    vector<int> ans;
    for(int i = M - 1; i >= 0; --i) {
        ans.push_back(res);
        if(same(p[i].first, p[i].second)) continue;
        int latte = node[find(p[i].first)], malta = node[find(p[i].second)];
        res -= latte * malta;
        unite(p[i].first, p[i].second);
        node[find(p[i].first)] = latte + malta;
    }
    reverse(ans.begin(), ans.end());
    for(int i = 0; i < ans.size(); ++i) cout << ans[i] << endl;
    return 0;
} 

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

using namespace std;

int aa[] = { 0, 1, 1, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8 };

long long n;
int ans;

void add(long long p) {
	int k = 0;
	while (n % p == 0)
		k++, n /= p;
	ans += aa[k];
}

int main() {
	cin >> n;
	for (long long p = 2; p <= n / p; p++)
		add(p);
	if (n > 1)
		add(n);
	cout << ans << '\n';
	return 0;
}


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

using namespace std;

int main(){

int n,m,c;
cin>>n>>m>>c;

int b[m];
int arr[n][m];

for(int i = 0;i<m;i++){
    cin>>b[i];
}
int sum = 0;
int cnt = 0;
for(int i = 0;i<n;i++){
     for(int j = 0;j<m;j++){
         cin>>arr[i][j];
     }
}
for(int i = 0;i<n;i++){
     for(int j = 0;j<m;j++){
         sum=sum+(arr[i][j]*b[j]);
     }
     if(sum+c>0){
        cnt++;
     }
     sum=0;
}
cout<<cnt<<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 fi first
#define se second
#define mp make_pair
#define pb push_back
 
typedef long long ll;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<ii, null_type, less<ii>, rb_tree_tag, tree_order_statistics_node_update> pbds;

ll a[222];
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	ll n,x; cin>>n>>x;
	for(int i=0;i<n;i++) cin>>a[i];
	sort(a,a+n);
	int ans=0;
	for(int i=0;i<n;i++)
	{
		if(x>=a[i])
		{
			x-=a[i]; 
			if(i+1<n) ans++;
		}
		else
		{
			x=-100;
		}
	}
	if(x==0) ans++;
	cout<<ans<<'\n';
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn = 10000;
int n,m,k;

int main(){
    //freopen("in.txt","r",stdin);
    scanf("%d %d",&n,&m);
    int x = max(n,m);
    int y = min(n,m);
    int ans = 0;
    if(x - 1 > y)ans = x + x-1;
    else ans = x + y;
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var k = int.Parse(Console.ReadLine());
            var ab = Console.ReadLine().Split(" ")
                .Select(i => int.Parse(i)).ToArray();
            var a = ab[0];
            var b = ab[1];
            for (var i = a; i <= b; i++)
            {
                if (i % k == 0)
                {
                    Console.WriteLine("OK");
                    return;
                }
            }
            Console.WriteLine("NG");
        }
    }
}

Measured memory_bytes: 28292
#include<bits/stdc++.h>
#define ll long long
#define all(a) a.begin(),a.end()
#define sz(a) a.size()
#define re return 
#define MP make_pair
#define pb push_back
#define pii pair<int,int>
#define se second
#define fi first
using namespace std;

signed main(){
	ios_base::sync_with_stdio(0);
	int x,a,b;
	cin>>x>>a>>b;
	cout<<(abs(x-a)<abs(x-b)?"A":"B");
	re 0;
}

Measured memory_bytes: 3544
n = int(input())
aa = list(map(int, input().split()))

mina = abs(aa[0])
nm = 0
for i in range(n):
    mina = min(mina, abs(aa[i]))
    if aa[i] < 0:
        nm += 1

if nm % 2 == 1 and mina > 0:
    print(sum(map(abs, aa)) - 2 * mina)
else:
    print(sum(map(abs, aa)))

Measured memory_bytes: 14412
n, a, b, c, d = map(int, input().split())
s = input()

judge = True
if "##" in s[a - 1:c] or "##" in s[b - 1:d]:
    judge = False

if judge and c > d:
    if not "..." in s[b - 2:d + 1]:
        judge = False

print("Yes") if judge else print('No')    

Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0; i < (ll)(n); i++)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1 << 30;
vector<int> to[100100];
vector<int> res(100100);

void bfs(int sv){
    vector<int> dist(100100,INF);
    dist[sv] = 0;
    queue<int> q;
    q.push(sv);

    while(!q.empty()){
        int v = q.front(); q.pop();
        for (auto tv : to[v]){
            if(dist[tv]!=INF) continue;
            dist[tv] = dist[v] + 1;
            q.push(tv);
            res[tv] = v;
        }
    }
}
int main(){
    int n,m;
    cin >> n >> m;
    rep(i,m){
        int a,b;
        cin >> a >> b;
        a--; b--;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    
    bfs(0);
    cout << "Yes" << endl;
    rep(i,n){
        if(!i) continue;
        cout << res[i]+1 << endl;
    }
    return 0;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>0;(i)--)
#define rrep(i,n,m) for(int (i)=(n);(i)<(m);(i)++)
#define rrepr(i,n,m) for(int (i)=(n);(i)>(m);(i)--)
#define SORT(s) sort((s).begin(),(s).end())
#define SORTR(s,t) sort((s).begin(),(s).end(),greater<t>())

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;

const int INF = 1000000000;
const ll LINF = 1000000000000000000ll;
const double PI = acos(-1.0);
const double EPS = 1e-10;

const ll MOD = 1000000007ll;
const int MAX=510000;

int N; vi A,B;
void input(){
    cin>>N;
    rep(i,N-1){
        int b; cin>>b; B.emplace_back(b);
    }
    B.emplace_back(INF);
    return;
}

void solve(){
    A.emplace_back(B[0]);
    rep(i,N-1){
        A.emplace_back(min(B[i],B[i+1]));
    }
    ll sum=0;
    rep(i,N) sum+=A[i];
    cout<<sum<<endl;
    return;
}

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

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

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

  ll x = N / 3;
  ll y = N / 5;
  ll z = N / 15;

  ll ans = 0;
  ans = N * (N + 1) / 2 - (3 * x * (x + 1) / 2) - (5 * y * (y + 1) / 2) + (15 * z * (z + 1) / 2);

  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3620
#define _GLIBCXX_DEBUG
#include<algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<iostream>
#include<vector>
#include<queue>
#include<deque>
#include<stack>
#include<set>
#include<map>
#include<string>
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i,s,n) for(int i=s;i< (int)n; i++)
#define ll long long 
#define all(v) v.begin(),v.end()
using namespace std;
int main(){
  int n; cin >>n;
  vector<ll> a(n);
  rep(i,n) cin >>a[i];
  map<ll,ll>  mp;
  rep(i,n) mp[a[i]]++;
  ll ans=0;
  for(auto x :mp){
    if(x.second%2==1) ans++;
  }
  cout <<ans<<endl;
}

Measured memory_bytes: 10368
package main

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

const (
	initialBufSize = 100000
	maxBufSize     = 1000000
)

var sc *bufio.Scanner

func initScanner(r io.Reader) *bufio.Scanner {
	buf := make([]byte, initialBufSize)

	sc := bufio.NewScanner(r)
	sc.Buffer(buf, maxBufSize)
	sc.Split(bufio.ScanWords) // bufio.ScanLines
	return sc
}

func main() {
	sc = initScanner(os.Stdin)
	fmt.Println(resolve(parseProblem()))
}

func parseProblem() int {
	r, g, b, n := scanInt(sc), scanInt(sc), scanInt(sc), scanInt(sc)
	var num int
	for i := 0; i <= n/r; i++ {
		for j := 0; j <= (n-r*i)/g; j++ {
			rest := n - r*i - g*j
			if rest%b == 0 {
				num++
			}
		}
	}
	return num
}

func resolve(n int) int {
	return n
}

// snip-scan-funcs
func scanInt(sc *bufio.Scanner) int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return int(i)
}
func scanString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}


Measured memory_bytes: 1780
fun main(args: Array<String>) {
	readLn()
	val a = readLn().map { it - '1' }
	if (a.min() == a.max()) return println(0)
	if (!a.contains(1)) return println(solve(a.map { it / 2 }) * 2)
	println(solve(a.map { it % 2 }))
}

private fun solve(a: List<Int>): Int {
	var two = 0
	var ans = 0
	val n = a.size - 1
	for (i in a.indices) {
		if (two == 0) ans = ans xor a[i]
		two += Integer.numberOfTrailingZeros(n - i) - Integer.numberOfTrailingZeros(i + 1)
	}
	return ans
}

private fun readLn() = readLine()!!
private fun readInt() = readLn().toInt()
private fun readStrings() = readLn().split(" ")
private fun readInts() = readStrings().map { it.toInt() }


Measured memory_bytes: 47924
import java.io.BufferedReader;
import java.io.InputStreamReader;

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

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();

        int n = scanner.nextInt();
        int[] array = new int[n];
        for(int i=0;i<n;i++) {
        	array[i] = scanner.nextInt();
        }

        int cnt = 0;
        for(int j=1;j<(n-1);j++) {
        	if(((array[j-1]<array[j])&&(array[j]<array[j+1]))||
        		((array[j-1]>array[j])&&(array[j]>array[j+1]))) {
        		cnt++;
        	}
        }
        System.out.println(cnt);
    }

    private static long gcd(long m, long n) {
        if(m < n) return gcd(n, m);
        if(n == 0) return m;
        return gcd(n, m % n);
    }

    private static long lcm(long m, long n) {
        return m * n / gcd(m, n);
    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        public String next() {
            try {
                if (i < s.length) return s[i++];
                String line = br.readLine();
                while (line.equals("")) {line = br.readLine();}
                s = line.split(reg, 0);
                i = 0;return s[i++];
            } catch (Exception e) {e.printStackTrace();}
            return null;
        }
        public int nextInt() {
            try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public double nextDouble() {
            try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public long nextLong()  {
            try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
    }
}

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

#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
using tp = tuple<ll, ll, ll>;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
//constexpr long long MOD = (ll)1e9 + 7;
constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

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

//グラフ関連
struct Edge {
    ll to, cap, rev;
    Edge(ll _to, ll _cap, ll _rev) {
        to = _to;
        cap = _cap;
        rev = _rev;
    }
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph &G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
    G[from].push_back(Edge(to, cap, (ll)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve() {
    ll n, x, m;
    cin >> n >> x >> m;

    vec<ll> used(m, -1);
    ll ret = 0;
    vec<ll> cycle;
    REP(i, 2 * m) {
        if(used[x] != -1) {
            ret = used[x];
            break;
        }

        used[x] = cycle.size();
        cycle.push_back(x);
        x *= x;
        x %= m;
    }

    ll k = cycle.size();
    vec<ll> sum(k + 1, 0);
    REP(i, k) {
        sum[i + 1] = sum[i] + cycle[i];
    }
    if(n <= k) {
        cout << sum[n] << en;
        return;
    }
    ll ans = sum[ret];
    n -= ret;
    ll d = k - ret;
    ans += n / d * (sum[k] - sum[ret]);
    ans += sum[ret + n % d] - sum[ret];
    cout << ans << en;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    /*
    ll t;
    cin >> t;
    while(t--)*/
    solve();

    return 0;
}


Measured memory_bytes: 4968
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD = 1000000007;

int main(){
    ll N; cin >> N;
    vector<ll> V(N); for(int i = 0; i < N; i++) cin >> V[i];
    ll ans = 0;
    for(int i = 0; i < N-1; i++){
        if(V[i] == V[i+1]){
            if(i+2 < N) V[i+1] = V[i+2]+1;
            else V[i+1]++;
            ans++;
        }
        
    }
    cout << ans << endl;
}

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

#define pb push_back
#define mp make_pair
#define f first
#define s second

using namespace std;

typedef vector<int> vi;
typedef pair<int, int> ii;
typedef long long ll;

void maxi(int &a, int b){
    a = max(a, b);
}

int main(){

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    string s, t;
    cin >> s >> t;

    int dp[s.length()+1][t.length()+1];

    for(int i=0; i <= s.length(); i++) dp[i][0] = 0;
    for(int i=0; i <= t.length(); i++) dp[0][i] = 0;

    for(int i=1; i <= s.length(); i++){
        for(int j=1; j <= t.length(); j++){

            if(s[i-1] == t[j-1]){
                dp[i][j] = dp[i-1][j-1] + 1;
            }else{
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            }

        } 
    }

    int m = s.length();
    int n = t.length();
    char lcs[dp[m][n]+1];
    int idx = dp[m][n];
    lcs[idx] = '\0';

    while(m > 0 && n > 0){

        if(s[m-1] == t[n-1]){
            lcs[idx-1] = s[m-1];
            m--;
            n--;
            idx--;
        }else if(dp[m-1][n] > dp[m][n-1]){
            m--;
        }else{
            n--;
        }

    }

    cout << lcs << endl;

    return 0;
}

Measured memory_bytes: 35456
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <unordered_map>
#include <unordered_set>

using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

#define vii vector<int>
#define vip vector<pair<int,int> >
#define pb push_back

int main(int argc,char* argv[])
{
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    //#ifndef ONLINE_JUDGE
    //   freopen("input.txt", "r", stdin);
    //#endif
/*     int tc;
 *     cin>>tc;
 *     while(tc--)
 *     {
 *
 *     }
 */

    int n;
    cin>>n;
    string s;
    vector<string> v;
    int mx=0;
    map<string,int> m;
    for(int i=0;i<n;++i)
    {
        cin>>s;
        ++m[s];
        mx=max(mx,m[s]);
    }
    for(auto it=m.begin();it!=m.end();++it)
    {
        if(it->second==mx)
        {
            v.push_back(it->first);
        }
    }
    int len=v.size();
    sort(v.begin(),v.end());
    for(int i=0;i<len;++i)
        cout<<v[i]<<"\n";

    return 0;
}


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

int main(void) {
    int a, b;
    cin >> a >> b;
    
    if(a < b) {
        cout << "a < b" << endl;
    } else if(a > b) {
        cout << "a > b" << endl;
    } else {
        cout << "a == b" << endl;
    }
}


Measured memory_bytes: 3084
#include <stdio.h>
#include <string.h>

int main(void) {
  
  char str[1000];
  int count = 0, max = 0;
  int i;
  
  scanf("%s", str);
  
  for(i = 0; i < strlen(str); i++) {
    if( (str[i] == 'A') || (str[i] == 'T') || (str[i] == 'G') || (str[i] == 'C') ) {
      count++;
    } else {
      if(max < count) {
        max = count;
      }
      count = 0;
    }
  }
  if(max < count) {
    max = count;
  }
  printf("%d", max);
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define N 100001
using namespace std;

int n, k, h[N], dp[N];

int main() {
	cin>>n>>k;
	for (int i=1; i<=n; i++) cin>>h[i];
	for (int i=2; i<=n; i++) {
		dp[i] = INT_MAX;
		for (int j=1; j<i && j<=k; j++) {
			dp[i] = min(dp[i], dp[i-j]+abs(h[i-j]-h[i]));
		}
	}
	cout<<dp[n]<<endl;
	return 0;
}

Measured memory_bytes: 1024
import java.util.*;

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

        boolean[] cardStatus = new boolean[N];
        Arrays.fill(cardStatus, true);

        for (int i = 0; i < M; i++) {
            int L = sc.nextInt();
            int R = sc.nextInt();
            for (int j = 0; j < L - 1; j++) {
                cardStatus[j] = false;
            }

            for (int k = R; k < cardStatus.length; k++) {
                cardStatus[k] = false;
            }
        }
        sc.close();

        int cnt = 0;
        for (int i = 0; i < cardStatus.length; i++) {
            if (cardStatus[i]) {
                cnt++;
            }
        }
        System.out.println(cnt);

    }
}


Measured memory_bytes: 64612
/*
* Author. Silviase(@silviasetitech)
* For AtCoder
*/

import java.util.*;
import java.lang.*;
import java.math.*;

class Main{
    public static void main(String[] args){
        abc122cGeTACsolve();
    }

    public static void abc122cGeTACsolve() {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int q = sc.nextInt();
        String s = sc.next();
        int[] l = new int[q];
        int[] r = new int[q];
        int[] ruiseki = new int[n];
        int ans = 0;
        for (int i = 0; i < q; i++) {
            l[i] = sc.nextInt();
            r[i] = sc.nextInt();
            l[i]--;
            r[i]--;
        }
        for (int i = 1; i < n; i++) {
            if (s.charAt(i-1) == 'A' && s.charAt(i) == 'C'){
                if(i == 0){
                    ruiseki[i] = 1;
                }else{
                    ruiseki[i] = ruiseki[i-1] + 1;
                }
            }else{
                ruiseki[i] = ruiseki[i-1];
            }
        }
        for (int i = 0; i < q; i++) {
            System.out.println(ruiseki[r[i]] - ruiseki[l[i]]);  
        }
    }
}





Measured memory_bytes: 82844
#include <stdio.h>
int main(){
  int n,d,x,a[100],i,sum=0;
  scanf("%d%d%d",&n,&d,&x);
  for(i=0;i<n;i++){
    scanf("%d",&a[i]);
    sum+=d/a[i]+(d%a[i]!=0);
  }
  printf("%d",sum+x);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
#pragma GCC optimize("Ofast")
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,tune=native")
 
using namespace __gnu_pbds;
using namespace std;
     
#define mp make_pair
#define sz(x) (int)((x).size())
#define all(x) (x).begin(),(x).end()
#define FO(x) {freopen(#x".in","r",stdin);freopen(#x".out","w",stdout);}
#define eb emplace_back
 
typedef pair< int, int > pii;
typedef pair< long long, long long > pll;
typedef long long ll;
typedef unsigned long long ull;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef vector< ll > vll;
typedef vector< vll > vvll;
typedef vector< pii > vpii;
typedef vector< vpii > vvpii;
typedef vector< pll > vpll;
typedef long double ld;
typedef vector< ld > vld;
 
const ll MOD2 = 1e9 + 7;
const int MOD = 1e9 + 7;
 
const ull infull = numeric_limits<unsigned long long>::max();
 
void fix(int &x, ll MOD) {
    x = (x % MOD);
    if(x < 0) x += MOD;
    return;
}
 
ll lgput(ll a, ll b, ll MOD) {
    ll ret = 1;
    a %= MOD;
    while(b) {
        if(b&1) ret = ret*a % MOD;
        a = a*a % MOD;
        b >>= 1;
    }
 
    return ret;
}
 
ll inv(ll a, ll MOD) {
    return lgput(a, MOD-2, MOD);
}
 
struct f {
    int a, b;
    f(int _a = 0, int _b = 0) : a(_a) ,b(_b) {}
    ll eval(int x) {
        return 1ll*x*a + b;
    }
};
 
int binarySearch(int x, vi &v) {
    int pos = 0;
    int l = 1, r = sz(v);
    while(l <= r) {
        int m = l + r >> 1;
        if(v[m] <= x) {
            pos = m;
            l = m + 1;
        } else {
            r = m - 1;
        }
    }
 
    return pos;
}

int getParity(int n, int k){
    int put = 0;
    for(int i = 2; i <= n; i += i) {
        put += n / i;
        put -= k / i;
        put -= (n-k) / i;
    }

    return (put == 0);
}
int getAnsParity(vector< int > v) {
    int ret = 0;
    for(int i = 0; i < v.size(); ++i) {
        if(v[i] == 1 && getParity(v.size()-1, i)) ret ^= 1;
    }

    return ret;
}

int main() { 
    #ifdef BLAT
        freopen("stdin", "r", stdin);
        freopen("stderr", "w", stderr);
    #endif
 
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cout.precision(12);
    srand(time(NULL));
        
    int n;
    string s;
    cin >> n >> s;

    vi v(n);
    for(int i = 0; i < n; ++i) {
        v[i] = s[i] - '1';
    }

    int t1 = getAnsParity(v);
    if(t1 == 1) {
        return puts("1"), 0;
    }

    if(count(all(v), 1)) {
        return puts("0"), 0;
    }

    for(auto &x : v) {
        x /= 2;
    }

    int t2 = getAnsParity(v);
    if(t2 == 1) {
        return puts("2"), 0;
    }

    puts("0"), 0;

    return 0;  
}

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

using namespace std;

#define REP(i,n)	for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPS(i,s,n)	for(int i=(s), i##_len=(n); i<i##_len; ++i)

#define ALL(obj)	(obj).begin(),(obj).end()

typedef unsigned int 			uint;
typedef unsigned long long int	ull;
typedef long long int 			ll;

typedef pair<int,int>			P;
typedef vector<int>				V;
typedef vector<V>				VV;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define MAX 		100050

const ll LINF = (ll)1e18+7;		//
const int INF = 1e9+7;			//2,147,483,647 (Max int)
const int MOD = 1e9+7;
// テンプレ終了
//====================================================================//




//
int main(){
	int N;cin >> N;
	V A(N+1),B(N);
	REP(i,N+1)cin>>A[i];
	REP(i,N)cin >> B[i];

	ll ans = 0;

	REP(i,N){
		if(A[i] < B[i]){
			ans += A[i];
			B[i] -= A[i];
			ans += (A[i+1] > B[i] ? B[i] : A[i+1]);
			A[i+1] -= (A[i+1] > B[i] ? B[i] : A[i+1]);
		}
		else{
			ans += B[i];
		}
	}
	cout << ans << endl;

	return 0;
}




Measured memory_bytes: 1024
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cfloat>
#include<climits>
#include<cmath>
#include<deque>
#include<functional>
#include<iomanip>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<string>
#include<unordered_map>
#include<unordered_set>
#include<utility>
#include<vector>
#include<complex>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)

using namespace std;

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




const ll INF = 1e9;


/******************************************************************************************/


int main() {

	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(10);

	

	int n, m;
	cin >> n >> m;
	cout << n * m << endl;


	return 0;
}



Measured memory_bytes: 3180
import sys

a = input()
S = [int(c) for c in a]

ans = 0

if S[0] == 0:
	nxt = 1
else:
	nxt = 0

for i, tar in enumerate(S):
	if tar == 0:
		nxt = 1
	else:
		nxt = 0

	if i!=len(S)-1 and S[i] == S[i+1]:
		S[i+1] = nxt
		ans += 1
	

print(ans)


Measured memory_bytes: 3956
#include<stdio.h>
#define MAX 100000
int Partition(int[],int,int);
int Partition(int A[],int p,int r){
  int x=A[r];
  int i=p-1,j,k;
  for(j=p;j<r;j++){
    if(A[j]<=x){
      i++;
      k=A[i];
      A[i]=A[j];
      A[j]=k;

    }
  }
  k=A[i+1];
  A[i+1]=A[r];
  A[r]=k;
  return i+1;
}
int main(){
  int A[MAX];
  int n,i,q;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  q=Partition(A,0,n-1);
    for(i=0;i<n;i++){
if(i)  printf(" ");
      if(i==q){
        printf("[");

      }
     printf("%d",A[i]);
     if(i==q){

       printf("]");
     }
    
}
printf("\n");
return 0;
}

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

int main(){
  ll N,M,X;cin >> N >> M >> X;
  vector<ll> C(N);
  vector<vector<ll>> A(N,vector<ll>(M));
  for(int i=0;i<N;i++){
    cin >> C[i];
    for(int j=0;j<M;j++){
      cin >> A[i][j];
    }
  }
  ll ans = 1000000000;
  bool possible = false;
  for(int bit=0;bit<(1<<N);bit++){
    vector<ll> P(M,0);
    ll cost = 0;
    for(int i=0;i<N;i++){
      if(bit&(1<<i)){
        cost += C[i];
        for(int j=0;j<M;j++){
          P[j] += A[i][j];
        }
      }
    }
    bool ok = true;
    for(int j=0;j<M;j++){
      if(P[j]<X){
        ok = false;
        break;
      }
    }
    if(ok){
      possible = true;
      ans = min(ans,cost);
    }
  }
  if(!possible){
    cout << -1 << endl;
  }else{
    cout << ans << endl;
  }
}

Measured memory_bytes: 3616
def abc064_c():
    _ = int(input())
    a = list(map(int, input().split()))
    color = [False] * 8
    higher = 0
    for v in a:
        if v >= 3200:
            higher += 1
        else:
            color[v // 400] = True
    if sum(color) == 0:
        print(1, higher)
    else:
        print(sum(color), sum(color) + higher)


abc064_c()

Measured memory_bytes: 3064
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

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

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

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

  vector<int> a(N);
  rep(i, N) {
    cin >> a[i];
  }

  std::sort(a.begin(), a.end());

  int before = -1;
  int w = 0;
  int h = 0;
  for(int i = 0; i < N; i++) {
    if (before == a[i]) {
      w = h;
      h = a[i];
      before = -1;
    } else {
      before = a[i];
    }
  }

  cout << (long long)w * h << endl;

  return 0;
}


Measured memory_bytes: 640
n, x = map(int, input().split())
a = list(map(int, input().split()))
a = sorted(a)

cnt = 0
for a_ in a:
    cnt += 1
    if a_ <= x:
        x -= a_
    elif a_ > x:
        x -= a_
        break
print(cnt if x == 0 else cnt - 1)

Measured memory_bytes: 3060
#include<stdio.h>
#include<algorithm>
using namespace std;
int main()
{   int n,s=0,i;
 	scanf("%d",&n);
	int a[2*n];
	for(i=0;i<n*2;i++)
	scanf("%d",&a[i]);
	  sort(a,a+n+n);
		for(i=0;i<n*2;i++)
		if(i%2==0)
		s+=a[i];
    printf("%d\n",s);
}

Measured memory_bytes: 760
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<(n);i++)
#define ALL(v) (v).begin(),(v).end()
#define int long long
using namespace std;
typedef vector<int>   vint;
typedef pair<int,int> pint;

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

signed main()
{
    int N; cin>>N;
    vint a(N);
    REP(i,N) cin>>a[i];

    int ans=a[0];
    REP(i,N){
        ans=gcd(ans,a[i]);
    }
    cout<<ans<<endl;

}


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

int main(){
    int w, h, n;
    cin >> w >> h >> n;
    int l = 0, b = 0;
    for(int i=0;i<n;++i){
        int x, y, a;
        cin >> x >> y >> a;
        switch (a) {
            case 1:
                l = max(l, x);
                break;
            case 2:
                w = min(w, x);
                break;
            case 3:
                b = max(b, y);
                break;
            case 4:
                h = min(h, y);
        }
    }

    cout << (w > l && h > b ? (w - l) * (h - b) : 0) << endl;

    return 0;
}


Measured memory_bytes: 256
using System;

namespace _3000
{
    class Program
    {
        static void Main(string[] args)
        {
            double[] d = new double[]
            {
                double.Parse(Console.ReadLine()),
                double.Parse(Console.ReadLine())
            };
            Array.Sort(d);
            Console.WriteLine(d[1] - d[0] < 180 ? (d[0] + d[1]) / 2 : d[0] + d[1] < 360 ? (d[0] + d[1]) / 2 + 180 : (d[0] + d[1]) / 2 - 180);
        }
    }
}

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

int main() {
  double N,T,A;
    cin>>N>>T>>A;
  double M=1000000;
  int Q=0;
  for(int i=0;i<N;i++){
 double H;
      cin >>H;
  double ret=T-H*0.006;
  double X=max(ret-A,A-ret);
    if(X<=M){
      M=X;
      Q=i+1;
    }
}
  cout<<Q<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
ll a[403];
ll dp[403][403];
ll sm[403];
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n; 
	cin>>n; 
	for(int i=1;i<=n;i++)cin>>a[i];
	for(int i=1;i<=n;i++)sm[i] = sm[i-1]+a[i];
	memset(dp,0x7f,sizeof dp);
	for(int i=1;i<=n;i++)dp[i][i] = 0;
	for(int l=n;l>=1;l--){
		for(int r=l+1;r<=n;r++){
			for(int k=l;k<=r;k++){
				dp[l][r] = min(dp[l][r],dp[l][k]+dp[k+1][r]+sm[r]-sm[l-1]);
			}
		}
	}
	cout<<dp[1][n]<<endl;
	return 0;
}


Measured memory_bytes: 1536
#include <vector>
#include <iostream>
#include <map>
#include <string>
#include <utility>
#include <algorithm>

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

#define pb push_back

const int INF = 100100100;
const int MOD = (int)1e9 + 7;

using ll = long long;

using namespace std;

int main(){
  int n;
  vector<int> a;

  int ans = 0;

  cin >> n;
  a.resize(n);
  REP( i, n){
    cin >> a[i];
  }
  REP( i, n){
    bool f = true;
    for( int j = 2; j*j <= a[i]; ++j){
      if( a[i]%j == 0){
        f = false;
      }
    }
    if( f ){
      ++ans;
    }
  }
  cout << ans << endl;
}

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

signed main()
{
    ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    
    //int t=1 ; cin>>t ; while(t--)
    {
        int n, g =0;
        cin >> n;
        for(int i=0;i<n;i++)
        {
            int x;
            cin >> x;
            g = __gcd(x, g);
        }

        cout << g << '\n';
        
    }
    
    cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
    return 0;
}



Measured memory_bytes: 256