akhauriyash/Code-Regression huggingface dataset:
object Main {
  def main(args: Array[String]): Unit = {
    val s = new Main()
    s.solve()
    s.out.flush()
  }
}

class Main {
  import java.io._
  import java.util.StringTokenizer

  import scala.collection.mutable
  import scala.util.Sorting
  import math.{abs, max, min}
  import mutable.{ArrayBuffer, ListBuffer}
  import scala.reflect.ClassTag

  val MOD = 1000000007
  val out = new PrintWriter(System.out)

  def solve(): Unit = {
    val N = ni()
    val S = Array(ns(N), ns(N), ns(N))
    var ans = 0
    REP(N) { i =>
      val cnt = map(3){ k => S(k)(i) }.toSet.size
      ans += cnt - 1
    }

    out.println(ans)
  }


  def debug(as: Array[Boolean]): Unit = {
    System.err.println(as.map(x => if(x) "1" else "0").mkString)
  }

  def debug(as: Array[Int]): Unit = {
    System.err.println(as.mkString(" "))
  }

  def debug(as: Array[Long]): Unit = {
    System.err.println(as.mkString(" "))
  }

  def debug(s: String): Unit = {
    System.err.println(s)
  }

  class InputReader(val stream: InputStream) {
    private val reader = new BufferedReader(new InputStreamReader(stream), 32768)
    private var tokenizer: StringTokenizer = _

    def next(): String = {
      while (tokenizer == null || !tokenizer.hasMoreTokens)
        tokenizer = new StringTokenizer(reader.readLine)
      tokenizer.nextToken
    }

    def nextInt(): Int = next().toInt
    def nextLong(): Long = next().toLong
    def nextChar(): Char = next().charAt(0)
  }
  val sc = new InputReader(System.in)
  def ni(): Int = sc.nextInt()
  def nl(): Long = sc.nextLong()
  def nc(): Char = sc.nextChar()
  def ns(): String = sc.next()
  def ns(n: Int): Array[Char] = ns().toCharArray
  def na(n: Int, offset: Int = 0): Array[Int] = map(n)(_ => ni() + offset)
  def na2(n: Int, offset: Int = 0): (Array[Int], Array[Int]) = {
    val A1, A2 = Array.ofDim[Int](n)
    REP(n) { i =>
      A1(i) = ni() + offset
      A2(i) = ni() + offset
    }
    (A1, A2)
  }
  def nm(n: Int, m: Int): Array[Array[Int]] = {
    val A = Array.ofDim[Int](n, m)
    REP(n) { i =>
      REP(m) { j =>
        A(i)(j) = ni()
      }
    }
    A
  }
  def nal(n: Int): Array[Long] = map(n)(_ => nl())
  def nm_c(n: Int, m: Int): Array[Array[Char]] = map(n) (_ => ns(m))
  def REP(n: Int, offset: Int = 0)(f: Int => Unit): Unit = {
    var i = offset
    val N = n + offset
    while(i < N) { f(i); i += 1 }
  }
  def REP_r(n: Int, offset: Int = 0)(f: Int => Unit): Unit = {
    var i = n - 1 + offset
    while(i >= offset) { f(i); i -= 1 }
  }

  def map[@specialized A: ClassTag](n: Int, offset: Int = 0)(f: Int => A): Array[A] = {
    val res = Array.ofDim[A](n)
    REP(n)(i => res(i) = f(i + offset))
    res
  }


  def sumL(as: Array[Int]): Long = {
    var s = 0L
    REP(as.length)(i => s += as(i))
    s
  }

  def cumSum(as: Array[Int]) = {
    val cum = Array.ofDim[Long](as.length + 1)
    REP(as.length) { i =>
      cum(i + 1) = cum(i) + as(i)
    }
    cum
  }
}

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

long long int a,b,n;

signed main()
{
    ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin>>a>>b>>n;n=min(n,b-1);
	cout<<(a*n)/b;
}


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

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

    int n;
    cin >> n;

    double res = 0;

    rep(i, n){
        double x;
        string u;
        cin >> x >> u;

        if(u == "BTC") res += 380000.0 * x;
        else res += x;
    }

    printf("%.10f\n", res);
}

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

using namespace std;

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


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <cmath>
#include <queue>
#include <map>
#include <stack>
#include <bitset>
#include <numeric> //lcm
#include <iomanip> //double精度 setprecision

//#include <atcoder/all>

using namespace std;
//using namespace atcoder;

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = n-1; i >= 0; --i)
#define rep1(i,n) for(int i = 1; i <= (n); ++i)
#define rrep1(i,n) for(int i = (n); i >= 1; --i)
#define REP(i,n,m) for(int i = (n); i < (m); ++i)
#define all(vec) (vec).begin(),(vec).end()

#define debug(vec) for(auto v : vec) cerr << v << " "; cerr << endl;
#define debug2D(vec2D, w) for(auto vec : vec2D) { for (auto v : vec) cerr << setw(w) << v << " "; cerr << endl; } 
#define debugP(vec) for(auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl;
#define debug2DP(vec2D) for(auto vec : vec2D) { for (auto v : vec) cerr << "(" << v.first << "," << v.second << ") "; cerr << endl; } 

const char en = '\n';

typedef long long ll;

constexpr ll INF = 1000000000; //10^10
//const ll MOD = 998244353;
constexpr ll MOD = 1000000007;

typedef vector<vector<int>> Graph;
void add_edge(Graph& g, int from, int to, bool isDirected) {
	g[from].push_back(to);
	if (!isDirected) g[to].push_back(from);
}

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

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

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

	int h,w; cin >> h >> w;

	int si,sj,gi,gj; cin >> si >> sj >> gi >> gj;
	si--; sj--; gi--; gj--;
	vector<string> s(h); rep(i,h) cin >> s[i];

	vector<vector<int>> dist(h, vector<int>(w,h*w));

	deque<pair<int,int>> deq;
	deq.push_back({si*w + sj,0});

	while (!deq.empty()) {
		pair<int,int> p = deq.front(); deq.pop_front();
		int i = p.first / w, j = p.first % w;

		if (i == gi && j == gj) {
			cout << p.second << endl;
			return 0;
		}

		if (i < 0 || j < 0 || i >= h || j >= w || dist[i][j] <= p.second) continue;
		dist[i][j] = p.second;

		for (int di = -2; di <= 2; di++) for (int dj = -2; dj <= 2; dj++) {
			if (!(0 <= j + dj && j + dj < w && 0 <= i + di && i + di < h) || (di == 0 && dj == 0) || s[i+di][j+dj] == '#') continue;
		  if (abs(di + dj) < 2 && abs(di - dj) < 2) deq.push_front({p.first + dj + w * di, p.second});
			else deq.push_back({p.first + dj + w * di, p.second+1});
		}

	}

	cout << -1 << endl;
}



