akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const double EPS = 1e-8;

template<typename T> T chmax(T& a, const T& b){return a = (a > b ? a : b);}
template<typename T> T chmin(T& a, const T& b){return a = (a < b ? a : b);}

int main(){
    int n;
    cin >> n;
    int ans = 0;
    REP(i, 1, n+1) if(i&1) {
        int tmp = 0;
        REP(j, 1, i+1) if(i % j == 0) ++tmp;
        if(tmp == 8) ++ans;
    } 
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    std::ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int n;cin>>n;
    string s;cin>>s;
    int a=0,l=0;
    int result=0;
    for(char c:s){
        if(c=='.') a++; 
    }
    result=a;
    for(int i=0;i<n;i++){
        if(s[i]=='#') l++;
        else a--;
        result=min(result,a+l);
        
    }
    cout<<result<<endl;
    return 0;
}

Measured memory_bytes: 720
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
#include<set>
using namespace std;


const long long int mod=1000000007;
const long long int INF=99999999999999999;

long long int N,M,K,L,A[200005],B[200005];
string str,str2;
//素数判定　素数ならそのまま返す　合成数なら０を返す。
int sosu(long long int n) {
	for (long long int i = 2; i*i <= n; i++) {
		if (n%i == 0) { return 0; }
	}
	return n;
}

int main() {
	
	cout << fixed << setprecision(18);
	cin>>N;
	for(long long int i=N;i==i;i++){
		if(sosu(i)==i){cout<<i<<endl;return 0;}
	}
} 

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

struct RollingHash {
    vector<unsigned long long> hash, power;
    const unsigned int seed = 10007, mod  = 1e9 + 7;

    RollingHash(const string &s) {
        int n = (int)s.size();
        hash.assign( n + 1, 0);
        power.assign(n + 1, 1);
        for(int i = 0; i < n; ++i) power[i+1] = power[i] * seed % mod;

        for(int i = 0; i < n; ++i) {
            hash[i+1]  = (hash[i] * seed + s[i]) % mod;
            power[i+1] = power[i] * seed % mod;
        }
    }

    // [l, r)
    unsigned long long get_hash(int l, int r) {
        unsigned long long ret = (hash[r] - hash[l] * power[r-l] % mod + mod) % mod;
        return ret;
    }
};

struct UnionFind {
    vector<int> par, weight;
    UnionFind(int n) : par(n,-1), weight(n) {}
    bool unite(int x, int y, int w = 0) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (par[x] > par[y]) swap(x, y), w = -w;
        par[x] += par[y];
        par[y] = x;
        return true;
    }
    bool same(int x, int y) { return root(x) == root(y); }
    int root(int x) {
        if(par[x] < 0) return x;
        int r = root(par[x]);
        return par[x] = r;
    }
    int sizeOf(int x) { return -par[root(x)]; }
};

int main() {
    cin.tie(0); ios_base::sync_with_stdio(false);
    string s,t; cin >> s >> t;
    int n = s.size();
    s = s + s + s;
    while(t.size()*2 > s.size()) s += s;

    int N = s.size();
    int m = t.size();
    vector<bool> match(N);

    RollingHash rh1(s), rh2(t);
    unsigned long long thash= rh2.get_hash(0, m);
    
    for(int i=0; i < N - m; ++i) {
        if(rh1.get_hash(i, i + m) == thash) match[i] = true;
    }

    // loop check & count
    UnionFind uf(N);
    for(int i = 0; i < n; ++i) {
        if(match[i] && match[(i + m) % n]) {
            if(!uf.unite(i, (i + m) % n)) {
                cout << -1 << endl;
                return 0;
            }
        }
    }

    int ans = 0;
    for(int i = 0; i < N; ++i) if(match[i]) ans = max(ans, uf.sizeOf(i));
    cout << ans << endl;
    return 0;
}

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

using namespace std;

/*  テンプレここから */
typedef long long ll;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, start, end) for(int i = start; i < end; i++)
#define all(x) (x).begin(), (x).end()
#define INF (1e9)
#define add_mod(a, b, x) ( (ll)(a) + (ll)(b) ) % (ll)(x)
#define mul_mod(a, b, x) ( ((ll)(a) % (ll)(x)) * ((ll)(b) % (ll)(x)) ) % (ll)(x)
#define out(x) cout << (x) << endl;
#define outyes(bool_val) cout << (bool_val ? "yes" : "no") << endl;
#define outYes(bool_val) cout << (bool_val ? "Yes" : "No") << endl;
#define outYES(bool_val) cout << (bool_val ? "YES" : "NO") << endl;
#define outPossible(bool_val) cout << (bool_val ? "Possible" : "Impossible") << endl;
#define outPOSSIBLE(bool_val) cout << (bool_val ? "POSSIBLE" : "IMPOSSIBLE") << endl;

ll sub_mod(ll a, ll b, ll x){
    ll tmp = (a - b) % x;
    if(tmp < 0) tmp += x;
    return tmp;
}
ll gcd(ll a, ll b){
    if(b == 0) return a;
    else return gcd(b, a % b);
}

int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
/*  テンプレここまで */

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

    int W, a, b;
    cin >> W >> a >> b;

    cout << max(0, abs(b - a) - W) << endl;
}

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

int main(){
    int x1,y1,x2,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int x3,y3,x4,y4;
    x3 = x2-(y2-y1);
    y3 = y2+(x2-x1);
    cout << x3 << ' ' << y3 << ' ';
    x4 = x3-(y3-y2);
    y4 = y3+(x3-x2);
    cout << x4 << ' ' << y4 << endl;
}


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

int main() {
   
long long n,k,q,i,ans=0,j,m;
  cin>>n>>m;

  long long a[n];
  for(i=0;i<n;i++)
 { cin>>a[i];}
 sort(a,a+n);
   if(n==1)
   {
       while(m>0)
       {
           a[n-1]=a[n-1]/2;
           m--;
       } cout<<a[0]; return 0;
   }
   while(m>0)
   {
     
       j=lower_bound(a,a+n,a[n-1]/2)-a;
       for(i=n-1;i>=j;i--)
       {   
           a[i]=a[i]/2;
           m--;
           if(m==0)
           break;
       }
       if(m==0)
       break;
       sort(a,a+n); if(a[n-1]==0)break;
                                  
       
   }
    for(i=0;i<n;i++)
    {
        ans+=a[i];
    }
    cout<<ans;
	return 0;
}

