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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define each(i,a) for (auto&& i : a)
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
#define pb push_back
#define all(a) (a).begin(),(a).end()
#define chmin(x,v) x = min(x, v)
#define chmax(x,v) x = max(x, v)

const ll linf = 1e18;
const int inf = 1e9;
const double eps = 1e-12;
const double pi = acos(-1);

template<typename T>
istream& operator>>(istream& is, vector<T>& vec) {
    each(x,vec) is >> x;
    return is;
}
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& vec) {
    rep(i,vec.size()) {
        if (i) os << " ";
        os << vec[i];
    }
    return os;
}
template<typename T>
ostream& operator<<(ostream& os, const vector< vector<T> >& vec) {
    rep(i,vec.size()) {
        if (i) os << endl;
        os << vec[i];
    }
    return os;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string T;
    string pwstr = "23456789TJQKA";
    map<char, ll> pw;
    rep(i, pwstr.size()) pw[pwstr[i]] = i;
    while (cin >> T, T != "#") {
        char M = T[0];
        vector<vector<string>> cards(4, vector<string>(13)); cin >> cards;
        ll led = 0;
        ll trick[2] = {0, 0};
        string name[2] = {"NS", "EW"};
        rep(i, 13) {
            char L = cards[led][i][1];
            vector<P> v;
            rep(j, 4) {
                ll power = pw[cards[j][i][0]];
                char suit = cards[j][i][1];
                if (suit == M) power += 1000;
                else if (suit == L) power += 100;
                v.pb({power, j});
            }
            ll win = max_element(all(v))->second;
            led = win;
            trick[win%2]++;
        }
        ll winner = trick[0] > trick[1] ? 0 : 1;
        cout << name[winner] << " " << trick[winner]-6 << endl;
    }
}

Measured memory_bytes: 3136
#[allow(unused_imports)]
use std::cmp::{min,max};
#[allow(unused_imports)]
use std::collections::{BTreeMap,BTreeSet};
#[allow(unused_imports)]
use std::ops::*;
#[allow(unused_imports)]
use std::collections::BinaryHeap;

#[allow(unused_macros)]
macro_rules! tf {
    ($c:expr, $t:expr, $f:expr) => {{
        if $c { $t } else { $f }
    }};
}

fn main() {
    let (n,k) = {
        let xs = read_vec_i64();
        (xs[0] as usize, xs[1] as usize)
    };
    let t1 = n / k + tf!(n%k >= k/2, 1, 0);
    let t2 = n / k;
    let r1 = t1 * t1 * t1;
    let r2 = t2 * t2 * t2;
    let res = tf!(k % 2 == 0, r1 + r2, r2);
    println!("{}", res);
}

#[allow(dead_code)]
fn read_line() -> String {
    let mut ret = String::new();
    std::io::stdin().read_line(&mut ret).ok();
    ret.pop();
    //ret.pop();
    return ret;
}

#[allow(dead_code)]
fn read_i64() -> i64 {
    let ss = read_line();
    return ss.parse::<i64>().unwrap();
}

#[allow(dead_code)]
fn read_vec_i64() -> Vec<i64> {
    let mut res = vec![];
    let ss = read_line();
    for ts in ss.split_whitespace() {
        let x = ts.parse::<i64>().unwrap();
        res.push(x);
    }
    return res;
}

use std::fmt::Display;
#[allow(dead_code)]
fn write_vec<T: Display>(xs: &Vec<T>) {
    if xs.len() == 0 {
        println!("");
        return;
    }
    print!("{}", xs[0]);
    for i in 1..xs.len() {
        print!(" {}", xs[i]);
    }
    println!("");
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i, n, m) for (int i = (int)(n); i < (int)(m); i++)
#define repr(i, n, m) for (int i = (int)(n) - 1; i >= (int)(m); i--)
using namespace std;
using ll = int64_t;
const int MOD = 1000000007; // 10^9+7

