akhauriyash/Code-Regression huggingface dataset:
L = input()
INT = [int(L[i]) for i in range(len(L))]

for i in range(2**3):
    ans=[INT[0], L[0]]
    for j in range(3):
        if(i>>j)&1:
            ans[0]+=INT[j+1]
            ans[1]+='+'
            ans[1]+=L[j+1]
        else:
            ans[0]-=INT[j+1]
            ans[1]+='-'
            ans[1]+=L[j+1]
    if ans[0]==7:
        print(ans[1]+'=7')
        break        

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main () {
  vector<int>i(3);
  for (int m = 0; m <3; m ++) {
    cin >> i[m];
  }
  sort(i.begin(),i.end());
  int k = i[2];
  int j = k * 2 - (i[0] + i[1]);
  if (j % 2 == 1) cout << (j + 3) / 2 << endl;
  else cout << j / 2 << endl;
}

Measured memory_bytes: 256
# include <bits/stdc++.h>
# include <ext/pb_ds/assoc_container.hpp>
# include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

// I DON'T KNOW WHO YOU ARE BUT I WILL FIND YOU AND SEE YOUR CODE _/\_

# define MOD         1000000007
# define gc          getchar
# define LL          long long
# define pb          push_back
# define mp          make_pair
# define vi          vector<int>
# define MAXN        1000005
# define INF         1e9
# define all(v)      v.begin(),v.end()

template<class T> void in(T &x) { register T c=gc();x=0;T neg=0;for(;((c<48||c>57)&&c!='-');c=gc());if(c=='-'){neg=1;c=gc();}for(;c>47&&c<58;c=gc()){x=(x<<1)+(x<<3)+c-48;}if(neg)x=-x;}
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
LL power(LL a,LL b,LL m){ if(b==0) return 1; if(b==1) return a%m; LL t=power(a,b/2,m); t=(t*t)%m; if(b&1)t=(t*a)%m; return t;}
LL lcm(LL a, LL b) { LL ret = a*b; ret /= __gcd(a,b); return ret;}
LL nC2(LL n) {LL ret = n*(n-1)/2; return ret;}

int main()
{
	string s;
	cin>>s;
	for(int i=0;i<5;i++)
		cout<<s[i];
	cout<<" ";
	for(int i=6;i<=12;i++)
		cout<<s[i];
	cout<<" ";
	for(int i=14;i<=18;i++)
		cout<<s[i];
    return 0;
}


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

class UnionFind {
private:
  int sz;
  vector<int> par, size_;
public:
  UnionFind() {}
  UnionFind(int n) : sz(n), par(sz), size_(sz, 1) {
    iota(par.begin(), par.end(), 0);
  }
  int root(int x) {
    if (par.at(x) == x) return x;
    else return par.at(x) = root(par.at(x));
  }
  void unit(int x,int y) {
    x = root(x), y = root(y);
    if (x == y) return;
    if (size_.at(x) < size_.at(y)) swap(x, y);
    par.at(y) = x;
    size_.at(x) += size_.at(y);
  }
  int size(int x) {
    x = root(x);
    return size_.at(x);
  }
  bool same(int x, int y) {
    return root(x) == root(y);
  }
};

int main() {
  UnionFind UF(13);
  vector<int> V1 = {1,3,5,7,8,10,12};
  vector<int> V2 = {4,6,9,11};
  for (int i = 0; i < V1.size(); i++) {
    if (i) UF.unit(V1.at(i - 1), V1.at(i));
  }
  for (int i = 0; i < V2.size(); i++) {
    if (i) UF.unit(V2.at(i - 1), V2.at(i));
  }
  int x, y;
  cin >> x >> y;
  cout << ((UF.same(x, y)) ? "Yes" : "No") << "\n";
}

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

// #define int long long
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define SORT(v, n) sort(v, v + n);
#define REVERSE(v, n) reverse(v, v+n);
#define vsort(v) sort(v.begin(), v.end());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
#define PI (acos(-1))
#define FILL(v, n, x) fill(v, v + n, x);
#define sz(x) int(x.size())

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vs = vector<string>;
using vpll = vector<pair<ll, ll>>;
using vtp = vector<tuple<ll,ll,ll>>;
using vb = vector<bool>;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const ll INF = 1e15;
const int MOD = 1e9+7;
const ll LINF = 1e18;



signed main()
{
  cin.tie( 0 ); ios::sync_with_stdio( false );
  ll n; cin>>n;
  vll a(n); rep(i,n) cin>>a[i];
  ll ans=LINF;
  
  irep(i,-100,101){
    ll tmp=0;
    rep(j,n){
      tmp+=(a[j]-i)*(a[j]-i);
    }
    chmin(ans,tmp);
  }
  cout<<ans<<endl;
}


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

int main() {
  
  int N, K;
  cin >> N >> K;
  vector<double> kitai(N);
  vector<double> sum(N);
  
  double a = 0;
  for (int i=0; i<N; i++) {
    int x;
	cin >> x;
    double p;
    p = (double)1/x;
    kitai.at(i) = p * x * (x+1) / 2;
    sum.at(i) = a + kitai.at(i);
    a = sum.at(i);
  }
  
  int start = 0;
  double max = 0;
  while ( start + K <= N ) {
    double d;
    if (start > 0) {
      d = sum.at(start+K-1) - sum.at(start-1);
    } else {
      d = sum.at(start+K-1);
    }
    if (d > max) {
		max = d;
    }
  start++;
  }
  
  printf("%.10f\n", max);
  
  return 0;
}


Measured memory_bytes: 3328
n = int(input())
txy = [[0,0,0]]
for i in range(n):
    txy.append([int(j) for j in input().split()])
for i in range(1,n+1):
    t = txy[i][0]-txy[i-1][0]
    x = abs(txy[i][1]-txy[i-1][1])
    y = abs(txy[i][2]-txy[i-1][2])
    if t%2 == (x+y)%2 and t >= x+y:
        continue
    else:
        print('No')
        exit()
print('Yes')

Measured memory_bytes: 21156
#include <iostream>
#include <algorithm>
#include <queue>
#define debug freopen("1.in","r",stdin),freopen("1.out","w",stdout);
#define ios ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
typedef long long ll;
const ll maxn = 1e5 + 10;

