akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
#include <unordered_set>

#define _CRT_SECURE_NO_WARNINGS

#define REP(i, n) for(decltype(n) i = 0; i < (n); i++)
#define REP2(i, x, n) for(decltype(x) i = (x); i < (n); i++)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

using namespace std;

using LL = long long int;
using LD = long double;

using pii = pair<int, int>;
using pll = pair<LL, LL>;
using pdd = pair<double, double>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vl = vector<LL>;
using vvl = vector<vl>;
using vvvl = vector<vvl>;
using vd = vector<double>;
using vvd = vector<vd>;
using vs = vector<string>;
using vb = vector<bool>;
using vvb = vector<vb>;

const int INF = (1 << 30) - 1;
const LL INF64 = ((LL)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

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

int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
LL gcd(LL x, LL y) { return y ? gcd(y, x % y) : x; }

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

	vi v(3);
	cin >> v[0] >> v[1] >> v[2];

	SORT(v);
	cout << v[0] << " " <<v[1] << " " << v[2] << endl;
	return 0;
}

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

#define ff              first
#define ss              second
#define ll             long long
#define pb              push_back
#define mp              make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
//mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void sb()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}

int main()
{
	sb();
	int h1,m1,h2,m2,k;
	cin>>h1>>m1>>h2>>m2>>k;
	cout<<((h2*60+m2) - (h1*60 +m1) - k);
	return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<ll>v;
ll n,a[100000],b,tot,ntot,ans;
int main(void){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[i];
    }
    for(int i=0;i<n;i++){
        cin>>b;
        tot+=a[i]-b;
        if(a[i]-b>=0){
            v.push_back(a[i]-b);
            ans++;
        }
        else ntot+=a[i]-b;
    }
    sort(v.begin(),v.end());
    reverse(v.begin(),v.end());
    if(tot<0){cout<<-1<<endl;return 0;}
    ll i=0;
    while(ntot<0){
        ntot+=v[i];
        i++;
    }
    //cout<<ans<<i<<endl;
    cout<<n-ans+i<<endl;
}


Measured memory_bytes: 2168
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int h = sc.nextInt();
		int w = sc.nextInt();
		List<String> squareInfo = new ArrayList<String>();
		for(int i=0;i < h;i++) {
			String line = sc.next();
			if(!line.matches("\\.+")) {
				squareInfo.add(line);
			}
		}
		List<Integer> deleteInfo = new ArrayList<Integer>();
		for(int i =0; i < w; i++) {
			boolean deleteFlag = true;
			for(int j =0; j < squareInfo.size(); j++) {
				if(squareInfo.get(j).substring(i,i+1).equals("#")) {
					deleteFlag = false;
				}
			}
			if(deleteFlag) {
				deleteInfo.add(i);
			}
		}
		for(int i = 0; i < squareInfo.size(); i++) {
			StringBuilder sb = new StringBuilder();
			for(int j =0; j < w; j++) {
				if(deleteInfo.indexOf(j) ==-1) {
					sb.append(squareInfo.get(i).substring(j,j+1));
				}
			}
			System.out.println(sb);
		}
	}
}

Measured memory_bytes: 24752
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
#define REP(i, n) for (int i = 0; (i64)(i) < (i64)(n); ++i)

#ifdef ENABLE_DEBUG
template <typename T>
void debug(T value) {
  cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  cerr << value << ", ";
  debug(args...);
}
#define DEBUG(...)                              \
  do {                                          \
    cerr << " \033[33m (L" << __LINE__ << ") "; \
    cerr << #__VA_ARGS__ << ":\033[0m ";        \
    debug(__VA_ARGS__);                         \
    cerr << endl;                               \
  } while (0)
#else
#define debug(...)
#define DEBUG(...)
#endif

template <class Monoid>
struct SegTree {
  using Func = function<Monoid(Monoid, Monoid)>;
  const Func F;
  const Monoid UNITY;
  int size;
  vector<Monoid> dat;

  SegTree(int n, const Func f, const Monoid &unity)
      : F(f), UNITY(unity), size(n), dat(2 * n, unity) {}

  // Sets i-th value (0-indexed) to x for initial setup.
  // build() must be called after set() calls.
  void set(int i, const Monoid &x) { dat[size + i] = x; }
  void build() {
    for (int k = size - 1; k > 0; --k) {
      dat[k] = F(dat[k * 2], dat[k * 2 + 1]);
    }
  }

  // Sets i-th value (0-indexed) to x.
  void update(int i, const Monoid &x) {
    int k = size + i;
    dat[k] = x;
    while (k > 1) {
      k >>= 1;
      dat[k] = F(dat[k * 2], dat[k * 2 + 1]);
    }
  }

  // Queries by [l,r) range (0-indexed, open interval).
  Monoid fold(int l, int r) {
    l += size;
    r += size;
    Monoid vleft = UNITY, vright = UNITY;
    for (; l < r; l >>= 1, r >>= 1) {
      if (l & 1) vleft = F(vleft, dat[l++]);
      if (r & 1) vright = F(dat[--r], vright);
    }
    return F(vleft, vright);
  }

  // Queries by a single index (0-indexed).
  Monoid operator[](int i) { return dat[size + i]; }