Measured memory_bytes: 1024
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt(), L = sc.nextInt();
    int[] A = new int[N];
    A[0] = L;
    for (int i = 1; i < N; i++) A[i] = A[i - 1] + 1;
    int ans = 0, min = 10000, ans2 = 0;
    for (int i = 0; i < N; i++) {
      ans += A[i];
      if (min > Math.abs(A[i])) {
        min = Math.abs(A[i]);
        ans2 = A[i];
      }
    }
    System.out.println(ans - ans2);
  }
}

Measured memory_bytes: 21844
#include <cstdio>
#include <algorithm>

int n, k;
int A[100];

constexpr int mod = 1000000007;
int dp[101][100001];

int main(){
  scanf("%d%d", &n, &k);
  for(int i = 0; i < n; i++) scanf("%d", A+i);
  dp[0][0] = 1;
  for(int i = 1; i <= n; i++){
    int sum[100001];
    for(int j = 0; j <= k; j++){
      sum[j] = (j ? sum[j-1] : 0) + dp[i-1][j];
      if(sum[j] >= mod) sum[j] -= mod;
      dp[i][j] = sum[j] + (A[i-1] >= j ? 0 : mod - sum[j-A[i-1]-1]);
      if(dp[i][j] >= mod) dp[i][j] -= mod;
    }
  }
  printf("%d\n", dp[n][k]);
  return 0;
}


Measured memory_bytes: 39680
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)
import math

i_i = lambda: int(i_s())
i_l = lambda: list(map(int, stdin.readline().split()))
i_s = lambda: stdin.readline().rstrip()

K = i_i()

ans = 0
ab = []
for a in range(1, K+1):
    for b in range(1, K+1):
        ab.append(math.gcd(a,b))
for c in range(1, K+1):
    for x in ab:
        ans += math.gcd(c,x)
print(ans)


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

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

char a, b;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  cin >> a >> b;
  if (a < b)
    cout << string(b - '0', a) << endl;
  else
    cout << string(a - '0', b) << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int a,b,c,k;
	int count = 0;
	
	scanf("%d%d%d%d%d",&a,&b,&c,&k);
	//printf("%d,%d,%d,%d\n",a,b,c,k);
	
	while(1){
		if(b>a){
			break;
		}
		else{
			b = b*2;
			count++;
			//printf("!");
		}
	}
	//printf("%d\n",count);
	
	while(1){
		if(c>b){
			break;
		}
		else{
			c = c*2;
			count++;
			//printf("!");
		}
	}
	//printf("%d\n",count);
	
	if(count <= k){
		printf("Yes");
	}
	else{
		printf("No");
	}

	
	return 0;
}


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

#define ipair pair<int,int>
#define rep(i,n) for(i=0;i<n;i++)
#define repj(i,j,n) for(i=j;i<n;i++)

#define PB(a,i) (a).push_back(i)
#define ALL(a) (a).begin(),(a).end()
#define SIZE(a,n) (a).resize(n)
#define SORT(a) sort(ALL(a))
#define RSORT(a, type) sort(ALL(a),greater<type>())
#define MAPIN(a,i,j) (a).insert(make_pair(i,j))
#define PREC(n) setprecision(n)

#define OK(i) cout<<"OK "<<i<<endl
#define Yes cout<<"Yes"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define NO cout<<"NO"<<endl

using namespace std;

typedef unsigned long long lli;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector< vi > Matrix;

int main() {
    int i,j,n,k,m,c,p,s;
    vi a;
    bool y;
    vector < vector< pair<int,bool> > > x;
    bitset<16> bn;

    cin>>n;
    SIZE(x,n);
    SIZE(a,n);
    rep(i,n){
        cin>>a[i];
        SIZE(x[i],a[i]);
        rep(j,a[i]){
            cin>>k>>m;
            x[i][j]=make_pair(k-1,m);
        }
    }
    m=0;
    repj(k,1,pow(2,n)){
        c=0;
        bn=k;
        y=true;
        rep(i,n){
            if(k & (1<< i)){
                c++;
                rep(j,a[i]){
                    p=(k & (1 <<x[i][j].first));
                    s=x[i][j].second;
                    if(!(p==0 && s==0 || p!=0 && s!=0)){
                        y=false;
                        break;
                    }
                }
            }
            if(!y)break;
        }
        if(y){
            m=max(m,c);
        }
    }
    cout<<m;
	
	return 0;
}


Measured memory_bytes: 256
#-------------------------------------------------------------------
import sys
def p(*_a):
  _s=" ".join(map(str,_a))
  #print(_s)
  sys.stderr.write(_s+"\n")
#-------------------------------------------------------------------
s = input()		# 文字列の入力  abcdefg...
k = int(input())						# 5


ans=0

if len(s)==1:
	ans=(k)//2
	print(ans)
	exit(0)

if len(s)==2:
	if s[0]==s[-1]: ans=k
	print(ans)
	exit(0)



# グループ作成
#「groupby」は、「キーとグループ」を返すようなイテレータを作成します
from itertools import groupby
m=[]
for key, g in groupby(s):
	#print( key, list(g) )
	m.append([key,len(list(g))])

p(m)

if len(m)==1:
	i=m[0][1]
	ans+=((i*k)//2)
	print(ans)
	exit(0)
		

for a,i in m:
	#p(a,i)
	ans+=(i//2)*k


if m[0][0]==m[-1][0]:
	if m[0][1]%2==1:
		if m[-1][1]%2==1:
			ans+=(k-1)

print(ans)


Measured memory_bytes: 3064
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        int d = sc.nextInt();
        
        while(true){
            c -= b;
            if(c <= 0) break;
            a -= d;
            if(a <= 0) break;
        }
        
        System.out.println(c<=0?"Yes":"No");
    }
}

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

#ifdef LOCAL
        #include "debug.h"
        #define input freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
        #else
        #define debug(...) 4
        #define input ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#endif

using ll = long long;
const int N = 2e5 + 5;
const int mod = 1e9 + 7;

int a[N * 10], vis[N * 10], done[N * 10];
int32_t main() {
    input;
    int n;
    cin >> n;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        if(done[a[i]] > 1)  continue;
        for(int j = a[i]; j <= 1000000; j += a[i])
            vis[j]++;
        done[a[i]]++;
        
    }

    int cnt = 0;
    for(int i = 0; i < n; i++) {
        if(vis[a[i]] == 1)
            cnt++;
    }
    cout << cnt;
}