Measured memory_bytes: 9508
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,x,i;
	cin>>n>>x;
	int a[105];
	for(i=0;i<n;i++){
	 cin>>a[i];
	 x=x-a[i]; }
	 sort(a,a+n);
	 n=n+x/a[0];
	cout<<n<<endl;
	return 0;
	
}


Measured memory_bytes: 256
#![allow(unused_imports)]
use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        n: usize,
        t: usize,
        mut tt: [usize; n]
    };
    tt.push(std::usize::MAX);
    let mut sum = 0;
    for (&a, &b) in tt.iter().tuple_windows() {
        sum += if a + t < b { t } else { b - a };
    }
    println!("{}", sum);
}


Measured memory_bytes: 5716
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <tuple>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl
#define show2(a, n, m) rep(i, n) { rep(j, m) {cout << a[i][j] << ' ';} cout << endl;} 
#define chmin(a, b) a = min(a, b)
#define chmax(a, b) a = max(a, b)

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<long long, long long> pll;
typedef long double ld;

const int INF = 1 << 30;
const long long INFL = 1LL << 60;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100010;

int main() {
//	cout << fixed << setprecision(15);
	int n;
	cin >> n;
	vector<vll> a(n, vll(n));
	rep(i, n) rep(j, n) cin >> a[i][j];

	ll ans = 0;
	rep(i, n) rep(j, n) {
		if(i == j) continue;
		bool add = true;
		rep(k, n) {
			if(i == k || j == k) continue;
			if(a[i][j] == a[i][k] + a[k][j]) {
				add = false;
			}
			else if(a[i][j] > a[i][k] + a[k][j]) {
				cout << -1 << endl;
				return 0;
			}
		}
		if(add) ans += a[i][j];
	}
	cout << ans / 2 << endl;
}


Measured memory_bytes: 1024
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
#include <bitset>
using namespace std;
#define MAX 300000
typedef long long ll;

int main(){
  ll N,M;
  cin>>N>>M;
  ll x=1;

  for(int i=0;i<M;i++){
    x*=2;
  }

  cout<<((N-M)*100+1900*M)*x<<endl;
}


Measured memory_bytes: 256
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {n: usize, m: usize, ab: [[usize; 2];m]};

    let mut v: Vec<Vec<usize>> = vec![vec![0; n]; n];

    for i in ab.iter() {
        let a = i[0] - 1;
        let b = i[1] - 1;

        v[a][b] += 1;
        v[b][a] += 1;
    }

    for i in v.iter() {
        println!("{:?}", i.into_iter().sum::<usize>());
    }
}


Measured memory_bytes: 2148
#include<bits/stdc++.h>
#define rep(i,N) for(int i=0;i<(N);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
using namespace std;
const long long MOD = 1e9 + 7;
const long long INF = 1e12;
const int inf = 1e9;
typedef long long ll;
typedef pair<ll,int> P;
typedef set<int> S;
int n;
int main(){
    cin>>n;
    vector<int> v(n,0);
    rep(i,n) cin>>v[i];
    vector<int> x(n,0);
    int a=0,b=0;
    rep(i,n){
        if(i%2==0) a+=v[i];
        else b+=v[i];
    }
    x[0]=a-b;
    for(int i=1;i<n;i++){
        //cout<<"i :"<<v[i-1]<<" "<<x[i-1]<<endl;
        x[i]=2*v[i-1]-x[i-1];
    }
    rep(i,n) cout<<x[i]<<endl;
    return 0;
}

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

using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<lint> vl;
typedef pair<lint,lint> pll;
#define mpr make_pair

void solve(){
    int n; cin>>n;
    vl a(n);
    lint xand = 0;
    for (int i=0; i<n; ++i){
        cin>>a[i];
        xand ^= a[i];
    }
    if (xand == 0) {
        cout<<"DRAW\n"; return;
    }
    int bit = 33;
    for (bit=33; bit>=0; bit--){
        if (xand & (1LL<<bit)) break;
    }
    int cnt = 0;
    for (lint v : a)
        if (v & (1LL<<bit))
            cnt++;
    assert(cnt%2);
    int k = cnt/2;

    if (k % 2 == 0) cout<<"WIN\n";
    else
    {
        if ((n- cnt)%2==0 ) cout<<"LOSE\n";
        else cout<<"WIN\n";
    }
}

int main()
{
    ios_base::sync_with_stdio(0);    cin.tie(NULL);    cout.tie(NULL);

    int n; cin>>n;
    map<int, pair<set<int>, set<int>>> x, y, xpyu, xmyu, xpyd, xmyd;

    auto init = [](int id, int v, map<int, pair<set<int>, set<int>>> &mp, bool up){
//        if (mp.find(id) == mp.end()) mp[id] = {1e9, -1e9};
        if (up) mp[id].first.insert(v);
        else mp[id].second.insert(v);
    };

    for (int i=0; i<n; ++i){
        int a, b; cin>>a>>b;
        char d; cin>>d;

        if (d == 'U'){
            init(a, b, x, true);
            init(a+b, a-b, xpyu, 0);
            init(a-b,a+b, xmyu, 1);
        } else if (d == 'D') {
            init(a, b, x, 0);
            init(a+b, a-b, xpyd, 1);
            init(a-b,a+b, xmyd, 0);
        } else if (d == 'R') {
            init(b, a, y, 1);
            init(a+b, a-b, xpyu, 1);
            init(a-b,a+b, xmyd, 1);
        } else if (d == 'L') {
            init(b, a, y, 0);
            init(a+b, a-b, xpyd, 0);
            init(a-b,a+b, xmyu, 0);
        }
    }

    int mt = 1e9;
    for (const map<int, pair<set<int>, set<int>>> *mp : {&x, &y, &xpyu, &xmyu,&xpyd, &xmyd,}){
        for (const pair<int, pair<set<int>, set<int>>>  &p : *mp){
            const pair<set<int>, set<int>> &ps = p.second;

            const set<int> &up = ps.first;
            const set<int> &down = ps.second;
            if (up.empty() || down.empty()) continue;

            auto x = up.begin();
            auto y = down.begin();

            for (; x != up.end(); ++x)
            {
                while(y != down.end() && *x > *y){
                    y++;
                }
                if (y != down.end()) mt = min(mt, 10 * (*y - *x) / 2);
            }

//            if (ps.first <= ps.second)
//            {
//                mt = min(mt, 10 * (ps.second - ps.first) / 2);
//            }
        }
    }
    if (mt < 1e9) cout<<mt;
    else cout<<"SAFE";
}


