akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <cassert>
#include <random>
using namespace std;
using ll = long long;


int main() {
	int n, k; cin >> n >> k;
	vector<double> x(n), y(n), c(n);
	for (int i = 0; i < n; i++) {
		cin >> x[i] >> y[i] >> c[i];
	}
	auto dist = [](double a, double b, double c = 0, double d = 0) {
		return sqrt((a - c)*(a - c) + (b - d)*(b - d));
	};
	auto cntp = [&](double u, double v, double r) {
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			double d = dist(x[i], y[i], u, v);
			cnt += c[i]*d <= r + 1e-8;
		}
		return cnt;
	};
	auto cross = [&](double a, double b, double r, double c, double d, double s, bool neg) -> pair<double, double> {
		c -= a;	d -= b;
		double dcd = dist(c, d)*dist(c, d);
		double t = 0.5 * (dcd + r*r - s*s);
		double sgn = neg ? -1 : 1;
		if (dcd*r*r - t*t < 0) {
			return make_pair(1e18, 1e18);
		}
		double xx = (t*c + sgn*d*sqrt(dcd*r*r - t*t)) / dcd;
		double yy = (t*d - sgn*c*sqrt(dcd*r*r - t*t)) / dcd;
		xx += a; yy += b;
		return make_pair(xx, yy);
	};
	double lo = 0, hi = 1e9;
	for (int iter = 0; iter < 100; iter++) {
		double mid = (lo + hi) / 2;
		bool flag = false;
		for (int i = 0; i < n; i++) {
			flag |= cntp(x[i], y[i], mid) >= k;
		}
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				double u, v;
				tie(u, v) = cross(x[i], y[i], mid/c[i], x[j], y[j], mid/c[j], false);
				if (u < 1e17) flag |= cntp(u, v, mid) >= k;
				tie(u, v) = cross(x[i], y[i], mid/c[i], x[j], y[j], mid/c[j], true);
				if (u < 1e17) flag |= cntp(u, v, mid) >= k;
			}
		}
		if (flag) hi = mid;
		else lo = mid;
	}
	printf("%.10f\n", lo);
	return 0;
}


Measured memory_bytes: 256
//code by lynmisakura.wish to be accepted!
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;

int main(void){
    ll n;scanf("%lld",&n);
    vector<ll> a(n);
    for(int i = 0;i < n;i++)scanf("%lld",&a[i]);
    int cnt = n;int now = 1;
    for (int i = 0; i < n; ++i)
    {
        if(a[i] == now){
            cnt--;now++;
        }
    }
    if(cnt == n)printf("-1\n");
    else printf("%d\n", cnt);
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int p[3] = {9, 6, 1};

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

    vector<int> dp(N + 1, 1 << 30);
    dp[0] = 0;
    REP(i, 0, N) {
        REP(j, 0, 3) {
            int v = p[j];
            while (v <= N) {
                if (i + v > N) break;
                dp[i + v] = min(dp[i + v], dp[i] + 1);
                v *= p[j];
                if (v == 1) break;
            }
        }
    }

    cout << dp[N] << endl;

    return 0;
}

Measured memory_bytes: 640
import { readFileSync } from "fs";

const read = () =>
  readFileSync(0, "utf8")
    .split("\n")
    .map((line) => line.split(" "));

const main = (input: string[][]) => {
  const A = Number(input[0][0]);
  const B = Number(input[0][2]);
  const op = input[0][1];

  return op === "+" ? A + B : A - B;
};

console.log(main(read()));


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

using namespace std;

int main(){
    int a,b;
    int d,r;
    double f;

    cin >> a >> b;

    d = a/b;
    r = a%b;
    f = (double)a/(double)b;

    cout << fixed << setprecision(8) << d << " " << r << " " << f << endl;

    return 0;
}


Measured memory_bytes: 3284
/* 
	今日も一日がんばるぞい
*/
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<< '\n'

int main(){
    int n;
    cin >> n;
    int a[n];//ソートするやつ
    vector<int> v;
    int t;
    REP(i,n){
        cin >> t;
        a[i] = t;
        v.push_back(t);
    }
    sort(v.begin(),v.end());
    int num1 = v[(n-1)/2];
    int num2 = v[n/2];
    REP(i,n){
        if(a[i]<=num1)COUT(num2);
        else COUT(num1);
    }
    return 0;
}


Measured memory_bytes: 3828
k=int(input())
import math
def ggcd(a,b,c):
    return math.gcd(math.gcd(a,b),math.gcd(a,c))
a=0
for i in range(1,1+k):
    for j in range(1,1+k):
        for l in range(1,1+k):
            a+=ggcd(i,j,l)
print(a)

Measured memory_bytes: 71196
#include <stdio.h>

int
main(void)
{
  int n, i = 1;
  scanf("%d", &n);

  while (i <= n) {
    int x = i;
    if (x % 3 == 0) {
      printf(" %d", i);
    } else {
      while (x) {
        if (x % 10 == 3) {
          printf(" %d", i);
          break;
        }
        x = x / 10;
      }
    }
    i += 1;
  }
  printf("\n");
}

Measured memory_bytes: 1776
package main

import (
    "bufio"
    "fmt"
    "os"
)

var r = bufio.NewReader(os.Stdin)

func main() {
    var x int
    fmt.Fscan(r, &x)
    h := x / 3600
    m := x % 3600 / 60
    s := x % 60
    fmt.Print(h,":",m,":",s,"\n")
}


Measured memory_bytes: 1156
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define endl "\n"
#define FASTIO cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(false);
#define loop(i,a,b) for(int i=a; i<b; i++)
#define INF 10000000000099ll
#define mod 1000000007
#define prDouble(x) cout<<fixed<<setprecision(10)<<x

ll dp[22][(1 << 22)];