Measured memory_bytes: 12088
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<sstream>
using namespace std;
int main(void){

    string str,tmp;
    getline(cin,str);
    for(int i=0;i<str.size();i++)if(str[i]==','||str[i]=='.')str[i]=' ';
    stringstream ss(str);
    bool flg = 0;
    while(ss>>tmp){

        int x = tmp.size();
        if(tmp[x-1]=='.'||tmp[x-1]==',')tmp.erase(--x);
        if(2<x&&x<7){
            if(flg)cout<<" ";
            cout<<tmp;
            flg = 1;
        }


    }
    cout<<endl;


    return 0;
}

Measured memory_bytes: 1200
def main():
    n = int(input())
    s = list(map(int, input().split(' ')))

    s = sorted(s)[::-1]

    slimes = [s[0]]
    s = s[1:]

    for i in range(n):
        make_slimes = []
        rest_slimes = []
        make_idx = 0
        for j in range(2 ** i):
            for tmp_make_idx in range(make_idx, len(s)):
                if slimes[j] > s[tmp_make_idx]:
                    make_slimes.append(s[tmp_make_idx])
                    break
                else:
                    rest_slimes.append(s[tmp_make_idx])
            make_idx = tmp_make_idx + 1
        rest_slimes += s[make_idx:]
        if len(make_slimes) < 2 ** i:
            print("No")
            return
        slimes += make_slimes
        s = rest_slimes
        slimes = sorted(slimes)[::-1]
        s = sorted(s)[::-1]
    print("Yes")


main()


Measured memory_bytes: 34676
class Dice
  attr_reader :current
  def initialize(current = 1, north = 5, east = 3)
    @current = current
    @north = north
    @east = east
  end

  def roll(direction)
    case direction
    when "N"
      @current, @north = 7 - @north, @current
    when "S"
      @current, @north = @north, 7 - @current
    when "E"
      @current, @east  = 7 - @east, @current
    when "W"
      @current, @east  = @east, 7 - @current
    end
    self
  end
end

dice = gets.split
puts dice[gets.chomp.chars.reduce(Dice.new) {|acc, x| acc.roll(x) }.current - 1]

Measured memory_bytes: 8680
#include<iostream>
 
using namespace std;
 
int main(){
  int N;
  cin >> N;
  
  int H[N];
  for(int i = 0; i < N; i++) cin >> H[i];
  
  int MAX = 0;
  int cnt = 0;
  
  for(int i = 0; i < N; i++){
    if( MAX <= H[i] ){
      MAX = H[i];
      cnt++;
    }
  }
  
  cout << cnt << endl;
  
  return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.*;
import java.math.*;
 
class Main {
    public static BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    public static PrintWriter pw = new PrintWriter(System.out);
    public static String line;
    public static StringTokenizer st, st2;
    public static ArrayList<ArrayList<Integer>> adjList;
    public static int[] dx = {-1, 0, 1, 0, -1, 1, 1, -1, 0};
    public static int[] dy = {0, 1, 0, -1, 1, 1, -1, -1, 0};
    public static int INF = 0x3f3f3f3f;
    public static int MOD = 1000000007;
    public static long LINF = 0x3f3f3f3f3f3f3f3fL;

    public static void main(String[] args) throws Exception {
        st = new StringTokenizer(br.readLine());
        long N = Long.parseLong(st.nextToken());        
        long a = Long.parseLong(st.nextToken());
        long b = Long.parseLong(st.nextToken());        

        long ans = 0;
        if ((b - a) % 2 != 0) {
            if (a - 1 <= N - b) {
                ans += a;
                b -= a;
                a -= (a - 1);
            } else {
                ans += N - b + 1;
                a += N - b + 1;
                b += N - b;
            }
        }
        // System.out.println(ans);
        ans += (b - a) / 2;
        pw.println(ans);

        pw.close();
        br.close();
    }
}

class Pair implements Comparable<Pair>{
    public int a, b;

    Pair(int _a, int _b){
        a = _a;
        b = _b;
    }
 
    public String toString(){
        return a + " " + b;
    }

    public int compareTo(Pair p){
        if (b != p.b) return b < p.b ? -1 : 1;
        if (a != p.a) return a < p.a ? -1 : 1;
        return 0;
    }
}

Measured memory_bytes: 22996
fun main(arr:Array<String>) {
    val (n,m) = readLine()!!.split(" ").map { it.toInt() }
    val gakusei = (1..n).map { readLine()!!.split(" ").map { it.toLong() } }
    val checkooint = (1..m).map { readLine()!!.split(" ").map { it.toLong() } }

    val ans = gakusei.map { a-> checkooint.map { Math.abs(it[0]-a[0]) + Math.abs(it[1] - a[1]) }.let { b->b.indices.map { Pair(b[it], it) } }.sortedBy { it.first }.map { it.second + 1 }.first() }
    ans.forEach { println(it) }
}

Measured memory_bytes: 38456
l,r = map(int,input().split())
r2 = r+0
l2 = l+0
l%=2019
r%=2019
ans = 20000
if r2-l2 >= 2019 or r<=l:
  r += 2019
for i in range(l,r+1):
  for j in range(i+1,r+1):
    ans = min(i*j%2019,ans)
if ans == 20000:
  ans = 0
print(ans)


Measured memory_bytes: 3064
N = int(raw_input())

array = map(int, raw_input().split())
num = 0

for i in range(1,N-1):
    if ((array[i] > array[i-1]) and (array[i] <= array[i+1]))or((array[i] <= array[i-1]) and (array[i] > array[i+1])) :
            num += 1

print num


Measured memory_bytes: 2568
//
//  main.cpp
//  C - Reconciled?
//
//  Created by wenhan on 2017/6/24.
//  Copyright © 2017年 wenhan. All rights reserved.
//

#include <iostream>
#include <cstdio>
using namespace std;
const int s=1e9+7;
long long fun(int n)
{
    long long m=1;
    for(int i=1;i<=n;i++)
        m=m*i%s;
    return m;
}
int main() {
    int n,m;
    scanf("%d%d",&n,&m);
    if(n-m>1||m-n>1)
        printf("0\n");
    else
    {
        if(n==m)
        {
            printf("%lld\n",(long long)(fun(n)*fun(m)%s*2%s));
        }
        else
        {
            printf("%lld\n",(long long)(fun(n)*fun(m)%s));
        }
    }
    // insert code here...
    //std::cout << "Hello, World!\n";
    return 0;
}


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

typedef long long ll;
typedef long double ld; 
typedef double db; 
typedef string str; 

typedef pair<int, int> pi;
typedef pair<ll,ll> pl; 
typedef pair<ld,ld> pd; 

typedef vector<int> vi; 
typedef vector<ll> vl;
typedef vector<ld> vd; 
typedef vector<str> vs; 
typedef vector<pi> vpi;
typedef vector<pl> vpl; 

#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)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

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

#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 = 998244353;
const ll INF = 1e18;
const int MX = 1000001;

int N, ans = 0;

int main() {
	cin.sync_with_stdio(0); cin.tie(0);
	cin >> N;
	vi a(N);
	F0R(i, N) cin >> a[i];
	F0R(i, N)
	{
		FOR(j, i + 1, N)
		{
			ans += a[i] * a[j];
		}
	}
	
	cout << ans;
    return 0;
    // You should actually read the stuff at the bottom
}

/* Stuff to Look For
 * -----------------
 * Int overflow, array bounds
 * Initializing all variables, avoid weird behavior
 * Edge cases(n = 0, n = 1)
 * Just return 0 after result
 */


Measured memory_bytes: 256
#include <algorithm>
#include <cstdio>
#include <string>

static const size_t N_MAX = 36;

bool cmp(const std::string& a, const std::string& b) {
  return a[1] < b[1];
}

int main() {
  size_t N;
  std::string A[N_MAX], B[N_MAX];
  scanf("%zu", &N);
  for (size_t i = 0; i < N; i++) {
    char c[3];
    scanf("%s", c);
    A[i] = c;
  }
  std::copy(A, A + N, B);
  std::stable_sort(B, B + N, cmp);
  for (size_t i = 0; i < N - 1; i++) {
    auto m = std::min_element(A + i, A + N, cmp);
    if (A[i] != *m)
      std::swap(A[i], *m);
  }
  for (size_t i = 0; i < N - 1; i++)
    printf("%s ", B[i].c_str());
  printf("%s\n", B[N-1].c_str());
  puts("Stable");
  for (size_t i = 0; i < N - 1; i++)
    printf("%s ", A[i].c_str());
  printf("%s\n", A[N-1].c_str());
  puts(std::mismatch(A, A + N, B).first == A + N ? "Stable" : "Not stable");
  return 0;
}

Measured memory_bytes: 2864
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner scan = new Scanner(System.in);
		int K = scan.nextInt();

		String s = "";

		for(int i = 0; i < K; i++) {
			s = s + "ACL";
		}

		System.out.println(s);
	}

}