priority_queue <int> q;
int n, m, test;
ll ans = 0;
int main(){
    ios;
    cin >> n >> m;
    for(int i=0;i<n;i++){
        cin >> test;
        q.push(test);
    }
    while(m --){
        test = q.top() / 2;
        q.pop();
        q.push(test);
    }
    while(!q.empty()){
        ans += q.top();
        q.pop();
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 892
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    n = 25 - n;
    cout << "Christmas ";
    for (int i = 0; i < n; i++)
    {
        cout << "Eve ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n)  for(int i = 0; i < n; i++)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.rbegin(), cont.rend()
#define unique(a)        (a).erase(unique((a).begin(), (a).end()),(a).end())
#define fastio          ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define PB push_back
#define endl "\n"
#define mod 1000000007
double tick() { static clock_t oldt; clock_t newt = clock(); double diff = 1.0*(newt - oldt) / CLOCKS_PER_SEC; oldt = newt; return diff; }
typedef long long LL;
typedef long double LD;
typedef vector<int> VI;
inline LL add(LL x, LL y) { x += y; if (x >= mod) x -= mod; return x; }
inline LL moduloMultiplication(LL x, LL y) { return (x%mod * 1LL * y%mod) % mod; }
inline LL power(LL a, LL b) {
	LL x = 1 % mod;
	while (b) {
		if (b & 1) x = moduloMultiplication(x, a);
		a = moduloMultiplication(a, a);
		b >>= 1;
	}
	return x % mod;
}
inline LL inv(LL a) { return power(a, mod - 2) % mod; }
LL gcd(LL a, LL b)
{
	if (!a)
		return b % mod;
	return gcd(b%a, a) % mod;
}


int main()
{
	int a, n;
	cin >> a >> n;
	VI v(n);
	rep(i, n)cin >> v[i];
	int tot = accumulate(all(v), 0);
	if (tot >= a)cout << "Yes" << endl;
	else cout << "No" << endl;
	

}



Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define mod 1000000007
using ll = long long;
using namespace std;
int main(){
  int n;
  cin >> n;
  map<string, int> card;
  rep(i, n){
    string s;
    cin >> s;
    card[s]++;
  }
  int m;
  cin >> m;
  rep(i, m){
    string t;
    cin >> t;
    card[t]--;
  }
  int maxNum = 0;
  for(auto a : card){
    maxNum = maxNum < a.second ? a.second : maxNum;
  }
  cout << maxNum << endl;
}

Measured memory_bytes: 256
use std::collections::HashMap;
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}

fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
fn main(){
    let n:i64 = read();
    let cs = vec!['M','A','R','C','H'];
    let mut map = HashMap::new();
    for _ in 0..n{
        *map.entry(read::<String>().chars().nth(0).unwrap()).or_insert(0) += 1;
    }
    let master:Vec<i64> = cs.iter().map(|&c| *map.entry(c).or_insert(0)).collect();
    let f = vec![0,0,0,0,0,0,1,1,1,2];
    let s = vec![1,1,1,2,2,3,2,2,3,3];
    let t = vec![2,3,4,3,4,4,3,4,4,4];
    let mut ans = 0;
    for j in 0..10 as usize{
        ans += master[f[j]] * master[s[j]] * master[t[j]];
    }
    println!("{}",ans );
}

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

using ll = long long;
using namespace std;

#define swap(a, b)    do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while(false)
#define repd(i, a, b) for(typeof(b) i = a; i < (b); ++i)
#define rep(i, n)     repd(i, 0, n)
#define dump(x)       cerr << #x << " = " << (x) << endl
#define debug(x)      cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl
#define YN(x)         cout << ((x) ? "YES" : "NO") << endl
#define Yn(x)         cout << ((x) ? "Yes" : "No") << endl
#define yn(x)         cout << ((x) ? "yes" : "no") << endl
#define absi(x)       ( ((x) >= 0) ? (x) : (-(x)) )
#define debugvec(v)   rep(i, v.size()) cerr << "L" << __LINE__ << ": " << #v << "[" << i << "] = " << v[i] << endl;
#define debugvec2(v)  cerr << "L" << __LINE__ << ": " << #v << " = { "; rep(i, v.size()) cerr << v[i] << (i + 1 == v.size() ? "" : ", "); cerr << " }" << endl;

ll gcd(ll a, ll b) { return __gcd(a, b); }
ll lcm(ll a, ll b) { return (a == 0 || b == 0) ? 0 : (a / __gcd(a, b) * b); }

vector<vector<ll>> tree;
vector<ll> ret;

void dfs(const ll index, const ll parent) {
	for(ll child : tree.at(index)) {
		if(child == parent) continue;

		ret.at(child) += ret.at(index);
		dfs(child, index);
	}
}

int main(int argc, const char* argv[]) {
	ll n, q;
	cin >> n >> q;
	tree = vector<vector<ll>>(n, vector<ll>(0));
	ret = vector<ll>(n, 0);

	rep(i, n-1) {
		ll a, b;
		cin >> a >> b;
		tree.at(a-1).push_back(b-1);
		tree.at(b-1).push_back(a-1);
	}

	rep(i, q) {
		ll p, x;
		cin >> p >> x;
		ret.at(p-1) += x;
	}

	dfs(0, 0);

	rep(i, n-1) {
		cout << ret.at(i) << " ";
	}
	cout << ret.at(n-1);

	return 0;
}


Measured memory_bytes: 24320
use std::io;

fn main() {
    loop {
        let mut s = String::new();
        io::stdin().read_line(&mut s).expect("");
        s = s.trim().to_string();
        if s == "0" {
            break;
        }

        let mut sum = 0;
        for c in s.chars() {
            let x = match c {
                t @ '0'...'9' => t as i32 - '0' as i32,
                _ => 0
            };

            sum += x;
        }

        println!("{}", sum);

    }
}



Measured memory_bytes: 5036
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define  boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ull unsigned long long
#define deb(x) cout<<#x<<" "<<x<<endl;
#define deb2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define deb2l(x,y,i) cout<<#x<<i<<" "<<x<<" "<<#y<<i<<" "<<y<<endl;

#define fr(i,l,r) for(ll i=l;i<r;i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define mod 1000000007
#define ff first
#define ss second
#define pb(x) push_back(x)
#define vll vector<ll>
#define pbp(x,y) push_back(make_pair(x,y))
#define  mat vector<vector<ll>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
ll find(ll k){
ll ans=0;
 map<ll,ll>mp;
  for(int i=1;i<=k;i++){
      for(int j=1;j<=k;j++){
          for(int kk=1;kk<=k;kk++){
              int  kkk=__gcd(i,j);
              if(kkk!=1)
              kkk=__gcd(kkk,kk);
              ans+=kkk;
              mp[kkk]++;
              
          }
      }
  }
  //cout<<ans;
  for(auto &it :mp){
      cout<<it.first<<" "<<it.second<<endl;
  }
  cout<<endl;
}

ll pw(ll a,ll k){
  
  ll res=1;
  while(k){
    if(k&1)
    res=(res*a)%mod;

    a=a*a,a=a%mod;
    k=k/2;
  }
 // deb(res);
  return res;

}
int main(){
  boost;

  ll n,k;
  cin>>n>>k;
   vll dp(k+1);

   for(ll i=1;i<=k;i++){
       
       dp[i]=(pw(k/i,n))%mod;
   }
  // cout<<dp[2]<<endl;
   for(int i=k;i>1;i--){
       for(int j=1;j*j<=i;j++){
           if(i%j==0){
             //  cout<<i<<" ";
            dp[j]=(dp[j]-dp[i]+mod)%mod;
       //  deb2(j,dp[j]);
           if((i/j)!=j && j!=1){
            dp[i/j]=(dp[i/j]-dp[i]+mod)%mod;
           }
        // deb2(i/j,dp[i/j]);
           }
       }
   }
    ll ans=0;
   ll sm=0;
    for(int i=k;i>=1;i--){
    ans=(ans+(i*dp[i])%mod)%mod;
    //sm=(sm+dp[i])%mod;
    }
    
   // ans=(ans+(sm-pw(n,k)+mod)%mod)%mod;
    cout<<ans;
//  find(k);

    return 0;
}


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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            //[summary]C - Minimization
            var line = ReadLine();
            int n = line[0];
            int k = line[1];
            var a = ReadLine();

            int count = (n - k) / (k - 1);

            if ((n - k) % (k - 1) == 0)
            {
                count++;
            }
            else
            {
                count += 2;
            }

            Console.WriteLine(count);
        }

        static List<int> ReadLine()
        {
            var line = Console.ReadLine();
            var array = line.Split(' ');

            return array.Select(x => int.Parse(x)).ToList();
        }
    }
}

