akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
using namespace std;
typedef long long int ll;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}


int main() {
    int h,w;
    cin >> h >> w;
    string s[h];
    rep(i,h){
        cin >> s[i];
    }

    int t[h][w];
    int y[h][w];
    rep(i,h){
        rep(j,w){
            t[i][j] = 0;
            if(s[i][j]=='.'){
                if(j==0){
                    t[i][j] = 1;
                }else{
                    t[i][j] = t[i][j-1] + 1;
                }
            }
        }
        drep(j,w){
            if(j==w-1)continue;
            if(t[i][j]!=0){
                t[i][j] = max(t[i][j],t[i][j+1]);
            }
        }
    }

    rep(i,w){
        rep(j,h){
            y[j][i] = 0;
            if(s[j][i]=='.'){
                if(j==0){
                    y[j][i] = 1;
                }else{
                    y[j][i] = y[j-1][i] + 1;
                }
            }
        }
        drep(j,h){
            if(j==h-1)continue;
            if(y[j][i]!=0){
                y[j][i] = max(y[j][i],y[j+1][i]);
            }
        }
    }

    int ans = 0;
    rep(i,h){
        rep(j,w){
            ans = max(ans,t[i][j]+y[i][j]-1);
        }
    }

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


Measured memory_bytes: 35584
#include <stdio.h>
#include <string.h>
int main(void){
    char a[11]="",b[11]="",c[11]="";
    scanf("%s %s %s",a,b,c);
    if(a[strlen(a)-1]==b[0]&&b[strlen(b)-1]==c[0]){
        printf("YES");
    }
    else{
        printf("NO");
    }
}

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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define ALL(a) a.begin(),a.end()
using lint = long long int;

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

    vector<int> A(N);
    vector<lint> cnt(N+1, 0);
    for_(i,0,N) {
        cin >> A[i];
        cnt[A[i]]++;
    }

    vector<lint> sub(N+1, 0);
    for_(i,1,N+1) sub[i] = cnt[i] * (cnt[i] - 1) / 2;

    lint sum = accumulate(ALL(sub), lint());
    for_(i,0,N) {
        lint ans = sum - sub[A[i]];
        lint nc = cnt[A[i]] - 1;
        ans += nc * (nc - 1) / 2;
        cout << ans << endl;
    }
}

Measured memory_bytes: 6528
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

void main() {
    auto t = readln.split;
    auto N = t[0].to!int;
    auto L = t[1].to!long;
    auto S = N.iota.map!(_ => readln.chomp).array;

    auto tr = new Trie(L);
    foreach (s; S) {
        tr.add_string(s);
    }

    writeln(tr.search ? "Alice" : "Bob");
}


class Node {
    int d;
    Node[2] children;

    this(int d) {
        this.d = d;
    }
}

class Trie {
    Node root;
    long L;

    this(long L) {
        root = new Node(0);
        this.L = L;
    }

    void add_string(string s) {
        Node cur = root;
        foreach (c; s) {
            if (cur.children[c-'0'] is null) {
                cur.children[c-'0'] = new Node(cur.d+1);
            }
            cur = cur.children[c-'0'];
        }
    }

    long search() {
        return search(root);
    }
    
    long search(Node n) {
        long l = L - n.d;
        long i = 1;
        while (l != 0 && l % (i * 2) == 0) i *= 2;
        
        if (n.children[0] is null && n.children[1] is null) {
            return 0;
        } else if (n.children[0] is null) {
            return search(n.children[1]) ^ i;
        } else if (n.children[1] is null) {
            return search(n.children[0]) ^ i;            
        } else {
            return search(n.children[0]) ^ search(n.children[1]);            
        }
    }
}


Measured memory_bytes: 12668
#include <bits/stdc++.h>
using namespace std;
  
int main() {
  int N, L, R, sum = 0;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    cin >> L >> R;
    sum += R-L + 1;
  }
  cout << sum << endl;
}


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

const long long mod = 1e9 + 7;

using ll = long long;
using pii  = pair<int, int>;
using pll = pair<ll, ll>;
#define ull unsigned long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpii vector<pii>
#define vpll vector<pll>

#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; i++)
#define rep1(i, n) for (int i = 1, i##_len = (n); i <= i##_len; i++)
#define repr(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rep1r(i, n) for (int i = ((int)(n)); i >= 1; i--)

#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()

#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RSORT(x) sort(rall(x));
#define pb push_back
#define mp make_pair

#define INF (1e9)
#define PI (acos(-1))
#define EPS (1e-7)

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

int w, h;
vector<vi> c, ids;
const vi dj = { -1, 0, 1, -1, 1, -1, 0, 1 }, di = { -1, -1, -1, 0, 0, 1, 1, 1 };
void dfs(int i, int j, int id) {
    ids[i][j] = id;
    rep(k, 8) {
        int ni = i + di[k], nj = j + dj[k];
        if (ni<0 || ni>=h || nj<0 || nj>=w) continue;
        if (c[ni][nj]==0 || ids[ni][nj]==id) continue;
        dfs(ni, nj, id);
    }
}

int main(){
    while (1) {
        cin >> w >> h;
        if (w==0 && h==0) break;
        c = vector<vi>(h, vi(w));
        rep(i, h) rep(j, w) cin >> c[i][j];
        ids = vector<vi>(h, vi(w, -1));
        int ans = 0;
        rep(i, h) rep(j, w) {
            if (c[i][j]==0 || ids[i][j]!=-1) continue;
            dfs(i, j, ans);
            ++ans;
        }
        cout << ans << endl;
    }
    return 0;
}



Measured memory_bytes: 3296
#include<iostream>
#include <string>
#include <cstdlib> //絶対値利用のため
#include <algorithm>
#include <vector>
using namespace std;
typedef long long ll;
#define fr(i,n) for(int i=0;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)

