akhauriyash/Code-Regression huggingface dataset:
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
/*多倍長整数/cpp_intで宣言
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
*/

//#pragma gcc target ("avx2")
//#pragma gcc optimization ("o3")
//#pragma gcc optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0
#define addf(T) [](T a, T b){return (a + b);}
#define minf(T) [](T a, T b){return min(a, b);}
#define maxf(T) [](T a, T b){return max(a, b);}


using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acos(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

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

ll lcm(ll number1, ll number2) {
	return number1 / gcd(number1, number2) * number2;
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	ll n;
	scanf("%lld", &n);
	vector<ll> a(5);
	rep(i, 5)scanf("%lld", &a[i]);
	sort(all(a));
	ll ans = 4 + (n + a[0] - 1) / a[0];
	printf("%lld\n", ans);

	Please AC;
}


Measured memory_bytes: 888
#include<stdio.h>
#include<algorithm>
using namespace std;
int main(){
	int n,k;
	int a[100005];
	while(~scanf("%d",&n)){
		k=0;
		for(int i=0;i<n;i++)
		scanf("%d",&a[i]);
		sort(a,a+n);
		if(a[n/2-1]<a[n/2])
		k=a[n/2]-a[n/2-1];
		printf("%d\n",k);
	} 
return 0;	
}

Measured memory_bytes: 640
import java.util.ArrayDeque;
import java.util.Scanner;

// stack
public class Main {

	// ?°´?????????
	static class Pool {
		// ????????????'\'?????????
		int start;
		// ??????????????§?????¢???
		int area;

		public Pool(int start, int area) {
			this.start = start;
			this.area = area;
		}

		public String toString() {
			return "(" + start + ", " + area + ")";
		}
	}

	public static void main(String[] args) {

		// ??\??????????????????
		ArrayDeque<Integer> s1 = new ArrayDeque<>();
		// ?°´??????????????¢???
		ArrayDeque<Pool> s2 = new ArrayDeque<>();

		Scanner sc = new Scanner(System.in);
		String line = sc.nextLine();
		// ?°´????????????????¨???¢???
		int sum = 0;

		for (int i = 0; i < line.length(); i++) {

			if (line.charAt(i) == '\\') {
				s1.offerFirst(i);
			} else if (line.charAt(i) == '/' && s1.size() > 0) {
				int j = s1.pollFirst();
				sum += i - j;
				// ?±?????°´?????????
				int a = i - j;
				// ??±???
				while (s2.size() > 0 && s2.getFirst().start > j) {
					a += s2.pollFirst().area;
				} 
				Pool pool = new Pool(j, a);
				s2.offerFirst(pool);
			}
			// ???????????°
			// System.out.println(s2);
		}
		
		System.out.println(sum);
		int loop = s2.size();
		if (loop == 0) {
			System.out.println(loop);
		}else{
			System.out.print(loop + " ");
		}

		// ??\?????????????????????????????????
		for (int i = 0; i < loop; i++) {
			if (i == loop - 1) {
				System.out.println(s2.pollLast().area);	
			}else{
				System.out.print(s2.pollLast().area + " ");
			}
			
		}

		sc.close();
	}

}

Measured memory_bytes: 29856
#include <bits/stdc++.h>
#define fin ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ii pair<int,int>
#define F first
#define S second
#define pb push_back
#define pf push_front
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fore(i,a,b) for(int i = a;i < b; i+= 1)
#define forr(i,a) for(int i = a; i >= 0; i--)
#define fori(i,m) for(auto i = m.begin(); i != m.end(); i++) 
#define w(t) while(t--)
#define sz(s) int(s.size())
#define cls(a,car) memset(a,car,sizeof (a))
#define ff(x) cerr << #x << " is " << x << '\n'
#define FL freopen("in", "r", stdin),freopen("out", "w", stdout);
#define time cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n"
using namespace std;
typedef unsigned long long ll;
typedef vector<int> vi;
typedef vector<ii> vii;
const int N = 1 * 1e5 + 5;
const ll mod = 1e9 + 7;
const int INF = INT_MAX;
const ll INFCAD  = ll(INT_MAX) * 2 + 1;
const double E = 1e-9;
int dx[] = {1, 0, -1, 0}, dy[] = {0, 1, 0, -1};
// fflush(stdout)
// cout << flush
// a + b = a ^ b + 2 * (a & b) 
vi G[26];
int main(){
    //FL;
    fin;
    int k;
    string s;
    cin >> s >> k;
    set<string> st;
    fore(i, 0, sz(s)){
        fore(j, 1, 6)
            st.insert(s.substr(i, min(5, j)));
    }
    int cur = 0;
    fori(i, st){
        cur++;
        if(cur == k)
        cout << *i << '\n';
    }
    time;
    return 0;
}   

Measured memory_bytes: 1664
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>  // sort, 二分探索, etc
#include <iomanip>  // setprecision (浮動小数点の出力の誤差)
#include <map>
#include <queue>
#include <set>
#include <stack>

#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=a,i##_len=(b);i<i##_len;++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define cauto const auto&
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000
#define MOD 10000007
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

using namespace std;
using ui = unsigned int;
using ll = long long;
using ull = unsigned long long;

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

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

ll comb(int n, int r) {
    vector<vector<ll> > v(n+1, vector<ll>(r+1, 0));
    for(int i=0;i<n+1;i++) {v[i][0]=1; if(i < r+1)v[i][i]=1; }
    for(int i=1;i<n+1;i++) {for(int j=1;j<min(i,r+1);j++) {v[i][j]=v[i-1][j-1]+v[i-1][j];}}
    return v[n][r];
}

// CHAR_MAX  = 127
// INT_MAX   = 2.1e+09 (2147483647)
// LONG_MAX  = 9.2e+18 (9223372036854775807)
// LLONG_MAX = 9.2e+18 (9223372036854775807)


int main() {
    int n, m;
    cin >> n >> m;
    ll total = 0;
    rep(i, m) {
        ll x;
        cin >> x;
        total += x;
    }

    if (total > n) {
        cout << "-1" << '\n';
    } else {
        cout << n - total << '\n';
    }


    return 0;
}


Measured memory_bytes: 3164
n = int(input())
hhh = list(map(int, input().split()))
dp = [0] * n
dp[1] = abs(hhh[0] - hhh[1])
for i, h in enumerate(hhh[2:]):
    dp[i + 2] = min(dp[i] + abs(hhh[i] - hhh[i + 2]), dp[i + 1] + abs(hhh[i + 1] - hhh[i + 2]))
print(dp[-1])


Measured memory_bytes: 13908
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define fi first
#define se second
long long mo = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

const int mod = 1000000007;
class mint {
    long long x;
public:
    mint(long long x=0) : x((x%mod+mod)%mod) {}
    mint operator-() const { 
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }
 
    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x;
        return os;
    }
};
 