Measured memory_bytes: 17632
#include<cstdio>
#include<cstring>
#include<algorithm>
#define maxn 300005
using namespace std;
int w,h,n,ans;
struct node { int x,y; } a[maxn],sa[maxn],sb[maxn];
bool cmp(node p,node q)
{
	if(p.x!=q.x) return p.x<q.x;
	return p.y<q.y;
}
struct tr { int val,add; } tree[maxn*4];
void Build(int i,int l,int r)
{
	tree[i].val=tree[i].add=0;
	if(l==r) return;
	int mid=(l+r)/2;
	Build(i*2,l,mid); Build(i*2+1,mid+1,r);
}
void Update(int i,int L,int R,int l,int r,int val)
{
	if(r<L||l>R) return;
	if(l<=L&&R<=r)
	{
		tree[i].val+=val; tree[i].add+=val;
		return;
	}
	int mid=(L+R)/2;
	Update(i*2,L,mid,l,r,val); Update(i*2+1,mid+1,R,l,r,val);
	tree[i].val=max(tree[i*2].val,tree[i*2+1].val)+tree[i].add;
}
#define For(i, l, r) for(register int i = (l), i##end = (int)(r); i <= i##end; ++i)
#define Fordown(i, r, l) for(register int i = (r), i##end = (int)(l); i >= i##end; --i)
inline bool chkmax(int &a, int b) {return b > a ? a = b, 1 : 0;}
void solve()
{
	sort(a+1,a+n+1,cmp);
	Build(1,1,n);
	int topa=0,topb=0;
	for(int i=1;i<n;i++)
	{
		if(a[i].y<=h/2)
		{
			int nxt=i-1;
			while(topa&&a[i].y>sa[topa].y)
			{
				Update(1,1,n,sa[topa].x,nxt,sa[topa].y-a[i].y);
				nxt=sa[topa].x-1; topa--;
			}
			if(nxt!=i-1) { topa++; sa[topa].x=nxt+1,sa[topa].y=a[i].y; }
		}
		else
		{
			int nxt=i-1;
			while(topb&&a[i].y<sb[topb].y)
			{
				Update(1,1,n,sb[topb].x,nxt,a[i].y-sb[topb].y);
				nxt=sb[topb].x-1; topb--;
			}
			if(nxt!=i-1) { topb++; sb[topb].x=nxt+1,sb[topb].y=a[i].y; }
		}
		topa++; sa[topa].x=i,sa[topa].y=0;
		topb++; sb[topb].x=i,sb[topb].y=h;
		Update(1,1,n,i,i,h-a[i].x);
		ans=max(ans,tree[1].val+a[i+1].x);
	}
}
int main()
{
	scanf("%d%d%d",&w,&h,&n);
	for(int i=1;i<=n;i++) scanf("%d%d",&a[i].x,&a[i].y);
	n++; a[n].x=a[n].y=0;
	n++; a[n].x=w,a[n].y=h;
	solve();
	for(int i=1;i<=n;i++) swap(a[i].x,a[i].y);
	swap(h,w);
	solve();
	printf("%d\n",ans*2);
}

Measured memory_bytes: 16640
IDENTIFICATION DIVISION.
PROGRAM-ID. PROGRAM_ID.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 R              PIC 9(3)V9(7).
01 PI             PIC 9(3)V9(7) VALUE 3.1415926.
01 ans            PIC 9(3)V9(7).
01 zs             PIC Z(2)9.9(7).

PROCEDURE DIVISION.
  ACCEPT R.
  COMPUTE ans = 2 * R * PI.
  MOVE ans TO zs.
  DISPLAY FUNCTION TRIM(zs).
  STOP RUN.

Measured memory_bytes: 3864
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
	vector<int> a(5);
	for(int i = 0; i < 5; ++i){ cin >> a[i]; }
	cout << find(a.begin(), a.end(), 0) - a.begin() + 1 << endl;
	return 0;
}



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

int main() {
	ll n, k;
	cin >> n >> k;
	ll ans = 0, cnt1 = 0, cnt2 = 0;
	for(ll i = 1 ; i <= n ; ++ i) {
		if(i % k == 0) {
			++ cnt1;
		}
	}
	if(k % 2 == 0) {
		for(ll i = 1 ; i <= n ; ++ i) {
			if(i % k == k / 2) {
				++ cnt2;
			}
		}
	}
	ans = cnt1 * cnt1 * cnt1 + cnt2 * cnt2 * cnt2;
	cout << ans << endl;
}

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