int main() {
    int H, W, K;
    cin >> H >> W >> K;

    vector<string> S(H);
    rep(i, 0, H)
    {
        cin >> S[i];
    }

    int ans = INT_MAX;

    rep(i, 0, 1 << (H - 1))
    {
        // **ASCENDING ORDER** from n to m (m is **EXCLUDED**)
        bitset<32> bs(i);
        int cnt = bs.count();
        int tmp = 0;
        vector<vector<string>> pieces(cnt + 1);
        pieces[tmp].push_back(S[0]);

        rep(k, 1, H)
        {
            // **ASCENDING ORDER** from n to m (m is **EXCLUDED**)
            if (bs.test(k - 1))
            {
                pieces[++tmp].push_back(S[k]);
            }
            else
            {
                pieces[tmp].push_back(S[k]);
            }
        }

        vector<int> whiteSum(pieces.size(), 0);
        vector<int> whiteNew(pieces.size(), 0);
        bool valid = true;
        rep(l, 0, W)
        {
            // **ASCENDING ORDER** from n to m (m is **EXCLUDED**)
            bool isGreater = false;
            rep(k, 0, pieces.size())
            {
                // **ASCENDING ORDER** from n to m (m is **EXCLUDED**)
                rep(m, 0, pieces[k].size())
                {
                    // **ASCENDING ORDER** from n to m (m is **EXCLUDED**)
                    whiteNew[k] += pieces[k][m][l] - '0';
                    if (whiteNew[k] > K)
                    {
                        valid = false;
                        break;
                    }
                }
                if (!valid) break;;
                if (whiteNew[k] + whiteSum[k] > K)
                {
                    isGreater = true;
                }
            }
            if (!valid) break;

            if (isGreater)
            {                
                cnt++;

                rep(k, 0, whiteNew.size()) 
                {
                    whiteSum[k] = whiteNew[k];
                    whiteNew[k] = 0;
                }
            }
            else
            {
                rep(k, 0, whiteNew.size()) 
                {
                    whiteSum[k] += whiteNew[k];
                    whiteNew[k] = 0;
                }
            }
        }

        if (!valid) continue;

        ans = min(ans, cnt);
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<set>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
signed main(){
  ll n,cnt=0;
  set<ll> st;
  cin >> n;
  ll a[n];
  for(int i=0;i<n;i++){
    cin >> a[i];
    if(a[i]<3200){
      st.insert(a[i]/400);
    }else{
      cnt++;
    }
  }
  if(st.size()==0){
    cout << 1<<" "<<cnt<<endl;
  }else{
    cout <<st.size()<<" "<<cnt+st.size()<<endl;
  }
}


Measured memory_bytes: 256
//code by ASIM FOIZE AIMON
//CSE'19;CUET
#include <bits/stdc++.h>
using namespace std;
#define w(t)  \
    int t;    \
    cin >> t; \
    for(int z=1;z<=t;z++)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);
#define precise cout.precision(10); cout << fixed;
#define endl "\n"
#define int int64_t
#define ll long long
#define yes printf("YES\n")
#define no printf("NO\n")
int32_t main()
{
    /*#ifndef ONLINE_JUDGE
        freopen("/media/AIMON/SSDVol/Progs/CodeForces/input.txt", "r", stdin);
        freopen("/media/AIMON/SSDVol/Progs/CodeForces/output.txt", "w", stdout);
    #endif*/
    long long a[100001],b[100001],c=0,p=-1,d,e,f,m,n,x,y=10e9,i,j,k,r;
    string s;
    cin>>n;
    if(n>=400 && n<=599)
        cout<<8<<endl;
    else if(n>=600 && n<=799)
        cout<<7<<endl;
    else if(n>=800 && n<=999)
        cout<<6<<endl;
    else if(n>=1000 && n<=1199)
        cout<<5<<endl;
    else if(n>=1200 && n<=1399)
        cout<<4<<endl;
    else if(n>=1400 && n<=1599)
        cout<<3<<endl;
    else if(n>=1600 && n<=1799)
        cout<<2<<endl;
    else if(n>=1800 && n<=1999)
        cout<<1<<endl;

}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const ll MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")




int main() {


    ll n,x,l; cin >> n;
    ll r;
    ll ans = n;
    vector<pair<ll,ll>> p(n);

    rep(i,n){
        cin >> x >> l;
        p[i].first = x-l;
        p[i].second = x+l;
    }

    sort(p.begin(),p.end());
    rep(i,p.size()){
        if(i == 0) r = p[0].second;
        else{
            if(r <= p[i].first){
                r = p[i].second;
            }else{
                r = min(r,p[i].second);
                ans --;
            }
        }
    }

    cout << ans;

    return 0;
}


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

int main(){
  int h,w,n;
  int count=0;
  int n_temp;
  
  scanf("%d",&h);
  scanf("%d",&w);
  scanf("%d",&n);
  n_temp=n;
  while(n_temp>0){
    if(h>=w){
      n_temp=n_temp-h;
    } else {
      n_temp=n_temp-w;
    }
    count++;
  }
  
  printf("%d",count);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
/*
alias g='g++ -std=c++17 -O2 pra.cpp'
alias cg='g++ -std=c++17 -O2 -g pra.cpp'
alias s='g++ -std=c++17 -O2 -g subpra.cpp'
alias a='./a.out'
cd programming
cd cpp
cd practice

*/
#define rep(i, n) for(int i=0; i<(n); i++)
#define Sort(v) sort((v).begin(), (v).end())
#define pb push_back
using veci = vector<int>;
using ll = long long;
struct node{
  ll key;
  struct node *right;
  struct node *left;
  struct node *parent;
};
node* root = {NULL};
void insert(ll key){
  node* n = new node();
  n->key = key;//新しいノードのポインタnからそのノードのメンバにアクセス
  node* x = root;
  node* y = {NULL};
  while (x != NULL){//見る箇所を移動
    y = x;
    if (x->key >= n->key){
      x = x->left;
    }
    else x = x->right;
  }
  if (y == NULL) root = n;
  else if (y->key >= n->key) y->left = n;
  else y->right = n;
}
void preorder(node* u){//根、左、右
    cout << " " << u->key;//アクセス先が構造体変数ならドット演算子を、構造体変数へのポインターならアロー演算子を使う
    if (u->left != NULL) preorder(u->left);
    if (u->right != NULL) preorder(u->right);
}
void inorder(node* u){//左、根、右
    if (u->left != NULL) inorder(u->left);//左に行けるまで行く
    cout << " " << u->key;//いけるとこまで行ったら根を出力
    if (u->right != NULL) inorder(u->right);//次は右、これが終われば関数終了で一個前の続きをやる
}
bool treeSearch(node* root, ll x){
	bool flag=false;
	node* u = root;
	while (u != NULL){
		if (u->key == x) return true;
		else if (u->key < x){
			u = u->right;
		}
		else u = u->left;
	}
	return false;
}
int main(){
  int n, i; cin >> n;
  ll x;
  string com;
  for ( i = 0; i < n; i++ ){
    cin >> com;
    if (com == "insert"){
      cin >> x;
      insert(x);
    }
	if (com == "find" ){
      cin >> x;
      if (treeSearch(root, x)) printf("yes\n");
      else printf("no\n");
    }
    else if (com == "print"){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
	}
  }
  return 0;
}


Measured memory_bytes: 21776
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        Main m = new Main(sc);
        m.show(m.solve());
        sc.close();
    }
    
	//フィールド
    Scanner sc;
    int N;
    int[] A;
    
    //入力
    Main(Scanner sc) {
        this.sc = sc;
        this.N = sc.nextInt();
        this.A = new int[N];
        for (int i=0; i<N; i++) {
        	A[i] = sc.nextInt();
        }
    }
    
    //解答処理
    private int solve() {
    	//全ての項の積が偶数 = 最低1つの項は偶数　→　全体の組み合わせから全ての項が奇数の場合を除く
        int countTotal = (int)Math.pow(3, N);
        int countOdd = 1;
        
        for (int i=0; i<N; i++) {
        	if (A[i] % 2 == 0) {
        		countOdd *= 2;
        	}
        }
        
        return countTotal - countOdd;
    }
    
    //出力
    public void show(int answer) {
        System.out.println(answer);
    }

}


