akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#define N 100

int main(){
  int i, j, k, n,m[N][N], a, b, c;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      m[i][j] = 0;
    }
  }
  for(k=0;k<n;k++){
    scanf("%d%d",&a,&b);
    for(i=0;i<b;i++){
      scanf("%d",&c);
      m[a-1][c-1] = 1;
    }
  }

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



Measured memory_bytes: 2108
#include<stdio.h>
#include<math.h> 
int main(){
 
    double d1,d2,d3,d4;
    int i,j,k,l,n;
    double x[1020]={0};
    double y[1020]={0};
    double z[1020]={0};
    double o,p,q,max;
    max=-1;
    o=0;
    p=0;
    q=0;
    d1=0;
    d2=0;
    d3=0;
    d4=0;
 
    scanf("%d",&n);
 
    for(i=0;i<n;i++){
        scanf("%lf",&x[i]);
    }
 
    for(i=0;i<n;i++){
        scanf("%lf",&y[i]);
    }
 
    for(i=0;i<n;i++){
        o=(x[i]-y[i])*(x[i]-y[i]);
        p=(x[i]-y[i])*(x[i]-y[i])*(x[i]-y[i]);
        p=p*p;
        p=sqrt(p);
   
        d3=d3+p;
        d2=d2+o;
        d1=d1+sqrt(o); 
 
        if(max<sqrt(o)){
            max=sqrt(o);
        }
    }
 
    d2=pow(d2,1.0/2);
    d3=pow(d3,1.0/3);
    d4=max;
 
    printf("%.11lf\n%.11lf\n%.11lf\n%.11lf\n",d1,d2,d3,d4);
 
    return 0;
 
}


Measured memory_bytes: 2056
#include<iostream>
using namespace std;
int a[10005];
int b[10005];
int main()
{
    int h,w;
    int n;
    cin>>h>>w;
    cin>>n;
    for(int i=1; i<= n; i++)
        cin>>b[i];
    int flag = 1;
    int j = 1;
    for (int i = 1; i <= n; i++)
    {
        while (b[i] > 0)
        {
            a[j] = flag;
            j++;
            b[i]--;
        }
        flag++;
    }
    for (int i = 1; i <= h; i++)
    {
        if (i % 2 == 1)
        {
            for (int p = w*(i - 1) + 1; p <= i*w; p++)
            {
                cout << a[p] << " ";
            }
            if (i != h)
                cout << endl;
        }
        else if (i % 2 == 0)
        {
            for (int p = w*i; p >= w*(i - 1) + 1; p--)
            {
                cout << a[p] << " ";
            }
            if (i != h)
                cout << endl;
        }
    }
    return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;

#define f first
#define s second
#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rall(x) rbegin(x), rend(x)
#define pb push_back

#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define F0R(i, a) FOR(i, 0, a)
#define ROF(i, a, b) for (int i = (b); i >= (a); i--)
#define R0F(i, a) ROF(i, 0, a-1)
#define trav(x, a) for (auto& x: a)

const int MX  = 2e5+5;
const int MOD = 1e9+7;
const ll  INF = 1061109567; // 4557430888798830399LL
const ld  EPS = 1e-9;
const ld  PI  = acos(-1);

int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);

    ll N; cin >> N;

    ll res = 1;
    FOR(i, 1, N+1) res = (res*i)%MOD;

    cout << res << "\n";
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pii;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpii;
const ll INF = (1ll << 60);

ll MOD = 1000000007;

