akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;
const int N = 100005;
char a[N];
int main()
{
    while(scanf("%s",a)!=EOF){
        int len=strlen(a);
        char b[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
        for(int i=0;i<len;i++){
            for(int j=0;j<26;j++){
                if(a[i]==b[j]){
                    b[j]='0';
                }
            }
        }
        int flag=1;
        for(int j=0;j<26;j++){
            if(b[j]!='0'){
                flag=0;
                cout<<b[j]<<endl;
                break;
            }
        }
        if(flag) cout<<"None"<<endl;
    }
    return 0;
}


Measured memory_bytes: 384
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>

//#include<bits/stdc++.h>

using namespace std;


int main() {

	int p, a, b;
	cin >> p >> a >> b;
	if (abs(p - a) >= abs(p - b))cout << "B" << endl;
	else cout << "A" << endl;
	return 0;
	
}


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

int main(){
	long long H,N,d[100000];
	cin >> H >> N;
	for(int i = 0;i < N;i++){
     cin >> d[i];
     H-= d[i];
	}

	if(H <= 0){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" <<endl;
	}
}


Measured memory_bytes: 1024
N, K = map(int,input().split())
ball = input().split()
d = {}

if K >= len(set(ball)):
  print("0")
  exit()

for i in ball:
  if not i in d:
    d[i] = 1
  else:
    d[i] += 1

d_val = sorted(d.values(),reverse=True)
print(N - sum(d_val[:K]))

Measured memory_bytes: 40220
//love yjl forever
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define fi first
#define se second
const int INF=0x3f3f3f3f,N=1e6+5;
int n;
int si[N],a[N];
ll dp[N];
vector<int> v[N];
int fa[N];
int b[N];
void dfs(int x)
{
	ll maxi=0;
	int tot=0;
	for(int i=0;i<v[x].size();i++)
	{
		int u=v[x][i];
		if(u==fa[x]) continue;
		dfs(u);
		si[x]+=si[u];
		dp[x]+=dp[u];
//		a[++tot]=si[u];
	}
	for(int i=0;i<v[x].size();i++)
	{
		int u=v[x][i];
		b[++tot]=si[u];
	}
	if(tot)
	{
		sort(b+1,b+tot+1);
		for(int i=1;i<=tot;i++)
		{
			dp[x]+=b[i]*(tot-i);
		}		
	}

	si[x]+=a[x];
}
int main()
{
/*	freopen("","r",stdin);
	freopen("","w",stdout);*/
	int i;
	cin>>n;
	for(i=1;i<=n;i++)
	{
		scanf("%lld%d",&a[i],&fa[i]);
		fa[i]++;
		if(fa[i]!=0)
		{
			v[fa[i]].pb(i);
		}
	}
	ll ans=0;
	for(i=1;i<=n;i++)
	{
		if(fa[i]==0)
		{
			dfs(i);
			ans+=dp[i];
		}		
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 139780
#include<bits/stdc++.h>
#define mod 1000000007
#define int long long int
#define phi 1.6180339
#define rep(i,n) for(auto i=0;i<(n);i++)
#define endl "\n"
#define For(i,a,b) for(auto i=(a);i<(b);i++)
#define op1 cin.tie(NULL)
#define op2 cout.tie(NULL)
#define op3 std::ios_base::sync_with_stdio(false)
#define MAXX 1000001
using namespace std;
void trozen()
{
  string s,t;
  cin>>s>>t;
  int ans=INT_MAX;
  int curr_ans=INT_MIN;
  rep(i,s.length())
  {
    curr_ans=0;
    bool flag=false;
    for(int j=0;j<t.length()&&(i+t.length()-1)<s.length();j++) {flag=true;if(t[j]!=s[i+j]) curr_ans++;}
    if(flag) ans=min(ans,curr_ans);
  }
  cout<<ans<<endl;
}
int32_t main()
{
    op1;op2;op3;
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/
    trozen();
    return 0;
}


Measured memory_bytes: 3652
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	mod = 10^9+7
	n = readline() |> parseInt
	t = readline() |> split |> parseMap
	a = readline() |> split |> parseMap
	x = -ones(Int,n)
	c = ones(Int,n)
	m = 0
	for i in 1:n
		if t[i]!=m
			x[i] = t[i]
			m = t[i]
		else
			c[i] = m
		end
	end
	m = 0
	f = 0
	for i in n:-1:1
		if a[i] != m
			if a[i]!=x[i]&&c[i]==1
				f = 1
			else
				m = a[i]
				c[i] = 1
			end
		elseif c[i]==1&&a[i]<x[i]
			f = 1
		else
			c[i] = min(c[i],m)
		end
	end
	s = 1
	for i in 1:n
		if x[i]==-1
			s = s*c[i]%mod
		end
	end
	println(f==0?s:0)
end

main()



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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

constexpr int INF = 1e9;
constexpr ll INFLL = 1e18;
constexpr int MOD = 1e9 + 7;
const ld PI = acosl(-1);

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) n.begin(),n.end()

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    //cout << fixed << setprecision(6);
    int n, k;
    cin >> n >> k;

    cout << n - k + 1 << endl;
    return 0;
}

Measured memory_bytes: 3612
#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <iomanip>
#include <cmath>
#include <string>
#include <string.h>
#include <sstream>
#include <cctype>
#include <climits>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <vector>
#include <iterator>
#include <algorithm>
#include <stack>
#define _clr(x,y) memset(x,y,sizeof(x))
#define _inf(x) memset(x,0x3f,sizeof(x))
#define pb push_back
#define mp make_pair
using namespace std;
const int INF = 0x3f3f3f3f;
const double eps = 1e-8;
typedef long long LL;
int main()
{
	//ios_base::sync_with_stdio(false);cin.tie(0);
	#ifndef ONLINE_JUDGE
		//freopen("in.txt","r",stdin);
		//freopen("out.txt","w",stdout);
	#endif
	
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<max(a*b,c*d)<<endl;
	
    return 0;
}


Measured memory_bytes: 256
# coding-utf8 #

n, a, b = map(int, input().split())

sum = 0
result = 0

for i in range(n):
  str_n = str(i + 1)
  for char in str_n:
    sum += int(char)
  if a <= sum <= b:
    result += (i + 1)
  sum = 0

print(result)

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

int main(int argc, char const *argv[])
{
	int n; cin >> n;
	vector<int> p(n); rep(i, n) cin >> p[i];
	int cnt = 0;
	rep(i, n) if (i + 1 != p[i]) cnt++;
	printf("%s\n", (cnt <= 2 ? "YES" : "NO"));
	return 0;
}


Measured memory_bytes: 256
x, k, d= [int(i) for i in input().split()]
l = abs(x) // d
if k > l:
    k -= l
    if x >= 0:
        x -= d*l
    else:
        x += d*l
    k = k % 2
    if k:
        if x >= 0:
            x -= d
        else:
            x += d
else:
    if x >= 0:
        x -= d*k
    else:
        x += d*k
print(abs(x))

Measured memory_bytes: 61800
#include<stdio.h>
 int N,K,i;
 int j=0;
 int hoge[100000];
 
 main(void)
{scanf("%d",&N);
 scanf("%d",&K);
 for(i=1;i<=N;i++){
 scanf("%d",&hoge[i-1]);
 
  if(K<=hoge[i-1]){
		j++;
	}
 }
 
printf("%d",j);
}	
 


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define yesno(flg) if(flg){cout<<"YES"<<endl;}else{cout<<"NO"<<endl;}
#define MAX_N 1002
#define i197 1000000007

using namespace std;

typedef long long ll;
typedef pair<ll,ll> P1;
typedef pair<int,int> Pi;
typedef pair<double,Pi> Pdi;
typedef pair<ll,int>Pli;
typedef pair<P1,ll> P2;
const ll INF=1000000000000000001;
struct edge{int to,cost;};
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
struct Road{double cost;int a,b;};

int main() {

	int a,b,c;

	cin>>a>>b>>c;

	cout<<min(c,b/a)<<endl;
	return 0;
}


Measured memory_bytes: 256
//https://atcoder.jp/contests/abc120/tasks/abc120_a
//
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main()
{
    int A, B, C;
    cin >> A >> B >> C;
    cout << ( A*C > B ? B/A : C ) << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
a.sort()
i = len(a) - 1
fl = True
sumal = 0
while(i >= 0):
    if fl:
        sumal += a[i]
        fl = False
    else:
        sumal -= a[i]
        fl = True
    i -= 1
print(sumal)

Measured memory_bytes: 3064
/*
    Created by 10_months
    Tag:
    Link:
*/

#include <iostream>
#include <iomanip>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
                
using namespace std;

const long long inf = 1e17;
const int INF = 1e9;
const int N = 1234567;
const int M = 123456;

int a, b;
                         
int main() {
    #ifdef home
        freopen("in", "r", stdin);
        freopen("out", "w", stdout);
    #endif
    while (cin >> a >> b) {
        if (a == 1) a = a * 10 + 4;
        if (b == 1) b = b * 10 + 4;
        if (a > b) puts("Alice");
        else if (a == b) puts("Draw");
        else puts("Bob"); 
    }
    return 0;
}

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

typedef struct{
    int wt;
    long long int val;
}ITEM;



int main(){
    long long int n,tot;
    cin >> n >> tot;
    ITEM items[n];
    for (int i=0 ; i<n ; i++){
        cin >> items[i].wt >> items[i].val;
    }
    long long int dp[n][tot+1];


    for (int i=0 ; i<n ; i++){
        for (int j=0 ; j<=tot ; j++){
            dp[i][j] = 0;
            if (i==0){
                if (items[0].wt <= j){
                    dp[0][j] = items[0].val;
                }
                else{
                    dp[0][j] = 0;
                }
            }
            else{
                if (items[i].wt <= j){
                    dp[i][j] = max(dp[i-1][j-items[i].wt]+items[i].val,dp[i-1][j]);
                }
                else{
                    dp[i][j] = dp[i-1][j];
                }
            }
            //cout << dp[i][j] << " ";
        }
        //cout << "\n";
    }
    cout << dp[n-1][tot] << "\n";
    return 0;
}

Measured memory_bytes: 78336
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
    ll n;
    cin>>n;
    ll k;cin>>k;
    ll a[n];
    rep(i,n)cin>>a[i];
    ll ans=0;
    ll ret=0;
    for(int i=40;i>=0;--i){
        ll mask=1LL<<i;
        ll cnt=0;
        rep(j,n){
            if(a[j]&mask)++cnt;
        }
        if(cnt>=n-cnt){
            ans+=mask*cnt;
        }
        else {
            if(mask+ret<=k){
                ans+=(n-cnt)*mask;
                ret+=mask;
            }
            else ans+=mask*cnt;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
  
int main(){
  string s[3];
  cin >> s[0] >> s[1] >> s[2];
  char a, b, c;
  a = s[0][0] - 'a' + 'A';
  b = s[1][0] - 'a' + 'A';
  c = s[2][0] - 'a' + 'A';  
  cout << a << b << c << endl;
  return 0;
}

Measured memory_bytes: 256
import math

n, d = map(int, input().split(" "))
x = [list(map(int, input().split(" "))) for i in range(n)]

ans = 0
for i in range(n-1):
    for j in range(i+1, n):
        s = 0
        for k in range(d):
            s += (x[i][k] - x[j][k]) ** 2
        if math.sqrt(s).is_integer():
            ans += 1
print(ans) 

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

int main() {
  int N, M;
  cin >> N >> M;
  vector<vector<int>> V(9, vector<int>(9));
  for (int i = 0, a, b; i < M && cin >> a >> b; i++) V.at(a).at(b)++, V.at(b).at(a)++;
  vector<int> P(N);
  for (int i = 0; i < N; i++) P.at(i) = i + 1;
  int ans = 0;
  do {
    for (int i = 0; i + 1 < N; i++) if (!V.at(P.at(i)). at(P.at(i + 1))) goto NG;
    ans++;
    NG:;
  } while (next_permutation(P.begin(), P.end()) && P.at(0) == 1);

  cout << ans << endl;  
}

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

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            int a = input[0];
            int b = input[1];

            bool flag = false;
            int tmp = b / a;
            if (tmp * a == b)
            {
                flag = true;
            }

            if (flag)
            {
                Console.WriteLine(b + a);
            }
            else
            {
                Console.WriteLine(b - a);
            }
        }
    }
}

Measured memory_bytes: 13396
//For higher stack size use g++ -O2 -std=c++11 -Wall -Wl,--stack=268435456 a.cpp -o a.exe in cmd
    #include <bits/stdc++.h>
    #include <cstdio>
    #include <cstring>
    #include <cmath>
    #include <cstring>
    #include <chrono>
    #include <complex>
    #define ll long long
    #define ld long double
    #define vi vector<int>
    #define vll vector<ll>
    #define vvi vector < vi >
    #define pii pair<int,int>
    #define pll pair<long long, long long>
    #define mod 1000000007
    #define inf 1000000000000000001;
    #define all(c) c.begin(),c.end()
    #define mp(x,y) make_pair(x,y)
    #define mem(a,val) memset(a,val,sizeof(a))
    #define eb emplace_back
    #define pb push_back
    #define f first
    #define s second
    
    using namespace std;

    ll der[500001],fact[500001],inv[500001],kfix[500001];

    ll power(ll a, ll b)    //a is base, b is exponent
    {
        if(b==0)
            return 1;
        if(b==1)
            return a;
        if(b%2 == 1)
            return (power(a,b-1)*a)%mod;
        ll q = power(a,b/2);
        return (q*q)%mod;
    }

    void init()
    {
        der[0] = 1; 
        der[1] = 0; 
        der[2] = 1;
        for(ll i=3;i<=500000;++i)
        {
            der[i] = ((i - 1) * (der[i - 1] +  der[i - 2]))%mod; 
        }
        fact[0]=1,inv[0]=1;
        for(int i=1;i<=500000;++i)
        {
            fact[i]=(fact[i-1]*i)%mod;
            inv[i]=power(fact[i],mod-2);
        }
    }

    ll ncr(int n,int r)
    {
        if(n<r)
            return 0;
        return ((fact[n]*inv[r])%mod*inv[n-r])%mod;
    }

    ll npr(int n,int r)
    {
        return (fact[n]*inv[n-r])%mod;
    }



    int main()
    {
        std::ios::sync_with_stdio(false);
        int T;
        T=1;
        init();
        // cin.ignore(); must be there when using getline(cin, s)
        while(T--)
        {
            ll n,m,i,ans=0,ans2=0,flag=-1;
            cin>>n>>m;
            ans=npr(m,n);
            for(i=1;i<=n;++i,flag=flag*-1)
            {
                ans=(ans+(ncr(n,i)*npr(m-i,n-i))%mod*flag+mod)%mod;
            }
            ans=(ans*npr(m,n))%mod;
            cout<<ans<<endl;
        }
        return 0;
    }


Measured memory_bytes: 15372
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
ll ans = 0;
string s;
void dfs(ll k, ll sum, ll now){
    if(k == s.size()){
        ans += sum + now;
        return;
    }
    int d = s[k] - '0';
    dfs(k + 1, sum + now, d);
    dfs(k + 1, sum, now * 10 + d);
}

int main(){
    cin >> s;
    dfs(1, 0, s[0] - '0');
    cout << ans << endl;
}


Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>
#define int long long
#define main signed main()
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define forever while (true)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
template<typename A> using V = std::vector<A>;
template<typename A> using F = std::function<A>;
template<typename A, typename B> using P = std::pair<A, B>;
using pii = P<int, int>;
using vi = V<int>;
using vd = V<double>;
using vs = V<std::string>;
using vpii = V<pii>;
using vvi = V<vi>;
using vvpii = V<vpii>;
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = acos(-1);
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
template<typename T> std::istream &operator>>(std::istream &is, std::vector<T> &v) { for (T &x : v) is >> x; return is; }
using namespace std;
// clang-format on

main {
  double r;
  cin >> r;
  cout << prec(32) << PI * r * r << ' ' << 2.0 * PI * r << endl;
}

Measured memory_bytes: 3280
import java.util.Scanner;

public class Main {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args) {
        int N = sc.nextInt();
        int M = sc.nextInt();
        int[] L = new int[M];
        int sum = 0;
        for(int i = 0; i < M; i++){
          L[i] = sc.nextInt();
          sum += L[i];
        }
        if(sum > N){
          System.out.println("-1");
        }
        else{
          System.out.println(N - sum);
        }
      }
}


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