  /* debug */
  void print() {
    for (int i = 0; i < size; ++i) {
      cout << (*this)[i];
      if (i != size - 1) cout << ",";
    }
    cout << endl;
  }
};

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N, Q;
  cin >> N >> Q;
  vector<int> colors(N);
  REP(i, N) cin >> colors[i];
  vector<int> lefts(Q), rights(Q), ids(Q);
  REP(i, Q) {
    cin >> lefts[i] >> rights[i];
    --lefts[i];
    --rights[i];
    ids[i] = i;
  }
  sort(ids.begin(), ids.end(),
       [&](int i, int j) { return rights[i] < rights[j]; });

  SegTree<int> seg(
      N, [](int x, int y) { return x + y; }, 0);
  vector<int> prev(500'005, -1);
  vector<int> res(Q);
  int j = 0;
  for (int i = 0; i < N; ++i) {
    int pc = prev[colors[i]];
    if (pc >= 0) {
      seg.update(pc, seg[pc] + 1);
    }
    for (; j < Q && rights[ids[j]] == i; ++j) {
      int dup_count = seg.fold(lefts[ids[j]], N);
      res[ids[j]] = rights[ids[j]] - lefts[ids[j]] + 1 - dup_count;
      DEBUG(j, ids[j], lefts[ids[j]], rights[ids[j]], dup_count, res[ids[j]]);
    }
    prev[colors[i]] = i;
  }
  for (int i = 0; i < Q; ++i) cout << res[i] << '\n';
}


Measured memory_bytes: 19448
#include <stdio.h>
#include <stdlib.h>

int update(int *num, int size){
  for(int i=0; i<size; i++){
    if(num[i]%2 != 0){
      //failed to update
      return 1;
    }else{
      num[i]=num[i]/2;
    }
  }
  return 0;
}

int main(){
  int n = 0;
  scanf("%d", &n);
  
  int *num = calloc(n, sizeof(int));
  for(int i=0; i<n; i++){
    scanf("%d", &num[i]);
  }
  int count = 0;
  while(1){
    if(update(num, n) != 0){
      printf("%d", count);
      return 0;
    }
    count++;
  }
}

Measured memory_bytes: 128
//
// Created by 13783 on 2020/4/2.
//
#include<iostream>
using namespace std;
const int MAX_N=101;
const int MAX_W=1e5+2;
typedef long long ll;
int N,W;
int w[MAX_N];
int v[MAX_N];
ll dp[MAX_N][MAX_W];
void solve(){
    //dp[i][j]为前i种物品，总总量为j的最大价值
    for(int i=1;i<=N;i++){
        for(int j=1;j<=W;j++){
            if(j>=w[i]){
                dp[i][j]=max(dp[i-1][j],dp[i-1][j-w[i]]+v[i]);
            } else
                dp[i][j]=dp[i-1][j];
        }
    }
    cout<<dp[N][W];
}
int main(){
    cin>>N>>W;
    for(int i=1;i<=N;i++){
        cin>>w[i]>>v[i];
    }
    solve();
    return 0;
}

Measured memory_bytes: 78336
#include<iostream>
#include<algorithm>
#include<string>
#include<math.h>
#include<vector>
#include<map>
#include<numeric>
//#include <bits/stdc++.h>
#include<cstring>
#include<iostream>
#include<functional>
using namespace std;
int main() {
	int x, a, b;
	cin >> x >> a >> b;
	int diff1 =abs( x - a);
	int diff2 =abs( b - x);
	
	if (diff1 > diff2)
		cout << "B\n";
	else
		cout << "A\n";


	return 0;
}

Measured memory_bytes: 256
//https://onlinejudge.u-aizu.ac.jp/challenges/sources/PCK/Prelim/0359?year=2017

#include <bits/stdc++.h>

using namespace std;

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

    int y = (x - 9 + 14) % 7;
    string day[] = {"sat", "sun", "mon", "tue", "wed", "thu", "fri"};

    cout << day[y] << endl;
    return 0;
}

/*
 *
 */


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

#define int long long
#define double long double

#define REP(i, b) for(int i = 0; i < (b); i++)
#define REPS(i, b) for(int i = 1; i <= (b); i++)
#define ALL(v) (v).begin(), (v).end()

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

using namespace std;

using pi = pair<int, int>;
using vi = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vb = vector<bool>;
using vpi = vector<pi>;
using vvi = vector<vi>;
using vvb = vector<vb>;

const int INF = 1e16;
const int MOD = 1e9+7;

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


signed main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    int n, m; cin >> n >> m;
    vi c(m); REP(i, m) cin >> c[i];
    vvi dp(m+1, vi(n+1, INF)); dp[0][0] = 0;
    REP(i, m)
    {
        REP(j, n+1)
        {
            chmin(dp[i+1][j], dp[i][j]);
            if(j >= c[i]) chmin(dp[i+1][j], dp[i+1][j-c[i]]+1);
            /*
            REPS(k, j/c[i])
            {
                chmin(dp[i+1][j], dp[i][j-k*c[i]]+k);
            }
            */
        }
    }
    cout << dp[m][n] << endl;
}


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

int main(){
  
  int a,b;
  cin >> a >> b;
  
  int ave;
  if((a+b)%2 == 1)ave = (a+b)/2 + 1;
  else ave = (a+b)/2;
  
  cout << ave << endl;
  
  return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int c = a -b;

    if(c%2!=0){
      System.out.println("IMPOSSIBLE");
    }else{
      System.out.println((a+b)/2);
    }


  }
}

Measured memory_bytes: 22996
/*      ░░█ ▄▀█ █   █▀ █░█ █▀█ █▀▀ █▀▀   █▀█ ▄▀█ █▀▄▀█  
        █▄█ █▀█ █   ▄█ █▀█ █▀▄ ██▄ ██▄   █▀▄ █▀█ █░▀░█     */

// Author : Udit "luctivud" Gupta @ (https://www.linkedin.com/in/udit-gupta-1b7863135/)


#include <bits/stdc++.h>
#pragma GCC optimize "trapv"

using namespace std;

typedef long long int lld;
typedef unsigned long long int llu;