int main(){
  int N;
  cin >> N;
  int X = (N/1.08);
  if(int(X*1.08) == N){
    cout << X << endl;
    return 0;
  }
  if(int(1.08*(X+1))==N){
    cout << X+1 << endl;
    return 0;
  }
  else{
    cout << ":(" << endl;
    return 0;
  }
}
  
  

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

using ll = long long;
using ull = unsigned long long;
using st = string;
using ch = char;
using db = double;
using bl = bool;
using vll = vector<long long>;
using vdb = vector<db>;
using vst = vector<st>;
using vch = vector<char>;
using vbl = vector<bl>;
using vvll = vector<vll>;
using pll = pair<ll, ll>;
using vpll = vector<pll>;
using vvpll = vector<vpll>;
#define rep(i, m, n) for (ll i = (ll)(m); i < (ll)(n); i++)
#define vrep(i, vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
#define mkp(a, b) make_pair(a, b) 
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;}
const ll mod = 1000000007;
const ll inf = 1LL << 60;
const db pi = acos(-1.0L);

int main(){
  ll n;
  cin >> n;
  vll a(n);
  vin(a);
  ll ans = 1;
  vrep(i, a) if(i == 0){
    cout << 0 << endl;
    return 0;
  }
  vrep(i, a){
    if(ans > db(1e18) / i){
      ans = -1;
      break;
    }
    ans *= i;
    if(ans > ll(1e18)){
      ans = -1;
      break;
    }
  }
  cout << ans << endl;
}

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

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)


int main()
{
  ll n, m=0, c;
  string s, x, y;
  char h;
  cin >> n >> s;
  forll(i, 1, n-1){
	c = 0;
	x = s.substr(0, i);
	y = s.substr(i);
	forll(i, 0, 26){
	  h = 'a' + i;
	  if ((x.find(h) != string::npos) && (y.find(h) != string::npos))
		c++;
	}
	m = max(m, c);
  }
  cout << m << endl;
}


Measured memory_bytes: 256
import sys
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
mod = 10**9 + 7
inf = float('inf')

N = I()
t = LI()
v = LI()
T = sum(t)*2
vcandi =[[0]*(N+2) for _ in range(T+1)]
sumt = int(0)
for i in range(N):
    time = t[i]*2
    for j in range(sumt):
        vcandi[j][i] = v[i]+(sumt-j)*0.5
    for j in range(time+1):
        vcandi[sumt+j][i] = v[i]
    sumt = sumt+time
    for j in range(T-sumt+1):
        vcandi[sumt+j][i] = v[i]+j*0.5
for i in range(T+1):
    vcandi[i][N] = i*0.5
    vcandi[i][N+1] = (T-i)*0.5
ansV =[0]*(T+1)
for i in range(T+1):
    ansV[i] = min(vcandi[i])

#print(ansV)
cur = float(0)
for i in range(T):
    cur += (ansV[i]+ansV[i+1])/2*0.5

ans = cur
print(ans)

Measured memory_bytes: 195720
#include <iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<queue>
#include<cmath>
#include<set>
#include<deque>
#include<iomanip>
using namespace std;
typedef long long ll;

typedef pair<int, int> pii;

//const ll MOD_CONST = 1000000007;
const ll MOD_CONST = 998244353;


const int INF = 1000000000;
const ll BIG_NUM = 1000000000000000000;



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

	vector<int>a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}

	vector<vector<vector<ll>>> dp(n + 1, vector<vector<ll>>(s + 1, vector<ll>(3)));
	dp[0][0][0] = 1;
	for (int i = 0; i < n; i++) {

		for (int j = 0; j <= s; j++) {
			(dp[i + 1][j][0] += dp[i][j][0]) %= MOD_CONST;
			(dp[i + 1][j][1] += dp[i][j][0] + dp[i][j][1]) %= MOD_CONST;
			(dp[i + 1][j][2] += dp[i][j][0] + dp[i][j][1] + dp[i][j][2]) %= MOD_CONST;

			if (a[i] + j <= s) {
				(dp[i + 1][a[i] + j][1] += dp[i][j][0] + dp[i][j][1]) %= MOD_CONST;
				(dp[i + 1][a[i] + j][2] += dp[i][j][0] + dp[i][j][1]) %= MOD_CONST;
			}
		}


	}



	cout << dp[n][s][2] << endl;
}



Measured memory_bytes: 493056
#include <bits/stdc++.h>
using namespace std;
#define rep0(i,n) for(ll (i) = 0; (i) < (n); ++(i))
#define rrep0(i,n) for(ll (i) = (n) - 1; (i) >= 0; --(i))
#define rep1(i,n) for(ll (i) = 1; (i) <= (n); ++(i))
#define rrep1(i,n) for(ll (i) = (n); (i) >= 1; --(i))
#define nfor(i,a,b) for(ll (i) = (a); (i) < (b); ++(i))
#define rfor(i,a,b) for(ll (i) = (a); (i) > (b); --(i))
#define ll long long
#define mod (1000000007)
#define pf(a) cout << (a) << endl;
#define all(x) (x).begin(),(x).end()

ll gcd(ll a,ll b){
    if(b == 0) return a;
    return gcd(b,a%b);
}

ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}

ll factorial(ll n){
    ll t = 1;
    rep1(i, n)t *= i;
    return t;
}

ll combinations(ll n, ll k) {
    ll r = 1;
    for (ll d = 1; d <= k; ++d) {
        r *= n--;
        r /= d;
    }
    return r;
}

int main()
{
    int h,w,ans = 0,mh[] = {-1,1,0,0},mw[] = {0,0,-1,1};
    cin >> h >> w;
    vector<vector<bool> > g(h + 2,vector<bool>(w + 2,true));
    vector<string> a(h);
    queue<pair<int, int> > q1,q2,erase;
    rep0(i, h){
        cin >> a[i];
        rep0(j, w){
            if(a[i][j] == '.'){
                g[i + 1][j + 1] = false;
            }else{
                q1.push(make_pair(i + 1, j + 1));
            }
        }
    }
    
    while (1) {
        if(q1.empty())break;
        while (!q1.empty()) {
            rep0(i, 4){
                if(!g[q1.front().first + mh[i]][q1.front().second + mw[i]]){
                    q2.push(make_pair(q1.front().first + mh[i], q1.front().second + mw[i]));
                    g[q1.front().first + mh[i]][q1.front().second + mw[i]] = true;
                }
            }
            q1.pop();
        }
        q1 = q2;
        q2 = erase;
        ++ans;
    }
    pf(ans - 1)
    return 0;
}


