akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define range(i, l, r) for(int (i) = (l); (i) < (r); (i)++)
#define reversed_range(i, l, r) for (int (i) = (r) - 1; (i) >= l; (i)--)
using namespace std;
template <typename T>
using vec = vector<T>;
using lint = long long;
using ulint = unsigned long long;
using pint = pair<int, int>;
using plint = pair<lint, lint>;

template <typename S, typename T>
ostream& operator <<(ostream& os, pair<S, T> p) {
    os << "(";
    os << p.first << ", " << p.second;
    return os << ")";
}

template <typename T>
ostream& operator <<(ostream& os, vec<T> v) {
    os << "[";
    for (int i = 0; i < v.size() - 1; i++) {
        os << v.at(i) << ", ";
    }
    return os << v.at(v.size() - 1) << "]";
}

template <typename T>
ostream& operator <<(ostream& os, set<T>& s) {
    os << "{";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename T>
ostream& operator <<(ostream& os, unordered_set<T>& s) {
    os << "{";
    auto it_first_item = s.begin();
    cout << *it_first_item;
    for (auto it = ++it_first_item; it != s.end(); it++) {
        cout << ", " << *it;
    }
    return cout << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, map<K, V> m) {
    os << "{";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

template <typename K, typename V>
ostream& operator <<(ostream& os, unordered_map<K, V> m) {
    os << "{";
    auto it_first_item = m.begin();
    cout << it_first_item->first << ": " << it_first_item->second;
    for (auto it = ++it_first_item; it != m.end(); it++) {
        cout << ", " << it->first << ": " << it->second;
    }
    return os << "}";
}

int main() {
    cin.tie(0); cout.tie(0);
    ios::sync_with_stdio(false);
    lint A, B;
    cin >> A >> B;
    cout << (A + B >= 10 ? "error" : to_string(A + B)) << "\n";
}

Measured memory_bytes: 256
h,w=map(int,input().split())
a=[0]*(h+2)
a[0]='.'*(w+2)
a[h+1]=a[0]
for _ in range(1,h+1):
  j=input()
  a[_]='.'+j+'.'
x='Yes'
for i in range(1,h+1):
  for j in range(1,w+1):
    if a[i][j]=='#':
      if a[i-1][j]=='.' and a[i+1][j]=='.' and a[i][j-1]=='.' and a[i][j+1]=='.':
        x='No'
        break
print(x)

Measured memory_bytes: 3064
#include <cstdio>

int main() {
    int N;
    scanf("%d", &N);

    char buf[10];
    sprintf(buf, "%d", N);

    if((buf[0] == buf[1] && buf[1] == buf[2]
       || (buf[1] == buf[2] && buf[2] == buf[3]))) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
typedef long long ll;
int main(void){
   string n;
   cin>>n;
   ll a=0;
   rep(i,n.size()){
       a+=n[i]-'0';
   }
   if(a==0){
       cout<<"Yes"<<endl;
   }
   else if(a%9==0){
       cout<<"Yes"<<endl;
   }else{
       cout<<"No"<<endl;
   }
}


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

#define FILE
#define fr first
#define se second

using namespace std;

const long long N = 2e5 + 7;
const long long inf = 1e9 + 7;
const long long mod = 1e9 + 7;

int h;
int n;
long long sum;
int main()
{
    #ifdef FILEs
        freopen("input.txt", "r", stdin);
        /// freopen("output.txt", "w", stdout);
    #endif

    ios_base::sync_with_stdio(false);

    cin >> h >> n;
    for(int i = 1; i <= n; i ++){
        int x;
        cin >> x;
        sum += x;
    }
    if(h <= sum){
        cout << "Yes\n";
    }
    else{
        cout << "No\n";
    }
}


Measured memory_bytes: 256
#include <queue>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <sstream>

using namespace std;

typedef long long ll;

std::vector<std::string> StringSplit(const std::string &str, char sep)
{
	std::vector<std::string> v;
	std::stringstream ss(str);
	std::string buffer;
	while (std::getline(ss, buffer, sep)) {
		v.push_back(buffer);
	}
	return v;
}

int main()
{
	string S;
	cin >> S;

	string tmpS;
	ll ans = 0;

	int plus;

	for (int i = 0; i < pow(2, S.length() - 1); i++)
	{
		tmpS = S;
		plus = 0;

		if (i & 1)
		{
			tmpS.insert(1, "+");
			plus++;
		}
		if (i & 2)
		{
			tmpS.insert(2 + plus, "+");
			plus++;
		}
		if (i & 4)
		{
			tmpS.insert(3 + plus, "+");
			plus++;
		}
		if (i & 8)
		{
			tmpS.insert(4 + plus, "+");
			plus++;
		}
		if (i & 16)
		{
			tmpS.insert(5 + plus, "+");
			plus++;
		}
		if (i & 32)
		{
			tmpS.insert(6 + plus, "+");
			plus++;
		}
		if (i & 64)
		{
			tmpS.insert(7 + plus, "+");
			plus++;
		}
		if (i & 128)
		{
			tmpS.insert(8 + plus, "+");
			plus++;
		}
		if (i & 256)
		{
			tmpS.insert(9 + plus, "+");
			plus++;
		}

		vector<string> vkey = StringSplit(tmpS, '+');

		for (int j = 0; j <= plus; j++)
		{
			ans += atoll(vkey[j].c_str());
//			cout << atoi(vkey[j].c_str()) << endl;
		}
//		printf("\n");
	}

//	printf("\n");
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    double a,b;
    cin>>a>>b;
    cout<<setprecision(10)<<fixed<<(a/b)<<endl;

    return 0;
}


Measured memory_bytes: 3784
import math
n = int(input())
a = list(map(int, input().split()))
mod = 10**9 + 7

def lcm(a, b):
    return (a * b) // math.gcd(a, b)

a_lcm = 1
for i in range(n):
    a_lcm = lcm(a_lcm, a[i])

b_sum = 0
for ai in a:
    b_sum += a_lcm // ai

print(b_sum%mod)


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

int main() {
    int n, m;
    cin >> n >> m;
    vector<bool> check(n+1, 0);
    vector<set<int>> map(n+1);
    for (int i = 0; i < m; i++)
    {
        int a, b;
        cin >> a >> b;
        map[a].insert(b);
        map[b].insert(a);
    }
    vector<int>AR;
    int cnt =0;
    for (int i = 1; i <=n; i++)
    {
        AR.push_back(i);
        //cnt *=i;
    }

    do
    {
        bool F=1;
        for (int i = 0; i < n-1; i++)
        {         
                if(map[AR[i]].count(AR[i+1]));
                else
                {
                    F=0;
                    break;
                }
        }
        if(F) cnt++;
    } while (next_permutation(AR.begin()+1, AR.end()));
        
    cout << cnt << endl;
    
    return 0;
}



Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS 1

#include <stdio.h>

int main()
{
	char X, Y, P = 'A';

	while (scanf("%c,%c", &X, &Y) != EOF)
	{
		if (X == P)
		{
			P = Y;
		}
		else if (Y == P)
		{
			P = X;
		}
	}

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

	return 0;
}

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

using namespace std;
using Int = long long;

signed main(){
    Int n, x;
    cin >> n >> x;
    Int num = 1;
    Int sum = 0;
    for (Int i = 0; i < n; i++){
        Int tmp;
        cin >> tmp;
        sum += tmp;
        if (sum > x) break;
        num += 1;
    }

    cout << num << endl;
    return 0;
}

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

typedef long long int ll;
typedef pair<ll, ll> p_ll;
typedef vector<pair<ll, ll>> vec_p; //vector<pair<ll, ll>> pairs(n) ,pairs.at(i) = make_pair(i*i, i)

#define ture ture
#define flase false
#define falg flag

#define REP(i, x) for (ll i = 0; i < (ll)(x); i++)
#define REPS(i, x) for (ll i = 1; i <= (ll)(x); i++)
#define RREP(i, x) for (ll i = ((ll)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (ll i = ((ll)(x)); i > 0; i--)
#define all(x) (x).begin(), (x).end()

const ll MOD = pow(10, 9) + 7;
const ll LLINF = pow(2, 61) - 1;//llの最大9*10^18
const int INF = pow(2, 30) - 1;

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

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

    ll N;
    string S;
    cin >> N;

    vector<ll> a(1000001);
    vector<bool> vec(1000001);

    REPS(i,1000000){
        vec.at(i) = false;
    }

    a.at(1) = N;
    vec.at(a.at(1)) = true;

    for (ll i = 2; i <= 1000000; i++)
    {
        if (a.at(i - 1) % 2 == 0)
        {
            a.at(i) = a.at(i - 1) / 2;
        }
        else{
        a.at(i) = 3 * a.at(i - 1) + 1;
    }

    if(vec.at(a.at(i))==false){
        vec.at(a.at(i)) = true;
    }
    else{
        cout << i << endl;
        break;
    }
}

}


Measured memory_bytes: 8192
#include<cstdio>
#include<algorithm>
int main(){
	long long int n,m;
	scanf("%lld%lld",&n,&m);
	long long int a[n+1]={};
	for(int i=0;i<n;i++){
		scanf("%lld",&a[i]);
		if(i>0)a[i]+=a[i-1];
		a[i]=a[i]%m;
	}
	std::sort(a,a+n+1);
	long long int ans=0;
	long long int l=1;
	for(int i=1;i<=n;i++){
		if(a[i]==a[i-1]){
			l++;
		}else{
			ans+=(l*(l-1))/2;
			l=1;
		} 
	}
	ans+=(l*(l-1))/2;
	printf("%lld\n",ans);
	return 0;
}
	

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

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  if (a < b && b < c) {
      cout << "Yes" << endl;
  } else {
      cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 3084
N = int(input())
A = []
for _ in range(N):
    A.append(int(input()))
A = sorted(A)
cnt = 1
ans = 0

for i in range(N-1):
    if(A[i] == A[i+1]):
        cnt += 1
        continue
    ans += cnt % 2
    cnt = 1

if(cnt % 2 == 1):
    ans += 1

print(ans)

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

int main()
{
	int N;
	string str,res;
	cin >> N;
	for (int i = 0; i < N; i++) {
		res = "";
		cin >> str;
		char ch = 0;
		int inc = 0;
		for (int j = 0; j < str.length();j++) {
			switch (str[j]) {
			case '0':
				if (ch) {
					if (ch == '.') {
						if (inc % 5 == 0) {
							res += '.';
						}else if (inc % 5 == 1) {
							res += ',';
						}
						else if (inc % 5 == 2) {
							res += '!';
						}
						else if (inc % 5 == 3) {
							res += '?';
						}
						else if (inc % 5 == 4) {
							res += ' ';
						}
					} else if(ch == 'p' || ch == 'w')
						res += (char)(ch + (inc % 4));
					else
						res += (char)(ch + (inc % 3));
				}
				ch = 0;
				inc = 0;
				break;
			case '1':
				if (ch == '.')
					inc++;
				else
					ch = '.';
				break;
			case '2':
				if (ch == 'a')
					inc++;
				else
					ch = 'a';
				break;
			case '3':
				if (ch == 'd')
					inc++;
				else
					ch = 'd';
				break;
			case '4':
				if (ch == 'g')
					inc++;
				else
					ch = 'g';
				break;
			case '5':
				if (ch == 'j')
					inc++;
				else
					ch = 'j';
				break;
			case '6':
				if (ch == 'm')
					inc++;
				else
					ch = 'm';
				break;
			case '7':
				if (ch == 'p')
					inc++;
				else
					ch = 'p';
				break;
			case '8':
				if (ch == 't')
					inc++;
				else
					ch = 't';
				break;
			case '9':
				if (ch == 'w')
					inc++;
				else
					ch = 'w';
				break;
			}
		}
		if(ch) {
			if (ch == '.') {
				if (inc % 5 == 0) {
					res += '.';
				}
				else if (inc % 5 == 1) {
					res += ',';
				}
				else if (inc % 5 == 2) {
					res += '!';
				}
				else if (inc % 5 == 3) {
					res += '?';
				}
				else if (inc % 5 == 4) {
					res += ' ';
				}
			}
			else if (ch == 'p' || ch == 'w')
				res += (char)(ch + (inc % 4));
			else
				res += (char)(ch + (inc % 3));
		}
		cout << res << endl;
	}
	return 0;
}

Measured memory_bytes: 1208
// Problem : A - Next Alphabet
// Contest : AtCoder Beginner Contest 151
// URL : https://atcoder.jp/contests/abc151/tasks/abc151_a
// Memory Limit : 1024,000000 MB 
// Time Limit : 2000,000000 milisec 
// Powered by CP Editor (https://github.com/coder3101/cp-editor)

#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <cmath>
#include <cstdio>

#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <map>
#include <set>
#include <vector>

using namespace std;

void preambule() {
  cin.tie(0);
  cout.precision(16);
  cout << fixed;
}

char c;

void input() {
  cin >> c;
}

void solve1() {
  cout << char(c + 1);
}

int main() {
#ifdef _DEBUG
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  preambule();
  input();
  solve1();
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
string a,b;
int main()
{
cin>>a;
cin>>b;
sort(a.begin(),a.end());
sort(b.begin(),b.end());
reverse(b.begin(),b.end());
if(b>a)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
}

Measured memory_bytes: 256
///  author:Kissheart  ///
#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<string.h>
#include<vector>
#include<stdlib.h>
#include<math.h>
#include<queue>
#include<deque>
#include<ctype.h>
#include<map>
#include<set>
#include<stack>
#include<string>
#define INF 0x3f3f3f3f
#define FAST_IO ios::sync_with_stdio(false)
const double PI = acos(-1.0);
const double eps = 1e-6;
const int MAX=1e5+10;
const int mod=1e9+7;
typedef long long ll;
using namespace std;
#define gcd(a,b) __gcd(a,b)
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline ll qpow(ll a,ll b){ll r=1,t=a; while(b){if(b&1)r=(r*t)%mod;b>>=1;t=(t*t)%mod;}return r;}
inline ll inv1(ll b){return qpow(b,mod-2);}
inline ll exgcd(ll a,ll b,ll &x,ll &y){if(!b){x=1;y=0;return a;}ll r=exgcd(b,a%b,y,x);y-=(a/b)*x;return r;}
inline ll read(){ll x=0,f=1;char c=getchar();for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;for(;isdigit(c);c=getchar()) x=x*10+c-'0';return x*f;}
//freopen( "in.txt" , "r" , stdin );
//freopen( "data.txt" , "w" , stdout );
ll n,sum,sumc;
ll b[MAX],a[MAX];
ll c[MAX],cha[MAX];
int main()
{
    scanf("%lld",&n);
    for(ll i=1;i<=n;i++)
    {
        scanf("%lld",&a[i]);
        sum+=a[i];
    }
    for(ll i=1;i<=n;i++)
    {
        scanf("%lld",&b[i]);
        c[i]=b[i];
        sumc+=b[i];
    }

    ll t=sum-sumc;
    ll ans=0;
    if(t<0)
        printf("-1\n");
    else
    {

        for(ll i=1;i<=n;i++)
            cha[i]=c[i]-a[i];

        sort(cha+1,cha+1+n);


        ll num=1;
        while(cha[num]<=0 && num<=n) num++;
        num--;

        /*printf("%lld\n",num);
        printf("%lld\n",t);
        for(int i=1;i<=n;i++)
            printf("%d ",cha[i]);
        printf("\n");*/

        for(ll i=num;i>=1;i--)
        {
            if(cha[i]<0)
            {
                if(t+cha[i]>=0)
                {
                    t+=cha[i];
                    ans++;
                }
            }
            else if(cha[i]==0)
                ans++;
            else
                break;
        }
        if(n-ans==0 && t>0) printf("1\n");
        else printf("%d\n",n-ans);
    }
    return 0;
}


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

main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

    int h1, m1, h2, m2, k;
    while(cin>>h1>>m1>>h2>>m2>>k){
        cout<<(h2-h1)*60 - m1 + m2 - k<<endl;
    }

}


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

template<typename T, typename U>
using pv=vector<pair<T,U>>;
template<typename T>
using matrix=vector<vector<T>>;
template<typename T>
using pque=priority_queue<T>;
template<typename T>
using lpque=priority_queue<T,vector<T>,greater<T>>;

using ll=long long;
using intpair=pair<int,int>;
using llpair=pair<ll,ll>;
using ilpair=pair<int,ll>;
using lipair=pair<ll,int>;
using intvec=vector<int>;
using llvec=vector<ll>;
using intq=queue<int>;
using llq=queue<ll>;
using intmat=vector<intvec>;
using llmat=vector<llvec>;

#define PI 3.141592653589793
#define INTINF ((1<<30)-1)
#define LLINF ((1LL<<62)-1)
#define MPRIME 1000000007
#define MPRIME9 998244353
#define MMPRIME ((1ll<<61)-1)

#define len length()
#define pushb push_back
#define fi first
#define se second

#define setpr fixed<<setprecision(15)
#define all(name) name.begin(),name.end()
#define rall(name) name.rbegin(),name.rend()
#define gsort(vbeg,vend) sort(vbeg,vend,greater<>())

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>
inline void init(T& v) {
	for(auto &a: v) cin>>a;
}
template<class T, class U>
inline void init(vector<pair<T,U>>& v) {
	for(auto &a: v) cin>>a.first>>a.second;
}
template<class T, class N>
inline void init(T& v, N n) {
	v.resize(n);
	for(auto &a: v) cin>>a;
}
template<class T, class U, class N>
inline void init(vector<pair<T,U>>& v, N n) {
	v.resize(n);
	for(auto &a: v) cin>>a.first>>a.second;
}

inline void out() {
	cout<<endl;
}
template<class T, class... U>
inline void out(T a, U... alist) {
	cout<<a<<" ";
	out(forward<U>(alist)...);
}

template<class N>
void resiz(N n) {
	//empty
}
template<class N, class T, class... U>
void resiz(N n, T&& hd, U&&... tl) {
	hd.resize(n);
	resiz(n,forward<U>(tl)...);
}

bool isout(int h, int w, int H, int W) {
	return ( h<0 || h>=H || w<0 || w>=W );
}

ll binpow(ll a, ll ex, ll p) {
	ll result=1;
	while(ex>0) {
		if(ex&1) result=result*a%p;
		ex>>=1;
		a=a*a%p;
	}
	return result;
}


ll N,M,D;
double ans;

void input() {
	cin>>N>>M>>D;
}

void solve() {
	ans = double((N-D)*2)/(N*N)*(M-1);
	if(D==0) ans/=2;
	cout<<ans<<endl;
}

int main() {
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout<<fixed<<setprecision(15);
	int t=1;
	while(t) {
		input();
		solve();
		t--;
	}
}


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

#define IOS ios::sync_with_stdio(0); cin.sync_with_stdio(0); cout.tie(0);
#define Bye return 0
const int MAX = 1e6+1;
#define int long long

int maxSum(int n, int w, int weight[], int values[]){
    int mat[n+1][w+1];

    for (int i=0; i<=n; i++)
        for (int j=0; j<=w; j++){
            if(i==0 || j==0) mat[i][j] = 0;
            else if(j<weight[i]) mat[i][j] = mat[i-1][j];
            else mat[i][j] = max(mat[i-1][j-weight[i]] + values[i], mat[i-1][j]);
        }

    return mat[n][w];
}

void solve(){
    int n, w; cin>>n>>w;

    int weight[n+1], values[n+1];
    for (int i=1; i<=n; i++)
        cin>>weight[i]>>values[i];

    cout<<maxSum(n, w, weight, values)<<endl;
}

int32_t main()
{
    IOS;
    solve();
    Bye;
}


Measured memory_bytes: 82408
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18;
const int MOD = 1e9 + 7;

int main() {
    int A, B;
    cin >> A >> B;
    cout << (A - 1) * (B - 1) << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Scanner;

class Main{

	public static void main(String[] args) {




		Scanner scan = new Scanner(System.in);
		int H = scan.nextInt();
		int W = scan.nextInt();
		String[] s = new String[H];
		boolean[] x = new boolean[W];
		boolean[] y = new boolean[H];

		Arrays.fill(x, false);
		Arrays.fill(y, false);

		


		for(int i= 0;i < H;i++){
			s[i] = scan.next();
		}

		for(int i= 0;i <H;i++){
			for(int j=0;j < W;j++){
				if(s[i].charAt(j) == '#'){
					x[j] = true;
					y[i] = true;
				}
			}
		}
		
	


		for(int i= 0;i <H;i++){
			if(y[i]){
				for(int j=0;j < W;j++){
					if(x[j]){
						System.out.print(s[i].charAt(j));
					}
				}
				System.out.println();
			}
		}




	}



}


Measured memory_bytes: 28472
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <math.h>
#include <stdio.h>
#define INF 1000000000
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
typedef long long int ll;
using namespace std;

int main() {

	string s; cin >> s;
	for (int i = 0; i < s.size(); i++) {
		cout << "x";
	}
	cout << endl;
	return 0;
}

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

typedef long long ll;
const ll MOD = 1000000007;

ll N, K;
vector<vector<int>> G;

ll dfs(int u, int parent) {
    ll numOfColors = (parent == -1) ? K - 1 : K - 2;

    if (G[u].size() > K) {
        return 0;
    } else {
        ll res = 1;
        for (int v : G[u]) {
            if (v == parent) continue;

            res *= numOfColors;
            res %= MOD;
            numOfColors--;
        }

        for (int v : G[u]) {
            if (v == parent) continue;

            res *= dfs(v, u);
            res %= MOD;
        }

        return res;
    }
}

int main() {
    cin >> N >> K;
    G.resize(N);
    for (int i = 0; i < N - 1; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }

    ll res = K * dfs(0, -1);
    res %= MOD;

    cout << res << endl;
    return 0;
}

Measured memory_bytes: 10368
#include <bits/stdc++.h>
// until dimension reduction.

using namespace std;
typedef long long LL;

#define LOG(...) fprintf (stderr, __VA_ARGS__)
#define pb push_back
#define mp make_pair
#define SZ(x) ((int)(x).size())
#define ALL(x) (x).begin(), (x).end()

const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fll;

const int N = 200005, M = 1000005, m = 1000000, MOD = 998244353; 
int n, a[N], cnt[M], iv[M], mu[M], prime[M], cc, sm[M];
bool np[M];

void linear_sieve() {
    mu[1] = np[1] = 1; 
    for (int i = 2; i <= m; i++) {
        if (!np[i]) prime[++cc] = i, mu[i] = -1;
        for (int j = 1; j <= cc && i * prime[j] <= m;j++) {
            np[i * prime[j]] = 1;
            if (i % prime[j]) mu[i * prime[j]] = -mu[i];
            else {
                mu[i * prime[j]] = 0;
                break;
            }
        }
    }
}
namespace Modulo {
    int inv(int x) {int b = MOD - 2, res = 1;while (b) {if (b & 1) res = 1LL * res * x % MOD;x = 1ll * x * x % MOD;b >>= 1;}return res; }
    int add(int a, int b) {a += b;while (a >= MOD) a -= MOD; while (a < 0) a += MOD; return a; }
    int mns(int a, int b) {a += MOD;a -= b;while (a >= MOD) a -= MOD;return a; }
    int mul(int a, int b) {return 1ll * a * b % MOD;}
    int divi(int a, int b) {return 1ll * a * iv[b] % MOD;}
}
using namespace Modulo; 
signed main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]), ++cnt[a[i]];
    iv[1] = 1; 
    for (int i = 2; i <= m; i++) iv[i] = 1LL * (MOD - MOD / i) * iv[MOD % i] %MOD;
    for (int i = 1; i <= m; i++)
        for (int j = i; j <= m; j += i)
            sm[i] = add(sm[i], 1ll * cnt[j] * j % MOD);
    linear_sieve(); 
    int tt = 0; 
    for (int d = 1; d <= m; d++) {
        int ans = 0; 
        for (int g = 1; g <= m / d; g++) {
            if (mu[g] == 0) continue;
            if (mu[g] == 1) ans = add(ans, 1ll * (1ll * sm[g * d] * sm[g * d] % MOD) % MOD);
            else ans = mns(ans, 1ll * (1ll * sm[g * d] * sm[g * d] % MOD) % MOD);
        }
        tt = add(tt, divi(ans, d));
    }

    for (int i = 1; i <= n; i++) tt = mns(tt, a[i]);
    tt = 1ll * tt * iv[2] % MOD;
    cout << tt << endl; 
    return 0;
}


Measured memory_bytes: 19456
#include <bits/stdc++.h>
using namespace std;
int main() {
	int n;
	cin >> n;
	set<int> mochi;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		mochi.insert(a);
	}
	cout << mochi.size() << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <utility>
#include <cmath>
#include <functional>
#include <queue>
//#include <stack>
#include <climits>
#include <map>
#define REP(i,n) for(ll i=0;i<n;i++)
#define FOR(i,n1,n2) for(ll i=n1;i<n2;i++)
#define put(a) cout<<a<<endl;
#define all(a)  (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
using namespace std;
typedef long long ll;
//typedef unsigned long long ull;
typedef pair<int, int> P;

int n;
int a[300001];
ll fsum[100005];
ll ssum[100005];

int main(){
    cin >> n;
    priority_queue<int,vector<int>,greater<int>> fpq;
    priority_queue<int> spq;
    REP(i,n*3){
        cin >> a[i];
    }
    REP(i,n){
        fpq.push(a[i]);
        fsum[0] += a[i];
    }
    REP(i,n+1){
        fpq.push(a[i+n]);
        fsum[i+1]=fsum[i]+a[i+n];
        fsum[i+1]-=fpq.top();
        fpq.pop();
    }
    
    REP(i,n){
        spq.push(a[n*3-1-i]);
        ssum[n] += a[n*3-1-i];
    }
    REP(i,n+1){
        spq.push(a[n*2-1-i]);
        ssum[n-1-i]=ssum[n-i]+a[n*2-1-i];
        ssum[n-1-i]-=spq.top();
        spq.pop();
    }
    ll res = LLONG_MIN;
    REP(i,n+1){
        res = max(res,fsum[i]-ssum[i]);
    }
    put(res);
    return 0;
}




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

const int N = 200005;

int n;
pair<int,int> a[N];	
int res[N];

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

	cin >> n;
	for (int i = 1; i <= n; ++i) {
		cin >> a[i].first;
		a[i].second = i;
	}
	sort(a + 1, a + n + 1);

	for (int i = 1; i <= n; ++i) {
		if (i <= n / 2) {
			res[a[i].second] = a[n / 2 + 1].first;
		} else {
			res[a[i].second] = a[n / 2].first;
		}
	}

	for (int i = 1; i <= n; ++i) {
		printf("%d\n", res[i]);
	}
}

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

