akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
using System.Numerics;
static class Program{
	const int mod=(int)1e9+7;
	const double eps=1e-11;
	static void Main(){
		Sc sc=new Sc();
		var s=sc.Ia;
		var a=sc.Ia;
		const int m=200000;
		var h=new int[m+1];
		for(int i = 0;i<s[0];i++) {h[a[i]]++;}
		Array.Sort(h,(u,v)=>v-u);
		int p=0;
		for(int i = 0;i<s[1];i++) {p+=h[i];}
		Console.WriteLine("{0}",s[0]-p);
	}
}
public class Sc{
	public int I{get{return int.Parse(Console.ReadLine());}}
	public long L{get{return long.Parse(Console.ReadLine());}}
	public double D{get{return double.Parse(Console.ReadLine());}}
	public string S{get{return Console.ReadLine();}}
	public int[] Ia{get{return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public object[] Oa{get{return Console.ReadLine().Split();}}
	public int[] Ia2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),int.Parse);}}
	public int[] Ia3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),int.Parse);}
	public int[] Ia3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),int.Parse);}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public long[] La3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),long.Parse);}
	public long[] La3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),long.Parse);}
	public double[] Da2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),double.Parse);}}
	public double[] Da3(int a){return Array.ConvertAll((a.ToString()+" "+Console.ReadLine()).Split(),double.Parse);}
	public double[] Da3(bool a,int b,bool c,int d){return Array.ConvertAll(((a?b.ToString()+" ":"")+Console.ReadLine()+(c?" "+d.ToString():"")).Split(),double.Parse);}
	public T[] Arr<T>(int n,Func<T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f();}return a;}
	public T[] Arr<T>(int n,Func<int,T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i);}return a;}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
	public T[] Arr<T>(int n,Func<int,string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(i,Console.ReadLine().Split());}return a;}
}

Measured memory_bytes: 29404
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC073A
{
    class Program
    {
        static void Main(string[] args)
        {
            string n;
            n = Console.ReadLine();
            if (n[0] == '9' || n[1] == '9')
                Console.WriteLine("Yes");
                else
            Console.WriteLine("No");
            Console.ReadKey();
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#include <atcoder/convolution>
using namespace atcoder;
struct fast_ios { fast_ios(){ cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(20); }; } fast_ios_;
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define all(v) v.begin(),v.end()
#define SZ(v) ((int)v.size())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define chmax(a, b) a = max(a, b)
#define chmin(a, b) a = min(a, b)
#define bit(n) (1LL<<(n))
#define debug(x) cout << #x << "=" << x << endl;
#define vdebug(v) { cout << #v << "=" << endl; REP(i_debug, v.size()){ cout << v[i_debug] << ","; } cout << endl; }
#define mdebug(m) { cout << #m << "=" << endl; REP(i_debug, m.size()){ REP(j_debug, m[i_debug].size()){ cout << m[i_debug][j_debug] << ","; } cout << endl;} }
#define pb push_back
#define fi first
#define se second
#define int long long
#define INF 1000000000000000000
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream &operator<<(ostream &os, vector<T> &v){ for(int i = 0; i < v.size(); i++) { cout << v[i]; if(i != v.size() - 1) cout << endl; }; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p){ cout << '(' << p.first << ',' << p.second << ')'; return os; }
template<typename T> void Out(T x) { cout << x << endl; }
template<typename T1, typename T2> void chOut(bool f, T1 y, T2 n) { if(f) Out(y); else Out(n); }

using vec = vector<int>;
using mat = vector<vec>;
using Pii = pair<int, int>;
using v_bool = vector<bool>;
using v_Pii = vector<Pii>;

//int dx[4] = {1,0,-1,0};
//int dy[4] = {0,1,0,-1};
//char d[4] = {'D','R','U','L'};

const int mod = 1000000007;
//const int mod = 998244353;



signed main(){

    int N, M; cin >> N >> M;
    vec a(N); cin >> a;
    vec b(M); cin >> b;
    vec c = convolution(a, b);
    REP(i, N + M - 1) cout << c[i] << " ";
    cout << endl;

    return 0;
}


Measured memory_bytes: 27264
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const ll mod=1000000007;
int main(){
  int i,n,k;
  cin >> n >> k;
  vector<vector<int> > g(100010);
  vector<int> ans(100010,mod);
  for(i=0;i<n-1;i++){
    int a,b;
    cin >> a >> b;
    a--,b--;
    g[a].push_back(b),g[b].push_back(a);
  }
  stack<P> s;
  s.push(P(0,k));
  ans[0]=k;
  while(!s.empty()){
    P p=s.top();
    s.pop();
    int v=p.first,w;
    if(v==0){
      w=k;
    }
    else{
      w=k-1;
    }
    for(i=0;i<g[v].size();i++){
      int us=g[v][i];
      if(ans[us]!=mod){
        continue;
      }
      w--;
      ans[us]=w;
      s.push(P(us,w));
    }
  }
  ll ans1=1;
  for(i=0;i<n;i++){
    ans1=ans1*ans[i]%mod;
    if(ans[i]<=0){
      cout << 0 << endl;
      return 0;
    }
  }
  ans1%=mod;
  cout << ans1 << endl;
}

Measured memory_bytes: 10284
#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;
#ifdef ENABLE_DEBUG
#define dump(a) cerr<<#a<<"="<<a<<endl
#define dumparr(a,n) cerr<<#a<<"["<<n<<"]="<<a[n]<<endl
#else
#define dump(a) 
#define dumparr(a,n) 
#endif
#define FOR(i, a, b) for(ll i = a;i < b;i++)
#define For(i, a) FOR(i, 0, a)
#define REV(i, a, b) for(ll i = b-1;i >= a;i--)
#define Rev(i, a) REV(i, 0, a)
#define REP(a) For(i, a)
#define SIGN(a) (a==0?0:(a>0?1:-1))

typedef long long int ll;
typedef unsigned long long ull;
typedef unsigned int uint;
typedef pair<ll, ll> pll;
typedef pair<ll,pll> ppll;
typedef vector<ll> vll;
typedef long double ld;
typedef pair<ld,ld> pdd;

const ll INF=(1LL<<50);
#if __cplusplus<201700L
ll gcd(ll a, ll b) {
  if(a < b) return gcd(b, a);
  ll r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}
#endif
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;
}
template<class S,class T>
std::ostream& operator<<(std::ostream& os,pair<S,T> a){
  os << "(" << a.first << "," << a.second << ")";
  return os;
}
template<class T>
std::ostream& operator<<(std::ostream& os,vector<T> a){
  os << "[ ";
  REP(a.size()){
    os<< a[i] << " ";
  }
  os<< " ]";
  return os;
}

const string YES = "Yes";
const string NO = "No";

void solve(long long a, long long b, long long c){
  if(2*sqrtl(a*b)<c-a-b){
    cout<<YES<<endl;
  }else{
    cout<<NO<<endl;
  }
}

int main(){
  cout<<setprecision(1000);
    long long a;
    scanf("%lld",&a);
    long long b;
    scanf("%lld",&b);
    long long c;
    scanf("%lld",&c);
    solve(a, b, c);
    return 0;
}


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

#define lli long long int
#define pi pair<int,int>
#define mod 1000000007

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);	cout.tie(0);
	int n,w;
	cin>>n>>w;
	vector<lli> dp(w+1);
	for(int i=0;i<n;i++)
	{
		int weight,value;
		cin>>weight>>value;
		for(int weight_already=(w-weight);weight_already>=0;weight_already--)
			dp[weight_already+weight]=max(dp[weight_already+weight],dp[weight_already]+value);
	}
	lli res=0;
	for(int i=0;i<=w;i++)
		res=max(res,dp[i]);
	cout<<res<<endl;
	return 0;
}