using namespace std;

const double PI = 3.141592653589;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define int long long
#define all(c) (c).begin(),(c).end()
#define M 1000000007
#define INF LLONG_MAX
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ", "; dbs(str.substr(idx + 1), s...);}
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}
// Use pr(a,b,c,d,e) or cerr<<anything or prc(v.begin(),v.end()) or prc(v,v+n)
//  


int32_t main()
{
    fastio;
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    int n, k;
    cin >> n >> k;
    if(n >= 10) cout << k << "\n";
    else cout << k+ 100*(10-n) << "\n";

    return 0;
}



Measured memory_bytes: 256
import sys
import re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from copy import copy
import numpy as np
from numpy.fft import fft, ifft
from fractions import gcd


def input(): return sys.stdin.readline().strip()


def INT(): return int(input())


def MAP(): return map(int, input().split())


def LIST(): return list(map(int, input().split()))


sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

n = INT()

sp = [[x for x in input().split()] for _ in range(n)]

for x in sp:
    x[1]=int(x[1])

lis=sp.copy()
sp.sort(key=lambda x:(x[0],-x[1]))

#print(sp)
#print(lis)

for x in sp:
    print(lis.index(x)+1)

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

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

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

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

#define DEBUG(x) cout<<#x<<": "<<(x)<<endl

