akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef pair<ll, ll> PP;
#define rep(i, n) for (ll i = 0; i < ll(n); i++)
#define all(v) v.begin(), v.end()
#define inputv(v, n)    \
    vl v;               \
    rep(i, n)           \
    {                   \
        ll x;           \
        cin >> x;       \
        v.push_back(x); \
    }
const ll INF = 999999999999999;
const ll MOD = 1000000007;
ll a, b, c, d, e, f, p, t, x, y, z, q, m, n, r, h, k, w, l, ans = 0;
#include <cstdint>

template <std::uint_fast64_t Modulus>
class modint
{
    using u64 = std::uint_fast64_t;

public:
    u64 a;

    constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
    constexpr u64 &value() noexcept { return a; }
    constexpr const u64 &value() const noexcept { return a; }
    constexpr modint operator+(const modint rhs) const noexcept
    {
        return modint(*this) += rhs;
    }
    constexpr modint operator-(const modint rhs) const noexcept
    {
        return modint(*this) -= rhs;
    }
    constexpr modint operator*(const modint rhs) const noexcept
    {
        return modint(*this) *= rhs;
    }
    constexpr modint operator/(const modint rhs) const noexcept
    {
        return modint(*this) /= rhs;
    }
    constexpr modint &operator+=(const modint rhs) noexcept
    {
        a += rhs.a;
        if (a >= Modulus)
        {
            a -= Modulus;
        }
        return *this;
    }
    constexpr modint &operator-=(const modint rhs) noexcept
    {
        if (a < rhs.a)
        {
            a += Modulus;
        }
        a -= rhs.a;
        return *this;
    }
    constexpr modint &operator*=(const modint rhs) noexcept
    {
        a = a * rhs.a % Modulus;
        return *this;
    }
    constexpr modint &operator/=(modint rhs) noexcept
    {
        u64 exp = Modulus - 2;
        while (exp)
        {
            if (exp % 2)
            {
                *this *= rhs;
            }
            rhs *= rhs;
            exp /= 2;
        }
        return *this;
    }
};
int main()
{
    using mint = modint<MOD>;
    cin>>n;
    inputv(A,n);
    sort(all(A));
reverse(all(A));
    vector<mint> B(n);
    rep(i,n){
        B[i].a=A[i];
    }

    mint K=0;
    vector<mint> beki,kaijo;

    beki.push_back(1);
    kaijo.push_back(1);
    rep(i,n){
        beki.push_back(beki.back()*2);
        kaijo.push_back(kaijo.back()*(i+1));
    }

    mint a=0;
    for(ll i=n-1;i>-1;i--){
        a=beki[n-1]+beki[n-1]/2*i;
        K+=a*B[i];
    }
K=K*beki[n];

    cout<<K.a<<endl;
}


Measured memory_bytes: 8304
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;

alias sread = () => readln.chomp();
alias Point2 = Tuple!(long, "y", long, "x");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void minAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) min(dst, src);
}

void maxAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) max(dst, src);
}

void main()
{
    long A, B;
    scan(A, B);
    bool b = (A * B) % 2 == 0;
    writeln(!b ? "Odd" : "Even");
}


Measured memory_bytes: 256
import copy
N=int(input())
A=[int(input()) for _ in range(N)]

a=max(A)
k=A.count(a)#リストの最大数の個数をカウント
if k>=2:
  for i in range(N):
    print(a)
else:
  b=A.index(a)
  for i in range(N):
    if i != b:
      print(a)
    else:
      s=sorted(A)
      print(s[N-2])

Measured memory_bytes: 14800
import static java.util.Arrays.deepToString;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		new Main().run();
	}
	void tr(Object... os) {
		System.err.println(deepToString(os));
	}

	Scanner sc = new Scanner(System.in);
	public void run() {
		final int SIZE = 1000000 + 10;
		
		boolean[] is = new boolean[SIZE];
		is[1] = true;
		int[] count = new int[SIZE];
		for (int i = 1; i < SIZE; i++) {
			if (is[i]) {
				if (i * 2 < SIZE) is[i * 2] = true;
				if (i * 3 < SIZE) is[i * 3] = true;
				if (i * 5 < SIZE) is[i * 5] = true;
			}
			count[i] = count[i-1] + (is[i] ? 1 : 0);
		}
		
		for (;sc.hasNext();) {
			int from = sc.nextInt();
			if (from == 0) break;
			int to = sc.nextInt();
			
			int ans = count[to] - count[from-1];
			System.out.println(ans);
			
		}
	}
}

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

using namespace std;

typedef long long ll;
int kk[20];
int n,m,x;

int chec()
{
    for(int i=1; i<=m; i++)
        if(kk[i]<x) return 0;
    return 1;
}

int main()
{
    int a[20],p[20][20];
    scanf("%d%d%d",&n,&m,&x);
    for(int i=1; i<=n; i++)
    {
        scanf("%d",&a[i]);
        for(int j=1; j<=m; j++)
        {
            scanf("%d",&p[i][j]);
        }
    }
    int ans=9999999;
    for(int i=1; i<(1<<n); i++)
    {
        int sum=0;
        memset(kk,0,sizeof (kk));
        int zz=i;
        for(int j=0; j<n; j++)
        {
            if(zz&1){
                sum+=a[j+1];
                for(int r=1; r<=m; r++)
                    kk[r]+=p[j+1][r];
            }
            zz>>=1;
        }
        if(chec()){
           // cout<<sum<<endl;
            ans=min(ans,sum);
        }
    }
    if(ans!=9999999)
        printf("%d\n",ans);
    else printf("-1");
    return 0;
}


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

    int id,sub;
    cin>>id>>sub;
    map<int,int>done,wa;
    int ans=0,ans2=0;
    while(sub--)
    {
        int idd;
        string s;
        cin>>idd>>s;
        if(s=="AC")
        {
            if(done[idd]==0)
            {
                ans++;
                ans2+=wa[idd];
                done[idd]++;
            }
        }
        else
        {
            if(done[idd]==0)
            {
                wa[idd]++;
            }
        }
    }
    cout<<ans<<' '<<ans2<<endl;
    return 0;
}