//const int INF = INT_MAX / 2;

int main() {
	int n, m;
	cin >> n >> m;
	int a[10];
	int h[] = { 0, 2, 5, 5, 4, 5, 6, 3, 7, 6 };
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}
	sort(a, a + m, greater<int>());
	int dp[10100];
	fill(dp, dp + 10100, -1);
	dp[0] = 0;
	for (int i = 0; i <= n; i++) {
		if (dp[i] == -1) continue;
		for (int j = 0; j < m; j++) {
			dp[i + h[a[j]]] = max(dp[i + h[a[j]]], dp[i] + 1);
		}
	}
	int k = n;
	while (k) {
		for (int i = 0; i < m; i++)
			if (k - h[a[i]] >= 0 && dp[k - h[a[i]]] == (dp[k] - 1)) {
				cout << a[i];
				k = k - h[a[i]];
				break;
			}

	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N=205,mod=1e9+7;
int n,cnt;
unordered_map<ull,int>mp;
vector<pair<ll,ll> >v[N*N];
ull hs,base=2343;
ll inf=1e18,k,a[N],c[N];
struct node
{
    ll x,c;
    int id;
    bool operator<(const node&o)const
    {
        return x<o.x;
    }
}b[N];
ll popcount(ll l,ll r)
{
    if(l>=r) return inf;
    int ans=0;
    for(int i=60;i>=0;i--)
        if((l>>i&1)!=(r>>i&1))
            return ++ans;
    else ans+=l>>i&1;
    return inf;
}
int main()
{
    scanf("%d%lld",&n,&k);
    for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
    ll p=1;
    for(int t=0;t<=60;t++,p<<=1)
    {
        for(int i=1;i<=n;i++)
            b[i].x=a[i]%p,b[i].c=a[i]/p,b[i].id=i;
        sort(b+1,b+1+n);
        b[n+1].x=p-1;
        b[0].c=1;
        for(int i=0;i<=n;i++)
        {
            ll s=(i==0)?0:popcount(b[i].x,b[i+1].x);
            s=k-t-s;
            b[i].c--;
            if(s<0) continue;
            if(b[i].c<0) break;
            for(int j=1;j<=n;j++) c[b[j].id]=b[j].c,s=min(s,b[j].c);
            hs=0;
            for(int j=1;j<n;j++) hs=hs*base+c[j+1]-c[j]+inf;
            if(!mp[hs]) mp[hs]=++cnt;
            v[mp[hs]].push_back({c[1]-s,c[1]});
        }
    }
    ll ans=0;
    for(int i=1;i<=cnt;i++)
    {
        sort(v[i].begin(),v[i].end());
        ll l=v[i][0].first,r=v[i][0].second;
        for(int j=1;j<v[i].size();j++)
            if(v[i][j].first>r)
        {
            ans=(ans+(r-l+1)%mod)%mod;
            l=v[i][j].first,r=v[i][j].second;
        }
        else r=max(r,v[i][j].second);
        ans=(ans+(r-l+1)%mod)%mod;
    }
    printf("%lld\n",ans);
}


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

size_t n;

void dfs(string s,char mx){
	if(s.size()==n)cout<<s<<"\n"s;
	else for(char c='a';c<=mx+1;++c)dfs(s+c,max(mx,c));
}

int main(){
	cin>>n;
	dfs("a"s,'a');
}

Measured memory_bytes: 1536
#include<bits/stdc++.h>
#define INF 1e7

using namespace std;
typedef long long int ll;

vector<ll>par,len,Size;

ll find(ll x)
{
    if(par[x] == x) return x;
    return par[x] = find(par[x]);
}

void unite(ll x, ll y)
{
    x = find(x);
    y = find(y);
    if(x == y) return;
    if(len[x] < len[y]) par[x] = par[y];
    else par[y] = par[x];
    if(len[x] == len[y]) len[x]++;
    ll sx = Size[x];
    ll sy = Size[y];
    Size[x] += sy;
    Size[y] += sx;
}

int main()
{
    ll N,M; cin >> N >> M;
    vector<pair<ll,ll>>G(M);
    for(ll i = 0; i < M; i++)
    {
        ll a,b; cin >> a >> b;
        a--,b--;
        G[M-1-i] = pair(a,b); 
    }
    vector<ll>ans(M+1);
    ans[0] = 0;
    ans[M] = N*(N-1)/2;
    len.assign(N,0);
    par.resize(N);
    Size.assign(N,1);
    for(ll i = 0; i < N; i++) par[i] = i;
    for(ll i = 0; i < M-1; i++)
    {
        if(find(G[i].first) == find(G[i].second)) 
        {
            ans[M-i-1] = ans[M-i];
            continue;
        }
        ans[M-i-1] = ans[M-i] - Size[find(G[i].first)]*Size[find(G[i].second)];
        unite(G[i].first,G[i].second);
    }
    for(int i = 1; i <= M; i++) cout << ans[i] << endl;
}

Measured memory_bytes: 7940
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a[3]={};
    for(int i=0;i<3;i++)
        cin>>a[i];
    sort(a,a+3);
    int ans=0;
    ans+=a[2]*10+a[1]+a[0];
    cout<<ans<<endl;
    return 0;
    
}


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

public class Main{
	public static void main(String[] args)throws Exception{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line = br.readLine();
		StringBuilder sb = new StringBuilder();
		
		double r = Double.parseDouble(line);
		
		String area = String.format("%.6f",((double)r *(double)r * Math.PI));
		String cir = String.format("%.6f",(2 * (double)r * Math.PI));
		
		sb.append(area).append(" ").append(cir).append("\n");
		System.out.print(sb);
	}
}

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

using ll = long long;