struct combination {
  vector<mint> fact, ifact;
  combination(int n):fact(n+1),ifact(n+1) {
    assert(n < mod);
    fact[0] = 1;
    for (int i = 1; i <= n; ++i) fact[i] = fact[i-1]*i;
    ifact[n] = fact[n].inv();
    for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
  }
  mint operator()(int n, int k) {
    if (k < 0 || k > n) return 0;
    return fact[n]*ifact[k]*ifact[n-k];
  }
} comb(200010);

int main(){
    ll N,K;
    cin >> N >> K;
    ll M = K+1;
    if(N-1 < K){
        M = N;
        //if(N%2 != K%2){
        //    M--;
        //}
    }
    //ll init = ((K%2)?1:0);
    mint ans = 0;
    REP(i,0,M){
        ans += comb(N,i)*comb(N-1,i);//N-i とi // i+N-i-1
        //cout << i <<": " <<ans << endl;
    }
    cout << ans << endl;
}

Measured memory_bytes: 6236
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
const int INF = 1000000000;

int main() {
	int n;
	cin >> n;
	vector<vector<pair<int, int>>> g(n);
	for (int i = 0; i < n-1; ++i) {
		int a, b;
		cin >> a >> b;
		a--; b--;
		g[a].emplace_back(b, i);
		g[b].emplace_back(a, i);
	}

	int s = 0;
	int d[n];
	fill(d, d+n, INF);
	d[s] = 0;
	int prev_color[n];
	prev_color[s] = 0;
	int color[n];
	int max_color = 1;
	queue<int> que;
	que.push(s);
	while (!que.empty()) {
		int v = que.front(); que.pop();
		int ng_color = prev_color[v];
		int c = 1;
		for (auto e : g[v]) {
			if (d[e.first] == INF) {
				d[e.first] = d[v] + 1;
				if (c == ng_color) c++;
				color[e.second] = c;
				prev_color[e.first] = c;
				max_color = max(max_color, c);
				c++;
				que.push(e.first);
			}
		}
	}
	cout << max_color << endl;
	for (int i = 0; i < n-1; ++i) {
		cout << color[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 7808
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
//#include <regex>

/* g++ -g -std=c++0x */
/* g++ -g -std=c++11 */

using namespace std;

// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

int main()
{
/* #ifndef ONLINE_JUDGE */
/*     freopen("foo", "rt", stdin); */
/* #endif */
    std::ios::sync_with_stdio(false);

    int h, w;
    string s[51];
    while (cin >> h >> w) {
        FOR(i,0,h)
            cin >> s[i];
        const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
        const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
        FOR(j,0,h) FOR(k,0,w) {
            if (s[j][k] == '#') continue;
            int cnt = 0;
            FOR(l,0,8) {
                const int nj = j + dx[l];
                const int nk = k + dy[l];
                if (nj < 0 || nj >= h) continue;
                if (nk < 0 || nk >= w) continue;
                if (s[nj][nk] == '#')
                    cnt++;
            }
            s[j][k] = char(cnt + '0');
        }
    }
    FOR(i,0,h)
        cout << s[i] << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
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;}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin>>n;
    string s;cin>>s;
    int ans = 0;
    rep(i, n){
        string s1 = s.substr(0,i);
        string s2 = s.substr(i);
        int t=0;
        cerr<<s1<<" "<<s2<<endl;
        map<char, int> cm;
        rep(j, s1.size()){
            cm[s1[j]]++;
        }
        map<char, int> cm2;
        rep(k, s2.size()){
            if(cm[s2[k]]>0 && cm2[s2[k]]==0){
                cm2[s2[k]]++;
                t++;
            }
        }
        ans = max(ans, t);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
Created on Sat Sep  8 10:15:40 2018

@author: maezawa
"""
import collections
n = int(input())
arr = []
for i in range(n):
    arr.append(collections.Counter(input()))
    
common = arr[0]
for key, value in common.items():
    for i in range(1,n):
        if arr[i][key] < common[key]:
            common[key] = arr[i][key]

ans = ''
for key, value in common.items():
    ans += key*value

ans = ''.join(sorted(list(ans)))

print(ans)




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

int main(){
	int n,h,w,x,y,k=0;
	cin >>n >> h >> w;
	for(int i = 0; i < n; i++) {
		cin >> x >> y;
    	if(x>=h && y >=w)
          	k++;
	}
	cout << k << endl;
	
}


Measured memory_bytes: 256
// Package main provides
//
// File:  c.go
// Author: ymiyamoto
//
// Created on Wed Jan 16 19:19:02 2019
//
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)

	m := map[int]int{}
	for i := 0; i < N; i++ {
		var a int
		fmt.Scan(&a)
		if a < 400 {
			m[0]++
		} else if a < 800 {
			m[400]++
		} else if a < 1200 {
			m[800]++
		} else if a < 1600 {
			m[1200]++
		} else if a < 2000 {
			m[1600]++
		} else if a < 2400 {
			m[2000]++
		} else if a < 2800 {
			m[2400]++
		} else if a < 3200 {
			m[2800]++
		} else {
			m[3200]++
		}
	}

	min := 0
	max := 0
	for k, v := range m {
		if k == 3200 {
			max += v
		} else {
			min++
			max++
		}
	}

	if min == 0 {
		min++
	}

	fmt.Println(min, max)
}


Measured memory_bytes: 512
x=int(input())

y=x//100
m=x-y*100

if y>0 and y<13:
	if m>0 and m<13:
		res='AMBIGUOUS'
	else:
		res='MMYY'
else:
	if m>0 and m<13:
		res='YYMM'
	else:
		res='NA'

print(res)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
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; }
const ll INF = 1LL << 60;
const int MAX = 1000000010;
const ll MOD = 1000000007;

struct UnionFind {
    vector<int> par; vector<int> rank;

    UnionFind(int N) : par(N), rank(N) {
        for (int i = 0; i < N; i++) {
            par[i] = i; 
            rank[i] = 0;
        }
    }

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

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        if (rank[rx] < rank[ry]) {
            par[rx] = ry;
        } else {
            par[ry] = rx;
            if (rank[rx] == rank[ry]) rank[rx]++;
        }
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

int main() {
    int N, M; cin >> N >> M;
    UnionFind T(N + 1);
    vector<int> p(N + 1);
    for (int i = 1; i <= N; i++) cin >> p[i];

    for (int i = 0; i < M; i++) {
        int x, y; cin >> x >> y;
        T.unite(p[x], p[y]);
    }

    int cnt = 0;
    for (int i = 1; i <= N; i++) {
        if (T.same(p[i], i)) cnt++;
    }

    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 1408
import sys
input = lambda: sys.stdin.readline().rstrip()
H, W, M = map(int, input().split())
X = [0] * H
Y = [0] * W
Z = []
for _ in range(M):
    h, w = map(int, input().split())
    h, w = h-1, w-1
    X[h] += 1
    Y[w] += 1
    Z.append((h, w))
mX = max(X)
mY = max(Y)
cX = X.count(mX)
cY = Y.count(mY)
c = 0
for h, w in Z:
    if X[h] == mX and Y[w] == mY:
        c += 1

print(mX + mY - (0 if c < cX * cY else 1))

Measured memory_bytes: 100976
//in the name of god
#include <bits/stdc++.h>
using namespace std;
#define MAX_N (int)1e5+20
#define INF 1e9+20
#define pb push_back
#define F first
#define S second
typedef long long LL;
typedef pair<int,int> pii;
const int delta=(int)1e9+7;
string s; int ans;
int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin>>s;
	for(int i=0;i<3;++i) if(s[i]=='1') ++ans;
	cout<<ans;
	return cout<<endl,0;
}

Measured memory_bytes: 764
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <list>
#include <string>
#include <numeric>
#include <math.h>
#include <set>
#include <map>
#include <fstream>
using namespace std;

int main()
{
	vector<int> a(5);
	vector<int> b(5);
	for(int i=0; i<5; i++)
	{
		cin>>a[i];
		b[i] = a[i] % 10;
		if(b[i]==0)
		{
			b[i] = 10;
		}
	}
	//最後に頼むものを指定

	
	int index = distance(b.begin(),min_element(b.begin(),b.end()));
	//cout<<index<<endl;
	int count = 0;
	for(int i=0; i<5; i++)
	{
		if(i==index)
		{
			count += a[i];
			continue;
		}
		count += (a[i]+9)/10 * 10;
	}
	cout<<count<<endl;
	return 0;
}

Measured memory_bytes: 256
S = input()
n = False
e = False
s = False
w = False
for _s in S:
    if _s == 'N':
        n = True
    if _s == 'E':
        e = True
    if _s == 'S':
        s = True
    if _s == 'W':
        w = True
if (n and s and e and w) or (n and s and not e and not w) or (not n and not s and e and w):
    print('Yes')
else:
    print('No')


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

int main() {
  ll x;
  cin>>x;
  ll  i=100;
  int t=0;
  while(true){
    i*=1.01;
    t++;
    if(i>=x)break;
  }
  cout<<t;
}





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

using namespace std;

int main(int argc, char const *argv[]) {
  int A, B;
  cin >> A >> B;
  string S;
  cin >> S;

  if (S.length() != A + B + 1) {
    cout << "No\n";
    return 0;
  }

  for (int i = 0; i < A; i++) {
    if (S[i] < 48 || 57 < S[i]) {
      cout << "No\n";
      return 0;
    }
  }

  if (S[A] != '-') {
    cout << "No\n";
    return 0;
  }

  for (int i = A + 1; i < A + B + 1; i++) {
    if (S[i] < 48 || 57 < S[i]) {
      cout << "No\n";
      return 0;
    }
  }

  cout << "Yes\n";

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define forp(x,a,b) for(int x=a; x<b; x++)
#define forn(x,a,b) for(int x=a; x>b; x--)
#define SZ(a) ((int)(a).size())
#define pb push_back
#define vec(x) vector<x>
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pair<int,int>>
#define umpii unordered_map<int,int>
#define all(v) v.begin(),v.end()
#define mem(a,b) memset(a, b, sizeof a)
#define setBits(n) __builtin_popcountll(n)
#define prec(n) fixed<<setprecision(n)
#define ff first
#define ss second
#define print(x) for(auto it:x) cout<<it<<" ";
#define w(x) while(x--)
using namespace std;
typedef long long ll;
const int mod= 1e9 + 7;
 int n, p;
 ll w[100], v[100];
 ll W[100001][101];
 ll pot(ll x,int y){
    if(y==0){
        return 1;
            }
else{
    if(y%2==0){ int k=pot(x,y/2);
        return k*k;
        }
    else{
        return x*pot(x,y-1);
        }    
    }
}


 
void solve(){ 
    
}

int main(){
 ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n>>p;
    forp(i,0,n){cin>>w[i]>>v[i];}
    forp(i,0,p+1){
        
        forn(j,n-1,-1){
            W[i][j]=W[i][j+1];
            if(i>=w[j]){W[i][j]=max(W[i-w[j]][j+1]+v[j],W[i][j+1]);}//cout<<W[i][j]<<' ';
        }//cout<<endl;
        }
    
    
    cout<<W[p][0];
    
    return 0;}

Measured memory_bytes: 82476
// #[warn(dead_code)]
// const TOP: u64 = 1000000007;

fn main() {
	let text = {
		use std::io::Read;
		let mut s = String::new();
		std::io::stdin().read_to_string(&mut s).unwrap();
		s
	};

	let mut iter = text.split_whitespace();
	let _: usize = iter.next().unwrap().parse().unwrap();
	let index: usize = iter.next().unwrap().parse().unwrap();
	let index = index - 1;
	let word: String = iter.next().unwrap().parse().unwrap();

	let word: String = word
		.chars()
		.enumerate()
		.map(|(i, c)| {
			if i == index {
				match c {
					'A' => 'a',
					'B' => 'b',
					'C' => 'c',
					_ => ' ',
				}
			} else {
				c
			}
		})
		.fold("".to_string(), |s, c| format!("{}{}", s, c));

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


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

#define mem(Arr,x) memset(Arr,x,sizeof(Arr))

const int maxN=201000;
const int maxM=maxN<<1;
const int inf=2147483647;

int n,m;
int edgecnt=0,Head[maxN],Next[maxM],V[maxM];
char str[maxN];
stack<int> St;
int del[maxN],vis[maxN],ink[maxN];

void Add_Edge(int u,int v);
bool check(int u);

int main(){
	mem(Head,-1);
	cin>>n>>m;
	cin>>(str+1);
	for (int i=1;i<=m;i++){
		int u,v;cin>>u>>v;
		Add_Edge(u,v);Add_Edge(v,u);
	}
	for (int i=1;i<=n;i++)
		if (check(i)==0){
			St.push(i);
			do{
				int u=St.top();St.pop();
				if (del[u]==1) continue;
				del[u]=1;
				for (int j=Head[u];j!=-1;j=Next[j])
					if ((del[V[j]]==0)&&(check(V[j])==0)) St.push(V[j]);
			}
			while (!St.empty());
		}

	bool flag=0;
	for (int i=1;i<=n;i++) if (del[i]==0) flag=1;
	if (flag) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

	return 0;
}

void Add_Edge(int u,int v){
	Next[++edgecnt]=Head[u];Head[u]=edgecnt;V[edgecnt]=v;
	return;
}

bool check(int u){
	bool fa=0,fb=0;
	for (int i=Head[u];i!=-1;i=Next[i])
		if (del[V[i]]==0){
			if (str[V[i]]=='A') fa=1;
			if (str[V[i]]=='B') fb=1;
		}
	return fa&fb;
}


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

using namespace std;

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

int main(){
  int n;
  cin >> n;
  vector<int> a(n * 2);
  uint64_t r = 0;
  REP(i, n){
    int x;
    cin >> x;
    if(x >= n) continue;
    if(x < i){
      r += a[i - x];
    }
    ++a[x + i];
  }
  cout << r << endl;
  return 0;
}

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

int main(){
    ll k,n;
    cin>>n>>k;
    vector<ll> h(n);
    rep(i,n){
        cin>>h[i];
    }
    sort(h.begin(),h.end());
    ll ans = (int)pow(10,10);
    rep(i,n-k+1){
        ans=min(ans,abs(h[i]-h[i+k-1]));
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    string a,b;
    cin>>a>>b;
    string ans="";
    int j=0,i=0;
    for(i=0;i<b.size();i++){
        ans+=a[i];
        ans+=b[i];
    }
    if(a.size() != b.size()){
        ans += a[i];
    }
    cout<<ans<<endl;
    return 0;
}


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

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

  int ans = 0;
  for(size_t i = 0; i < 4; ++i) {
    if(input_s[i] == '+') {
      ans += 1;
    } else if(input_s[i] == '-') {
      ans -= 1;
    } else {
      return -1;
    }
  }
  cout << ans << endl;
  return 0;
}

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

typedef pair<int,int> P;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;


ll dp[3][100010];
int __list[] = {0,1,2};
ll abc[3][100010];

int main()
{
    int n;
    cin >> n;
    rep(i,n)
    {
        cin >> abc[0][i]>> abc[1][i] >> abc[2][i];
    }

    rep(i,n)
    {
        rep(j,3)
        {
            for(auto& u: __list)
            {
                if (u!=j)
                {
                    chmax(dp[u][i+1], dp[j][i]+abc[u][i]);
                }
            }
        }
    }
    ll ans = 0;
    for(auto& u : __list)
    {
        ans = max(ans, dp[u][n]);
    }
    cout << ans << endl;
}

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

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update>
#define ll long long
#define ull unsigned long long
#define N 100005
//#define mod 1000000007
#define mod 1e18
#define boost ios_base::sync_with_stdio(false);cin.tie(0)
#define prec(n) fixed<<setprecision(n)

#define mii map<int,int>
#define mll map<ll,ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi  first

#define se second
#define pb push_back
#define mp make_pair
#define pp pop_back
#define vii vector<int>
#define vll vector<ll>
#define vpii vector<pii>
#define vpll vector<pll>
#define all(c) c.begin(),c.end()
#define tr(it,c) for(it = c.begin() ; it!=c.end() ; it++)
int inf = INT_MAX ;
ll modulo(ll num,ll MOD=mod){ return ((num%MOD)+MOD)%MOD;} // for negative integer
ll power(ll b,ll e,ll MOD=mod){ll ans=1; while(e){if(e%2) ans=(ans*b)%MOD; b=(b*b)%MOD; e/=2;} return ans;}
ll inv(ll num,ll MOD=mod){ return power(modulo(num),MOD-2,MOD); }
ll gcd(ll a,ll b){ return ((b==0) ? a:gcd(b,a%b));}
ll dp[405][405];

int main(){
	boost;
	int n;
	cin>>n;
	int arr[n];
	ll pre[n];
	
	for(int i = 0;i<n;i++){
		cin>>arr[i];
		pre[i] = (i>0?pre[i-1]:0) + arr[i]; 
	}
	
	for(int i = n;i>=0;i--){
		for(int j = i;j<n;j++){
			dp[i][j] = mod;
			if(i==j){
				dp[i][j] = 0;
				continue;
			}
			
			for(int k = i;k<j;k++){
				ll ans = dp[i][k] + dp[k+1][j] + pre[j];
				if(i>0){
					ans = ans - pre[i-1];
				}
				dp[i][j] = min(dp[i][j],ans);
			}
		}
	}
	
	cout<<dp[0][n-1];
	return 0;
}



Measured memory_bytes: 4896
r, g, b, n = gets.split(" ").map(&:to_i)

numbers = []

numbers.push(r)
numbers.push(g)
numbers.push(b)

numbers.sort!

count = 0

number_0_max = n / numbers[0]
number_1_max = n / numbers[1]
sum = 0

3001.times do |index|
  3001.times do |index2|
    sum = numbers[0] * index + numbers[1] * index2
    if (n - sum) % numbers[2] == 0 && n >= sum
      count += 1
    end
  end
end

puts count

Measured memory_bytes: 1788
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = n;
        HashSet<Integer> primes = new HashSet<>();
        for (int i = 2; i <= Math.sqrt(m); i++) {
            while (m % i == 0) {
                primes.add(i);
                m /= i;
            }
        }
        if (m != 1) {
            primes.add(m);
        }
        ArrayList<HashSet<Integer>> lists = new ArrayList<>();
        lists.add(primes);
        for (int i = 1; i < primes.size(); i++) {
            HashSet<Integer> tmp = new HashSet<>();
            for (int x : lists.get(i - 1)) {
                for (int y : primes) {
                    if (x % y != 0) {
                        tmp.add(x * y);
                    }
                }
            }
            lists.add(tmp);
        }
        int total = n;
        for (int i = 0; i < lists.size(); i++) {
            for (int x : lists.get(i)) {
                if (i % 2 == 0) {
                    total -= n / x;
                } else {
                    total += n / x;
                }
            }
        }
        System.out.println(total);
    }
}


Measured memory_bytes: 26352
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

ll F[2100010];

ll Mul(ll a, ll b) {
	return ((a % mod) * (b % mod)) % mod;
}

void fact(void) {
	F[0] = 1;
	F[1] = 1;
	for (int i = 2; i <= 2100000; i++) {
		F[i] = Mul(i, F[i - 1]);
	}
}
ll square(ll x) {
	return (x * x) % mod;
}

ll power(ll x, ll y) {
	if (y == 0) return 1;
	else if (y == 1) return x % mod;
	else if (y % 2 == 0) return square(power(x, y / 2)) % mod;
	else return square(power(x, y / 2)) * x % mod;
}

ll Div(ll a, ll b) {
	return Mul(a, power(b, mod - 2));
}
ll P(ll n, ll r) {
	if (n < r || n < 0 || r < 0) return 0;
	return Div(F[n], F[n - r]);
}

ll C(ll n, ll r) {
	if (n < r || n < 0 || r < 0) return 0;
	ll ret;
	ret = Div(F[n], Mul(F[n - r], F[r]));
	return ret;
}

int main()
{
	fact();
	int N, K;
	cin >> N >> K;
	for (int i = 1; i <= K; i++) {
		cout << Mul(C(N - K + 1, i), C(K - 1, i - 1)) << endl;
	}
}


Measured memory_bytes: 16640
#include<iostream>
using namespace std;
void cookie(int &A,int &B) {
	if(A%2==0) {
		A/=2;
		B+=A;
	} else {
		A--;
		A/=2;
		B+=A;
	}
}
int main() {
	int A,B,K;
	cin>>A>>B>>K;
	for (int i=1; i<=K; i++) {
		if(i%2==1)      cookie(A,B);
		else            cookie(B,A);
	}
	cout <<A<<" "<<B;
	return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <math.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using pint = pair<int,int>;
using vec = vector<int>;
using ll=long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
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; }


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

    rep(i,n) cin>>v[i];

    sort(v.begin(),v.end());

    double sum=(v[0]+v[1])/2.0;
    for(int i=2; i<n; i++){
        sum = (double)(sum+v[i])/2.0;
    }

    cout<<sum<<endl;

}

Measured memory_bytes: 256
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;
 
int main() {
    int N = 28;

    vector<int> cnt(31);
    for(int i=0; i<N; i++) {
        int v; scanf("%d", &v);
        cnt[v]++;
    }

    for(int i=1; i<=30; i++) {
        if(!cnt[i]) cout << i << endl;
    }
    return 0;
}



Measured memory_bytes: 3152
#include <iostream>
#include <string>
using namespace std;
int n;

void dfs(string s, char max){
    if(s.length() == n){
        cout << s << endl;
    }else{
        for(char ch = 'a'; ch <= max; ch++){
            dfs(s + ch, (ch == max) ? (char)(max + 1) : max);
        }
    }
}

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

Measured memory_bytes: 1536
uid = []
gets.to_i.times do
  uid << gets.chomp
end

open = false
gets.to_i.times do
  id = gets.chomp
  if uid.include? id
    puts ( open ? "Closed" : "Opened" ) + " by " + id
    open = !open
  else
    puts "Unknown " + id
  end
end

Measured memory_bytes: 8744
#include <bits/stdc++.h>
using namespace std;
typedef long long l;
int main()
{
    l X,Y;
    cin>>X>>Y;
    bool b=false;
    for(l i=0;i<=X;i++)
    {
        for(l j=X-i;(i+j)==X;j--)
        {
            if(((2*i)+(4*j))==Y)
            {
                b=true;
                break;
            }
        }
        if(b) break;
    }
    if(b) cout<<"Yes";
    else cout<<"No";
    return 0;
}


Measured memory_bytes: 3620
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#include <queue>
     
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<long long, long long> pll;


struct pair_hash
{
	size_t operator()(const std::pair<ll, ll> &v) const 
    {
      
        return std::hash<ll>()(v.first) ^ std::hash<ll>()(v.second);
    }
};

struct state
{
    ll a,b,c;

    state(ll a, ll b, ll c) : a(a), b(b), c(c)
    {

    }

  bool operator==(const state &other) const
  { return (a == other.a
            && b == other.b
            && c == other.c);
  }
};

struct KeyHasher
{
    size_t operator()(const state& k) const
  {
    //using std::size_t;
    //using std::hash;
    //using std::string;

    return ((hash<ll>()(k.a)
               ^ (hash<ll>()(k.b) << 1)) >> 1)
               ^ (hash<ll>()(k.c) << 1);
  }
};  

ll MOD = 998244353;
ll mod = 998244353;

ll fast_power(ll base, ll power) {
    ll result = 1;
    while(power > 0) {

        if(power % 2 == 1) { // Can also use (power & 1) to make code even faster
            result = (result*base) % MOD;
        }
        base = (base * base) % MOD;
        power = power / 2; // Can also use power >>= 1; to make code even faster
    }
    return result;
}


ll blockOfAGivenAndLen(ll len, ll n, ll m)
{
	if (len == n) return m;

	ll kblocks = 1;

	kblocks *= m*(n - len + 1); // choose a color for a block of a given len and a starting position
	kblocks %= MOD;

	kblocks *= fast_power(m - 1, max(0LL, n - len));
	kblocks %= MOD;

	return kblocks;
}

ll fact[200005];
ll inv[200005];

ll C(ll n, ll k)
{
	return (((fact[n] * inv[k]) % mod) * inv[n-k]) % mod;
}

void solve()
{
	ll n,m,k;

	cin >> n >> m >> k;

	ll res = 0;

	// at least n - k - 1 pairs needs to be differnet

	fact[0] = 1;
	fact[1] = 1;
	inv[0] = 1;

	for (int i = 1; i <= n; i++)
	{
		fact[i] = (fact[i-1] * i) % mod;
		inv[i] = fast_power(fact[i], mod - 2);
	}

	//ll res = 0;

	for (int i = n - k - 1; i <= n-1; i++)
	{
		ll calc = C(n-1, i)*m % MOD;
		calc *= fast_power(m-1,i);
		calc %= MOD;
		res += calc;
		res %= mod;
	}

	cout << res << endl;
	
}


int main()
{
	solve();

	return 0;
}




Measured memory_bytes: 6740
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <sstream>
#include <functional>
#include <iomanip>
//#include <windows.h>  //Should be deleted when using AtCoder&POJ
using namespace std;

#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)
/**==Info==
*Program:4
*Problem:E - 高橋君とホテル / Tak and Hotels
*Date:2018-10-20
*Algorithm:JGH's Doubleize
*Stats:Unknown*/

bool debug=false;

int n,l,q;
int x[100005];
int d[100005][20];
int pw2[25];

inline int CanGoTo(int pos){
	return upper_bound(x,x+n,pos+l)-x-1;
}

int solve(int st,int ed){
	
	int ans=0;
	
	for(int i=18;i>=1;i--){
		if(d[st][i]<ed){
			st=d[st][i];
			ans+=pw2[i-1];
		}
	}
	
	if(st!=ed){
		ans++;
	}
	
	return ans;
}

int main(int argc,char* argv[]){
	
	pw2[0]=1;
	for(int i=1;i<=20;i++){
		pw2[i]=pw2[i-1]*2;
	}
	
	qi;
	cin>>n;
	//if(n>1000) exit(1);
	
	for(int i=0;i<n;i++){
		cin>>x[i];
	}
	
	cin>>l>>q;
	
	//Shart BZ
	for(int i=0;i<n;i++){
		d[i][1]=CanGoTo(x[i]);
	}
//	
//	for(int i=0;i<n;i++){
//		cout<<"walk from 1 step from "<<i<<" can get to "<<d[i][1]<<endl;
//	}
	
	for(int i=2;i<=18;i++){
		for(int j=0;j<n;j++){
			d[j][i]=d[d[j][i-1]][i-1];
			//cout<<"d"<<j<<","<<i<<"="<<d[j][i-1]<<","<<i-1<<"="<<d[d[j][i-1]][i-1]<<endl;
		}
	}
	
//	for(int i=0;i<n;i++){
//		for(int j=1;j<=18;j++){
//			cout<<"walk from "<<j<<" step from "<<i<<" can get to "<<d[i][j]<<endl;
//		}
//	}
	
	for(int i=0;i<q;i++){
		int a,b;
		cin>>a>>b;
		a--;b--;
		if(a>b) swap(a,b);
		cout<<solve(a,b)<<endl;
	}
	return 0;
}



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

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

#define repa(i, a, b) for (auto i = (a); i <= (b); i++)
#define repd(i, a, b) for (auto i = (a); i >= (b); i--)
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define zero(a)  memset((a), 0, sizeof (a))
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back

constexpr auto inf = numeric_limits<int>().max() - 1;
constexpr auto llinf = numeric_limits<ll>().max() - 1LL;

template<typename ForwardIterator>
void dump(ForwardIterator st, ForwardIterator en) {
	for (auto it = st; it != en; it++) {
		cout << *it << " ";
	}
	cout << endl;
}

template<typename ForwardIterator>
void dump_map(ForwardIterator st, ForwardIterator en) {
	for (auto it = st; it != en; it++) {
		cout << (*it).first << ":" << (*it).second << " ";
	}
	cout << endl;
}
template<typename T>
void debug(initializer_list<T> list) {
  for (auto el : list) {
    cout << el << " ";
  }
  cout << endl;
}

constexpr ll mod = ll(1e9 + 7);

ll mult(ll a, ll b) { return ((a % mod) * (b % mod)) % mod; }

ll power(ll a, ll b) {
	ll result = 1LL;
	while (b) {
		if (b % 2LL) result = mult(result, a);
		a = mult(a, a);
		b /= 2LL;
	}
	return result;
}

ll divide(ll a, ll b) { return mult(a, power(b, mod - 2)); }

ll add(ll a, ll b) { return ((a % mod) + (b % mod)) % mod; }

ll subtract(ll a, ll b) { return ((a - b) % mod + mod) % mod; }

char mat[10][10];
char matc[10][10];

void copymat(int h, int w) {
  rep(i, h) rep(j, w) matc[i][j] = mat[i][j];
}

int countmat(int h, int w) {
  int cnt = 0;
  rep(i, h) rep(j, w) if (matc[i][j] == '#') cnt++;
  return cnt;
}

void solve() {
  int h, w, k;
  cin >> h >> w >> k;
  rep(i, h) rep(j, w) cin >> mat[i][j];
  int cnt = 0;
  for (int i = 0; i < (1 << h); i++) {
    for (int j = 0; j < (1 << w); j++) {
      copymat(h, w);
      rep (i1, h) {
        if (i & (1 << i1)) {
          rep(j1, w) matc[i1][j1] = 'r';
        }
      }
      rep (j1, w) {
        if (j & (1 << j1)) {
          rep(i1, h) matc[i1][j1] = 'r';
        }
      }
      if (countmat(h, w) == k) cnt++;
    }
  }
  cout << cnt;
	cout << "\n";
}

#define REPEAT 0
#define CASE 0

int main() {
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	#if REPEAT
		int t;
		cin >> t;
		repa(i, 1, t) {
			#if CASE
				cout << "Case #" << i << ": ";
			#endif
			solve();
		}
	#else
		solve();
	#endif
	return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <string> 
using namespace std;
int main(void) {
	int	a,b,c;
	cin >> a >> b >> c;
	if (a*b*c == 175)cout << "YES" << endl;
	else
	{
		cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
   int n;
   cin >> n;
   long int h[n];
   int i;
   for(i = 0; i < n ; i++)
   {
       cin >> h[i];
   }
   long int max = h[0];
   
   for(i = 0; i < n ; i++)
   {
       if(h[i] < (max - 1))
        {
            cout << "No";
            break;
        }
        if(h[i] > max)
            max = h[i];
   }
   if(i == n)
    cout << "Yes";
}


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

int N;
vector<int> a;

set<int> zs;
vector<int> z;

vector<int> acc;

int main()
{
    cin >> N;
    a.resize(N);
    for (auto &v : a)
    {
        cin >> v;
        zs.insert(v);
    }
    z.resize(1, 0);

    for (auto v : zs) z.push_back(v);

    acc.resize(z.size());
    for (auto v : a)
    {
        acc[lower_bound(z.begin(), z.end(), v) - z.begin()]++;
    }
    for (int i=acc.size()-2; i>=1; i--) acc[i] += acc[i+1];


    int maxa_tmp = 0;
    for (int i=0; i<N; i++)
    {
        if (a[i] <= maxa_tmp)
        {
            cout << 0 << endl;
            continue;
        }
        long long ans = 0;
        int j = lower_bound(z.begin(), z.end(), a[i]) - z.begin();
        for (; z[j] > maxa_tmp; j--) ans += (long long)acc[j] * (z[j] - z[j-1]);
        cout  << ans << endl;
        maxa_tmp = a[i];
    }
}


Measured memory_bytes: 7036
#include <cstdlib>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

const ll inf = 100000000009;

ll dis(ll x1, ll y1, ll x2, ll y2){
	return abs(x1-x2)+abs(y1-y2);
}

int main(int argc, char ** argv){
	ll M,N;
	cin >> N >> M;
	vector <ll> a(N,0), b(N,0), c(M,0), d(M,0);
	for(ll i=0; i<N; i++) cin >> a[i] >> b[i];
	for(ll i=0; i<M; i++) cin >> c[i] >> d[i];
	for(ll i=0; i<N; i++){
		ll min_dis = inf;
		ll min_chkpt = -1;
		for(ll j=0; j<M; j++){
			if(dis(a[i],b[i],c[j],d[j]) < min_dis){
				min_dis = dis(a[i],b[i],c[j],d[j]);
				min_chkpt = j;
			}
		}
		cout << min_chkpt+1 << endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){

    int N;      cin >> N;
    long H[100000];
    for(int i = 0 ; i < N ; i++)
        cin >> H[i];

    bool check = true;
    for(int i = 1 ; i < N ; i++){
        if(H[i - 1] <= H[i] - 1)
            H[i] -= 1;

        if(H[i] < H[i - 1]){
            check = false;
            break;
        }
    }

    if(check)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
        

    return 0;
}

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

typedef long long ll;
typedef pair<ll,ll> ii;
typedef long double ld;
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ALL(x) x.begin(),x.end()
#define SZ(x) (int)x.size()
const int INF=2012345678;
const ll LLINF=4012345678012345678LL;
const ll MOD=998244353; //1000000007
const ld PI=3.1415926535898;
const ld EPS=1e-9;
ll gcd(ll a,ll b){if(a<b)swap(a,b);if(b==0)return a;return gcd(b,a%b);}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline ll expo(ll b,ll p,ll m){ll res=1; while(p){if(p&1)res=(res*b)%m; b=(b*b)%m; p>>=1;} return res;}
inline ll modinv(ll a,ll m){return expo(a,m-2,m);}

struct node{
    int s,e,m;
    ll v;
    node *l,*r;
    node(int S,int E){
        s=S;e=E;m=(s+e)/2;v=0;
        if(s!=e){
            l=new node(s,m);r=new node(m+1,e);
        }
    }
    void upd(int x,ll nv){
        if(s==e){v=max(v,nv);return;}
        if(x<=m)l->upd(x,nv);
        else r->upd(x,nv);
        v=max(l->v,r->v);
    }
    ll qry(int x){ //pref max
        if(x==e)return v;
        if(x<=m)return l->qry(x);
        return max(l->qry(m),r->qry(x));
    }
}*root;

int main(){
    int n;
    scanf("%d",&n);
    int h[n];ll arr[n];
    for(int i=0;i<n;i++)scanf("%d",&h[i]);
    for(int i=0;i<n;i++)scanf("%lld",&arr[i]);
    root=new node(0,n);
    for(int i=0;i<n;i++){
        ll ans=root->qry(h[i]-1);
        root->upd(h[i],ans+arr[i]);
    }
    printf("%lld",root->qry(n));
}


Measured memory_bytes: 21376
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        // Your code here!
        Scanner sc = new Scanner(System.in);
        int sc1 = sc.nextInt();
        int sc2 = sc.nextInt();
        int sc3 = sc.nextInt();
        System.out.println(sc3 + " " + sc1 + " " + sc2);
    }
}


Measured memory_bytes: 21844
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <ctype.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>
#include <math.h>

#define N_MAX (100)
#define P_MAX (100)
#define DP_ARRAY_SIZE (N_MAX * P_MAX / 32 + 1)

#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define ABS(a) ((a) < 0 ? -(a) : (a))
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

int compare_sz_desc(const void* a, const void* b) {
    return *((size_t*)a) > * ((size_t*)b) ? -1 : 1;
}

int compare_f(const void* a, const void* b) {
    return *((int64_t*)a) < *((int64_t*)b) ? -1 : 1;
}

int compare_f2(const void* a, const void* b) {
    return *((uint64_t*)a) > * ((uint64_t*)b) ? -1 : 1;
}

static size_t comb(const size_t n, const size_t r) {
    size_t result = 1;

    for (size_t i = 0; i < r; i++) {
        result *= n - i;
        result /= i + 1;
    }

    return result;
}

static uint64_t combU64(const uint64_t n, const uint64_t r) {
    uint64_t result = 1;

    for (uint64_t i = 0; i < r; i++) {
        result *= n - i;
        result /= i + 1;
    }

    return result;
}

static uint64_t gcd(uint64_t m, uint64_t n)
{
    uint64_t temp;

    while (m % n != 0) {
        temp = n;
        n = m % n;
        m = temp;
    }

    return n;
}

static size_t gcdZu(size_t m, size_t n) {
    size_t temp;

    while (m % n != 0) {
        temp = n;
        n = m % n;
        m = temp;
    }

    return n;
}

int main(void) {
    size_t N, K;

    scanf("%zu %zu", &N, &K);

    double result = 0;

    for (size_t i = 1; i <= N; i++) {
        if (K <= i) {
            result += 1.0f / (double)N;
        }
        else {
            result += (1.0f / (double)N) / pow(2.0f, ceill(log2((double)K / (double)i)));
        }
    }

    printf("%.11lf", result);

    return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <map>
#include <unordered_map>
#include <set>
#include <queue>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define SZ(x) long long((x).size())
#define OUT(x) cout << (x) << endl
typedef long long ll;
typedef vector<ll> V;
typedef vector<vector<ll>> VV;
typedef pair<ll, ll> P;
typedef map<string, ll> M;
typedef unordered_map<ll, ll> HM;
typedef set<ll> S;
typedef multiset<ll> MS;
typedef queue<ll> Q;

int main(){
    ll n; cin>>n;
    OUT(n*(n-1)/2);
}


Measured memory_bytes: 256