Measured memory_bytes: 35672
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#include <unordered_map>
//#include"testlib.h"
#define endl "\n"
#define all(v) v.begin(),v.end()
#define allr(s) s.rbegin(),s.rend()
#define RT(s) return cout<<s,0
#define sz(s)    (int)(s.size())
#define PI acos(-1)
#define EPS 1e-8
#define watch(x) cout << (#x)<<" = "<<x<<endl
using namespace std;
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
void file() {
#ifndef ONLINE_JUDGE
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
#else
	//freopen("street.in", "r", stdin);
	//freopen("out.txt", "w", stdout);
#endif
}
void fast() {
	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL);
}

int main() {
	file();
	fast();
	int n; cin >> n;
	ll ans = 0;
	for (ll a = 1; a <= n; a++) 
		for (ll b = 1; b * a <= n; b++) {
			int c = n - a * b;
			if (c > 0)
				ans++;
		}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 3648
use std::io::stdin;

#[allow(unused_variables)]
fn main() {
    let x = input_ints()[0];

    let mut n = x / 2;
    let mut m = n / 2;

    loop {
        let cur = n * (n + 1) / 2;

        if cur - (2 * n) + 1 < x && x <= cur - n {
            println!("{}", n-1);
            break;
        }
        
        if cur - n < x && x <= cur {
            println!("{}", n);
            break;
        }
        if cur < x && x <= cur + n+1 {
            println!("{}", n+1);
            break;
        }

        if cur < x {
            n += m;
            m /= 2;
        } else {
            n -= m;
            m /= 2
        }
    }
}

#[allow(dead_code)]
fn input_ints() -> Vec<i64> {
    let mut st = String::new();
    match stdin().read_line(&mut st) {
        Ok(_) => st.split_whitespace().map(|s| s.parse().unwrap()).collect(),
        Err(_) => Vec::<i64>::new(),
    }
}



Measured memory_bytes: 4352
#if __has_include("D:/dhiraj/Programming/debug.h")
    #include "D:/dhiraj/Programming/debug.h"
#else
    #include <bits/stdc++.h>
    using namespace std;
    #define d(...) 11
#endif

// Loops --------------------------------------------------------------------

#define loop(i,s,e)         for(ll i=(s); i<(e); i++)
#define rloop(i,s,e)        for(ll i=(s); i>=(e); i--)
#define iter(it,var)        for(auto it=var.begin(); it!=var.end(); it++)
#define riter(it,var)       for(auto it=var.rbegin(); it!=var.rend(); it++)

// Extra --------------------------------------------------------------------

#define fast                ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ull                 unsigned long long int
#define ll                  long long int
#define ld                  long double
#define endl                '\n'
#define all(x)              x.begin(),x.end()
#define rall(x)             x.rbegin(),x.rend()

// Template -----------------------------------------------------------------

template <typename T> 
inline bool inrange(T a, T l, T r) {
    if(l>r) swap(l,r);
    return (a>=l and a<=r);
}
template <typename T, typename U> 
inline bool exist(T val, U &any) {
    return (any.find(val) != any.end());
}
// multiple input
template <typename T> 
inline void inp(T &any) {
    cin >> any;
}
template <typename T, typename... U> 
inline void inp(T &a, U &...b) {
    cin >> a; inp(b...);
}
// scan vector
template <typename T> 
inline istream &operator>>(istream &in, vector<T> &a) {
    for(auto &x : a) in >> x;
    return in;
}
// scan pair
template <typename T, typename U> 
inline istream &operator>>(istream &in, pair<T,U> &a) {
    in >> a.first >> a.second; 
    return in;
}

// Solve --------------------------------------------------------------------

void solve(ll &T)
{
    ll n;
    std::cin>>n;
    
    vector<ll> a(n);
    std::cin>>a;

    map<ll,ll> m;
    for(auto i : a) {
        m[i]++;
    }

    loop(i,0,n)
    {
        std::cout<<m[i+1]<<endl;
        m[a[i]]--;
    }
}

// Main ---------------------------------------------------------------------

int main()
{
    #ifdef Dhiraj
        freopen("D:/dhiraj/Programming/i1.txt","r",stdin);
        freopen("D:/dhiraj/Programming/o1.txt","w",stdout);
    #endif
    
    fast;
    int t = 1;
    loop(i,1,t+1)
    {
        cerr<<"Case #"<<i<<"\n";
        solve(i);
    }
    return 0;
}

Measured memory_bytes: 17252
#include<bits/stdc++.h>
int main() {
	int k, A, B;
	std::cin >> k >> A >> B;
	int ans1 = (A-1) / k;
	int ans2 = B / k;

	if ((ans2 - ans1) > 0)std::cout << "OK";
	else std::cout << "NG";

}

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

#define rep(i,l,r) for(int i=(l);i<(r);i++)
#define pb push_back
#define fi first
#define se second

using ll = long long;
using G = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const ll MOD = 1000000007;

ll GCD(ll x, ll y){
	return y ? GCD(y, x%y) : x;	
}

int main() {
	int n, m; cin >> n >> m;
	int ans = 0;
	if(n!=0){
		ans += n*(n-1)/2;
	}
	if(m!=0){
		ans += m*(m-1)/2;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3640
function Main(input) {
    var tmp = input.split(" ");
    var num = parseInt(tmp[0]);
    var leg = parseInt(tmp[1]);
    
    if(leg%2===1){
        console.log("No");
    }else{
        if(num*2<=leg && leg<=num*4){
            console.log("Yes");
        }else{
            console.log("No");
        }
    }
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29592
import java.util.Scanner;
class Main{
    public static void main(String[] args){
	int count=0,i,j,yaku=0,n,m;
	
	Scanner scan = new Scanner(System.in);
	n = scan.nextInt();
	if(1>n || n>10000){System.exit(0);}
	 
	for(i=0;i<n;i++){  
	    m = scan.nextInt();
	    if(2>m || m>100000000){System.exit(0);} 
	    for(j=2;j<=Math.sqrt(m);j++){
		if(m%j==0){
		    yaku++;
		}
	    }
	    if(yaku==0){count++;}
	    yaku=0;
	}
	System.out.println(count);
    }
}



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

typedef long lint;
typedef long long llint;
typedef pair<int, int> pint;
typedef pair<long long, long long> pllint;

// static const int MAX = 1e6;
// static const int NIL = -1;
// static const llint INF = 1<<21;
// static const llint MOD = 1e9 + 7;

bool compPair(const pint& arg1, const pint& arg2) { return arg1.first > arg2.first; }
template<class T> void chmax(T& a, T b) { if (a < b) { a = b; } }
template<class T> void chmin(T& a, T b) { if (a > b) { a = b; } }

int main(void) {
    int n, y;
    cin >> n >> y;

    for(int ia=0;ia<=n;ia++) {
        for(int ib=0;ib<=n-ia;ib++) {
            if(10000*ia+5000*ib+1000*(n-ia-ib)==y) {
                cout << ia << " " << ib << " " << n-ia-ib << endl;
                return 0;
            }
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<map>
#include<queue>
#include<deque>
#include<iomanip>
#include<tuple>
using namespace std;
typedef long long int LL;
typedef pair<int,int> P;
typedef pair<LL,int> LP;
const int INF=1<<30;
const LL MAX=1e9+7;

void array_show(int *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%d%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(LL *array,int array_n,char middle=' '){
	for(int i=0;i<array_n;i++)printf("%lld%c",array[i],(i!=array_n-1?middle:'\n'));
}
void array_show(vector<int> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%d%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}
void array_show(vector<LL> &vec_s,int vec_n=-1,char middle=' '){
	if(vec_n==-1)vec_n=vec_s.size();
	for(int i=0;i<vec_n;i++)printf("%lld%c",vec_s[i],(i!=vec_n-1?middle:'\n'));
}

int t[100005];

int main(){
	int n,m;
	int i,j,k;
	int a,b,c;
	cin>>n>>m;
	if(n<=m)cout<<1<<endl;
	else cout<<(n-m-1)/(m-1)+2<<endl;
}

Measured memory_bytes: 256
import java.util.Scanner;


public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ


		Scanner sc = new Scanner(System.in);
		String S = sc.next();

		String res;
		if(S.equals("A")) {
			res = "T";
		}else if(S.equals("G")) {
			res = "C";
		}else if(S.equals("C")) {
			res = "G";
		}else  {
			res = "A";
		}
		System.out.println(res);


		}


}

Measured memory_bytes: 20564
N, M = map(lambda x: int(x), input().split(" "))
Hs = list(map(lambda x: int(x), input().split(" ")))
lowers = set()

for _ in range(M):
    A, B = map(lambda x: int(x), input().split(" "))
    a = A-1
    b = B-1
    if Hs[a] > Hs[b]:
        lowers.add(b)
    elif Hs[b] > Hs[a]:
        lowers.add(a)
    else:
        lowers.add(a)
        lowers.add(b)

result = N - len(lowers)
print(result)


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

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<bool> VB;
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define LB lower_bound
#define UB upper_bound

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL INF = 1e9;
const LL MOD = 1e9+7;

//other
//-------------------------------------------
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define FI first
#define SE second

//memo
// setprecision()


int main() {
  string S,T,U;
  cin >> S >> T >> U;
  
  cout << S[0] << T[1] << U[2] << endl;
  
  
  return 0;
}

Measured memory_bytes: 256
import sys
N = int(input())
A = [int(x) for x in input().split()]
if N == 1:
    print(1)
    sys.exit()

inc = 0  # 1: 単調非減少,　-1 : 単調非増加, 0: 未確定
ans = 1
for i in range(N - 1):
    if A[i] < A[i + 1]:
        if inc == -1:
            ans += 1
            inc = 0
        elif inc == 0:
            inc = 1
    elif A[i] > A[i + 1]:
        if inc == 1:
            ans += 1
            inc = 0
        elif inc == 0:
            inc = -1

print(ans)

Measured memory_bytes: 19968
N = int(input())
inp2 = input()
a = inp2.split()
count = 0
for i in range(int(N)):
	b = int(a[i])
	flag = True
	c = b
	while flag:
		c = c/2
		if c.is_integer():
			count+=1
		else:
			flag = False

print(count) 

Measured memory_bytes: 3828
#include <vector> 
#include <list> 
 #include <map>
 #include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <queue>
using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << '=' << (x) << endl;
#define debug(x) cerr << #x << '=' << (x) << '('<<'L' << __LINE__ << ')' << ' ' << __FILE__ << endl;

#define YES_ cout<<"Yes"<<endl;
#define NO_ cout<<"No"<<endl;


int main(){
 
    LL sum=0;
    int a,b,c,x;
    cin>>a>>b>>c>>x;
    REP(i,a+1)REP(j,b+1){
        int xx=x-i*500-j*100;
        if(xx<0){
            continue;
        }
        
        if(xx%50==0){
            if(xx/50<=c){
                sum++;
            }
        }
    }
    cout<<sum<<endl;


}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int N,M,a,b;
	int n[51]={0};
	cin>>N>>M;
	for(int i=0;i<M;i++){
		cin>>a>>b;
		for(int k=1;k<=N;k++){
			if(a==k||b==k)n[k]++;
		}
	}
	for(int p=1;p<=N;p++){
		cout<<n[p]<<endl;
	}
}

		





Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,f,n) for(int i=(f); (i) < (n); i++)
#define repe(i,f,n) for(int i=(f); (i) <= (n); i++)
using namespace std;
using ll = long long;
#define MOD (ll)1000000007
#define PI 3.14159265359
#define debug(x) cout<<#x<<" :: "<<x<<"\n";
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\n";
#define debug3(x,y,z) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<"\t"<<#z<<" :: "<<z<<"\n";
#define P pair<int, int>
#define dvec vector<vector<ll>>
//printf("%.10f\n")
//cout << fixed << setprecision(10);
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;}
ll INF = 1e+18;
int iINF = 1e9;

struct UnionFind {
    vector<int> par, rank, sz;
    
    UnionFind(int n) : par(n), rank(n, 0), sz(n, 1) {
        for (int i = 0; i < n; ++i) par[i] = i;
    }
    void init(int n) {
        par.resize(n); rank.resize(n); sz.resize(n);
        for (int i = 0; i < n; ++i) par[i] = i, rank[i] = 0, sz[i] = 1;
    }
 
    int root(int n)
    {
      if(par[n] == n) return n;
      else {
        return par[n] = root(par[n]);
      }
    }
 
    bool is_same(int a, int b)
    {
      return root(a) == root (b); 
    }
 
    int size(int n)
    {
      return sz[root(n)];
    }
 
    bool merge(int a, int b)
    {
      int rt_a = root(a);
      int rt_b = root(b);
      if(rt_a == rt_b) return false;
      if (rank[rt_a] < rank[rt_b]) swap(rt_a, rt_b);
      if (rank[rt_a] == rank[rt_b]) ++rank[rt_a];
      par[rt_b] = rt_a;
      sz[rt_a] += sz[rt_b];
      return true;
    }
 
};

int main()
{
  int N, M; cin >> N >> M;
  UnionFind uf(N);

  rep(i, 0, M){
    int a, b; cin >> a >> b; --a, --b;
    uf.merge(a, b);
  }

  int ans = 0;
  rep(i, 0, N) chmax(ans, uf.size(i));

  cout << ans << endl;
}


Measured memory_bytes: 5564
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <array>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <cstdint>
#include <unordered_set>
#include <ctime>
#include <numeric>
#include <cstdint>

typedef long long int llint;

int main(void){

  int n;
  std::cin >> n;
  n = n%10;

  switch(n){
  case 2:
  case 4:
  case 5:
  case 7:
  case 9:
    std::cout << "hon" << std::endl;
    break;
  case 0:
  case 1:
  case 6:
  case 8:
    std::cout << "pon" << std::endl;
    break;
  case 3:
    std::cout << "bon" << std::endl;
  }

  
  return 0;
}


Measured memory_bytes: 3636
//pprockys
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
	ll n,k,i,j;
	cin>>n;
	ll a[n][3];
	for(ll i=0;i<n;i++)cin>>a[i][0]>>a[i][1]>>a[i][2];
//	for(ll i=0;i<n;i++)cout<<a[i][0]<<" "<<a[i][1]<<" "<<a[i][2]<<"\n";
	ll dp[n][3];
	dp[0][0]=a[0][0];
	dp[0][1]=a[0][1];
	dp[0][2]=a[0][2];
	for(i=1;i<n;i++)
	{
	    dp[i][0]=a[i][0]+max(dp[i-1][1],dp[i-1][2]);
	    dp[i][1]=a[i][1]+max(dp[i-1][0],dp[i-1][2]);
	    dp[i][2]=a[i][2]+max(dp[i-1][1],dp[i-1][0]);
	}
	cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]));
}