// How many pairs (equal to or lower than mid)
ll f(ll mid, ll n, vector<ll> &a, vector<ll> &b) {
  ll ret = 0;
  for (int i = 0; i < n; i++) {
    ll now = a.at(i);
    if (now == 0) ret += (n - 1) * (mid >= 0);
    else if (now > 0) {
      ll left = -1, right = n;
      while (right - left > 1) {
        ll mid2 = (left + right) / 2;
        if (now * a.at(mid2) <= mid) left = mid2;
        else right = mid2;
      }
      ret += left + 1;
      if (left != -1) {
        if (now <= a.at(left)) ret--;
      }
    }
    else {
      ll left = -1, right = n;
      while (right - left > 1) {
        ll mid2 = (left + right) / 2;
        if (now * b.at(mid2) <= mid) left = mid2;
        else right = mid2;
      }
      ret += left + 1;
      if (left != -1) {
        if (now >= b.at(left)) ret--;
      }
    }
  }
  return ret / 2;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  ll n, k;
  cin >> n >> k;
  
  vector<ll> a(n), b(n);
  for (int i = 0; i < n; i++) {
    cin >> a.at(i);
    b.at(i) = a.at(i);
  }
  
  sort(a.begin(), a.end());
  sort(b.rbegin(), b.rend());
  
  ll left = -1e18 - 1, right = 1e18 + 1;
  while (right - left > 1) {
    ll mid = (left + right) / 2;
    if (f(mid, n, a, b) >= k) right = mid;
    else left = mid;
  }
  
  cout << right << '\n';
}

Measured memory_bytes: 3328
#include <string>
#include <vector>
#include <stack>
#include <iostream>
using namespace std;

static const int MAX =100000;
static const int NIL=-1;

int n;
vector<int> G[MAX];
int color[MAX];

void dfs(int r,int c){
  stack<int> S;
  S.push(r);
  color[r]=c;
  while(!S.empty()){
    int u=S.top();
    S.pop();
    for(int i=0;i<G[u].size();i++){
      int v=G[u][i];
        if(color[v]==NIL){
        color[v]=c;
        S.push(v);
        }
    }
  }
}

void assignColor(){
  int id=1;
  for(int i=0;i<n;i++) color[i]=NIL;
  for(int u=0;u<n;u++){
    if(color[u]==NIL)dfs(u,id++);
  }
}

int main (){
  int s,t,m,q;
  cin >> n >> m;
  for(int i=0;i<m;i++){
    cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }

  assignColor();
  cin >>q;
  for(int i=0;i<q;i++){
    cin >> s >> t;
    if(color[s]==color[t]){
      cout <<"yes"<< endl;
    }else{
      cout << "no" <<endl;
    }
  }

  return 0;
}


Measured memory_bytes: 8956
import core.bitop, std.algorithm, std.ascii, std.bigint, std.conv, std.math,
    std.functional, std.numeric, std.range, std.stdio, std.string, std.random,
    std.typecons, std.container, std.format;

// dfmt off
T lread(T = long)(){return readln.chomp.to!T();}
T[] aryread(T = long)(){return readln.split.to!(T[])();}
void scan(TList...)(ref TList Args){auto line = readln.split();
foreach (i, T; TList){T val = line[i].to!(T);Args[i] = val;}}
alias sread = () => readln.chomp();enum MOD = 10 ^^ 9 + 7;
// dfmt on

long f(long n)
{
    long c = 0;
    while (n != 0)
    {
        n /= 10;
        c++;
    }
    return c;
}

void main()
{
    long N = lread();
    long cnt;
    foreach (x; 1 .. N + 1)
    {
        if (f(x) & 1)
            cnt++;
    }
    writeln(cnt);
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
  int N,count=0,i,ex=0;
  if(scanf("%d",&N)==1);
  int A[N];

  for(i=0;i<N;i++){
    if(scanf("%d",&A[i])==1);
  }

  while(ex==0){
    for(i=0;i<N;i++){
      if(A[i]%2==1){
        ex=1;
      }
      else A[i]=A[i]/2;
    }

    count++;
  }
  printf("%d",count-1);
}


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

int main(){
    int A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;

    vector<int> x;
    for(int i = 0; i * A * 100 <= F; ++i){
        for(int j = 0; (i * A + j * B) * 100 <= F; ++j){
            x.push_back((i * A + j * B) * 100);
        }
    }
    
    vector<int> y;
    for(int i = 0; i * C <= F; ++i){
        for(int j = 0; i * C + j * D <= F; ++j){
            y.push_back(i * C + j * D);
        }
    }

    double maxn = -1;
    int water = 0;
    int sugar = 0;
    for(int i = 0; i < x.size(); ++i){
        for(int j = 0; j < y.size(); ++j){
            if(x[i] > 0 && x[i] + y[j] <= F){
                double noudo = double(100 * y[j]) / (x[i] + y[j]);
                if(maxn < noudo && E * (x[i] / 100) >= y[j]){
                    maxn = noudo;
                    water = x[i];
                    sugar = y[j];
                }
            }
        }
    }
    cout << water + sugar << " " << sugar << endl;
}

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

int main(){
	string a;
	cin >> a;
	set<char> b;
	for(int i = 0; i < a.size(); i++){
		b.insert(a[i]);
	}
	if(b.count('N') != b.count('S')){
		cout << "No" << endl;
	} else if(b.count('W') != b.count('E')){
		cout << "No" << endl;
	} else {
		cout << "Yes" << endl;
	}
}


Measured memory_bytes: 764
#include<iostream>
#include<algorithm>
using namespace std;
typedef long long ll;
#define fr(i,n) for(int i=0;i<n;i++)