int main() {
  ll N, K;
  cin >> N >> K;
  vi A(N);
  for (ll i = 0; i < N; i++) {
    cin >> A[i];
  }

  ll ans = 0;

  for (ll i = 0; i < N; i++) {
    for (ll j = i + 1; j < N; j++) {
      if (A[i] < A[j]) {
        ans += (K * (K - 1) / 2) % MOD;
      }
      if (A[i] > A[j]) {
        ans += (K * (K + 1) / 2) % MOD;
      }
      ans %= MOD;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
x = input().split(' ')
count_5 = 2
count_7 = 1
for num in x:
    if num == '5':
        count_5 -= 1
    elif num == '7':
        count_7 -= 1

if count_5 == 0 and count_7 == 0:
    print('YES')
else:
    print('NO')
    

Measured memory_bytes: 2940
#include <cstdio>

//  1240380 C++	00.00 s	1040 KB	1006 B	2015-03-08 19:10
// cl /EHsc xxx.cpp
int main(int argc, char *argv[])
{
	int n;
	scanf("%d ", &n);
	
	int cards[4][13] = {0};
	
	int t = n;
	while (t)
	{
		//scanf("%c %d ", &c0, &v);
		char buff[1024] = {0};
		gets(buff);
		//printf("%s\n", buff);
		
		char c0;
		int v;
		sscanf(buff, "%c %d", &c0, &v);
		switch (c0)
		{
		case 'S':
			cards[0][v-1] = 1;
			break;
		case 'H':
			cards[1][v-1] = 1;
			break;
		case 'C':
			cards[2][v-1] = 1;
			break;
		case 'D':
			cards[3][v-1] = 1;
			break;
		default:
			break;
			//printf("c0=%d\n", c0);
		}
		t--;
		//printf("!!!!!!t=%d\n", t);
	}
	
	char cc[4] = {'S' ,'H', 'C', 'D'};
	for (int r = 0; r < 4; r++)
	{
		for (int c = 0; c < 13; c++)
		{
			if (cards[r][c] == 0)
			{
				printf("%c %d\n", cc[r], c+1);
			}
		}
	}
	
	return 0;
}

Measured memory_bytes: 1040
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
int max(int a,int b){return a>b?a:b;}
int min(int a,int b){return a<b?a:b;} 
int main(void)
{
  long n,a,b;
  scanf("%ld %ld %ld",&n,&a,&b);
  if(n%(a+b)<=a)
  printf("%ld",n/(a+b)*a+n%(a+b));
  if(n%(a+b)>a)
  printf("%ld",n/(a+b)*a+a);
    
}

Measured memory_bytes: 128
#include <stdio.h>

int main(void){
  int x, n, a, b, c;
  scanf("%d", &n);
  x = n;
  while(1){
    a = x / 100;
    b = (x - a * 100) / 10;
    c = x - a * 100 - b * 10;
    if(a == b && a == c){
      break;
    }
    x++;
  }

  printf("%d\n", x);
  return 0;
}


Measured memory_bytes: 128
#include <cstdio>
#include <algorithm>
using namespace std;

int a[200005];
int b[200005];
int main()
{
    int n,j;
    int k=1;
    scanf("%d",&n);
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&a[i]);
    }
    b[1]=a[1];
    for(int i=2; i<=n; i++)
    {
        if(a[i]<=b[k])
        {
            b[++k]=a[i];
        }
        else
        {
            j=lower_bound(b+1,b+k+1,a[i])-b;
            b[j]=a[i];
        }
    }
    printf("%d",k);
    return 0;
}


Measured memory_bytes: 1664
#include<bits/stdc++.h>
using namespace std;
#define REP(i,a,b) for(int (i)=(a);(i)<(int)(b);(i)++)
#define RREP(i,a,b) for(int (i)=(a);(i)>=(int)(b);(i)--)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;

class UnionFind{
    protected:
        vector<int> par;
        vector<int> rnk;
    public:
        UnionFind(int n);
        virtual int root(int x);
        virtual void unite(int x, int y);
        bool same(int x, int y);
};

UnionFind::UnionFind(int n){
    par = vector<int>(n + 1);
    rnk = vector<int>(n + 1);
    for (int i = 0; i < n + 1; i++){
        par[i] = i; rnk[i] = 0;
    }
}

int UnionFind::root(int x){
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
}

void UnionFind::unite(int x, int y){
    x = root(x); y = root(y);
    if (x == y) return;
    if (rnk[x] < rnk[y]) par[x] = y;
    else{
        par[y] = x;
        if (rnk[x] == rnk[y]) rnk[x]++;
    }
}

bool UnionFind::same(int x, int y){
    return root(x) == root(y);
}


int main(){
    int n, k, l;
    cin >> n >> k >> l;

    UnionFind r(n), t(n);
    REP(i,0,k){
        int x, y;
        cin >> x >> y;
        r.unite(x, y);
    }
    REP(i,0,l){
        int x, y;
        cin >> x >> y;
        t.unite(x, y);
    }

    map<P, int> cnt;

    REP(i,1,n + 1){
        cnt[P(r.root(i), t.root(i))]++;
    }

    REP(i,1,n + 1){
        if (i != 1) cout << " ";
        cout << cnt[P(r.root(i), t.root(i))];
    }
    cout << endl;
    
    return 0;
}

Measured memory_bytes: 15104
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
#define FOR(i, o, n) for (auto i = (o); (i) < (n); ++(i))
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) for (auto i = (n)-1; (i) >= 0; --i)
#define REPI(itr, v) for (auto itr = v.begin(); itr != v.end(); ++itr)
#define REPIR(itr, v) for (auto itr = v.rbegin(); itr != v.rend(); ++itr)
#define fi first
#define se second
#define ll long long
#define V2(name, h, w) vector<vector<int> > name((h), vector<int>(w));
int main(){
	int N; cin >> N;
	double x, sum=0; string u;
	REP(i, N){
		cin >> x >> u;
		if(u == "JPY"){
			sum += x; 
		}else{
			sum += x * 380000.0;
		}
	} 
	printf("%f\n", sum);
}


Measured memory_bytes: 256
MOD = 10**9 + 7
N = 3000  # 10**6が限界
factorial_mod = [1, 1]  # factrial_mod[i] := i! mod p
modular_multiplicative_inverse = [0, 1]  # モジュラ逆数 := i^(-1) ≡ x (mod p) となるx
factorial_inverse_mod = [1, 1]  # factrial_inverse_mod[i] := (i!)^(-1) mod p

for i in range(2, N + 1):  # O(N)
    factorial_mod.append((factorial_mod[i - 1] * i) % MOD)
    modular_multiplicative_inverse.append((-modular_multiplicative_inverse[MOD % i] * (MOD // i)) % MOD)
    factorial_inverse_mod.append((factorial_inverse_mod[i - 1] * modular_multiplicative_inverse[i]) % MOD)

def nCr_mod(n, r):
    if r < 0 or r > n:
        return 0
    r = min(r, n - r)
    return factorial_mod[n] * factorial_inverse_mod[r] * factorial_inverse_mod[n - r] % MOD

# ---------------------- #

s = int(input())
if s < 3:
    print(0)
    exit()
m = s // 3
ans = 0
for i in range(1, m + 1):
    ans += nCr_mod(s - 2 * i - 1, i - 1)
    ans %= MOD
print(ans)


Measured memory_bytes: 65752
const MAX_N: usize = 100100;
fn solve() {
    let s = std::io::stdin();
    let mut sc = Scanner { stdin: s.lock() };
    let n: usize = sc.read();
    let k: u32 = sc.read();
    let ss: Vec<char> = sc.chars();
    let mut sum : Vec<u32> = vec![0; n];



    for i in 1..n {
        if ss[i - 1] == '1' && ss[i] == '0' {
            sum[i] = 1;
        }
    }
    for i in 0..n - 1 {
        sum[i + 1] += sum[i];
    }
    let mut result = 1;
    for i in 0..n {
        let mut left = 0;
        let mut right = n + 10;
        while right - left > 1 {
            let med = (right + left) / 2;
            if i + med >= n {
                right = med;
                continue;
            }
            let mut cost = sum[i + med];
            if i >= 1 {
                cost -= sum[i - 1];
            }
            if ss[i] == '0' {
                cost += 1;
            }
            if cost <= k {
                left = med;
            } else {
                right = med;
            }
        }
        result = std::cmp::max(result, left + 1);
    }
    println!("{}", result);
}

fn main() {
    std::thread::Builder::new()
        .stack_size(256 * 1024 * 1024) // 64MB
        .spawn(|| solve())
        .unwrap()
        .join()
        .unwrap();
}

//snippet from kenkoooo
pub struct Scanner<R> {
    stdin: R,
}

impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self.stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn read_line(&mut self) -> String {
        use std::io::Read;
        let buf = self.stdin
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b'\n' || b == b'\r')
            .take_while(|&b| b != b'\n' && b != b'\r')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}

Measured memory_bytes: 8572
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);    
    string s;
    cin>>s;
    int ans=0;
    for(int i=0;i<s.length()/2;i++){
        if(s[i]!=s[s.length()-i-1]){
            ans++;
        }
    }
    cout<<ans;
}

