akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include<iostream>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<queue>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
#define forn(i,a,b)for(int i=(a),_b=(b);i<=_b;i++)
#define fore(i,b,a)for(int i=(b),_a=(a);i>=_a;i--)
#define rep(i,n)for(int i=0,_n=n;i<n;i++)
#define ll long long
#define pii pair<int,int>
#define vi vector<int>
#define vpii vector<pii>
#define m_p make_pair
#define re return
#define pb push_back
#define si set<int>
#define ld long double
#define X first
#define Y second
#define st string
#define ull unsigned long long
#define mod 1000000007
#define INF 1000000007
#define x1 XZVJDFADSPFOE
#define y1 GASDIJSLDAEJF
#define x2 DFDAJKVOHKWIW
#define y2 PSFSAODSXVNMQ
#define LLINF 0x3f3f3f3f3f3f3f3fLL
using namespace std;
inline void read(int &x)
{
	short negative=1;
    x=0;
    char c=getchar();
    while(c<'0' || c>'9')
    {
		if(c=='-')
			negative=-1;
		c=getchar();
	}
    while(c>='0' && c<='9')
        x=(x<<3)+(x<<1)+(c^48),c=getchar();
    x*=negative;
}
ll quickpower(ll n,ll k){
	ll ans=1;
	while(k){
		if(k%2){
			ans*=n;
			ans%=mod;
		}
		n*=n;
		n%=mod;
		k/=2;
	}
	return ans;
}
string int_to_string(int n)
{
	string s="";
	while(n)
	{
		int now=n%10;
		s+=now+'0';
		n/=10;
	}
	reverse(s.begin(),s.end());
	return s;
}
int string_to_int(string s)
{
	int n=0;
	rep(i,s.size())
	{
		n*=10;
		n+=s[i]-'0';
	}
	return n;
}
int main()
{
	ios::sync_with_stdio(0);
	//think twice,code once
	int x[5];
	rep(i,5)cin>>x[i];
	rep(i,5)if(x[i]==0)cout<<i+1<<endl; 
	return 0;
}



Measured memory_bytes: 3608
#include<stdio.h>
int main(void){
	int N,K;
	char S[10];
	int i;
	
	scanf("%d %s %d",&N,S,&K);
	
	for(i=0;i<N;i++){
		if(S[i]!=S[K-1]){
			S[i]='*';
		}
	}
	printf("%s",S);
	

	return 0;
	
}









Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>

#define N 100000
#define Q 50000
int binarySearch(int);

int n,q,c=0;
int l,m,r;
int S[N];
int T[Q];

int main()
{
  int i,k;

  scanf("%d",&n);
  if(N<n) exit(1);

  for(i=0; i<n; i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&q);
  if(Q<q) exit(2);

  for(i=0; i<q; i++){
    scanf("%d",&T[i]);
  }

  for(i=0; i<q; i++){
    c += binarySearch(T[i]);
  }

  printf("%d\n",c);

  return 0;
}

int binarySearch(int key){

  int l = 0;
  int r = n;

  while(l<r){
    m = (l + r)/2;
    if(S[m]==key)
      return 1;
    else if(key < S[m])
      r = m;
    else 
      l = m + 1;
  }
  return 0;
}

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

using namespace std;
using ll = long long;

using Field = vector<vector<int>>;
using Graph = vector<vector<int>>;
using VI = vector<int>;
using VC = vector<char>;
using PI = pair<int, int>;

#define REP(i, n) for (int i = 0; i < (n); i++)
#define ALL(x) x.begin(), x.end()


int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int n; cin >> n;

    bool flag = false;

    do {
        if (n%10 == 7) {
            flag = true;
            break;
        }
    } while (n = n / 10);

    if (flag) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

Measured memory_bytes: 3636
# coding: utf-8
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))
ans = 0
for i in range(N):
    ans += B[A[i]-1]
    past = A[i]
    if i != 0 and A[i-1] + 1 == A[i]:
        ans += C[A[i]-2]
print(ans)

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

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
typedef long double ld;

const ll mod = (ll)1e9 + 7;
const ll mxN = 200200;



void solve(){
	ll n,ans=0;
	cin>>n;
	map<string,ll>cnt;
	for(int i=0;i<n;i++){
		string s;cin>>s;
		cnt[s]++;
		ans=max(ans,cnt[s]);
	}
	for(auto i:cnt)
		if(i.se==ans)
			cout<<i.fi<<"\n";
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.precision(20);
	cout << fixed;

	//ll t;cin>>t;while(t--)
	solve();

}


Measured memory_bytes: 23808
#include <iostream>

using namespace std;

int main()
{
    int A;
    int B;
    int C;

    cin >> A >> B;
    C = A + B;

    if((A % 3) == 0)
    {
        cout << "Possible";
    }
    else if((B % 3) == 0)
    {
        cout << "Possible";
    }
    else if((C % 3) == 0)
    {
        cout << "Possible";
    }
    else
    {
        cout << "Impossible";
    }

    return 0;
}

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

const LL MOD = 1000000007;
LL powmod(LL a, LL n){
    if(n == 0) return 1;
    if(n % 2) return (a*powmod(a,n-1)) % MOD;
    LL c = powmod(a, n/2);
    return (c*c) % MOD;
}
LL inv(LL a){
    return powmod(a, MOD-2);
}
LL fact[110000];
LL invfact[110000];

LL ncr(LL n, LL r){
    if(r < 0 || n < 0) return 0;
    if(n < r) return 0;
    LL a = fact[n];
    a = (a * invfact[r]) % MOD;
    a = (a * invfact[n-r]) % MOD;
    return a;
}
LL inv2;
void init(){
    fact[0] = 1;
    invfact[0] = 1;
    inv2 = inv(2);
    for(LL i = 1; i < 110000; i++){
        fact[i] = (i*fact[i-1]) % MOD;
        invfact[i] = inv(fact[i]);
    }
}

LL prob[3100][3100]; //prob i > j
LL temp1[3100][3100];
LL temp2[3100][3100];
int c, d;
int f(int a){
    if(a == c) return d;
    if(a == d) return c;
    return a;
}