Measured memory_bytes: 9856
#include <bits/stdc++.h>
#define IO_OP std::ios::sync_with_stdio(0); std::cin.tie(0);
#define F first
#define S second
#define V vector
#define PB push_back
#define MP make_pair
#define EB emplace_back
#define ALL(v) (v).begin(), (v).end()
#define debug(x) cerr << #x << " is " << x << endl

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef V<int> vi;

const int INF = 1e9 + 7;

signed main()
{
	IO_OP;
	
	ll n, ans = 0;
	cin >> n;
	for(ll i = 2; i * i <= n; i++) {
		if(n % i == 0) {
			ll cnt = 0;
			while(n % i == 0) n /= i, cnt++;
			ll cur = 0;
			for(ll j = 1; ; j++) {
				cur += j;
				if(cur > cnt) break;
				ans++;
			}
		}
	}
	if(n != 1) ans++;
	cout << ans << endl;
}





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

using namespace std;


int main() {
    int a, b;
    cin >> a >> b;
    if(a + b == 15) {
        cout << '+' << "\n";
    }
    else if(a * b == 15) {
        cout << '*' << "\n";
    }
    else {
        cout << 'x' << "\n";
    }
    return 0;
}

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

int main() {
  string s, t;
  cin >> s >> t;
  string ans = "Yes";
  for(int i = 0; i < s.size(); ++i){
    if(s.at(i) != t.at(i)) ans = "No";
  }

  cout << ans << endl;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MOD=1000000007;
#define INF 1LL<<30
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()

vector<vector<pair<int,int>>> G(101010);
int ans[101010];
void dfs(int cu,int pa=-1,int col=0){
    set<int> used;
    used.insert(col);
    int c=1;
    for(auto to : G[cu]){
        if(to.first==pa) continue;
        while(used.count(c)) c++;
        ans[to.second]=c;
        dfs(to.first,cu,c);
        c++;
    }
}

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

    dfs(0);
    int ma=0;
    rep(i,n) ma=max(ma,(int)G[i].size());
    cout<<ma<<endl;
    rep(i,n-1) cout<<ans[i]<<endl;
}



Measured memory_bytes: 13824
#include<iostream>
#include<cstdio>
#include<queue>
#include<vector>
#define F first
#define S second
using namespace std;
typedef pair<int,int>p;

vector<p>g[10001];
int d[10001];
main()
{
  int n;
  int u, k, v, c;
  
  scanf("%d", &n);
  for (int i = 0; i < n ; ++i) {
    scanf("%d %d", &u, &k);
    for(int j = 0; j < k ; ++j) {
      scanf("%d %d", &c, &v);
      g[u].push_back(p(c,v));
    }
    d[i] = 1 << 21;
  }
  
  priority_queue< p, vector<p>, greater<p> >p_que;
  p_que.push(p(0,0));
  d[0] = 0;
  while ( !p_que.empty() ) {
    p now = p_que.top(); p_que.pop();
    int pos = now.F;
    int cost = now.S;
    for ( int i = 0; i < g[pos].size() ; ++i) {
      int ncost = cost + g[pos][i].S;
      if ( ncost < d[g[pos][i].F] ) {
	d[g[pos][i].F] = ncost;
	p_que.push(p(g[pos][i].F,ncost));
      }
    }
  }

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

  return (0);
}



Measured memory_bytes: 8148
// ABC177D - Friends

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

typedef unsigned long long int ull;
typedef long long int ll;

struct UnionFind {
	vector<int> par;
	vector<int> rank;
	vector<int> count;

	// n要素で初期化
	UnionFind(int n) {
		par.resize(n);
		rank.resize(n, 0);
		count.resize(n, 1);
		for (int i = 0; i < n; i++) {
			par[i] = i;
		}
	}

	// 木の根を求める。
	int find(int x) {
		if (par[x] == x) {
			return x;
		} else {
			return par[x] = find(par[x]);
		}
	}

	// xとyの属する集合を併合
	void unite(int x, int y) {
		x = find(x);
		y = find(y);
		if (x == y) {
			return;
		}
		
		count[x] += count[y];
		count[y] = count[x];
		if (rank[x] < rank[y]) {
			par[x] = y;
		} else {
			par[y] = x;
			if (rank[x] == rank[y]) {
				rank[x]++;
			}
		}
	}

	// xとyが同じ集合に属するか否か
	bool same(int x, int y) {
		return find(x) == find(y);
	}

	// xと同じ集合の要素数を返す。
	int getCount(int x) {
		return count[x];
	}
};

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

	UnionFind tree(N);
	for (int i = 0; i < M; i++) {
		int A, B;
		cin >> A >> B;
		tree.unite(A-1, B-1);
	}

	int ans = 0;
	for (int i = 0; i < N; i++) {
		ans = max(ans, tree.getCount(i));
	}

	cout << ans << endl;

	return 0;
}


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

using namespace std;

//#define FILE_IO

int main()
{
    #ifdef FILE_IO
    freopen("1.in", "r", stdin);
    freopen("1.out", "w", stdout);
    #endif

    long long S, C, A;
    scanf("%lld%lld", &S, &C);
    A = min(S, C / 2);
    C -= A * 2;
    A += C / 4;
    printf("%lld\n", A);

    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;
const int INF = 1001001001;
const int MOD = 1000000007;
typedef long long ll;

template<typename T> void print(const T & v);


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

    string S;
    cin >> S;

    deque<char> dq;
    for(char c: S){
        dq.push_back(c);
    }

    int Q;
    cin >> Q;
    int flag = 0; //偶数の時そのまま，奇数の時反転
    rep(i, Q){
        int num;
        cin >> num;
        if(num == 1){
            flag += 1;
        }else{
            int F;
            char c;
            cin >> F >> c;
            if((flag + F) % 2 == 1){
                dq.push_front(c);
            }else{
                dq.push_back(c);
            }
        }
    }
    if(flag % 2 == 0){
        while(!dq.empty()){
            cout << dq.front();
            dq.pop_front();
        }
    }else{
        while(!dq.empty()){
            cout << dq.back();
            dq.pop_back();
        }
    }
    cout << endl;
    return 0;
}


// Use For Debug
template <typename T>
void print(T const & v){
    for(int i = 0; i < v.size(); i++){
        if(i) cout << " ";
        cout << v[i];
    }
    cout << endl;
}