int main(){
	int r;
	cin>>r;
	cout<<(r*r)<<endl;
	return 0;
}

Measured memory_bytes: 256
<?php
    list($A, $B) = explode(" ", trim(fgets(STDIN)));
    if($A == $B){
        echo "Draw";
    }elseif($A == 1){
        echo "Alice";
    }elseif($B == 1){
        echo "Bob";
    }elseif($A < $B){
        echo "Bob";
    }else{
        echo "Alice";
    }
?>

Measured memory_bytes: 4604
import numpy as np

n,s = map(int, input().split())
a = list(map(int, input().split()))

MOD = 998244353

dp = np.zeros(s+1,dtype=int) #動的計画法を用いる
dp[0] = 1

for i in range(n):
    ddp = dp * 2 % MOD
    ddp[a[i]:] += dp[:-a[i]] #非常に大きな数になると考えられるため先にMOD計算を行う
    dp = ddp % MOD


print(dp[s])

Measured memory_bytes: 27524
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <valarray>
#include <vector>
using namespace std;

using ll = long long;
using ld = long double;
const int INF = 1e9;
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;

int main()
{
  long long N;
  scanf("%lld", &N);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++)
  {
    scanf("%lld", &A[i]);
  }
  vector<vector<ll>> dp(N + 1, vector<ll>(2, 0));
  dp[0][1] = -1e15;
  for (int i = 0; i < N; ++i)
  {
    dp[i + 1][0] = max(dp[i][0] + A[i], dp[i][1] - A[i]);
    dp[i + 1][1] = max(dp[i][0] - A[i], dp[i][1] + A[i]);
  }
  cout << dp[N][0] << endl;

  return 0;
}