int main()
{
    int n;
    scanf("%d", &n);

    int cnt = 0, x;
    for(int i = 1; i <= n; i++){
        x = log10(i);
        if(x % 2 == 0) cnt++;
    }
    printf("%d\n", cnt);
}


Measured memory_bytes: 640
#/*
    AUTHOR:shivam51
    IIESTS
*/
  #include<bits/stdc++.h>
  using namespace std;
  //
  #define add	 	accumulate
  #define ll 	 	long long int
  #define ff	 	first
  #define ss 	 	second
  #define pb 	 	push_back
  #define pob		pop_back
  #define pf 	 	push_front
  #define pof		pop_front
  #define mp 	 	make_pair
  #define vll 	 	vector<ll>
  #define lb 	 	lower_bound
  #define ub     		upper_bound
  #define pll 	 	pair<ll,ll>
  #define vpll   		vector<pll>
  #define all(v) 		v.begin(), v.end()
  #define llmax		numeric_limits<ll>::max()
  #define rep(i,k,n)    for(int i=k;i<n;i++)
  #define hs            ios_base::sync_with_stdio(false);cin.tie(NULL);
  template <class C> void setmin(C &a,C b){if(a>b)a=b;}
  template <class C> void setmax(C &a,C b){if(a<b)a=b;}
  const ll mod=1e9+7;
  const ll MAX=20000000000;
  //
  //
  	void solve(){
  		ll n,m,A,B;
  		cin>>n>>m>>A>>B;
  		if(A>(m/2)||B>(n/2)){
  			cout<<-1;
  			return ;
  		}

  		rep(i,0,(n-B)){
  			rep(j,0,A)
  				cout<<"1";
  			rep(j,A,m){
  				cout<<"0";
  			}
  			cout<<'\n';
  		}
  		rep(i,n-B,n){
  			rep(j,0,A)
  				cout<<"0";
  			rep(j,A,m){
  				cout<<"1";
  			}
  			cout<<'\n';
  		}
  	}
	int main(){ 
		hs;
		ll t;
		// cin>>t;
		t=1;
		while(t--)
			solve();
    return 0; 
} 	

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