Measured memory_bytes: 976
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define vi vector< int >
#define vb vector< bool >
#define vl vector< ll >
#define ss second
#define ff first
#define ll long long
#define pii pair< int,int >
#define pll pair< ll,ll >
#define sort(a) sort(a.begin(),a.end())
#define tri pair<int,pii>
#define vii vector<pii>
#define vll vector<pll>
#define viii vector<tri>
#define mod (1000*1000*1000+7)
#define moddd (1000*1000*1000+9)
#define pqueue priority_queue< int >
#define pdqueue priority_queue< int,vi ,greater< int > >
#define flush fflush(stdout) 
#define primeDEN 727999983
//cout<<fixed<<setprecision(15)<<ans;
 
template <typename T>
void printvec(vector<T>& vec){
	for(int i=0;i<vec.size();i++){
		cout<<vec[i]<<" ";
	}
	cout<<endl;
}

int main(){
	std::ios::sync_with_stdio(false); 
	int ttt=1;
	//cin>>ttt;
	while(ttt--){
		int n,k,i;
		cin>>n>>k;
		//if(k%2==0) k=k/2;
		ll x=n/k;
		//if(n%k==0) x++;
		ll ans=x*x*x;
		//cout<<ans<<endl;
		if(k%2==0){
			ll kby2=k/2;
			ll y=n/kby2;
			y=y-x;
			ans+=(y*y*y);
		}
		cout<<ans;
	}
	return 0;
} 


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <memory>
#include <memory.h>
#include <fstream>
#include <cmath>
#include <math.h>
#include <numeric>
#include <vector>
#include <stack>
#include <string>
#include <queue>
#include <sstream>
#include <cstdlib>
#include <cassert>
#include <cstdio>
#include <map>
#include <iomanip>
#include <list>
#include <cctype>
#include <algorithm>
#include <complex>

#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)
using namespace std;

typedef complex<double> xy_t;
typedef pair<xy_t, xy_t> line;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<double, double> Pd;
typedef pair<int, P> PP;
typedef pair<int, PP> PPP;
const int INF = 1 << 29;
const double EPS = 1E-10;

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

ll dp[100][100];
bool bad[100][100];