Measured memory_bytes: 6528
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long A,B;
  long long C,D;
  cin >> A >> B >> C >> D;
  long long count = 0;
  int N = 1;
  int c = C;
  int d = D;
    
  for (int i = 2; i <= 31623; i++) { 
    for (int j = 0; i < 15; j++) { 
      if (c % i == 0 && d % i == 0){
        N *= i;
        c /= i;
        d /= i;
      }
      else {
        break;
      }
    }
  }
  
  if (C == D && N == 1){
    N = C;
  }
  long long M = C*D/N;
  count = B/M - (A-1)/M;

  cout << B - A + 1 - ((B/C - (A-1)/C) + (B/D - (A-1)/D) - count) << endl;
}



Measured memory_bytes: 3540
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
#include <sstream>
#include <map>
#include <set>

#define REP(i,k,n) for(int i=k;i<n;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 1<<30
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

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

	vector<int> c(m), d(m);
	rep(i, m) cin >> c[i] >> d[i];

	int cnt[1005];
	memset(cnt, 0, sizeof(cnt));

	rep(i, m) {
		REP(j, c[i], d[i]) {
			cnt[j]++;
		}
	}

	int ans = 3 * (n + 1);
	rep(i, n + 1) {
		if(cnt[i] == 0) {
			ans -= 2;
		}
	}

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 1200
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)
using P =pair<ll,ll>;

ll ketasu(ll a){
   ll num=1;
   while(a/10){
       num++;
       a/=10;
   }
   return num;
}

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

ll kosuu(ll a){
    ll sum=0;
    for(ll i=1;i*i<=a;i++){
        if(a%i==0){
            if(a!=1&&i*i!=a){
            sum+=2;
            }else{
             sum++;   
            }
        }
    }
    return sum;
}

ll n;



    vector<pair<ll,ll>>p;
void fs(ll a){
    for(ll i=2;i*i<=n;i++){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        p.emplace_back(i,cnt);
    }
    return;
}