int main(){
    init();
    int n, m;
    cin >> n >> m;
    int a[n];
    for(int i = 0; i < n; i++){
        cin >> a[i];
        a[i]--;
    }
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(a[i] > a[j]){
                prob[i][j] = 1;
            } else {
                prob[i][j] = 0;
            }
        }
    }

    for(int i = 0; i < m; i++){
        cin >> c >> d;
        c--; d--;
        vector<int> r, s;
        for(int j = 0; j < n; j++){
            r.push_back(j); s.push_back(c);
            r.push_back(j); s.push_back(d);
            r.push_back(c); s.push_back(j);
            r.push_back(d); s.push_back(j);
        }
        for(int j = 0; j < r.size(); j++){
            int u = r[j]; int v = s[j];
            temp1[u][v] = prob[u][v];
            temp2[u][v] = prob[f(u)][f(v)];
        }
        for(int j = 0; j < r.size(); j++){
            int u = r[j]; int v = s[j];
            prob[u][v] = (temp1[u][v] + temp2[u][v]) * inv2;
            prob[u][v] %= MOD;
        }
    }
    LL ans = 0;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < n; j++){
            if(i < j){
                ans += prob[i][j];
                ans %= MOD;
            }
        }
    }
    ans = ans * powmod(2, m);
    ans %= MOD;
    if(ans < 0) ans += MOD;
    cout << ans << endl;
}

Measured memory_bytes: 227448
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define Fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define MOD 1000000007

ll n,a[100005],i,c,ann;

int main()
{
    Fast;

    cin>>n;
    for(i=0;i<n;i++)
    	cin>>a[i];
   	for(i=1;i<n;i++)
   	{
   		if(a[i]<=a[i-1])
   		{
   			c++;
   			ann=max(ann,c);
   		}
   		else
   		{
   			c=0;
   		}
   	}
   	cout<<ann;
}

Measured memory_bytes: 1024
#include <algorithm>
#include <climits>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <vector>

using namespace std;
constexpr long long int INF = std::numeric_limits<long long int>::max();
#define int long long int

void solve() {
  int N, L;
  cin >> N >> L;

  int aji = 0;
  for (int i = 0; i < N; i++) {
    int x = L + i;
    aji += x;
  }

  int diff = INF;
  int ans = 0;
  for (int i = 0; i < N; i++) {
    int x = L + i;
    if (diff > abs(x)) {
      diff = abs(x);
      ans = aji - x;
    }
  }
  cout << ans << endl;
  // int x;
  // cout << endl;
}

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


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