Measured memory_bytes: 4992
#include<cstdio>

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

  scanf("%d %d", &a,&b);

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

  printf("%d %d %f\n",d,r,f);

  return 0;
}

Measured memory_bytes: 2760
#include<stdio.h>
#include<math.h>
int main(void){
	long n,g,max,min,sum=0,i;
	scanf("%ld",&n);
	scanf("%ld",&g);
	max=g;
	min=g;
	sum+=g;
	for(i=1;i<n;i++){
		scanf("%ld",&g);
		if(max<g){
			max=g;
		}
		if(min>g){
			min=g;
		}
		sum+=g;
	}
	printf("%ld %ld %ld\n",min,max,sum);
	return 0;
}

Measured memory_bytes: 2712
h = {
    'A' => %w(B D),
    'B' => %w(A C E),
    'C' => %w(B F),
    'D' => %w(A E G),
    'E' => %w(B D F H),
    'F' => %w(C E I),
    'G' => %w(D H),
    'H' => %w(E G I),
    'I' => %w(F H),
}
1000.times do
    s = gets.chomp
    puts s if s.each_char.each_cons(2).all? {|x, y| h[x].include?(y)}
end


Measured memory_bytes: 6884
s = list(input())
kouho = ["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"]
for i in s:
    kouho.remove(i)