ll di[]={1,0,-1,0};
ll dj[]={0,-1,0,1};
int main(){
   int n;
   cin>>n;
    long long int a[n],ans=0,i;
    int mod=1000000007;
    long long int sum=0;
 
    for( i = 0 ; i < n ; i++ ){
            cin>>a[i];
        sum = sum + a[i];
        sum%=mod;
    }
    for( i = 0 ; i < n ; i++ ){
        sum = sum - a[i];
        if(sum<0)sum+=mod;
 
        ans+=(sum%mod * a[i]%mod)%mod;
        ans%=mod;
    }
    cout<<ans%mod;
 
    return 0;
}
 




Measured memory_bytes: 5196
#n,a,b,c,d=map(int,input().split())
n=int(input())
a=[int(i) for i in input().split()]
ans=True
c=[]

t=sum(a)//((n*(n+1))//2)

if sum(a)%((n*(n+1))//2)!=0:
    ans=False
else:
    for i in range(n):
        if i==0:
            d=a[0]-a[-1]
        else:
            d=a[i]-a[i-1]
        if (t-d)%n!=0 or d-t>0:
            ans=False
            break
        s=(t-d)//n
        c.append(s)
    #if sum(c)==t:
        #ans=True
if n==1:
    ans=True
print('YES' if ans else 'NO')

Measured memory_bytes: 63728
#include <cstdio>
#include <cstdlib>
#include <cstring>

struct Node
{
	int key;
	Node *prev, *next;
};

Node *nil;
void init();
void insert(int key);
Node *listSearch(int key);
void deleteNode(Node *t);
void deleteFirst();
void deleteLast();
void deleteKey(int key);
void printList();

int main()
{
	int key, n, i;
	int size = 0;
	char com[20];
	int np = 0, nd = 0;
	scanf("%d", &n);
	init();
	for (i = 0; i < n; i++)
	{
		scanf("%s%d", com, &key);
		if (com[0] == 'i')
		{
			insert(key);
			np++;
			size++;
		}
		else if (com[0] == 'd')
		{
			if (strlen(com) > 6)
			{
				if (com[6] == 'F')
				{
					deleteFirst();
				}
				else
				{
					deleteLast();
				}
			}
			else
			{
				deleteKey(key);
				nd++;
			}
		}
	}
	printList();
	return 0;
}

void init()
{
	nil = new Node;
	nil->next = nil;
	nil->prev = nil;
}

void insert(int key)
{
	Node *x = new Node;
	x->key = key;
	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
	x->prev = nil;
}

Node *listSearch(int key)
{
	Node *cur = nil->next;	//start from the first element after cur
	while (cur != nil&&cur->key != key)
	{
		cur = cur->next;	//move cur to the next element
	}
	return cur;
}

void deleteNode(Node *t)
{
	if (t == nil)
	{
		return;
	}
	t->prev->next = t->next;
	t->next->prev = t->prev;
	delete t;
}

void deleteFirst()
{
	deleteNode(nil->next);
}

void deleteLast()
{
	deleteNode(nil->prev);
}

void deleteKey(int key)
{
	deleteNode(listSearch(key));
}

void printList()
{
	Node *cur = nil->next;
	int isf = 0;
	while (1)
	{
		if (cur == nil)
		{
			break;
		}
		if ((isf++) > 0)
		{
			printf(" ");
		}
		printf("%d", cur->key);
		cur = cur->next;
	}
	printf("\n");
}


Measured memory_bytes: 33856
loop {
m,f,r=gets.split(" ").map(&:to_i)
break if m==-1 && f==-1 && r==-1

grade="F"
if m == -1 || f == -1
    grade="F"

elsif (m + f) >=80 
    grade= "A"
elsif (m + f) >=65
    grade= "B"
elsif (m + f)>=50
    grade="C"
elsif (m + f)>=30
    if r >= 50
        grade= "C"
    else
        grade= "D"
    end
end

puts grade


}








Measured memory_bytes: 6876
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define repl(i, l, r) for (ll i = (l); i < (r); i++)
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define CST(x) cout << fixed << setprecision(x)
using ll = long long;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pl = pair<ll, ll>;
const ll MOD = 1000000007;
const int inf = 1e9 + 10;
const ll INF = 4e18;
int main() {
	cin.tie(0);
	cout.tie(0);
	ios::sync_with_stdio(false);

	string S;
	cin >> S;
	if (S == "AAA" or S == "BBB")
		cout << "No" << endl;
	else
		cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a);i<(b);++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+(b),(a).begin()+(c) // [b,c) イテレータ
#define INF 1000000000000000
#define MOD 1000000007
using PII = pair<int64_t, int64_t>;
using VI = vector<int64_t>;
using VVI = vector<VI>;
using VS = vector<string>;
using VP = vector<PII>;
using i64 = int64_t;
template<typename T> void invec(vector<T> &A){for(T& a:A) cin >> a;} 

int N;
// 連結成分の二部グラフ判定。隣接行列表現
vector<int> seen; // 0未訪問、1黒、-1白
bool dfs(const VVI &G, const int v, const int c = 1) {
    seen[v] = c;
    int N = G.size();
    rep(nv, 1, N) {
        if (G[v][nv] == INF || v == nv) continue;
        if (seen[nv] == c) return false; // next_v が探索済みで同色
        if (seen[nv] == 0 && !dfs(G, nv, -c)) return false;
    }
    return true;
}

// warshall-floyd
VVI WF(VVI d){
    int V = d.size();
    //径路 i - k - j 
    rep(k, 1, V) rep(i, 1, V) if (d[i][k] < INF) 
        rep(j, 1, V) if (d[k][j] < INF)
            d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
    return d;
}


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

cin >> N;
VVI G(N+1, VI(1, INF)); // 隣接行列
// VS S(N); invec(S);

rep(i, 0, N){
    string S; cin >> S;
    rep(j, 0, N) {
        if (S[j] - '0') G[i+1].push_back(S[j] - '0');
        else if (i == j) G[i+1].push_back(0);
        else G[i+1].push_back(INF);
    }
}

// 二部グラフ判定
seen.assign(N+1, 0);
if (!dfs(G, 1)){
    cout << "-1\n";
    return 0;
}

VVI dist = WF(G);
i64 d = 0;
for(VI d1: dist) for(i64 d2: d1) if (d2 < INF)
    d = max(d, d2);

cout << d + 1 << "\n";

return 0;
}
// コンテスト前はtemplate振り返り。
// 書いて考える．場合分け．情報整理．
// 単純に分かる量から．愚直解を実装して研究．
// 境界，出力文字列 チェック．行末にスペース入れない．
// 可読性優先．高速化次点．
// まずは全探索，分割，次にDP(小さい問題から大きな問題)
// 制限を見る．境界に注意．求めたい量の変域．動かせる量．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性→二分探索
// 存在判定：構成方法，入力の特徴
// 構築問題。極端解を試す。
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 代数的処理．前処理によるクエリ高速化．
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// コーナーケース。境界値。数表出力プログラム作る
// 実行エラー：vector添え字超え．0割り．



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

