akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000
#define LLINF 1000000000000000
#define sz(x) ((int)(x).size())
#define fi first
#define sec second
#define all(x) (x).begin(),(x).end()
#define sq(x) ((x)*(x))
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define repn(i,a,n) for(int (i)=(a);(i)<(int)(n);(i)++)
#define EQ(a,b) (abs((a)-(b))<eps)
template<class T> void chmin(T& a,const T& b){if(a>b)a=b;}
template<class T> void chmax(T& a,const T& b){if(a<b)a=b;}
ll N,M;
string s,t;
ll gcd(ll a,ll b){
	if(b==0ll)return a;
	return gcd(b,a%b);
}
int main(){
	cin >> N >> M;
	cin >> s;
	cin >> t;
	ll ans = N/gcd(N,M)*M;
	ll a = ans/N, b = ans/M;
	ll g = a/gcd(a,b)*b;
	int c = 0,d = 0;
	for(int i=0;i<ans/g;i++){
		if(s[c]!=t[d]){
			cout << -1 << endl;
			return 0;
		}
		c += g/a;
		d += g/b;
	}
	cout << ans << endl;
	return 0;
}

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

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

void run(void){
  int n,k;
  scanf("%d%d",&n,&k);
  int *h=(int *)calloc(n,sizeof(int));
  int i;
  for(i=0;i<n;i++) scanf("%d",h+i);
  int *dp=(int *)calloc(n,sizeof(int));
  for(i=1;i<n;i++) dp[i]=1000000000+1;
  for(i=0;i<n;i++){
    for(int j=1;j<=k && i+j<n;j++){
      dp[i+j]=MIN(dp[i+j],dp[i]+ABS(h[i+j]-h[i]));
    }
  }
  printf("%d\n",dp[n-1]);
}

int main(void){
  run();
  return 0;
}


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

using namespace std;

#define int long long
#define pb push_back
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define REP(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for(int i=(a);i>=(b);i--)
#define RREP(i, n) FOR(i, n, 0);

signed main () {
  cin.tie(0);
  cout << setprecision(10);

  int n; cin >> n;
  map<int, int> a;
  vector<int> b;
  int tmp;
  REP(i, n) {
    cin >> tmp;
    if(a[tmp] == 0) b.pb(tmp);
    a[tmp]++;
  }

  int count = 0;

  REP(i, b.size()) {
    if(a[b[i]] > b[i]) count += a[b[i]] - b[i];
    else if (a[b[i]] < b[i]) count += a[b[i]];
  }

  cout << count << endl;
}


Measured memory_bytes: 7028
/**
*    author:  yuya1234
*    created: 26.06.2020 16:26:38
**/

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

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

#define SORT(s) sort((s).begin(),(s).end())
#define SORTD(s) sort((s).rbegin(),(s).rend())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define SZ(x) ((int)(x).size())
#define MEMSET(v, h) memset((v), h, sizeof(v))

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

    ll a,b,c;
    cin>>a>>b>>c;

    string ans="NO";
    for (ll i = 1; i < 100; i++)
    {
        if((i*a)%b==c)
        {
            ans="YES";
            break;
        }
    }
    
    cout<<ans<<endl;

    return 0;
}

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

typedef long long ll;

int main() {
    int N, ans = 0;
    string S;
    cin >> N >> S;
    for (int i = 1; i < N; i++) {
        vector<bool> a(26, false), b(26, false);
        rep(j, i) {
            a[S[j] - 'a'] = true;
        }
        rep(j, N - i) {
            b[S[j + i] - 'a'] = true;
        }
        int c = 0;
        rep(j, 26) {
            if (a[j] && b[j]) c++;
        }
        ans = max(ans, c);
    }
    cout << ans << "\n";
}

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

int selection(vector<int> &A,int N){
    int sw=0;
    for(int i=0;i<N;i++){
        int minj=i;
        for(int j=i;j<N;j++){
            if(A.at(j)<A.at(minj)) minj=j;
        }
        swap(A.at(i),A.at(minj));
        if(i!=minj) sw++;
    }
    return sw;
}

int main(void){
    int N;
    cin >> N;
    
vector<int> A(100);
    for(int i=0;i<N;i++){
        cin >> A.at(i);
    }
    
    int sw=selection(A,N);
    
    for(int i=0;i<N-1;i++){
        cout << A.at(i) << " ";
    }
    cout << A.at(N-1) << endl;
    
    cout << sw << endl;
    return 0;
}


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

int main()
{
    int number;

    cin >> number;


    for(int a=1;a<=9;a++)
    {
        for(int b=1;b<=9;b++)
        {
            if( a*b == number)
            {
                cout << "Yes";
                return 0;
            }
        }
    }

    cout << "No";



    return 0;
}


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