int main(){
  int N, K;
  cin >> N >> K;
  map<int,bool> mp;
  for(int i=0; i<K; i++){
    if(2*i %K == 0){
     mp[i] = true;
    }
  }
  int64_t ans = 0;
  int x = N%K;
  for(int i=0; i<K; i++){
    if(mp.count(i)){
      if(i <= x && i != 0){
      ans += pow(N/K+1,3);
      }
      else{
       ans += pow(N/K,3);
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
using namespace std;
int main()
{
	int a=0;
	int b=0;
	int c=0;
	int ac=0;
	int pena=0;
	string s;
	cin>>a>>b;
	vector<int> v(a),w(a);
	for(int i=0;i<b;i++)
	{
		cin>>c>>s;
		c--;
		if(v[c]==1) continue;
		if(s=="AC")
		{
			v[c]=1;
		}
		else if(s=="WA")
		{
			w[c]+=1;
		}
	}
	for(int i=0;i<a;i++)
	{
		ac+=v[i];
		if(v[i]==1)	pena+=w[i];
	}
	printf("%d %d\n",ac,pena);
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#define INF 1000000000
using namespace std;
int n,mp[100010],dp[100010];
bool visited[100010];

int mk_mp(int ima){
  if(visited[ima]||mp[ima]==-INF) return -INF;
  visited[ima]=1;
  if(mp[ima]!=0) mp[ima]+=mk_mp(ima+mp[ima]);
  if(mp[ima]<-10000000) mp[ima]=-INF;
  visited[ima]=0;
  return mp[ima];
}

int main(){
  cin >> n;
  for(int i=0;i<n;i++)cin>>mp[i];
  for(int i=0;i<n;i++)mp[i]=mk_mp(i),dp[i]=-1;
  dp[0]=0;
  int cnt=0;
  while(dp[n-1]==-1){
    cnt++;
    for(int i=0;i<n;i++)
      for(int j=1;j<=6&&dp[i]==cnt-1;j++){
	int nx=i+j;
	while(nx>=0&&mp[nx]!=0)nx+=mp[nx];
	if(nx>=0&&dp[nx]==-1)dp[nx]=cnt;
      }
  }
  cout<<cnt<<endl;
  return 0;
}

Measured memory_bytes: 4640
package main

import (
	"fmt"
	"math"
)

func main() {
	var N, D int
	fmt.Scan(&N, &D)
	X := make([][]float64, N)
	for i := 0; i < N; i++ {
		X[i] = make([]float64, D)
		for j := 0; j < D; j++ {
			fmt.Scan(&X[i][j])
		}
	}
	var ans int
	for i := 0; i < N; i++ {
		for j := i + 1; j < N; j++ {
			var d float64
			for k := 0; k < D; k++ {
				d += (X[i][k] - X[j][k]) * (X[i][k] - X[j][k])
			}
			rd := math.Sqrt(d)
			// fmt.Printf("(%d,%d) -> %f\n", i, j, rd)
			if math.Floor(rd) == math.Ceil(rd) {
				ans++
			}
		}
	}
	fmt.Println(ans)
}


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

#define MAX 10000000
bool arr[MAX];

int main(){
  for(int i=0;i<MAX;i++){
    arr[i] = 1;
  }
  for(int i=2;i<sqrt(MAX);i++){
    if(arr[i]){
      for(int j=0;i*(j+2) < MAX;j++){
	arr[i*(j+2)] = 0;
      }
    }
  }
  while(1){
    int a;
    cin >> a;
    if(a == 0) break;
    for(int i=a;i>0;i--){
      if(arr[i] == 1){
	if(arr[i-2] == 1){
	  if(arr[i-6] == 1){
	    if(arr[i-8] == 1){
	      cout << i << endl;
	      break;
	    }
	  }
	}
      }
    }
  }
}
  

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

vector<int> a(3);

int main() {
    cin >> a.at(0) >> a.at(1) >> a.at(2);
    sort(a.begin(), a.end());
    cout << a.at(2) * 10 + a.at(0) + a.at(1) << endl;
    return 0;
}


Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<numeric>
#include<vector>
#include<set>
#include<map>
#include<unordered_map>
#include<stack>
#include<queue>
#include<list>
using namespace std;

typedef long long ll;

#define MOD 1000000007

class Comb{
private:
  ll *fac,*finv,*inv;
public:
  Comb(){
    fac = new ll[1000000];
    finv = new ll[1000000];
    inv = new ll[1000000];
    fac[0] = 1;
    for(int i=1;i<1000000;i++){
      fac[i] = i*fac[i-1];
      fac[i] %= MOD;
    }
    inv[1] = 1;
    for(int i=2;i<1000000;i++){
      inv[i] = MOD-inv[MOD%i]*(MOD/i)%MOD;
    }
    finv[0] = 1;
    for(int i=1;i<1000000;i++){
      finv[i] = inv[i]*finv[i-1];
      finv[i] %= MOD;
    }
  }
  ll calc(ll n,ll k){
    ll c = fac[n];
    c *= finv[k];c %= MOD;
    c *= finv[n-k];c %= MOD;
    return c;
  }
};

int main(){
  int n,k;
  cin >> n >> k;
  vector<int> a(n+1);
  for(int i=0;i<k;i++){
    int d;
    cin >> d;
    for(int j=0;j<d;j++){
      int x;
      cin >> x;
      a[x] = 1;
    }
  }
  int ans = n;
  for(int i=1;i<=n;i++) ans -= a[i];
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i, s, n) for (int i = (s); i < (n); ++i)
#define rrep(i, n, g) for (int i = (n)-1; i >= (g); --i)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define len(x) (int)(x).size()
#define dup(x, y) (((x) + (y)-1) / (y))
#define pb push_back
#define Field(T) vector<vector<T>>
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
  int a, b,c;
  cin >> a >> b >> c;
  cout << c/a*b << endl;
}

Measured memory_bytes: 3556
#include <iostream>
#include <iomanip>
#include <algorithm>
using namespace std;
#include <cstdio>
#include <tuple>
#include <string>
#include <vector> 
#include <set>
#include <string.h>
#include <map>
#include <cmath>
#include <deque>
using ll = long long;
using Graph = vector<vector<int>>;
#include <queue>
#include <stack>
#include <cmath>

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

    if(c - a - b <= 0LL) cout << "No" << endl;
    else if(4 * a * b < (c - a - b)*(c - a - b) ) cout << "Yes" << endl;
    else cout << "No" << endl;


    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<iterator>
#include<string>
#include<queue>
#include<set>
#include<stack>
#include<map>

using namespace std;

int main(){
    int N;
    long long x;
    long long A[100];
    cin>>N>>x;
    long long sum=0;
    for(int i=0;i<N;i++){
        cin>>A[i];
        sum+=A[i];
    }
    sort(A,A+N);
    int ans=0;
    for(int i=0;i<N;i++){
        if(i<N-1 && x>=A[i]){
            x-=A[i];
            ans++;
        }else if(i==N-1 && x==A[i]){
            ans++;
            x=0;
        }
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
#define ll long long int
#define li long int
#define ull unsigned long long int
#define pb(k) push_back(k)
#define rep(i,n) for(int i =0;i<n;i++)
#define repk(i,k,n) for(int i =k; i<n; i++)
#define rrep(i,n) for(int i = n-1;i>=0;i--)
#define rrepk(i,n,k) for(int i = n-1; i>=k; i--)
#define f first
#define s second
#define vi vector<int>
#define vvi vector<vector<int>>
#define tc int t;cin>>t;while(t--)
using namespace std;

void optimize()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

int main()
{
	optimize();
	unordered_map<string,int> mp;
  mp["MON"] = 6;
  mp["TUE"] = 5;
  mp["WED"] = 4;
  mp["THU"] = 3;
  mp["FRI"] = 2;
  mp["SAT"] = 1;
  mp["SUN"] = 7;
  string s;
  cin>>s;
  cout<<mp[s];
}

Measured memory_bytes: 256
n,d = map(int,input().split())
points = []
for _ in range(n):
  X = tuple(map(int,input().split()))
  points.append(X)
  
ans = 0

import math
def distance(x,y):
  dis = 0
  for i in range(d):
    dis += (x[i]-y[i])**2
  return math.sqrt(dis)

for i in range(n-1):
  for j in range(i+1,n):
    dis = distance(points[i],points[j])
    if dis == int(dis):
      ans += 1
print(ans)



Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int  main()
{
    int ara[5],i;
    for(i=0;i<5;i++){
        scanf("%d",&ara[i]);
    }
    for(i=0;i<5;i++){
        if(ara[i]==0)
        printf("%d\n",i+1);
    }
}


Measured memory_bytes: 3724
#include <bits/stdc++.h>
#define rep(a,n) for (ll a = 0; a < (n); ++a)
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<vector<ll> > Graph;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e9;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;
//const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}




// combination mod prime
// mintが必要
// https://www.youtube.com/watch?v=8uowVvQ_-Mo&feature=youtu.be&t=1619
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
};


int main(){
    mint ans = 1;
    int n,m;
    cin >> n >> m;
    if(abs(n-m)>1){
        cout << 0 << endl;
        return 0;
    }
    
    for(int i=n;i>=1;i--){
        ans *= i;
    }
    for(int i = m;i>=1;i--){
        ans *= i;
    }
    if(n==m)ans*=2;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text;
using System.Text.RegularExpressions;
using System.Diagnostics;
//var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
namespace AtCoderSolve
{
    class Solve
    {
        const int mod = 1000000007;
        static void Main(string[] args)
        {

            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);

            var p = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Console.WriteLine(Math.Max(Math.Max(p[0] + p[1], p[0] - p[1]), p[0] * p[1]));


            //Console.Out.Flush();
            
        }
    }



    public class Calculation
    {

    }

    public class Graph
    {

    }
}



Measured memory_bytes: 13396
#include<bits/stdc++.h>
#define PI acos(-1.0)
#define pb push_back
#define F first
#define S second
#define debug puts
#define setp cout << fixed << setprecision(15)
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long ll;
const int N=2e5+5;
const int MOD=998244373;
int a[N];
int main(void){
    FAST_IO;
    int n;
    cin >> n;
    int ans=1e9+9;
    for(int i=1;i<=n-1;i++){
        int j=n-i;
        string s1=to_string(i);
        string s2=to_string(j);
        int res=0;
        for(auto ch:s1) res+=ch-'0';
        for(auto ch:s2) res+=ch-'0';
        ans=min(ans,res);
    }
    cout << ans << endl;


    return 0;
}
/********

*********/


Measured memory_bytes: 892
#include <bits/stdc++.h> 
#define int long long
#define quickie ios_base::sync_with_stdio(false); cin.tie(NULL);
#define rep(i, a, b) for(int i=a; i<b; i++)
#define rep1(i, a, b) for(int i=a; i<=b; i++)
#define repp(i, a, b) for(int i=b-1; i>=a; i--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define db double
#define mi map<int, int>
#define mc map<char, int>
#define ms map<string, int>
#define vi vector<int>
#define qi queue<int>
#define MI(x) power(x, mod-2)
#define test int t; cin >> t;
#define mod 1000000007LL
//#define mod 998244353 
using namespace std;
int power(int x, int y) ;
int gcd(int a, int b) ;

signed main() {
    quickie
    int n ;
    cin >> n ;
    int a[n] ;
    int f = 0 ;
    rep(i, 0, n) {
        cin >> a[i] ;
        if(a[i]%2 == 0 && (a[i]%3 != 0 && a[i]%5 != 0)) f = 1;
    }
    if(f == 1) cout << "DENIED" << endl ;
    else cout << "APPROVED" << endl ;
}
 
int power(int x, int y) {
    int res = 1; x %= mod;
    while (y > 0) {
        if (y & 1)
            res = (res*x) % mod;
        y = y>>1;
        x = (x*x) % mod;
    }
    return res%mod;
}
 
int gcd(int a,int b){
    if(a==0) return b;
    return gcd(b%a,a);
}

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

const ll mod = 1000000007 ;

bool isInteger(double n)
{
	if(floor(n)==ceil(n))
		return true ;
	return false ;
}

using namespace std ;

int main()
{
	int n,d;
	cin>>n>>d;
	vector<int> v[2];
	for(int i=0 ; i<n ; i++)
	{
		int x,y ;
		cin>>x>>y;
		v[0].push_back(x);
		v[1].push_back(y);
	}
	int count = 0 ;
	for(int i=0 ; i<n ; i++)
	{
		if(sqrt((ll)((ll)v[0][i]*v[0][i]+(ll)v[1][i]*v[1][i]))<=d)
			count++ ;
	}
	cout<<count;
}


Measured memory_bytes: 5160
#include<iostream>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i < (int)(n); i++)

#include <algorithm>
using namespace std;
#include <cmath>
#include <string>
#define elif else if
typedef long long ll;
#define TENNINE 1000000005
#define TENFIVE 100005
int N;

int main(){
    int A,B,C;
    cin>>A>>B>>C;
    if(C>B)swap(C,B);
    if(B>A)swap(A,B);
    int sum = A-B;
    sum += A-C;
    if(sum %2 ==0)cout<<int(sum/2)<<endl;
    else cout<< int(sum/2)+2<<endl;

    return 0;
}

Measured memory_bytes: 256
import java.util.*;

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

        int n = sc.nextInt();
        List<Tuples> T = new ArrayList<>();
        for(int i = 0;i < n;i++){
            long v = sc.nextLong();
            long w = sc.nextLong();
            char t = sc.next().charAt(0);
            long s = sc.nextLong();
            String d = sc.next();
            T.add(new Tuples(v,w,t,s,d));
        }

        Collections.sort(T);
        Iterator<Tuples> it = T.iterator();
        while(it.hasNext()){
            Tuples t = it.next();
            t.print();
        }
    }

    static class Tuples implements Comparable<Tuples>{
        long v,w,s;
        char t;
        String d;

        Tuples(long v,long w,char t,long s,String d){
            this.v = v;
            this.w = w;
            this.t = t;
            this.s = s;
            this.d = d;
        }

        public void print(){
            System.out.println(v+" "+w+" "+t+" "+s+" "+d);
        }

        public int compareTo(Tuples T){
            if(v < T.v) return -1;
            else if(v == T.v){
                if(w < T.w) return -1;
                else if(w == T.w){
                    if(t < T.t) return -1;
                    else if(t == T.t){
                        if(s < T.s) return -1;
                        else if(s == T.s)   return d.compareTo(T.d);
                        else return 1;
                    }
                    else return 1;
                }
                else return 1;
            }
            else return 1;
        }
    }
}


Measured memory_bytes: 184652
#include <bits/stdc++.h>
using namespace std;
 
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
#define fill(a)  memset(a, 0, sizeof (a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
typedef long double ld;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

void pre(){


}
 
void solve(){
 
 
}

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin.exceptions(cin.failbit);
	pre();

    string s;cin>>s;
    int n=sz(s);
    string a=s.substr(0,(n-1)/2);
    string b=s.substr((n+3)/2-1,n-(n+3)/2+1);

    int fg=1;
    rep(i,sz(s)) if(s[i]!=s[sz(s)-i-1]) fg=0;
    rep(i,sz(a))if(a[i]!=a[sz(a)-i-1])fg=0;
    rep(i,sz(b))if(b[i]!=b[sz(b)-i-1])fg=0;

    if(fg)cout<<"Yes\n";
    else cout<<"No\n";

	return 0;
}
 



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct point{
	double x,y;
	point(){}
	point(double _x,double _y){
		x=_x;y=_y;
	}
	point operator +(const point &b) const{
		return point(x+b.x,y+b.y);
	}
	point operator -(const point &b) const{
		return point(x-b.x,y-b.y);
	}
	double operator ^(const point &b) const{
		return (x*b.x)+(y*b.y);
	}
	double operator *(const point &b) const{
		return x*b.y-y*b.x;
	}
	point operator *(const double &b) const{
		return point(x*b,y*b);
	}
};
double len(point p){
	return (p.x*p.x+p.y*p.y);
}
int main(){
	point res,p1,p2,p;
	cin>>p1.x>>p1.y>>p2.x>>p2.y;
	int q;
	cin>>q;
	while(q--){
		cin>>p.x>>p.y;
		res=(p2-p1)*(((p-p1)^(p2-p1))/len(p2-p1));
		res=res+p1;
		res=(res-p)*2+p;
		if(fabs(res.x)==0) res.x=0;
		if(fabs(res.y)==0) res.y=0;
		printf("%.8lf %.8lf\n",res.x,res.y);
	}
	return 0;
}


Measured memory_bytes: 3288
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
using ll = long long;

int main(){
        ll n,m,i,a,b,ans=0;
        cin >> n >> m;
        vector<pair<ll, ll>> s(n);
        for(i=0;i<n;++i){
                cin >> a >> b;
                s.at(i) = {a,b};
        }
        sort(s.begin(),s.end());
        for(i=0;i<n;++i){
                if(s.at(i).second<m){
                        m -= s.at(i).second;
                        ans += s.at(i).first*s.at(i).second;
                }else{
                        ans += s.at(i).first*m;
                        break;
                }
        }
        cout << ans << endl;
        return 0;
}

Measured memory_bytes: 4844
import math
a, b = map(int, input().split())

n = int(str(a) + str(b))
# found = False
# for i in range(1, 330):
#     if(n == i**2):
#         # print(i)
#         found = True

# if(found == True):
#     print("Yes")
# else:
#     print("No")

if(math.floor(math.sqrt(n)) ** 2 == n):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 62124
#include<bits/stdc++.h>
#define ll long long
#define dbg(x) cout<<#x<<": "<<x<<endl;
#define N 3000005
#define M 1000000007
#define pii pair<ll,ll>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);
using namespace std;
ll fact[N];
ll inv_fact[N];
ll bigmod(ll a,ll n,ll m)
{
    if(n==0)
        return 1LL;
    ll ans=bigmod(a,n/2,m);
    ans=(ans*ans)%m;
    if(n&1LL)
        ans=(ans*a)%m;
    return ans;
}
ll p[N];
ll C(int n,int r)
{
    return fact[n]*inv_fact[r]%M*inv_fact[n-r]%M;
}
main()
{
    fast;
    fact[0]=1;
    for(int i=1;i<N;i++)
        fact[i]=(fact[i-1]*i)%M;
    for(int i=0;i<N;i++)
    {
        inv_fact[i]=bigmod(fact[i],M-2,M);
    }
    int k,n;
    cin>>k;
    string s;
    cin>>s;
    n=s.size();
    ll ans=0;

    p[0]=1;
    for(int i=1;i<N;i++)
        p[i]=(p[i-1]*25)%M;
    for(int i=0;i<n;i++)
    {
        ll baki=n+k-i;

        ll way=p[baki];
        way=way*C(baki+i+1-1,baki)%M;
        ans+=way;
        ans%=M;
    }
    ans=bigmod(26,n+k,M)-ans;
    ans%=M;
    ans=(ans+M)%M;
    cout<<ans;

}


Measured memory_bytes: 74584
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>
#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 INF 2e9
#define IPSILON 1e-9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
  int N,L;
  cin >> N; cin >> L;
  vector<int> taste;
  vector<int> absTaste;
  REP(i,N) taste.push_back(L+i);
  REP(i,N) absTaste.push_back(abs(taste[i]));
  //  REP(i,N) cout << absTaste[i] << endl;                                                                                       
  auto minIt = min_element(absTaste.begin(),absTaste.end());
  size_t minIndex = distance(absTaste.begin(), minIt);
  //  cout << "eliminate " << minIndex << " " << taste[minIndex] << endl;                                                         
  int result = 0;
  REP(i,N){
    if(i == minIndex) continue;
    result += taste[i];
  }
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cinttypes>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;

int main() {
//  freopen("../Console/1.txt", "rb", stdin);
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  int A, B, C;
  cin >> A >> B >> C;

  if (B - A == C - B) {
    cout << "YES" << '\n';
  } else {
    cout << "NO" << '\n';
  }

  return 0;
}


Measured memory_bytes: 256
// B.

#include <iostream>
#include <sstream>
#include <algorithm>

using namespace std;

int main(int argc, char *argv[]) {
	int d;
	cin >> d;
	int a = d / 100, b = d % 100;
	bool yymm = b >= 1 && b <= 12;
	bool mmyy = a >= 1 && a <= 12;
	string ans = "NA";
	if (yymm && mmyy) {
		ans = "AMBIGUOUS";
	} else if (yymm) {
		ans = "YYMM";
	} else if (mmyy) {
		ans = "MMYY";
	}
	cout << ans << endl;
	return 0;
}


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

using namespace std;

void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

#define SPEED ios_base::sync_with_stdio(false);cin.tie(nullptr)
#define rep(i,n) for(int i=0; i<(int)(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using ll = long long;
using P = pair<ll, ll>;

//constexpr ll mod = 998244353;
constexpr ll mod = 1e9+7;
constexpr double PI = 3.14159265358979323846;
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

unordered_map<ll, ll> minvmap;
ll minv(ll a, ll m) {
  auto k = a; auto p = minvmap[a]; if (p != 0) return p;
  ll b = m, u = 1, v = 0;
  while (b) { ll t = a/b; swap(a -= t*b, b); swap(u -= t*v, v); }
  p = (u%m+m)%m; minvmap[k] = p; return p;
}
struct mint {
    ll x;
    mint():x(0){}
    mint(ll x):x((x%mod+mod)%mod){}
    mint& fix() { x = (x%mod+mod)%mod; return *this;}
    mint operator-() const { return mint(0) - *this;}
    mint& operator+=(const mint& a){ if((x+=a.x)>=mod) x-=mod; return *this;}
    mint& operator-=(const mint& a){ if((x+=mod-a.x)>=mod) x-=mod; return *this;}
    mint& operator*=(const mint& a){ (x*=a.x)%=mod; return *this;}
    mint& operator/=(const mint& a){ (x*=minv(a.x, mod))%=mod; return *this; }
    mint operator+(const mint& a)const{ return mint(*this) += a;}
    mint operator-(const mint& a)const{ return mint(*this) -= a;}
    mint operator*(const mint& a)const{ return mint(*this) *= a;}
    mint operator/(const mint& a)const{ return mint(*this) /= a;}
    bool operator<(const mint& a)const{ return x < a.x;}
    bool operator==(const mint& a)const{ return x == a.x;}
};
istream& operator>>(istream&i,mint&a){i>>a.x;return i;}
ostream& operator<<(ostream&o,const mint&a){o<<a.x;return o;}

mint dp[51][51][2555];

signed main() {
  SPEED;
  int n, K; cin >> n >> K;
  dp[0][0][0] = 1;
  for(int i=1; i<=n; i++) {
    for(int j=0; j<=i; j++) {
      for(int k=0; k<=K; k+=2) {
        mint now = 0;
        if (k-2*j>=0) now += dp[i-1][j+1][k-2*j]*(j+1)*(j+1);
        if (k-2*j>=0) now += dp[i-1][j][k-2*j]*(2*j+1);
        if (k-2*j>=0 && j-1>=0) now += dp[i-1][j-1][k-2*j];
        dp[i][j][k] = now;
      }
    }
  }
  cout << dp[n][0][K] << endl;
}

Measured memory_bytes: 52224
#include <iostream>
#include <string>
#include <cstdio>
#include <vector>
#define int long long
struct tree {int p,l,r;};
using namespace std;
vector<int> num;
int n,l;
tree a[200000];
void dfs(int a0,int h){
  int check=0;
  if(a[a0].l==-1) check++;
  if(a[a0].r==-1) check++;
  if(check==1) num.push_back(l-h);
  if(~a[a0].l) dfs(a[a0].l,h+1);
  if(~a[a0].r) dfs(a[a0].r,h+1);
}
signed main(){
  int r=0;
  for(int i=0;i<200000;i++) a[i].p=a[i].l=a[i].r=-1;
  cin>>n>>l;
  char c0;
  scanf("%c",&c0);
  int cnt=1;
  for(int i=0;i<n;i++){
    char c;
    int whe=0;
    for(;;){
      scanf("%c",&c);;
      if(c=='\n') break;
      if(c=='0'){
	if(a[whe].l==-1){
	  a[whe].l=cnt;
	  a[cnt].p=whe;
	  cnt++;
	}
	whe=a[whe].l;
      }
      else if(c=='1'){
	if(a[whe].r==-1){
	  a[whe].r=cnt;
	  a[cnt].p=whe;
	  cnt++;
	}
	whe=a[whe].r;	
      }
    }
  }
  dfs(0,0);
  /*  cout<<endl;
  for(int i=0;i<(int)num.size();i++) cout<<num[i]<<" ";
  cout<<endl;
  for(int i=0;i<10;i++) cout<<a[i].p<<" "<<a[i].l<<" "<<a[i].r<<endl;
  */
  if(num.empty()){
    cout<<"Bob"<<endl;
    return 0;
  }
  int b=1;
  for(;!(num[0]%(b*2));b*=2);
  r=b;
  // cout<<0<<":"<<b<<endl;
  for(int i=1;i<(int)num.size();i++){
    b=1;
    for(;!(num[i]%(b*2));b*=2);
    //  cout<<i<<":"<<b<<endl;
    r^=b;
  }
  // cout<<r<<endl;
  if(r) cout<<"Alice"<<endl;
  else cout<<"Bob"<<endl;
  return 0;

}

Measured memory_bytes: 10484
#include<iostream>
#include<cmath>
using namespace std;
int a[1000000];
double b[1000000];
 
int main(){
	int x,y,x1,x2;
	cin>>x>>y>>x1>>x2;
    int a,b;
    if(x>y)
    {
    	a=y;
	}
	else 
	{
		a=x;
	}
	if(x1>x2)
	{
		b=x2;
	}
	else
	{
		b=x1;
	}
	cout<<a+b;
}

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

#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intll int long long
const int INF = 1e9;
const int MOD = 1e9 + 7;

int main() {
  string s ; 
  cin >> s ;
  
  if(s == "ABC")
    cout << "ARC" ;
  else 
    cout << "ABC";
  
    
         
  

}


Measured memory_bytes: 3596
/* it was worth becoming a chemist */
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef double db;
typedef long double ld;
typedef unsigned int uni;
typedef unsigned long long unll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef pair<long long, int> pli;
typedef pair<int, long long> pil;
typedef vector<int> vi;
typedef vector<long long> vll;

#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)x.size()
#define NAME "puts"
#define F first
#define S second

const ll INF = 1e18;
const int inf = 1e9;
const int mod = 1e9 + 7;
const db EPS = (db) 1e-9;
const db pi = acos(-1.0);
const int MAXN = 1e5 + 5;


int n, W;
ll dp[105][MAXN];
pll p[MAXN];

int main() {	
    #ifndef ONLINE_JUDGE
	//~ freopen(NAME".in", "r", stdin);
    //~ freopen(NAME".out", "w", stdout);
    #endif
	
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout << setprecision(9) << fixed;
	
	cin >> n >> W;
	for (int i = 1; i <= n; i++) {
		ll w, v;
		cin >> w >> v;
		p[i] = mp(w, v);
	}
	for (int i = 1; i <= n; i++) {
		ll w = p[i].F, v = p[i].S;
		for (int j = 0; j <= W; j++) {
			dp[i][j] = max(dp[i - 1][j], dp[i][j]);
			if (j + w <= W) dp[i][j + w] = max(dp[i - 1][j + w], dp[i - 1][j] + v);
		}
	}
	
	ll res = 0;
	for (int i = 1; i <= n + 1; i++) {
		for (int j = 0; j <= W; j++) {
			//~ cout << dp[i][j] << ' ';
			res = max(res, dp[i][j]);
		}
		//~ cout << '\n';
	}
	cout << res;
	return 0;	
}


Measured memory_bytes: 80128
#include <bits/stdc++.h>
using namespace std;
int main(){

  long long a,b;
  cin>>a;
  cout<<a<<':';
  b=a;
  for(int i=2;i*i<=b;i++)
{
    while(a%i==0){
      cout<<' '<<i;
      a/=i;
    }
    if(a==1)break;
}
  if(a !=1 )
    cout<<' '<<a;
  cout<<endl;
}



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

int main() {
    long long N,M;
    cin >> N >> M;
    vector<long long> A(N), B(M), C(M);
    for (int i=0; i<N; i++){
        cin >> A[i];
    }
    for (int i=0; i<M; i++) {
        cin >> B[i] >> C[i];
    }
    
    vector<pair<long long, long long>> CB(M);
    //long long sum_B=0;
    for (int i=0; i<M; i++) {
        CB[i]=make_pair(C[i], B[i]);
        //sum_B+=B[i];
    }
    
    sort(CB.begin(), CB.end());
    reverse(CB.begin(), CB.end());
    
    vector<long long> D;
    for (int i=0; i<M && D.size()<=N; i++) {
        for (int j=0; j<CB[i].second && D.size()<=N; j++) {
            D.push_back(CB[i].first);
        }
    }
    
    long long sum_A=0;
    for (int i=0; i<N; i++) {
        sum_A+=A[i];
    }
    sort(A.begin(), A.end());
    
    for (int i=0; i<N; i++) {
        //cout << A[i] << ' ' << D[i] << endl;
        if (A[i]<D[i]) {
            sum_A+=D[i]-A[i];
            A[i]=D[i];
        }
        else{
            break;
        }
    }
    
    cout << sum_A << endl;
}


Measured memory_bytes: 5368
char s[102],t['9:'];short*p,z[102];main(i){for(i=26;i--;t[i%5*256+i/5+'11']=i+97)t['26']=46;for(t['36']=63,t['46']=33,t['56']=32;~scanf("%s",p=z);*p=!puts(*p?"NA":s))for(i=0;s[i++]=t[*p];*p++=0);}

Measured memory_bytes: 0
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <cstdio>
#include <ctime>
#include <assert.h>
#include <chrono>
#include <random>
#include <numeric>
#include <set>
#include <deque>
using namespace std;
typedef long long int ll;
typedef unsigned long long ull;

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
    return (ull)rng() % B;
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n,k; cin >> n >> k;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i];
    }
    for(int i=k;i<n;i++){
        if(a[i]>a[i-k]){
            printf("Yes\n");
        }
        else{
            printf("No\n");
        }
    }
}