int main(){
  int a[3],b,c[10],cnt=0;
  fr(i,3) cin>>a[i];
  sort(a,a+3);
  while(a[1]-a[0]>=2){
    cnt++;
    a[0]=a[0]+2;
  }
  while(a[2]-a[1]>=2){
    cnt +=2;
    a[0]+=2;
    a[1]+=2;
  }
  
  
  a[1]-=a[0];
  a[2]-=a[0];
  a[0]=0;
  if(a[1]==0){
    if(a[2]==0) cout << cnt;
    else cout << cnt+1;
  }
  else{
    if(a[2]==1) cout << cnt+2;
    else cout<<cnt+3;
  }
  }

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>

char a[200][200];
using namespace std;
int d[][2] = {0,1,0,-1,1,0,-1,0};
void fill(int x, int y, char c){
	a[x][y] = '.';
	for(int i = 0; i < 4; ++i){
		int x_ = x+d[i][0];
		int y_ = y+d[i][1];
		if(a[x_][y_] == c){
			fill(x_, y_, c);
		}
	}
}
int main(){
	int H,W;
	cin >> H >> W;
	while(H){
		//init
		memset(a, '\0', sizeof a);
		//read data
		cin.ignore();
		for(int i = 0; i < H; ++i){
			string s;
			getline(cin, s);
			strcpy((char *)(a[i+1])+1, s.c_str());
		}
		//count the number of areas
		int c = 0;
		for(int i = 1; i <= H; ++i){
			for(int j = 1; j <= W; ++j){
				if(a[i][j] != '.'){
					fill(i, j, a[i][j]);
					c++;
				}
			}
		}
		cout << c << endl;
		cin >> H >> W;
	}
}

Measured memory_bytes: 1736
#include "bits/stdc++.h"
using namespace std;

#define ul unsigned long long
#define ll long long
#define ld long double


int main()
{
  ll n,m;
  cin>>n>>m;
  ll a[n],sa=0;

  for (ll i = 0; i < n; i++)
  {
    cin>>a[i];
    sa+=a[i];
  }
  ll lim=sa/(4*m)-(sa%(4*m)==0),ct=0;
  sort(a,a+n,greater<int>());
  for (ll i = 0; i < n; i++)
  {
    if (a[i]<=lim) break;
    ct++;
    if (ct==m) break;
  }

  if (ct==m) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  

  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;
import java.util.stream.IntStream;

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

        int N = sc.nextInt();
        int[] t = readArray(sc, N);
        int[] v = readArray(sc, N);

        System.out.println(solve(t, v));

        sc.close();
    }

    static int[] readArray(Scanner sc, int size) {
        int[] result = new int[size];
        for (int i = 0; i < result.length; ++i) {
            result[i] = sc.nextInt();
        }

        return result;
    }

    static double solve(int[] t, int[] v) {
        int N = t.length;

        int leftMax = 0;
        int[] leftMaxs = new int[N - 1];
        for (int i = 0; i < leftMaxs.length; ++i) {
            leftMax = Math.min(Math.min(leftMax + t[i], v[i]), v[i + 1]);
            leftMaxs[i] = leftMax;
        }

        int rightMax = 0;
        int[] rightMaxs = new int[N - 1];
        for (int i = rightMaxs.length - 1; i >= 0; --i) {
            rightMax = Math.min(Math.min(rightMax + t[i + 1], v[i + 1]), v[i]);
            rightMaxs[i] = rightMax;
        }

        int[] maxs = IntStream.range(0, N - 1).map(i -> Math.min(leftMaxs[i], rightMaxs[i])).toArray();

        return IntStream.range(0, N)
                .mapToDouble(
                        i -> computeMaxDistance(t[i], v[i], (i == 0) ? 0 : maxs[i - 1], (i == N - 1) ? 0 : maxs[i]))
                .sum();
    }

    static double computeMaxDistance(int time, int limitV, int v1, int v2) {
        double maxV;
        if ((limitV - v1) + (limitV - v2) <= time) {
            maxV = limitV;
        } else {
            maxV = (time + v1 + v2) / 2.0;
        }

        return (v1 + maxV) * (maxV - v1) / 2 + maxV * (time - (maxV - v1) - (maxV - v2))
                + (maxV + v2) * (maxV - v2) / 2;
    }
}

Measured memory_bytes: 29140
package main

import (
	"fmt"
	"sort"
)

func main(){
	var N int
	fmt.Scan(&N)
	var X int
	XN := make([]int, N)
	for i:=0; i < N; i++ {
		fmt.Scan(&X)
		XN[i] = X
	}

	so := make([]int, N)
	copy(so,XN)
	sort.Ints(so)
	c:=so[(N/2)]

	for i := 0; i < N; i++ {
		if XN[i] < c {
			fmt.Println(so[(N/2)])
		}else{
			fmt.Println(so[(N/2)-1])
		}
	}
}

Measured memory_bytes: 9216
import math
def prime(n):
    for i in range(2, int(math.sqrt(n))):
        if n % i == 0: return False
    return True
 
X = int(input())
 
for i in range(X, 10**8):
    if prime(i):
        print(i)
        exit(0)
 
print('No prime number in this range')

Measured memory_bytes: 3060
import java.util.Scanner;
public class Main{
	 public static void main(String args[] ) throws Exception {
        Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		StringBuilder sb = new StringBuilder("");
		while(t-->0) {
			sb.append("ACL");
		}
		System.out.println(sb);
		sc.close();
    }
}

Measured memory_bytes: 35724
n = int(input())
q = [int(x) for x in input().split(' ')]
q_set = set(q)