Measured memory_bytes: 114988
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (ll i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (ll i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,x) for (ll i = 0; i < x.size(); i++)
#define RREPALL(i,x) for (ll i = x.size()-1; i >= 0; i--)
#define REPITR(itr,x) for (auto itr = (x).begin(); itr != (x).end(); itr++)
#define ALL(x) (x).begin(), (x).end()
#define SORT(x) sort(ALL(x))
#define MIN_ELEMENT(x) min_element(ALL(x))
#define MAX_ELEMENT(x) max_element(ALL(x))
#define COUNT(x,num) count(ALL(x), num)
#define MEMSET(x,val) memset(x, val, sizeof(x))
#define MAX(a,b) a = max(a,b)
#define MIN(a,b) a = min(a,b)
#define debug(x) cerr<<__LINE__<<": "<<(#x)<<" = "<<(x)<<endl;
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
#define e1 first
#define e2 second
#define nextline putchar('\n')
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> VI;
typedef vector<vector<int>> VVI;
typedef vector<ll> VLL;
typedef vector<vector<ll>> VVLL;
const int INF = 1e7;
const ll MOD = 1e9 + 7;

static const double pi = 3.141592653589793;

int main()
{
	int a, b, h, m;
	double c;
    cin>>a>>b>>h>>m;
    c = sqrt(a * a + b * b - 2 * a * b * cos((double)(h / 12.0 + m / (12.0 * 60) - m / 60.0) * 2 * pi));

    cout<<setprecision(15)<<c<<endl;

    return 0;
}


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

int main(){

  int n,m;
  cin >> n >> m;
  vector<int> s(m);
  vector<int> c(m);
  vector<int> cnt = {0,0,0};
  vector<int> ans = {1,0,0};

  rep(i,m){
    cin >> s[i] >> c[i];
    
    if(cnt[s[i]-1]==0){
      ans[s[i]-1] = c[i];
      cnt[s[i]-1]++;
    }
    
    else{
      if(ans[s[i]-1]!=c[i]){
        cout<<-1;
        return 0;
      }
    }
  }

  if(m == 0){
    rep(i,n){
      if(n==1)
        cout<<0;
      else
        cout<<ans[i];
    }
    return 0;
  }

  if(n>1 && ans[0]==0){
    cout<<-1;
    return 0;
  }
  
  rep(i,n){
    cout<<ans[i];
  }
  
  
  return 0;
}

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

int main(void){
    int X, Y, Z, K;
    cin >> X >> Y >> Z >> K;
    vector<long long>cakesA(X);
    vector<long long>cakesB(Y);
    vector<long long>cakesC(Z);
    for (int i = 0; i < X; i++) cin >> cakesA[i];
    for (int i = 0; i < Y; i++) cin >> cakesB[i];
    for (int i = 0; i < Z; i++) cin >> cakesC[i];
    
    vector<long long> cakesAB;
    for (int i = 0; i < X; i++){
        for (int j = 0; j < Y; j++){
            cakesAB.push_back(cakesA[i] + cakesB[j]);
        }
    }
    
    sort(cakesAB.begin(), cakesAB.end());
    reverse(cakesAB.begin(), cakesAB.end());
    
    vector<long long> cakesABC;
    for (int i = 0; i < min(K, (int)cakesAB.size()); i++){
        for (int j = 0; j < Z; j++){
            cakesABC.push_back(cakesAB[i] + cakesC[j]);
        }
    }
    
    sort(cakesABC.begin(), cakesABC.end());
    reverse(cakesABC.begin(), cakesABC.end());
    
    for (int i = 0; i < K; i++){
        cout << cakesABC[i] << endl;
    }
}

Measured memory_bytes: 42984
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define all(a)      (a).begin(),(a).end()
#define sz(x)       (int)x.size()
#define hell        1000000007
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
ll dp[22][(1<<21)+5],a[22][22];
int n;
int func(int i,int mask){
    if(mask==(1<<n)-1 and i==n)
        return 1;

    if(dp[i][mask]!=-1)
        return dp[i][mask];

    ll ans=0;
    for(int j=0;j<=20;j++){
        if(a[i][j]==1 and (1<<j&mask)==0)
            ans+=func(i+1,mask|(1<<j));
    }
    //cout<<i<<" "<<mask<<" "<<ans<<endl;
    return dp[i][mask]=ans%hell;
}
int main(){
    cin>>n;

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

    memset(dp,-1,sizeof dp);

    cout<<func(0,0);
}

Measured memory_bytes: 360704
#!/usr/bin/env python
# encoding: utf-8


class Solution:
    @staticmethod
    def stack_polish_calc():
        # write your code here
        # array_length = int(input())
        calc_func = ('+', '-', '*')
        array = [str(x) for x in input().split()]
        # print(array)
        result = []
        for i in range(len(array)):
            if array[i] not in calc_func:
                result.append(str(array[i]))
            else:
                calc = array[i]
                arg_2 = result.pop()
                arg_1 = result.pop()
                result.append(str(eval(''.join((str(arg_1), calc, str(arg_2))))))

        print(*result)


if __name__ == '__main__':
    solution = Solution()
    solution.stack_polish_calc()

Measured memory_bytes: 7580
#A

"""
s = input().split("/")
if int(s[1]) <= 4:
    print("Heisei")
else:
    print("TBD")
"""
#B
"""
n = int(input())
ans = 0
for i in range(n):
    a = input().split()
    if a[1] == "JPY":
        ans += int(a[0])
    else:
        ans +=  float(a[0]) * 380000
print(ans)
"""

#C
"""
n, a, b, c = map(int, input().split())
abc = [a,b,c]
x = [int(input()) for i in range(n)]
x.sort()
ans = []
flg = 0
for i in x:
    if i in abc:
        ans.append(i)
        flg = 1
if flg:
    for i in ans:
        abc.remove(i)
        x.remove(i)

"""
#D

a, b, q = map(int, input().split())
s = [int(input()) for i in range(a)]
t = [int(input()) for i in range(b)]
s.sort()
t.sort()

import bisect


for i in range(q):
    x = int(input())
    s_l = bisect.bisect_left(s, x) - 1
    t_l = bisect.bisect_left(t, x) - 1
    s_r = s_l + 1
    t_r = t_l + 1
    if s_l == -1:
        s_l = 0
    if t_l == -1:
        t_l = 0
    if s_l == a :
        s_l = a - 1
        s_r = a - 1
    if s_r == a:
        s_r = a - 1
    if t_l == b:
        t_l = b - 1
        t_r = b - 1
    if t_r == b:
        t_r = b - 1
    ans = min(abs(t[t_l] - s[s_r]) + min(abs(t[t_l] - x), abs(s[s_r] - x)),
    abs(s[s_l] - t[t_r]) + min(abs(s[s_l] - x), abs(t[t_r] - x)),
    abs(s[s_l] - t[t_l]) + min(abs(s[s_l] - x), abs(t[t_l] - x)),
    abs(s[s_r] - t[t_r]) + min(abs(s[s_r] - x), abs(t[t_r] - x)),
    )
    
    print(ans)


Measured memory_bytes: 12096
#include <iostream>

int main(){
    int n, k;
    std::cin >> n >> k;

    int ans = 1;
    for(int i = 0; i < n; ++i){
        if(ans <= k){
            ans *= 2;
        }else{
            ans += k;
        }
    }

    std::cout << ans << std::endl;

    return 0;
}


Measured memory_bytes: 888
// C++ 14
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(__x, __start, __end) for(int __x = __start; __x < __end; __x++)

int main() {
  int n;
  cin >> n;
  vector<int> A(n);
  loop(i,0,n) cin >> A[i];
  int min_ = 100000000;
  for (int k=-100; k<=100; k++) {
    int cost = 0;
    for (auto &&a: A) cost += (a-k)*(a-k);
    min_ = min(cost, min_);
  }
  cout << min_ << endl;
  return 0;
}


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

using namespace std;

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

int main() {
  string s, t;
  cin >> s >> t;
  int answer = 0;
  Rep(i, s.size()) {
    if (s[i] != t[i]) answer++;
  }
  cout << answer << endl;
  return 0;
}


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

#define FOR(a, b, c) for (int a = (b), _for = (c); a < _for; ++a)
#define REP(a, n) FOR(a, 0, n)
#define x first
#define y second
#define pb push_back
#define pii pair<int, int>
#define ll long long
#define lf double

using namespace std;

const int MAX = (int)1e6 + 5;

int main(){
	int a,b;
	scanf ("%d%d",&a,&b);
	printf ("%lld",(ll)a*b/__gcd(a,b));
	
	
	
	return 0;
}


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


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

    if(S == "zyxwvutsrqponmlkjihgfedcba"){
        cout << -1 << endl;
        return 0;
    }
    map<char, int> mp;
    for(char c: S){
        mp[c]++;
    }
    if(mp.size() != 26){
        for(char c = 'a'; c <= 'z'; c++){
            if(!mp.count(c)){
                cout << S << c << endl;
                return 0;
            }
        }
    }
    string T = S;
    next_permutation(S.begin(), S.end());
    for(int i = 0; i < S.size(); i++){
        if(S[i] == T[i]){
            cout << S[i];
            continue;
        }
        cout << S[i] << endl;
        return 0;
    }

}


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


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

 char x1;
 cin>>x1;

 if(isupper(x1)){
    cout<<"A";
 }

 else{
    cout<<"a";
 }



}