Measured memory_bytes: 4028
#include<stdio.h>

int main(void){
  int a,b,c;
  scanf("%d %d %d",&a,&b,&c);
  if(a==b&&b!=c||a==c&&a!=b&&c!=b||b==c&&a!=b&&c!=a){
		printf("Yes");
  }
  else{
    printf("No");
  }
  return 0;
}


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

int dp[50][100][10];

int main(){
  int c,d,w,x;
  int e[50][50],f[50][50];

  while(cin >> c >> d >> w >> x, c||d||w||x){
    for(int i=0;i<c;i++)
      for(int j=0;j<d;j++)cin >> e[i][j];
    for(int i=0;i<c;i++)
      for(int j=0;j<d;j++)cin >> f[i][j];

    for(int i=0;i<=d;i++)
      for(int j=0;j<=w;j++)
	for(int k=0;k<=x;k++)dp[i][j][k] = -1;
    dp[0][0][0] = 0;

    for(int i=0;i<d;i++)
      for(int j=0;j<=w;j++)
	for(int k=0;k<=x;k++){
	  if(dp[i][j][k]<0)continue;
	  dp[i+1][j][k] = max(dp[i+1][j][k],dp[i][j][k]);
	  for(int a=0;a<c;a++){
	    if(!e[a][i])continue;
	    int st = j+f[a][i];
	    int val = dp[i][j][k]+e[a][i];
	    if(st>w)continue;
	    dp[i+1][st][k] = max(dp[i+1][st][k],val);
	    if(k<x){ 
	      for(int b=1;a+b<c;b++){
		if(!e[a+b][i])break;
		st += f[a+b][i];
		if(st>w)break;
		val += e[a+b][i];
		dp[i+1][st][k+1] = max(dp[i+1][st][k+1],val);
	      }
	    }
	  }
	}

    int ans = 0;
    for(int i=0;i<=w;i++)
      for(int j=0;j<=x;j++)ans = max(ans,dp[d][i][j]);

    cout << ans << endl;
  }
}
	  

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