Measured memory_bytes: 1024
//#pragma comment(linker, "/STACK:1024000000,1024000000")
/* vim: set fdm=marker */
//{{{
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int iinf = 0x7fffffff;
const ll linf = ~(1LL<<63);
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef map<ll, int> mli;
typedef map<ll, ll> mll;
template<typename T>
inline T gcd(T a, T b) {
	if(a < 0) return gcd(-a, b);
	if(b < 0) return gcd( a,-b);
	if(a < b) return gcd(b, a);
	if(b == 0) return a;
	return gcd(b, a%b);
}

ll qpow(ll a, ll n, ll mod) {
	a %= mod;
	ll ans = 1LL;
	while(n) {
		if(n & 1) ans = (ans*a % mod);
		a = (a*a % mod);
		n >>= 1;
	}
	return ans;
}

inline ll rev(ll a, ll p) {
	return qpow(a, p - 2, p);
}

#define all(v) v.begin(), v.end()
#define sz(v) v.size()
#define rep(x, st, en) for(int x = st; x < en; x++)
#define pb push_back
#define mp make_pair
#define dbgm(msg, var) cerr<<#msg<<" "<<#var<<" = "<<var<<endl; 
#define dbg(var) cerr<<#var<<" = "<<var<<endl;
#define X first
#define Y second
inline int in() { int x; cin>>x; return x; }
#ifdef ALNDBG
namespace alndbg {
	clock_t s, e;
}
#endif

inline void tic() {
#ifdef ALNDBG
	alndbg::s = clock();
#endif
}

inline void toc() {
#ifdef ALNDBG
	alndbg::e = clock();
	cerr<<1000.0 * (alndbg::e - alndbg::s) / CLOCKS_PER_SEC<<" ms"<<endl;
#endif
}

//}}}

// -------------------- Spliters ------------------------
const int maxn = 102;


int main() {
	ios::sync_with_stdio(0);
	int N;
	string s, t;
	cin>>N;
	cin>>s>>t;
	int ans = 2*N;
	for(int i = 0; i < s.size(); i++) {
		bool ok = true;
		for(int j = i; j < s.size(); j++) {
			if(s[j] != t[j - i]) { ok = false; break; }
		}
		if(ok) {
			ans = N + i;
			break;
		}
	}
	cout<<ans<<endl;
	return 0;
}
// --USE C++11
// *-USE O2


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
ans = 0
for i in range(N):
    ans += min(A[i],B[i])
    B[i] -= min(A[i],B[i])
    ans += min(A[i+1],B[i])
    A[i+1] -= min(A[i+1],B[i])
print(ans)


Measured memory_bytes: 97340
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
constexpr auto mod = 1000000007;
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
template<class T> inline void chmax(T& a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
	a = std::min(a, b);
}

//combination(Nが小さい時はこれを使う)
const int MAX = 330000;
int fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}
int COMB(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}