ll solve(vector<vector<int>>& compat, int i, int womenSubset, int n)
{
	if (i == n + 1) {
		if (womenSubset == 0) return 1;
		return 0;
	}
	if (dp[i][womenSubset] != -1) {
		return dp[i][womenSubset];
	}
	ll ans = 0;
	for (int women = 0; women < n; women++) {
		bool available = (((1 << women) & (womenSubset)) == 0) ? 0 : 1;
		if (available && compat[i][women + 1]) {
			ans = (ans + solve(compat, i + 1, womenSubset ^ (1 << women), n)) % mod;
		}
	}
	return dp[i][womenSubset] = ans;
}

int main()
{
	FASTIO;
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	int n;
	cin >> n;
	vector<vector<int>> compat(n + 1, vector<int>(n + 1));
	memset(dp, -1, sizeof dp);
	loop(i, 1, n + 1)
	loop(j, 1, n + 1)
	cin >> compat[i][j];
	cout << solve(compat, 1, ((1 << (n)) - 1), n); //2^n-1
	return 0;
}



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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s, t;
  cin >> s >> t;

  int sz = t.size();
  int pos = -1;
  for(int i=0;i<s.size()-t.size()+1;i++) {
    bool ok = true;
    for(int j=i;j<i+t.size();j++) {
      if(s[j] == t[j-i] || s[j] == '?') continue;
      else ok = false;
    }
    if(ok)
      pos = i;
  }
  if(pos < 0) {
    cout <<"UNRESTORABLE"<< endl;
    return 0;
  }

  for(int i=0;i<s.size();i++) {
    if(i >= pos && i <= pos+t.size()-1)
      s[i] = t[i-pos];
    else if(s[i] == '?')
      s[i] = 'a';
  }

  cout << s << endl;

}


Measured memory_bytes: 256
n=int(input())
a=list(map(int, input().split()))
b=[]
cnt=0

for num in a:
    if num < 0:
        cnt+=1
        b.append(abs(num))
    else:
        b.append(num)

if cnt%2 == 0:
    ans=sum(b)
else:
    ans=sum(b)-2*min(b)

print(ans)

Measured memory_bytes: 14252
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <regex>
#include <random>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exout(x) printf("%.10f\n", x)
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e18;
const ll MAX_N = 201010;

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

ll dx[4] = { 0,0,-1,1 };
ll dy[4] = { -1,1,0,0 };
ll h, w;
char a[1010][1010];
ll res[1010][1010];

//long longしか使わない
//素数は1より大きい
//lower_boundは指定したkey以上の要素の一番左のイテレータをかえす
//upper_boundは指定したkeyより大きい要素の一番左のイテレータをかえす
int main() {
	cin >> h >> w;
	deque<pair<ll,ll>>q;
	rep(i, h) {
		rep(j, w) {
			cin >> a[i][j];
			if (a[i][j] == '#') {
				q.push_back(make_pair(i, j));
				res[i][j] = 1;
			}
		}
	}
	while (!q.empty()) {
		pair<ll, ll>target = q.front();
		ll y = target.first;
		ll x = target.second;
		q.erase(q.begin());
		rep(i, 4) {
			ll ny = y + dy[i];
			ll nx = x + dx[i];
			if (0 <= ny && ny < h && 0 <= nx && nx < w) {
				if (res[y + dy[i]][x + dx[i]] == 0) {
					res[y + dy[i]][x + dx[i]] = res[y][x] + 1;
					q.push_back(make_pair(y + dy[i], x + dx[i]));
				}
			}
		}
	}
	ll ans = 0;
	rep(i, h) {
		rep(j, w) {
			ans = max(ans, res[i][j]);
		}
	}
	ans--;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 28644
import sys
N,Y=[int(x) for x in input().rstrip().split()]

flag=0
for x in range(N+1):
  for y in range(N+1):
    if (x*10000+y*5000+(N-(x+y))*1000)==Y and 0<=N-(x+y):
      print(x,y,N-(x+y))
      flag=1
      sys.exit()
print(-1,-1,-1)


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

using namespace std;

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

    int menor = INT_MAX;

    if( a + b < menor ) 
        menor = a + b;
    if ( c + b < menor )
        menor = c + b;
    if( a + c < menor )
        menor = a + c;



    cout << menor << endl;

    return 0;
}

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

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		a[i]--;
	}
	vector<int> b(n);
	for (int i = 0; i < n; i++) {
		cin >> b[i];
	}
    vector<int> c(n - 1);
    for (int i = 0; i < n - 1; i++) {
    	cin >> c[i];
    }

    int ans = 0;
    for (int i = 0; i < n; i++) {
    	ans+= b[a[i]];
    	if (i > 0 && a[i] == a[i - 1] + 1) {
    		ans += c[a[i - 1]];
    	}
    }
    cout << ans << "\n";
    return 0;
}

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

using namespace std;

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

int main(){
  std::cin.tie(nullptr);                  // 標準入出力高速化
  std::ios_base::sync_with_stdio(false);  // SとS++の入出力出力を非同期
  int n;
  cin>>n;
  int d[n],sum=0;
  rep(i,0,n)cin>>d[i];
  rep(i,0,n){
    rep(j,i+1,n){
      sum+=d[i]*d[j];
    }
  }
  cout<<sum<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>
#include <fstream>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
using namespace std;


#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++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD 1000000007
#define P pair<ll, ll>

ll cnt[1100220];

int main() {
	ll n;
	cin >> n;
	REP(i, n - 1) {
		ll a;
		cin >> a;
		cnt[a]++;
	}
	REP(i, n)cout << cnt[i + 1] << endl;
}


Measured memory_bytes: 5192
#include <stdio.h>

int main(){
    int a,b,c;
    scanf("%d %d %d",&a,&b,&c);
    int i, ans;
    i=a;
    while(i<=b){
        if(c%i==0)
            ans++;
            i++;
    }
    printf("%d\n", ans);
    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>

using namespace std;
using namespace __gnu_pbds;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
template <class T> using Tree = tree<T, null_type, less<T>, rb_tree_tag,tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i=a; i<(b); i++)
#define F0R(i, a) for (int i=0; i<(a); i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

const int MOD = 1000000007;

int N,M,K;

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin >> N >> M >> K;
	F0R(i,N+1) F0R(j,M+1) if (K == i*j+(N-i)*(M-j)) {
	    cout << "Yes";
	    return 0;
	}
	cout << "No";
}