Measured memory_bytes: 3648
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include <string>
#include <map>
#include <set>
#include <list>

#define ll long long
#define fornum(A,B,C) for(A=B;A<C;A++)

using namespace std;

int i,j,k,l,m,n;
/////////////////////////////////////////////////////
#define INF 999999999
#define DUB 21 //>log2_505050

char s[505050];
int Q;

int sl;
int nextc[505050][30];
int nextdb[DUB][505050];


int main(){
    //文字列入力
    cin>>s;

    //データ作成
    for(sl=0;s[sl]!='\0';sl++);

    int C[30];
    //cout<<sl<<" "<<endl;
    for(j=0;j<27;j++){
        nextc[sl][j]=INF;
        C[j]=INF;
    }
    for(i=sl-1;i>=0;i--){
        for(j=0;j<27;j++){
            nextc[i][j]=INF;
        }
        int cc=s[i]-'a';
        nextc[i][cc]=i+1;
        int ci=nextc[nextc[i][cc]][cc];
        
        while(ci!=INF&&cc<26){
            cc++;
            nextc[i][cc]=ci;
            ci=nextc[nextc[i][cc]][cc];
        }
        if(cc==26){
            int idx=nextc[i][26];
            int cci=s[i]-'a';
            cc=0;
            while(cc<cci){
                nextc[i][cc]=nextc[idx][cc];
                cc++;
            }
        }
        /*
        cout<<"\n"<<i<<":"<<endl;
        for(j=0;j<27;j++){
            if(nextc[i][j]==INF)
                cout<< " ["<<j<< "]:-"; 
            else
                cout <<" ["<<j<< "]:" << nextc[i][j];
        }
        */
        
    }

    //ダブリング
    for(i=0;i<=sl;i++){
        nextdb[0][i]=nextc[i][26];
    }
    for(k=1;k<DUB;k++){
        for(i=0;i<=sl;i++){
            if(nextdb[k-1][i]!=INF){
                nextdb[k][i]=nextdb[k-1][nextdb[k-1][i]];
            }else{
                nextdb[k][i]=INF;
            }
            //cout<<" "<<k<<":"<<i<< nextdb[k][i]<<endl;
        }
    }   

    //検索
    cin>>Q;
    int l,r,lr,next;
    for(i=0;i<Q;i++){
        cin >> l >> r;
        l--;
        for(k=DUB-1;k>=0;k--){
            if(r>=nextdb[k][l]){
                l=nextdb[k][l];
                if(r==l)
                    break;
            }
        }
        if(l==r){
            cout<< "Yes"<<endl;
        }else{
            cout<<"No"<< endl;
        }
    }
    
    return 0;
}