if (n%2 == 1):
    count = 2**((n-1)//2)
else:
    count = 2**(n//2)
    
    
if (sum(q) == 2*sum(q_set)):
    print(count%(10**9+7))
else:
    print(0)

Measured memory_bytes: 13880
#include <iostream>
#include <climits>
using namespace std;
typedef long long ll;
const int N_MAX = 100;
const ll INF = INT_MAX - 1;
int N;
int F[N_MAX][10];
ll P[N_MAX][11];
int O[10];
ll ans = - INF ;
void dfs(int i) {
    if (i >= 10) {
        int cnt = 0;
        for (int j = 0; j < 10; j++) {
            if (O[j]) {
                cnt++;
            }
        }
        if (cnt != 0) {
            ll sum = 0;
            for (int j = 0; j < N; j++) {
                cnt = 0;
                for (int k = 0; k < 10; k++) {
                    if (O[k] == 1 && O[k] == F[j][k]) {
                        cnt++;
                    }
                }
                sum += P[j][cnt];
            }
            ans = max(ans, sum);
        }
    } else {
        O[i] = 0;
        dfs(i + 1);
        O[i] = 1;
        dfs(i + 1);
    }
}
int main (void) {
    cin >> N;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 10; j++) {
            cin >> F[i][j];
        }
    }
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < 11; j++) {
            cin >> P[i][j];
        }
    }

    dfs(0);

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<vector>
#include<string>
#include<queue>
#include<algorithm>
#define P pair<string,int>
using namespace std;

int main() {
	int a, b;
	scanf("%d%d", &a, &b);
	queue<P>Q;
	for (int c = 0; c < a; c++) {
		string d; int e;
		cin >> d;
		scanf("%d", &e);
		Q.push(P(d, e));
	}
	int s = 0;
	while (Q.size()) {
		P h = Q.front();
		Q.pop();
		int g = min(b, h.second);
		s += g;
		h.second -= g;
		if (h.second) {
			Q.push(h);
		}
		else {
			cout << h.first << " " << s << endl;
		}
	}
}

Measured memory_bytes: 6352
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()

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

    if(a + b >= c){
        cout << "Yes" << endl;
        return 0;
    }else{
        cout << "No" << endl;
        return 0;
    }
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] x = new int[N+1];
        int[] dif = new int[N];
        int max = 0;
        int r, tmp;
        for(int i = 0; i < N+1; i++){
            x[i] = sc.nextInt();
        }
        for(int i = 0; i < N; i++){
            dif[i] = Math.abs(x[i+1] - x[i]);
        }
        for(int i = 0; i < N-1; i++){
            if(dif[i] < dif[i+1]){
                tmp = dif[i];
                dif[i] = dif[i+1];
                dif[i+1] = tmp;
            }
            while( (r = dif[i] % dif[i+1]) != 0 ) {
                dif[i] = dif[i+1];
                dif[i+1] = r;
            }
        }
        System.out.println(dif[N-1]);
    }
}


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

public class Main {
    public static void main(String[] args) throws Exception{
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String[] arr = bf.readLine().split(" ");
        int N = Integer.parseInt(arr[0]);
        int K = Integer.parseInt(arr[1]);
        int Q = Integer.parseInt(arr[2]);
        int[] players = new int[N+1];
        for(int i=1; i<players.length; i++) {
            players[i] = K - Q;
        }
        for(int i=0; i<Q; i++) {
            int n = Integer.parseInt(bf.readLine());
            players[n]++;
        }
        for(int i=1; i<players.length; i++) {
            if(players[i] <= 0) System.out.println("No");
            else System.out.println("Yes");
        }
    }

}

Measured memory_bytes: 59912
#include <cstdio>
#include <cassert>
#include <cctype>
#include <algorithm>
#include <vector>

using namespace std;

enum { Leaf, Node };

struct Stage {
    int type;
    int required_vote;

    union {
        int n;
        vector<Stage*>* childs;
    } u;
};

bool comp(const Stage* l, const Stage* r) {
    return l->required_vote < r->required_vote;
}

char S[20000];

Stage* parse(char* s, char** next) {
    assert(s[0] == '[');
    if (isdigit(s[1])) {
        int n = 0;

        int i = 1;
        for (; isdigit(s[i]); i++) {
            n *= 10;
            n += (int)(s[i] - '0');
        }
        assert(s[i] == ']');

        *next = &s[i + 1];

        Stage* r = new Stage;
        r->type = Leaf;
        r->u.n = n;

        return r;
    } else if (s[1] == '[') {
        ++s;

        Stage* r = new Stage;
        r->type = Node;
        r->u.childs = new vector<Stage*>;

        vector<Stage*> &childs = *(r->u.childs);

        for (; *s != ']'; ) {
            assert(*s == '[');

            char *n;
            Stage* c = parse(s, &n);
            childs.push_back(c);

            s = n;
        }

        *next = s + 1;

        return r;
    }

    assert(false);
    return 0;
}

int more_than_half(int i) {
    return i / 2 + 1;
}

void calc(Stage* s) {
    if (s->type == Leaf) {
        s->required_vote = more_than_half(s->u.n);
    } else if (s->type == Node) {
        vector<Stage*>& v = *(s->u.childs);

        for (int i = 0; i < (int)v.size(); i++) {
            calc(v[i]);
        }

        sort(v.begin(), v.end(), comp);

        int r = 0;
        for (int i = 0; i < more_than_half(v.size()); i++) {
            r += v[i]->required_vote;
        }

        s->required_vote = r;
    }
}

void cleanup(Stage* s) {
    if (s->type == Leaf) {
        delete s;
    } else if (s->type == Node) {
        vector<Stage*>& v = *(s->u.childs);

        for (int i = 0; i < (int)v.size(); i++) {
            cleanup(v[i]);
        }

        delete s->u.childs;
        delete s;
    }
}