vector<vector<int>> G;
vector<long long> ans;

void dfs(int current, int parent) {
  if (parent != -1) ans.at(current) += ans.at(parent);
  for (int next : G.at(current)) {
    if (next == parent) continue;
    dfs(next, current);
  }
}

int main() {
  int N, Q; cin >> N >> Q;
  G.resize(N);
  ans.resize(N);
  for (int i = 0; i < N-1; i++) {
    int a, b; cin >> a >> b;
    a--; b--;
    G.at(a).push_back(b);
    G.at(b).push_back(a);
  }
  for (int i = 0; i < Q; i++) {
    int p; cin >> p;
    long long x; cin >> x;
    p--;
    ans.at(p) += x;
  }
  dfs(0, -1);
  for (int i = 0; i < N-1; i++) cout << ans.at(i) << " ";
  cout << ans.at(N-1) << endl;
}

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

int main(void){
	char words[10000],i;
	
	scanf("%[^\n]",words);
	getchar();
	
	i=0;
	while(words[i] != '\0'){
		if(words[i] >= 'a' && words[i] <= 'z'){
			words[i] = toupper(words[i]);
		}
		i++;
	}
	
	printf("%s\n",words);
	
	return 0;
}

Measured memory_bytes: 532
#define _USE_MATH_DEFINES

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>