//繰り返し二乗法（Nが大きい時の場合のcombination)
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= (i % mod); res %= mod;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
//UnionFind
class UnionFind {
protected:
	int* par, * rank, * size;
public:
	UnionFind(unsigned int size) {
		par = new int[size];
		rank = new int[size];
		this->size = new int[size];
		rep(i, size) {
			par[i] = i;
			rank[i] = 0;
			this->size[i] = 1;
		}
	}
	int find(int n) {
		if (par[n] == n)return n;
		return par[n] = find(par[n]);
	}
	void unite(int n, int m) {
		n = find(n);
		m = find(m);
		if (n == m)return;
		if (rank[n] < rank[m]) {
			par[n] = m;
			size[m] += size[n];
		}
		else {
			par[m] = n;
			size[n] += size[m];
			if (rank[n] == rank[m])rank[n]++;
		}
	}
	bool same(int n, int m) {
		return find(n) == find(m);
	}
	int getsize(int n) {
		return size[find(n)];
	}
};
int dight_sum(int n) {
	int sum = 0;
	rep(i, 20)sum += (n % (int)pow(10, i + 1)) / (pow(10, i));
	return sum;
}
int n, k;
int a[555];
int gl[50000000];
int g[555];
signed main() {
	cin >> n >> k;
	rep(i, n)cin >> a[i];
	int p = 0;
	rep(i, n)p += a[i];
	int memo = 0;
	for (int i = 1; i <= sqrt(p); i++) {
		if (p % i == 0) {
			gl[memo] = i;
			gl[memo + 1] = p / i;
			memo += 2;
		}
	}
	sort(gl, gl + memo);
	reverse(gl, gl + memo);
	rep(i, memo) {
		int m = 0;
		rep(j, n) {
			g[j] = a[j] % gl[i];
			m += g[j];
		}
		m = m / gl[i];
		int p = 0;
		sort(g, g + n);
		rep(j, n - m)p += g[j];
		if (p <= k) {
			cout << gl[i] << endl;
			ggr
		}
	}
	ggr
}

Measured memory_bytes: 2304
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int A, B;
  cin >> A >> B;
 
  if (B > A){
  int i = 0;
  while (i < B) {
    cout << A;
    i++;
  }
  }
 
  if (A >= B){
  int i = 0;
  while (i < A) {
    cout << B;
    i++;
  }
  }  
}

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

const long long int MOD = 1000000007;
const int MAX_K = 2020;

long long int fac[MAX_K], finv[MAX_K], inv[MAX_K];