Measured memory_bytes: 9600
#include<iostream>
#include <stdio.h>
using namespace std;
 
int main(){
	while(1){
		int x;
		int y;
    cin >> x >> y;
    if ( x == 0 && y == 0 ) break;
	if ( x < y){
    cout << x<<" "<< y <<endl;
} else {
    cout << y<<" "<<x <<endl;
}
}
    return 0;
}


Measured memory_bytes: 1156
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double lb;
#define REP(i,j,n) for (int i=j;i<(n);i++)
#define RREP(i,n) for (int i = n; 0<i;i--)
#define print(out) cout<< out  << "\n";
#define mod 1000000007
const ll INF = 1e16;
using P=pair<ll,ll>;
//vector<vector<ll>> visited(1000000,vector(1000000)<ll>);

int main(){
  ll N,a,b,ans=INF;cin>>N;
  for(ll a=1;a<=sqrt(N);a++){
    if(N%a!=0)continue;
    b=N/a;
    ans=min(ans,(a+b-2));
  }
  print(ans)

  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;

ll mod(ll a, ll b){
  ll ret=a%b;
  if(ret<0) ret+=b;
  return ret;
}

ll modpow(ll a,ll b,ll c){
  ll res=1;
  while(b>0){
    if(b&1) res=mod(res*a,c);
    a=mod(a*a,c);
    b>>=1;
  }
  return res;
}

int main() {
  int n;
  cin>>n;
  int sum=0,l[n];
  for(int i=0;i<n;i++){
    cin>>l[i];
    sum+=l[i];
  }
  for(int i=0;i<n;i++){
    if(sum-2*l[i]<=0){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}


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

using ll = int_fast64_t;
#define rep(i,n) for(int i=0;i<int(n);++i)
#define repr(i,n) for(int i{n};i-->0;)

signed main(){

  int h,w;
  cin>>h>>w;
  vector a(h,vector(w,0));
  vector b(h,vector(w,0));
  rep(i,h)rep(j,w)cin>>a[i][j];
  rep(i,h)rep(j,w)cin>>b[i][j];

  vector c(h,vector(w,0));
  rep(i,h)rep(j,w)c[i][j] = abs(a[i][j]-b[i][j]);

  constexpr int dmax = 80;
  constexpr int szmax = 80;
  constexpr int mvmax = szmax*2;
  constexpr int offset = dmax*mvmax + 1;
  using vecbool = bitset<offset*2+1>;

  vector dp (h+1,vector<vecbool>(w+1));
  dp[0][0].set(offset);
  rep(i,h)rep(j,w){
    vecbool mv = dp[i][j]<<c[i][j] | dp[i][j]>>c[i][j];
    dp[i+1][j] |= mv;
    dp[i+1][j] |= mv;
    dp[i][j+1] |= mv;
    dp[i][j+1] |= mv;
  }

  vecbool reachable = dp[h-1][w]|dp[h][w-1];
  int ans = offset;
  rep(i,offset*2)
    if(reachable[i])
      ans = min(ans,abs(i-offset));
  cout<<(ans)<<endl;
    

}

Measured memory_bytes: 24328
k,n = map(int, input().split())
a = list(map(int, input().split()))

m = 0
for i in range(n):
    if i != n-1:
        b = a[i+1]-a[i]
    else:
        b = a[0]+k - a[i]
    m = max(m, b)

ans = k-m
print(ans)


Measured memory_bytes: 78796
#include <bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define ff           first
#define ss           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;

// Most important thing in CP - Have Fun :)

int h,w;

void solve(){
	//write here
    cin>>h>>w;
    vector<vector<char>>arr(h,vector<char>(w));
    rep(i,0,h){
        rep(j,0,w)cin>>arr[i][j];
    }
    vector<vector<int>>ans(h,vector<int>(w,0));
    ans[0][0] = 1;
    for (int i = 1 ; i<w ; i++){
        if (arr[0][i] == '#')ans[0][i] = 0;
        else ans[0][i] = ans[0][i-1];
    }
    for (int i = 1 ; i<h ; i++){
        if (arr[i][0] == '#')ans[i][0] = 0;
        else ans[i][0] = ans[i-1][0];
    }
    for (int i = 1; i<h ; i++){
        for (int j = 1 ; j<w ; j++){
            if (arr[i][j] == '#')ans[i][j] = 0;
            else ans[i][j] = (ans[i-1][j] + ans[i][j-1])%hell;
        }
    }
    cout<<ans[h-1][w-1]<<endl;
    
}

int main(){
	cin.tie(NULL);
	ios::sync_with_stdio(false);
	//insert code
	
		solve();
	return 0;
}

Measured memory_bytes: 8204
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????

		Scanner n = new Scanner(System.in);
        int a = n.nextInt();
        int b = n.nextInt();
        if ( a > b ) System.out.println("a > b");
        if ( a < b ) System.out.println("a < b");
        if ( a == b ) System.out.println("a == b");
    }
 
}

Measured memory_bytes: 26200
#include <bits/stdc++.h>
using namespace std; 
string s;
int main() { 
    //freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin>>s;
	int cnt=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='x')cnt++;
	}
	if(cnt>=8)cout<<"NO"<<endl;
	else cout<<"YES"<<endl;
    return 0; 
}

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

using namespace std;
int main() {
    long long N,K;
    cin >> N >> K;
    vector<long long> turnPoint(0);
    string S;
    cin >> S;
    turnPoint.push_back(0);
    for(int i = 1; i < N; i++){
        if(S[i - 1] != S[i]){
            //TurnPointとして登録
            turnPoint.push_back(i);
        }
    }
    turnPoint.push_back(N);
    long long M = 0;
    for(int i = 0; i < turnPoint.size(); i++){
        if(S[turnPoint[i]] == '0'){
            //反転から開始
            long long endPoint = min((long long)turnPoint.size() - 1, i + 2 * K);
            M = max(M,turnPoint[endPoint] - turnPoint[i]);
        }else{
            //順転から開始
            long long endPoint = min((long long)turnPoint.size() - 1,i + 2 * K + 1);
            M = max(M,turnPoint[endPoint] - turnPoint[i]);
        }
    }
    cout << M << endl;
}

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