Measured memory_bytes: 38620
import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    String[] input = new String[3];
    for(int i=0; i<3; i++){
      input[i] = scanner.next();
    }
    scanner.close();

    if(input[1].equals("+")){
      System.out.println(Integer.parseInt(input[0])+Integer.parseInt(input[2]));
    }else{
      System.out.println(Integer.parseInt(input[0])-Integer.parseInt(input[2]));
    }
  }
}


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

#define mo 1000000007
using namespace std;

int n, m, a[200005], sz[200005], ans, fa[200005];

int fis(int x) {
    return fa[x] == x ? x : fa[x] = fis(fa[x]);
}

int main() {
    scanf("%d%d", &n, &m);
    for(int i=1;i<=n;i++)
        fa[i]=i,sz[i]=1;
    while (m--) {
        int u, v;
        scanf("%d%d", &u, &v);
        if (fis(u) != fis(v)) {
            sz[fis(v)] += sz[fis(u)];
            fa[fis(u)] = fis(v);
        }
    }
    printf("%d", *max_element(sz + 1, sz + n + 1));
    return 0;
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;
const int INF = 1e9;

int main() {
  string s1, s2;
  cin >> s1 >> s2;

  cout << (s1[0] == s2[2] && s1[1] == s2[1] && s1[2] == s2[0] ? "YES" : "NO")
       << endl;
  return 0;
}


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

using namespace std;

int main() {

  char buf[1100];

  char word[1100];

  char* tp;
  int len;
  int flag=0;


  fgets(buf,sizeof(buf),stdin);

  buf[strlen(buf)-1]='\0';

  tp=strtok(buf,",. ");

  len=strlen(tp);

  if(len>=3 && len<=6) {

    flag=1;
    cout << tp;

  }

  while(tp!=NULL) {

    tp=strtok(NULL,",. ");

    if(tp!=NULL) {
      
      len=strlen(tp);

      if(len>=3 && len<=6) {

	if(flag==1) cout << " " << tp;

	else {

	  cout << tp;
	  flag=1;

	}

      }

    }

  }

  cout << endl;

  return 0;

}

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

int main(){
string s;

long long ans  = 1,n,a ;
cin>>n;
bool f=false;
for(int j=0;j<n;j++){
cin>>a;
if(a%2==1)f=true;
}

if(f)cout<<"first"<<endl;
else cout<<"second"<<endl;
return 0;
}

Measured memory_bytes: 256
import sys

if __name__ == '__main__':
    k = int(sys.stdin.readline())
    a, b = list(map(lambda x: int(x), sys.stdin.readline().split(' ')))
    for i in range(a, b+1):
        if i % k == 0:
            print('OK')
            break
    else:
        print('NG')

Measured memory_bytes: 9184
#include <stdio.h>

int main()
{
  int price, figure;
  int total_price = 0, total_figure = 0, figure_count = 0;

  while(scanf("%d,%d", &price, &figure)!=EOF){
    total_price += price*figure;
    total_figure += figure;
    ++figure_count;
  }

  figure = 0;
  if((total_figure*10/figure_count)%10 > 4){
    figure = 1;
  }

  printf("%d\n%d\n", total_price, total_figure/figure_count+figure);

  return 0;
}

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


// Union-Findの実装
const int MAX_N = 10000; // 今回の場合、頂点の数の最大値

struct UnionFind
{
  // par[i]:要素iが属する木の親の番号、i==par[i]のときは要素iが木の根となる
  int par[MAX_N];
  
  // rank[i]:根が要素iの木の高さ(ランク)
  int rank[MAX_N];
  
  // コンストラクタ
  // 各要素iが要素iを根とする高さ0の木に存在するものとして初期化を行う
  UnionFind(int n){
    for(int i = 0; i < n; i++){
      par[i] = i;
      rank[i] = 0;
    }
  }

  // 要素xが属する木の根を得るメソッド
  int find(int x){
    if(par[x] == x) return x;
    else return par[x] = find(par[x]);
  }

  // 2つの要素xとyが属する木を併合するメソッド
  void unite(int x, int y){
    x = find(x);
    y = find(y);

    // 既に同じ木に属している場合
    if(x == y) return;

    // 効率化の工夫としてランクが低いものから高いものへ辺を張る
    if(rank[x] < rank[y]) par[x] = y;
    else{
      par[y] = x;
      if(rank[x] == rank[y]) rank[x]++; // ランクが等しい場合
    }
  }

  // 2つの要素xとyが属する木の根が同じならtrueを返すメソッド
  bool same(int x, int y){
    return find(x) == find(y);
  }
};

// 辺の情報を表す構造体
struct Edge{
  int u, w, cost;
};

// Edgeをコストの小さい順にソートするための比較関数
bool comp(const Edge &e1, const Edge &e2)
{
  return e1.cost < e2.cost;
}

const int MAX_E = 100000; // 辺の数の最大値
Edge es[MAX_E]; // グラフ上の辺を保存する配列
int v, e; // 頂点の数と辺の数


int kruskal()
{
  sort(es, es + e, comp); // 辺をコストの小さい順にソート
  UnionFind uf(v); // Union-Findの準備
  int ans = 0; // 最小全域木(森)の辺の総コスト

  // 全域木に辺を追加していく
  for(int i = 0; i < e; i++){
    // コストの小さい辺から調べる
    Edge et = es[i];

    // もし辺の両端の頂点が同じ連結成分属していないならば
    if(!uf.same(et.u, et.w)){
      uf.unite(et.u, et.w); // 同じ連結成分に属させる
      ans += et.cost; // その辺を全域木に追加
    }
  }

  return ans;
}


int main()
{
  // gvは頂点数,geは辺の数
  int gv, ge;
  cin >> gv >> ge;
  v = gv;
  e = ge;
  for(int i = 0; i < e; i++){
    // 辺の端点、コストの入力を読み取る
    Edge et;
    cin >> et.u >> et.w >> et.cost;
    // 2頂点間の辺の情報を記憶
    es[i] = et;
  }

  cout << kruskal() << endl;
}

Measured memory_bytes: 2428
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
namespace Program
{
    using namespace std;
    typedef pair<char, int> pr;

    // 昇順
    //bool sort_less(const pr& left, const pr& right) {
    //    return left.second < right.second;
    //}

    // 降順
    bool sort_greater(const pr& left, const pr& right) {
        return left.second > right.second;
    }

    class Solver
    {
    private:
        const string AZ = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
        vector<pair<char, int>> pairs;

        int N;
        int K;
        string *P;

    public:
        Solver()
        {
            cin.tie(0);
            ios::sync_with_stdio(false);

            cin >> N;
            cin >> K;

            for (int i = 0; i < (int)AZ.size(); i++)
            {
                pairs.push_back(make_pair(AZ[i], 0));
            }

            P = new string[N]{};

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

                // 問題名 頭文字1文字 出現回数
                pairs[AZ.find(P[i][0])].second++;
            }

            // 降順 出現回数
            sort(pairs.begin(), pairs.end(), sort_greater);
        };
        void Solve()
        {
            int total = 0;

            while (true)
            {
                if (N <= K * total) break;

                // 都度並び替える
                // 降順 出現回数
                sort(pairs.begin(), pairs.end(), sort_greater);

                // 初期化 減らしたアルファベットの数
                int cnt = 0;

                for (int i = 0; i < (int)AZ.size(); i++)
                {

                    if (pairs[i].second == 0) break;

                    else if (cnt >= K) break;

                    // アルファベットごとのカウント
                    pairs[i].second--;

                    // 減らしたアルファベットの数
                    cnt++;
                }

                if (cnt >= K) total++;
                else break;
            }

            cout << total << "\n";
        };
    };
}