if kouho == []:
    kouho.append(s.pop(-1))
    for i in range(25):
        dum = s.pop(-1)
        for j in range(len(kouho)):
            if dum < kouho[j]:
                s.append(kouho[j])
                print("".join(s))
                exit()
        else:
            kouho.append(dum)
            kouho.sort()
    else:
        print(-1)
    print("".join(s))
else:
    s.append(kouho[0])
    print("".join(s))


Measured memory_bytes: 9156
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<ll,ll> p2;
ll a[200005],b[200005];
void solve(){
	ll n,m,k,res=0;
	cin>>n>>m>>k;
	for(ll i=1;i<=n;i++)
	cin>>a[i];
	for(ll i=1;i<=m;i++)
	cin>>b[i];
	vector<ll> p0(n+1,0),p1(m+1,0);
	for(ll i=1;i<=n;i++)
	p0[i]=p0[i-1]+a[i];
	for(ll i=1;i<=m;i++)
	p1[i]=p1[i-1]+b[i];
	for(ll i=0;i<=n;i++){
		if(p0[i]>k)
		break;
		auto it=upper_bound(p1.begin(),p1.end(),k-p0[i]);
		res=max(res,i+(it-p1.begin())-1);
	}
	cout<<res;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll qc=1;
    //cin>>qc;
    for(ll i=1;i<=qc;i++)
    solve();		
}