int main(){
	int a, b, n;
	int x, y;
	while(cin >> a >> b && ( a || b)){
		memset(dp, 0, sizeof(dp));
		memset(bad, false, sizeof(bad));
		dp[1][1] = 1;
		cin >> n;
		rep(i, n){
			cin >> x >> y;
			bad[x][y] = true;
		}
		for(int i = 1; i <= a;i++){
			for(int j = 1; j <= b; j++){
				if(bad[i][j]) continue;
				dp[i+1][j] += dp[i][j];
				dp[i][j+1] += dp[i][j];
			}
		}
		cout << dp[a][b] << endl;
	}
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
using namespace std;
const int N=100005;
long long a[N],b[N];
int main()
{
	int n;
	scanf("%d",&n);
	for(int i=1;i<=n+1;i++)
		scanf("%lld",&a[i]);
	for(int i=1;i<=n;i++)
		scanf("%lld",&b[i]);
	long long ans=0;
	for(int i=n;i>=1;i--)
	{
		long long s=min(b[i],a[i+1]);
		a[i+1]-=s;
		b[i]-=s;
		ans+=s;
		s=min(b[i],a[i]);
		a[i]-=s;
		b[i]-=s;
		ans+=s;
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define mins(a,b) a=min(a,b)
#define maxs(a,b) a=max(a,b)
using namespace std;

int main(){
  int n;
  cin>>n;
  long long int num[n*3];
  for(int i=0;i<n*3;i++){
    cin>>num[i];
  }
  sort(num,num+n*3);
  reverse(num,num+n*3);
  long long int ans=0;
  for(int i=1;i<n*2;i+=2){
    ans+=num[i];
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
typedef long long int uli;
int g[9][9];
int main(){
  int n,m;
  cin>>n>>m;
  while(m--){
    int u,v;
    cin>>u>>v;
    g[--u][--v]=1;
    g[v][u]=1;
  }
  int p[10];
  iota(p+1,p+n,1);
  int ans=0;
  do{
    bool ok=true;
    p[0]=0;
    for(int i=1;i<n;i++)if(!g[p[i]][p[i-1]]){
      ok=false;
    }
    if(ok)ans++;
  }while(next_permutation(p+1,p+n));
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstdio>
#include<vector>
using namespace std;
#define MAXN 100000
int n,d[MAXN+5];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	scanf("%d",&d[i]);
	sort(d+1,d+n+1);
	printf("%d",d[n/2+1]-d[n/2]);
}

Measured memory_bytes: 640
/*
Keep clam  Believe youself
*/
#include<cstdio>
#include<iostream>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
#include<stack>
#include<set>
#include<cmath>
#define Xiaobo main
using namespace std;
const int maxn=2e5+7;
const int mod=1e9+7;
const double eps=1e-15;
const double pi=acos(-1);
const int INF=0x3f3f3f;
typedef long long ll;
ll read(){ll c = getchar(),Nig = 1,x = 0;while(!isdigit(c) && c!='-')c = getchar();if(c == '-')Nig = -1,c = getchar();while(isdigit(c))x = ((x<<1) + (x<<3)) + (c^'0'),c = getchar();return Nig*x;}
ll gcd(ll a,ll b){ return b==0?a:gcd(b,a%b);}
int dp[maxn];
int v[maxn];
int w[maxn];
int Xiaobo()
{
	int n,h;
	scanf("%d%d",&h,&n);
	for(int i=1;i<=n;i++) {
		scanf("%d",&w[i]);
		scanf("%d",&v[i]);
	}
	for(int i=1;i<=2*h;i++) dp[i]=mod;
	for(int i=1;i<=n;i++) {
		for(int j=1;j<w[i];j++) {
			dp[j]=min(dp[j],v[i]);
		}
		for(int j=w[i];j<=h;j++) {
			dp[j]=min(dp[j],dp[j-w[i]]+v[i]);
		}
	}
	cout<<dp[h]<<'\n';
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <iomanip>
using namespace std;
typedef long long int ll;
typedef pair<int,int> pii;

template<class T> T umax(T a,T b) {return (a>b?a:b);}
template<class T> T umin(T a,T b) {return (a<b?a:b);}
template<class T,class P> T umax(T a,P b) {return (a>b?a:b);}
template<class T,class P> T umin(T a,P b) {return (a<b?a:b);}

typedef long long int ll;
const int maxn = 1e5+7;
const ll mod = 1e9+7;

bool compare(const pair<ll,ll>& x, const pair<ll,ll>& y) {
    if(x.second == y.second) return x.first < y.first;
    return x.second < y.second;
}

ll power(ll a,ll b) {
    ll res = 1;
    while(b) {
        if(b&1) {
            res = (res*a)%mod;
        }
        a = (a*a)%mod;
        b >>= 1;
    }
    return res;
}

ll gcd(ll a,ll b) {
    if(b == 0) return a;
    return gcd(b,a%b);
}

int main() {
    string s;
    cin >> s;
    char ch;
    int q,type,part;
    cin >> q;
    int rev = 0;
    vector<char> beg,end;
    while(q--) {
        cin >> type;
        if(type == 1) {
            rev = 1-rev;
        } else {
            cin >> part >> ch;
            if(rev == 1) {
                if(part == 1) {
                    part = 2;
                } else {
                    part = 1;
                }
            }
            if(part == 1) beg.push_back(ch);
            else end.push_back(ch);
        }
    }
    string ans = "";
    if(rev == 1) {
        reverse(s.begin(),s.end());
        for(int i=end.size()-1;i>=0;i--) {
            ans += end[i];
        }
        ans += s;
        for(int i=0;i<beg.size();i++) {
            ans += beg[i];
        }
    } else {
        for(int i=beg.size()-1;i>=0;i--) {
            ans += beg[i];
        }
        ans += s;
        for(int i=0;i<end.size();i++) {
            ans += end[i];
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1368
//url:
//problem name:

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
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;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long long,long long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long long>>;

int main() {
    int A,B;
    cin >> A >> B;
    if(A > B) cout << A + (A-1) << endl;
    else if(A == B) cout << A + A << endl;
    else cout << B + (B-1) << endl;
}

Measured memory_bytes: 256
H, W = map(int, input().split())
c = []
for _ in range(H):
    *w, = map(int, input().split())
    c.append(w)

dp = []
for _ in range(H+2):
    dp.append([0]*(W+2))

ans = 0
for h in range(1, H+1):
    for w in range(1, W+1):
        if c[h-1][w-1] == 1:
            dp[h][w] = 0
        else:
            dp[h][w] = 1+min([
                dp[h-1][w-1],
                dp[h-1][w],
                dp[h][w-1]
            ])
            if ans < dp[h][w]:
                ans = dp[h][w]

print(ans**2)



Measured memory_bytes: 55212
import java.util.*;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int M = sc.nextInt();
		int s = 0;
		for (int i = N - 1; i > 0; i--)
			s = s + i;
		for (int i = M - 1; i > 0; i--)
			s = s + i;
		System.out.println("" + s);
	}
}

Measured memory_bytes: 23252
card = []
# card.append([int(i) for i in input().split()])
# card.append([int(i) for i in input().split()])
# card.append([int(i) for i in input().split()])
# カードの数値は順番にしておいて、あとから四角くする
card.extend([int(i) for i in input().split()])
card.extend([int(i) for i in input().split()])
card.extend([int(i) for i in input().split()])

N = int(input())
hits = []
for i in range(N) :
    h = int(input())
    if (h in card) :
        idx = card.index(h)
        card[idx] = "o"
    # hits.append(int(input()))

# print(card)

# もう愚直に
is_bingo = False
# 横の調査
if (card[0] == "o" and card[1] == "o" and card[2] == "o") :
    is_bingo = True
if (card[3] == "o" and card[4] == "o" and card[5] == "o") :
    is_bingo = True
if (card[6] == "o" and card[7] == "o" and card[8] == "o") :
    is_bingo = True

# 縦の調査
if (card[0] == "o" and card[3] == "o" and card[6] == "o") :
    is_bingo = True
if (card[1] == "o" and card[4] == "o" and card[7] == "o") :
    is_bingo = True
if (card[2] == "o" and card[5] == "o" and card[8] == "o") :
    is_bingo = True

# ななめ
if (card[0] == "o" and card[4] == "o" and card[8] == "o") :
    is_bingo = True
if (card[2] == "o" and card[4] == "o" and card[6] == "o") :
    is_bingo = True

if (is_bingo) :
    print("Yes")
else :
    print("No")



Measured memory_bytes: 3064
a,b=map(int,input().split())
print("100 100")
a-=1
b-=1
for i in range(100):
    if i%2==0:
        print("."*50+"#"*50)
    else:
        for j in range(50):
            if j%2==0 or j==49:
                print(".",end="")
            else:
                if b>0:
                    print("#",end="")
                    b-=1
                else:
                    print(".",end="")
        for j in range(50):
            if j%2==0 or j==49:
                print("#",end="")
            else:
                if a>0:
                    print(".",end="")
                    a-=1
                else:
                    print("#",end="")
        print("")


Measured memory_bytes: 45548
//Robs Code
/***********HEADER***************/
#include<bits/stdc++.h>
/***********MACROS***************/
#define ll long long int
#define fri(l,k) for (i=l;i<=k;i++)
#define frj(l,k) for (j=l;j>=k;j--)
#define fij(a,b,l,k) for(i=a;i<=b;i++) for(j=l;j<=k;j++)
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define endl "\n"
#define pb push_back
#define _1 first
#define _2 second
#define mxsz 10000007
#define mxval 1e9
#define grt [](auto x,auto y){return x>y;}
#define pii pair<ll,ll>
/*********VARIABLE****************/
using namespace std;
ll i,j,n,m,k,l,q,t,a,b,c,sum[3],tot[3],cnt[3];
/***********MAIN******************/
int main()
{
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	cin>>n>>m>>c;
    vector<ll> v(m);
    fri(0,m-1) cin>>v[i];
    for(i=0;i<n;i++){
        sum[0]=0;
        for(j=0;j<m;j++){
            cin>>a;
            sum[0]+=(v[j]*a);
        }
        if(sum[0]>(-c)){
            cnt[0]++;
        }
    }
    cout<<cnt[0];
	return 0;
}
//.........

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

using namespace std;

int main()
{
	 ll n;
	map<ll,ll> cnt;
	cin>>n;
	while(n--)
	{
		ll input;
		cin>>input;
		cnt[input]++;
	}
	cout<<cnt.size()<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    int N;
    cin >> N;
    int x[N], y[N];
    for (int i = 0; i < N; i++) {
        cin >> x[i] >> y[i];
    }

    vector<int> v(N);
    for (int i = 0; i < N; i++) {
        v[i] = i;
    }

    double dist = 0;

    do {
        for (int i = 1; i < N; i++) {
            double dx = x[v[i]]-x[v[i-1]];
            double dy = y[v[i]]-y[v[i-1]];
            double squx = pow(dx, 2);
            double squy = pow(dy, 2);
            dist += pow(squx + squy, 0.5);
        }
    } while (next_permutation(v.begin(), v.end()));

    double factorial = 1;
    for (int i = 1; i <= N; i++) {
        factorial *= i;
    }
    double ave = dist/factorial;

    cout << fixed << setprecision(10);
    cout << ave << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <queue>
#include <cstring>
using namespace std;

#define PII pair<int, int>
#define A first
#define B second
#define MP make_pair
#define ll long long

const int YEAR = 2019;
int num[2][YEAR];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s; cin >> s;
    ll ans = 0;
    int cur = 0;
    num[cur][0] = 1;
    for (int i=0; i<s.size(); i++) {
        int now = s[i]-'0';
        int ind = now;
        for (int j=0; j<YEAR; j++) {
            num[cur][ind] = num[!cur][j];
            ind += 10;
            if (ind >= YEAR) ind -= YEAR;
        }
        num[cur][now]++;
        ans += num[cur][0];
        cur = !cur;
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 3376
#include "bits/stdc++.h"
#define rep(i,a,n) for(int i=a;i<=n;i++)
#define per(i,a,n) for(int i=n;i>=a;i--)
#define pb push_back
#define mp make_pair
#define FI first
#define SE second
#define maxn 200000
#define mod 1000000007
#define inf 0x3f3f3f3f
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef double db;

int x[maxn+5],y[maxn+5],id[maxn+5];
int fa[maxn+5],sz[maxn+5],mn[maxn+5];

int getfa(int x)
{
    if(fa[x]==x) return x;
    return fa[x]=getfa(fa[x]);
}

int main()
{
    int n; scanf("%d",&n);
    rep(i,1,n) scanf("%d%d",&x[i],&y[i]),id[i]=i;
    sort(id+1,id+n+1,[](int a,int b){return x[a]<x[b];});
    rep(i,1,n) fa[i]=i,mn[i]=i,sz[i]=1;
    stack<int> s;
    rep(I,1,n)
    {
        int i=id[I];
        while(s.size() && y[s.top()]<y[i])
        {
            int j=s.top(); s.pop();
            int fi=getfa(i);
            int fj=getfa(j);
            if(fi!=fj)
            {
                //printf("! %d: %d %d\n",I,i,j);
                if(sz[fi]<sz[fj]) swap(fi,fj);
                sz[fi]+=sz[fj];
                fa[fj]=fi;
                if(y[mn[fi]]>y[mn[fj]]) mn[fi]=mn[fj];
            }
        }
        int x=mn[getfa(i)]; s.push(x);
    }
    rep(i,1,n) printf("%d\n",sz[getfa(i)]);
    return 0;
}

Measured memory_bytes: 8452
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define rep(i,n) for(int i=0;i<n;i++)
#define INF 999999999
const int mod = 1000000007;
ll cnt = 0;

int main(){
  int n;cin >> n;
  int a[n+1];
  a[1]=1;
  map<int,int>mp;
  for(int i=2;i<=n;i++){
      cin >> a[i];
      mp[a[i]]++;
  }
  for(int i=1;i<=n;i++){
      cout << mp[i] << endl;
  }

return 0;

}

Measured memory_bytes: 13756
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#include <map>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uld = unsigned long long;
using P = pair<int,int>;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
template<class T> inline bool chmax(T &a,T& b){if(a < b){a = b; return true;} else return false;}
template<class T> inline bool chmin(T &a,T& b){if(a > b){a = b; return true;} else return false;}
//struct area

//function area

//main area
int main(){
    string s;
    cin >> s;
    int n = s.size();
    bool check = true;
    int C_place;

    //一個目
    if(s[0] != 'A'){
        check = false;
    }

    //二個目
    int cnt = 0;
    for(int i=2; i<n-1; i++){
        if(s[i] == 'C'){
            cnt++;
            C_place = i;
        }
    }
    if(cnt != 1) check = false;

    //三個目
    rep(i, n){
        if(i == C_place || i == 0) continue;
        if(s[i] < 'a' || 'z' < s[i]){
            check = false;
        }
    }
    cout << (check ? "AC" : "WA") << endl;
}
/*

一個ずつ判定する
・s[0] == 'A'
・2 <= i <= s.size()-2      cnt = 1
・上二つ以外の座標において'a' <= s[i] <= 'z'を満たす

*/


Measured memory_bytes: 3592
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
// run : ctrl + c 

template<class T>bool chmax(T &a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T>bool chmin(T &a,T b){if(b<a){a=b;return 1;} return 0;}

double eps = 1e-6;


signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

   
   ll a,b,c;
   cin>>a>>b>>c;
   if(a >= c+b){
       cout << "No" << endl;
       return 0;
   }
   ll pos = (c+b-a) * (c+b-a) - 4*c*b;
   if(pos > 0)
   {
       cout << "Yes" << endl;
   }
   else  cout << "No" << endl;
}

Measured memory_bytes: 256
N = int(input())
S = [input() for i in range(N)]


AC = 0
WA = 0
TLE = 0
RE = 0

for s in S:
    if s == 'AC':
        AC += 1
    elif s == 'WA':
        WA += 1
    elif s == 'TLE':
        TLE += 1
    elif s == 'RE':
        RE += 1

print(f'AC x {AC}')
print(f'WA x {WA}')
print(f'TLE x {TLE}')
print(f'RE x {RE}')

Measured memory_bytes: 16324
#include <stdio.h>

int main(){
    int n, idx, debt = 100000;
    scanf("%d", &n);
    for(idx = 0; idx < n; ++idx){
        debt *= 1.05;
        if(debt - debt / 1000 * 1000){
            debt = debt / 1000 * 1000 + 1000;
        }
    }
    printf("%d\n", debt);
    return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define fast                                                                   \
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long
#define ll long long
#define f(i, n) for (int i = 0; i < n; i++)
#define F first
#define S second
#define pii pair<int,int>
#define sz size()
#define all(v) v.begin(),v.end()
#define pb push_back
#define pf push_front    
#define PB pop_back
#define pll pair<long long, long long>
#define vl vector<int>
#define mp make_pair
#define mod 1000000007
typedef unsigned long long ull;
const int N = 200005;
const int MOD = 998244353 ;



void solve(){
    int n;
    string s, t, ans;
    cin>>n>>s>>t;
    f(i,n){
        ans.pb(s[i]);
        ans.pb(t[i]);
    }
    cout<<ans;
}


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


Measured memory_bytes: 256