int main() {
    int n;
    char ns[100];
    fgets(ns, 99, stdin);
    n = atoi(ns);

    for (int zz = 0; zz < n; zz++) {
        for (int i = 0; i < 10002; i++) { S[i] = 0; }
        fgets(S, 20000, stdin);
        char* dummy;
        Stage* node = parse(S, &dummy);

        calc(node);

        printf("%d\n", node->required_vote);

        cleanup(node);
    }
    return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
#define rep0(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define mREP(i,a,b) for (int i = a; i > (b); --i)
#define all(x) (x).begin(),(x).end()
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; } 
int main(){
  ll a;cin >> a;
  for(ll i = sqrt(a) + 1; i > 0; i--){
    if(a % i == 0){
      cout << i + (a / i) - 2 << endl;
      return 0;
    }
  }
  return 0;
}

Measured memory_bytes: 256
// ~maqsat~

// #pragma GCC target ("avx2")
// #pragma GCC optimize ("Ofast")
// #pragma GCC optimize ("unroll-loops")

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>

#define F first
#define S second
#define in insert
#define pb push_back
#define eb emplace_back
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define count1 __builtin_popcountl
#define debug(x) cerr << (#x) << " = " << (x) << "\n"
#define ACCELERATE ios_base::sync_with_stdio(false),cin.tie(nullptr)
#define fre(f) if(fopen(f".in", "r")) freopen(f".in", "r", stdin),freopen(f".out", "w", stdout)
#define ever ;;

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;

using ll = long long;
using ull = unsigned long long;
// using big = __int128_t; // -10^38...10^38
using db = double;
using ld = long double;
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;

template <class T> using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T> inline void cmin(T &a, T b) { a = min(a, b); }
template <class T> inline void cmax(T &a, T b) { a = max(a, b); }

const int oo = 0x3f3f3f3f;
const ll N = 1e5 + 123;
const ll MOD = 1e9 + 7;
const ll INF = 1e15 + 9;
const db EPS = 1e-9;
const db PI = acos(-1); // 3.14159265358979323846
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1};
const int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};

#define db ld

inline db sq(ld n) {
	db x = n;
	db y = 1;
	while (x - y > EPS) {
		x = (x + y) / 2.0;
		y = n * 1.0 / x;
	}
	return x;
}

main() {
#ifdef ZVER
	cerr << "Ready\n";
#endif
	fre("");
	ACCELERATE;
	
	ld a, b, c;
	cin >> a >> b >> c;
	
	db x = sq(a * b);
	
	if (a + b + 2 * x < c) cout << "Yes";
	else cout << "No";
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <climits>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cassert>

using namespace std;

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

const ll MOD = ll(1e9) + 7;
const ll INF = LLONG_MAX;
const ll MAX_N = ll(1e5) + 5;
const double EPS = 10e-8;
const double PI = 3.14159265359;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define REPR(i, n) for (ll i = n; i >= 0; i--)
#define FOR(i, m, n) for (ll i = m; i < n; i++)

int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};

int main() {
    string s;
    cin >> s;
    cout << s[0] << s.size()-2 << s[s.size()-1] << endl;
    return 0;
}