#define       TESTCASES()  cin >> (T3X0); T353 = T3X0; while(T3X0--)
#define       _input(V3C)  for(auto &V3C_I7 : (V3C)) cin >> (V3C_I7)
#define mems(A77AY, V4LU)  memset((A77AY), (V4LU), sizeof((A77AY)))
#define  CH3K(I7, E4, S7)  (((S7)<0) ? (I7)>(E4) : (I7)<(E4))
#define for4(I7,S4,E4,S7)  for(auto I7=(S4); CH3K(I7,E4,S7); (I7)+=(S7))




void solveEachTest(lld T35TC453N = 1) {
    
    lld a, b, w;
    cin >> w >> a >> b;

    if (a>b) swap(a, b);

    cout << max(0ll, b-a-w);

    return;
}


signed main() {
    ios_base::sync_with_stdio(false); cin.tie(0);

    lld T3X0 = 0, T353 = 1;

    // TESTCASES() 
        solveEachTest(T353 - T3X0);
    return 0;
}
// Random Thought :  null  

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

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s); i<(long long)(n);i++)
#define mod 1000000007
typedef long long ll;

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

    cout<<((3*a)+p)/2<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	Scanner sc = new Scanner(System.in);
	
	public static void main(String[] args) {
		Main m = new Main();
		m.run();
	}
	
	void testRun() {
		int h = 2*100000;
		int w = 2*100000;
		int n = 2*100000;
		int y = 100000;
		int x = 100000;
		
		char s[] = new char[n];
		char t[] = new char[n];
		for(int i =0;i < n ;i++) {
			s[i] = (new char[]{'R','L'})[i%2];
			t[i] = (new char[]{'R','L'})[i%2];
		}
		
		if(ud(h,w,n,x,y,s,t)) {
			System.out.println("NO");
		}else if(rl(h,w,n,x,y,s,t)) {
			System.out.println("NO");
		}else {
			System.out.println("YES");
		}
		
	}
	
	void run() {
		
		int h =sc.nextInt();
		int w = sc.nextInt();
		int n = sc.nextInt();
		int y = sc.nextInt();
		int x = sc.nextInt();
		
		char[] s = sc.next().toCharArray();
		char[] t = sc.next().toCharArray();
		
		if(ud(h,w,n,x,y,s,t)) {
			System.out.println("NO");
		}else if(rl(h,w,n,x,y,s,t)) {
			System.out.println("NO");
		}else {
			System.out.println("YES");
		}
	}
	
	boolean ud(int h,int w,int n,int x,int y,char[] s, char[]t) {
		int ss[] = new int[n];
		int tt[] = new int[n];
		for(int i =0 ; i< n ;i++) {
			if(s[i]=='U') {
				ss[i] = -1;
			}
			if(s[i] == 'D') {
				ss[i] = 1;
			}
			if(t[i]=='U') {
				tt[i]=-1;
			}
			if(t[i] == 'D') {
				tt[i] = 1;
			}
		}
		
		return solve(h,y,n,ss,tt);
	}
	boolean rl(int h,int w, int n, int x, int y, char[] s, char[] t) {
		int ss[] = new int[n];
		int tt[] = new int[n];
		for(int i =0 ; i< n ;i++) {
			if(s[i]=='L') {
				ss[i] = -1;
			}
			if(s[i] == 'R') {
				ss[i] = 1;
			}
			if(t[i]=='L') {
				tt[i]=-1;
			}
			if(t[i] == 'R') {
				tt[i] = 1;
			}
		}
		return solve(w,x,n,ss,tt);
	}
		
	boolean solve(int max, int now, int n , int[] ss, int[] tt) {
		int left = 1;
		int right = max;
		
		for(int i = n-1; i >= 0;i--) {
			if(tt[i] == 1) {
				left = Math.max(1, left-1);
			}
			if(tt[i] == -1) {
				right = Math.min(max, right+1);
			}
			if(ss[i] == 1) {
				right = right-1;
			}
			if(ss[i] == -1) {
				left = left+1;
			}
			if(left > right) {
				return true;
			}
		}
		return !(now >= left && now <=right);
		
	}
}


Measured memory_bytes: 31160
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define printVec(v) printf("{"); for (const auto& i : v) { std::cout << i << ", "; } printf("}\n");
#define degreeToRadian(deg) (((deg)/360)*2*M_PI)
#define radianTodegree(rad) (((rad)/2/M_PI)*360)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
using P = pair<int,int>;
using ll = long long;
const ll INF = 1LL<<60;
const int MOD = 1e9 + 7;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//cin.tie(0);ios::sync_with_stdio(false);
//cout << fixed << setprecision(15) << y << endl;

const ll maxn = 1e18;

int main() {
  int n; cin >> n;
  vector<ll> a(n);
  bool zero, over;
  zero = over = false;
  rep (i, n) {
    cin >> a[i];
    if (a[i] == 0) zero = true;
  }
  if (zero) {
    cout << 0 << endl;
    return 0;
  }

  ll ans = 1;
  rep (i, n) {
    if (maxn / ans < a[i]) {
      over = true;
      break;
    }
    ans *= a[i];
  }

  if (over) {
    cout << -1 << endl;
  } else {
    cout << ans << endl;
  }

  
  return 0;
}


Measured memory_bytes: 3972
import std.stdio;
import std.string;
import std.conv;
import std.typecons;
import std.algorithm;
import std.functional;
import std.bigint;
import std.numeric;
import std.array;
import std.math;
import std.range;
import std.container;
import std.ascii;
void times(alias pred)(int n) {
    foreach(i; 0..n) pred();
}
auto rep(alias pred, T = typeof(pred()))(int n) {
    T[] res = new T[n];
    foreach(ref e; res) e = pred();
    return res;
}

int N;
long[][] ary;