#define debug(s) cout << s << endl
#define debug1(s, t) cout << s << " " << t << endl
#define debug2(s, t, u) cout << s << " " << t << " " << u << endl
#define printvec(v)       \
    for (auto &&i : v)    \
        cout << i << " "; \
    cout << endl

using namespace std;
using i64 = long long;

int main()
{
    i64 n, k;
    cin >> n >> k;
    i64 r = n % k;

    i64 ans = min(r, k - r);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
vector<int> now;
int get(int num){
    int L = 0, R = now.size()+1;
    while (R-L>1){
        int M = (L+R) / 2;
        if (now[M-1] < num) L = M;
        else R = M;
    }
    return L;
}
signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    for (int i=0; i < n; i++) cin >> a[i];
    for (int i=0; i < n; i++) cin >> b[i];
    int ans = 0;
    for (int i=1; i <= 29; i++){
        int res = 0;
        now.clear();
        for (int j=0; j < n; j++){
            int ost = b[j] % (1LL<<i);
            now.push_back(ost);
        }
        sort(now.begin(), now.end());
        for (int j=0; j < n; j++){
            int ost = a[j] % (1LL<<i);
            int A = 1 << (i-1);
            int B = (1<<i) - 1;
            A -= ost;
            B -= ost;
            while (A < 0) A += (1LL<<i);
            while (B < 0) B += (1LL<<i);
            int R;
            if (A < (1LL<<(i-1))){
                R = get(B+1) - get(A);
            }
            else{
                R = n - get(A) + get((B+1)%(1LL<<i));
            }
            res += R;
            res %= 2;
        }
        if (res!=0) ans += 1LL<<(i-1);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 2936
def prime(m):
    N=range(1,m+2,2)
    r=int(m**.5)
    h=len(N)
    N[0]=0
    for i in range(h):
        x=N[i]
        if x>r: break
        if x and i+x<h: N[i+x:h:x]=[0] * ((h-1-i-x)/x+1)
    N[0]=2
    return filter(None,N)
PRIMES=prime(105000)
while 1:
    n=input()
    if n==0: break
    print sum(PRIMES[:n])

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

using namespace std;

int main(){
    string S;
    cin >> S;
    int Ans1 = 0;
    int Ans2 = 0;
    for(int i = 0;i < S.size();i++){
        if(i % 2 == 0 && S[i] == '1'){
            Ans1++;
        }else if(i % 2 == 1 && S[i] == '0'){
            Ans1++;
        }
    }
    for(int i = 0;i < S.size();i++){
        if(i % 2 == 0 && S[i] == '0'){
            Ans2++;
        }else if(i % 2 == 1 && S[i] == '1'){
            Ans2++;
        }
    }
    if(Ans1 > Ans2){
        cout << Ans2 << endl;
    }else{
        cout << Ans1 << endl;
    }
}


Measured memory_bytes: 512
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In,' '));
        }

        public void Solve(ConsoleInput cin)
        {
            //ABC 161 E - Yutori
            var N = cin.ReadInt;
            var K = cin.ReadInt;
            var C = cin.ReadInt;
            var S = cin.Read.ToCharArray();
            var L = new int[K];
            var R = new int[K];

            var count = 0;
            for (int i = 0; i < N; i++)
            {
                if (S[i] == 'x') continue;
                L[count] = i+1;
                i += C;
                count++;
                if (count == K) break;
            }

            count = 0;
            for (int i = N-1 ; i >= 0; i--)
            {
                if (S[i] == 'x') continue;
                R[K - 1 - count] = i + 1;
                i -= C;
                count++;
                if (count == K) break;
            }
            /*
            Console.WriteLine(" i + 1, L[i]");
            for (int i = 0; i < K; i++)
            {
                Console.WriteLine("{0}日目は{1}日以降",i+1,L[i]);
            }
            Console.WriteLine(" i + 1, R[i]");
            for (int i = 0; i < K; i++)
            {
                Console.WriteLine("{0}日目は{1}日以前", i + 1, R[i]);
            }*/
            for (int i = 0; i < K; i++)
            {
                if (R[i] == L[i]) Console.WriteLine(R[i]);
            }
        }
    }


    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream,char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }

        public string Read
        {
            get
            {
                if(inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for(int i = 0;i < tmp.Length;i++)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }

        
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }

}

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

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