Measured memory_bytes: 256
import java.io.*;

public class Main {

	public static void main(String[] args)throws IOException{
		// TODO Auto-generated method stub
		
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String input = in.readLine();
		String[] size = input.split(" ");
		
		int leangh = Integer.parseInt(size[0]);
		int height = Integer.parseInt(size[1]);
		


		
		System.out.println(leangh*height + " " + 2*(leangh + height));

	}

}

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

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;
    vector<int>broken(n+1);

    for(int i = 0; i < m; i++) {
        int a;
        cin >> a;
        broken[a]=1;
    }
    vector<int>dp(n+2);
    const int mod = 1000000007;
    dp[n]=1;

    for(int i = n - 1; i >= 0; i--) {
        if(broken[i]){
            dp[i]=0;
            continue;
        }
        dp[i] =(dp[i+1] + dp[i+2]) % mod;
    }
    cout << dp[0] % mod << endl;
    return 0;
}

Measured memory_bytes: 1024
#define _CRT_SECURE_NO_WARNINGS
#include"bits/stdc++.h"
#ifdef _DEBUG
#define DBG(n) n
#else
#define DBG(n)
#endif
#define INF         1e9
#define INFLL       1e18
#define EPS         1e-9
#define REP(i,n)    for(ll i=0,i##_len=(n);i<i##_len;++i)
#define REP1(i,n)   for(ll i=1,i##_len=(n);i<=i##_len;++i)
#define REPR(i,n)   for(ll i=(n)-1;i>=0;--i)
#define REPR1(i,n)  for(ll i=(n);i>0;--i)
#define REPC(i,obj) for(auto i:obj)
#define ALL(obj)    (obj).begin(),(obj).end()
#define SETP(n)     cout << fixed << setprecision(n)
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

signed main() {
	int n = in(), k = in();
	vector<int>hist(n);
	REP(i, n) {
		int a = in() - 1;
		++hist[a];
	}
	sort(ALL(hist));
	int ans = 0;
	REP(i, n - k) {
		ans += hist[i];
	}
	cout << ans << endl;
}

Measured memory_bytes: 1024
#include <stdio.h>

int main(void)
{
  int i,l;
  int flag=0;
  int n[1000];
  do{
  scanf("%d", &l);
  }while(l<1||l>100);
  
  for(i=0;i<l;i++)
  {
    do{
    scanf("%d" ,&n[i]);
    }while(n[i]<1||n[i]>1000);
  } 
for(i=0;i<l;i++)
{
if(n[i]%2==0)
{
	if(n[i]%3!=0&&n[i]%5!=0)
	{
		flag=1;
	}
}
}
  
  if(flag==0)
    printf("APPROVED");
  else
    printf("DENIED");
return 0;
}

Measured memory_bytes: 1712
#include <stdio.h>

int lunlun[13][10]= { {}, { 1,1,1,1,1,1,1,1,1,1} };
int numberOfLunlun(int digit, int head){
  int sum;
  if( lunlun[digit][head] )
    return lunlun[digit][head];

  sum = head-1>=0 ? lunlun[digit-1][head-1] : 0;
  sum += lunlun[digit-1][head];
  sum += head+1<=9 ? lunlun[digit-1][head+1] : 0;
  
  return lunlun[digit][head] = sum;
}

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

  int sum = 0;
  int sum_digit[13] = {0};

  //  for(int digit = 1; digit<4; digit++) {
  for(int digit = 1; digit<13; digit++) {
    digit, numberOfLunlun(digit,0);
    for(int n=1;n<10;n++){
      sum_digit[digit] += numberOfLunlun(digit,n); 
      sum += numberOfLunlun(digit,n);
      //  printf( "head %d digit %d : %d  (sum %d)\n", n, digit, numberOfLunlun(digit,n),sum );
      if(K<=sum){
	printf("%d", n);

	sum -= numberOfLunlun(digit,n);
	digit -= 1;
	n -= n!=0 ? 2 : 1;
	
	}
      if(digit == 0) break;
    }
    //    printf("sum %d \n",sum_digit[digit]);
    if(digit == 0) break;
  }

  printf("\n");
  return 0;
  
}


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

int main(){

    string S;
    cin >> S;

    int pre;
    int post;

    pre = stoi(S.substr(0,2));
    post = stoi(S.substr(2,2));

    int result = 0;

    if(post > 0 && post < 13){
        result += 1;
    }

    if(pre > 0 && pre <13){
        result += 2;
    }

    switch (result){
    case 0:
        cout << "NA" << endl;
        break;

    case 1:
        cout << "YYMM" << endl;
        break;

    case 2:
        cout << "MMYY" << endl;
        break;

    case 3:
        cout << "AMBIGUOUS" << endl;
        break;
    
    default:
        break;
    }

}

Measured memory_bytes: 256
n = int(input())
h = list(map(int, input().split()))
dp = [10 ** 18 for _ in range(n)]
dp[0] = 0
for i in range(1, n):
    dp[i] = min(dp[i-1] + abs(h[i] - h[i-1]),
                dp[i-2] + abs(h[i] - h[i-2]))
print(dp[-1])


Measured memory_bytes: 13924
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <string>
#include <iomanip>
#include <deque>
#include <queue>
#include <stack>
#include <set>
#include <complex>
#include <ctime>
#include<bitset>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef int itn;
const ll LINF = 1e18;
const int INF = 1e9;

//マクロ定義
#define vvint(vec,n,m,l) vector<vector<int>> vec(n, vector<int>(m,l));	// lで初期化
#define vvll(vec,n,m,l) vector<vector<ll>> vec(n,vector<ll>(m,l));
#define vint vector<int>
#define pint pair<int,int>
#define rep(i,a) for(ll i=0;i<(a);i++)
#define all(x) (x).begin(),(x).end()
#define debug system("pause")				//デバッグ用
#define ret return 0

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

using Graph = vector<vector<ll>>;

#define ketasitei setprecision(15) //15桁表示

const ll MOD = 1000000007;
const double PI = 3.1415926535897932;



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

	ll x, k, d;
	cin >> x >> k >> d;
	x = abs(x);

	if (x / d <= k)
	{
		k -= x / d;
		x = x % d;
		if (k % 2)
			cout << abs(x - d) << endl;
		else
			cout << abs(x) << endl;
	}
	else
	{
		cout << abs(x - k * d) << endl;
	}

	return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <stdlib.h>