// read!
// ll vs. int!

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

#define vec              vector<int>
#define vecll            vector<ll>
#define vecd             vector<double>
#define vecst            vector<string>
#define vecb             vector<bool>
#define v2(v,n,m,init)   vector<vector<int>>  v(n, vector<int>(m, init))
#define vb2(v,n,m,init)  vector<vector<bool>> v(n, vector<bool>(m, init))
#define vll2(v,n,m,init) vector<vector<ll>>   v(n, vector<ll>(m, init))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << (var) << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << (var);
#define prt2(v1, v2)     cout << (v1) << " " << (v2) << "\n"
#define prt3(v1, v2, v3) cout << (v1) << " " << (v2) << " " << (v3) << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
template <typename T>
bool chmax(T &a, const T& b){if(a<b){a=b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a>b){a=b; return true;} return false;}
//------------------------------------------------------------------

int main(void){
  int h, w;
  cin >> h >> w;
  arrst(s,h);

  vecst ans(h);
  rep(i,h){
    rep(j,w){
      if(s[i][j]=='#') {ans[i].push_back('#'); continue;}
      int tmp=0;
      if(i!=0){
        if(j!=0) tmp += s[i-1][j-1]=='#';
        tmp += s[i-1][j]=='#';
        if(j!=w-1) tmp += s[i-1][j+1]=='#';
      }
      if(j!=0) tmp += s[i][j-1]=='#';
      if(j!=w-1) tmp += s[i][j+1]=='#';
      if(i!=h-1){
        if(j!=0) tmp += s[i+1][j-1]=='#';
        tmp += s[i+1][j]=='#';
        if(j!=w-1) tmp += s[i+1][j+1]=='#';
      }
      char x = '0'+tmp;
      ans[i].push_back(x);
    }
  }

  rep(i,h){
    prt(ans[i]);
  }
}


Measured memory_bytes: 3644
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<cstring>
#include<cmath>
#include<ctime>
#include<algorithm>
#include<utility>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>
#define EPS 1e-9
#define PI acos(-1.0)
#define INF 0x3f3f3f3f
#define LL long long
const int MOD = 1E9+7;
const int N = 1000000+5;
const int dx[] = {0,0,-1,1,-1,-1,1,1};
const int dy[] = {-1,1,0,0,-1,1,-1,1};
using namespace std;
int a[N];
int main() {
    int n,t;
    scanf("%d%d",&n,&t);
    for(int i=1;i<=n;i++)
        scanf("%d",&a[i]);

    int maxx=-INF,temp=-INF;
    for(int i=n;i>=1;i--){
        temp=max(temp,a[i]);
        maxx=max(maxx,temp-a[i]);
    }
    
    temp=-INF;
    int res=0;
    for(int i=n;i>=1;i--){
        temp=max(temp,a[i]);
        if(maxx==temp-a[i])
            res++;
    }
    printf("%d\n",res);

    return 0;
}


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

int main()
{
  int k, x;
  cin >> k >> x;
  cout << ((500 * k >= x) ? "Yes" : "No") << 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 rep2(i, x, n) for(int i = x; i < n; i++)
#define elif else if
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll MOD2 = 998244353;
const ll INF = 1e18;

int main(){
    int N;
    cin >> N;
    double x[N], y[N], arg[N];
    vector<pair<double, int> >vec;
    rep(i, N){
        cin >> x[i] >> y[i];
        arg[i] = atan2(y[i], x[i]);
        vec.push_back(make_pair(arg[i], i));
    }
    sort(vec.begin(), vec.end());
    double M = 0;
    rep(i, N){
        rep(j, N+1){
            double X = 0, Y = 0, R;
            rep(k, j){
                int l = vec[(i+k)%N].second;
                X += x[l];
                Y += y[l];
            }
            R = sqrt(X*X+Y*Y);
            M = max(M, R);
        }
    }
    cout << setprecision(30) << M << endl;
}

Measured memory_bytes: 256
MOD = 10**9 + 7

def nCr(n, r):
    r = min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n+1-i) % MOD
        denom = denom * i % MOD
    return numer * pow(denom, MOD-2, MOD) % MOD


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

    print((pow(2, n, MOD)-1-nCr(n, a)-nCr(n, b)) % MOD)

if __name__ == "__main__":
    main()

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

//使用flag的冒泡排序
int BubbleSort(int A[], int N) {
	int sw = 0;
	bool flag = 1;
	for (int i = 0; flag; i++) {
		flag = 0;
		for (int j = N - 1; j >= i + 1; j--) {
			if (A[j] < A[j - 1]) {
				swap(A[j], A[j - 1]);
				flag = 1;
				sw++;
			}
		}
	}
	return sw;
}
int main() {
	int A[100], N, sw;

	cin >> N;
	for (int i = 0; i < N; i++) cin >> A[i];

	sw = BubbleSort(A, N);

	for (int i = 0; i < N;i++) {
		if (i) cout << " ";
		cout << A[i];
	}

	cout << endl;
	cout << sw << endl;
	return 0;
}


Measured memory_bytes: 3084
N,M = map(int,input().split(' '))
l = [list(map(int,input().split())) for i in range(M)]
st = 0
ed = N
flag = False
for i in l:
    if st<i[0]:
        st = i[0]
    if i[1]<ed:
        ed = i[1]
    if st>ed:
        flag = True
        print(0)
        break
if not flag:
    print(ed-st+1)

Measured memory_bytes: 27332
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, n) for (int i = 0; i < n; i++)
#define MAX 100001
#define INF 1000000009
#define MOD 1000000007

typedef long long int lli;