Measured memory_bytes: 9528
import java.util.Scanner;
public class Main {
     
    static char[] k = {'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'};
     
 
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int L = 0;
        int R = 0;
        for(int i = 0; i < n; i++) {
            String s1 = stdIn.next();
            String s2 = stdIn.next();
             
            if(s1.compareTo(s2) == 0) {
                L++;
                R++;
            }
            else if(s1.compareTo(s2) < 0) {
                L += 3;
            }
            else {
                R += 3;
            }
        }
         
        System.out.println(R + " " + L);
    }
}


Measured memory_bytes: 29864
def ii():return int(input())
def iim():return map(int,input().split())
def iil():return list(map(int,input().split()))
from collections import deque


def bfs(xg,yg):
    queue = deque([(xs,ys,0)])
    while queue:
        x,y,dep = queue.popleft()
        l = []
        for xx,yy in [(1,0),(0,1),(-1,0),(0,-1)]:
            for i in range(1,k+1):
                nx,ny = x+xx*i,y+yy*i
                if cord[ny][nx] == '.':
                    l.append((nx,ny))
                elif type(cord[ny][nx]) != int or cord[ny][nx] < dep+1:
                    break
        for nx, ny in l:
            if cord[ny][nx] == '.':
                cord[ny][nx] = dep+1
                if (nx,ny) == (xg,yg):
                    return dep+1
                else:
                    queue.append((nx,ny,dep+1))
    return -1

h,w,k = iim()
ys,xs,yg,xg = iim()

cord = [['@']*(w+2)]
for i in range(h):
    cord.append(['@']+list(input())+['@'])
cord.append(['@']*(w+2))
cord[ys][xs] = '#'

print(bfs(xg,yg))


Measured memory_bytes: 51072
"use strict";

const fs = require("fs");

function main(input) {
  const tmp = input.split("\n");
  const card = tmp.slice(0, 3).map(v => v.split(" "));
  const n = tmp[3];
  const bs = tmp.slice(4);
  const check = [];
  for (let i = 0; i < 3; i++)
    check[i] = new Array(3).fill(false);
  for (let b of bs)
    for (let i = 0; i < 3; i++)
      for (let j = 0; j < 3; j++)
        if (card[i][j] === b)
          check[i][j] = true;
  if (check[0][0] && check[0][1] && check[0][2]
     || check[1][0] && check[1][1] && check[1][2]
     || check[2][0] && check[2][1] && check[2][2]
     || check[0][0] && check[1][0] && check[2][0]
     || check[0][1] && check[1][1] && check[2][1]
     || check[0][2] && check[1][2] && check[2][2]
     || check[0][0] && check[1][1] && check[2][2]
     || check[0][2] && check[1][1] && check[2][0])
    console.log("Yes");
  else
    console.log("No");
}