int main(){
	string S; cin >> S;
	int64_t ret = 0, n = S.size();
	for(int i=0; i < 1<<n-1; ++i){
		bitset<10> bit(i);
		int64_t sum_i_pattern = 0;
		int st = 0;
		for(int j=0; j<n-1; ++j){
			if (bit.test(j)){
				sum_i_pattern += stol(S.substr(st, j + 1 - st));
				st = j + 1;
			}
		}
		if(st < n) sum_i_pattern += stol(S.substr(st, n - st));
		ret += sum_i_pattern;
	}
	cout << ret << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <map>
using namespace std;
typedef long long LL;
LL v[40]={1,2},n;
int main() {
    for(int i=2;i<=32;i+=2)
        v[i]=v[i-2]+LL(pow(2,i));
    for(int i=3;i<=32;i+=2)
        v[i]=v[i-2]+LL(pow(2,i));
    scanf("%lld",&n);
    if(n==0)
        printf("0");
    else if(n>0){
        int m=0;
        for(int i=2;i<=32;i+=2){
            if(n>v[i-2]&&v[i]>=n){
                m=i;
                break;
            }
        }
        LL sum=v[m];
        printf("1");
        for(int i=m-1;i>=0;i--){
            if(sum-LL(pow(2, i))>=n){
                sum-=LL(pow(2, i));
                if(i%2==0)
                    printf("0");
                else
                    printf("1");
            }
            else{
                if(i%2==0)
                    printf("1");
                else
                    printf("0");
            }
        }
    }
    else{
        int m=0;
        n=-n;
        for(int i=3;i<=32;i+=2){
            if(n>v[i-2]&&v[i]>=n){
                m=i;
                break;
            }
        }
        LL sum=v[m];
        printf("1");
        for(int i=m-1;i>=0;i--){
            if(sum-LL(pow(2, i))>=n){
                sum-=LL(pow(2, i));
                if(i%2==1)
                    printf("0");
                else
                    printf("1");
            }
            else{
                if(i%2==1)
                    printf("1");
                else
                    printf("0");
            }
        }
    }
    printf("\n");
    return 0;
}


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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) begin(r),end(r)
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init))
#define mp(a,b) make_pair(a,b)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

template<typename T>
void O(T t){
  cout << t << endl;
}

const ll mod = 1e9+7;
constexpr ll inf = ((1<<30)-1)*2+1 ;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;
  cin >> n;
  vector<ll> v(n);
  ll s = 0;
  rep(i,n){
    cin >> v[i];
    s += v[i];
  }
  if(s % 10 != 0){
    cout << s << endl;
    return 0;
  }
  sort(all(v));
  rep(i,n){
    s -= v[i];
    if(s % 10 != 0){
      cout << s << endl;
      return 0;
    }
    s += v[i];
  }
  cout << 0 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>  // include all standard C++ libraries

using namespace std;

// Loops
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define _rrep(i,n) rrepi(i,n,0)
#define rrepi(i,a,b) for(int i=int(a)-1;i>=int(b);--i)

#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(...) _overload3(__VA_ARGS__,rrepi,_rrep,)(__VA_ARGS__)
#define each(xi, x) for (auto&& xi : x)
// Note: we can use rep(i,N) or rep(i,from,to)


// typedef
using ll = long long;
template <class T> using vec = vector<T>;
using vi   = vector<int>;
using vvi  = vector<vi>;
using vvvi = vector<vvi>;
using pii  = pair<int, int>;


// Constants

// Shorter repr for frequently used terms
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second


// Algorithms
#define all(x) (x).begin(), (x).end()
#define uniq(v) v.erase( unique(all(v)), v.end() )
#define perm(c) sort(all(c));for(bool c##p=1;c##p;c##p=next_permutation(all(c)))

template<class T> pair<T, size_t> max(vector<T> &x){ auto it = max_element(all(x)); return mp(*it, it-x.begin()); }
template<class T> pair<T, size_t> min(vector<T> &x){ auto it = min_element(all(x)); return mp(*it, it-x.begin()); }

template<class T> inline bool chmax(T &maxval, const T &newval) { if (maxval<newval) { maxval=newval; return 1; } return 0; }
template<class T> inline bool chmin(T &minval, const T &newval) { if (minval>newval) { minval=newval; return 1; } return 0; }

// Utilities
// Grid world utilities
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
#define inside(H,W,y,x) 0<=(x) && (x)<(W) && 0<=(y) && (y)<(H)

inline int in() {int x; cin >> x; return x;} // read int from cin
inline  ll IN() {ll x; cin >> x; return x;}  // read ll from cin



// Debug
#ifdef LOCAL
  #include "dump.hpp"
  #define debug(x) cerr << #x << ": " << x << '\n'
#else
  #define dump(...)
  #define debug(x)
#endif

// Paste snippets here!!

// 