int main()
{
    // メンバ関数ポインタ取得
    void (Program::Solver::*pSolve)() = &Program::Solver::Solve;

    // コンストラクタ呼び出し
    Program::Solver obj;

    // .*演算子でアクセス
    (obj.*pSolve)();
    return 0;
}


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

int N;

void dfs(string a, char mx) {
    if (a.length() == N) cout << a << endl;
    else {
        for (char c='a'; c<=mx; ++c) {
            dfs(a + c, ((c == mx) ? (char)(mx + 1) : mx));
        }
    }
}

int main() {
    cin >> N;
    dfs("", 'a');
    return 0;
}


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

int main() 
{
  string s;
  cin >> s;
  int n = s.size();
  vector<int> a(n,0);
  int tmp = 0;
  REP(i,n-1){
    if(s[i]=='R'){
      tmp++;
      if(s[i+1]=='L'){
  		a[i+1] += tmp/2;
        a[i] += (tmp+1)/2;
      }
    }else{
      tmp=0;
    }
  }
  tmp=0;
  REPR(i,n-1){
    if(s[i]=='L'){
      tmp++;
      if(s[i-1]=='R'){
  		a[i-1] += tmp/2;
        a[i] += (tmp+1)/2;
      }
    }else{
      tmp=0;
    }
  }
  REP(i,n) cout << a[i] << " ";
  return 0;
}

Measured memory_bytes: 1024
using System;

namespace a
{
    class Program
    {
        static void Main(string[] args)
        {
            var r = int.Parse(Console.ReadLine());

            if(r < 1200){
                Console.WriteLine("ABC");
            }else if(r < 2800){
                Console.WriteLine("ARC");
            }else{
                Console.WriteLine("AGC");
            }
        }
    }
}


Measured memory_bytes: 11092
#include <stdio.h>

int main(void) {
	
	int a,b,c,d,e,x;
	
	scanf("%d/n",&a);
	scanf("%d/n",&b);
	scanf("%d/n",&c);	
	scanf("%d/n",&d);
	scanf("%d/n",&e);
	
	if(a < 40){
		a=40;
	}
	if(b < 40){
		b=40;
	}
	if(c < 40){
		c=40;
	}
	if(d < 40){
		d=40;
	}
	if(e < 40){
		e=40;
	}
	
	x=(a+b+c+d+e)/5;
	
	printf("%d\n",x);
	
	return 0;
}