using namespace std;

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

long long int INF = 1e18;
long long int MOD = 1e9 + 7;

int N;

long long int A[210000];
long long int cnt[210000];

bool check(long long int minA){
	
	for(int i = 0; i < N; i++){
		cnt[i] = minA;
	}
	
	int cur = 1;
	int pre = 0;
	int from = 0;
	
	for(int i = 0; i < N; i++){
		int pos;
		if(pre == A[i]){
			cnt[A[i]] -= 1;
			pos = A[i];
		}else if(pre < A[i]){
			cnt[A[i]] = minA;
			from = pre + 1;
			pos = A[i];
		}else{
			cnt[A[i]] -= 1;
			pos = A[i];
		}
		while(cnt[pos] == 0){
			if(pos == 0 || minA == 1){
				return false;
			}
			if(from <= pos - 1){
				cnt[pos - 1] = minA;
			}
			cnt[pos - 1] -= 1;
			cnt[pos] = minA;
			pos -= 1;
		}
		if(pos == 0){
			return false;
		}
		pre = A[i];
	}
	
	return true;
}

long long int bin_search(long long int lef, long long int rig){
	long long int middle = (lef + rig) / 2;
	//cout << middle << " ";
	if(rig - lef <= 1){
		if(check(lef)){
			return lef;
		}else{
			return rig;
		}
	}
	if(check(middle)){
		rig = middle;
	}else{
		lef = middle;
	}
	return bin_search(lef, rig);
}