void main() {
    N = readln.chomp.to!int;
    ary = N.rep!(() => readln.split.to!(long[]));
    ary.reverse();

    long l = 0;
    long r = 10L^^18;
    while(l < r) {
        long c = (l+r)/2;
        if (check(c)) {
            r = c;
        } else {
            if (l==c) break;
            l = c;
        }
    }
    r.writeln;
}

bool check(long c) {
    long[] res = ary.front.dup;
    if (c<res.sum) return false;
    res[] *= c/res.sum;
    foreach(e; ary) {
        if (res.front<e.front || res.back<e.back) return false;
        long r = min(res.front/e.front, res.back/e.back);
        res.front = r*e.front;
        res.back = r*e.back;
    }
    return true;
}


Measured memory_bytes: 508
#include <iostream>
#include <vector>

using namespace std;
int main(){
  int N;
  cin >> N;
  vector<long long int> A(N), B(N);
  int M = 0;
  long long int ans = 0, d = 0, m = 1e15;
  for(int i = 0; i < N; ++i){
    cin >> A[i] >> B[i];
    ans += A[i];
    if(A[i] > B[i]){
      m = min(m, B[i]);
    }
  }
  ans -= m;
  cout << max(0LL, ans) << endl;
  return 0;
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;

const int INF = 1000000000;
const int MOD = 1000000007;

int main () {
	int N; cin >> N;
	cout << (N % 2 ? N * 2 : N) << endl;
}



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

int main(){
  int n,a,b,result;
  cin >> n >> a >> b;
  result = (n*a>b)? b:n*a;
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
	static void solve(){//Here is the main function
      int N = nextInt();
      int tmp = N;
      int count = 0;
      while(tmp > 0){
        count += tmp % 10;
        tmp /= 10;
      }
      myout((N % count == 0) ? "Yes" : "No");
	}
	//Method addition frame start



	//Method addition frame end
}


Measured memory_bytes: 32972
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

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

int main() {
  
  int N;
  while(cin >> N && N) {
    vector<int> in(N), v(N);
    rep(i, N) cin >> in[i];
    int ans = -1<<29;
    rep(i, N) {
      if(i-1 >= 0 && v[i-1] >= 0) {
	v[i] += v[i-1] + in[i];
      }
      else {
	v[i] = in[i];
      }
      ans = max(ans, v[i]);
    }
    cout << ans << endl;
  }
  
  return 0;
}

Measured memory_bytes: 1216
#include <stdio.h>
     
    int main(){
        int N;
        int Sum = 0;
       
        scanf("%d",&N);
        int a[N];
        for(int i=0;i<N;i++){
        scanf("%d",&a[i]);
        Sum = Sum + a[i];
        }
    printf("%d\n",Sum-N);
    return 0;
    }

Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[4] = { 0,0,1,-1 };
const int c_Dy[4] = { 1,-1,0,0 };




int main() {
	int r,D;
	int X[20];
	scanf("%d%d%d", &r,&D,&X[0]);

	for (int i = 1; i <= 10; i++) {
		X[i] = r * X[i - 1] - D;
	
		printf("%d\n", X[i]);
	}
}





/*         提出前の確認事項

・デバッグ用の関数は＜＜コメント化＞＞しているか？
・すべての＜＜入力例＞＞は試したか？
・＜＜限界値分析＞＞はしたか？
・＜＜出力の改行＞＞の有無は確認したか？
　　　　　　　　↓
	 ＜＜提出先＞＞に注意して提出！！
*/

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

const ll INF = 1LL << 62;
const double PI = acos(-1);
const double eps = 1e-10;

int main() {
  ll n, k;
  cin >> n >> k;
  vector<int> l(n);
  rep(i, n) cin >> l[i];
  sort(l.rbegin(), l.rend());
  ll ans = 0;
  rep(i, k) ans += l[i];
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define fi first
#define se second
#define dbg(x) cout<<#x" = "<<((x))<<endl
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

const ll mod = 1e9+7;

ll mod_pow(ll x, ll n){
    ll ret = 1;
    while(n){
        if(n&1) (ret *= x) %= mod;
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

const int N = 100010;
ll dp[N][2];
ll ct[2];

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

    dp[0][0] = dp[0][1] = 1;
    rep(i,n){
        (ct[0] += dp[i][0]) %= mod;
        (ct[1] += dp[i][1]) %= mod;
        if(i+1-m>=0) (ct[1] += mod-dp[i+1-m][1]) %= mod;

        // dbg(ct[0]);dbg(ct[1]);
        dp[i+1][1] = ct[0];
        dp[i+1][0] = ct[1];
    }
    // rep(i,n+1)rep(j,2) printf(" dp[%d][%d] = %lld\n",i,j,dp[i][j]);

    ll ans = mod_pow(2,n);
    rep(i,2) ans = (ans - dp[n][i] + mod) % mod;
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 4660
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

const int M = 30000000;
array<ll, M+10> dp{};

template <typename T>
using GPQ = priority_queue<T, vector<T>, greater<T>>;

int main() {
    int n;
    cin >> n;
    array<array<int, 5>, 5> v{};
    for (int i = 0; i < 2; ++i) {
        for (int j = 0; j < 3; ++j) {
            cin >> v[i][j];
        }
    }
    for (int i = 0; i < M; ++i) {
        dp[i] = -INF<ll>;
    }
    dp[n] = n;
    for (int i = n; i >= 0; --i) {
        for (int j = 0; j < 3; ++j) {
            if(v[0][j] < v[1][j]){
                ll b = v[1][j] - v[0][j], c = v[0][j];
                if(i-c >= 0){
                    dp[i-c] = max(dp[i-c], dp[i]+b);
                }
            }
        }
    }
    ll V = 0;
    for (int i = 0; i <= n; ++i) {
        V = max(V, dp[i]);
    }
    for (int i = 0; i < M; ++i) {
        dp[i] = -INF<ll>;
    }
    dp[V] = V;
    for (int i = V; i >= 0; --i) {
        for (int j = 0; j < 3; ++j) {
            if(v[1][j] < v[0][j]){
                ll b = v[0][j] - v[1][j], c = v[1][j];
                if(i-c >= 0){
                    dp[i-c] = max(dp[i-c], dp[i]+b);
                }
            }
        }
    }
    ll ans = 0;
    for (int i = 0; i <= V; ++i) {
        ans = max(ans, dp[i]);
    }
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 234752
x1, y1, x2, y2 = map(int, input().split())
x = x2 - x1
y = y2 - y1
x3 = x2 - y
y3 = y2 + x
x4 = x1 - y
y4 = y1 + x
print(x3, y3, x4, y4)

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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl




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



int n;
vector<int> g[maxn];


ll dp[maxn][2];

ll dfs(int at, int p, int color) {
    if (~dp[at][color]) return dp[at][color];
    ll &res = dp[at][color] = 1;
    if (color==1) {
	for (int to: g[at]) {
	    if (to==p) continue;
	    res *= dfs(to,at,0);
	    res %= mod;
	}
	return res;
    }

    assert(color==0);
    for (int to: g[at]) {
	if (to==p) continue;
	res *= ((dfs(to,at,0)+dfs(to,at,1))%mod);
	res %= mod;
    }
    
    return res;
    
}

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

    memset(dp,-1,sizeof(dp));

    cin>>n;
    for (int i=0; i<n-1; i++) {
	int u,v; cin>>u>>v;
	g[u].push_back(v);
	g[v].push_back(u);
    }


    dfs(1,0,0);
    dfs(1,0,1);

    ll res=(dp[1][0]+dp[1][1])%mod;
    cout<<res<<endl;  

    return 0;
}


Measured memory_bytes: 14208
#include <iostream>
#include <queue>
#include <algorithm>
#include <vector>

using namespace std;

typedef pair<int, long> P;
vector<int> w[100001];
P p[100000];

int main(){
    int N, M;
    cin >> N >> M;
    for(int i = 0; i < N; i++){
        int A, B;
        cin >> A >> B;
        w[A].push_back(B);
    }
    
    priority_queue<long> pq;
    int cnt = 0;
    long ans = 0;
    for(int i = 1; i <= M; i++){
        for(int j = 0; j < w[i].size(); j++){
            pq.push(w[i][j]);
        }
        if(!pq.empty()){
            long top = pq.top();
            pq.pop();
            ans += top;
            cnt++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 5632
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();

    let mut ans: usize = 0;
    for i in 1..n {
        let j = n - i;
        if i >= j {
            break;
        }
        ans += 1;
    }
    return ans.to_string();
}


Measured memory_bytes: 2180
#include <iostream>
#include <vector>

using namespace std;

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

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

    for (auto i : ans)
        cout << i << endl;
}



Measured memory_bytes: 1280
#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	int N; cin >> N;
	vector<int>p(N); rep(i, 0, N) { cin >> p[i]; }
	int ans = 0;
	rep(i, 1, N - 1) {
		vector<int>x;
		x.eb(p[i - 1]);
		x.eb(p[i]);
		x.eb(p[i + 1]);
		sort(all(x));
		if (p[i] == x[1]) {
			ans++;
		}
	}
	cout << ans << endl;

	return 0;
}


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

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

  if (a * b > c) {
    cout << c << endl;
  }
  else if (a * b == c) {
    cout << c << endl;
  }
  else if (a * b < c) {
    cout << a * b << endl;
  }
    
}


Measured memory_bytes: 256
n=int(input())

import bisect

ans=[1]
i=1
s=1
while True:
    if s>=n:
        break
    i+=1
    s+=i
    ans.append(i)

dif = s-n
if dif==0:
    for i in range(len(ans)):
        print(ans[i])
    exit(0)
    
index = bisect.bisect_left(ans,dif)

for i in range(len(ans)):
    if i==index:
        continue
    print(ans[i])




Measured memory_bytes: 3572
#include <stdio.h>
#include <algorithm>
#include <deque>
#include <tuple>
using namespace std;
using ll = long long;

using pii = pair<int, int>;
int h, w, a[1010][1010], delay[1010][1010];
char s[1010];
int dx[] = { -1, 1, 0, 0 }, dy[] = { 0, 0, -1, 1 };
deque<pii> que;
int main() {
	scanf("%d %d", &h, &w);
	for (int i = 1; i <= h; i++) {
		scanf("%s", s + 1);
		for (int j = 1; j <= w; j++)
			if (s[j] == '.')
				a[i][j] = true;
	}
	for (int i = 1; i <= h; i++)
		for (int j = 1; j <= w; j++)
			if (!a[i][j] && !delay[i][j])
				for (int d = 0; d < 4; d++)
					if (a[i + dx[d]][j + dy[d]]) {
						a[i + dx[d]][j + dy[d]] = false;
						delay[i + dx[d]][j + dy[d]] = 1;
						que.emplace_back(i + dx[d], j + dy[d]);
					}
	int max_d = 0;
	while (!que.empty()) {
		int x, y;
		tie(x, y) = que.front();
		que.pop_front();
		max_d = max(max_d, delay[x][y]);

		for (int d = 0; d < 4; d++)
			if (a[x + dx[d]][y + dy[d]]) {
				a[x + dx[d]][y + dy[d]] = false;
				delay[x + dx[d]][y + dy[d]] = delay[x][y] + 1;
				que.emplace_back(x + dx[d], y + dy[d]);
			}
	}
	printf("%d\n", max_d);
}

Measured memory_bytes: 12288
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<map>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,b,a) for(int i=b;i>=a;i--)
#define mset(a,x) memset(a,x,sizeof(a))
using namespace std;
typedef long long ll;
typedef double db;
char ch;
int read(){int n=0,p=1;for(ch=getchar();ch<'0' || '9'<ch;ch=getchar())if(ch=='-') p=-1;for(;'0'<=ch && ch<='9';ch=getchar()) n=n*10+ch-'0';return n*p;}
const int N=1e5+5;
int n,a[N],b[N];
map<int,int> ok,cb,fa,exi;
int getfa(int x){return fa[x]?fa[x]=getfa(fa[x]):x;}
int main()
{
	n=read();
	int x=0;
	fo(i,1,n) a[i]=read(),x^=a[i];
	a[0]=x;
	x=0;
	fo(i,1,n) b[i]=read(),x^=b[i];
	b[0]=x;
	fo(i,0,n) ok[a[i]]++,cb[b[i]]++;
											bool same=1;
											fo(i,1,n) if(a[i]!=b[i]) same=0;
											if(same) return puts("0"),0;
	fo(i,0,n)
		if(ok[a[i]]!=cb[a[i]]) return puts("-1"),0;
	int ans=0;
	fo(i,0,n) if(a[i]!=b[i])
	{
		exi[a[i]]=1;
		if(i) ++ans;
		int f1=getfa(a[i]),f2=getfa(b[i]);
		if(f1!=f2) fa[f2]=f1;
	}
	fo(i,0,n) if(exi[a[i]] && getfa(a[i])==a[i]) ++ans,exi[a[i]]=0;
	if(!(a[0]==b[0] && ok[a[0]]==1)) --ans;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 19712
#include <iostream>
#include <cmath>
#include <algorithm>
#include <string> //文字列
#include <iomanip> //doubleの桁数指定
#include <list> //前後に数値を入れれる配列
#include <map> //map
#include <vector> //vecror



#define REP(i,m,n) for(ll i = (ll) (m);i < (ll) (n);i++) //forの短縮
#define rep(i,n) REP(i,0,n) //REPが0の時
#define ll long long int

using namespace std;

double PI = 3.141592653589793; //円周率

//常設関数↓

//最大公約数
ll gcd(ll a, ll b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}

//最小公倍数
ll lcm(ll a, ll b) {
	return a * b / gcd(a, b);
}

//degree → radian
ll chg_DegRad(int deg) {
	return deg * PI / 180.0;
}

//radian → degree
ll chg_RadDeg(int rad) {
	return rad * 180.0 / PI;
}

//距離
double dis(double xa, double ya, double xb, double yb) {
	return pow(pow(xa - xb, 2.0) + pow(ya - yb, 2.0), 0.5);
}



//提出コード↓

int n, x, L[110],D,c;





int main() {
	cin >> n >> x;
	rep(i, n) cin >> L[i];
	rep(i, n + 1) {
		if (D > x) break;
		D += L[i];
		c++;
	}
	cout << c << endl;
	return 0;
}



Measured memory_bytes: 256
#include <iostream>
using namespace std;
 
int main() {
    int n, ttl, cnt;
    int *a, *b;
    ttl = 0;
    cnt = 0;

    cin >> n;

    a = new int[n];
    b = new int[n-1];

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

    for(int i = 0; i < n; i++){
        if(i == 0){
            a[i] = b[i];
        }
        else if(i == n-1){
            a[i] = b[i - 1];
        }
        else
        {
            if(b[i] > b[i - 1]){
                a[i] = b[i - 1];
            }
            else{
                a[i] = b[i];
            }
        }
        ttl = ttl + a[i];
    }

    cout << ttl << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N = 1e3 + 5;
int arr[N] = {};
int main() {
    int n, k;
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
        cin >> arr[i];
    int ans = 0;
    sort(arr + 1, arr + 1 + n);
    for (int i = 1; i <= k; i++)
        ans += arr[i];
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3588
# coding: utf-8


def main():
    N, M = map(int, input().split())
    ans = [0, 0]
    A = [[0, 0] for _ in range(N)]

    for i in range(M):
        p, s = input().split()
        p = int(p)
        if s == 'AC':
            A[p - 1][1] = 1
        elif A[p - 1][1] == 0:
            A[p - 1][0] += 1
    
    for i, j in A:
        if j == 1:
            ans[0] += 1
            ans[1] += i

    print(ans[0], ans[1])

if __name__ == "__main__":
    main()


Measured memory_bytes: 17664
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
const int MM = 1000000000;
const int MOD = MM + 7;
const int MAX = 510000;
#define rep(i, n) for(ll i=0; i<n; i++)
#define Rep(i, j, n) for(ll i=j; i<n; i++)
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmin(T& a, T b) {if(a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if(a < b) {a = b; return true;} return false;}
const ll INF = 1LL << 60;

int main() {
    int a; cin >> a;
    cout << a + pow(a, 2) + pow(a, 3) << endl;
}

Measured memory_bytes: 4224
// Gaurav Aggarwal
 
/*
useful stl
array<ll,size> ar;         //size(),front(),back(),fill(),empty()
deque<ll> d                //push_back(),push_front(),pop_front(),pop_back()
vector<ll> v(size,val);    //push_back(),*max_element(v.begin(),v.end()),accumulate(v.begin(),v.end(),0)
stack<ll> g;               //push(),pop(),top(),size(),empty()         LIFO
queue<ll> q;               //push(),size(),front(),back(),empty()      FIFO
priority_queue<ll> pq
*/
 
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii > vii;
typedef vector<pll > vll;
#define pb push_back
#define mp make_pair 
#define mod 1000000007
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define For(i, a, b) for(__typeof (a) i=a; i<=b; i++)
#define inp_arr(a,n) for(__typeof (n) i=0; i<n; ++i) {cin>>a[i];}
#define debug_arr(a,n) {{for(__typeof (n) i=0; i<n; ++i) {cout<<a[i]<<" ";}cout<<"\n";}}

ll power(ll x, ll y) 
{ 
    ll res = 1;   
    while (y > 0) { 
        if (y & 1) 
            res = (res*x)%mod; 
        y = y>>1;
        x = (x*x)%mod; 
    } 
    return res%mod; 
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
 
    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("out.txt", "w", stdout); 
    // #endif  

    string s;
    cin>>s;
    if(s[0] == s[1] or s[1] == s[2] or s[2] == s[3])   cout<<"Bad";
    else cout<<"Good";


    return 0;
}   

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<algorithm>
#include<iostream>
#include<queue>
#include<vector>
using namespace std;
#define MAX 120


int main(){
  string s;
  cin>>s;
  s[5]=' ';
  s[13]=' ';
  s[19]=' ';
  cout<<s<<endl;
  
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main{

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		
		if(a == 5 && b == 5 && c == 7){
			System.out.println("YES");
		}else if(a == 5 && b == 7 && c == 5){
			System.out.println("YES");
		}else if(a == 7 && b == 5 && c == 5){
			System.out.println("YES");
		}else{
			System.out.println("NO");
		}
	}

}



Measured memory_bytes: 23764
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] c = new int[n];
        int[] s = new int[n];
        int[] f = new int[n];
        for (int i = 0; i < n-1; i++) {
            c[i] = sc.nextInt();
            s[i] = sc.nextInt();
            f[i] = sc.nextInt();
        }
        for ( int i = 0; i < n ; i++) {
            int t = 0;
            for (int j = i ; j < n-1; j++) {
                if (t < s[j]) t = s[j];
                else if (t % f[j]==0);
                else t = t + f[j] - t % f[j];
                t += c[j];
            }
            System.out.println(t);
        }
    }
}

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

using namespace std;

#define INF 100000000
#define YJ 1145141919
#define INF_INT_MAX 2147483647
#define INF_LL 9223372036854775
#define INF_LL_MAX 9223372036854775807
#define EPS 1e-10
#define MOD 1000000007
#define MOD9 998244353
#define Pi acos(-1)
#define LL long long
#define ULL unsigned long long
#define LD long double

#define int long long

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(a)  begin((a)), end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())

const int MAX_N = 105;
int N;
string A[3];

signed main()
{
  cin >> N;
  REP(n,3) {
    cin >> A[n];
  }

  int ans = 0;
  REP(n,N) {
    if(A[0][n] == A[1][n] && A[1][n] == A[2][n]) {
      continue;
    }
    if(A[0][n] != A[1][n] && A[1][n] != A[2][n] && A[2][n] != A[0][n]) {
      ans += 2;
      continue;
    }
    ans++;
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
A, B, K = map(int, input().split())

l = B - A + 1

if l == 1:
  print(A)
elif l == 2:
  print(A)
  print(B)
else:
  if (l+1)//2 <= K:
    for i in range(A, B+1):
      print(i)
  else:
    for i in range(A, A+K):
      print(i)
    for i in range(B-K+1, B+1):
      print(i)




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

int main() {
	int n,a,b;
	cin >> n >> a >>b;
	
	long long answer=0;
	
	for(int i=1; i<=n; i++){
		int k=i;
		int wa=0;
		for(int j=0; j<5; j++){
			wa+=k%10;
			k/=10;
		}
		
		if(wa>=a && wa <= b){
			answer+=i;
		}
		
		
	}
	cout << answer << endl;
	return 0;
}

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

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()
#define endl "\n"

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
typedef long long ll;

void solve() {
    string s,t;
    cin >> s;
    cin >> t;
    REP(i,s.size()) {
        if (s[i]!=t[i]) {
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes"  << endl;
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 3624
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <string.h>
#include <vector>
#include <functional>
#include <queue>
#include <unordered_set>
#include <climits>
#include <set>
#include <list>
#include <cmath>
#include <map>

using namespace std;
typedef long long ll;

int main()
{
	ll L[100];
	int N;
	cin >> N;
	for(int i = 0; i < N; i++){
		cin >> L[i];
	}
	
	int ans = 0;
	for(int i = 0; i < N; i++){
		for(int j = i+1; j < N; j++){
			for(int z = j+1; z < N; z++){
				if( abs(L[j] - L[z] ) < L[i] && L[i] < L[j] + L[z]){
					if(L[i] != L[j] && L[j] != L[z] && L[z] != L[i]){
						ans++;
					}
				}
			}
		}
	}
	cout << ans <<endl;
	
	return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define SLAY ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define PI 3.141592653589793238
#define ll long long
#define pii pair<int , int>
#define pll pair<long long , long long>
using namespace std;
int _=1 , tc=1;
int dx[] = { 0 , 0 , 1 , -1};
int dy[] = { 1 , -1 , 0 , 0};
int getmod(int x, int y , int mod ){return (((x - y)%mod)+mod)%mod;}
int MAXN = 46341 + 1;
int spf[46341+1];
int d,x,y;
int gcd(int a , int b){
	if(b==0)return a;
	return gcd(b , a%b);
}
void sieve(){
	for(int i = 1 ; i<MAXN ; i++)spf[i]=i;
	for(int i = 4 ; i<MAXN ; i+=2)spf[i]=2;
	for(int i = 3; i*i<MAXN; i+=2){
		if(spf[i]==i){
			for(int j = i*i ; j<MAXN ; j+=i){
				if(spf[j]==j)spf[j]=i;
			}
		}
	}
}
void extended_gcd(int a , int b){
	if(b==0){
		d=a;
		x=1;
		y=0;
	}else{
		extended_gcd(b,a%b);
		int temp = y;
		y = x - y * (a/b);
		x = temp;	
	}
}
ll gcd(ll a , ll b){
	if(b==0)return a;
	return gcd(b , a%b);
}
ll lcm(ll a, ll b){  
    return (a*b)/gcd(a, b);  
}
void solve(){
	int n,ans=0;
	cin>>n;
	vector<int> v(n);
	for(int i=0;i<n;i++)cin>>v[i];
	sort(v.begin(),v.end());
	for(int i =0;i<n ; i++){
		for(int j=i+1 ; j<n ; j++){
			for(int k=j+1;k<n;k++){
				if(v[i]!=v[j] && v[j]!=v[k]){
					if(v[i] + v[j] > v[k])ans++;
				}
			}
		}
	}
	cout<<ans;;
}
int main(){
	SLAY
	// cin>>_;
	while(_--){
		solve();
	}
	return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
#define inf 1000000007
using namespace std;
typedef long long ll;
int n,k;
ll a[100009],b[100009],c[100009],ans=0;
ll pow1(ll x,ll y)
{
    ll res=1;
    while(y)
    {
        if(y%2)
            res=res*x%inf;
        x=x*x%inf;
        y/=2;
    }
    return res;
}
ll inv(ll x)
{
    return pow1(x,inf-2);
}
ll f(ll x,int q,int w,int e)
{
    return x*b[q]%inf*c[w]%inf*c[e]%inf;
}
int main()
{
    scanf("%d%d",&n,&k);
    b[0]=1,c[0]=1;
    for(int i=1; i<=n-1; i++)
        b[i]=b[i-1]*(ll)i%inf,c[i]=inv(b[i]);
    for(int i=1; i<=n; i++)
        scanf("%lld",&a[i]);
    sort(a+1,a+n+1);
    for(int i=k; i<=n; i++)
        ans=(ans+f(a[i],i-1,k-1,i-k))%inf;
    for(int j=1; j<=n-k+1; j++)
        ans=(ans-f(a[j],n-j,k-1,n-j-k+1)+inf)%inf;
    printf("%lld",ans);
    return 0;
}


Measured memory_bytes: 2688
#include <iostream>
#include <vector>

void showVector(std::vector<int> readVec){
    int length = readVec.size();
    for(int i = 0; i < length; ++i){
        if(length - 1 != i){
            std::cout << readVec.at(i) << " ";
        }else{
            std::cout << readVec.at(i);
        }
    }
    
    std::cout << std::endl;
}

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

    std::vector<int> a(n);
    for(int i = 0; i < n; ++i){
        std::cin >> a.at(i);
    }

    bool flg = true;
    int i = 0;
    int j, tmp;
    int count = 0;
    while(flg){
        flg = 0;
        for(j = n - 1; i < j; --j){
            if(a.at(j) < a.at(j - 1)){
                a.at(j) += a.at(j - 1);
                a.at(j - 1) = a.at(j) - a.at(j - 1);
                a.at(j) = a.at(j) - a.at(j - 1);
                flg = true;
                ++count;
            }
        }
    }
    
    showVector(a);    
    std::cout << count << std::endl;

    return 0;
}



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

using namespace std;
typedef long long ll;

void solve();
ll n, k;
string s;

int main()
{
    cin >> n;
    solve();
}

ll dfs(ll i, ll j, ll l, ll flag)
{
    if (i == k)
    {
        return j + l;
    }
    else
    {
        flag *= 10;
        return dfs(i + 1, j, l, flag) + dfs(i + 1, j / flag, l + j % flag, 1);
    }
}

void solve()
{
    k = -1;
    ll m = n;
    while (m != 0)
    {
        m /= 10;
        k++;
    }
    ll ans = dfs(0, n, 0, 1);
    cout << ans << endl;
}

Measured memory_bytes: 256
/*#include<stdio.h>
#include<string.h>
using namespace std;
#define ll long long int
int main()
{
    ll a;
    while(~scanf("%lld",&a))
    {
        ll mod=11;
        ll output=a/mod*2;
        a%=mod;
        if(a>=1&&a<=5)output++;
        if(a>=6&&a<=10)output+=2;
        printf("%lld\n",output);
    }
}
*/
#include<stdio.h>
#include<string.h>
#include<queue>
#include<algorithm>
using namespace std;
int a[100006];
int vis[100006];
int main()
{
    int n;
    while(~scanf("%d",&n))
    {
        memset(vis,0,sizeof(vis));
        for(int i=0;i<n;i++)
        {
            scanf("%d",&a[i]);
            vis[a[i]]++;
        }
        int j=100002;
        for(int i=1;i<=100002;i++)
        {
            if(vis[i]>1)
            {
                while(vis[j]<=1&&j>i)j--;
                if(j>i)
                {
                    if(vis[i]==vis[j])vis[i]=1,vis[j]=1;
                    else if(vis[i]>vis[j])
                    {
                        vis[i]-=vis[j]-1;
                        vis[j]=1;
                        i--;
                    }
                    else if(vis[i]<vis[j])
                    {
                        vis[j]-=vis[i]-1;
                        vis[i]=1;
                        j++;
                    }
                }
            }
        }
        int output=0;
        for(int i=1;i<=100002;i++)
        {
            if(vis[i]==1)output++;
            if(vis[i]>1)
            {
                if(vis[i]%2==0)continue;
                else output++;
            }
        }
        printf("%d\n",output);
    }
}


Measured memory_bytes: 896
import math
N, M = map(int, raw_input().split())

MAX_RES = int(math.sqrt(M))
res = 1
for i in range(1, MAX_RES + 1):
	if i * i > M:
		break
	if M % i != 0:
		continue
	j = M / i
	if i * N <= M:
		res = max(res, i)
	if j * N <= M:
		res = max(res, j)
print res


Measured memory_bytes: 3588