Measured memory_bytes: 101376
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#include <bitset>
#define M 1000000007
#define M1 998244353

#define tr(container, it) \
for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)

#define fast                        \
  ios_base::sync_with_stdio(false); \
  cin.tie(NULL);

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

ll power(ll x, ll n)
{
    ll result = 1;
    while (n)
    {
        if (n % 2 == 1)
            result = result * x;
        n = n / 2;
        x = x * x;
    }
    return result;
}

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

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

inline ll mul(ll x, ll y, ll m)
{
    ll z = 1LL * x * y;
    if (z >= m)
    {
        z %= m;
    }
    return z;
}

ll powmod(ll x, ll y, ll m)
{
    ll r = 1;
    while (y)
    {
        if (y & 1)
        {
            r = mul(r, x, m);
        }
        y >>= 1;
        x = mul(x, x, m);
    }
    return r;
}



void start()
{
    fast;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
}
/***********************************************************************************************************/

int main()
{
    start();

    int n, m, k;
    cin>>n>>m>>k;
    int a[m];
    int b=0, c=0;
    for (int i=0;i<m;i++)
    {
        cin>>a[i];
        if (a[i]<k)
        {
            b++;
        }
        else
        {
            c++;
        }
    }
    cout<<min(b, c);
    return 0;
}

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

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

def f(x):
    return (a*x)//b - (x//b)*a


res = f(n)


for i in range(max(1,n-10000),n+1):
    res = max(res,f(i))

w = (n//b)*b - 1
w2 = (n//b)*b - 1 + b

for i in range(max(1,w-10000),min(n+1,w+10000)):
    res = max(res,f(i))

for i in range(max(1,w2-10000),min(n+1,w2+10000)):
    res = max(res,f(i))


print(res)

Measured memory_bytes: 67708
#include <stdio.h>
#include <stack>

int main(void) {
  std::stack<int> st;
  int n;
  while(scanf("%d", &n) != EOF) {
    if(n) st.push(n);
    else {
      printf("%d\n", st.top());
      st.pop();
    }
  }
  return 0;
}


Measured memory_bytes: 2672
#include<iostream>
#include<stdlib.h>
#include<cstdio>
#include<string>
#include<cmath>
#include<vector>
#include<algorithm>
#define N 41
using namespace std;
int main()
{
	int a, b;
	cin >> a >> b;
	cout << 2 * b - a << endl;
	return 0;
}

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

int main() {

	int m = 0, f = 0, r = 0, sum;
	char rank;

	while (true) {
		cin >> m >> f >> r;

		if ((m & f & r) == -1)
			break;

		if (m < 0 || f < 0) {
			rank = 'F';
		} else {
			sum = m + f;
			if (sum < 30) {
				rank = 'F';
			} else if (sum < 50) {
				rank = 'D';
				if (r >= 50)
					rank = 'C';
			} else if (sum < 65) {
				rank = 'C';
			} else if (sum < 80) {
				rank = 'B';
			} else {
				rank = 'A';
			}
		}
		cout << rank << endl;
	}

	return 0;
}

Measured memory_bytes: 1156
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Random;
import java.util.StringTokenizer;

/*
1
4
0011
 */
public class Main {

    public static void main(String[] args) {
        FastScanner fs=new FastScanner();
        int T=fs.nextInt();
        if(T>=30){
            System.out.println("Yes");

        }
        else{
            System.out.println("No");
        }


    }

    static final Random random=new Random();

    static void ruffleSort(int[] a) {
        int n=a.length;//shuffle, then sort
        for (int i=0; i<n; i++) {
            int oi=random.nextInt(n), temp=a[oi];
            a[oi]=a[i]; a[i]=temp;
        }
        Arrays.sort(a);
    }

    static class FastScanner {
        BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
        StringTokenizer st=new StringTokenizer("");
        String next() {
            while (!st.hasMoreTokens())
                try {
                    st=new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }
        int[] nextArray(int n) {
            int[] a=new int[n];
            for (int i=0; i<n; i++) a[i]=nextInt();
            return a;
        }
        long nextLong() {
            return Long.parseLong(next());
        }
    }


}

Measured memory_bytes: 32836
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<algorithm>
//deque/functional/iterator/list/map/memory/numeric/queue/set/stack/utility/vector
//#include<bits/stdc++.h>
#define ll long long
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	int x,y,z,k,s;
	cin>>k>>s;
	int w=0;
	for(int x=0;x<=k;x++)
		for(int y=0;y<=k;y++)
        {
			if(s-x-y<=k&&s-x-y>=0)
			w++;
        }
	cout<<w<<endl;
return 0;
}


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

using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
#define all(x) x.begin(), x.end()

template <typename T1, typename T2> inline void chkmin(T1 &x, const T2 & y) {if (x > y) x = y;}
template <typename T1, typename T2> inline void chkmax(T1 &x, const T2 & y) {if (x < y) x = y;}

void read() {
	int n;
	cin >> n;
	while (n) {
		if (n % 10 == 7) {
			cout << "Yes";
			return;
		}
		n /= 10;
	} 
	cout << "No";
}

void run() {

}

void write() {

}

signed main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	read();
	run();
	write();
	return 0;
}

Measured memory_bytes: 3648
#include <stdio.h>

#define M 100
#define INF 1000000000

/*
typedef struct{
  int ikisaki;
  int omomi;
} keiro;

keiro miti[MAX][MAX];

int main(){

  int i,j,n,k,tyouten[MAX][2],count;

  scanf("%d",&n);

  for(i=0;i<n;i++){

    scanf("%d%d",&tyouten[i],&k);

    for(j=0;j<k;j++) scanf("%d%d",&miti[i][j].ikisaki,&miti[i][j].omomi);

}

  for(i=0;i<n;i++){

    count=0;

    if(i!=0){

for

}

    printf("%D %D\n",i,count);

}

  return 0;

}*/


int n;
int kyori[M][M];
int omomi[M];
char used[M];

void dijkstra(/*int*/);

int main(){

  int i,j,k,l,ikisaki,omo;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      kyori[i][j]=INF;
    }
  }

  for(i=0;i<n;i++){

    scanf("%d%d",&k,&l);

    for(j=0;j<l;j++){

      scanf("%d%d",&ikisaki,&omo);
      kyori[k][ikisaki]=omo;
    }
  }

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

  dijkstra();

  for(i=0;i<n;i++){

    // dijkstra(i);

    printf("%d %d\n",i,omomi[i]);
  }

  return 0;

}