void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < MAX_K; i++){
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
      finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

long long int COM(int n, int k){
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int n, k;

int main(){
  cin >> n >> k;
  COMinit();
  
  for(int i = 1; i <= k; i++){
    cout << (COM(n - k + 1, i) * COM(k - 1, i - 1)) % MOD << endl;
  }
    
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

#define N 1000

int max(int,int);

int lcs(char *X,char *Y){
  int i,j;
  int c[N+1][N+1];
  int m=strlen(X)+1;
  int n=strlen(Y)+1;
  int maxl=0;
 
  for(i=1;i<m;i++){
    for(j=1;j<n;j++){
      if(X[i-1]==Y[j-1])
	c[i][j]=c[i-1][j-1]+1;
      else{
	if(c[i-1][j]>c[i][j-1])c[i][j]=c[i-1][j];
	else {c[i][j]=c[i][j-1];
	    }
      }
	if(c[i][j]>maxl)maxl=c[i][j];
	
    }
  }
  return maxl;
}

int main(){
  char s1[N+1],s2[N+1];
  int i;
  int n;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%s%s",s1,s2);
    printf("%d\n",lcs(s1,s2));
  }
  return 0;
}



Measured memory_bytes: 5648
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main(){
  int N; cin >> N;
  vector<int> A(N);
  vector<int> B(N);
  rep(i,N) cin >> A[i];
  rep(i,N) cin >> B[i];
  vector<int> C(N), D(N);
  rep(i,N) {
    C[(i+(N/2))%N]=B[i];
    D[(i+((N+1)/2))%N]=B[i];
  }
  bool ok = true;
  rep(i,N){
    if(A[i]==C[i])ok =false;
  }
  if(ok){
    cout << "Yes" << endl;
    rep(i,N){
      if(i) cout << " ";
      cout << C[i];
    }
    cout << endl;
    return 0;
  }
  /*
  ok = true;
  rep(i,N){
    if(A[i]==D[i])ok =false;
  }
  if(ok){
    cout << "Yes" << endl;
    rep(i,N){
      if(i) cout << " ";
      cout << D[i];
    }
    cout << endl;
    return 0;
  }
  */
  reverse(all(B));
  ok = true;
  rep(i,N){
    if(A[i]==B[i]) ok = false;
  }
  if(ok) {
    cout << "Yes" << endl;
    rep(i,N){
      if(i) cout << " ";
      cout << B[i];
    }
    cout << endl;
    return 0;
  }
  cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 6420
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
template<class t, class u>
ostream& operator<<(ostream& os, const pair<t, u>& p) {
  return os << "{" << p.first << ", " << p.second << "}";
}
template<class t> ostream& operator<<(ostream& os, const vector<t>& v) {
  os << "{";
  rep(i, v.size()) { if(i) os << ", "; os << v[i]; }
  return os << "}";
}
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  int N;
  cin >> N;
  cout << (N-1)/2 << endl;
  return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

// constexpr double EPS = 1e-10;
//constexpr double PI  = acos(-1.0);
//constexpr int INF = INT_MAX;
// constexpr int MOD = 1'000'000'007;
//inline void modAdd(LL &l, LL &r) {l = (l + r) % MOD;}

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

void solve() {
    int h,w,k;
    cin >> h >> w >> k;
    vector<vector<char>> c(h,vector<char>(w));
    REP(i,0,h) REP(j,0,w) cin >> c[i][j];
    int cnt = 0;
    REP(p,0,1<<h) REP(q,0,1<<w) {
        int sum = 0;
        REP(i,0,h) REP(j,0,w) {
            if (p&(1<<i)) continue;
            if (q&(1<<j)) continue;
            sum += c[i][j] == '#';
        }

        cnt += sum == k;
    }
    cout << cnt << endl;

}

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

Measured memory_bytes: 3628
#define _USE_MATH_DEFINES
#define INF 100000000

#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>

using namespace std;

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

static const double EPS = 1e-8;

bool visited[1<<24];

class Data{
public:
	int x;
	int y;
	int r;
	int c;
	Data(int _x,int _y,int _r,int _c){
		x = _x;
		y = _y;
		r = _r;
		c = _c;
	}
};



bool check(const vector<Data>& d,int a,int b,int visited){
	//true then erase
	if(d[a].c != d[b].c) return false;
	for(int i=0;i<a;i++){
		if(visited & (1<<i)) continue;
		if((d[a].x-d[i].x)*(d[a].x-d[i].x)+(d[a].y-d[i].y)*(d[a].y-d[i].y) < (d[a].r + d[i].r)*(d[a].r + d[i].r)) return false;
	}
	for(int i=0;i<b;i++){
		if(visited & (1<<i)) continue;
		if((d[b].x-d[i].x)*(d[b].x-d[i].x)+(d[b].y-d[i].y)*(d[b].y-d[i].y) < (d[b].r + d[i].r)*(d[b].r + d[i].r)) return false;
	}

	return true;
}

void dfs(const vector<Data>& nodes,int got){
	visited[got] = true;

	for(int i=0;i<nodes.size();i++){
		for(int j=i+1;j<nodes.size();j++){
			if(got & (1<<i) || got & (1<<j)) continue;
			if(check(nodes,i,j,got)){
				int tmp = got;
				tmp |= (1<<i);
				tmp |= (1<<j);

				if(visited[tmp]) continue;
				dfs(nodes,tmp);
			}
		}
	}
}

int main(){
	int n;
	while(~scanf("%d",&n)){
		if(n==0) break;
		memset(visited,0,sizeof(visited));

		int x,y,r,c;
		vector<Data> nodes; 
		for(int i=0;i<n;i++){
			scanf("%d %d %d %d",&x,&y,&r,&c);
			nodes.push_back(Data(x,y,r,c));
		}

		dfs(nodes,0);

		int res = 0;
		for(int S=(1<<n)-1;S>=0;S--){
			if(visited[S]){
				int tmp=0;
				for(int i=0;i<n;i++) tmp += (bool)((1<<i) & S);
				res = max(tmp,res);
			}
		}
		printf("%d\n",res);
	}
}

Measured memory_bytes: 16000
#include "bits/stdc++.h"
#define all(x) (x).begin(), (x).end()

using namespace std;

const int MSIZE = 3003;
const long long mod = 1e9 + 7;

long long dp[MSIZE][MSIZE];
long long pref[MSIZE];

long long Sum(int l, int r) {
    return (mod + pref[r] - (l ? pref[l - 1] : 0LL)) % mod;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    string s;
    cin >> s;
    
    for (int i = 0; i < n; i++) {
        dp[0][i] = 1;
    }
    

    for (int i = 1; i < n; i++) {
        memcpy(pref, dp[i - 1], sizeof pref);
        for (int j = 1; j < n; j++) {
            pref[j] += pref[j - 1];
            pref[j] %= mod;
        }

        if (s[i - 1] == '<') {
            for (int j = 0; j < n - i; j++) {
                dp[i][j] = Sum(0, j);
            }
        } else {
            for (int j = 0; j < n - i; j++) {
                if (n - i - j - 1 >= 0) dp[i][n - i - j - 1] = Sum(n - i - j, n - i);
            }
        }
    }
    cout << dp[n - 1][0] << endl;
}

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

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

int main() {
    int a, b; cin >> a >> b;
    int h = 0;
    rep(i, b-a) h += i+1;
    cout << h-b << endl;
    return 0;
}


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

int main() {
  string S,T;
  cin>>S>>T;
  
  int N=S.size();
  
  
  for(int i=0;i<N;i++){
   
    if(S.at(i)!=T.at(i)){
      
      cout<<"No"<<endl;
    break;}
    
     else if((i==N-1)&&(S.at(N-1)==T.at(N-1))){
      
      cout<<"Yes"<<endl;}}
    
    
    
}





Measured memory_bytes: 3592
#include <stdio.h>
 
int main()
{
    int x,y;
    while(1){
        scanf("%d %d", &x, &y);
        if(x==0&&y==0){
            break;
        }
        if(x<y){
            printf("%d %d\n", x, y);
        }
        else{
            printf("%d %d\n", y, x);
        }
    }
    return 0;
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep2(i, a, n) for(ll i = a; i < (ll)(n); i++)
#define memi cout << endl
#define kono(n) cout << fixed << setprecision(n)
#define all(c) (c).begin(), (c).end()
#define pb push_back
#define hina cout << ' '
#define in(n) cin >> n
#define in2(n, m) cin >> n >> m
#define in3(n, m, l) cin >> n >> m >> l
#define out(n) cout << n
const ll mei = (ll)1e9 + 7;

int main(){
  ll a, b, c, d;
  in3(a, b, c);
  if(a > 0)
    d = (a - 1) / c;
  else
    d = -1;
  out(b / c - d);
  memi;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>

int h, w;
std::vector<std::string> map;
std::vector<std::vector<long long>> label;
std::vector<long long> numBlack;
std::vector<long long> numWhite;
long long ans=0;

void dfs(int y, int x, int l){
	if(map[y][x]=='#')
		numBlack[l]++;
	if(map[y][x]=='.')
		numWhite[l]++;

	if(y+1< h){
		if(map[y][x]!= map[y+1][x] && label[y+1][x]==-1){
			label[y+1][x]=l;
			dfs(y+1, x,  l);
		}
	}
	if(y-1>= 0){
		if(map[y][x]!= map[y-1][x] && label[y-1][x]==-1){
			label[y-1][x]= l;
			dfs(y-1, x, l);
		}
	}
	if(x+1< w){
		if(map[y][x]!= map[y][x+1] && label[y][x+1]==-1){			
			label[y][x+1]= l;
			dfs(y, x+1, l);
		}
	}
	if(x-1>= 0){
		if(map[y][x]!= map[y][x-1] && label[y][x-1]==-1){
			label[y][x-1]= l;
			dfs(y, x-1, l);
		}
	}
}

int main(){

	std::cin>>h>>w;
	map.resize(h);
	label.resize(h);

	for(int i=0; i<h; i++)
		label[i].resize(w, -1);

	for(int i=0; i<h; i++)
		std::cin>>map[i];

	long long curL=0;
	for(int i=0; i<h; i++){
		for(int j=0; j<w; j++){
			if(label[i][j]==-1){
				numBlack.push_back(0);
				numWhite.push_back(0);

				label[i][j]=curL;
				dfs(i, j, curL);
				curL++;
			}

		}

	}

	for(int i=0; i<curL; i++)
		ans+= numWhite[i]* numBlack[i];
	
	std::cout<<ans<<std::endl;

	return 0;
	
	
}


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

void paint(bool &b, bool &nb, char a, char nex) {
    b |= a == '.';
    nb |= nex == '.';

    if (a == nex)
        b = nb = true;
}

int main() {
    int h, w;
    cin >> h >> w;
    string s[h];
    for (int i = 0; i < h; i++)
        cin >> s[i];

    bool can[h][w];
    for (int i = 0; i < h; i++)
        fill(can[i], can[i] + w, false);

    for (int i = 0; i < h; i++) {
        for (int j = 1; j < w; j++) {
            paint(can[i][j - 1], can[i][j], s[i][j - 1], s[i][j]);
        }
    }
    for (int j = 0; j < w; j++) {
        for (int i = 1; i < h; i++) {
            paint(can[i - 1][j], can[i][j], s[i - 1][j], s[i][j]);
        }
    }

    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (!can[i][j]) {
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}


Measured memory_bytes: 764
#include <stdio.h>

int main() {
  long long  n,a,min,Max,c,b,i;
  c = 0;
  min = 100000000;
  Max =-100000000;
  scanf("%lld",&n);

  for(i=1; i<=n; i++){
    scanf("%lld",&a);
    if(a > Max) {
      Max = a;
    } 
    if(a < min){
      min = a;
    }
    c = c+a;
  }
    printf("%lld %lld %lld\n",min,Max,c);

  return 0;
}


Measured memory_bytes: 2064
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repr(i,n) for(int i = (int)(n); i >= 0; i--)
#define all(v) v.begin(),v.end()
typedef long long ll;

int main(){
    ll N,T;
    cin >> N >> T;
    vector<ll> vec(N);
    rep(i,N){
        cin >> vec[i];
    }
    ll ans = 0;
    rep(i,N - 1){
        if (vec[i + 1] - vec[i] < T){
            ans += (vec[i + 1] - vec[i]);
        }
        else{
            ans += T;
        }
    }
    ans += T;
    cout << ans << endl;
}


Measured memory_bytes: 1792
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

#define int long long
#define rep(i,n) for(int i = 0; i < (n); i++)
#define INF ((long long)1e18)
#define endl "\n"

#define yn(f) ((f)?"Yes":"No")
#define YN(f) ((f)?"YES":"NO")

#define MAX

long long MOD;

template<typename type>
vector<vector<type>> product(vector<vector<type>> &a, vector<vector<type>> &b){
	vector<vector<type>> res(a.size(),vector<type>(b[0].size(),0));
	
	
	for(int i = 0; i < a.size(); i++){
		for(int j = 0; j < b[0].size(); j++){
			for(int k = 0; k < b.size(); k++){ 
				res[i][j] += a[i][k]*b[k][j];
				res[i][j] %= MOD;
			}
		}
	}
	
	return res;
}

template<typename type>
vector<vector<type>> matrix_power(vector<vector<type>> matrix, long long n){
	vector<vector<type>> res(matrix.size(), vector<type>(matrix.size(),0));
	
	for(int i = 0; i < matrix.size(); i++) res[i][i] = 1;
	
	for( ; n > 0; n >>= 1){
		if(n&1) res = product(res,matrix);
		matrix = product(matrix,matrix);
	}
	
	return res;
}

int check(int num){
	int con = 0;
	while(num) con++, num /= 10;
	
	return con;
}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	vector<vector<int>> ans(3,vector<int>(1,0));
	long long L, A, B;
	int b = -1;
	
	cin>>L>>A>>B>>MOD;
	
	ans[0][0] = 0;
	ans[1][0] = A;
	ans[2][0] = 1;
	
	for(int i = 1, power = 10; i <= 18; i++, power *= 10){
		vector<vector<int>> matrix(3,vector<int>(3,0));
		int d = 0;
		int m = 0, l = 0, h = L;
		
		while(l + 1 < h){ 
			int m = (l + h)/2;
			if(check(A + m*B) > i){
				h = m;
			} else {
				l = m;
			}
		}
		
		if(check(A + l*B) < i) continue;
		d = l - b;
		b = l;
		
		matrix[0][0] = power%MOD;
		matrix[0][1] = matrix[1][1] = matrix[2][2] = 1;
		matrix[1][2] = B;
		
		matrix = matrix_power(matrix, d);
		ans = product(matrix, ans);
	}
	
	cout<<ans[0][0]<<endl;
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <cmath>
#include <fstream>

using namespace std;

typedef long long ll;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int n;
    cin >> n;
    int t = floor(log2(n));
    int cur = 1;
    for (int i = 0; i < t; i++) {
        cur *= 2;
    }
    cout << cur << endl;
}


Measured memory_bytes: 512
import java.util.*;
public class Main 
{
	public static void main(String[] args) 
	{
		Scanner stdIn = new Scanner(System.in);
		int a = stdIn.nextInt();
		int b = stdIn.nextInt();
		int c = stdIn.nextInt();
		int d = stdIn.nextInt();
		int sum = a + b + c + d;
		System.out.println(sum / 60);
		System.out.println(sum % 60);
	}
}

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

using namespace std;

#define FOR(i,s,e) for(int i=(s);(i)<(int)(e);(i)++)
#define REP(i,e) FOR(i,0,e)
#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp make_pair
#define mt make_tuple
#define t0(t) get<0>((t))
#define t1(t) get<1>((t))
#define t2(t) get<2>((t))

typedef long long ll;
const int N = 1e5;
const ll INF = 1e15;
int n;
ll a[N], dp[N][2];

int main() {
  scanf("%d ", &n);
  REP(i,n) scanf("%lld ", a+i);
  REP(i,n) REP(j,2) dp[i][j] = -INF;
  dp[1][0] = a[0] + a[1]; dp[1][1] = -dp[1][0];
  FOR(i,2,n) REP(j,2) REP(k,2) {
    if (k) {
      ll x = (j ? a[i-1]*2 : -a[i-1]*2) - a[i];
      dp[i][k] = max(dp[i][k], dp[i-1][j] + x);
    } else 
      dp[i][k] = max(dp[i][k], dp[i-1][j] + a[i]);
  }
  printf("%lld\n", max(dp[n-1][0],dp[n-1][1]));
  return 0;
}

Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
int main()
{
          long long n,d,c=0,a,b;
          cin>>n>>d;
          for(int i=0;i<n;i++)
          {
                    cin>>a>>b;
                    if(a*a+b*b<=d*d)
                              c++;
          }
          cout<<c;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define ll long long
#define MAX_N 51
#define P pair<int,int>
using namespace std;

// uからの辺の色
// u-v の色は1~G[u].size()+1
// ただし、uと一致するなら+1
// 辺u,vの色を記録

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    int n;
    cin>>n;
    vector<vector<int>> G(n);
    vector<P> e;
    for(int i = 0; i<(n-1); i++){
        int a,b;
        cin>>a>>b;
        a--;b--;
        G[a].push_back(b);
        G[b].push_back(a);
        e.push_back( make_pair(a,b));
    } 
    vector<int> u_color(n,0);
    vector<int> visited(n,0);
    map<P,int> edge_color;
    int k=0;

    queue<int> que;
    que.push(0);
    visited[0] = 1;
    while(!que.empty()){
        int u = que.front(); que.pop();
        int cur = 1;

        if(G[u].size() > k) k = G[u].size();

        for(int j = 0; j<G[u].size(); j++){
            int v = G[u][j];
            if(visited[v]) continue;
            if(u_color[u] == cur) cur++;
            edge_color[make_pair(u,v)] = edge_color[make_pair(v,u)]  = u_color[v] = cur++;

            visited[v] = 1;
            que.push(v);
        }
    }
    cout<< k <<endl;
    for(int i =0; i<(n-1); i++){
        int ans = edge_color[e[i]];
        cout<< ans <<endl;
    }
    return 0;
}


Measured memory_bytes: 20088
A,B,C,D,E,F = map(int,input().split())

MAX_SUGER = E*F/(E+100)


water = [min(A,B)*100,max(A,B)*100]
for i in range(1,300):
    for j in range(1,300):
        water.append(100*A*i+100*B*j)
water = sorted(list(set(water)))

suger = []
for i in range(1000):
    for j in range(1000):
        if C*i + D*j <= MAX_SUGER:
            suger.append(C*i+D*j)
suger = sorted(list(set(suger)))

ans = []
for s in suger:
    min_water = 100*s/E
    for w in water:
        if w >= min_water:
            ans.append([s/(w+s),w+s,s])
            break
ans.sort(reverse=True)
for c,w,s in ans:
    if w <= F:
        print(w,s)
        break

Measured memory_bytes: 7256
#include <iostream>
using namespace std;
int main(void){
    int a,b;
    cin>>a>>b;
    if((a+b)%2==0){
    cout<<(a+b)/2<<endl;
    }
    else{
        cout<<(a+b)/2+1<<endl;
    }
    return 0;
    // Your code here!
    
}


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

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

    char cbuff='a';
    rep(i,26) {
        cbuff='a'+i;
        string::size_type pos=s.find(cbuff);
        if (pos==string::npos) {
            cout << cbuff << endl;
            return 0;
        }
    }

    cout << "None" << endl;
    return 0;
}

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

int main(){
    int n;
    cin >> n;
    int max_n = -1;
    int sum = 0;
    for(int i=0;i<n;i++){
        int l;
        cin >> l;
        sum += l;
        max_n = max(max_n,l);
    }
    if(max_n < (sum-max_n)){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define all(x) (x).begin(), (x).end()
using ll = long long;
using namespace std;
template <typename T> using vec = std::vector<T>;

const ll MOD = 1000000007;

struct mint {
    ll x;
    mint(ll 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 / 2);
        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;
    }
};

ostream &operator<<(ostream &os, const mint &a) {
    return os << a.x;
}

int main() {
    ll N, K;
    cin >> N >> K;

    vec<ll> A(N);
    rep(i, N) cin >> A[i];
    sort(all(A), greater<ll>());

    mint ans = 1;
    ll l = 0, r = N - 1;
    if (K % 2 == 1) ans *= A[0], l = 1;

    rep(_, K / 2) {
        if (A[l] * A[l + 1] > A[r] * A[r - 1]) {
            ans *= A[l] * A[l + 1];
            l += 2;
        } else {
            ans *= A[r] * A[r - 1];
            r -= 2;
        }
    }

    if(K % 2 == 1 && A[0] < 0) {
        ans = 1;
        rep(i,K) ans*=A[i];
    }

    cout << ans << endl;
}


Measured memory_bytes: 4836
/*
* Filename:    aoj0121.cpp
* Desciption:  Desciption
* Created:     2016-03-07
* Author:      JIngwei Xu [mail:xu_jingwei@outlook.com]
*
*/
#include<iostream>
#include<stdio.h>
#include<algorithm>
#include<cstring>
#include<map>
#include<queue>
#define INT_MAX 1<<30
using namespace std;
//typedef long long ll;
const int INF=0x7F;
int dx[5]={1,0,0,-1,0},dy[5]={0,1,-1,0,0};
map<string,int> dp;
void bfs(){
	queue<string> que;
	que.push("01234567");
	dp["01234567"]=0;
	while (!que.empty())
	{
		string get=que.front();que.pop();
		int cr=0;
		for (int i = 0; i < 8; i += 1)
		{
			if(get[i]=='0'){
				cr=i;
				break;
			}
		}
		int cx=cr/4,cy=cr%4;
		for (int i = 0; i < 4; i += 1)
		{
			int px=cx+dx[i],py=cy+dy[i];
			if(px<0||py<0||px>1||py>3)continue;
			int pr=4*px+py;
			string ps=get;
			swap(ps[cr],ps[pr]);
			if(dp.find(ps)==dp.end()){
				dp[ps]=dp[get]+1;
				que.push(ps);
			}
		}
	}
}
char str[10];
int main()
{
	bfs();
	bool vvv=false;
	while (1)
	{
		for (int i = 0; i < 8; i += 1)
		{
			if (scanf("%s",&str[i])==EOF){vvv=true;break;}
		}
		if(vvv)break;
		printf("%d\n",dp[str]);
//		printf("%d\n",dp["10234567"]);
		
	}
	return 0;
}

Measured memory_bytes: 3452
#input of int(split by space)
def get_i()
  return gets.chomp.split(" ").map(&:to_i)
end
#input of float(split by space)
def get_f()
  return gets.chomp.split(" ").map(&:to_f)
end
#input of string(split by space)
def get()
  return gets.chomp.split(" ")
end
#input of string(split per one character)
def get_nsp()
  return gets.chomp.split("")
end
#yes or no decision
def yn_judge(bool,y="Yes",n="No")
  return bool ? y : n 
end
#create of array
def array(size1,init=nil,size2=-1)
  if size2==-1
      return Array.new(size1){init}
  else
      return Array.new(size2){Array.new(size1){init}}
  end
end

def max(a,b)
    return a>b ? a : b
end

def min(a,b)
    return a>b ? b : a
end

INF=Float::INFINITY

N=gets.to_i
ans=array(1000**2+1,0)
1.upto(100) do|x|
    1.upto(100) do|y|
        1.upto(100) do|z|
            ans[x**2+y**2+z**2+x*y+y*z+z*x]+=1 
        end
    end
end
res=0
1.upto(N) do|i|
  puts ans[i]
end

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

int main(){
  int S;
  cin >> S;
  int UP = S/100;
  int DN = S - UP*100;
  bool UP_possible = false;
  bool DN_possible = false;
  if(0<UP && UP<13){
    UP_possible = true;
  }
  if(0<DN && DN<13){
    DN_possible = true;
  }
  if(UP_possible && DN_possible){
    cout << "AMBIGUOUS" << endl;
  }else if(UP_possible){
    cout << "MMYY" << endl;
  }else if(DN_possible){
    cout << "YYMM" << endl;
  }else{
    cout << "NA" << endl;
  }
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.IO.Pipes;

namespace cswork
{
    class Program
    {
        class Scanner
        {
            string[] s;
            int i;

            char[] cs = new char[] { ' ' };

            public Scanner()
            {
                s = new string[0];
                i = 0;
            }

            public string next()
            {
                if (i < s.Length) return s[i++];
                string st = Console.ReadLine();
                while (st == "") st = Console.ReadLine();

                s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
                i = 0;
                return next();
            }

            public int nextInt()
            {
                return int.Parse(next());
            }

            public long nextLong()
            {
                return long.Parse(next());
            }

            public double nextDouble()
            {
                return double.Parse(next());
            }
        }

        public Program() { }

        static void Main(string[] args)
        {
            new Program().Omame();
        }

        Scanner cin;
        const int MAXIN = 1024;
        bool[] used = new bool[MAXIN];
        int[] perm = new int[MAXIN];

        List<int[]> permList = new List<int[]>();

        public void Permutation(int pos, int n, int length)
        {
            if (pos == n)
            {
                permList.Add((int[])perm.Clone());
            }

            for (int i = 0; i < n; i++)
            {
                if (!used[i])
                {
                    perm[pos] = i;
                    used[i] = true;
                    Permutation(pos + 1, n, length);
                    used[i] = false;
                }
            }
        }

        void Omame()
        {
            cin = new Scanner();
            long a = cin.nextLong();
            long b = cin.nextLong();
            long c = cin.nextLong();

            if (c - a - b < 0)
            {
                Console.WriteLine("No");
            }
            else
            {
                if (4 * a * b < (c - a - b) * (c - a - b))
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }

        }

        long Choose(long n)
        {
            return n * (n - 1) / 2;
        }

    }
}


Measured memory_bytes: 13268
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleTest
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var from = Console.ReadLine().Split().Select(int.Parse).ToArray();
            Console.ReadLine();
            var targets = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var max = targets.Max();

            var IsCompleted = new bool[targets.Length];

            IsComputable(targets, from, 0, 0, max, ref IsCompleted);
            foreach(var v in IsCompleted)
            {
                Console.WriteLine(v ? "yes" : "no");
            }
        }

        private static void IsComputable(int[] targets, int[] from, int beginIndex, int nowSum, int max, ref bool[] IsCompleted)
        {
            if (beginIndex >= from.Length) return;

            var nextSum = nowSum + from[beginIndex];

            if (nextSum <= max)
            {
                for (var k = 0; k < targets.Length; ++k)
                    if (targets[k] == nextSum) IsCompleted[k] = true;
                IsComputable(targets, from, beginIndex + 1, nextSum, max, ref IsCompleted);
            }
            IsComputable(targets, from, beginIndex + 1, nowSum, max, ref IsCompleted);
        }
    }
}



Measured memory_bytes: 18376
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG //これつけるとA[N]でもいいらしい
//for文のマクロ
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
bool tasai(string s,int l){
    //int l = s.length();
    //cout<<l<<endl;
    map<char,int> p;
    rep(i,l){
        p[s[i]]++;
        if(p[s[i]]>=2){
            return false;
        }
    }
    return true;
}
int main(){
    string s;
    cin>>s;
    if(s=="zyxwvutsrqponmlkjihgfedcba"){
        cout<<-1<<endl;
        return 0;
    }
    int n=s.length();
    map<char,int> p;
    rep(i,n){
        //s[i] = s[i]+1; これでabcd順に進められる
        p[s[i]]++;
    }
    if(n<=25){
    rep(i,26){
        if(p['a'+i]==0){
            s[n] = 'a'+i;
            //cout<<s[n]<<endl;
            break;
        }
    }
    cout<<s+s[n]<<endl;
    }
    else{
        int j=0;
        s[n-1]=s[n-1]+1;
        while(1){
            bool Tasai=false;
            for(int i=0;i<=26;i++){
                if(i>=1){
                s[n-1-j] = s[n-1-j]+1;
                }
                if(s[n-1-j]>'z'){
                    s[n-1-j]='\0';
                   // cout<<"next"<<endl;
                    break;
                }
                if(tasai(s,26-j)){
                    Tasai = true;
                   // cout<<"GET"<<endl;
                    break;
                }
                //cout<<s<<endl;
            }
            if(Tasai){
                break;
            }
            j++;
            //cout<<s<<endl;
            s[n-1-j] = s[n-1-j]+1;
        }
        rep(i,26-j){
        cout<<s[i];
        }
        cout<<endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1000000007;
const ld PI = acos(-1);  
const ld EPS = 0.0000000001;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define rep(i, n) for(ll i=0; i<(ll)(n); i++)
#define repd(i, n) for(ll i=n-1; 0<=i; i--)
#define FOR(i, a, b) for(ll i=a; i<(ll)(b); i++)
#define FORD(i, a, b) for(ll i=b-1; (ll)(a)<=i; i--)
#define ALL(x) x.begin(), x.end()
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};



int main(){
    ll k;   cin >> k;
    vector<ll> a(k);
    a[0] = 7%k;
    rep(i, k-1) a[i+1] = (a[i]*10+7)%k;
    rep(i, k){
        if(a[i]==0){
            cout << i+1 << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}


Measured memory_bytes: 11096
//测试标程是否能过，绝无抄袭之意

#include <bits/stdc++.h>
using namespace std;
 
int h, w;
char s[12][13];
string ss[12];
int a[12];
int b[12];
 
void dfs1(int x, bool f) {
    if (x == w) {
        puts("YES");
        exit(0);
    } else if (b[x] != -1) {
        dfs1(x + 1, f);
    } else {
        int i, j;
        
        for (i = x + 1; i < w; i++) {
            if (b[i] != -1) continue;
            
            for (j = 0; j < h; j++) {
                if (s[j][x] != s[a[j]][i]) break;
            }
            
            if (j == h) {
                b[x] = i;
                b[i] = x;
                
                dfs1(x + 1, f);
                
                b[x] = b[i] = -1;
            }
        }
        
        if (!f) {
            for (j = 0; j < h; j++) {
                if (s[j][x] != s[a[j]][x]) break;
            }
            
            if (j == h) {
                b[x] = x;
                
                dfs1(x + 1, true);
                
                b[x] = -1;
            }
        }
    }
}
 
void dfs2(int x, bool f) {
    if (x == h) {
        dfs1(0, w % 2 == 0);
    } else if (a[x] != -1) {
        dfs2(x + 1, f);
    } else {
        int i;
        
        for (i = x + 1; i < h; i++) {
            if (a[i] != -1) continue;
            if (ss[x] != ss[i]) continue;
            
            a[x] = i;
            a[i] = x;
            
            dfs2(x + 1, f);
            
            a[x] = a[i] = -1;
        }
        
        if (!f) {
            a[x] = x;
            
            dfs2(x + 1, true);
            
            a[x] = -1;
        }
    }
}
 
int main() {
    int i;
    
    scanf("%d %d", &h, &w);
    
    for (i = 0; i < h; i++) scanf("%s", s[i]);
    
    for (i = 0; i < h; i++) {
        ss[i] = s[i];
        sort(ss[i].begin(), ss[i].end());
    }
    
    for (i = 0; i < h; i++) a[i] = -1;
    for (i = 0; i < w; i++) b[i] = -1;
    
    dfs2(0, h % 2 == 0);
    
    puts("NO");
    
    return 0;
}

Measured memory_bytes: 256