int main(){
	
	cin >> N;
	
	for(int i = 0; i < N; i++){
		cin >> A[i];
		A[i] = min(A[i], 200000LL);
	}
	
	cout << bin_search(1, N) << endl;
	
	return 0;
}


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

int main(){
    int N,K,ans=0;
    cin>>N>>K;
    vector<int> a(N);
    for(int i=0;i<N;i++){
        cin>>a.at(i);
    }
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    for(int i=0;i<K;i++){
        ans +=a.at(i);
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 256
//ΔARC 084C
#include<iostream>
#include<cstdio>
#include<fstream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<cmath>
#include<cstring>
#include<cstdlib>
using namespace std;
typedef long long LL;
const int N = 1e5+15;
int a[N],b[N],c[N];
int main()
{
	int n,i,x,y;
	LL ans;
	scanf("%d",&n);
	for(i=1;i<=n;i=i+1)
		scanf("%d",a+i);
	for(i=1;i<=n;i=i+1)
		scanf("%d",b+i);
	for(i=1;i<=n;i=i+1)
		scanf("%d",c+i);
	sort(a+1,a+n+1);
	sort(c+1,c+n+1);
	ans=0;
	for(i=1;i<=n;i=i+1){
		x=lower_bound(a+1,a+n+1,b[i])-a-1;
		y=c+n+1-upper_bound(c+1,c+n+1,b[i]);
		ans+=(LL)x*y;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1408
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <string>

using namespace std;


/* define */
#define Yes(X) puts ( (X) ? "Yes" : "No")
#define YES(X) puts ( (X) ? "YES" : "NO")
#define FOR(i, a, b) for ( int i = (a); i < (b) ; i++)
#define REP(i, n) for ( int i = 0; i < (n) ; i++)
#define max(a, b) (((a) > (b)) ? (a) : (b))
#define min(a, b) (((a) < (b)) ? (a) : (b))
#define max3(a, b, c) ((max((a), (b)) > (c)) ? max((a), (b)) : (c))
#define min3(a, b, c) ((min((a), (b)) < (c)) ? min((a), (b)) : (c))

/* const */
const int MOD = 1000000007;

/* alias */
typedef long long ll;
typedef unsigned  u;

/* function */
int cmp(const void *a, const void *b) {
	return *(int*)a - *(int*)b;
}
int cmp2(const void *a, const void *b) {
	return *(int*)b - *(int*)a;
}
int gcd(int a, int b) {
	if (b != 0)return gcd(b, a % b);
	return a;
}
ll Lgcd(ll a, ll b) {
	if (b != 0) return Lgcd(b, a % b);
	return a;
}
int lcm(int a, int b) {
	return a / gcd(a, b) * b;
}
ll Llcm(ll a, ll b) {
	return a / Lgcd(a, b) * b;
}

/* main */

int main() {
	int n, f = 0;
	cin >> n;
	for (int i = 0; 4 * i <= n; i++) {
		for (int j = 0; 7 * j + 4 * i <= n; j++) {
			if (7 * j + 4 * i == n)f = 1;
		}
	}
	Yes(f);
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define SCD3(m,n,k) scanf("%d%d%d",&m,&n,&k)
#define PB push_back
#define MP make_pair
#define ARSCD(A,N) REP(i,N){SCD(A[i]);}
#define ARSCD1(A,N) FORq(i,1,N){SCD(A[i]);}
#define PRINTD(n) printf("%d\n",n)
#define PRINTLLD(n) printf("%lld\n",n)
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define IN(x,S) (S.count(x) != 0)
using namespace std;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef long long ll;
//////////////////////////////////////////////////////
int main(){
	const int INF = 100000000;
	static int d[202][202];
	int N,M,R; SCD3(N,M,R);  // 1-indexed
	int r[R];
	REP(i,R){
		SCD(r[i]);
	}
	sort(r,r+R);
	
	REP(i,202){
		REP(j,202){
			if (i==j) {d[i][j] = 0;}
			else {d[i][j] = INF;}
		}
	}
	
	REP(i,M){
		int a,b,c; SCD3(a,b,c);
		d[a][b] = c;
		d[b][a] = c;
	}
	
	FORq(k,1,N){
		FORq(i,1,N){
			FORq(j,1,N){
				d[i][j] = min(d[i][j] , d[i][k] + d[k][j]);
			}
		}
	}
	
	vector<int> v;
	REP(i,R){
		v.PB(r[i]);
	}
	
	int ans = INF;
	
	do {
       int nowa = 0;
       REP(i,R-1){
       		nowa += d[v[i]][v[i+1]];
       }
       ans = min(nowa,ans);
       
    } while( next_permutation(v.begin(), v.end()) );
    
    PRINTD(ans);
    
	return 0;
}

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

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

    int n;
    cin >> n;
    vector<int> S(n);
    for (int i = 0; i < n; i++) cin >> S[i];
    int q;
    cin >> q;
    vector<int> T(q);
    for (int i = 0; i < q; i++) cin >> T[i];
    int cnt = 0;
    for (auto t : T) {
        for (auto s : S) {
            if (t == s) {
                cnt++;
                break;
            }
        }
    }
    cout << cnt << endl;

    return 0;
}



Measured memory_bytes: 3172
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstdio>
#include <iomanip>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <stdlib.h>
#include <set>
typedef long long ll;
using namespace std;

int main() {
	string s;
	cin>>s;
	if(s.substr(0,1)==s.substr(2,1)){
		cout<<"Yes"<<endl;
	}else{
		cout<<"No"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
	ios_base :: sync_with_stdio (false);
	cin.tie(NULL);
	
	int n,d, count=0,sum=0;
	cin>> n>> d;

	while(sum<n){
		sum+= 2*d+1;
		count++;
	}
	cout << count;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;

int main(){
    int n; cin>>n;
    int a[n]; rep(i,n) cin>>a[i];
    long ans=5000000000000;
    rep(i,201){
        long score=0;
        rep(j,n){
            score+=(a[j]-(i-100))*(a[j]-(i-100));
        }
        if(ans>score) ans=score;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
import math
n,h = map(int ,raw_input().split())
ais = [map(int, raw_input().split()) for _ in range(n)]
ais.sort(key = lambda x: (-x[1],x[0]))
r,m,cumul = h, max(ais)[0],0
r = (h+m-1)/m
for i in range(len(ais)):
	cumul += ais[i][1]
	r = min(r, i + 1 + (max(h - cumul, 0) + m - 1)/ m )
	if h <= cumul:
		break
print r


Measured memory_bytes: 94468
n,m=map(int,input().split())

def find(x):
    if parents[x] < 0: # 負なら根
        return x
    else:
        parents[x] = find(parents[x])
        return parents[x]
    
#xとyの属する集合の併合
def unite(x,y):
    x = find(x) # x,yは根の番号にする。
    y = find(y)
    
    if x == y:
        return False
    else:
        if parents[x] > parents[y]: # sizeの大きいほうがx
            x,y = y,x
        parents[x] += parents[y]
        parents[y] = x
        return True

parents=[-1]*n

for i in range(m):
    x,y,z=map(int,input().split())
    unite(x-1,y-1)

ans=0
for i in range(n):
    if parents[i]<0:
        ans+=1
print(ans)

Measured memory_bytes: 67516
#include <iostream>
#define llint long long 
#define mod 1000000007

using namespace std;

llint fact[100005], fact_inv[100005];

llint pow(llint a, llint n)
{
	if(n == 0) return 1;
	if(n % 2){
		return ((a%mod) * (pow(a, n-1)%mod)) % mod;
	}
	else{
		return pow((a*a)%mod, n/2) % mod;
	}
}

void make_fact()
{
	llint val = 1;
	fact[0] = 1;
	for(int i = 1; i < 100005; i++){
		val *= i;
		val %= mod;
		fact[i] = val;
	}
	for(int i = 0; i < 100005; i++){
		fact_inv[i] = pow(fact[i], mod-2);
	}
}

llint N;
llint A[100005];
llint sum[100005], sumk[100005];
llint ek[100005], sumek[100005];

int main(void)
{
	make_fact();
	cin >> N;
	for(int i = 1; i <= N; i++) cin >> A[i];
	for(int i = 1; i <= N; i++){
		sum[i] = sum[i-1] + A[i];
		sum[i] %= mod;
	}
	for(int i = 1; i <= N-2; i++){
		llint tmp = fact[N] * 2;
		tmp *= pow(i+1, mod-2), tmp %= mod;
		tmp *= pow(i+2, mod-2), tmp %= mod;
		sumk[i] = sumk[i-1] + tmp, sumk[i] %= mod;
	}
	for(int i = 1; i <= N-1; i++){
		ek[i] = fact[N] * pow(i+1, mod-2) % mod;
		sumek[i] = sumek[i-1] + ek[i];
		sumek[i] %= mod;
	}
	
	llint ans = 0;
	for(int i = 1; i <= N; i++){
		if(i < N){
			ans += sum[i] * sumk[i-1] % mod, ans %= mod;
			ans += sum[i] * ek[i] % mod, ans %= mod;
		}
		if(i > 1){
			ans += mod - sum[i-1] * sumk[N-i] % mod, ans %= mod;
			ans += mod - sum[i-1] * ek[N-i+1] % mod, ans %= mod;
			//cout << ans << endl;
		}
		if(i == N){
			ans += sum[N] * sumek[N-1] % mod, ans %= mod;
			ans += sum[N] * fact[N] % mod, ans %= mod;
		}
		//cout << ans << endl;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 5760
#include <bits/stdc++.h>
#define ll long long
#define sz(x) (int)(x).size()
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0);
    ll n,x=0;
    cin>>n;
    if ((n%11)&&(n%11<7))
        x=1;
    else if (6<n%11)
        x=2;
    cout<<(n/11)*2+x;
    return 0;
}

Measured memory_bytes: 3640
#include<stdio.h>
#include<iostream>
#include<algorithm>
#include<vector>
#include<map>
#include<set>

int main()
{
	int n, *a, *increments;
	long long count{};
	scanf("%d", &n);
	a = new int[n];
	increments = new int[n];
	std::fill(increments, increments + n, 1);

	for (int i = 0; i < n; ++i)
		scanf("%d", a + i);
	for (int i = n - 1; i > 0; --i)
	{
		if (a[i] == 0) increments[i - 1] += increments[i];
	}
	for (int i = 0; i < n; ++i)
	{
		int tmp{};
		for (int j = i; j < n ;j += increments[j])
		{
			if (tmp & a[j]) break;
			tmp ^= a[j];
			count += increments[j];
		}
	}

	printf("%lld\n", count);
	delete[] a;
	delete[] increments;
	return 0;
}

Measured memory_bytes: 1792
import sys
input = lambda: sys.stdin.readline().rstrip()

MOD = 10 ** 9 + 7

N = int(input())

#A=0, G=1, C=2, T=3と考える

dp = [[[[0 for _ in range(4)] for _ in range(4)] for _ in range(4)] for _ in range(N+1)]

#Tは制約に入らないので、スタートをTTT+Sみたいな感じに考える。
dp[0][3][3][3] = 1

for l in range(N):
    #左から3番目
    for last3 in range(4):
        #左から2番目
        for last2 in range(4):
            #左から1番目
            for last1 in range(4):
                #条件に当てはまるものないときはcontinue
                # if dp[l][i][j][k] == 0: 
                #     continue
                #追加する文字
                for now in range(4):
                    if last2 == 0 and last1 == 2 and now == 1: continue
                    if last2 == 0 and last1 == 1 and now == 2: continue
                    if last2 == 2 and last1 == 0 and now == 1: continue
                    if last3 == 0 and last1 == 2 and now == 1: continue
                    if last3 == 0 and last2 == 2 and now == 1: continue

                    dp[l+1][last2][last1][now] += dp[l][last3][last2][last1]
                    dp[l+1][last2][last1][now] %= MOD

#長さNの全部の答えを回収する
ans = 0
for i in range(4):
    for j in range(4):
        for k in range(4):
            ans += dp[N][i][j][k]
            ans %= MOD
print(ans)

Measured memory_bytes: 47216
a , b , c , k = map(int,input().split())
if k % 2 == 0:
    ans = a-b
elif k % 2 == 1:
    ans = b-a

if abs(ans) > 10 **18:
    print("Unfair")
elif abs(ans) <= 10**18:
    print(ans)

Measured memory_bytes: 2940
/*　　　　　　　{:i:i:|i:i:/l/l--　 　 　--l/li:i:i|i:i:i:i}
　　　　　　 　 {:rx|:i:i ィi芥ミ 　 　 .ィi芥ミｉ:ｉ|ﾍ:i:i:}
.　　　 　 　 　 ｛ﾏ|ｉ:  {::’:} 　 　 　{:‘::} :ｉ:i:|〉｝:/
　　 　 　 　 　 乂|:i:| ｀¨¨¨¨´ 　 　　｀¨¨¨´  :i:ｉ:|ｼ/
　 　 　 　 　 　 ﾉ:|:i|　　　　　　′　　　 　   |:i:i:|ﾂ
　　　　　　　　/:/|:i:| ､　　　 　_ _ 　　　　  |:i:i:|
　 　 　　 　 /:/ .|:i:|/ ＼　　　 　 　     ｨ〔|:i:/
　　 　 　  　 〈;/ く刈＿ 个 　   -   　＜}　./|/_〉
　　     　　 r-っ'~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ|___
　　 　     /／ニつ　　　　　　 ､　　　　　　　ノﾆﾆ　＼
.　　　     |　　ニ⊃ 　./　/　 ──   /　/　　..⊆ﾆﾆ　　:|
.　　　     |　　丁´　 /|￣|￣  ─‐ /|￣|￣ 　 .￣|丁 　|
.　　　     |　　ﾉ.  　 |￣|￣  ─‐  |￣|￣ 　 　.|八 　|
.　　　     |　　||. 　 |￣|￣ |￣| |￣|￣ 　   .|　|
.　 　 　   |  　||   　￣￣￣　￣ 　￣￣￣　　  .|　|  |
.　 　 　  　    ||＿＿＿＿＿＿＿＿＿＿＿＿______|__　　 ',
　 　      ,′　 | ７ﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆ}  ,′
.　　     {　　　|/　}ﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆ{/ 　 　
*///讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐。
#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 <cmath>
#include <limits>

using namespace std;

#define rep(b) for(int i=0;i<int(b);i++)
#define ll long long
#define fst first
#define snd second
#define pf(b) printf("%.12f\n",(double)b)
#define _GLIBCXX_DEBUG
const double pai = 3.1415926535897;
#define _cos(n) cos(n*pai/180)
#define l_b lower_bound
#define u_b upper_bound
#define b_s binary_search

//factorial(練習)　階乗
int fact(int n) {
	int a = 1;
	for (int i = 1;i <= n;i++) a *= i;
	return a;
}
int sa(int n, int m) {      //差！
	if (n < m)return m - n;
	else return n - m;
}
int keta(int num) {
	int n = 0;
	if (num == 0) {
		return 1;
	}
	while (num != 0) {
		num /= 10;
		n++;
	}
	return n;
}

int a;
signed main() {
	cin >> a;
	cout << a + a * a + a * a * a << endl;
}

Measured memory_bytes: 3520
N = int(input())
K = int(input())
l = len(str(N))
dp = [[[0]*(K+2) for _ in range(2)] for _ in range(l+1)]
# dp[i][smaller][j]
# i: 調べている桁
# smaller: 未満フラグ(未満のとき1)
# j: 0以外の数がj回出た

dp[0][0][0] = 1
for i in range(l):
  n = int(str(N)[i])
  for j in range(2):
    for k in range(K+1):
      for m in range(10):
        # 今までは一致
        if j == 0 and m > n:
          continue
        if j == 0 and m == n:
          nj = 0 # 今回も一致
          if m == 0:
            nk = k # 0なら回数は増えない
          else:
            if k < K:
              nk = k + 1 # 0以外の数がK-1回以下しかでていないなら増やす
            else:
              nk = k
              continue
        if j == 0 and m < n:
          nj = 1
          if m == 0:
            nk = k
          else:
            if k < K:
              nk = k + 1
            else:
              nk = k
              continue

        # すでに未満
        if j == 1:
          nj = j
          if m == 0:
            nk = k
          else:
            if k < K:
              nk = k + 1
            else:
              nk = k
              continue

        dp[i+1][nj][nk] += dp[i][j][k]

print(dp[l][0][K]+dp[l][1][K])



Measured memory_bytes: 41712
#include <algorithm>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <tuple>
#include <vector>

using namespace std;

typedef long long ll;
constexpr ll MOD = 1000000007;

// struct UnionFind {
//     vector<int> par;
    
//     UnionFind(int N): par(N) {
//         for (int i=0;i<N;i++) par[i] = i;
//     }

//     int root(int x) {
//         if (par[x] == x) return x;
//         else return par[x] = root(par[x]);
//     }

//     void unite(int x, int y) {
//         int rx = root(x);
//         int ry = root(y);
//         if (rx == ry) return;
//         par[rx] = ry;
//     }

//     bool same(int x, int y) {
//         int rx = root(x);
//         int ry = root(y);
//         return rx == ry;
//     }
// };

int main(void) {
    int N;
    vector<ll> A(100010,0), B(100010,0), C(100010,0);
    cin >> N;
    for (int i=0;i<N+1;i++) cin >> A[i];
    for (int i=0;i<N;i++) cin >> B[i];

    for (int i=0;i<N;i++) {
        if (A[i]-C[i] > B[i]) C[i] += B[i];
        else {
            C[i+1] += min(B[i]-(A[i]-C[i]),A[i+1]);
            C[i] += A[i]-C[i];
        }
    }
    cout << accumulate(C.begin(), C.end(), 0LL) << endl;

    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  if(abs(a-c) <= d ||
     (abs(a-b) <= d && abs(b-c) <=d)){
    cout << "Yes" << endl;
   }
  else{
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int sum = 1;
		int count = 0;
		while (sum < B) {
			sum = sum + A - 1;
			count++;
		}
		System.out.println(count);
	}
}


Measured memory_bytes: 22100
import java.io.*
import java.util.*

fun solve(D: Long, N: Long){
    val ans = (1..101)
        .map{ it*Math.pow(100.toDouble(), D.toDouble()) }
        .map{ it.toInt() }
    println(if(N==100L) ans[N.toInt()] else ans[N.toInt()-1])
    return
}


fun main(args: Array<String>) {
    fun StringArray(size: Int, init: (Int) -> String = { "\u0000" }): Array<String> {
        return Array<String>(size, init)
    }
    class Scanner(stream: InputStream) {
        private val reader = BufferedInputStream(stream).bufferedReader()
        private var st: StringTokenizer? = null
        fun next(): String {
            while (!(st?.hasMoreTokens() ?: false)) st = StringTokenizer(reader.readLine())
            return st!!.nextToken()
        }
    }
    val sc = Scanner(System.`in`)
    val D = sc.next().toLong()
    val N = sc.next().toLong()
    solve(D, N)
}



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

#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

using LL = long long;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

template<typename T1,typename T2> using P = pair< T1, T2 >;
using Pii = P<int,int>;
using Pll = P<LL,LL>;
using Pdd = P<double,double>;
using Psi = P<string,double>;

template<typename T1,typename T2> using M = map< T1, T2>;
using Mii = M<int, int>;
using Msi = M<string, int>;

P<Vll,Vll> primeFactor(LL n){
    Vll p,e; LL m=n; int c;
    for(LL i=2;i*i<=n;i++){
        if(m%i!=0){continue;}
        c=0;
        while(m%i==0){c++;m/=i;}
        p.pb(i); e.pb(c);
    }
    if(m>1){ p.pb(m); e.pb(1);}
    return mp(p,e);
}

M<LL,LL> prime_N_kai;
LL num(LL n){
    LL cnt = 0;
    for(auto p : prime_N_kai) if(p.se >= n-1) cnt++;
    return cnt;
}

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

    for(LL i=1; i<=n; i++){
        auto pf = primeFactor(i);
        REP(j,pf.fi.size()){
            prime_N_kai[pf.fi[j]] += pf.se[j];
        }
    }

    LL ans = 0;
    ans += num(75);
    ans += num(25) * (num(3)-1);
    ans += num(15) * (num(5)-1);
    ans += (num(5) * (num(5)-1) * (num(3)-2)) / 2;

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define all(v) v.begin(), v.end()
#include <cmath>
int main() {
    static const double pi = acos(-1);
    int A, B, H, M;
    cin >> A >> B >> H >> M;

    double x = 2 * pi * (H*60 + M)   /720.0;
    //型変換を行わないとint/intの計算で切り捨てられてしまう
    //⇒誤差
    double y = 2 * pi * (H*30 + M/2) /360;
    //ここの部分で 30H + M/2とすると桁落ちする？
    //printf("%.20f\n",x);
    //printf("%.20f\n",y);

    double th = x;
    double tm = 2 * pi * M / 60;
    double theta  = th - tm;
    double ans;
    ans = sqrt(A * A + B * B - 2 * A * B * cos(theta));

    printf("%.10f\n",ans);
      
    return 0;
}

Measured memory_bytes: 4108