main(fs.readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define ss second
#define ff first
#define INF 300000000000001
#define ll_max 9000000000000000001
#define mod 998244353
#define PI 3.14159265358979323846L
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define db(args...) {string _ss = #args; replace(_ss.begin(), _ss.end(), ',' , ' '); stringstream ___s(_ss) ; debug(___s, args);}
using namespace std;
typedef vector<pair<ll,ll> > vll;
typedef vector<pair<int,int> > vii ;
typedef pair<ll,ll> pll;
const ll N = 300001;
const ll M = 1;
struct point {
    ll x, y;
    ll i;
};

void debug(stringstream &s){}
template <typename T, typename... Args>
void debug(stringstream &s, T a, Args... args)
{
    string word;
    s >> word;
    cout << word << " = " << a << endl;
    debug(s, args...);
}

ll fast_exp(ll x, ll n)
{
    if(n == 0) return 1;
    else if(n & 1)
        return fast_exp(x, n - 1) * x % mod;
    else
    {
        ll tmp = fast_exp(x, n >> 1);
        return tmp * tmp % mod;
    }
}

int main()
{
    fast;
    int _ = 1;
    //cin >> _;
    //int test = 0;
    while(_--)
    {
        ll n, m, x = 0, y = 0, ans = 0;
        cin >> n;
        set<string> s;
        string ss;
        for(int i = 0; i < n; i++)
        {
            cin >> ss;
            if(s.find(ss) == s.end())
            {
                s.insert(ss);
                ans++;
            }
        }
        cout << ans << "\n";
    }
    return 0;
}


Measured memory_bytes: 19248
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define MM 1000000000
#define MOD MM+7
#define MAX 10000
#define MAP 100
#define Pair pair<int,int>

int dx[4] = {-1, 0, 1, 0};
int dy[4] = {0, -1, 0, 1};
int main(){
    ll n,m; cin >> n >> m;
    ll x[m];

    ll length = 0;
    for(int i = 0; i < m; i++){
        cin >> x[i];
    }
    if(m == 1 || n >= m){
        cout << 0 << endl;
        return 0;
    }
    sort(x,x+m);

    length = x[m-1]-x[0];
    ll difference[m-1];
    for(int i = 0; i < m-1; i++){
        difference[i] = x[i+1]-x[i];
    }
    sort(difference, difference + m-1);
    reverse(difference, difference + m-1);
    for(int i = 0; i < n-1; i++){
        length -= difference[i];
    }
    cout << length << endl;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
// type alias
typedef long long LL;
typedef pair<int,int> II;
typedef tuple<int,int,int> III;
typedef vector<int> VI;
typedef vector<string> VS;
typedef unordered_map<int,int> MAPII;
typedef unordered_set<int> SETI;
template<class T> using VV=vector<vector<T>>;
// minmax
template<class T> inline T SMIN(T& a, const T b) { return a=(a>b)?b:a; }
template<class T> inline T SMAX(T& a, const T b) { return a=(a<b)?b:a; }
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// collection
#define ALL(c) (c).begin(),(c).end()
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// stdout
#define println(args...) fprintf(stdout, ##args),putchar('\n');
// debug cerr
template<class Iter> void __kumaerrc(Iter begin, Iter end) { for(; begin!=end; ++begin) { cerr<<*begin<<','; } cerr<<endl; }
void __kumaerr(istream_iterator<string> it) { (void)it; cerr<<endl; }
template<typename T, typename... Args> void __kumaerr(istream_iterator<string> it, T a, Args... args) { cerr<<*it<<"="<<a<<", ",__kumaerr(++it, args...); }
template<typename S, typename T> std::ostream& operator<<(std::ostream& _os, const std::pair<S,T>& _p) { return _os<<"{"<<_p.first<<','<<_p.second<<"}"; }
#define __KUMATRACE__ true
#ifdef __KUMATRACE__
#define dump(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); __kumaerr(_it, args); }
#define dumpc(ar) { cerr<<#ar<<": "; FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }
#define dumpC(beg,end) { cerr<<"~"<<#end<<": "; __kumaerrc(beg,end); }
#else
#define dump(args...)
#define dumpc(ar)
#define dumpC(beg,end)
#endif

// $ cp-batch Magic2 | diff Magic2.out -
// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG -fsanitize=address Magic2.cpp && ./a.out

/*

 7/25/2020

 5:07-

 */

int A,B,C,K;

bool solve() {
  REPE(k,K) REPE(i,k) {
    int j=k-i;
    int b=C,g=B,r=A;
    int ii=i,jj=j;
    while(ii--) b*=2;
    while(jj--) g*=2;
    if(b>g&&g>r) {
      //dump(i,j,k,b,g,r);
      return true;
    }
  }
  return false;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout<<setprecision(12)<<fixed;

  cin>>A>>B>>C>>K;
  cout<<(solve()?"Yes":"No")<<endl;

  return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
#define pii pair<int,int>
vector<pii> ls, rs;
bool check() {
	int tot = 0;//记前缀和
	for(int i=0; i<ls.size(); i++) {
		if(tot+ls[i].first<0)
			return false;
		tot+=ls[i].second;
	}
	for(int i=0; i<rs.size(); i++) {
		if(tot+rs[i].second-rs[i].first<0)
			return false;
		tot+=rs[i].second;
	}
	return true;
}
bool cmp(const pii &a,const pii &b) {
	if(a.first==b.first) return a.second>b.second;
	return a.first>b.first;
}
int main() {
	int n;
	cin >> n;
	int sum = 0;//所有序列值总和
	for(int i=1; i<=n; i++) {
		string s;
		cin >> s;
		int cnt= 0, min_pre = 1e9;
		//对每个序列，cnt记任权值和，min_pre记任意前缀最小值
		for(int i=0; i<s.size(); i++) {
			if(s[i]== '(') ++cnt;
			else --cnt;
			min_pre = min(min_pre, cnt);
		}
		sum += cnt;
		if(cnt>=0) ls.push_back(make_pair(min_pre,cnt));
		else rs.push_back(make_pair(cnt-min_pre,cnt));
	}
	sort(ls.begin(),ls.end(),cmp);
	sort(rs.begin(),rs.end(),cmp);
	if(sum==0&&check())
		puts("Yes");
	else
		puts("No");
	return 0;
}

Measured memory_bytes: 11280
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
using namespace std;
 
#ifdef LOCAL
	#define eprintf(...) fprintf(stderr, __VA_ARGS__);fflush(stderr);
#else
	#define eprintf(...) 42
#endif

using ll = long long;
using ld = long double;
using uint = unsigned int;
using ull = unsigned long long;
template<typename T>
using pair2 = pair<T, T>;
using pii = pair<int, int>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
ll myRand(ll B) {
	return (ull)rng() % B;
}
 
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define mk(arr,n,type)  type *arr=new type[n];
 
clock_t startTime;
double getCurrentTime() {
	return (double)(clock() - startTime) / CLOCKS_PER_SEC;
}
int main(){
	long long a;
	double b;
	cin >> a >> b;
	long long  ans = (a *(b *100)/100);
	cout << ans << "\n";
	return 0;
}


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

int main(){
    int N;
    cin>>N;
    vector<string> data;
    string s;
    for(int i=0;i<N;i++){
        cin>>s;
        data.push_back(s);
    }

    sort(data.begin(),data.end());
    int count=N;
    for(int i=1;i<data.size();i++){
        if(data[i-1]==data[i]) count--;
    }

    cout<<count<<endl;
}


Measured memory_bytes: 11660
#include<algorithm>
#include<cstring>
#include<cctype>
#include<cstdio>
#include<vector>
#define rep(i,x,y) for(int i=x; i<=y; ++i)
#define pb push_back

using namespace std;
const int N=100005;
int n,ans,tot;
vector <int> vt[N];

int getint()
{
	char ch;
	while(!isdigit(ch=getchar()));
	int x=ch-48;
	while(isdigit(ch=getchar())) x=x*10+ch-48;
	return x;
}

int main()
{
	n=getint();
	rep(i,1,n+1) if(i*(i-1ll)/2==n) {ans=i; break;}
	if(!ans) return puts("No"),0;
	puts("Yes");
	printf("%d\n",ans);
	rep(i,1,ans-1)
		rep(j,i+1,ans)
			++tot,vt[i].pb(tot),vt[j].pb(tot);
	rep(i,1,ans)
	{
		int sz=vt[i].size();
		printf("%d",sz);
		rep(j,0,sz-1) printf(" %d",vt[i][j]);
		puts("");
	}
		
	return 0;
} 

Measured memory_bytes: 4608
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = nextInt(sc);
        int B = nextInt(sc);

        show(calc(A, B));
    }

    private static int calc(int A, int B) {
        return (A >= 13) ? B : (12 >= A && A >= 6) ? B/2 : 0;
    }

    private static int nextInt(Scanner sc) {
        return Integer.parseInt(sc.next());
    }
    private static void show(Object answer) {
        System.out.println(answer);
    }
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;


const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

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;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

#define REP(i,a,b) for(int i=(a);i<(b);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define rv reverse
#define ALL(a) (a).begin(),(a).end()

int main(){
    int N,MIN=INF,MAX=-1,ans=INF;
    cin>>N;
    vector<int> A(N);
    rep(i,N){
        cin>>A[i];
        if(A[i]<MIN)MIN=A[i];
        if(A[i]>MAX)MAX=A[i];
    }
    REP(x,MIN,MAX+1){
        int sum=0;
        rep(i,N){
            sum+=(A[i]-x)*(A[i]-x);
        }
        if(sum<ans)ans=sum;
    }

    cout<<ans<<endl;

    return 0;
}

//a=97,z=122

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
  int n,p,i,c=0;
  cin>>n;
  for(i=1;i<=n;i++){
    cin>>p;
    if(p!=i) c++;
  }
  if(c<=2) cout<<"YES"<<endl;
  else cout<<"NO"<<endl;
}

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

class Program
{
    public void Proc()
    {
        Reader.IsDebug = false;
        int[] inpt = Reader.ReadLine().Split(' ').Select(a => int.Parse(a)).ToArray();

        this.Sx = inpt[0];
        this.Sy = inpt[1];
        this.Tx = inpt[2];
        this.Ty = inpt[3];

        StringBuilder ans = new StringBuilder();
        for (int i = Sx; i < Tx; i++)
        {
            ans.Append("R");
        }
        for (int i = Sy; i < this.Ty; i++)
        {
            ans.Append("U");
        }
        for (int i = this.Tx; i > Sx; i--)
        {
            ans.Append("L");
        }
        for (int i = this.Ty; i > Sy; i--)
        {
            ans.Append("D");
        }
        ans.Append("D");
        for (int i = Sx; i < Tx + 1; i++)
        {
            ans.Append("R");
        }
        for (int i = Sy - 1; i < this.Ty; i++)
        {
            ans.Append("U");
        }
        ans.Append("L");
        ans.Append("U");
        for (int i = Tx; i > Sx - 1; i--)
        {
            ans.Append("L");
        }
        for (int i = this.Ty + 1; i > Sy; i--)
        {
            ans.Append("D");
        }
        ans.Append("R");
        Console.WriteLine(ans.ToString());

    }

    private int Sx;
    private int Sy;
    private int Tx;
    private int Ty;


    public class Reader
    {
        public static bool IsDebug = true;
        private static String PlainInput = @"




0 0 1 2



";
        private static System.IO.StringReader Sr = null;
        public static string ReadLine()
        {
            if (IsDebug)
            {
                if (Sr == null)
                {
                    Sr = new System.IO.StringReader(PlainInput.Trim());
                }
                return Sr.ReadLine();
            }
            else
            {
                return Console.ReadLine();
            }
        }
    }
    static void Main()
    {
        Program prg = new Program();
        prg.Proc();
    }
}

Measured memory_bytes: 2904
x, n = map(int, input().split())
p = []
while True:
  try:
    p = list(map(int, input().split()))
  except EOFError:
    break

for num in range(100 + 1):
  high, low = x + num, x - num
  if low not in p:
    print(low)
    break
  if high not in p:
    print(high)
    break

Measured memory_bytes: 9188
s=input()
b=0
m=len(s)
c=[0 for i in range(2019)]
c[0]=c[0]+1
a=""
e=0
f=1
s= ''.join(list(reversed(s)))
for i in s:
    e+=int(i)*f
    g=e%2019
    c[g]+=1
    f*=10
    f%=2019
e = sum(i * (i - 1) // 2 for i in c)
print(e)


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

int main(){
	
	
	int n,m;
	int a[10000];
	int sum =0;
	int free_days;
	
	cin>>n;
	cin>>m ;
	
	for(int i=0;i<m;i++){
		
	 cin >> a[i];
	
	}
	
	for(int i=0;i<m;i++){
		
		sum = sum + a[i];
    }
		if(sum<n)
		{
		    free_days= n-sum;
	     	printf("%d",free_days);
	    }
	    else if(sum==n){
		
		     printf("0");
	    }
	    else{
	    	printf("-1");
		}
	
	return 0;
}

Measured memory_bytes: 3820
import sys

APP = 'APPROVED'
DEN = 'DENIED'

N = int(input())
A = list(map(int, input().split()))


for i in A:
    if i % 2 == 0:
        if i % 3 != 0 and i % 5 !=0:
            print(DEN)
            sys.exit()
    
print(APP)

Measured memory_bytes: 3060
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Code author: Saurabh Singhal
Code copy karne vaale tera muh kaala
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/

#include<bits/stdc++.h>
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define ppb pop_back

using namespace std;
typedef long long int ll;
typedef vector<int> vi_t;
typedef vector<ll> vll_t;
int t=1;
vll_t a,b;
int  main(){
	// #ifndef ONLINE_JUDGE
 //    // for getting input from input.txt
 //    freopen("input.txt", "r", stdin);
 //    // for writing output to output.txt
 //    freopen("output.txt", "w", stdout);
	// #endif
	int n,k;
	cin>>n>>k;
	vector<int>v(n);
	for(int i=0;i<n;i++){
		cin>>v[i];
	}
	sort(v.begin(),v.end());
	int ans=INT_MAX;
	for(int i=0;i<=n-k;i++){
		ans=min(ans,v[i+k-1]-v[i]);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 640