int main(void) {
  int H, W;
  scanf("%d %d", &H, &W);

  int c[10][10];
  rep(i, 10) rep(j, 10) scanf("%d", &c[i][j]);
    
  int A[201][201];
  rep(h, H) rep(w,W) scanf("%d", &A[h][w]);

  rep(k, 10) rep(i, 10) rep(j, 10) 
    c[i][j] = min(c[i][j], c[i][k] + c[k][j]);

  int ans = 0;
  rep(h, H) rep(w, W) {
    if (A[h][w] == -1) continue;
    ans += c[A[h][w]][1];
  }
  
  printf("%d\n", ans);

  return 0;
}


Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<map>
#include<vector>
#include<queue>
#include<stack>
#include<climits>
#include<set>
#include<utility>
#include<typeinfo>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef set<int> S;
#define rep(i, n) for(int i=0; i<n; i++)
const ll MOD=1e9+7;

int main(){

	int a, b, c;
	cin >> a >> b >> c;
	cout << min(b/a, c) << endl;

	return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<algorithm>
using namespace std;
int main(){
   int N;
   while(cin >> N,N != 0){
	int player[11]={0};
	string card;
	cin >> card;

	int i=0,j=0,F=0;
	while(card[i] != '\0'){
		if(j == N){
			j = 0;
		}
		if(card[i] == 'M'){
			player[j]++;
		}else if(card[i] == 'S'){
			F = F + player[j] + 1;
			player[j] = 0;
		}else if(card[i] == 'L'){
			player[j] = player[j] + F + 1;
			F = 0;
		}

		i++;
		j++;
	}

	sort(player,player + N);

	for(int k=0;k<N-1;k++){
		cout << player[k] << " ";
	}
	cout << player[N-1] <<  " " << F << endl;
   }

   return 0;
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
#define repp(i,l,r)for(long long i=(l);i<(r);i++)
#define rep(i,n) for (long long i = 0; i < (n); ++i)
#define per(i,n) for (long long i = (n); i >= 0; --i)
const int INF = 1 << 30;//int max
const long long int MOD = 1000000007;
using namespace std;
using ll = long long;
using P = pair<int,int>;
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; }

struct UnionFind{
    vector<long long> par;
    vector<long long> siz;
    //Constractor
    UnionFind(long long sz_) : par(sz_),siz(sz_,1LL){
        for(long long i = 0;i < sz_;i++)par[i] = i;
    }
    void init(long long sz_){
        par.resize(sz_);
        siz.resize(sz_);
        for(long long i = 0;i < sz_;i++)par[i] = i;
    }
    //MemberFunc
    long long find(long long x){
        while(par[x] != x)x = par[x] = par[par[x]];
        return x;
    }
    void unite(long long x, long long y){
        x = find(x);
        y = find(y);
        if(x == y)return;
        if(siz[x] < siz[y])swap(x,y);
        siz[x] += siz[y];
        par[y] = x;
    }
    bool same(long long x, long long y){
        return find(x) == find(y);
    }
    long long size(long long x){
        return siz[find(x)];
    }
};

//ミョ(-ω- ?)
int main() {
    int n,m;
    cin >> n >> m;
    vector<P> v(m);
    rep(i,m){
        cin >> v[i].first >> v[i].second;
        --v[i].first;
        --v[i].second;
    }
    int res = 0;
    rep(i,m){
        UnionFind uf(n);
        rep(j,m){
            if(i != j)uf.unite(v[j].first,v[j].second);
        }
        rep(j,n){
            bool b = 0;
            rep(k,n){
                if(j == k)continue;
                if(!uf.same(j,k)){
                    b = true;
                    break;
                }
            }
            if(b){
                res++;
                break;
            }
        }
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3632
import std.algorithm;
import std.array;
import std.container;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

int readint() {
    return readln.chomp.to!int;
}

int[] readints() {
    return readln.split.map!(to!int).array;
}

void main() {
    auto q = BinaryHeap!(int[])(new int[2_000_000 + 1], 0);

    string s;
    while ((s = readln.chomp).length > 0) {
        if (s == "end")
            break;

        if (s[0] == 'e') { // extract
            writeln(q.front);
            q.popFront;
        }
        else {
            auto ss = s.split;
            int x = ss[1].to!int;
            q.insert(x);
        }
    }
}

Measured memory_bytes: 11120
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	n := nextInt(sc)

	valsB := make([]int64, n)
	valsF := make([]int64, n)
	valsR := make([]int64, n)
	valsV := make([]int64, n)
	for i := int64(0); i < n; i++ {
		valsB[i] = nextInt(sc)
		valsF[i] = nextInt(sc)
		valsR[i] = nextInt(sc)
		valsV[i] = nextInt(sc)
	}

	m := make(map[int64]int64)
	for i := int64(0); i < n; i++ {
		k := valsB[i]*1000 + valsF[i]*100 + valsR[i]
		v, ok := m[k]
		if !ok {
			v = 0
		}
		m[k] = v + valsV[i]
	}

	var out string
	for b := int64(1); b <= 4; b++ {
		if b != 1 {
			out += "####################\n"
		}
		for f := int64(1); f <= 3; f++ {
			for r := int64(1); r <= 10; r++ {
				out += " "

				k := b*1000 + f*100 + r
				v, ok := m[k]
				if !ok {
					v = 0
				}
				out += strconv.FormatInt(v, 10)
				if r == 10 {
					out += "\n"
				}
			}
		}
	}
	fmt.Print(out)
}

func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func nextInt(sc *bufio.Scanner) int64 {
	i, err := strconv.ParseInt(nextString(sc), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}



Measured memory_bytes: 1188
A = int(input())
B = int(input())
C = int(input())
X = int(input())
ans = 0
for i in range(A+1):
  for j in range(B+1):
    for k in range(C+1):
      if 500*i + 100*j + 50*k == X:
        ans += 1
print(ans)

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

#define rep(i,n) for(int i=0;i<(n); ++i)
#define INF 100000 // 2^31-1
#define MAX_V 1000


using namespace std;

using ll =long long;
using P = pair<int,int>;


 
int ctoi(const char c){
  switch(c){
    case '0': return 0;
    case '1': return 1;
    case '2': return 2;
    case '3': return 3;
    case '4': return 4;
    case '5': return 5;
    case '6': return 6;
    case '7': return 7;
    case '8': return 8;
    case '9': return 9;
    default : return -1;
  }
}

//5
int gcd(int a,int b){return b?gcd(b,a%b):a;}


int main() {

ios::sync_with_stdio(false);
cin.tie(0);

int n,m,x;

cin>>n>>m>>x;


int c[n];
int a[n][m];


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

}

long long int mini=1000000000;


    // {0, 1, ..., n-1} の部分集合の全探索
    for (int bit = 0; bit < (1<<n); ++bit) {
	long long int res[m]={};
	long long int costs=0;
        for (int i = 0; i < n; ++i) {
            if (bit & (1<<i)) { // 列挙に i が含まれるか
                costs+=c[i];
		for(int j=0;j<m;j++){
		res[j]+=a[i][j];
		}
            }
        }
	
	sort(res,res+m);
	if(res[0]>=x){
	mini=min(mini,costs);		
//	cout<<res[m-1]<<"=="<<costs<<endl;

	}
        
    }


if(mini==1000000000){
cout<<"-1"<<endl;
}else{
cout<<mini<<endl;
}

}

//cout << fixed << setprecision(5) <<(n*2)*M_PI << endl;

Measured memory_bytes: 3660
#include <stdio.h>
int main (int argc, char * argv[])
{
    int a,b,d;
    char op;
    while (1){
    scanf("%d %c %d",&a,&op,&b);
    if(op=='+'){
        d = a+b;
    }else if(op=='-'){
        d = a-b;
    }else if(op=='*'){
        d = a*b;
    }else if(op=='/'){
        d = a/b;
    }else if(op=='?'){
        break;
    }
    printf("%d\n",d);
        
    }
    return 0;
}




Measured memory_bytes: 2040
h = 0
w = 0
dataset = []

while True:
    h, w = map(int, input().split())
    if (h >= 3 and h <= 300) and (w >= 3 and w <= 300):
        listed = []
        listed.append(h)
        listed.append(w)
        dataset.append(listed)
    elif h == 0 and w == 0:
        break
    else:
        break

for listed in dataset:
    h = listed[0]
    w = listed[1]

    for i in range(0, 1):
        for j in range(w):
            print("#", end="")
        print()
    for i in range(1, h-1):
        for j in range(0, 1):
            print("#", end="")
        for j in range(1, w-1):
            print(".", end="")
        for j in range(w-1, w):
            print("#", end="")
        print()
    for i in range(h-1, h):
        for j in range(w):
            print("#", end="")
        print()
    print()

Measured memory_bytes: 9168
#include<iostream>

using namespace std;

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

    int len = 0;
    int i = 0;
    while(s[i]){
        len++;
        i++;
    }

    int start = 0, end = 0;
    for(i=0;i<len;i++){
        if(s[i]=='A'){
            start = i;
            break;
        }
    }
    for(i=len-1;i>=0;i--){
        if(s[i]=='Z'){
            end = i;
            break;
        }
    }
    cout << end - start + 1 << endl;
}


Measured memory_bytes: 644
#include<iostream>
#include<algorithm>
#include<iomanip>
#include"math.h"

#define MAX 1000000

int main(){
    int n, happy=0;
    scanf("%d", &n);
    while(n>=5){
        if(n>=500){
            n-=500;
            happy+=1000;

        }else{
            int m = n/5;
            n -= m*5;
            happy += m*5;
        }
    }
    printf("%d\n", happy);
    return 0;
}

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

using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int n;
    cin >> n;
    vector<int> d(n);
    for (int i = 0; i < n; ++i) {
        cin >> d.at(i);
    }
    sort(d.begin(), d.end());
    cout << d.at(n / 2) - d.at(n / 2 - 1) << "\n";
    return 0;
}


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