int main(){
  cin.tie(0); ios::sync_with_stdio(false);    // Magic for faster cin
  int n = in(); int k = in();
  string s; cin >> s;
  int RL = 0;
  int LR = 0;
  int LL = 0;
  int RR = 0;
  rep(i,n-1){
    if(s[i]=='R' && s[i+1]=='L') RL++;
    if(s[i]=='L' && s[i+1]=='R') LR++;
    if(s[i]=='R' && s[i+1]=='R') RR++;
    if(s[i]=='L' && s[i+1]=='L') LL++;
  }
  int ans = 2*min(k,min(RL,LR)) + RR + LL;
  // if((RL==0 || LR==0) && k>min(RL,LR)){
  //   ans += k-min(RL,LR);
  //   //ans += 1;
  // }
  if(k>min(RL,LR)){
    ans = n-1;
  }
  ans = min(ans, n-1);
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 512
import java.util.*;

//update 2020/1/1 23:01

public class Main{

  static Scanner sc = new Scanner(System.in);
  static StringBuilder sb = new StringBuilder();

  public static void main(String[] args) {

    String s = next();
    String[] ss = splitString(s);

    if( ss[2].equals(ss[3]) && ss[4].equals(ss[5]) ){
      System.out.println("Yes");
    }
    else{
      System.out.println("No");
    }


    //System.out.println();

  }

  static int lcm(int a,int b){
    return a*b*gcd(a,b);
  }

  static int gcd(int a,int b){
    if(a%b!=0){
      return gcd(b,a%b);
    }
    else{
      return b;
    }
  }

  /*
    static String toSmall(String s){
      char c = s.charAt(0);
      //if(Character.isUpperCase(c)){
      if(c<=90){
        c += 32;
      }
      return String.valueOf(c);
    }
    static String toBig(String s){
      char c = s.charAt(0);
      //if(Character.isLowerCase(c)){
      if(c>=97){
        c -= 32;
      }
      return String.valueOf(c);
    }
  */

  static String toSmall(String s){
    return s.toLowerCase();
  }

  static String toBig(String s){
    return s.toUpperCase();
  }

  static String next(){
    return sc.next();
  }

  static int nextInt(){
    return Integer.parseInt(sc.next());
  }

  static long nextLong(){
    return Long.parseLong(sc.next());
  }

  static double nextDouble(){
    return Double.parseDouble(sc.next());
  }

  static String[] splitString(String s){
    return s.split("");
  }

  static char[] splitChar(String s){
    return s.toCharArray();
  }

  static int charToInt(char a){
    return a - 48;
  }

////////////////////////////////////////////
  public static int max(int[] a){
    int lng = a.length;
    int max = a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }
  public static long max(long[] a){
    int lng = a.length;
    long max = a[0];
    for(int i=1;i<lng;i++){
      max = Math.max(max,a[i]);
    }
    return max;
  }
////////////////////////////////////////////

////////////////////////////////////////////
  public static int min(int[] a){
    int lng = a.length;
    int min = a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }
  public static long min(long[] a){
    int lng = a.length;
    long min = a[0];
    for(int i=1;i<lng;i++){
      min = Math.min(min,a[i]);
    }
    return min;
  }
////////////////////////////////////////////

}


Measured memory_bytes: 21972
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define nl '\n'
#define si(i) scanf("%d", &i)

int main() {

    float a, b;
    cin >> a >> b;
    cout << a / b << nl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define For(a,b,c) for(int a=b;a<=c;++a)
#define Dor(a,b,c) for(int a=b;a>=c;--a)
using namespace std;
int main() {
	int x,y;
	scanf("%d%d",&x,&y);
	if(x<y) puts("0");
	else puts("10");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう

#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main() {
  int n,a,b;
  cin>>n>>a>>b;
  int cnt=0;
  int cnta=0;
  char temp;
  rep(i,n){
    cin>>temp;
    if(temp=='a'&&cnt<(a+b)){cnt++;cout<<"Yes"<<endl;}
    else if(temp=='b'&&cnt<(a+b)&&cnta<b){cnt++;cnta++;cout<<"Yes"<<endl;}
    else cout<<"No"<<endl;
  }
    return 0;
}

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

#define fr(i,n) _back
#define pb	push_back
#define eb	emplace_back
#define mk	make_pair
#define fi	first
#define se	second
#define endl	'\n'

typedef long long ll;
typedef pair<int,int> ii;
typedef vector<ii> vii;
const int INF = 0x3f3f3f3f;
const double PI = acos(-1.0);
const int T = 1e5 + 10;

bool ok(ll x, const vector<ll> &v) {
    for(auto y : v) x -= x%y;
    return (x==2);
}

int main() {
    ios_base::sync_with_stdio(false);
    int k; cin >> k;
    ll ans1 = 2, ans2 = 2;
    vector<ll>v;

    for(int i = 0; i < k; i++) {
        int x; cin >> x;
        v.pb(x);
    }

    for(int i = k-1; i >= 0; i--) {
        ans1 = ((ans1/v[i])+(ans1%v[i]?1:0))*v[i];
        ans2 = (ans2/v[i])*v[i]+v[i]-1;
    }

    if(ok(ans1,v)) cout << ans1 << " " << ans2 << endl;
    else cout << -1 << endl;

    return 0;
}



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

using namespace std;

int main(void) {
    int N, X, A, B, AB;
    string S[10010];
    cin >> N;
    for (int i=0;i<N;i++) {
        cin >> S[i];
    }
    X = 0;
    for (int i=0;i<N;i++) for (int j=0;j<S[i].size()-1;j++) {
        if (S[i][j] == 'A' && S[i][j+1] == 'B') { X++; j++; }
    }
    A = B = AB = 0;
    for (int i=0;i<N;i++) {
        if (S[i][0] == 'B') B++;
        if (S[i][S[i].size()-1] == 'A') A++;
        if (S[i][0] == 'B' && S[i][S[i].size()-1] == 'A') AB++;
    }
    if (A>0 && A == B && B == AB) cout << X+AB-1 << endl;
    else cout << X+min(A,B) << endl;

    return 0;
}

Measured memory_bytes: 768
from collections import deque
import sys
read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines


def main():
    K = int(readline())

    queue = deque([])
    for i in range(1,10):
        queue.append(i)
    
    for i in range(K):
        x = queue.popleft()
        r = x % 10
        if r != 0:
            queue.append(10*x + r - 1)
        queue.append(10*x + r)
        if x % 10 != 9:
            queue.append(10*x + r + 1)
    
    print(x)


if __name__ == "__main__":
    main()


Measured memory_bytes: 11948
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    ll N;
    cin >> N;
    ll sum = 0;
    for(int i = 1; i <= N; i++) {
        if(i % 3 == 0 && i % 5 == 0) {

        } else if(i % 3 == 0) {

        } else if(i % 5 == 0) {

        } else {
            sum += i;
        }
    }
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 3644
s=input()[::-1]
l=len(s)
dp=[[0 for j in range(13)] for i in range(l)]
if s[0] == "?":
    for j in range(10):dp[0][j]=1
else:
    dp[0][int(s[0])]=1
for i in range(1,l):
    mod = pow(10,i,13)
    if s[i] == "?":
        for j in range(10):
            for k in range(13):
                dp[i-1][k] %= 10**9+7
                dp[i][(k+j*mod)%13] += dp[i-1][k]
    else:
        for k in range(13):
            dp[i-1][k] %= 10**9+7
            dp[i][(k+int(s[i])*mod)%13] += dp[i-1][k]
print(dp[-1][5]%(10**9+7))

Measured memory_bytes: 65884
n=int(input())
A=list(map(int,input().split()))
S=sum(A)//2
a=[]

for i in range(1,n,2):
  S=S-A[i]
a.append(2*S)
for i in range(n-1):
  a.append((A[i]-a[-1]//2)*2)
for i in range(n):
  print(a[i],end=' ')

Measured memory_bytes: 14092
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int N=1e5+5;

#define endl '\n'

int main(){
	ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	int n,k,temp,cnt;
	cin>>n>>k;
	cnt=0;
	for(int i=0;i<n;i++){
		cin>>temp;
		if(temp>=k) cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}

Measured memory_bytes: 256
let () =
  Scanf.scanf "%d %s" @@ fun n s ->
  let rec loop a c i =
    if i >= n then -a, c
    else if s.[i] = '(' then loop a (c+1) (i+1)
    else loop (min a (c-1)) (c-1) (i+1)
  in
  let l, r = loop 0 0 0 in
  String.make l '(' ^ s ^ String.make (max 0 (l+r)) ')'
  |> print_endline

Measured memory_bytes: 4480
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main() {
    int N;
    ll P;
    string s;
    cin >> N >> P >> s;
    int a[N];
    for(int i = 0; i < N; i++) {
        a[i] = s[i] - '0';
    }

    ll ans = 0;

    if(P == 2) {
        for(int i = 0; i < N; i++) {
            if(a[i] % 2 == 0) ans += i + 1;
        }
    }

    else if(P == 5) {
        for(int i = 0; i < N; i++) {
            if(a[i] % 5 == 0) ans += i + 1;
        }
    }

    else {
        map<ll, ll> mp;
        mp[0]++;
        ll mod = 0;
        ll modten = 1;
        for(int i = N - 1; i >= 0; i--) {
            mod += a[i] * modten;
            mod %= P;
            modten = (modten * 10) % P;
            ans += mp[mod];
            mp[mod]++;
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1796
import math

def solve():
	diceSurfaces, winBorder = [int(x) for x in input().split()]
	diceProbability = (1 / diceSurfaces)
	ans = 0
	for score in range(1, diceSurfaces + 1):
		if score >= winBorder:
			ans += diceProbability
			continue 
		needNum  = math.ceil((winBorder) / score)
		needWins = math.ceil(math.log2(needNum))
		ans += diceProbability * ((1/2) ** needWins)
	print(ans)
solve()

Measured memory_bytes: 3060
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rep1(i,n) for(int i=1; i<=(n); ++i)
#define repi(i,a,b) for(int i=a; i<=(b); ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#define sz(v) (int)v.size()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using ll = long long;
using namespace std;
struct aaa{aaa(){ cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(20);};}aaaaaaa;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

double n,k;
int main(){
    cin >> n >> k;
    cout << (int)ceil((n-1)/(k-1)) << '\n';
}

Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <iomanip>

using namespace std;
using P = pair<long, long>;

typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvinv(xs) sort(xs.begin(), xs.end(), std::greater<long>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)
#define index_of(as, x) \
  distance(as.begin(), lower_bound(as.begin(), as.end(), x))

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

const int mod = 1000000007;

int xCnt[100005];
char xChar[100005];

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

  long n, h;
  cin >> n >> h;

  vector<long> a(n);
  vector<long> b(n);

  rep(i, n) {
    cin >> a[i] >> b[i];
  }

  sortvinv(a);
  sortvinv(b);

  long mxa = a[0];

  long idx = 0;
  long res = 0;
  while(idx < n && b[idx] > mxa && h > 0) {
    h -= b[idx];
    idx++;
    res++;
  }

  if (h > 0) res += (h+mxa-1)/mxa;

  cout << res << endl;
}


Measured memory_bytes: 1920
#include <stdio.h>
#include <iostream>
using namespace std;

int  main(){
	int N[6];
	int M[6]={0};
	for(int i=0;i<6;i++){
		cin>>N[i];
		M[i]=N[i]; 
	}
	getchar();//一定要加上这一行，否则会报错 
	char ch; 
	
	while((ch=getchar())!='\n'){
		if(ch=='S'){
			N[0]=M[4];N[1]=M[0];N[4]=M[5];N[5]=M[1];
			for(int i=0;i<6;i++)
				M[i]=N[i];
		}
		if(ch=='N'){
			N[0]=M[1];N[1]=M[5];N[4]=M[0];N[5]=M[4];
			for(int i=0;i<6;i++)
				M[i]=N[i];
		}
		if(ch=='W'){
			N[0]=M[2];N[2]=M[5];N[3]=M[0];N[5]=M[3];
			for(int i=0;i<6;i++)
				M[i]=N[i];
		}
		if(ch=='E'){
			N[0]=M[3];N[2]=M[0];N[3]=M[5];N[5]=M[2];
			for(int i=0;i<6;i++)
				M[i]=N[i];
		}
	}
	cout<<M[0]<<endl;
	
	return 0;
}


Measured memory_bytes: 3124
public class Main {
	public static void main(String[] args){
		java.util.Scanner scan = new java.util.Scanner(System.in);
		int[] x = new int[6];

		for(int i = 0; i < 6; i++){
			x[i] = scan.nextInt();
		}
		String str = scan.next();
		int n = str.length();

		for(int i = 0; i < n; i++){
			String box = str.substring(i, i+1);
			int a = 0;
			if("E".equals(box)){
				a = x[0];
				x[0] = x[3];
				x[3] = x[5];
				x[5] = x[2];
				x[2] = a;
			}else if("W".equals(box)){
				a = x[0];
				x[0] = x[2];
				x[2] = x[5];
				x[5] = x[3];
				x[3] = a;
			}else if("N".equals(box)){
				a = x[0];
				x[0] = x[1];
				x[1] = x[5];
				x[5] = x[4];
				x[4] = a;
			}else if("S".equals(box)){
				a = x[0];
				x[0] = x[4];
				x[4] = x[5];
				x[5] = x[1];
				x[1] = a;
			}
		}
		System.out.println(x[0]);
	}

}

Measured memory_bytes: 26360
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<climits>
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
 
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
ll n;
char s[500][500];
char s2[500][500];
int main(){
    cin >> n;
    REP(i,n) {
        cin >> s[i];
    }

    ll ans = 0;
    REP(i,n) {
        ll A = i;ll B = 0;

        bool f = true;
        REP(j,n) {
            REP(k,n) {
                s2[j][k] = s[(j + A) % n][(k + B) % n];
            }
        }
        REP(j,n) {
            REP(k,n) {
                if(s2[j][k] != s2[k][j]) {
                    f = false;
                    break;
                }
            }
        }
        if(f) {
            ans += n;
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 1016
import numpy as np

N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A = [ list(map(int,input().split())) for i in range(N)]

B = np.array(B)
A = np.array(A)
AB = A*B
#ans = [np.sum(AB[i]) + C for i in range(N)]
#ans = np.array(ans)
#ans = np.sum(np.where(ans>0))

ans = 0
for i in range(N):
  if np.sum(AB[i]) + C > 0:
    ans += 1
print(ans)

Measured memory_bytes: 12480
A, B, C = gets.split.map(&:to_i)
is_ok = [
  [A, B + C],
  [A + B, C],
  [A + C, B],
  [B, A + C],
  [B + C, A]
].any? { |a, b| a == b }
puts(is_ok ? 'Yes' : 'No')


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

const int MN = 200012;

int n;
int pf[MN];
char s[MN];

int main (void) {
  ios::sync_with_stdio(false);cin.tie(0);
  cin >> n >> s;
  int res = n;
  // prefix sums of red stones
  for (int i = 1; i <= n; i++) {
    if (s[i - 1] == 'R')
      pf[i] = pf[i - 1] + 1;
    else
      pf[i] = pf[i - 1];
  }
  res = min(pf[n], n - pf[n]);
  for (int i = 1; i <= n; i++) {
    int rl = pf[i], wl = i - pf[i];
    int rr = pf[n] - pf[i], wr = n - rl - wl - rr;
    int mv = min(wl, rr);
    res = min(res, mv + (i - rl - mv) + (n - i - wr - mv));
  }
  cout << res << '\n';
  return 0;
}



Measured memory_bytes: 4572
#include <stdio.h>
 
int main()
{
    int a, b, c, t;
    int sa, sb, sc;
 
    sa = sb = sc = 0;
    while (1) {
        scanf("%d%d%d", &a, &b, &c);
        if (a + b <= c || b + c <= a || c + a <= b) break;
        if (c < a) t = c, c = a, a = t;
        if (c < b) t = c, c = b, b = t;
        t = a*a + b*b;
        if      (c*c == t) sa++;
        else if (c*c <  t) sb++;
        else               sc++;
    }
    printf("%d %d %d %d\n", sa+sb+sc, sa, sb, sc);
    return 0;
}


Measured memory_bytes: 2068
#include <bits/stdc++.h>
using namespace std;
const int maxn = 100000 + 10;
const int INF = 0x3f3f3f3f;

int n,a[maxn],q[maxn],f[maxn],res;
int main() {
	scanf("%d",&n);
	for (int i = 1; i <= n; i++) {
		scanf("%d",&a[i]);
	}
	memset(q,0x3f,sizeof(q));
	q[0] = -INF;
	for (int i = 1; i <= n; i++) {
		f[i] = upper_bound(q + 1, q + n, -a[i]) - q;
		q[f[i]] = -a[i];
		res = max(res,f[i]);
	}
	printf("%d\n",res);
	return 0;
}

Measured memory_bytes: 4932
/*
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_1_C&lang=ja
ALDS1_1_c:素数の数

*/

#include <bits/stdc++.h>

using namespace std;

void disp(unsigned int *n, unsigned short int N);

int main(void){

	unsigned short int N;
	scanf("%d", &N);

	unsigned int n[N];

	for(int i=0; i<N; i++) {
		//scanf("%d[^\n]", n[i]);
        cin >> n[i];
	}
    //vector<unsigned int>prime_num;
    //disp(n, N);
    unsigned int count=0;
    for(int i=0; i<N; i++){
        bool judge = true;
        while(judge){
            
            unsigned int max = int(sqrt(n[i])) + 1;
            //printf("(i,n[i],max)=(%d, %d, %d) \n", i,n[i], max);
            for(int j=2; j<=max; j++){
                
                if(n[i] == 2){
                    //printf("error: (n[i],j,max)=(%d, %d, %d) \n", n[i],j,max);
                    count += 1;
                    //printf("prime num: %d \n",n[i]);
                    judge = false;
                }
                else if(n[i] % j == 0){
                    judge = false;
                    break;
                }else if(j==max) {
                    count += 1;
                    //printf("prime num: %d \n",n[i]);
                    judge = false;
                }
                //
            }

        }
    }
    //disp(n, N);
    printf("%d\n",count);

	return 0;
	
  
}

void disp(unsigned int *n, unsigned short int N){
	//printf("disp: ");
	for(int i=0; i<N; i++) {
		printf("%d", n[i]);
		if( i != N-1) printf(" ");
	}
	printf("\n");
}




Measured memory_bytes: 3212
n=int(input())
s=input()

r=s.count("R")
g=s.count("G")
b=n-r-g

ans=r*g*b
for i in range(1,n):
    for j in range(n):
        if(j+i*2>=n):break
        d1,d2,d3=s[j],s[j+i],s[j+i*2]
        if(not(d1==d2 or d2==d3 or d1==d3)):ans-=1
print(ans)

Measured memory_bytes: 9200
/************************************
/ AUTHOR : YATHARTH GOSWAMI         /  
/ ALIAS : hacker_yg                 /
/ INSTITUTE : IIT Kanpur            /
************************************/
//          TEMPLATE                //

#include <bits/stdc++.h>

#define ll long long
#define MOD 1000000007
#define pb push_back
#define mp make_pair
#define F first
#define S second

using namespace std;

int main(){
    string s;
    cin >> s;
    int n = s.length();
    for (int i = 0; i< n; i++) cout << 'x';
    return 0;
}




Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;

int main(){
	int N;
	cin >> N;
	vi v(N);
	for(int i=0; i<N; i++){
		cin >> v[i];
		if(v[i]>i+1){
			cout << -1 << endl;
			return 0;
		}
	}

	vi ans;
	for(int i=0; i<N; i++){
		for(int j=N-i-1; j>=0; j--){
			if(v[j]==j+1){
				ans.push_back(j+1);
				v.erase(v.begin()+j);
				break;
			}
		}
	}

	for(int i=0; i<N; i++){
		cout << ans[N-i-1] << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <set>

#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
#define reprd(i,a,b) for (int i=(a);i>=(b);--i)
#define repr(i,n) reprd(i,n,0)
typedef long long ll;

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

using namespace std;

const ll BIG = 1000000007LL;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

template<typename T>
void inputArray(T* p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

template<typename T>
void inputVector(vector<T> * p, int a){
    rep(i, a){
        T input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision = 0) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

const int Max = 210000;
int N;
int a[Max];

int main(int argc, const char * argv[]) {
    cin >> N;
    inputArray(a, N);

    int ans = 0;
    int start = 0;
    bool found = false;
    repd(i, 1, N+1) {
        if (start >= N) break;
        repd(j, start, N) {
            if (a[j] == i) {
                ans += j - start;
                start = j + 1;
                found = true;
                break;
            }
            if (j == N - 1) {
                if (found) {
                    ans += j - start + 1;
                }
                start = N;
            }
        }
    }
    if (!found) ans = -1;

    output(ans);

    return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>

int main(){
	
	int r, g, b;	scanf("%d %d %d", &r, &g, &b);
	
	int ans = r * 100 + g * 10 + b;
	
	if(ans % 4 == 0)
		printf("YES");
	else
		printf("NO");
	
	
return 0;	
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> a(n);
  for(int i=0; i<n; i++){
    cin>>a.at(i);
  }
  vector<int> ans(n,0);
  for(int i=0; i<n; i++){
    ans.at(a.at(i)-1)=i+1;
  }
  for(int i=0; i<n; i++){
    cout<<ans.at(i)<<" ";
  }
}


Measured memory_bytes: 3996
#include <bits/stdc++.h>
#define bug1(x) cout<<#x<<" = "<<x<<endl
#define bug2(x,y) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<endl
#define bug3(x,y,z) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<" "<<#z<<" = "<<z<<endl
#define bug4(x,y,z,m) cout<<#x<<" = "<<x<<" "<<#y<<" = "<<y<<" "<<#z<<" = "<<z<<" "<<#m<<" = "<<m<<endl

using namespace std;

class Debugger {
public:
	template<typename T>
	void printVector(vector<T> const &vec, bool printSize=true){
		if(printSize){
			cout << vec.size() << endl;
		}
		for(auto &elem : vec){
			cout << elem << " ";
		}
		cout << endl;
	}

	template<typename T>
	void printMatrix(vector<vector<T>> const &matrix){
		cout << matrix.size()<< " ";
		if(!matrix.empty()){
			cout << matrix[0].size();
		}
		cout << endl; 
		for(auto &vec : matrix){
			printVector(vec, false);
		}
		cout << endl;
	}
};

const int maxN = 200000 + 5;
const double PI = acos(-1);
#define ll long long

class TaskC {
private:
	Debugger debugger;

	void fillRow(vector<string> &tab, int row, char ch){
		int cols = tab[0].size();
		for(int c = 0; c < cols; c++){
			tab[row][c] = ch;
		}
	}

	void fillCol(vector<string> &tab, int col, char ch){
		int rows = tab.size();
		for(int r = 0; r < rows; r++){
			tab[r][col] = ch;
		}
	}

public:
	void solveOne(int it){
		int rows, cols, k;
		cin >> rows >> cols >> k;
		vector<string> tab(rows);
		for(int i = 0; i < rows; i++){
			cin >> tab[i];
		}
		int ans = 0;
		for(int rowMask = 0; rowMask < 1<<rows; rowMask++){
			vector<string> tmp = tab;
			for(int i = 0; i < rows; i++){
				if(rowMask & (1<<i)){
					fillRow(tmp, i, 'r');
				}
			}

			for(int colMask = 0; colMask < 1<<cols; colMask++){
				vector<string> tmp2 = tmp;
				for(int j = 0; j < cols; j++){
					if(colMask & (1<<j)){
						fillCol(tmp2, j, 'r');
					}
				}
				int ones = 0;
				for(int i = 0; i < rows; i++){
					for(int j = 0; j < cols; j++){
						ones += tmp2[i][j] == '#';
					}
				}
				if(ones == k){
					ans++;
				}
			}
		}
		cout << ans << endl;
	}

	void solve(){
		int tc = 1;
		for(int it = 1; it <= tc; it++){
			solveOne(it);
		}
	}
};


int main(){
	ios_base::sync_with_stdio(false);
	TaskC solver;
	solver.solve();
	return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define loop(i, a, n) for(int i = (a); i < (n); i++)
#define all(x) x.begin(), x.end()
#ifdef _DEBUG
#define dd(x) cout << #x << " : " << x << endl
#define sorn(i, n) char((i == n-1)?'\n':' ')
#else
#define dd(x)
#endif
using namespace std;
using ll = int64_t;

bool check(int n, int p[], vector<int> np) {
    rep(i, n) {
        if(p[i] != np[i]) {
            return false;
        }
    }
    return true;
}

int main(){
    int n; cin >> n;
    int p[n], q[n];
    rep(i, n) cin >> p[i];
    rep(i, n) cin >> q[i];

    vector<int> np; rep(i, n) np.push_back(i+1);

    int a = 0, b = 0;
    bool aflag = true, bflag = true;
    int cnt = 0;
    do {
        if(check(n, p, np)) {
            a = cnt;
        }
        if(check(n, q, np)) {
            b = cnt;
        }
        cnt++;
    } while(next_permutation(all(np)));

    cout << abs(a-b) << endl;

    return 0;
}


Measured memory_bytes: 3644
using namespace std;

#include <iostream>
#include <vector>
#include <set>
#include <string>
#include <algorithm>
#include <utility>
#include <functional>
#include <queue>
using namespace std;


int main(void){
	long long int N, r = 0L;

	cin >> N;
	vector<long long int> A(N); deque<long long int> rq;
	for (auto& i : A)
		cin >> i;
	int lo, hi;

	auto st = A.begin(), ed = A.end();
	sort(st, ed--);
	lo = *st++, hi = *ed--;
	r += hi - lo;
	rq.push_back(lo); rq.push_back(hi);
	while (st <= ed) {
		auto nlo = *st, nhi = *ed;
		auto le = abs(rq.back() - nlo), ls = abs(nlo - rq.front()),
			he = abs(rq.back() - nhi), hs = abs(nhi - rq.front());
		if (le >= ls && le >= he && le >= hs) {
			rq.push_back(nlo);
			st++;
			r += le;
		}
		else if (le <= ls && ls >= he && ls >= hs) {
			rq.push_front(nlo);
			st++;
			r += ls;
		}
		else if (he >= ls && le <= he && he >= hs) {
			rq.push_back(nhi);
			ed--;
			r += he;
		}
		else if (hs >= ls && le <= hs && hs >= he) {
			rq.push_front(nhi);
			ed--;
			r += hs;
		}
	}
	cout << r << endl;
	return 0;
}


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

int main() {
  static const long double pi=3.14159265358979;
  
  long double a,b,h,m;cin >> a >> b >> h >> m;
  long double kakudo=0,c=0;
  kakudo+=min(abs(11*m/2-30*h),360-abs(11*m/2-30*h))/180;
  //cout << kakudo << endl;
  kakudo*=pi;
  //cout << fixed << setprecision(10) << kakudo*2 << endl;
  kakudo=cos(kakudo);
  //cout << 2*a*b*kakudo << endl;
  c=sqrtl(a*a+b*b-2*a*b*kakudo);
  
  cout << fixed << setprecision(10) << c << endl;
}

Measured memory_bytes: 4172
n,m,x=map(int,input().split())
a=list(map(int,input().split()))
l=[0]*(n+1)
for i in range(m):
    l[a[i]]=1
ans=[0]*2
ans[0]=sum(l[0:x])
ans[1]=sum(l[x:-1])
print(min(ans))

Measured memory_bytes: 38384
#include<iostream>
using namespace std;
int main(){
 int N;
 cin>>N;
 long long int L[88];
 L[0]=2;
 L[1]=1;
 long long int ans;
 if(N>=2){
  for(int i=2;i<=N;i++){
   L[i]=L[i-1]+L[i-2];
   ans=L[N];
  }
 }
 else if(N==0)ans=2;
 else ans=1;
 cout<<ans<<endl;
 return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

typedef long long ll;
using namespace std;

int main() {
    int n = 0;
    cin >> n;
    n--;
    long long pre = 2;
    long long now = 1;
    while (n > 0) {
        long long buf = now + pre;
        pre = now;
        now = buf;
        n--;
    }
    cout << now << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <string>
#include <cstdlib>
#include <iomanip>
using namespace std;

int main(){
    int N;
    long maxcount = 0;
    string s;
    cin >> N;
    map<string, long> m;
    for (int i=0; i<N; i++){
        cin >> s;
        size_t n = m.count(s);
        if(n==0){
            m[s] = 1;
        }
        else{
            m[s] = m[s] + 1;
        }
        if(maxcount < m[s]){
            maxcount = m[s];
        }
    }
    
    for (auto i=m.begin(); i!=m.end(); i++){
        if(i->second == maxcount){
            cout << i->first << "\n";
        }   
    }
    return 0;
}

Measured memory_bytes: 25216
#include<stdio.h>
int main()
{
	int a, i,j=0;
	char b[1000];
	scanf("%d", &a);
	scanf("%s", &b);
	for (i = 0; i < a-2; i++)
	{
		if (b[i] == 'A' && b[i + 1] == 'B' && b[i + 2] == 'C')
		{
			j++;
		}
	}
	printf("%d", j);
	return 0;
}

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

int main() {
    cout << fixed << setprecision(10);

    int a, b, h, m;
    cin >> a >> b >> h >> m;

    double h_angle = 360.0 / 12.0 * (double)h;
    double m_angle = 360.0 / 60.0 * (double)m;
    h_angle += 30.0 * (double(m) / 60.0);
    double diff = abs(h_angle - m_angle);
    if (diff > 180.0) diff = 360.0 - diff;

    double rad = diff * M_PI / 180.0;
    double cs = cos(rad);
    double c = a * a + b * b - 2 * a * b * cs;
    c = sqrtl(c);

    cout << c << endl;
}

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

 int main()
{
    char S[3];
    scanf("%s",S);
    if ((strcmp(S , "AAB") == 0) || (strcmp(S , "ABA") == 0) || (strcmp(S , "BBA") == 0) || (strcmp(S , "BAB") == 0) || (strcmp(S , "ABB") == 0) || (strcmp(S , "BAA") == 0))
    {
        puts("Yes");
    }
    else 
    {
        puts("No");
    }

    return 0;
} 

Measured memory_bytes: 1644