void dijkstra(/*int g*/){

  int i,j,min,g=0;

  for(i=0;i<n;i++){

    omomi[i]=INF;
    used[i]=0;
  }

  if(g==0) omomi[g]=0;

  while(1){

    min=INF;
    g=-1;
    for(i=0;i<n;i++){

      if(!used[i] && min>omomi[i]){ 
	min=omomi[i];
	g=i;

      }
    }
    // printf("%d\n",min);
    if(min == INF) break;

    used[g]=1;

	for(i=0;i<n;i++){

	  //      if(omomi[g]==min){
	//	printf("%d %d\n",min,omomi[j]);

	  if(!used[i]&&omomi[i]>(kyori[g][i]+omomi[g])&&kyori[g][i]!=INF)
	    omomi[i]=(kyori[g][i]+omomi[g]);

	  //	}

      }

  

  }

}

Measured memory_bytes: 636
#include<cstdio>
#include<algorithm>
#include<vector>
#include<deque>
#include<stack>
#include<queue>
#include<string>
#include<iostream>
#include<tuple>
#include<utility>
#include<set>
#include<queue>
#include<iomanip>
#include<iterator>
//#include<chrono>
//cout<<setprecision(12)
//fixed
//#include<random>
using namespace std;
typedef long long int llint;
typedef long double lldo;
const int big=1e9+100000;
const int mod=1e9+7;
const lldo eps=1e-9;
const long double pai=3.141592653589793238462643;
#define mt make_tuple
#define mp make_pair
#define fir first
#define sec second
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define res resize
#define ins insert
#define era erase
#define dme(in) cout<<in<<endl;return 0
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
int main(void){
	int q;cin>>q;
	while(q--){
		int c,a,n;cin>>c>>a>>n;
		int r=0;
		int can=min(c,min(a,n));
		r+=can;
		c-=can;
		a-=can;
		n-=can;
		int cca=min(c/2,a);
		r+=cca;
		c-=cca*2;
		a-=cca;
		r+=c/3;
		cout<<r<<endl;
	}
	return 0;
}

Measured memory_bytes: 3120
# でつoO(YOU PLAY WITH THE CARDS YOU'RE DEALT..)
import sys
def main(N, A):
    xor = 0
    for i in range(2, N):
        xor ^= A[i]
    p = A[0] + A[1]
    if (p - xor) & 1:
        return -1
    a = (p - xor) >> 1

    # dp[i][j]=A[0]と同じ桁数の整数で下からi桁目までで条件を満たす値の最大値
    # j=0: i桁目まで見てN未満が確定, j=1: 未確定
    bl = max(A[0], xor).bit_length()
    dp = [[-1] * 2 for _ in range(bl + 1)]
    # 初期状態
    dp[0][0] = 0

    az = A[0]
    for i in range(bl):
        ni = i + 1
        azb = az & 1
        xorb = xor & 1
        ab = a & 1
        for j in range(2):
            if dp[i][j] < 0: continue
            for nazb in range(2):
                if nazb > azb:
                    nj = 1
                elif nazb < azb:
                    nj = 0
                else:
                    nj = j
                for nbzb in range(2):
                    if nazb ^ nbzb == xorb and nazb & nbzb == ab:
                        break
                else:
                    continue
                dp[ni][nj] = max(dp[ni][nj], dp[i][j] | (nazb << i))
        az >>= 1
        xor >>= 1
        a >>= 1

    ans = dp[bl][0]
    if ans <= 0:
        return - 1
    return A[0] - ans

if __name__ == '__main__':
    input = sys.stdin.readline
    N = int(input())
    *A, = map(int, input().split())
    print(main(N, A))