#include <string>
using namespace std;

int main(){
        int N;
        int det=0;
        int flag = 0;
        string input1;
        cin >> input1;
        N = atoi(input1.c_str());
        string input2[N];
        int A[N];
        for(int i = 0; i < N; i++){
                cin >> input2[i];
                A[i] = atoi(input2[i].c_str());
        }

        while(1){
                for(int i = 0; i < N; i++){
                        if(A[i]%2 != 0){
                                flag++;
                                break;
                        }
                        A[i] /= 2;
                }
                if(flag != 0){
                        break;
                }else {
                        det++;
                }

        }
        cout << det << endl;
        return 0;
}

Measured memory_bytes: 256
package main

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

func out(x ...interface{}) {
	fmt.Println(x...)
}

var sc = bufio.NewScanner(os.Stdin)

func getInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func getString() string {
	sc.Scan()
	return sc.Text()
}

// min, max, asub, absなど基本関数
func max(a, b int) int {
	if a > b {
		return a
	}
	return b
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func asub(a, b int) int {
	if a > b {
		return a - b
	}
	return b - a
}

func abs(a int) int {
	if a >= 0 {
		return a
	}
	return -a
}

func lowerBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] >= x
	})
	return idx
}

func upperBound(a []int, x int) int {
	idx := sort.Search(len(a), func(i int) bool {
		return a[i] > x
	})
	return idx
}

func main() {
	sc.Split(bufio.ScanWords)
	sc.Buffer([]byte{}, 1000000)
	s := getString()
	w := make([]int, 0)
	for i, v := range s {
		if v == 'W' {
			w = append(w, i)
		}
	}
	pos := 0
	ans := 0
	for i := 0; i < len(w); i++ {
		ans += w[i] - pos
		pos++
	}
	out(ans)
}


Measured memory_bytes: 6528
#include<stdio.h>
int main(){
  
  int a,b;
  scanf("%d%d", &a, &b);
  
  if(a>=b) {
    for(int i=0; i<a; ++i){
      printf("%d", b);
    }
  } else { 
    for(int i=0; i<b; ++i){
      printf("%d", a);
    }
  }
  
  return 0;
}


Measured memory_bytes: 128
#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;
#define pb push_back
#define int long long
#define m_p make_pair
#define pair pair<int,int> 
//#define M 998244353
#define M 1000000007
const int inf=4e18;
const int MX=100;
const int MN=-100;
const double pi=3.14159265358979;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	char c;cin>>c;
	cout<<(char)(c+1)<<endl;
}

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

const int N = (int) 2e6 + 10 ;
const int inf = (int) 2e9 ;

vector< int > coin ;
int dp[N] ;

int pwr( int b , int p ) {
    int ans = 1 ;
    for( int i = 1 ; i <= p ; i++ ) {
        ans *= b ;
    }
    return ans ;
}

int main(){
//    freopen("in.txt" , "r" , stdin ) ;

    int n ; scanf("%d" , &n ) ;
    coin.push_back(1) ;
    for( int i = 1 ; ; i++ ) {
        int x = pwr(6 , i) ;
        if( x > n ) break ;
        coin.push_back( x ) ;
    }
    for( int i = 1 ; ; i++ ) {
        int x = pwr(9 , i) ;
        if( x > n ) break ;
        coin.push_back(x) ;
    }
    sort( coin.begin() , coin.end() ) ;
    int sz = coin.size() ;
    for( int i = 0 ; i < N ; i++ ) {
        dp[i] = inf ;
    }
    dp[0] = 0 ;
    for( int i = 0 ; i < n ; i++ ) {
        for( int j = 0 ; j < sz ; j++ ) {
            int nxt = i + coin[j] ;
            dp[nxt] = min( dp[nxt] , 1 + dp[i] ) ;
        }
    }
    printf("%d\n" , dp[n] ) ;
    return 0 ;
}


Measured memory_bytes: 8064
import sys
input = sys.stdin.readline


def main():
    MOD = 2019
    L, R = map(int, input().split())
    # R = min(R, L+MOD*2)
    ans = MOD - 1

    if R - L >= 3000:
        print(0)
        return

    for i in range(L, R+1):
        for j in range(i+1, R+1):
            ans = min(ans, i*j % MOD)

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 38896
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<string>
#include<map>
#include<set>
#include<functional>
#include<list>
#include<bitset>
#include<numeric>
#include<utility>
#define MAX 55
using namespace std;
typedef unsigned long long ll;
typedef pair<int, int> p;

ll triangle[MAX+1][MAX+1];

void makeTriangle() {
	int i, j;

	// initialize the first row
	triangle[0][0] = 1; // C(0, 0) = 1

	for (i = 1; i < MAX; i++) {
		triangle[i][0] = (ll)1; // C(i, 0) = 1
		for (j = 1; j <= i; j++) {
			triangle[i][j] = triangle[i - 1][j - 1] + triangle[i - 1][j];
		}
	}
}

long long C(int n, int r) {
	return triangle[n][r];
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, a, x;
	cin >> n >> a;
	map<int, ll> mp;
	for (int i = 0; i < n; i++) {
		cin >> x;
		x -= a;
		mp[x]++;
	}
	makeTriangle();
	vector<map<int,ll>> dp(mp.size() + 1, map<int,ll>());
//	for (auto it : mp) {
//		cout << it.first << " " << it.second << " " << endl;
//	}
//	cout << "begin" << endl;
	dp[0][0] = (ll)1;
	auto itr = mp.begin();
	for (int i = 0; i < mp.size(); i++) {
		for (auto it = dp[i].begin(); it != dp[i].end(); it++) {
//			cout << "("<<it->first << "," << it->second << ")";
			int now = it->first;
			int card = itr->first;
			int num = itr->second;
			for (int j = 0; j <= num; j++) {
				dp[i + 1][now + card * j] +=C(num,j)*dp[i][now];
			}
		}
//		cout << endl;
		itr++;
	}
	cout << dp[mp.size()][0] - 1;

	return 0;
}

Measured memory_bytes: 1920
def MAP(): return list(map(int,input().split()))
def INT(): return int(input())
def FLOAT(): return float(input())
MOD = 10**9+7