#include<random>  

#define int long long  

#define pp pair<int,int>  

#define ss second  

#define ff first  

#define pb push_back  

#define mod 1000000007  

using namespace std;  

void fastio()  

{    

  

  #ifndef ONLINE_JUDGE                  

  freopen("INPUT.txt","r",stdin);              

  freopen("OUTPUT.txt","w",stdout);              

  #endif    

     ios_base :: sync_with_stdio(false);   

     cin.tie(NULL) ;                             

      cout.tie(NULL);                              

   } 

   

signed main()  {    

        fastio();         

         int t=1;           

          // cin>>t;                

           while(t--)                  

              {                        

                      int m,k,n;

                      cin>>m>>k>>n;

                      int a[n];

                      int ma[m+2]={};

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

                        cin>>a[i];

                        ma[a[i]]++;

                      }

                      for(int i=1;i<=m;i++){

                      	int p=k-(n-ma[i]);

                      	if(p<=0)

                      	cout<<"No\n";

                      	else

                      	cout<<"Yes\n";

                      }

               }  

                  

    }    

Measured memory_bytes: 5184
import std.stdio, std.string, std.algorithm, std.array, std.range, std.conv, std.typecons, std.math, std.container, std.format, std.numeric;

void main(string[] args) {
    long a;
    readf("%d\n", &a);
    writeln(a + a*a + a*a*a);
}


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