int main() {
   int n;
   cin >> n;
   
   vector<ll> v;
   for (int i = 0; i < 3 * n; i++) {
       ll a;
       cin >> a;
       v.push_back(a);
   }
   
   sort(v.begin(), v.end());
   ll ans = 0;
   for (int i = n; i < 2 * n; i++) {
       ans += v[i];
   }
   
   ll total = 0;
   int cnt = 0;
   for (int i = 3 * n - 2; i >= 0; i -= 2) {
       total += v[i];
       cnt++;
       if (cnt == n) {
           break;
       }
   }
   ans = max(total, ans);
   cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 6000
#include <stdlib.h>                      
#include <stdio.h>                       
 
typedef struct node {
  int k;                        
  struct node *p;       
  struct node *l; 
  struct node *r; 
} node;   
 
static node *build_node(int k) {
  node *n;                       
  n = (node *) malloc(sizeof(node));
  n->p = n->l = n->r = NULL;
  n->k = k;      
  return n;
}
                  
static void insert_node(node *r, node *n) {
  if (n->k <= r->k) {
    if (r->l == NULL) {
      r->l = n;
      n->p = r;         
    } else {              
      insert_node(r->l, n);
    }           
  } else {      
    if (r->r == NULL) {     
      r->r = n;
      n->p = r;
    } else {   
      insert_node(r->r, n);
    }                                                  
  }           
}              
                                       
static int find_node(node *n, int k) {  
  int ret;    
  if (n == NULL) {
    ret = 0;  
  } else if (k == n->k) {
    ret = 1;
  } else if (n->l != NULL && k < n->k) {
    ret = find_node(n->l, k);
  } else if (n->r != NULL && k > n->k) {
    ret = find_node(n->r, k);              
  } else {
    ret = 0;
  }
  return ret;
}

static void print_inorder(node *n) {
  if (n->l != NULL) print_inorder(n->l);
  printf(" %d", n->k);
  if (n->r != NULL) print_inorder(n->r);
}

static void print_preorder(node *n) {
  printf(" %d", n->k);
  if (n->l != NULL) print_preorder(n->l);
  if (n->r != NULL) print_preorder(n->r);
}

static void free_node(node *n) {
  if (n == NULL) return;
  free_node(n->l);
  free_node(n->r);
  free(n);
}

int main(int argc, char **argv) {
  int m, i, k;
  char cmd[8];
  node *r = NULL;
  node *n;

  scanf("%d", &m);
  for (i = 0; i < m; ++i) {
    scanf("%s", cmd);
    switch (cmd[0]) {
      case 'i':
        scanf("%d", &k);
        n = build_node(k);
        if (r == NULL) {
          r = n;
        } else {
          insert_node(r, n);
        }
        break;
      case 'f':
        scanf("%d", &k);
        printf("%s\n", find_node(r, k) ? "yes" : "no");
        break;
      case 'p':
        print_inorder(r); printf("\n");
        print_preorder(r); printf("\n");
        break;
      default:
        break;
    }
  }
  free_node(r);
  exit(0);
}


Measured memory_bytes: 20536
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>

using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
int main() {
	int n; cin >> n; vector<int> x(n), y(n);

	rep(i, n) {
		cin >> x[i] >> y[i];
	}

	double sum = 0;

	for (int i = 0; i < n; i++) {
		for (int j = i; j < n; j++) {
			sum += (sqrt(abs(x[i] - x[j]) * abs(x[i] - x[j]) + abs(y[i] - y[j]) * abs(y[i] - y[j])))/ n;
		}
	}
	cout << fixed << setprecision(10);
	cout << sum*2 << endl;
}

Measured memory_bytes: 256
n,k = map(int,input().split())
p = [int(i)-1 for i in input().split()]
c = [int(i) for i in input().split()]
INF = float("INF")
ans = -INF

for si in range(n):
    x = si
    S = []
    tot = 0
    while True:
        x = p[x]
        S.append(c[x])
        tot += c[x]
        if x == si: break
    l = len(S)
    t = 0
    for i in range(l):
        if i+1 > k: break
        t += S[i]
        now = t
        if tot > 0:
            e = (k-(i+1))//l
            now += tot*e
        ans = max(ans, now)
print(ans)

Measured memory_bytes: 80628
while True:
	n, x = map(int, input().split())
	if n == 0 and x == 0:
		break
	else:
		count = 0
		for i in range(1, n-1):
			for j in range(i+1, n):
				for k in range(j+1, n+1):
					total = i + j + k
					if total == x:
						count += 1
		print(count)


Measured memory_bytes: 5592
#include<cstdio>
#include<cstring>
using namespace std;

int main()
{
//	int T;
//	scanf("%d",&T);
	long long x,y;
	while(scanf("%lld%lld",&x,&y)!=EOF)
	{
		if(x%y==0) printf("-1\n");
		else printf("%lld\n",x);
	}
}


Measured memory_bytes: 128
countIf :: Int -> String -> Int
countIf count string
  | string == "" = count
  | otherwise = countIf (count + (countInt x)) xs
  where (x:xs) = string

countInt :: Char -> Int
countInt char
  | char == "2" !! 0 = 1
  | otherwise = 0

main = do
  string <- getLine
  let result = countIf 0 string
  putStrLn $ show result



Measured memory_bytes: 380
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int r,g,b,ans;
    cin >> r >> g >> b;
    ans = r*100+g*10+b;
    if (ans%4 == 0){
    	cout << "YES" << endl;
    }
    else{
    	cout << "NO" << endl;
    }
    
}

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