s = input()
t = input()
n = len(s)
m = len(t)

pre = [[0]*(m+1) for _ in range(n+1)]
dp = [[0]*(m+1) for _ in range(n+1)]

for si in range(n):
    for ti in range(m):
        if s[si]==t[ti]:
            dp[si+1][ti+1] = dp[si][ti]+1
        else:
            dp[si+1][ti+1] = max(dp[si+1][ti],dp[si][ti+1])

ans = ""
x = dp[-1][-1]
for i in range(n,-1,-1):
    for j in range(m,-1,-1):
        if dp[i][j]==x:
            if (dp[i-1][j]==x-1) and (dp[i][j-1]==x-1):
                ans = s[i-1]+ans
                x-=1
                break
print(ans)


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

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

    int numCoin = 0;
    for (int i=0; i < 2; i++)
    {
        if (a >= b)
        {
            numCoin += a--;
        }
        else
        {
            numCoin += b--;
        }
    }

    cout << numCoin << endl;

    return 0;
}

Measured memory_bytes: 256
open Batteries
module EnumL = Enum.Labels
module ListL = List.Labels
module ArrayL = Array.Labels

let dbg0 x = Printf.eprintf "[debug]%s\n" @@ dump x
let dbg1 x = dbg0 x; x

let id = identity