int gcd(int x, int y, int z){
  int a = __gcd(x, y);
  int b = __gcd(a, z);
  return b;
}

int main(){
  int n;
  cin >> n;
  long long sum = 0;
  for(int i = 1; i <= n; i++){
    for(int j = 1; j <= n; j++){
      for(int k = 1; k <= n; k++){
        sum += gcd(i, j, k);
      }
    }
  }
  cout << sum << endl;
}

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


using namespace std;
#define rep(i,n) for (int i = 0; i < (int)(n); ++i)
#define reps(i,n) for (int i = 1; i <= (int)(n); ++i)
#define repd(i,n) for (int i = (int)(n - 1); i >= 0; --i)
#define repds(i,n) for (int i = (int)(n); i > 0; --i)
#define loop(i,x,n) for (int i = (int)(x); i < (n); ++i)
#define loops(i,x,n) for (int i = (int)(x); i <= (n); ++i)
#define loopd(i,x,n) for (int i = (int)(x); i > (n); --i)
#define loopds(i,x,n) for (int i = (int)(x); i >= (n); --i)
#define itrep(i,s) for (auto i = begin(s); i != end(s); ++i)
#define itrepd(i,s) for (auto i = rbegin(s); i != rend(s); ++i)
#define all(f,x,...) [&](decltype(x)& whole) { return (f)(begin(whole), end(whole), ##__VA_ARGS__); }(x)
#define rall(f,x,...) [&](decltype(x)& whole) { return (f)(rbegin(whole), rend(whole), ##__VA_ARGS__); }(x)
using ll = long long;
using ld = long double;
constexpr ll inf = static_cast<ll>(1e17);
constexpr int iinf = static_cast<int>(1e9);
constexpr double dinf = 1e10;
constexpr ld ldinf = 1e17;
ll mod = static_cast<ll>(1e9 + 7);
std::ostream& endn(std::ostream& os) { return os.put(os.widen('\n')); }
template<class T> constexpr int sz(const T& a) { return (int)a.ne(); }
template<class T> constexpr T pow2(const T a) { return a * a; }
template<class T, class ... Args> constexpr T mins(T& a, Args... args) { return a = min<T>({ a, args... }); }
template<class T, class... Args> constexpr T maxs(T& a, Args... args) { return a = max<T>({ a,args... }); }
template<class A, int N, class T>
void fillArray(A(&array)[N], const T& val) { std::fill((T*)array, (T*)(array + N), val); }