Measured memory_bytes: 256
X = int(input())
div = []
for i in range(1, int(X**0.5)+1):
    if X % i == 0:
        div.append(i)
        if i != X // i:
            div.append(X//i)
for p in div:
    i = 0
    while (i+p-p//2)**5 - (i-p//2) ** 5 <= X:
        if (i+p-p//2)**5 - (i-p//2) ** 5 == X:
            print(i+p-p//2, i-p//2)
            break
        i += 1
    else:
        continue
    break
    i = 0
    while (i+p)**5 - i ** 5 <= X:
        if (i+p)**5 - i ** 5 == X:
            print(i+p, i)
            break
        i += 1
    else:
        continue
    break

Measured memory_bytes: 63756
#include<bits/stdc++.h>
using namespace std;
template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    stack<int> st;
    string s;
    int a,b,x;
    while(cin>>s){
          if(s[0]=='+'){
              a=st.top();
              st.pop();
              b=st.top();
              st.pop();
              st.push(a+b);
          }
          else if(s[0]=='-'){
              a=st.top();
              st.pop();
              b=st.top();
              st.pop();
              st.push(b-a);
          }
          else if(s[0]=='*'){
              a=st.top();
              st.pop();
              b=st.top();
              st.pop();
              st.push(a*b);
          }
          else{
              st.push(atoi(s.c_str()));
          }
    }
    cout<<st.top()<<'\n';
    return(0);
}


Measured memory_bytes: 3232
#include <iostream>
#include <sstream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <iomanip>
#include <cstdlib>
#include <climits>
#include <set>
using namespace std;

//関数getinputdata宣言
vector<vector<string>> getinputdata();
vector<vector<int>> getinputdata2();
vector<vector<double>> getinputdata3();

void abc132_a(vector<vector<string>> v) {

    string s = v[0][0];

    map<char, int>m;
    for (auto c : s) {

        m[c] += 1;
    }
    

    cout <<(m.size()==2 ? "Yes" : "No")<<endl;
            
}

int main() {

    vector<vector < string>> vec_arr_result;
    //    vector<vector<int>> vec_arr_result;
    vec_arr_result = getinputdata();

    abc132_a(vec_arr_result);

    return 0;
}

//関数getinputdata実装

vector<vector<double>> getinputdata3() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<double>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<double> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atof(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;
}

//関数getinputdata実装

vector<vector<int>> getinputdata2() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector<int>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<int> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(atoi(ret.c_str()));
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;


}

//関数getinputdata実装

vector<vector < string >> getinputdata() {

    string str;
    string ret;
    stringstream ss;
    vector<string> v1;
    vector<vector < string>> vec_arr;

    //標準入力から入力がある間ループ処理でvector配列にデータ格納
    while (getline(cin, str)) {

        v1.push_back(str);

    }

    //stringstreamを利用してvector配列v1をスペースで分解処理
    for (string s : v1) {

        vector<string> array_data;
        ss << s;

        while (!ss.eof()) {

            ss >> ret;

            array_data.push_back(ret);
        }

        //vector配列に追加
        vec_arr.push_back(array_data);

        //バッファクリア
        ss.str("");
        //ストリームクリア
        ss.clear(stringstream::goodbit);

    }

    return vec_arr;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
     
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define int long long
#define rep(i,a,b)    for(int i=a;i<b;i++)
#define repn(i,a,b)   for(int i=a;i>=b;i--)
#define F first
#define S second
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define mp  make_pair
#define all(v) (v).begin(), (v).end()
#define mod 1000000007  
#define mod2 998244353  

int solve(){
    int n;
    string s;
    cin>>n>>s;
    cout<<s.substr(0,n);
    if(n<s.size()) cout<<"...";
    
    return 0;
}   
     
signed main(){
    IOS;
    //freopen("input.txt", "r" , stdin);
    //freopen("output4.txt", "w", stdout);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
        cout<<"\n";
      // cout<<" * "<<t<<"\n";
    }
//    return 0;
} 

Measured memory_bytes: 3640
#include<iostream>
using namespace std;
int main(){
  int a,b,c;
  cin>>a>>b>>c;
  int five=0;
  int seven=0;
  if(a==5){five++;}
  else if(a==7){seven++;}
  else{}
  if(b==5){five++;}
  else if(b==7){seven++;}
  else{}
  if(c==5){five++;}
  else if(c==7){seven++;}
  else{}
  if(five==2&&seven==1){cout<<"YES"<<endl;return 0;}
  else{cout<<"NO"<<endl;}
}

Measured memory_bytes: 256
#!/usr/bin/env python
from math import floor

def main():
    A, B = map(int, input().split())
    for i in range(1, 1300):
        if floor(i * 0.08) == A and floor(i * 0.10) == B:
            print(i)
            exit()
    print('-1')

if __name__ == '__main__':
    main()

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

int main() {
    string s;
    cin >> s;
    int q;
    cin >> q;
    string t;
    rep(i, q) {
        int flag;
        cin >> flag;
        if (flag == 1) {
            swap(s, t);
        } else {
            int flag_sub; char c;
            cin >> flag_sub >> c;
            if (flag_sub == 1) {
                t += c;
            } else {
                s += c;
            }
        }
    }
    reverse(t.begin(), t.end());
    t += s;
    cout << t << endl;
    return 0;
}


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

namespace AtCoder
{
    class ABC141
    {
        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static long[] ReadLongs()
        {
            return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }

        static double ReadDouble()
        {
            return double.Parse(Console.ReadLine());
        }

        static double[] ReadDoubles()
        {
            return Console.ReadLine().Split(' ').Select(double.Parse).ToArray();
        }

        static string ReadString()
        {
            return Console.ReadLine();
        }

        static string[] ReadStringSplit()
        {
            return Console.ReadLine().Split(' ');
        }

        static void A()
        {
            var s = ReadString();
            switch (s)
            {
                case "Sunny":
                    Console.WriteLine("Cloudy");
                    break;
                case "Cloudy":
                    Console.WriteLine("Rainy");
                    break;
                case "Rainy":
                    Console.WriteLine("Sunny");
                    break;
            }
        }

        static void B()
        {
            var S = ReadString();
            for (int i = 0; i < S.Length; ++i)
            {
                if (i % 2 == 0)
                {
                    if (S[i] == 'L')
                    {
                        Console.WriteLine("No");
                        return;
                    }
                }
                else
                {
                    if (S[i] == 'R')
                    {
                        Console.WriteLine("No");
                        return;
                    }

                }
            }
            Console.WriteLine("Yes");
        }

        static void C()
        {
            var longsInput = ReadLongs();
            var N = longsInput[0];
            var K = longsInput[1];
            var Q = longsInput[2];
            var AnsCounts = Enumerable.Range(0, (int)N)
                                        .Select(x => 0)
                                        .ToArray();
            for (int i = 0; i < Q; ++i)
            {
                var l = ReadLong();
                AnsCounts[l - 1]++;
            }
            for (int i = 0; i < N; ++i)
            {
                if (K - (Q - AnsCounts[i]) > 0)
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }
        }

        static void D()
        {

        }

        static void Main(string[] args)
        {
            //A();
            //B();
            C();
            //D();
        }
    }
}


Measured memory_bytes: 31568
H, W, K = map(int, input().split())

cake = []
for h in range(H):
	cake.append([c == "#" for c in input().strip()])

areas = []
number = 1
prev = None
skipping = False
for h in range(H):
	col = cake[h]
	if not any(col):
		if prev:
			areas.append(prev)
		else:
			skipping = True
	else:
		area_col = []
		strawed = False
		for c in col:
			if c:
				if strawed:
					number += 1
				strawed = True
			area_col.append(number)
		number += 1
		if skipping:
			for i in range(h):
				areas.append(area_col)
			skipping = False
		areas.append(area_col)
		prev = area_col

for area_col in areas:
	print(*area_col)


Measured memory_bytes: 8144
#include<iostream>
using namespace std;
int main() {
	int A, B, C;
	cin >> A >> B >> C;
	if ((A < C) && (C < B) || (B < C) && (C < A)) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
	system("pause");
	return 0;
}

Measured memory_bytes: 504
package main

import (
	"fmt"
)

func main() {
	var N, A, B, res int64
	fmt.Scan(&N, &A, &B)

	remain := N % (A + B)
	set := (N - remain) / (A + B)

	if remain > A {
		res = A*set + A
	} else {
		res = A*set + remain
	}

	fmt.Println(res)
}


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

#define rep(i,begin,end) for(int i=begin; i<end; i++)
#define revrep(i,begin,end) for(int i=begin; i>end; i--)
#define lld long long int

int main(){
    char s[1001];
    scanf("%s", s);
    int w, len = strlen(s);
    scanf("%d", &w);
    rep(i, 0, len){
        if(i%w == 0){
            printf("%c", s[i]);
        }
    }

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define PB push_back
#define MP make_pair
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(a) (a).begin(),(a).end()
#define MOD 10000
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
const ull B=100000007;
const int INF=1e9;
int main(){
      int n,a,ans=0;
      cin>>n;
      REP(i,n){
            cin>>a;
            bool f=false;
            for(int x=1;x*x<a;x++)if((a+x+1)%(2*x+1)==0)f=true;
            if(!f)ans++;
      }
      cout<<ans<<endl;
}

Measured memory_bytes: 1160
def fun():
     print('ac')
     print('AC')
     print('ACAC')
     print('ac')
     print('aacc')
n=eval(input())
if n<=6:
     print(1)
elif n<=11:
     print(2)
elif n<=17:
     print(3)
else:
     k=n//11
     if n%11==0:
          print(2*k)
     else:
          if 11*k+6>=n:
               print(2*k+1)
          else:
               print(2*k+2)

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

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

string s;

int main() {
    
    cin >> s;
    int n = s.length();
    rep(i, n) cout << 'x';
    cout << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    string s;
    getline(cin, s);  //1行読み込む
        for(int i = 0; i < s.size(); i++){
            char c = s[i];
            if ('A' <= c && c <= 'Z'){
                //c = tolower(c);
                c = c + 32;
            }
            else if('a' <= c && c <= 'z'){
                c = c - 32;
            }
            cout << c ;
    }
    cout << endl;
}


Measured memory_bytes: 3156
import collections
import heapq
N, M = map(int, input().split())
a = list(map(int, input().split()))


class unionFind:
    parent = []
    count = []

    def __init__(self, N):
        self.parent = [i for i in range(N)]
        self.count = [1 for i in range(N)]

    def root(self, x):
        if self.parent[x] == x:
            return(x)
        else:
            self.parent[x] = self.root(self.parent[x])
            return(self.parent[x])

    def same(self, x, y):
        x, y = x-1, y-1
        return(self.root(x) == self.root(y))

    def unite(self, x, y):
        x, y = x-1, y-1
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return
        else:
            self.parent[x] = y
            self.count[y] += self.count[x]
            self.count[x] = self.count[y]
            return

    def getCount(self, x):
        self.count[x] = self.count[self.root(x)]
        return(self.count[x])


G = unionFind(N)
for i in range(M):
    x, y = map(int, input().split())
    G.unite(x+1, y+1)
A = [(a[i], i) for i in range(N)]


A.sort(key=lambda x: (-G.getCount(x[1]), G.parent[x[1]], x[0]))
a1 = 0
x = 0
ans = 0
t = []
for a, x in A:
    x = G.root(x)
    if len(t) > 0:
        if G.root(t[0][1]) == x:
            heapq.heappush(t, (a, x))
        else:
            a1, y = heapq.heappop(t)
            y = G.root(y)
            ans += (a + a1)
            G.unite(x+1, y+1)
    else:
        heapq.heappush(t, (a, x))

s = set()
for i in range(N):
    s.add(G.root(i))
if len(s) == 1:
    print(ans)
else:
    print("Impossible")
    # print(ans)
    # print(s)


Measured memory_bytes: 32548
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int64_t MOD=1000000007;
const long long INF = 1LL<<60;
using Graph = vector<vector<int>>;

int temp=0;
vector<bool> seen;
void dfs(const Graph &G, int v) {
    seen[v] = true;
    ++temp;
    for (auto next_v : G[v]) { 
      if (seen[next_v]) continue;
      dfs(G, next_v); // 再帰的に探索
    }
}

int main() {
  int N, M,ans=0; cin >> N >> M;
  Graph G(N);
  set<pair<int,int>> K; 
  for (int i = 0; i < M; ++i) {
      int a, b;
      cin >> a >> b;
    a--;
    b--;
    pair<int,int> k=make_pair(a,b),l=make_pair(b,a);
    if(K.count(k)==false){
    K.insert(k);
    K.insert(l);
      G[a].push_back(b);
      G[b].push_back(a);
    }
  }

    // 全頂点が訪問済みになるまで探索
  seen.assign(N, false);
  for (int v = 0; v < N; ++v) {
      if (seen[v]) continue; // v が探索済みだったらスルー
      ans=max(temp,ans);
      temp=0;
      dfs(G, v); // v が未探索なら v を始点とした DFS を行う
  }
  ans=max(ans,temp); 
  cout << ans << endl;
}

Measured memory_bytes: 42232
MOD = 1000000007

def mult(a, b):
    da = len(a)
    db = len(b)
    res = [0] * (da + db - 1)
    for i in range(da):
        for j in range(db):
            res[i+j] = (res[i+j] + a[i] * b[j]) % MOD
    return res

plus = [1, 1]
minus = [1, -1]

d = [1]
for i in range(5):
    d = mult(d, plus)

for i in range(16):
    d = mult(d,  minus)

a = [0] * 6
a[5] = 1


def flip_odd(d):
    dd = d[:]
    for i in range(1, len(dd), 2):
        dd[i] = -dd[i]
    return dd

def get(a, d, n):
    if n == 0:return a[0]
    dd = flip_odd(d)
    if n % 2 == 1:
        return get(mult(a,dd)[1::2], mult(d, dd)[::2], (n-1) // 2)
    else:
        return get(mult(a,dd)[::2], mult(d,dd)[::2], n // 2)

for _ in range(int(input())):
    n = int(input())
    print(get(a, d, n))

Measured memory_bytes: 9184