int main() {
    int n,m,sum=0,count=0;
    string ans="No";
    cin>>n>>m;
    vector<int> a(n);
    rep(i,n) {
        cin>>a.at(i);
        sum+=a.at(i);
    }
    double temp=(double)sum/(double)(4*m);
    rep(i,n) {
        if (a.at(i)>=temp) {
            count++;
            if (count==m) {
                ans="Yes";
                break;
            }
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

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

#define int long long
#define v first
#define w second

string s, t, ans;
int d[3002][3002];

int dp(int ls, int rs){
	if(d[ls][rs] != LONG_MIN) return d[ls][rs];
	if(ls == 0 || rs == 0) return 0;
	if(s[ls] == t[rs]) return d[ls][rs] = dp(ls - 1, rs - 1) + 1;
	else return d[ls][rs] = max(dp(ls - 1, rs), dp(ls, rs - 1));
}

signed main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	cin >> s >> t;
	s = '~' + s, t = '~' + t;
	for(int i = 0 ; i <= 3000 ; i ++)
		fill(d[i], d[i] + 3002, LONG_MIN);
	int rem = dp(s.size() - 1, t.size() - 1);
	int ls = s.size() - 1, rs = t.size() - 1;
	while(ls > 0 && rs > 0){
		if(s[ls] == t[rs]){
			ans += s[ls];
			ls --;
			rs --;
		}
		else {
			if(dp(ls, rs - 1) == dp(ls, rs)) rs --;
			else ls --;
		}
	}
	reverse(ans.begin(), ans.end());
	cout << ans;
}


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

int main(){
    string S;
    cin >> S;
    string s1,s2;
    int ns;
    ns=S.size();

    for(int i=1; i<ns; i++){
        if( (ns-i)%2==1 ){
            continue;
        }else{
            s1=S.substr(0,(ns-i)/2);
            s2=S.substr((ns-i)/2,(ns-i)/2);
            if( s1 == s2 ){
                cout << ns-i << endl;
                return 0;
            }
        }
    }

    return 0;
}

Measured memory_bytes: 256
from collections import Counter,defaultdict,deque
from heapq import heappop, heappush
import sys,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

d,g = inpl()
p = [0] * d
c = [0] * d
for i in range(d):
    p[i], c[i] = inpl()
res = float('inf')

for flag in itertools.product((0,1),repeat=d):
    sco = 0
    cnt = 0
    for i,j in enumerate(flag):
        if j:
            sco += (i+1)*100*p[i] + c[i]
            cnt += p[i]
    # print(flag,sco,cnt)
    if sco >= g:
        res = min(res, cnt)
    else:
        rem = g - sco #残り
        for i,j in enumerate(flag):
            if not j:
                tmp = rem/((i+1)*100)
                # print(flag,tmp)
                if tmp < p[i]:
                    res = max(min(res, cnt+tmp),1)
print(int(res))


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

int main() {
	int a, b, c, d=0;
	cin>> a >> b >> c;
	for(int i=0; i<100000000;i++){
		if(a*i%b==c){
			d=1;
			cout<<"YES"<<endl;
			break;
		}
		}
		if(d==0){
			cout<<"NO"<<endl;
		}
	
return 0;	
}

Measured memory_bytes: 256
n,a,b = list(map(int, input().split()))
h = []
for i in range(n):
    h.append(int(input()))

import math as m

imin = 1
imax = sum([hh // a + 1 for hh in h])

while ( imax > imin+1 ):
    num = imin + (imax-imin)//2
    acnt = sum([m.ceil((hi- b*num)/(a-b)) for hi in h  if (hi- b*num)>0])
    if ( acnt<=num ):
        imax = num
    else:
        imin = num
print(imax)


Measured memory_bytes: 11056
#include<bits/stdc++.h>
using namespace std;
#define reg register
#define ll long long
inline ll read()
{
	ll x=0,w=0;char ch=getchar();
	while(!isdigit(ch))w|=ch=='-',ch=getchar();
	while(isdigit(ch))x=(x<<3)+(x<<1)+(ch^48),ch=getchar();
	return w?-x:x;
}
ll a[100];
inline void insert(ll x)
{
    for(int i=62;i>=0;--i)
        if((x>>i)&1)
        {
            if(!a[i]){a[i]=x;return ;}
            x^=a[i];
        }
}
inline int check(ll x)
{
    for(int i=62;i>=0;--i)
    {
        if((x>>i)&1)
        {
            if(!a[i])return 0;
            x^=a[i];
        }
    }
    return 1;
}
char s[1000];
int n;
ll b[1000];
int main()
{
    reg int T=read();
    reg int ans;
    reg int i;
    while(T--)
    {
        n=read();
        memset(a,0,sizeof a);
        for(i=1;i<=n;++i)b[i]=read();
        scanf("%s",s+1);
        ans=1;
        for(i=n;i>=1;--i)
        {
            if(s[i]=='0')insert(b[i]);
            else ans&=check(b[i]);
        }
        printf("%d\n",ans^1);
    }
	return 0;
}


Measured memory_bytes: 3836