int main(int argc, char const *argv[])
{
    int n; cin >> n;
    int d, e;
    int count = 0;
    rep(i,n) {
        cin >> d >> e;
        if (d == e) count ++;
        else count = 0;
        if (count == 3)
        {
            cout << "Yes" << endl;
            return 0;
        }
        
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#ifdef _WIN32
#include "debug.hpp"
#endif
using namespace std;

#define rep(i, N)  for(int i = 0; i < (N); i++)
#define reps(i, N) for(int i = 1; i <= (N); i++)
#define repr(i, N) for(int i = (N) - 1; i >= 0; i--)
#define pub push_back

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

typedef long long ll;
typedef pair<int, int> P;
const int INF = 100000000;
const ll LINF = 10000000000000000;
const int MOD = 1000000007;
const int dx[9] = { 0, 1,  0, -1, 1,  1, -1, -1, 0};
const int dy[9] = { 1, 0, -1,  0, 1, -1, -1,  1, 0};
//--------------------------------------//
int N;
string s;

void solve(){
	int rc = 0;
	rep(i, N){
		if(s[i] == 'R')
			rc++;
	}
	if(rc > N - rc){
		cout << "Yes" << endl;
	}
	else
		cout << "No" << endl;
}

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


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

	public static void main(String[] args) {
		Scanner sc= new Scanner(System.in);
		String s=sc.nextLine(),t=sc.nextLine();
		int max=Integer.MAX_VALUE;
		
			 for(int i=0;i<s.length()-t.length()+1;i++)
		        {
		            String x="";
		            		x+=s.substring(i, i+t.length());
		            int c=0;
		            for(int j=0;j<t.length();j++)
		            {
		                if(x.charAt(j)!=t.charAt(j))c++;
		            }
		            max=Math.min(max,c);
		        }
		System.out.println(max);

	}

}


Measured memory_bytes: 40484
/*  ***  In The Name of God ... ***  */ 
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;

#define int long long
#define all(v) v.begin() , v.end()

template<typename T> inline bool smin(T &a, const T &b){ return b < a ? a = b,1:0;}
template<typename T> inline bool smax(T &a, const T &b){ return a < b ? a = b,1:0;}

const int N = 3e5 + 10 , mod = 1e9 + 7 ; 

int n , m , a , b , f [ N ] , rev [ N ] ; 

int pw ( int x , int y ) {
	x %= mod ;
	int ret = 1 ;
	for ( ; y ; y >>= 1 , ( x *= x ) %= mod )
		if ( y & 1 )
			( ret *= x ) %= mod ;
	return ret ; 
}

int C ( int n , int r ) {
	return ( ( f [ n ] * rev [ n - r ] % mod ) * ( rev [ r ] % mod ) % mod ) % mod ; 
}

int get ( int x , int y , int xx , int yy ) {
	if ( x > xx || y > yy ) return 0 ; 
	return C ( ( xx - x ) + ( yy - y ) , ( xx - x ) ) ; 
}

int32_t main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> n >> m >> a >> b ;
	f [ 0 ] = rev [ 0 ] = 1 ;
	for ( int i = 1 ; i < N ; ++ i )
		( f [ i ] = f [ i - 1 ] * i ) %= mod , rev [ i ] = pw ( f [ i ] , mod - 2 ) ;
	int res = get ( 1 , 1 , n , m ) ;
	//cout << res << '\n' ; 
	for ( int i = n - a + 1 ; i <= n ; ++ i ) {
		int bad = get ( i , b + 1 , n , m ) * get ( 1 , 1 , i , b ) % mod ;
		//cout << get ( i , b + 1 , n , m ) << '\n' ; 
		res -= bad ;
		if ( res < 0 ) res += mod ; 
		if ( res >= mod ) res -= mod ; 
	}
	cout << ( ( res += mod ) %= mod )<< '\n' ; 
}


Measured memory_bytes: 4992
/*
 Author: nilesh8757
 */
#include<bits/stdc++.h>
 using namespace std;

#define FIO                     ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define mod                     1000000007
#define eps                     1e-9
#define setbits                 __builtin_popcount
#define gcd                     __gcd
#define rep(i,a,b)              for(int i=a;i<=b;i++)
#define repr(i,b,a)             for(int i=b;i>=a;i--)
#define forn(i,n)               for(int i=0;i<n;i++)
#define all(a)                  a.begin(), a.end()
#define in(a,b)                 ( (b).find(a) != (b).end())
#define pb                      push_back
#define fill(a,v)               memset(a, v, sizeof a)
#define endl                    "\n"
#define ff                      first
#define ss                      second
#define mp                      make_pair
#define minin(a)                *min_element (all(a))
#define maxin(a)                *max_element(all(a))
#define asort(c)                sort(all(c))
#define dsort(c)                sort(all(c), greater<int>()) 
#define PI                      3.14159265358979323846
#define int                     long long
typedef  vector<int>                 vi;
typedef  pair<int, int>              ii;
typedef  vector<ii>                 vii;
typedef  set<int>                    si;
typedef  map<int, int>              mii;
typedef  long double                 ld;


clock_t time_p=clock();
void timer()
{
    time_p=clock()-time_p;
    cerr<<"Execution Time: "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}

int a[100005];

int32_t main()
{
  FIO
 // #ifndef ONLINE_JUDGE
   // freopen("input.txt", "r", stdin); 
    //freopen("output.txt", "w", stdout);
  //#endif
 
  int n;
  cin>>n;
  int tot=0;
  rep(i,1,n)
  {
   	cin>>a[i];
    if(i==1)
    {
    	tot+=abs(a[i]);
    }
    else if(i==n)
    {
    	tot+=abs(a[i]-a[i-1]) + abs(a[i]);
    }
    else
    {
    	tot+=abs(a[i]-a[i-1]);
    }
  }
 
  rep(i,1,n)
  {
  	if(i==1)
  	{
       cout<<tot-(abs(a[i])+abs(a[i+1]-a[i])) + abs(a[i+1])<<endl;
  	}
  	else if(i==n)
  	{
        cout<<tot-(abs(a[i]-a[i-1]) + abs(a[i]))+ abs(a[i-1])<<endl;
  	}
  	else
  	{
        cout<<tot-(abs(a[i]-a[i-1]) + abs(a[i+1]-a[i])) + abs(a[i+1]-a[i-1])<<endl;
  	}
  }
  timer();
  return 0;
}  

Measured memory_bytes: 2048
#include<iostream>
#include<vector>
using namespace std;
vector<pair<int, int> *> vertical[5001];
bool find(int,int);
int main() {
	pair<int, int> point[3000];
	int n;
	bool dummy1, dummy2;
	pair<int, int> INF;
	while (cin >> n && n != 0) {
		for (int i = 0; i < n; ++i) {
			cin >> point[i].first >> point[i].second;
			vertical[point[i].first].push_back(&point[i]);
		}
		for (int i = 0; i <=5000; ++i) {
			vertical[i].push_back(&INF);
		}
		int x, y;
		int answer = 0;
		for (int i = 0; i + 1 < n; ++i) {
			for (int j = i + 1; j < n; ++j) {
				x = point[j].second - point[i].second;
				y = point[j].first - point[i].first;
				if (x*x + y*y <= answer)continue;
				INF.second = point[i].second - y;
				dummy1 = find(point[i].first + x, point[i].second - y);
				INF.second = point[j].second - y;
				dummy2 = find(point[j].first + x, point[j].second - y);
				if (dummy1 == true&&dummy2 == true) {
					answer = x*x + y*y;
					continue;
				}
				INF.second = point[i].second + y;
				dummy1 = find(point[i].first - x, point[i].second + y);
				INF.second = point[j].second + y;
				dummy2 = find(point[j].first - x, point[j].second + y);
				if (dummy1 == true&&dummy2 == true) {
					answer = x*x + y*y;
				}
			}
		}
		for (int i = 0; i <= 5000; ++i) {
			vertical[i].clear();
		}
		cout << answer << endl;
	}
}