Measured memory_bytes: 62416
#include <cstdio>
#include <algorithm>
const int inf = 0x7fffffff;
using namespace std;
int n, t, x, c, ans = inf;
int main() {
  scanf("%d%d", &n, &t);
  for(int i = 0; i < n; ++i) {
    scanf("%d%d", &c, &x);
    if(x <= t) ans = min(ans, c);
  }
  if(ans == inf) puts("TLE");
  else printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 128
#include <string>
#include <stdio.h>
#include <iostream>
#define ll long long
#define ld long double
#define PI 3.14159
using namespace std;
// string mul(string a, string b)
// {
//     string res="";
//     int n=a.length();
//     int m=b.length();
//     int len=n+m-1;
//     int carry=0;
//     for(int i=len;i>=0;i--)
//     {
//         int tmp=0;
//         for(int j=n-1;j>=0;j--)
//             if(i-j<=m && i-j>=1)
//             {
//                 int a1=a[j]-48;
//                 int b1=b[i-j-1]-48;
//                 tmp+=a1*b1;
//             }
//             tmp+=carry;
//             carry=tmp/10;
//             res=(char)(tmp%10 + 48)+res;
//     }
//     while(res.length()>1 && res[0]=='0') res.erase(0,1);
//     return res;
// }
int main()
{
    // string p="314159265358979323846";
    // string n;
    // cin >> n;
    // string ans=mul(mul(n,"2"),p);
    // cout<<ans;
    ll n;
    cin >> n;
    float c = n * 2 * PI;
    cout << c;
}

Measured memory_bytes: 3784
S = str(input())

cnt = 0
ans = [0]

for i in range(0, len(S)):
  if S[i] == "A" or S[i] == "C" or S[i] == "G" or S[i] == "T":
    cnt = cnt + 1
    ans.append(cnt)
  else:
    cnt = 0
print(max(ans))

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

using namespace std;
#define forn(i,n) for(i=0;i<n;i++)
#define forn1(i,a,n) for(i=a;i<=n;i++)

int32_t main(void)
{
	int i,n,j,x,p,k;
	cin>>n>>k;
	vector<int>dp(n,INT_MAX);
	vector<int>h(n);
	forn(i,n)
	{
		cin>>h[i];
	}
	dp[0]=0;
	forn1(i,0,n)
	{
		p=min(i+k,n-1);
		forn1(j,i+1,p)
		{
			x=fabs(h[i]-h[j]);
			dp[j]=min(dp[j],dp[i]+x);
		}
	}
	cout<<dp[n-1]<<endl;
	return 0;
}

Measured memory_bytes: 4048
import math
f= False

x=int(input())
for i in range(x):
	for j in range(1, 1+int(math.sqrt(x))):
		for k in range(2,10):
			if x == j**k:
				print(x)
				f=True
				break
		if f:
			break
	if f:
		break
	x-=1

Measured memory_bytes: 3060
s = int(input())

seta = set()
seta.add(s)

p = s
c = s
i = 2
while True:
    if p%2 == 0:
        c = p//2
    else:
        c = 3*p+1

    if c in seta:
        break
    else:
        seta.add(c)

    p = c
    i += 1

print(i)



Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp(a, b) make_pair(a, b)
typedef pair<int, int> pii; 
const ll mod = 1e9 + 7;
template <class T> T lowbit(T x){return ((x)&(-(x)));}
const int maxn = 2e5 + 10;
int main()
{
	ll n, a, b;
	cin >> n >> a >> b;
	ll step = n / (a + b);
	ll ans = step * a;
	n -= step * (a + b);
	ans += min(a, n);
	cout << ans << endl;
	return 0;
}

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

using namespace std;

typedef long long ll;

int main() {
  int N, M;
  
  cin >> N >> M;
  
  vector<bool> isBroken(N + 1, false);
  vector<ll> dp(N + 1, 0);
  
  for (int i = 0; i < M; i++) {
    int in;
    
    cin >> in;
    
    isBroken[in] = true;
  }
  
  dp[0] = 1;
  
  if (isBroken[1]) {
    dp[1] = 0;
  } else {
    dp[1] = 1;
  }
  
  if (N == 1) {
    cout << dp[1] << endl;
    
    return 0;
  }
  
  for (int i = 2; i < N + 1; i++) {
    if (isBroken[i]) {
      dp[i] = 0;
    } else {
      dp[i] = (!isBroken[i - 1] ? dp[i - 1] : 0)
            + (!isBroken[i - 2] ? dp[i - 2] : 0);
      dp[i] = dp[i] % 1000000007;
    }
  }
  
  cout << dp[N] << endl;
  
  return 0;
}

Measured memory_bytes: 1024
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int N = scan.nextInt();
        long[] a = new long[N];
        for (int i = 0; i < N; i++) {
            a[i] = scan.nextInt();
        }
        long ans = 0;
        for (int i = 0; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                ans += a[i] * a[j];
            }
        }
        System.out.println(ans);
    }
}


Measured memory_bytes: 23636
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var a=input.trim()-0;
var b=1;
while(true){
   b=b*2;
   if(b<a)continue;
   else if(b==a)console.log(b);
   else if(b>a)console.log(b/2);
   break;
}


Measured memory_bytes: 15380
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size1,init=nil,size2=-1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す
  if size2==-1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

H,W=get_i
a=array(H)
H.times do|i|
    a[i]=get_nsp
end
ans=array(W+2,"",H+2)
(H+2).times do|i|
    ans[i][0]="#"
    ans[i][W+1]="#"
end
(W+2).times do|i|
    ans[0][i]="#"
    ans[H+1][i]="#"
end
1.upto(H) do|i|
    1.upto(W) do|j|
      ans[i][j]=a[i-1][j-1]
    end
end
(H+2).times do|i|
    puts ans[i].join("")
end

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

void gcd(vector<int> &a, string buf){
  vector<int> bufs(26);
  int num;
  for (int i=0; i<buf.size(); i++){
    num = (int)(buf.at(i)-'a');
    bufs.at(num)++;
  }
  for (int i=0; i<26; i++){
    a.at(i) = min(a.at(i), bufs.at(i));
  }
}

int main() {
  int n; cin >>n;
  string buf;
  vector<int> a(26, 50);// アルファベットn文字がm子あるよ
  for (int i=0; i<n; i++){
    cin >>buf;
    gcd(a, buf);
  }
  int tsize = 0;
  for (int i=0; i<26; i++){
    tsize += a.at(i);
  }
  
  vector<char> t(tsize);
  int tindex = 0;
  for (int i=0; i<26; i++){
    for (int j=0; j<a.at(i); j++){
      t.at(tindex) = (char)(i+'a');
      tindex++;
    }
  }
  for (int i=0; i<tsize; i++){
    cout <<t.at(i);
  }
  
  //cout <<ans;
  cout <<endl;
}


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

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

	string str1,str2;
	cin >> str1 >> str2;
	str2.pop_back();
	if (str1 == str2) cout << "Yes";
	else cout << "No";
}

Measured memory_bytes: 3648
#include <stdio.h>

int main(void)
{
    int A, B, C;
    scanf("%d", &A);
    scanf("%d", &B);
    scanf("%d", &C);

    // A == B != C, A == C != B, B == C != A の全通りを書く
    if ((A == B && B != C) || (A == C && C != B) || (B == C && C != A))
    {
        printf("Yes\n");
    }
    else
    {
        printf("No\n");
    }

    return 0;
}


Measured memory_bytes: 1620
# -*- coding: utf-8 -*-
def check(r,g,b):
    if g > r and b > g:
        return True
    else:
        return False

A,B,C = map(int, input().split())
K = int(input())

for i in range(K+1):
    for j in range(K+1-i):
        for k in range(K+1-i-j):
            if i+j+k==0:
                continue

            r = A*(2**i)
            g = B*(2**j)
            b = C*(2**k)
            if check(r, g, b):
                print("Yes")
                exit()