int main(){
  int a, b, c, x;
  cin >> a >> b >> c >> x;
  int ans = 0;
  for(int i = 0; i <= a; i++){
    for(int j = 0; j <= b; j++){
      for(int k = 0; k <= c; k++){
        if(500 * i + 100 * j + 50 * k == x){
          ans++;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3556
import sys

N, K = map(int, sys.stdin.readline().split())
A = list(map(int, sys.stdin.readline().split()))

dp = [0] + [None] * (N - 1)
for n, a in enumerate(A):
    if n:
        l = max(0, n - K)
        dp[n] = min(abs(a - a2) + d for a2, d in zip(A[l : n], dp[l : n]))

print(dp[-1])


Measured memory_bytes: 14016
//小数点以下　cout << fixed << setprecision(10) << num << endl;
//桁数はlog10(mid)でやれ　log(mid)/log(10)はWA
//long*long<0で判定するな
//開区間と閉区間
//アルファベットが何番目かは x=s[i]-'a'
//bfsはmain()内で　rep(i,h)rep(j,w)rep(i,4)でバグ
//切り上げ：(a+(b-1))/b
//32bit以上は 1ull<<j
// map 初期値0 for(auto itr=mp.begin();itr!=mp.end();++itr) itr->fi itr->se で全探索
// for(auto u:mp) u.fi u.se も可能
//n個のgcd,lcmは一つずつみて更新していく
//大きな数を扱うときは素因数分解した形で持っておく
// (l/a[i]) = l*powmod(a[i],MOD-2)%MOD;
//auto itr=lower_bound(ALL(a),key) a[itr-a.begin()]
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <stdio.h>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional> //operator[]
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<ll,ll> Pll;

signed main(){
    int a,b;
    cin >> a >> b;
    if(a<=b) cout << a << endl;
    else cout << a-1 << endl;
}


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

int main()
{
  int N;
  cin >> N;
  
  vector<int> X(N), Y(N);
  vector<int> route;
  
  for (int i = 0; i < N; i++) {
    cin >> X.at(i) >> Y.at(i);
  }
  for (int i = 0; i < N; i++) {
    route.push_back(i);
  }
  double total = 0.0;
  int num = 0;
  do {
    double sum = 0.0;
    for (int i = 1; i < N; i++) {
      sum += sqrt((X.at(route.at(i-1)) - X.at(route.at(i))) * (X.at(route.at(i-1)) - X.at(route.at(i))) +
                  (Y.at(route.at(i-1)) - Y.at(route.at(i))) * (Y.at(route.at(i-1)) - Y.at(route.at(i))));
     
    }
    total += sum;
    num++;
  } while(next_permutation(route.begin(), route.end()));
  cout << setprecision(15) << total / num << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#define ll long long int
using namespace std;

int main(){
    ll a,b,c,k;
    cin>>a>>b>>c>>k;
    ll x = max(c,max(a,b));
    ll shit = a + b + c - x;
    while(k--){
        x<<=1;
    }
    cout<<x+shit<<endl;
    return 0;
}


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

class ProgramB
    {
        static void Main(string[] args)
        {
            string input = Console.ReadLine();
            long n = long.Parse(input);

            long[] d = new long [n];
            long[] d_num = new long[n];
            long sum = 1;

            string[] input_d = Console.ReadLine().Split();


            for(long i = 0;i < n;i++)
            {
                d[i] = long.Parse(input_d[i]);
                if(d[0] != 0)
                {
                    Console.WriteLine("0");
                    return;
                }
                d_num[d[i]]++;
            }

            if(d_num[0] >= 2)
            {
                Console.WriteLine("0");
                return;
            }

            long count  = 1;
            for(long i = 1;i < n;i++)
            {
                if(d_num[i] == 0)
                {
                    Console.WriteLine("0");
                    return;
                }
                long temp = (long)(BigInteger.ModPow(d_num[i - 1], d_num[i], 998244353));
                sum = sum * temp % 998244353;

                count = count + d_num[i];
                if(count == n)
                   break;

            }


            Console.WriteLine(sum);

        }
    }

Measured memory_bytes: 20192
#include <bits/stdc++.h>
using namespace std;
#define rep(i,ini,n) for(int i=ini;i<n;i++)
#define _rep(i,ini,n) for(int i=ini;i>=n;i--)
#define ToEnd(a) a.begin(),a.end()
uint64_t MOD=1000000007;

int main(){
    int N,K; cin>>N>>K;
    vector<int64_t> A(N);
    rep(n,0,N) cin>>A.at(n);

    rep(i,0,N-K){
        if(A.at(i+K)>A.at(i)) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}

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

void bubbleSort(vector<int> &h)
{
	int tmp;
	for (int i = 0; i < h.size() - 1; i++)
	{
		for (int j = 0; j < h.size() - 1 - i; j++)
		{
			if (h[j] < h[j + 1])
			{
				tmp = h[j + 1];
				h[j + 1] = h[j];
				h[j] = tmp;
			}
		}
	}
}

int main()
{
	vector<int> height(10);
	for (int i = 0; i < 10; i++)
	{
		cin >> height[i];
	}
	bubbleSort(height);
	for (int i = 0; i < 3; i++)
	{
		cout << height[i] << endl;
	}
	return 0;
}


Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  cin >> h >> w;
  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      string s;
      cin >> s;
      if(s=="snuke"){
        cout << char('A'+j) << i+1 << endl;
        return 0;
      }
    }
  }
}

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

        int main() {
          string S;
          cin>> S; 
          int L=0;
          int R=0; 
          
          for(int i=0; i<S.size(); i++){
            if(S.at(i)=='1' && (i%2)==1 ) L++;
            if(S.at(i)=='0' && (i%2)==0 ) L++;
          }
          
          for(int i=0; i<S.size(); i++){
            if(S.at(i)=='1' && (i%2)==0 ) R++;
            if(S.at(i)=='0' && (i%2)==1 ) R++;
          }
          
          cout<< min(L,R) << endl; 
          //cout<< L <<" "<<R <<endl; 

        }

Measured memory_bytes: 512
import java.util.*;

public class Main {
public static void main(String[] args) {
		
		Scanner keyboard = new Scanner(System.in); 
	
		int N = keyboard.nextInt();
		
		int[]A = new int[N];
		Set<Integer> sp = new HashSet<Integer>();
		
		for(int i = 0; i<N; i++) {
			A[i] = keyboard.nextInt();
			sp.add(A[i]);
		}
		
		boolean flag = false;  
		
		if(sp.size() == 1){
//			aが1種類であるとき1、aは必ず０でないといけない
		if(A[0] == 0) {
			flag = true;
		}
	}
//			Nが３の倍数個であるとき
		if(N % 3 == 0) {
//				aが３種類であるとき
			if(sp.size() == 3) {
//					a1^a2 == a3である、かつ各aの個数が等しい
				Integer[]a = sp.toArray(new Integer[0]);
				if((a[0]^a[1]) == a[2]) {
					Arrays.sort(A); 
					if(A[0] == A[N/3-1] && A[N/3] == A[2*N/3-1] && A[2*N/3] == A[N-1]) {
						flag = true;
					}
				}
			}else if(sp.size() == 2){
//				aが２種類であるとき
				Integer[]a = sp.toArray(new Integer[0]);
				if(a[0]== 0) {
					Arrays.sort(A); 
					if(A[0] == A[N/3-1] && A[N/3] == A[N-1]) {
						flag = true;
					}
				}
			}
		}

		String ans = "";
		if(flag) {
			ans = "Yes";
		}else {
			ans = "No";
		}
		
		System.out.println(ans);
		keyboard.close();	
	}
}


Measured memory_bytes: 62524
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
using P = pair<int, int>;
 
int main() {
    int l;
    cin >> l;
	
  	double tmp = l / 3.0;
    double value = pow(tmp,3);

    printf("%.10f",value);
}

Measured memory_bytes: 256
# Dijkstra????????¨??????vertex???????????¢?????????
# ???????????????????????????????????¢?????´???????????§??´???????±???????

import heapq
from collections import defaultdict

INF = float('inf')
N = int(input())
Adj_list = defaultdict(set)

for i in range(N-1):
    s, t, w = map(int, input().split())
    Adj_list[s].add((t, w))
    Adj_list[t].add((s, w))
    
def dijkstra(x, vertex):
    d = [INF] * x
    d[vertex] = 0
    hq = [(0, vertex)]
    
    while hq:
        u = heapq.heappop(hq)[1]
        for (v, c) in Adj_list[u]:
            if d[v] > d[u] + c:
                d[v] = d[u] + c
                heapq.heappush(hq, (d[u]+c, v))

    return d

#??????????????????????????¢?????´???????????????????????????s???????????§???0??¨???????????????
l_0 =  dijkstra(N, 0)
x = l_0.index(max(l_0))
l_x = dijkstra(N, x)
print(max(l_x))

Measured memory_bytes: 66676
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll MOD = (1e+9)+7;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
ll t = 1e+18;
int main() {
	ll a, b, c, k; cin >> a >> b >> c >> k;
	ll out = a - b;
	if (k % 2)out = -out;
	cout << out << endl;
	return 0;
}

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

using namespace std;
set<int> S;
int main(){
	int n;
	cin >> n;
	for(int i = 0; i < n; i++){
		int v;
		cin >> v;
		if(S.find(v) != S.end()){
			cout << "NO" << endl;
			return 0;
		}
		S.insert(v);
	}
	cout << "YES" << endl;
}

Measured memory_bytes: 9600
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <fstream>
#include <string>
#include <math.h>
#include <set>
#include <string>
#include <bitset>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
//typedef pair<ll, P> T;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define revrep(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define f first
#define s second
#define pb push_back

ll mod = 1000000007;
const ll INF = 100000000000010000;
//const ull B = 998244353;

//ll bit[200010];
//ll kai[3010];
//ll Cnt[10010];

//void pres(double A, ll x = 20) { printf("%.20f\n", x); }



/*ll sum(ll i)
{
	i += 1;
	ll t = 0;
	while (i > 0)
	{
		t += bit[i];
		i -= i & -i;
	}
	return t;
}

void add(ll i, ll x)
{
	i += 1;
	while (i <= 200005)
	{
		bit[i] += x;
		i += i & -i;
	}
}*/

/*`ll SAIKI(ll S) {
	for (ll T = S; ; T = (T - 1) & S) {

	}
}*/



void test() {
	cout << "888888888888888888888888" << endl;
}

ll gcd(ll x, ll y) {
	if (y == 0) return x;
	return gcd(y, x % y);
}

ll pow_mod(ll x, ll k) {
	x %= mod;
	ll res = 1;
	while (k > 0) {
		if (k % 2) {
			res *= x; res %= mod;
		}
		x *= x; x %= mod;
		k /= 2;
	}
	return res;
}

ll div_mod(ll x) {
	return pow_mod(x, mod - 2);
}

//コンビネーション
const int MAXcomb = 200010;
ll fac[MAXcomb], finv[MAXcomb], inv[MAXcomb];
//facはn!,finvは1/n!
//invは逆元
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAXcomb; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod%i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}
ll comb(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * finv[k] % mod * finv[n - k] % mod;
}


/*map<ll, ll> pres;
ll ct;

void makePrimeList(ll x) {
	ll X = x;
	for (ll j = 2; j * j <= x; j++) {
		ll cnt = 0;
		while (X % j == 0) {
			cnt++;
			X /= j;
		}
		if (cnt) {
			if (pres[j] == 0) {
				ct++;
				pres[j] = ct;
			}
			Cnt[pres[j]] += cnt;
		}
	}
	if (X != 1) {
		if (pres[X] == 0) {
			ct++;
			pres[X] = ct;
		}
		Cnt[pres[X]] += 1;
	}
}*/

string S, T, U;
ll a, b;

void solve() {
	cin >> S;
	rep(i, S.length()) cout << 'x';
	cout << endl;
}

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int,  int>;
using pll = pair<ll, ll>;
using edge = pair<int, ll>;
using Graph = vector<vector<int>>; 
using WeightedGraph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

int main(){
	ll n,m,v,p;
	cin >> n >> m >> v >> p;
	map<ll, ll> mp;
	for(int i = 0; i < n; ++i){
		int a;cin >> a;++mp[a];
    }
    vector<pll> vec;
    for(auto it : mp){
      vec.push_back({it.first, it.second});
    }
    ll N= vec.size();
    vector<ll> sum(N+1);
    for(int i = 0; i < N; ++i){
      sum[i+1]=sum[i]+vec[i].second;
    }
	int idx= 0;
	for(int i = N-1; i >= 0; --i){
		if(p>vec[i].second)p-= vec[i].second;
		else {
			idx = i;
			break;
        }
    }
    ll lb = -1,ub = idx+1;
    while (ub-lb>1){
      ll mb = (ub+lb)/2;
      ll t = vec[mb].first + m;
      bool f = true;
      if(t>=vec[idx].first){
        ll rem = (v-sum[mb+1]-sum[N]+sum[idx+1])*m;
        for(int i = mb+1; i < idx+1; ++i){
          rem -= vec[i].second * min(m,t-vec[i].first);
        }
        if(rem>0)f=false;
      }
      else f = false;
      
      if(f) ub = mb;
      else lb = mb;
    }
    ll ans= 0;
    for(int i = ub; i < N; ++i)ans+= vec[i].second ;
    cout << ans << endl;
}


Measured memory_bytes: 9720
S = int(input())

a = S//100
b = S%100

if 1<=a<=12 and 1<=b<=12:
    print('AMBIGUOUS')
elif 1<=a<=12 and (b>12 or b==0):
    print('MMYY')
elif (a==0 or a>12) and 1<=b<=12:
    print('YYMM')
else:
    print('NA')


Measured memory_bytes: 9084
#include<string>
#include<cctype>
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<queue>
using namespace std;
#define inf 0x3f3f3f3f
typedef long long ll;
const int maxn = 1000 + 8;
int sta[maxn];
char c[100];
int top ;
/*
bool isEmpty(int sta[])
{
    return !top;
}*/

int pop()
{
    top--;
    return sta[top+1];
    /*int x = sta[top];
    top--;
    return x;*/
}
void push(int x)
{
    sta[++top] = x;
    return;
}
void add()
{
    int y = pop();
    int x = pop();
    //cout <<"x + y: " << x + y << endl;
    push(x+y);
    //cout << sta[top] << endl;
}
void subtract()
{
    int y =  pop();
    int x =  pop();
    //cout << "x - y: " <<x - y << endl;
    push(x-y);
    //cout << sta[top] << endl;
}

void multiple()
{
    int y = pop();
    int x = pop();
    //cout <<"x * y: "<< x * y << endl;
    push(x*y);
    //cout << sta[top] << endl;
}
void operate(char s[])
{
    int x = atoi(c);
    push(x);
}
int main()
{
    top = 0;
    while(scanf("%s",c) != EOF)
    {
        if(strcmp(c,"+") == 0){
            add();
        }else if(strcmp(c,"-") == 0){
            subtract();
        }else if(strcmp(c,"*") == 0){
            multiple();
        }else {
            operate(c);
        }

        if(strcmp(c,"#") == 0) break;
    }
    printf("%d\n",pop());
    return 0;
}

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

ll mod = 1000000007;
int main()
{
  int N;
  cin >> N;
  vector<int> A(N);
  rep(i, N) cin >> A[i];
  sort(A.begin(), A.end());

  int idx = 0;
  int n = 1;

  if(N%2 && A[0] == 0) {
    idx = 1;
    n = 2;
  }

  ll ans = 1;
  while(idx<N-1) {
    if(A[idx] == n && A[idx] == A[idx+1]) {
      n = n+2;
      ans = (ans*2)%mod;
    }
    else
    {
      cout << 0 << endl;
      return 0;
    }
    idx = idx+2;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
input = require('fs').readFileSync('/dev/stdin', 'utf8')
lines = input.split('\n')
s = lines.shift()
o = {}
ans = ''
for (i=65;i<91;i++) {
    o[String.fromCharCode(i).toLowerCase()] = 0
}
if (s.length == 26) {
    len = s.length
    arr = []
    for(i = len - 1; i >= 0; i--) {
        arr.push(s.slice(i,i+1))
        arr.sort()
        t = s.slice(0, i)
        found = false
        for(j=0; j < arr.length; j++) {
            if (t + arr[j] > s) {
                found = true
                ans = t + arr[j]
                break;
            }
        }
        if (found) {
            break;
        }
    }    

    if (!found) {
        ans = -1
    }

} else {
    for (i=0;i<s.length;i++) {
        o[s[i]] = 1
    }
    for (i=65;i<91;i++) {
        t = String.fromCharCode(i).toLowerCase()
        if (!o[t]) {
            break;
        }
    }
    ans = s + t
}
console.log(ans)

Measured memory_bytes: 7500
N = int(input())
S = list(input())
A = (S.count("R"))*(S.count("B"))*(S.count("G"))
for i in range(1,N):
    for j in range(i+1,N+1):
        if j < 2*j - i <= N:
            if S[i-1] != S[j-1] and S[i-1] != S[2*j - i - 1] and S[j-1] != S[2*j - i - 1]:
                A -= 1
print(A)

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

int isPrime(int x){
  int i;
  if(x < 2)return 0;
  else if(x==2)return 1;
  if(x%2 == 0)return 0;
  for(i=3 ; i*i <= x ; i+=2){
    if(x%i == 0)return 0;
  }
  return 1;
}

int main(){
  
  int k;
  int i,j;

  while(1){
    cin >>k;
    if(k==0)break;
    
    if(isPrime(k)){
      cout <<"0"<<endl;
    }else{
      for(i=k+1 ; isPrime(i) != 1 ; i++);
      for(j=k-1 ; isPrime(j) != 1 ; j--);
      cout <<i-j<<endl;
    }
  }

  return 0;
}

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

using namespace std;

const int mxn = 1e5;
unsigned long long a[mxn + 11];
const long long mm = 1e18;

int main(){
	int n;
	scanf("%d", &n);
	unsigned long long ans = 1;
	for (int i = 0; i < n; i++){
		scanf("%lld", &a[i]);
	}
	sort(a, a + n);
	if (a[0] == 0LL){
		puts("0");
		return 0;
	}
	for (int i = 0; i < n; i++){
		if (a[i] <= mm / ans)
			ans *= a[i];
		else {
			puts("-1");
			return 0;
		}
	}
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 4552
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const float eps=1e-6;
const ll mod=1e8;
int main()
{
    ll n,i,k,j;
    cin>>n>>k;
    ll a[n]={0},dp[n];
    for(i=0;i<n;i++)
    {
        cin>>a[i];
    }
    dp[0]=0;
    for(i=1;i<=n;i++)
    {
        dp[i]=INT_MAX;
        for(j=1;j<=k;j++)
            if(i-j>=0)
               dp[i]=min(dp[i],abs(a[i]-a[i-j])+dp[i-j]);
    }
    cout<<dp[n-1]<<endl;
    return 0;
}


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

int main(){
  int n,m,count=0;
  cin >> n >> m;
  int s1[n],s2[n];//s1は赤い球 s2は白い球
  r(i,n){
    if(!i){
      s1[i]=1;	s2[i]=0;
    }
      else{
        s1[i]=0;	s2[i]=1;
      }
  }
  while(m--){//s1は赤い球 s2は白い球
    int x,y;
    cin >> x >> y;
    if(s1[x-1]==0){
      s2[x-1]--;
      s2[y-1]++;
    }
    else{
      s1[x-1]--;
      s1[y-1]++;
    }
    if(s1[y-1]&&s2[y-1]){
      s1[y-1]+=s2[y-1];
      s2[y-1]=0;
    }
  }
  r(i,n)if(s1[i])count++;
  cout<<count<<endl;
}

Measured memory_bytes: 1024
#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()


int main(){
    ll l,r;
    cin>>l>>r;

    ll ans=2020;
    for(ll i=l;i<=min(r,l+3000);i++){
        for(ll j=i+1;j<=min(r,l+3000);j++){
            ans=min(ans,(i*j)%2019);
        }
    }

    cout<<ans<<endl;
}


Measured memory_bytes: 3596