let (++) n m = List.range n `To m
let (++-) n m = if n >= m then List.range n `Downto m else []
let (++^) n m = if n < m then List.range n `To (pred m) else []

module ModOp = struct
  let prime = 1_000_000_007
  let (-) a b = (a + prime - b) mod prime
  let (+) a b = (a + b) mod prime
  let ( * ) a b = (a * b) mod prime

  let rec pow x n =
    if n = 0 then 1
    else if n mod 2 = 0 then pow (x*x) (n/2)
    else x * pow (x*x) (n/2)
end

let scan fmt = Scanf.sscanf (read_line ()) fmt

let scan_lines n fmt f =
  if n = 0 then []
  else List.map (fun _ -> scan fmt f) (1 ++ n)

let scan_list ?sep cnv =
  let line = read_line () in
  (match sep with
   | None -> List.map String.of_char @@ String.to_list line
   | Some sep -> String.split_on_char sep line)
  |> List.map cnv

let scan_array ?sep cnv = Array.of_list @@ scan_list ?sep cnv

let scan_matrix n m e ?sep conv =
  let arr = Array.make_matrix n m e in
  ListL.iter (0 ++^ n)
    ~f:(fun i -> arr.(i) <- Array.of_list @@ scan_list ?sep conv);
  arr

let atoi c = Char.code c - Char.code '0'

let rec powerset = function
  | [] -> [[]]
  | hd::tl ->
    let pws =  powerset tl in
    pws @ ListL.map pws ~f:(fun pw -> hd::pw)

let permutations l =
  let rec interleave x = function
    | [] -> [[x]]
    | (hd::tl) as l ->
      (x::l) :: (interleave x tl |> ListL.map ~f:(fun l -> hd::l)) in
  let rec aux = function
    | [] -> [[]]
    | a::rest ->
      aux rest |> ListL.map ~f:(interleave a) |> List.concat in
  aux l

let intersection l =
  EnumL.filter ~f:(fun x -> EnumL.exists ~f:((=) x) @@ Enum.clone l)

let zip l m =
  let n = min (List.length l) (List.length m) in
  List.combine (List.take n l) (List.take n m)

let lower_bound n f =
  let rec aux l u =
    if u - l > 1 then
      let m = (l + u) / 2 in
      if f m then aux l m
      else aux m u
    else u in aux (-1) n

let between n x m = n <= x && x < m

let (x,y,z) = scan "%d %d %d" Tuple3.make

let () =
  Printf.printf "%d %d %d\n" z x y


Measured memory_bytes: 5516
from math import sqrt
def dist2(ax, ay, az, bx, by, bz):
    return (ax - bx) ** 2 + (ay - by) ** 2 + (az - bz) ** 2

def judge(d1, d2, d3):
    e1, e2, e3 = sqrt(d1), sqrt(d2), sqrt(d3)
    cos1 = (d1 + d2 - d3) / (2 * e1 * e2)
    cos2 = (d1 + d3 - d2) / (2 * e1 * e3)
    return (0 <= cos1 and 0 <= cos2)
    
N, Q = map(int, raw_input().split())
obj = [map(int, raw_input().split()) for i in xrange(N)]

for loop in xrange(Q):
    sx, sy, sz, dx, dy, dz = map(int, raw_input().split())
    vx, vy, vz = dx - sx, dy - sy, dz - sz
    d1 = dist2(sx, sy, sz, dx, dy, dz)
    cost = 0
    for x, y, z, r, l in obj:
        d2, d3 = dist2(x, y, z, sx, sy, sz), dist2(x, y, z, dx, dy, dz)
        if not judge(d1, d2, d3): continue
        t = 1.0 * (vx * (x - sx) + vy * (y - sy) + vz * (z - sz)) / (vx * vx + vy * vy + vz * vz)
        tx, ty, tz = sx + vx * t, sy + vy * t, sz + vz * t
        d = dist2(x, y, z, tx, ty, tz)
        if d <= r * r + 1e-9:
            cost += l
    print cost

Measured memory_bytes: 4492
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String args[]) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		int n = Integer.parseInt(br.readLine());

		String str[] = br.readLine().split(" ");
		int d[] = new int[n];

		for (int i = 0; i < n; i++) {
			d[i] = Integer.parseInt(str[i]);
		}

		int ans = 0;

		for (int i = 0; i < n - 1; i++) {
			for (int j = i + 1; j < n; j++) {
				ans += d[i] * d[j];
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 22740
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.*;
 
public class Main {
 
    void solve() throws IOException {
        int N = ni();
        int K = ni();
        ArrayList<Integer> list = new ArrayList<>();
        for (int i = 0; i < N; i++) {
            int a = ni();
            list.add(a);
        }
        int left = 0;
        int right = Integer.MAX_VALUE /2 ;
        while(right - left > 1){
            // System.out.print(left);
            // System.out.print(" ");
            // System.out.println(right);
            int mid = (left + right) /2;
            int count = 0;
            for (int i = 0; i < list.size(); i++) {
                count += (list.get(i)-1) / mid;
            }
            if(count <= K) right = mid;
            else left = mid;
        }
        out.println(right);
    }

    final int mod = 1000000007;
    final BigInteger MOD = BigInteger.valueOf(mod);
    int mul(int x, int y){
        int val = (int)((x * 1L * y) % mod);
        return val>=0 ? val : val+mod;
    }
    int add(int x, int y) {
        x += y;
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        if(x < 0) x += mod;
        if(x>=mod) x -= mod;
        return x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}

Measured memory_bytes: 57924
#include<bits/stdc++.h>
 
using namespace std;
long long mod=1e9+7;
long long INF=1e7;
double EPS = 1e-12;
const long long lim = 1e6+100;
typedef long long int lld;
typedef long long ll;

#define rep(i,a,n) for(long long int i = (a); i <= (n); ++i)
#define repD(i,a,n) for(long long int i = (a); i >= (n); i--)
#define mset(a, v) memset(a, v, sizeof(a))
#define Error(x...) { cout << "(" << #x << ")" << " = ( "; printIt(x); }
template <typename T1> void printIt(T1 t1) { cout << t1 << " )" << endl; }
template <typename T1, typename... T2>
void printIt(T1 t1, T2... t2) { cout << t1 << " , "; printIt(t2...); }
 
 
#define popcount __builtin_popcountll
 
ll powP(ll x, ll y) {
    ll ans = 1, po = x % mod;
    while(y > 0) {
        if(y & 1) ans = ans * po % mod;
        y >>= 1; po = po * po % mod;
    }
    return ans;
}

ll findGcd(ll a, ll b){
    while(a != 0) { ll temp = b % a; b = a; a = temp; }
    return b;
}

set<ll> S[lim];
ll Array[lim], Prime[lim];



int main(){

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

    #ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
    #endif
    
    lld T,i,p,j,l,e,r,b,c,k,m,q,a,d,w,x,y,u,v,z,t,curr,prev,sum=0,val,countA=0,indicator=0,pos,h,minA,maxA,type,n,ans=0,left,right;
    string A,B;
    A = "Yes", B="No";
    cin>>n>>l;
    rep(i,1,n) cin>>Array[i];
    indicator=0;
    rep(i,1,n-1) {
        if(Array[i]+Array[i+1]>=l) indicator=1, val=i;
    }

    if(indicator==0) cout<<"Impossible"<<endl;
    else {
        cout<<"Possible"<<endl;
        rep(j,1,val-1) cout<<j<<endl;

        repD(j,n-1,val) cout<<j<<endl;
    }

    return 0;
}
    

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

const int N=1e5+5;

typedef long long ll;
ll a[N],b[N];
int main()
{
double n,m;
cin>>n>>m;
for(int i=0;i<n;i++)
    cin>>a[i];
cout<<ceil((n-1)/(m-1));


   return 0;
}


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

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    int constexpr N = 100009;
    bitset<N> a, x, y;
    string s;
    cin >> s;
    for(int i = 0; i < s.size(); ++i)
        a[i] = s[i] - '0';
    for(int i = 0; i < s.size(); i += 2)
        x[i] = 1;
    for(int i = 1; i < s.size(); i += 2)
        y[i] = 1;
    
    int ans = min((a ^ x).count(), (a ^ y).count());
    cout << ans << endl;
}

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

int main() {
	int k, s;
	int x, y, z;
	int formas = 0;
	
	cin >> k >> s;
	
	for (int x = 0; x <= k; x++) {
		for (int y = 0; y <= k; y++) {
			z = s - x - y;
			
			if (z >= 0 && z <= k) formas++;
		}
	}
	cout << formas;
}

Measured memory_bytes: 3616
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<vector<int>> dp(100005,vector<int>(3,0));
int a[100005],b[100005],c[100005];
void fanc(int n);
signed main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    int n;
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i]>>b[i]>>c[i];
    }
    for(int i=1;i<=n;i++){
        dp[i][0]=max(dp[i-1][1]+a[i],dp[i-1][2]+a[i]);
        dp[i][1]=max(dp[i-1][0]+b[i],dp[i-1][2]+b[i]);
        dp[i][2]=max(dp[i-1][0]+c[i],dp[i-1][1]+c[i]);
    }
    cout<<max(dp[n][0],max(dp[n][1],dp[n][2]))<<"\n";
    return 0;
}

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


int main(){
    string s;
    cin >> s;
    string a = s; 
    reverse(s.begin(),s.end());
    if(a != s){
        cout << "No" << endl;
        return 0;
    }
    s = s.substr(0,s.size()/2);
    string b = s;
    reverse(s.begin(),s.end());
    if(s == b) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
/////////////////////////////////////////////////////////
//
//  c/temp.cpp file
//  Last Updated: 2018-08-07 ...Maybe
//
//    I hope you adding this code to the setting file
//    alias g++='g++ -std=c++1y -DDEBUG_LOCAL'
//
/////////////////////////////////////////////////////////

#include <bits/stdc++.h>

using namespace std;

#define fi first
#define se second
#define mp make_pair
#define pb push_back

//#define int long long

#define _overload3(_1,_2,_3,name,...) name
#define _REP(i,n) REAP(i,0,n)
#define REAP(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(...) _overload3(__VA_ARGS__,REAP,_REP,)(__VA_ARGS__)

#define _REPR(i,n) REAPR(i,n,0)
#define REAPR(i,a,b) for(int i=int(a-1);i>=int(b);--i)
#define REPR(...) _overload3(__VA_ARGS__,REAPR,_REPR,)(__VA_ARGS__)

#define ALL(a) a.begin(),a.end()
#define rALL(a) a.rbegin(),a.rend()

#define coutALL(a) {int loop_coutALL=0;for(auto e:a) cout<<(loop_coutALL++?" ":"")<<e; cout<<endl;}

#define coutYN(a) cout<<((a)?"YES":"NO")<<endl;
#define coutYn(a) cout<<((a)?"Yes":"No")<<endl;
#define coutyn(a) cout<<((a)?"yes":"no")<<endl;

#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)

const int INF=1145141919;
const int MOD=(int)1e9+7;
const double EPS=1e-12;
const int dx[]={1,0,-1,0},dy[]={0,1,0,-1};
//const int dx[]={-1,-1,-1,0,1,1,1,0},dy[]={-1,0,1,1,1,0,-1,-1};

using vi=vector<int>;
using vvi=vector<vi>;
using vs=vector<string>;

typedef pair<int,int> pii;
typedef pair<int,string> pis;
typedef pair<string,int> psi;
typedef pair<string,string> pss;

typedef long long ll;

template<typename T> istream &operator >> (istream &is, vector<T> &v){for(T &x:v) is>>x;return is;}
template<typename T> ostream &operator << (ostream &os, vector<T> &v){int i=0;for(T &x:v) os<<(i++?" ":"")<<x;return os;}

ll rev(ll n){ll x=0;for(;n>0;){x=x*10+n%10;n/=10;}return x;}

template<class T> ll upper(T n,T m){return (n+m-1)/m;};
template<class T> ll rounding(T n){return (long double)n+0.5;};

template<class T> bool inG(T x,T n){return 0<=x && 0<n;}
template<class T> bool outG(T x,T n){return x<0 || n<=x;}

inline int qp(int a,ll b){int ans=1;do{if(b&1)ans=1ll*ans*a;a=1ll*a*a;}while(b>>=1);return ans;}
inline int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

inline ll fac(ll k,ll n){ll a=1;for(int i=0;i<n;i++)a*=k--;return a;}
inline ll fac(ll k,ll n,int mo){ll a=1;for(int i=0;i<n;i++)a*=k--,a%=mo;return a;}

struct Arithmetic{Arithmetic(){cin.tie(0);ios::sync_with_stdio(0);cout<<fixed<<setprecision(20);}};

//#define DEBUG_LOCAL

#ifdef DEBUG_LOCAL
template<typename T> void deb(T a){cerr<<"deb: "<<a<<"です"<<endl;}
#define debl {cerr<<"debug: "<<__LINE__<<"行目だ"<<endl;}
void what_cr(){cout<<__GCC_ATOMIC_CHAR16_T_LOCK_FREE<<" ←？"<<endl;}
//ori_func S

//ori_func E
#else
template<typename T>void deb(T a){}
#define debl
void what_cr(){}void t_t(){}
#endif

signed main(){

  Arithmetic Exception;

  int n;
  cin>>n;

  cout<<111*upper(n,111)<<endl;

  return 0;

}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <functional>
#include <algorithm>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <typeinfo>
#include <functional>
#include <iomanip>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;
typedef long long ll;


int main()
{
	ll N,A,B;
	cin >> N >> A >> B;

	int ret = (A < B) ? A : B;
	int ret2 = (A + B) - N;
	if (ret2 <= 0)
		ret2 = 0;
	cout << ret << " " << ret2<< endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(ll i=0;i<x;i++)
#define repn(i,x) for(ll i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 1000000007;
const ll MAX = 1000001;

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

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

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

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

struct edge {
	ll ind;
	ll fr;
	ll to;
	ll d;
};


///////////////////////////




int main() {

	string S;
	cin >> S;

	ll l = 0;
	rep(i, S.size()) {
		if (S[i] == 'x') { l++; }
	}

	if (l >= 8) { cout << "NO"; }
	else { cout << "YES"; }

	system("PAUSE");

}


Measured memory_bytes: 504
# -*- coding: utf-8 -*-

n = int(input())
ans = 1
wari = 0

for i, tmp in enumerate(range(1, n+1)):
    aa = 0
    while tmp % 2 == 0:
        tmp = tmp // 2
        aa += 1
    if wari < aa:
        wari = aa
        ans = i+1

print(ans)


Measured memory_bytes: 2940
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
	int lens,lent;
	char s[105],t[105],temp;
	while(~scanf("%s",&s)){
		scanf("%s",&t);
		lens = strlen(s);
		lent = strlen(t);
		for(int i = 0;i < lens;i++){
			for(int j = i;j < lens;j++){
				if(s[i] > s[j]){
					temp = s[i];
					s[i] = s[j];
					s[j] = temp;
				}
			}
		}
		for(int i = 0;i < lent;i++){
			for(int j = i;j < lent;j++){
				if(t[i] < t[j]){
					temp = t[i];
					t[i] = t[j];
					t[j] = temp;
				}
			}
		}
		if(strcmp(s,t) < 0)
			printf("Yes\n");
		else
			printf("No\n");
		memset(s,0,sizeof(s));
		memset(t,0,sizeof(t));
	}
	return 0;
}

Measured memory_bytes: 256
let fs = require('fs');

const yourAnswerFunctionComesHere = data => {
  var Arr=(data.trim()).split(" ").map(Number);
  Arr.sort(function(a,b){return b-a;});
  console.log(Arr.join(" "));
}

const readFile = path => {
  fs.readFile(path, 'utf8', (err, data) => {
    yourAnswerFunctionComesHere(data);
  });
}

const readFileWithoutArg = () => {
  const data = require('fs').readFileSync('/dev/stdin', 'utf8');
  yourAnswerFunctionComesHere(data);
}

let sampleInputPath = "";

if(process.argv.length > 2) {
  sampleInputPath = process.argv[2];
  readFile(sampleInputPath);
} else {
  readFileWithoutArg();
}



Measured memory_bytes: 15400
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<queue>
#include<deque>
#include<stack>
#include<string>
#include<string.h>
#include<vector>
#include<set>
#include<map>
#include<bitset>
#include<stdlib.h>
#include<cassert>
#include<time.h>
#include<bitset>
using namespace std;
const long long mod=1000000007;
const long long inf=mod*mod;
const long long d2=(mod+1)/2;
const double EPS=1e-6;
const double PI=acos(-1.0);
int ABS(int a){return max(a,-a);}
long long ABS(long long a){return max(a,-a);}
char in[2100][2100];
int t[2100][2100];
int main(){
	int a,b;scanf("%d%d",&a,&b);
	for(int i=0;i<a;i++){
		scanf("%s",in[i]);
	}
	int ret=max(a,b);
	for(int i=0;i<a-1;i++){
		for(int j=0;j<b-1;j++){
			int cnt=0;
			if(in[i][j]=='#')cnt++;
			if(in[i][j+1]=='#')cnt++;
			if(in[i+1][j]=='#')cnt++;
			if(in[i+1][j+1]=='#')cnt++;
			if(cnt%2==0)t[i][j]=1;
		}
	}
	for(int i=0;i<a-1;i++){
		for(int j=0;j<b-1;j++){
			if(i&&t[i][j])t[i][j]=t[i-1][j]+1;
	//		printf("%d ",t[i][j]);
		}
	//	printf("\n");
	}
	for(int i=0;i<a-1;i++){
		stack<pair<int,int> >S;
		for(int j=0;j<b-1;j++){
			int at=j;


			while(S.size()){
				if(S.top().first>t[i][j]){
					int W=j-S.top().second;
					at=S.top().second;
					ret=max(ret,(W+1)*(S.top().first+1));
					S.pop();
				}
				else break;
			}
			S.push(make_pair(t[i][j],at));
		}

		while(S.size()){
			int W=b-1-S.top().second;
			ret=max(ret,(W+1)*(S.top().first+1));
			S.pop();
		}

		//printf("%d\n",ret);
	}
	printf("%d\n",ret);
}

Measured memory_bytes: 21632
#include<iostream>

using namespace std;

int selection_sort(int A[], int N) {
  int i, j, minj, num = 0;
  for(i = 0; i < N; i++) {
    minj = i;
    for(j = i; j < N; j++) {
      if(A[minj] > A[j]) {
        minj = j;
      }
    }
    if(minj != i) {
      num++;
      swap(A[minj], A[i]);
    }
  }

  return num;
}

int main() {
  int A[100], N, i, num;

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

  num = selection_sort(A, N);

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

  cout<<endl<<num<<endl;

  return 0;
}



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

int main() {
  int n;
  cin>>n;
  vector<int> a(n+1,0);
  rep(i,n-1){
    int b;
    cin>>b;
    a[b]++;
  }
  rep(i,n){
    cout<<a[i+1]<<endl;
  }
}


Measured memory_bytes: 4040
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <algorithm>
#include <map>
#include <fstream>
#include <bitset>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef tuple<int, int, int> iii;
typedef vector<iii> viii;
typedef priority_queue<int> pqi;
typedef priority_queue<ii> pqii;
typedef map<int, int> mii;
typedef map<int, string> mis;
typedef map<string, int> msi;
typedef set<int> si;
typedef set<ll> sl;
typedef map<ll, ll> mll;
typedef queue<int> qi;
typedef queue<ii> qii;
typedef vector<string> vs;
typedef pair<ll, ll> iil;
typedef vector<iil> viil;
typedef vector<vi> vvi;
typedef long double ld;

#define pb push_back
#define mp make_pair
#define rep(i, n) for (int i = 0 ; i < n ; i++)
#define INF 1000000000

void solve() {
    int n;
    cin >> n;
    int counts[4];
    memset(counts, 0, sizeof counts);
    string wds[4] = {"AC", "WA", "TLE", "RE"};
    rep(i, n) {
        string s;
        cin >> s;
        if (s == "AC") {
            counts[0] ++;
        }
        else if (s == "WA") {
            counts[1] ++;
        }
        else if (s == "TLE") {
            counts[2] ++;
        }
        else {
            counts[3] ++;
        }
    }
    rep(i, 4) {
        cout << wds[i] << " x " << counts[i] << '\n';
    }
}

void querySolve() {
    int n;
    cin >> n;
    while (n--) {
        solve();
    }
}

int main() {
    //querySolve();
    solve();

}


Measured memory_bytes: 3628
def check(ar):
    for i in ar:
        if i%2 != 0: return False
    return True

w = input()
  
a = 'abcdefghijklmnopqrstuvwxyz'
ar = [0]*26

for c in w:
    ar[a.find(c)] += 1

if check(ar): print('Yes')
else: print('No')


Measured memory_bytes: 2940
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"

using namespace std;

const long long int MOD = 1000000007;

long long int N, M, K, H, W, L, R;

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

	cin >> N;
	vector<int>dp(100001, MOD);
	set<int>s;
	s.insert(1);
	for (int i = 6; i < 100000; i *= 6) {
		s.insert(i);
	}
	for (int i = 9; i < 100000; i *= 9) {
		s.insert(i);
	}
	dp[0] = 0;
	for (int i = 0; i < 100000; i++) {
		for (auto j : s) {
			if (i + j <= 100000) {
				dp[i + j] = min(dp[i + j], dp[i] + 1);
			}
		}
	}
	cout << dp[N] << endl;
	return 0;
}

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

#define int long long

using namespace std;

const int maxn = 2e5 + 10, mod = 1e9 + 7;
int fac[maxn], ifac[maxn], n, k;

int pw(int base, int power)
{
        int res = 1;
        while (power) {
                if (power & 1)
                        (res *= base) %= mod;

                (base *= base) %= mod;
                power >>= 1;
        }
        return res;
}

void precalc()
{
        fac[0] = 1;
        for (int i = 1; i < maxn; i++)
                fac[i] = fac[i - 1] * i % mod;
        ifac[maxn - 1] = pw(fac[maxn - 1], mod - 2);
        for (int i = maxn - 2; ~i; i--)
                ifac[i] = ifac[i + 1] * (i + 1) % mod;
}

int C(int n, int k)
{ return fac[n] * ifac[k] % mod *ifac[n - k] % mod; }

signed main()
{
        precalc();
        cin >> n >> k;

        int ans = 0;
        for (int i = 0; i <= min(n, k); i++)
                (ans += C(n, i) * C(n - 1, n - i - 1) % mod) %= mod;
        
        cout << ans;

        return 0;
}



Measured memory_bytes: 3328
#include <cstdio>

int main() {
    int m, d, ans = 0;
    scanf("%d%d", &m, &d);
    for (int i = 1; i <= m; ++i) {
        for (int j = 2; j < 10; ++j)
            for (int k = 2; k < 10; ++k)
                if(j * 10 + k > d) goto there;
                else if(j * k == i) ++ans;
        there:;
    }
    printf("%d", ans);
    return 0;
}

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

int main(){
  int N,sum=0;
  cin >> N;
  vector<int> d(N);
  for(int i=0;i<N;i++){
    cin >> d.at(i);
  }
  for(int i=0;i<N-1;i++){
    for(int j=i+1;j<N;j++){
      sum+=d.at(i)*d.at(j);
    }
  }
  cout << sum << endl;
}
      

Measured memory_bytes: 256