Measured memory_bytes: 600
#include<iostream>
using namespace std;
int main()
{
	int N;
	cin >> N;
	int A[N];
	for (int i = 0; i < N; i++) {
		if (scanf("%d", &A[i]) == EOF) {
			cout << "ERROR" << endl;
			return 0;
		}
	}
	if (A[0] != 0) {
		cout << -1 << endl;
		return 0;
	}
	for (int i = 1; i < N; i++) {
		if (A[i] - A[i - 1] > 1) {
			cout << -1 << endl;
			return 0;
		}
	}
	long long ans = 0;
	for (int i = 1; i < N; i++) {
		if (A[i - 1] + 1 == A[i]) {
			ans++;
		}
		else if(A[i] <= A[i-1] ){
			ans += A[i];
		}
	}
	cout << ans << endl;
	return 0;
}

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

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


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define N_MAX 100005
using namespace std;

int main()
{
	int N;
  	vector<int> b;
  	vector<int> f;
  	cin >> N;
  	for(int i = 0; i < N; i++){
      	int d;
    	cin >> d;
      	b.push_back(d);
    }
  	bool ter = false;
  	int t;
  	while(b.size() > 0){
        for(int i = b.size()-1; i >= 0; i--){
            if((b[i]-1) == i){
                b.erase(b.begin()+i);
                f.push_back(i+1);
                break;
            }
        }
      	if(b.size() == t) ter = true;
      	t = b.size();
      	if(ter){
        	cout << -1 << endl;
          	break;
        }
    }
  	if(!ter){
  	reverse(f.begin(), f.end());
  	for(int i = 0; i < N; i++){
    	cout << f[i] << endl;
    }
    }
}

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