int n;
vector<int> g[200005];
int d[200005];
void dfs(int p) {
    rep(i, g[p].size()) {
        auto v = g[p][i];

        if (d[v] == iinf) {
            d[v] = d[p] + 1;
            dfs(v);
        }
    }
}

void solve() {
    cin >> n;
    rep(i, n - 1) {
        int a, b;
        cin >> a >> b; --a; --b;
        g[a].push_back(b);
        g[b].push_back(a);
    }

    fillArray(d, iinf);
    d[0] = 0;
    dfs(0);

    int r = 0, l = -1;
    rep(i, n) {
        if (d[i] > l) {
            r = i;
            l = d[i];
        }
    }

    fillArray(d, iinf);
    d[r] = 0;
    dfs(r);

    l = -1;
    rep(i, n) maxs(l, d[i]);

    if (l % 3 != 1) cout << "First" << endn;
    else cout << "Second" << endn;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    solve();
    cout << flush;
    return 0;
}


Measured memory_bytes: 21376
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;


int main() {
    int n, sum = 0;
    cin >> n;
    for(int i = n; i > 0; i--){
        sum += i;
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <stdio.h>
#include <math.h>
using namespace std;


int main(int argc, char* argv[])
{
	long N, K;
	scanf("%ld %ld", &N, &K);

//	prlongf("%ld %ld\n", N, K);

	long mod = N%K;

//	prlongf("%d\n", mod);
	long K_mod = abs(mod - K);
	long y;
	if(mod < K_mod){
		y = mod;
	}else{
		y = K_mod;
	}

	printf("%ld\n", y);

	return 0;
}





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

int main(){
	int n;cin>>n;
	vector<int>arr(n);
	for(auto &x:arr)cin>>x;

	int fnum=arr[1];
	for(int i=2;i<n;i++){
		fnum=fnum^arr[i];
	}
	vector<int>ans(n);
	ans[0]=fnum;
	int xorzao=fnum^arr[0];
	
	for(int i=1;i<n;i++){
		ans[i]=xorzao^arr[i];
	}
	for(int x:ans)
		cout<<x<<' ';
	cout<<'\n';
	

	return 0;
}

Measured memory_bytes: 4800
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
vector<pair<int,int> >G[20];
int n;
int M;
int f(int u,int p,int c)
{
	if(G[u].size()==1&&p>=0)return -1;
	M=max(M,c);
	int ans=0;
	for(int i=0;i<G[u].size();i++)
	{
		if(G[u][i].first==p)continue;
		int x=f(G[u][i].first,u,c+G[u][i].second);
		if(x<0)continue;
		ans+=x;
		ans+=G[u][i].second*2;
	}
	return ans;
}
main()
{
	while(cin>>n,n)
	{
		for(int i=0;i<n;i++)G[i].clear();
		M=0;
		for(int i=1;i<n;i++)
		{
			int a,b,t;cin>>a>>b>>t;
			a--,b--;
			G[a].push_back(make_pair(b,t));
			G[b].push_back(make_pair(a,t));
		}
		cout<<f(0,-1,0)-M<<endl;
	}
}



Measured memory_bytes: 3084
#include<bits/stdc++.h>
#define MAXN 50
using namespace std;
typedef long long ll;
int n,flag;
int a[MAXN+1],b[MAXN+1];
int dp[MAXN];
long long ans;
bool solve(ll ans)
{
    for(int i=1;i<=n;i++)
    {
        if(a[i]==b[i])
        {
            continue;
        }
        flag=0;
        memset(dp,0,sizeof(dp));
        dp[a[i]]=1;
        for(int j=a[i];j>=0;j--)
        {
            if(((1ll<<j)&ans)>0)
            {
             //   printf(" a %d\n",j);
                for(int k=a[i];k>=0;k--)
                {
                    if(dp[k])
                    {
                        dp[k%(j+1)]=1;
                        if((k%(j+1))==b[i])
                        {
                            flag=1;
                        }
                    }
                }
            }
        }
        if(!flag)
        {
        //    printf("%d\n",i);
            return 0;
        }
    }
    return 1;
}
int main()
{
    scanf("%d",&n);
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&a[i]);
    }
    for(int i=1;i<=n;i++)
    {
        scanf("%d",&b[i]);
    }
    //第一位留空 第二位填MAXN=1
    //且假设50一定不用
    ans=(1ll<<MAXN)-1;
    if(!solve(ans))
    {
        printf("-1");
        return 0;
    }
    for(int i=MAXN-1;i>=0;i--)
    {
        //printf("%lld\n",ans);
        ans^=1ll<<i;
        if(!solve(ans))
        {
            ans^=1ll<<i;
        }
    }
    printf("%lld\n",ans<<1);
}


Measured memory_bytes: 256