print("No")


Measured memory_bytes: 9196
/*
#include <boost/multiprecision/cpp_int.hpp>
namespace mp = boost::multiprecision;
typedef mp::cpp_int mint; //*/
#include <bits/stdc++.h>
#define  re(i,j,n) for(li i=(j);i<(n);i++)
#define  rep(i,n) re(i,0,(n))
#define  red(i,n) for(li i=n;i>0;i--)
#define  all(a) begin(a),end(a)
#define  pb(a) push_back(a)
using namespace std;
typedef long int li;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<li> vli;
typedef vector<string> vs;


int main()
{
    li a,b,c;
    cin>>a>>b>>c;
    cout<<((a==b+c||b==c+a||c==a+b)?"Yes":"No")<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef struct node
{
	float a;
	char b[4];
}N,*PN;
N arr[11];
int main()
{
	int i,n;
	float sum=0;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%f %s",&arr[i].a,&arr[i].b);
		if(strcmp(arr[i].b,"JPY")==0)
			sum+=arr[i].a;
		else
			sum+=arr[i].a*380000.0;	
	}
	printf("%f",sum);
	return 0;
}



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

int main(){
  ll A,B,K;
  cin >> A >> B >> K;
  if(K<A){
    A-=K;
  }
  else{
    if(K-A<B){
      B-=K-A;
    }
    else{
      B=0;
    }
    A=0;
  }
  cout << A << " " << B << endl;
}

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

using namespace std;

int main(){
	int k;
	string s;
	cin >> k;
	cin >> s;
	if(s.size() <= k){
		cout << s;
	} 
	else if(s.size() > k){
		cout << s.substr(0, k) + "...";
	}
	return 0;
}

Measured memory_bytes: 3632
// -*- mode:c++; coding:utf-8; c-basic-offset:2; -*-
// ALDS1_5-A: Exhaustive Search

#include <cstdio>

static bool solve(const int m, const int as[], const unsigned int n)
{
  if (m == 0) {
    return true;
  } else if (m < 0 || n == 0) {
    return false;
  } else {
    return solve(m-as[0], as+1, n-1) || solve(m, as+1, n-1);
  }
}

int main()
{
  unsigned int n;
  std::scanf("%d", &n);
  int as[n];
  for (auto i = 0u; i < n; ++i) {
    std::scanf("%d", &as[i]);
  }

  unsigned int q;
  std::scanf("%d", &q);
  for (auto i = 0u; i < q; ++i) {
    int m;
    std::scanf("%d", &m);
    auto is_solved = solve(m, as, n);
    std::printf("%s\n", is_solved ? "yes" : "no");
  }
}

// eof

Measured memory_bytes: 2688
a = int(input())
s = []
ret = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v',
       'w', 'x', 'y', 'z',
       ]
while a > 0:
    a -= 1  # 为甚么减去1？
    shang = int(a / 26)
    yushu = int(a % 26)
    # print(shang, yushu)
    s.append(yushu)  # 上面减去的1，加在了这里，由此可以得到1-26，位置信息
    a = shang

s.reverse()
# print(s)
v = ''
for i in range(len(s)):
    v += ret[s[i]]
print(v)


Measured memory_bytes: 9088
#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 MOD          1000000007
#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)
#define VV(T,h,w)    move(vector<vector<T>>(h,move(vector<T>(w))))
#define VVI(T,h,w,i) move(vector<vector<T>>(h,move(vector<T>(w,i))))
using namespace std;
using ll = long long;
template<typename T = ll>inline T in() { T ret; cin >> ret; return ret; }

int main()
{
	char a, b; cin >> a >> b;
	cout << (
		a<b ? '<' :
		a>b ? '>' :
		'='
		) << endl;
}

Measured memory_bytes: 256
//
//  main.cpp
//

#include <algorithm>
#include <array>
#include <assert.h>
#include <iomanip>
#include <iostream>
#include <limits>
#include <math.h>
#include <memory>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

using ll = int64_t;
using ull = uint64_t;

template<typename T>
vector<T> make_vec_nd(T init, ll size) {
    return vector<T>(size, init);
}
template<typename T, typename... Args>
auto make_vec_nd(T init, ll size, Args... rest) {
    auto inner = make_vec_nd(init, rest...);
    return vector<decltype(inner)>(size, inner);
}

#define rep(i,a,b) for(ll i=(a);i<(b);i++)
#define rrep(i,a,b) for(ll i=(a)-1;i>=(b);i--)

int main() {
    ll H, N;
    cin >> H >> N;
    ll sum = 0;
    rep(i,0,N) {
        ll A;
        cin >> A;
        sum += A;
    }
    if (sum >= H) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}



Measured memory_bytes: 888
#include <iostream>
#include <stdio.h>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>

#define repeat(i,n) for (long long i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i] << '\n'
#define debugArrayP(x,n) for(long long i = 0; (i) < (n); ++ (i)) cerr << #x << "[" << i << "]: " << x[i].first<< " " << x[i].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const ll INF = INT_MAX;
const ll MOD = 1e9+7;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N,A,B;cin>>N>>A>>B;
  cout << min(N*A,B)<<endl;
  return 0;
}


Measured memory_bytes: 256
ini=map(int, raw_input().split())

ans=[]

ans.append(ini[2]-(ini[3]-ini[1]))
ans.append(ini[3]+(ini[2]-ini[0]))
ans.append(ini[0]+ans[0]-ini[2])
ans.append(ini[1]+ans[1]-ini[3])
for i in ans:
    print i,


Measured memory_bytes: 2568
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,K;
  cin >> N >> K;
  int p[N];
  for(int i=0;i<N;i++)cin >> p[i];
  double ans=0;
  double value=0;
  for(int i=0;i<K;i++){
    value+=((double)p[i]+1.0)/2.0;
  }
  ans = value;
  for(int i=K;i<N;i++){
    value+=((double)p[i]+1.0)/2.0-((double)p[i-K]+1.0)/2.0;
    ans=max(value,ans);
  }
  cout << fixed << setprecision(8) << ans;
}


Measured memory_bytes: 1024