int main() {
	int n;
	double x1, x2, x3, x4, y1, y2, y3, y4;
	vector<double> X1, Y1, X2, Y2;
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3 >> x4 >> y4;
		X1.push_back(x2 - x1); Y1.push_back(y2 - y1);
		X2.push_back(x4 - x3); Y2.push_back(y4 - y3);
	}
	for (int i = 0; i < n; i++) {
		double det = fabs(X1[i] * Y2[i] - X2[i] * Y1[i]);
		if (fabs(det)<1e-10)cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

void Main()
{
    int64_t N, K;
    cin >> N >> K;
    vector<int64_t> A;
    for(int64_t i = 0; i < K; ++i)
    {
        int64_t d;
        cin >> d;
        for(int64_t j = 0; j < d; ++j)
        {
            int64_t a;
            cin >> a;
            A.push_back(a);
        }
    }

    sort(A.begin(), A.end());
    A.erase(unique(A.begin(), A.end()), A.end());
    cout << N - A.size() << endl;
}

int main()
{
    Main();
}


Measured memory_bytes: 3724
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctype.h>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>

using namespace std;

#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define lengthof(x) (sizeof(x) / sizeof(*(x)))
#define FILL(ptr, value) FILL_((ptr), sizeof(ptr)/sizeof(value), (value))
template <typename T>
void FILL_(void * ptr, size_t size, T value){
  std::fill((T*)ptr, (T*)ptr+size, value);
}
//4方向ベクトル→↑←↓
int dx[] ={1,0,-1,0};
int dy[] ={0,-1,0,1};
int n;//ビルの数
int m;//移動情報の個数
const int INF = 1e+9;
typedef pair<int,int> P;
double d[1001];//2点間の最短距離
int prev[1001];//直前の頂点
bool used[1001];
double cost[1001][1001];

void dijkstra(int s){
  fill(d,d+1000,INF);
  fill(used,used+1000,false);
  d[s] = 0;
  while(1){
    int v = -1;
    //まだ使われていない頂点のうち距離が最小のものを探す
    for(int u = 0;u <n;u++){
      if(!used[u]&&(v==-1||d[u]<d[v]))
	v = u;
    }
    if(v==-1)
      break;
    used[v] =true;
    for(int u = 0;u <n;u++){
      if(d[u]>d[v]+cost[v][u]){
	d[u] =d[v]+cost[v][u];
	prev[u] = v;
      }
    }
  }
}
int main()
{
  while(cin>>n,n){
    for(int i = 0;i <=1000;i++){
      for(int j = 0;j <=1000;j++){
	cost[i][j] = INF;
      }
    }
    map<int,P> build;
    build.clear();
    int b,x,y;
    for(int i = 0;i <n;i++){
      cin>>b>>x>>y;
      b--;
      build[b]=P(x,y);
    }
    for(int i = 0;i <=1000;i++){
      for(int j = 0;j <=1000;j++){
	if(i!=j)
	  cost[i][j] =INF;
	else
	  cost[i][j] = 0;
      }
    }
    
    for(int i = 0;i <n;i++){//距離が50以下の距離なら道があるとする。
      for(int j = 0;j <n;j++){
	int d =(build[i].first-build[j].first)*(build[i].first-build[j].first)+(build[i].second-build[j].second)*(build[i].second-build[j].second);
	if(d<=2500){
	  cost[i][j] = sqrt(d);
	  cost[j][i] = sqrt(d);
	}
      }
    }
    
    cin>>m;
    int s,g;//スタートとゴール
    stack<int> path;
    for(int i = 0;i <m;i++){
      cin>>s>>g;
      s--;
      g--;
      dijkstra(s);
      if(d[g]!=INF){
	for(int j =g;j !=s;j =prev[j]){
	  path.push(j);
	}
	path.push(s);
	int k=	path.size();
	for(int j = 0;j <k;j++){
	  cout <<path.top()+1;
	  path.pop();
	  if(j==k-1)
	    cout <<endl;
	  else
	    cout <<" ";
	}
      }
      else{
	cout <<"NA"<<endl;
      }
    }
  }
  return 0;
}

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

int main(void){
    int n; cin >> n; n--;
    vector<ll>B(n);
    for(int i=0;i<n;i++) cin >> B[i];
    B.push_back(B[B.size()-1]);
    // for(int i=0;i<B.size();i++) cout << B[i] << ' ';
    ll ans = B[0],tmp=B[0];
    for(int i=0;i<B.size()-1;i++){
        ans += min(B[i],B[i+1]);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
object Main extends App {
    val x :: y = io.Source.stdin.getLines.map(_.split(" ").map(_.toInt)).toList
    val a = y.take(x(0))
    val b = y.drop(x(0)).flatten
    a.foreach(x => println(x.zip(b).map(p => p._1 * p._2).sum))
}

Measured memory_bytes: 49144
#include<bits/stdc++.h>
#define ll  long long int
#define ull unsigned long long 
#define ff first
#define ss second
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back 
#define mp make_pair
#define inf 1000000000000000
#define mod 1000000007
#define ld long double
#define pll pair<ll,ll>
using namespace std;

int main()
{ 
   

fast;

ll a,v,b,w,t;
cin>>a>>v>>b>>w>>t;

if(a==b)cout<<"YES";
else
{
    if(w>=v)cout<<"NO";
    else
    {
        ll dis=abs(a-b);
        ll rel=v-w;

        if(rel*t>=dis)cout<<"YES";
        else cout<<"NO";
    }
}

}


Measured memory_bytes: 3612
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<stack>
#include<cstdio>
#include<bitset>
#include<unordered_map>
#include<climits>
#include<fstream>
using namespace std;
///////////////////library zone!!!!!!!!!!!!!!!!!!!!!!!!!!!!
typedef long long ll;
typedef long double ld;
#define all(a) (a).begin(),(a).end()
const ll Mod = 1000000007;
struct P {
	ll pos, cost;
	bool operator<(const P &b) const { return cost < b.cost; }
	bool operator>(const P &b) const { return cost > b.cost; }
};
struct B {
	ll to, cost;
};
struct E {
	ll from, to, cost;
	bool operator<(const E &b) const { return cost < b.cost; }
	bool operator>(const E &b) const { return cost > b.cost; }
};
struct H {
	ll x, y;
	bool operator<(const H &b) const {
		if (x != b.x) return x < b.x;
		return y < b.y;
	}
	bool operator>(const H &b) const {
		if (x != b.x) return x > b.x;
		return y > b.y;
	}
	bool operator==(const H &b) const { return x == b.x&&y == b.y; }
	bool operator!=(const H &b) const { return (*this) != b; }
};
ll gcd(ll i, ll j) {
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcd(j%i, i);
}
ll mod_pow(ll x, ll n, ll p = Mod) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res * x % p;
		x = x * x % p;
		n >>= 1;
	}
	return res;
}//x^n%p
const ll Inf = 3023372036854775807;
const int inf = 1500000000;
#define int long long
//----------------------------------------------------
signed main() {
	int a, b, c;
	cin >> a >> b >> c;
	cout << min(c, b / a) << endl;
}

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

using ll = long long;
using ld = long double;
using pii = pair<int, int>;

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define m0(x) memset(x,0,sizeof(x))

int dx4[4] = {1,0,-1,0}, dy4[4] = {0,1,0,-1};

int main(){
    vector<int> n(4);
    
    for(int i = 0; i < 4; i++)
    {
        cin>>n[i];
    }
    sort(all(n));
    if(n[0]==1 &&n[1]==4&&n[2]==7&&n[3]==9)
    {
        cout<<"YES"<<endl;
    }
    else 
    {
        cout<<"NO"<<endl;

    }
    return 0;
}

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

using namespace std;

int main() {
	string shift = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

	int k;
	cin >> k;

	string s;
	cin >> s;


	for (auto &c : s) {
		cout << shift[(c-'A'+k) % 26];
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
n, c = gets.split.map(&:to_i)
xv = n.times.map{gets.split.map(&:to_i)}

ans = -(1 << 40)
2.times do
    v_sum = Array.new(n, 0)
    n.times {|i| v_sum[i] = v_sum[i-1] + xv[i][1]}

    f = Array.new(n, 0)
    n.times {|i| f[i] = v_sum[i] - xv[i][0]}

    g = Array.new(n, 0)
    n.times {|i| g[i] = [g[i-1], f[i]].max}

    s = g[n-1]
    (n-1).downto(1) do |i|
        t = v_sum[-1] - v_sum[i-1] - 2 * (c - xv[i][0]) + g[i-1]
        s = t if s < t
    end

    ans = s if ans < s
    xv.map!{|e| e[0] = c - e[0]; e}.reverse!
end

p ans

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace __gnu_pbds;

#if !ONLINE_JUDGE
#define debug
#endif

using namespace std;
 
/*******  All Required define Pre-Processors and typedef Constants *******/
#define mem(a, b) memset(a, (b), sizeof(a))
#define repd(i,k) for(int i=k;i>=0;i--)
#define rep(i,k) for(int i=0;i<k;i++)
#define repn(i,k1,k2) for(ll i=k1;i<k2;i++)
#define sz(x) (ll)(x).size()
#define ff first
#define ss second

#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
#define ee6 (ll)1000001
#define ee5 (ll)100001

#define trav(a, v) for(auto& a : v)

#define tt ll t;cin>>t; while(t--)
typedef long long int ll;
 
typedef pair<ll, ll> pr;
typedef vector<ll> vi;
typedef vector<string> vs;
typedef vector<pr> vpr;
typedef vector<vpr>vvpr;
typedef vector<vi> vvi;

//*X.find_by_order(2) element at index=2
//X.order_of_key(1) how many elements strictly less than 1

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag,
    tree_order_statistics_node_update>;

#ifdef debug
#define dbg(...) { cerr<<"[ "; dump(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.ff<<","<<x.ss<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const unordered_map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
} 
 
template <typename Arg1>
void dump(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void dump(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    dump(names.substr(1+(int)name.size()), args...);
}
#else
    #define dbg(args...)
#endif
 
ll powmod(ll x, ll y) 
{ 
    ll res = 1;  
    x = x % MOD;
    while (y > 0) 
    { 
        if (y & 1) 
            res = (res*x) % MOD; 
        y = y>>1; // y = y/2 
        x = (x*x) % MOD;   
    } 
    return res; 
} 

int main()
{
    #if !ONLINE_JUDGE
    //freopen("in.txt","r",stdin);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    ll n,m;cin>>n>>m;
    cout<<((1<<m)*(1900*m+100*(n-m)));      
}   


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

ll solve() {
    ll N;
    cin >> N;
    string S;
    cin >> S;
    ll ans = 1;
    char c = S[0];
    for ( int i = 1; i < N; i++ ) {
        if ( c != S[i] ) ans++;
        c = S[i];
    }
    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 512
import math
from collections import deque
from collections import defaultdict
import itertools as it

#自作関数群
def readInt():
	return int(input())
def readInts():
	return list(map(int, input().split()))
def readChar():
	return input()
def readChars():
	return input().split()
def factorization(n):
	res = []
	if n%2==0:
		res.append(2)
	for i in range(3,math.floor(n//2)+1,2):
		if n%i==0:
			c = 0
			for j in res:
				if i%j==0:
					c=1
			if c==0:
				res.append(i)
	return res
def fact2(n):
	p = factorization(n)
	res = []
	for i in p:
		c=0
		z=n
		while 1:
			if z%i==0:
				c+=1
				z/=i
			else:
				break
		res.append([i,c])
	return res
def fact(n):#階乗
	ans = 1
	m=n
	for _i in range(n-1):
		ans*=m
		m-=1
	return ans
def comb(n,r):#コンビネーション
	if n<r:
		return 0
	l = min(r,n-r)
	m=n
	u=1
	for _i in range(l):
		u*=m
		m-=1
	return u//fact(l)
def combmod(n,r,mod):
	return (fact(n)/fact(n-r)*pow(fact(r),mod-2,mod))%mod
def printQueue(q):
	r=copyQueue(q)
	ans=[0]*r.qsize()
	for i in range(r.qsize()-1,-1,-1):
		ans[i] = r.get()
	print(ans)
class UnionFind():
	def __init__(self, n):
		self.n = n
		self.parents = [-1]*n

	def find(self, x): # root
		if self.parents[x]<0:
			return x
		else:
			self.parents[x] = self.find(self.parents[x])
			return self.parents[x]

	def union(self,x,y):
		x = self.find(x)
		y = self.find(y)

		if x==y:
			return

		if self.parents[x]>self.parents[y]:
			x,y = y,x

		self.parents[x]+=self.parents[y]
		self.parents[y]=x

	def size(self,x):
		return -1*self.parents[self.find(x)]

	def same(self,x,y):
		return self.find(x)==self.find(y)

	def members(self,x): # much time
		root = self.find(x)
		return [i for i in range(self.n) if self.find(i)==root]

	def roots(self):
		return [i for i,x in enumerate(self.parents) if x<0]

	def group_count(self):
		return len(self.roots())

	def all_group_members(self):
		return {r: self.members(r) for r in self.roots()} # 1~n
def bitArr(n):#ビット全探索
	x = 1
	zero = "0"*n
	ans = []
	ans.append([0]*n)
	for i in range(2**n-1):
		ans.append(list(map(lambda x:int(x),list((zero+bin(x)[2:])[-1*n:]))))
		x+=1
	return ans;
def arrsSum(a1,a2):
	for i in range(len(a1)):
		a1[i]+=a2[i]
	return a1
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1
def copyQueue(q):
	nq = queue.Queue()
	n = q.qsize()
	for i in range(n):
		x = q.get()
		q.put(x)
		nq.put(x)
	return nq
def get_sieve_of_eratosthenes(n):
	#data = [2]
	data = [0,0,0]
	for i in range(3,n+1,2):
		data.append(i)
		data.append(0)
	for i in range(len(data)):
		interval = data[i]
		if interval!=0:
			for j in range(i+interval,n-1,interval):
				data[j] = 0
	#ans = [x for x in data if x!=0]
	ans = data[:]
	return ans

o = readChar()
e = readChar()

for i in range(len(e)):
	print(o[i],e[i],sep="",end="")

if len(o)!=len(e):
	print(o[-1])
else:
	print()

Measured memory_bytes: 3444
package main

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

var sc, wr = bufio.NewScanner(os.Stdin), bufio.NewWriter(os.Stdout)

func scanString() string { sc.Scan(); return sc.Text() }
func scanInt() int { a,_ := strconv.Atoi(scanString()); return a }
func scanInt64() int64 { a,_ := strconv.ParseInt(scanString(),10,64); return a }
func scanFloat64() float64 { a,_ := strconv.ParseFloat(scanString(),64); return a }

func scanInts(n int) []int {
	res := make([]int, n); for i := 0; i < n; i++ { res[i] = scanInt() }; return res
}

func abs(a int) int { if a<0 { return -a }; return a }
func min(a,b int) int { if a<b { return a }; return b }
func max(a,b int) int { if a>b { return a }; return b }

//•*¨*•.¸¸♪Main•*¨*•.¸¸♪(　-ω-)ノ　(　・ω・)

func main() {
	defer wr.Flush()
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 10000), 1001001)

	n := scanInt()
	m := scanInt()
	k := scanInt()

	g := make([][]int, n)
	uf := make(unionFind, n)
	uf.init()

	for i := 0; i < m; i++ {
		a,b := scanInt()-1, scanInt()-1
		g[a] = append(g[a], b)
		g[b] = append(g[b], a)
		uf.unite(a,b)
	}

	ans := make([]int, n)

	for i := 0; i < n; i++ {
		ans[i] = uf.size(i)-1-len(g[i])
		ans[i] = max(0,ans[i])
	}

	for i := 0; i < k; i++ {
		c,d := scanInt()-1,scanInt()-1
		if uf.find(c) == uf.find(d) {
			ans[c]--
			ans[d]--
		}
	}

	for i := 0; i < n; i++ {
		fmt.Fprintf(wr,"%d ", ans[i])
	}
	fmt.Fprintln(wr)

}

type unionFind []int

func (uf *unionFind) init() {
	for i := 0; i < len(*uf); i++ { (*uf)[i] = -1 }
}

func (uf *unionFind) find(x int) int {
	if (*uf)[x] < 0 { return x }
	(*uf)[x] = uf.find((*uf)[x])
	return (*uf)[x]
}

func (uf *unionFind) unite(x, y int) {
	x, y = uf.find(x), uf.find(y)
	if x != y {
		if (*uf)[x] > (*uf)[y] { x,y = y,x }
		(*uf)[x] += (*uf)[y]
		(*uf)[y] = x
	}
}

func (uf *unionFind) size(x int) int {
	a := uf.find(x)
	return -(*uf)[a]
}


Measured memory_bytes: 10624
#include<stdio.h>
int main(void){
    int out,x,r,d,i;
    scanf("%d %d %d",&r,&d,&x);
    for(i=0;i<10;i++){
        out=x*r-d;
        printf("%d\n",out);
        x=out;
    }
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <stdio.h>
using namespace std;

int main()
{
  char ch[1200];
  int i, n;
    
  for(i = 0; i < 1200; i++)
  {
    ch[i] = '\n';
  }

  while(1)
  {
    scanf("%c", &ch[n]);
    if(ch[n] == '\n') break;

    if('a' <= ch[n] && ch[n] <= 'z')
    {
      printf("%c", ch[n] - 32);
    }
    else if('A' <= ch[n] && ch[n] <= 'Z')
    {
      printf("%c", ch[n] + 32);
    }
    else
    {
        printf("%c", ch[n]);
    }
     n++;
  }
    
  cout << endl;

  return 0;
}


Measured memory_bytes: 3232