bool find(int x, int y) {
	if (x < 0 || x>5000 || y < 0 || y>5000)return false;
	int i=0,psize=vertical[x].size();
	while (true) {
		if (vertical[x][i]->second == y) {
			if (i + 1 == psize) {
				return false;
			}
			else {
				return true;
			}
		}
		++i;
	}
}

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

int f(int x) {
  if (x == 0) return 1;
  int cnt = 0;
  while (x) {
    x /= 10;
    cnt++;
  }
  return cnt;
}

int g(int x, int a) {
  while (a--) {
    x /= 10;
  }
  return x % 10;
}

int main() {
  int n, m; cin >> n >> m;
  vector<int> s(m), c(m); rep(i, m) cin >> s[i] >> c[i];
  if (n == 1) {
    bool f = true;
    rep(i, m) {
      if (s[i] == 1 && c[i] != 0)
        f = false;
    }
    if (f) {
      cout << 0 << endl;
      return 0;
    }
  }
  for (int i = 1; i < 1000; i++) {
    bool h = true;
    int t = f(i);
    if (t != n) h = false;
    rep(j, m) {
      if (s[j] > t) {
        h = false;
        break;
      }
      if (g(i, t - s[j]) != c[j])
        h = false;
    }
    if (h) {
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}

Measured memory_bytes: 256
from bisect import bisect_left,bisect_right,insort
N = int(input())
S = list(input())
Q = int(input())
D = dict()
D2 = dict()# to be removed
D3 = dict()# to be added

for i in range(97,97+26):
    D[chr(i)] = []
    D2[chr(i)] = []
    D3[chr(i)] = []
for i in range(N):
    D[S[i]].append(i+1)
for i in range(Q):
    t,l,r = input().split()
    if t == str(1):
        k = int(l)
        c = r
        if S[k-1] == c:
            continue
        if bisect_right(D[S[k-1]],k)-bisect_left(D[S[k-1]],k) == 1:
            del D[S[k-1]][bisect_left(D[S[k-1]],k)]
        insort(D[c],k)
        S[k-1] = c
        continue
    l = int(l)
    r = int(r)
    ans = 0
    for i in range(97,97+26):
        X = D[chr(i)]
        X2 = D2[chr(i)]
        X3 = D3[chr(i)]
        if bisect_right(X,r)-bisect_left(X,l) > 0:
            ans += 1
    print(ans)


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

int main()
{
  bool pri[1300000];
  //  vector<int> price;
  fill(pri,pri+1300000,true);
  pri[0]=pri[1]=false;
  for(int i=2;i<1300000;i++)
    {
      if(pri[i]==0)
	continue;
      //  price.push_back(i);	
      for(int j=i+i;j<1300000;j+=i)
	{
	  pri[j]=false;
	}
    }
  int n;
  for(;cin>>n,n;)
    { 
      
      if(pri[n])
	cout<<"0"<<endl;
      else
	{
	  int max,min;
	  for(int i=n-1;;i--)
	    {
	      if(pri[i])
		{
		  min=i;
		  break;
		}
	    }
	  for(int i=n+1;;i++)
	    {
	      if(pri[i])
		{
		  max=i;
		  break;
		}
	    }
	  cout<<max-min<<endl;
	}    
    }
 
}

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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    int N,T;
    cin>>N>>T;
    vint A(N);
    rep(i,N)cin>>A[i];

    int tmp=INT_MAX;
    int ma=0;
    for(int i=0;i<N;i++){
        chmax(ma,A[i]-tmp);
        chmin(tmp,A[i]);
    }

    int ans=INT_MAX;
    tmp=INT_MAX;
    int cnt=0;
    for(int i=0;i<N;i++){
        if(A[i]-tmp==ma)cnt++;
        chmin(tmp,A[i]);
    }
    chmin(ans,cnt);
    cnt=0;
    tmp=INT_MIN;
    for(int i=N-1;i>=0;i--){
        if(tmp-A[i]==ma)cnt++;
        chmax(tmp,A[i]);
    }
    chmin(ans,cnt);
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,int> pii;
const int N = 2e5+5;
const int M = 5e5+5;
#define pi acos(-1)
#define INF 1e18
#define INM INT_MIN
#define pb(a)  push_back(a)
#define mk(a,b) make_pair(a,b)
#define dbg(x) cout << "now this num is " << x << endl;
#define met0(axx) memset(axx,0,sizeof(axx));
#define metf(axx) memset(axx,-1,sizeof(axx));
#define sd(ax) scanf("%d",&ax)
#define sld(ax) scanf("%lld",&ax)
#define sldd(ax,bx) scanf("%lld %lld",&ax,&bx)
#define sdd(ax,bx) scanf("%d %d",&ax,&bx)
#define sddd(ax,bx,cx) scanf("%d %d %d",&ax,&bx,&cx)
#define sfd(ax) scanf("%lf",&ax)
#define sfdd(ax,bx) scanf("%lf %lf",&ax,&bx)
#define pr(a) printf("%d\n",a)
#define plr(a) printf("%lld\n",a)
int a[N];
int main()
{
	int n;sd(n);
	for(int i=1;i<n;++i)
	{
		int x;sd(x);
		a[x]++;
	}
	for(int i=1;i<=n;++i) pr(a[i]);
	//system("pause");
	return 0;
}

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

const int MOD = 1000000007;
const int INF = 1e9;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

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

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
} 

int main(){
int a, b, x, y;
cin >> a >> b >> x >> y;
  double ans = (double(a) * double(b)) / 2;
  bool flag = false;
  if(2 * x == a && 2 * y == b) flag = true;
  cout  << fixed << setprecision(9) << ans << ' ';
  if(flag) cout << 1;
  else cout << 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define cs const
#define re register
#define pb push_back
#define pii pair<int,int>
#define ll long long
#define fi first
#define se second
#define bg begin
cs int RLEN=1<<20|1;
inline char gc(){
    static char ibuf[RLEN],*ib,*ob;
    (ib==ob)&&(ob=(ib=ibuf)+fread(ibuf,1,RLEN,stdin));
    return (ib==ob)?EOF:*ib++;
}
inline int read(){
    char ch=gc();
    int res=0;bool f=1;
    while(!isdigit(ch))f^=ch=='-',ch=gc();
    while(isdigit(ch))res=(res+(res<<2)<<1)+(ch^48),ch=gc();
    return f?res:-res;
}
inline ll readll(){
    char ch=gc();
    ll res=0;bool f=1;
    while(!isdigit(ch))f^=ch=='-',ch=gc();
    while(isdigit(ch))res=(res+(res<<2)<<1)+(ch^48),ch=gc();
    return f?res:-res;
}
inline int readstring(char *s){
	int top=0;char ch=gc();
	while(isspace(ch))ch=gc();
	while(!isspace(ch)&&ch!=EOF)s[++top]=ch,ch=gc();
	return top;
}
template<typename tp>inline void chemx(tp &a,tp b){a<b?a=b:0;}
template<typename tp>inline void chemn(tp &a,tp b){a>b?a=b:0;}
cs int mod=998244353;
inline int add(int a,int b){return (a+=b)>=mod?(a-mod):a;}
inline int dec(int a,int b){a-=b;return a+(a>>31&mod);}
inline int mul(int a,int b){static ll r;r=1ll*a*b;return (r>=mod)?(r%mod):r;}
inline void Add(int &a,int b){(a+=b)>=mod?(a-=mod):0;}
inline void Dec(int &a,int b){a-=b,a+=a>>31&mod;}
inline void Mul(int &a,int b){static ll r;r=1ll*a*b;a=(r>=mod)?(r%mod):r;}
inline int ksm(int a,int b,int res=1){if(a==0&&b==0)return 0;for(;b;b>>=1,Mul(a,a))(b&1)&&(Mul(res,a),1);return res;}
inline int Inv(int x){return ksm(x,mod-2);}
inline int fix(ll x){return x%=mod,(x<0)?x+mod:x;}
cs int N=19,M=(1<<N)|1;
int f[M],p[M],n,m,s;
inline void fwt(int *f,int lim,int kd){
	for(int mid=1,a0,a1;mid<lim;mid<<=1)
	for(int i=0;i<lim;i+=mid<<1)
	for(int j=0;j<mid;j++)
	a0=f[i+j],a1=f[i+j+mid],f[i+j]=add(a0,a1),f[i+j+mid]=dec(a0,a1);
	if(kd==-1)
	for(int i=0,iv=Inv(lim);i<lim;i++)Mul(f[i],iv);
}
int main(){
	#ifdef Stargazer
	freopen("lx.in","r",stdin);
	#endif
	n=read(),m=1<<n;
	for(int i=0;i<m;i++){
		p[i]=read(),Add(s,p[i]);
	}s=Inv(s);
	for(int i=0;i<m;i++)Mul(p[i],s);
	Dec(p[0],1),f[0]=m-1;
	for(int i=1;i<m;i++)f[i]=mod-1;
	fwt(f,m,1),fwt(p,m,1);
	for(int i=1;i<m;i++)Mul(f[i],Inv(p[i]));
	f[0]=0,fwt(f,m,-1);
	for(int i=0;i<m;i++)cout<<dec(f[i],f[0])<<"\n";
	return 0;
}

Measured memory_bytes: 6784
A, B, C, X, Y = map(int, input().split())
c_max = max(X, Y) * 2
ans = float('inf')
for c in range(0, c_max+1, 2):
    a = X - c // 2
    b = Y - c // 2
    ans = min(max(a, 0)*A + max(b, 0)*B + c*C, ans)

print(ans)

Measured memory_bytes: 3064
#include<cstdio>
#include<string>
#include<iostream>
#include<algorithm>
#define _USE_MATH_DEFINES
#include<math.h>
#include<queue>
#include<set>
#include<vector>
#define INF 100000000

#define MAX_N 100
#define MAX_set 200

typedef long long int ll;
using namespace std;


int main(){

	double a, b, c, d, e, f;

	while(scanf("%lf%lf%lf%lf%lf%lf", &a, &b, &c, &d, &e, &f) != EOF){

		double x = (e*c-b*f)/(e*a-b*d);
		if(e*c == b*f)
			x = 0;
	
		printf("%.3f %.3f\n", x, (c-a*x)/b);
	
	
	
	}

}

Measured memory_bytes: 1236
import java.util.Scanner;

class Main {

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

    void compute() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int K = sc.nextInt();
        int sum = 0;
        for (int i = 0; i < N; i++) {
            int xi = sc.nextInt();
            sum += xi < K - xi ? xi : K - xi;
        }
        System.out.println(sum * 2);
    }
}


Measured memory_bytes: 24020
#include<bits/stdc++.h>
using namespace std;
char a[1005],b[1005];
int main()
{
	cin>>(a+1)>>(b+1);
	int n=strlen(a+1),m=strlen(b+1);
	int ans=2147483647;
	for(int i=1;i+m-1<=n;++i)
	{
		int tmp=0;
		for(int j=1;j<=m;++j)if(b[j]!=a[i+j-1])++tmp;
		ans=min(ans,tmp);
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3760
import java.io.*;

public class Main {

	final static long MOD = 1000000007;
	public static void main(String[] args) throws Exception {
		// TODO 自動生成されたメソッド・スタブ

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String W = in.readLine();
		String[] Ws = W.split(" ");
		int H = Integer.parseInt(Ws[0]);
		int A = Integer.parseInt(Ws[1]);
		System.out.println((H+A-1)/A);
	}
}


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

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  int n, k;
  while (cin >> n >> k) {
    using P = pair<lli, lli>;

    vector<P> v(n);
    cin >> v;
    each (i, v) swap(i.first, i.second);
    sort(begin(v), end(v));
    reverse(begin(v), end(v));

    lli mx = 0;
    lli sum = 0;

    stack<P> a;
    stack<P> b;
    set<lli> vis;
    for (int i = 0; i < v.size(); ++i) {
      if (vis.count(v[i].second)) {
        b.push(v[i]);
      } else {
        a.push(v[i]);
        vis.insert(v[i].second);
      }
      sum += v[i].first;
      if (k < a.size() + b.size()) {
        if (b.size()) {
          P j = b.top();
          b.pop();
          sum -= j.first;
        } else {
          P j = a.top();
          a.pop();
          sum -= j.first;
          vis.erase(j.second);
        }
      }
      lli y = vis.size();
      setmax<lli>(mx, sum + y * y);
    }
    cout << mx << endl;
  }

  return 0;
}


Measured memory_bytes: 6400
#include<cstdio>
#include<cstring>
using namespace std;
int main()
{
	char s[101];
	int n,i,flg;
	scanf("%s",s);
	// printf("%s\n",s);
	n=strlen(s);
	flg=0;
	for(i=0;i<n;i++){
		// printf("i=%d s=%c\n",i,s[i]);
		if(i%2!=0){
			if(s[i]=='L'||s[i]=='U'||s[i]=='D')	flg=1;
			else	flg=0;
		}
		else{
			if(s[i]=='R'||s[i]=='U'||s[i]=='D')	flg=1;
			else	flg=0;
		}
		// printf("flg=%d\n",flg);
		if(flg==0)	break;
	}
	if(flg==0)	printf("No\n");
	else	printf("Yes\n");
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#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 ALL(v) v.begin(), v.end()
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
using namespace std;
typedef long long ll;

int main(){
    double n,k;
    cin >> n >> k;
    if (n<=k){
        cout << '0' << endl;
     return 0;//n<=kの場合を弾く
}
else{
    vector <int> h(n);
    //cout << "Start" << endl;
    REP(i,n) {
    cin >> h[i];
   // cout << h[i] << endl;
    }
    //cout << "Sortting...." << endl;

    sort(h.rbegin(),h.rend());//降順にソート
   /* REP(i,n) {
    cout << h[i] << endl;
    }*/
    //cout << "Sort Complete" << endl;
    ll sum =0 ;
    FOR(i,k,n){
        sum += h[i];
        //cout << sum << endl;
    }

    cout << sum<<endl;
    return 0;
}

    


}

Measured memory_bytes: 1024
#include <stdio.h>

const int MOD = 1e9 + 7;

void selfAdd(int &a, int b) {
  a += b;
  if (a >= MOD)
    a -= MOD;
}

int main() {
  int n;
  scanf("%d", &n);
  int isCompatible[n][n];
  for (int i = 0; i < n; i++)
    for (int j = 0; j < n; j++)
      scanf("%d", &isCompatible[i][j]);
  int Pairings[1 << n];
  for (int wSet = 0; wSet < (1 << n); wSet++)
    Pairings[wSet] = 0;
  Pairings[0] = 1;
  for (int wSet = 0; wSet < (1 << n); wSet++) {
    for (int w = 0; w < n; w++) {
      if (!(wSet & (1 << w))) {
        int m = __builtin_popcount(wSet); // number of bits of wSet
        if (isCompatible[m][w]) {
          selfAdd(Pairings[wSet | (1 << w)], Pairings[wSet]);
        }
      }
    }
  }
  int answer = Pairings[(1 << n) - 1];
  printf("%d", answer);
  return 0;
}


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

int main() {
  string s;
  cin >> s;
  for(int i = 0;i <= s.size()-1;i += 2){
    if(i != s.size()-2 && i != s.size()-1){
      cout << s.at(i);
    }
    else{
      cout << s.at(i) << endl;
    }
  }
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

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

long long check(int N, int X) {
    int bottom = X % 10;
    if (bottom == 0) {
        return 0;
    }
    int top = X;
    int max_digit = 1;
    while (top / 10 > 0) {
        top /= 10;
    }
    swap(top, bottom);
    int Ntest = N;
    while (Ntest / 10 > 0)  {
        Ntest /= 10;
        max_digit++;
    }

    long long ans = (top == bottom ? 1 : 0);
    int digit = 2;
    top *= 10;
    int ten = 1;
    while (top + bottom <= N) {

        if (digit < max_digit) ans += ten;
        else if (digit == max_digit) {
            int N0 = N / (ten * 10);
            int X0 = top / (ten * 10);
            int N1 = N % 10;
            int X1 = bottom;
            if (N0 < X0) continue;
            else if (N0 > X0) ans += ten;
            else {
                if (N1 >= X1) {
                    ans += 1 + (N - top) / 10;
                } else {
                    ans += (N - top) / 10;
                }
            }
        }
        top *= 10;
        digit++;
        ten *= 10;
    }

    return ans;
}

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

    long long ans = 0;
    for (int i = 1; i <= N; i++) {
        ans += check(N, i);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;

int n,x,y,z;

ll dp[41][1<<16];

ll mod_pow(ll x,ll n){
	ll res=1;
	while(n>0){
		if(n&1)res=res*x%MOD;
		x=x*x%MOD;
		n>>=1;
	}
	return res;
}

int main(void){
	scanf("%d%d%d%d",&n,&x,&y,&z);
	dp[0][0]=1;
	for(int i=0;i<n;i++){
		for(int j=0;j<(1<<(x+y+z-1));j++){
			if(dp[i][j]>0){
				vector<int> v;
				int g=j,c=1;
				while(g>0){
					if(g&1){
						v.push_back(c);
						c=1;
					}else c++;
					g>>=1;
				}
				for(int k=1;k<=10;k++){
					int type=3,sum=0;
					sum+=k;
					if(sum==z)type=2,sum=0;
					for(int l=0;l<v.size();l++){
						sum+=v[l];
						if(sum==z && type==3)type=2,sum=0;
						if(sum==y && type==2)type=1,sum=0;
						if(sum==x && type==1)type=0,sum=0;
					}
					if(type==0)continue;
					int shiftbit=j<<k;
					int plusbit=1<<(k-1);
					dp[i+1][(shiftbit+plusbit)%(1<<(x+y+z-1))]=(dp[i+1][(shiftbit+plusbit)%(1<<(x+y+z-1))]+dp[i][j])%MOD;
				}
				v.clear();
			}
		}
	}
	ll res=0;
	for(int i=0;i<(1<<(x+y+z-1));i++){
		res=(res+dp[n][i])%MOD;
	}
	ll all=mod_pow(10,n);
	printf("%lld\n",(all-res+MOD)%MOD);
	return 0;
}

Measured memory_bytes: 19200
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<utility>
#include<vector>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<time.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
const double PI=acos(-1);
const double EPS=1e-10;
using namespace std;
typedef long long ll;
typedef vector<int> vi;
int main(){
	string s;
	getline(cin,s);
	rep(i,s.size()-4){
		string q=s.substr(i,5);
		if(q=="apple")s.replace(i,5,"peach");
		else if(q=="peach")s.replace(i,5,"apple");
	}
	cout<<s<<endl;
}

Measured memory_bytes: 1184
#pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << "\n";
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << " ";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define dl double
#define wh while
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tp tuple
#define ft first
#define sc second
#define ve vector
#define tos to_string
#define len length
#define rt return 0
#define br break
#define con continue
#define lcm(n, m) (n * m / gcd(n, m))
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define repill(i, m, n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define repll(i, n) repill(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m);i>(int)(n);i--)
#define rev(i, m) revi(i, m, 0)
#define revill(i, m, n) for(ll i=(ll)(m);i>(ll)(n);i--)
#define revll(i, n) revill(i, 0, n)
#define sz(v) ((int)(v).size()) 
#define each(i, n) for(auto&& i: n)
#define all(n) (n.begin(), n.end())
#define allr(n) (n.rbegin(), n.rend())
#define sp(n) cout << fixed << setprecision(n)
#pragma endregion
// sqrt ルート, int 2*10^9, gcd　最大公約数
// __builtin_popcount bitの個数

int main() {
  int K, S;
  ci(K, S);
  int c = 0;
  rep(i, K + 1){
    rep(j, K + 1){
      if(S >= i + j && i + j >= S - K){
        c++;
      }
    }
  }
  co(c);
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define full(a) a.begin(),a.end()
#define rfull(a) a.rbegin(),a.rend()

using namespace std;
const double pi=acos(-1.0);
const double pii=2*pi;
const double eps=1e-6;
const long long MOD=1e9+7;

void solve(){
	long long n,a,b;
	cin>>n>>a>>b;
	if((b-a)%2==0){
		cout<<(b-a)/2<<"\n";
	}
	else{
		long long ans=min(b-1,n-a);
		long long curra=a,currb=b;
		ans=min(ans,a+((b-a-1)/2));
		ans=min(ans,n-b+((b-a+1)/2));
		cout<<ans<<"\n";
	}
}

int main(){
	std::ios::sync_with_stdio(false);
	std::cin.tie(NULL);
	std::cout.tie(NULL);

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

Measured memory_bytes: 256
#include <algorithm>
    #include <bits/stdc++.h>
    #include <cctype>
    #include <cmath>
    #include <cstdio>
    #include <iomanip>
    #include <iostream>
    #include <list>

    #include <stack>
    #include <string>
    #include <vector>
    #include <bits/stdc++.h>
    #define INFINI (1000 * 1000 * 1000)

    using namespace std;
    //#define s(T) scanf("%d", &T)
    #define sl(T) scanf("%lld", &T)
    #define fill(a, val) memset(a, val, sizeof(a))
    #define mp make_pair
    #define pb push_back
    #define all(x) x.begin(), x.end()
    #define DREP(x) sort(all(x)); x.erase(unique(all(x)), x.end())
    #define INDEX(a, val) (lower_bound(all(a), val) - a.begin())

    typedef long long ll;


    bool compare_first(pair<int,int>a,pair<int,int >b)
    {
        return a.first<b.first;
    }

     bool compare_second(pair<int,pair<int , int> > a,pair<int,pair<int , int> > b)
    {
        return a.second.first<b.second.first;
    }


    ll min(ll a,ll b)
    {
        if(a>b)return b;
        return a;
    }
     ll max(ll a,ll b)
    {
        if(a>b)return a;
        return b;
    }

    ll toINT(string s)
    {
        ll a=0;
        for(ll index=0;index<s.size();index++)
            a=a*10+(s[index]-'0');
        return a;
    }


    int main(){



int n;
cin>>n;

if(n<=81)
{
    for(int index=1;index<10;index++)
        if(n%index==0&&n/index<10)
    {
        cout<<"Yes"<<endl;
        return 0;
    }
     cout<<"No"<<endl;
}
else
    cout<<"No"<<endl;


    return 0 ;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main()
{
  int n;
  cin >> n;
  vector<int> h(n);
  REP(i,n) cin >> h[i];
  vector<int> imos(n);
  imos[0] = h[0];
  FOR(i,1,n) imos[i] = h[i] - h[i-1];
  int ans = 0;
  REP(i,n){
    if(imos[i]>0) ans += imos[i];
  }
  cout << ans << '\n';
  return 0;
}


Measured memory_bytes: 256
package main

import "fmt"

var p = []int{11, 31, 41, 61, 71, 101, 131, 151, 181, 191, 211, 241, 251, 271, 281, 311, 331, 401, 421, 431, 461, 491, 521, 541, 571, 601, 631, 641, 661, 691, 701, 751, 761, 811, 821, 881, 911, 941, 971, 991, 1021, 1031, 1051, 1061, 1091, 1151, 1171, 1181, 1201, 1231, 1291, 1301, 1321, 1361, 1381}

func main() {
        var n int
        fmt.Scan(&n)
        fmt.Printf("%d", p[0])
        for i := 1; i < n; i++ {
                fmt.Printf(" %d", p[i])
        }
        fmt.Printf("\n")
}

Measured memory_bytes: 512
//Created by Kira

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

#define IOS cin.sync_with_stdio(0);cin.tie(0); cout.tie(0);
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define pii pair<int,int> 
#define pb push_back
#define vi vector<int> 
using ll = long long;

const int mod = 1e9 + 7;

ll pwr(ll a, ll b);
   



int main(){
   IOS

   int n; cin>>n;

   vector<int> f(n + 1);

   for(int x = 1; x <= 100; x++){
      for(int y = 1; y <= 100; y++){
         for(int z = 1; z <= 100; z++){
            int val = x*x + y * y + z * z + x * y + y * z + z * x;
            if(val <= n){
               f[val]++;
            }
         }
      }
   }

   for(int i = 1; i <= n; i++){
      cout<<f[i]<<"\n";
   }







}

ll pwr(ll a, ll b){
   a %= mod;	//Remove mod if not required
   ll res = 1;
   while(b > 0){
   if(b&1) res = res * a % mod;
        a = a * a % mod;
   b >>= 1;
    }

    return res;
}



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

using namespace std;

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

int main(){
	int n;
	ll p[100000];

	cin >> n;
	for(int i=0;i<n;i++) cin >> p[i];
	sort(p,p+n);

	p[n-1] /= 2;

	ll ans = 0;
	for (int i = 0; i < n; i++){
		ans += p[i];
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll inf = 1e18;
const int ms = 2e5+10;
ll n, dp[ms];
vector<pair<int, int>> v;

int main(){
	ios::sync_with_stdio(0), cin.tie(0);
	cin >> n;
	v.assign(n, {0, 0});
	memset(dp, 0x3f, sizeof dp);
	for(int i = 0; i < n; i++)
		cin >> v[i].first >> v[i].second;


	sort(v.begin(), v.end(), [&](pair<int, int> a, pair<int, int> b){
		return a.first + a.second < b.first + b.second;
	});

	dp[0] = 0;
	for(int i = 0; i < n; i++)
		for(int j = i; j >= 0; j--){
			if(v[i].first >= dp[j])
				dp[j+1] = min(dp[j]+v[i].second, dp[j+1]);
		}

	int ans = 0;
	for(int i = 1; i <= n; i++){
		if(dp[i] < inf)
			ans = i;
	}

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

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

int main(){
  std::string O, E;
  std::cin >> O >> E;
  for(int i = 0; i < E.size(); i++){
    std::cout << O.at(i) << E.at(i);
  }
  if(O.size() > E.size()) std::cout << O.at(O.size() - 1) << std::endl;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String S = sc.next();

		int ans = 0;

		int a = 0;

		for(int i=0;i<S.length();i++) {

			char c = S.charAt(i);

			if(c=='A' || c=='C' || c=='G'|| c=='T') {

				a++;

				if(a>ans) ans = a;

			}else {

				a = 0;

			}

		}

		System.out.println(ans);

	}

}


Measured memory_bytes: 23380
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atc_0030
{
    class Program
    {
        static void Main(string[] args)
        {
            var b = Console.ReadLine();

            string result = "";

            if (b == "A")
            {
                result = "T";
            }
            else if (b == "T")
            {
                result = "A";
            }
            else if (b == "G")
            {
                result = "C";
            }
            else if (b == "C")
            {
                result = "G";
            }

            Console.WriteLine(result);

        }
    }
}


Measured memory_bytes: 25680
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i,n) for (int i = 0; i < (n); ++i)
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main(){
    long long int  n,k, temp=0;
    cin >> n >> k;

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

    if(n>k) n = n%k;
    if(n==0){
        cout << 0 << endl;
        return 0;
    }    

    while(1){
        temp = abs(n-k);
        if(temp >= n) break;
        n = temp;
    }
    cout << n << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(a,b,c) for(int a=b;a<=c;a++)
#define per(a,b,c) for(int a=b;a>=c;a--)
#define pb push_back
using namespace std;
typedef long long ll;
typedef double db;
const int inf = 0x3f3f3f3f;
const int mod = 998244353;
const int N = 2e5 + 5;
int n, m, k;
int a[N];

int main(){
    scanf("%d", &n);
    printf("%d\n",n*n);
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


struct Precision{
  Precision(){
    cout<<fixed<<setprecision(12);
  }
}precision_beet;

//INSERT ABOVE HERE
signed main(){
  int n;
  cin>>n;
  int odd=0;
  for(int i=1;i<=n;i++) if(i&1) odd++;
  cout<<(double)odd/n<<endl;
  return 0;
}


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

vector<ll> a;
ll n,x,y;
bool isOK(ll key){
  ll cnt=0;
  for(int i=0;i<(int)a.size();i++){
    ll remain = a[i]-key*y;
    cnt+=max(0ll,(remain+x-y-1)/(x-y));
  }
  if(cnt<=key)return true;
  else return false;
}

ll binary_search(){
  ll ng = 0;
  ll ok = 1e10;
  //okとngの初期値によって最大値だけでなく最小値も求められる.
  //ng=-1の時はkey以上の数値の最小値

  while(abs(ok - ng) > 1){
    ll mid = (ok + ng) / 2;

    if(isOK(mid)) ok = mid;
    else ng = mid;
  }

  return ok;
}

int main(){
  ll i,j,k,ret;
  cin >> n >> x >> y;
  a.resize(n);
  for(i=0;i<n;i++)cin >> a[i];
  ret = binary_search();
  cout << ret << endl;
  return 0;
}


Measured memory_bytes: 1152
A=int(input())
B=int(input())
C=int(input())
D=int(input())
E=int(input())

l=[A,B,C,D,E]
tot = 0
for i in l:
  tot+=-(-i//10)*10
  
a=max(map(lambda x: -(-x//10)*10-x, l))

print(tot-a)

Measured memory_bytes: 9116
import java.util.*

fun main(args: Array<String>) {

    val sc = Scanner(System.`in`)
    val S = sc.next()
    var red = 0
    var blue= 0
    for (c in S) {
        when (c - '0') {
           0->red++
           1->blue++
        }
    }
    println(2*Math.min(red,blue))
}

Measured memory_bytes: 34224
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;

int main(void) {
    ll n;
    cin>>n;
    ll a[n];
    ll cnt4=0,cntodd=0;
    rep(i,n)cin>>a[i];
    rep(i,n){
        if(a[i]%2)cntodd++;
        else if(a[i]%4==0)cnt4++;
    }
    if(cntodd<=cnt4||cntodd==cnt4+1&&cntodd+cnt4==n)cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 1024
#include <iostream>
#include <iomanip>

int main(void)
{
	int a, b;
	std::cin >> a >> b;
	std::cout
		<< a / b << " "
		<< a % b << " "
		<< std::fixed
		<< std::setprecision(5)
		<< (double)a / b << std::endl;
	return 0;
}

Measured memory_bytes: 1244
#include<bits/stdc++.h>
#define ll long long
#define fo(i,x,y) for(int i=x;i<=y;i++)
#define fd(i,x,y) for(int i=x;i>=y;i--)
using namespace std;

const int maxn=100007,maxm=maxn*2;

int n;

int tot,fi[maxn],la[maxm],va[maxm],ne[maxm];
ll Sum=0;
void add(int a,int b,int c){
	tot++;
	ne[tot]=fi[a];
	la[tot]=b;
	va[tot]=c;
	fi[a]=tot;
}

void Init(){
	scanf("%d",&n);
	fo(i,1,n-1){
		int x,y,z;
		scanf("%d%d%d",&x,&y,&z);
		add(x,y,z);
		add(y,x,z);
	}
}

int b[maxn],fa[maxn],Size[maxn];
ll Deep[maxn];
void Bfs(int v){
	fa[b[b[0]=1]=v]=0;
	Deep[v]=0;
	fo(i,1,b[0]){
		int v=b[i];
		Sum+=Deep[v]*2;
		Size[v]=1;
		for(int k=fi[v];k;k=ne[k])
			if (la[k]!=fa[v]){
				fa[la[k]]=v;
				Deep[la[k]]=Deep[v]+va[k];
				b[++b[0]]=la[k];
			}
	}
	fd(i,b[0],1){
		int v=b[i];
		Size[fa[v]]+=Size[v];
	}
}
int Root;
void Solve(){
	Bfs(1);
	fo(i,1,b[0]){
		int v=b[i];
		bool Bz=true;
		for(int k=fi[v];k;k=ne[k])
			if (la[k]!=fa[v])
				Bz&=Size[la[k]]<=n/2;
		if (Bz && n-Size[v]<=n/2) Root=v;
	}
	Sum=0;
	Bfs(Root);
}

void Print(){
	int Temp=2e9;
	for(int k=fi[Root];k;k=ne[k]){
		if (Size[la[k]]==(n+1)/2){
			Temp=va[k];
			break;
		}
		Temp=min(Temp,va[k]);
	}
	printf("%lld",Sum-Temp);
}

int main(){
	Init();
	Solve();
	Print();
	return 0;
}

Measured memory_bytes: 4992
#include <stdio.h>

int count = 0;

void bubble_sort(int a[], int n) {
  int flag = 1;
  int b;

  while (flag == 1) {
    flag = 0;
    for (int i = n - 1; i >= 1; i--) 
      if (a[i] < a[i - 1]) {
	b = a[i];
	a[i] = a[i - 1];
	a[i - 1] = b;
	count++;
	flag = 1;
      }
  }
}

int main(void) {
  int n;
  int a[100];

  scanf("%d", &n);

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

  bubble_sort(a, n);

  for (int i = 0; i < n; i++) {
    printf("%d", a[i]);
    if (i != n - 1)
      printf(" ");
    else if (i == n - 1)
      printf("\n");
  }
  printf("%d\n", count);
  
  return 0;
}



Measured memory_bytes: 2044
import java.io.*;
public class Main {
public static void main(String[] args)throws IOException{
BufferedReader br=
new BufferedReader(new InputStreamReader(System.in));
int a = Integer.parseInt(br.readLine());

if(a == 1){
System.out.println("Hello World");
} 
if(a == 2){
int b = Integer.parseInt(br.readLine());
int c = Integer.parseInt(br.readLine());
System.out.println(b + c);
}
}
}


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

int main()
{
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  if ((a + b) > (c + d))
  {
    cout << "Left" << endl;
  }
  else if ((a + b) == (c + d))
  {
    cout << "Balanced" << endl;
  }
  else
  {
    cout << "Right" << endl;
  }
}


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

//#define int long long
#define ll long long
#define all(v) (v).begin(), (v).end()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

int is_sum(int sum){
    int res = 0;
    while(sum > 0){
        res += sum%10;
        sum/=10;
    }
    return res;
}
signed main()
{   
    gearup;
    int n,l;cin>>n>>l;
    vector<string> s(n);
    rep(i,n)cin>>s[i];
    sort(all(s));
    rep(i,n)cout<<s[i];
    cout<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int a, b, c, d;
    int sum1=0, sum2=0;

    scanf("%d", &a);
    scanf("%d", &b);
    sum1 = a + b;
    
    scanf("%d", &c);
    scanf("%d", &d);
    sum2 = c + d;

    if(sum1 > sum2){
        printf("Left\n");
    }else if(sum2 > sum1){
        printf("Right\n");
    }else{
        printf("Balanced\n");
    }

    return 0;
}

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

int table[1010][1010];
int table2[1010][1010];
typedef long long LL;
int main() {
	int N = 1010;
	int H,W,D;
	cin >> H >> W >> D;
	char c[4] = {'R', 'G', 'B', 'Y'};
	/*
	for(int i=0; i<10; i++, cout << endl)
		for(int j=0; j<10; j++)
			cout << table[i][j] << " ";
	*/
	if(D%2 == 1)  {
		for(int i=0 ;i<H; i++, cout << endl)
			for(int j=0; j<W; j++)
				cout << c[(i+j)%2];
		
	}

	else {
		
	for(int i=0; i<1010; i++) {
		for(int j=0; j<1010; j++) {
			table[i][j] = (2*(i/D)+j/D) % 4 ;
		}
		
	}
		/*
		for(int i=0; i<10; i++, cout << endl)
		for(int j=0; j<10; j++)
			cout << table[i][j] << " ";
		*/
		
		for(int i=0; i<H; i++, cout << endl) 
			for(int j=0; j<W; j++)
				cout << c[table[500 + i - j][0 + i + j]];
		
	}
	
	
	return 0;
}

Measured memory_bytes: 6400
N = gets.to_i
A = gets.split(' ').map(&:to_i)
count = 0
while true 
  exist_odd = false
  A.each_index do |idx|
    exist_odd = true if A[idx] % 2 != 0
    A[idx] /= 2
  end
  break if exist_odd
  count += 1
end
puts count

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#include <string.h>
#include <vector>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15
#define MOD 1000000007

 int main(){

  long long n;
  cin>>n;

  vector<int>A(n+1);
  for(int i=0;i<n+1;i++)
    cin>>A[i];

  vector<int>B(n);

  for(int i=0;i<n;i++)
    cin>>B[i];

  long long ans=0;
  for(int i=0;i<n;i++)
 {
    long long tmp = min(A[i],B[i]);
    A[i] -= tmp;
    B[i] -= tmp;
    ans += tmp;
 // cout<<ans<<" ? "<<tmp<<endl;
    tmp = min(A[i+1],B[i]);
    A[i+1] -= tmp;
    B[i] -= tmp;
    ans += tmp;

    //cout<<ans<<" > "<<tmp<<endl;

  }

  cout<<ans<<endl;

 return 0;
 }


Measured memory_bytes: 3988