akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }
template<typename S, typename T> ostream& operator<<(ostream &os, const pair<S, T> &p){ cout << "[" << p.first << ", " << p.second << "]"; return os; }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) { for(const auto &e : xs) cout << e << " "; cout << "\n"; }
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")
#define Return(expr) { Cout(expr); return 0; }
#define vc vector
#define Mini(a, x) a = min(a, x)
#define Maxi(a, x) a = max(a, x)

// constexpr int MOD = 1e9+7;

int main(void){
    Cin(int, a, b, c, d);
    Cout((a+b-1)/b);
}

Measured memory_bytes: 256
using System;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            int cnt = 0;
            if (s[1] == 'R')
            {
                for (int i = 0; i< 3; i++){
                    if (s[i] == 'R') cnt++;
                }
            }
            else
            {
                int t = 0;
                for(int i = 0; i < 3; i++){
                    if (s[i] == 'R') t++;
                }
                if (t == 2 || t == 1) cnt = 1;
                else cnt = 0;
            }
            Console.WriteLine(cnt);
        }
    }
}


Measured memory_bytes: 25864
//$g++ -std=c++11 Template.cpp 

//#include <bits/stdc++.h>
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <climits>
#include <iomanip>

#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define ROF(i, j, k) for(int i = (int)(j); i >= (int)(k); --i)
#define FORLL(i, n, m) for(long long i = n; i < (long long)(m); i++)
#define SORT(v, n) sort(v, v+n)
#define REVERSE(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;
const ll MOD=1000000007LL;
typedef pair<int, int> P;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }

priority_queue<int> q_descending;
priority_queue<int, vector<int>, greater<int> > q_ascending;

string s[30][30];

int
main(void){  
  ios_base::sync_with_stdio(false);

  int h, w;
  cin >> h >> w;
    
  REP(i, h) REP(j, w) cin >> s[i][j];

  int ax, ay;
  REP(i, h) REP(j, w) if(s[i][j] == "snuke") { ax = i; ay = j; break;}

  char stmp = 'A';
  stmp = stmp + ay;
  cout << stmp << ax+1 << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <algorithm>
#define MOD 998244353
using namespace std;
pair<int,int> P[205];
double tmp[205];
int pw2[205];
int N;
int rez;
void fix(int &val)
{
    if(val<0)val+=MOD;
    if(val>=MOD)val-=MOD;
}
void baga(pair<int,int> a)
{
    int len=0;
    for(int i=1;i<=N;i++)
    {

        if(a<P[i])
        {
            tmp[++len]=atan2(P[i].second-a.second,P[i].first-a.first);
        }
    }
    sort(tmp+1,tmp+1+len);
    int cnt=(len>0);
    //printf("%d ",rez);
    fix(rez=rez-1);
    for(int i=2;i<=len;i++)
    {
        if(tmp[i]==tmp[i-1])
        {
            cnt++;
        }
        else
        {
            fix(rez-=(pw2[cnt]-1));
            cnt=1;
        }
    }
    fix(rez-=(pw2[cnt]-1));
//    printf("%d\n",rez);
}
int main()
{
    pw2[0]=1;
    for(int i=1;i<=200;i++)fix(pw2[i]=2*pw2[i-1]);
    scanf("%d",&N);rez=pw2[N]-1;
    for(int i=1;i<=N;i++)scanf("%d %d",&P[i].first,&P[i].second);
    for(int i=1;i<=N;i++)
    {
        baga(P[i]);
    }
    printf("%d",rez);
    return 0;
}


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

int main() {
    int N;cin>>N; 
    map<int,int> prime_factor;
    for(int i=2; i<=N; ++i){
        int n = i;
        for(int j=2; j*j <= n; ++j){
            while(n%j==0){
                ++prime_factor[j];
                n /= j;
            }
        }
        if(n != 1) ++prime_factor[n];
    }
    int div2 = 0, div4 = 0, div14 = 0, div24 = 0, div74 = 0;
    for(int i=2; i <= N; ++i) {
        if(prime_factor[i] >= 2) ++div2;
        if(prime_factor[i] >= 4) ++div4;
        if(prime_factor[i] >= 14) ++div14;
        if(prime_factor[i] >= 24) ++div24;
        if(prime_factor[i] >= 74) ++div74;
    }
    // 2^x * 3^y * 5^z * 7^w * ... = N!
    // (x+1) * (y+1) * (z+1) * (w+1) * ... = 75
    // 75 = 3 * 5 * 5, 15 * 5, 25 * 3, 75
    // e.g.) 32400 = 2^4 * 3^4 * 5^2
    // 10! = 2^8 * 3^4 * 5^2 * 7^1
    cout << div4 * (div4-1) / 2 * (div2-2) + div14 * (div4-1) + div24 * (div2-1) + div74 << '\n';
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for(int i = x; i < n; i++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
long gcd(long a, long b){
    if(a%b==0){
        return(b);
    }
    else {
        return(gcd(b,a%b));
    }
}
int main(int argc, char* argv[]) {
    long n,xx;
    cin >> n >> xx;
    vector<long> x(n);
    rep(i,n) cin >> x[i];
    if(n==1){
        cout << abs(x[0]-xx) << endl;
        return 0;
    }

    long t = gcd(abs(x[0]-xx),abs(x[1]-xx));
    REP(i,2,n){
        t=gcd(abs(x[i]-xx),t);
    }
    cout << t << endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define ULL unsigned long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<LL,LL>
#define x first
#define y second
#define pi acosl(-1)
#define sqr(x) ((x)*(x))
#define pdd pair<double,double>
#define MEMS(x) memset(x,-1,sizeof(x))
#define MEM(x) memset(x,0,sizeof(x))
#define EPS 1e-4
#define arg ARG
#define cpdd const pdd
#define rank Rank
#define MAXN 205
//#define N 262144
#define ULL unsigned long long
#define ll long long
int main(){
    int n,k;
    scanf("%d %d",&n,&k);
    int a[10005];
    for(int i = 0;i<n;i++)scanf("%d",&a[i]);
    sort(a,a+n);
    int ans=0;
    for(int i = 0;i<k;i++){
        ans+=a[i];
    }
    printf("%d\n",ans);
}

Measured memory_bytes: 3840
import Control.Applicative
import qualified Control.Monad as Monad

main = loop

loop :: IO ()
loop = do
    [h,w] <- map (read :: String -> Int) . words <$> getLine
    Monad.when (h /= 0 || w /= 0) $ do
        printChessboard h w
        loop

printChessboard :: Int -> Int -> IO ()
printChessboard h w = do
    Monad.forM_ [1..h] $ \i -> do
        putStrLn $ squareLine w i
    putStrLn ""

squareLine :: Int -> Int -> String
squareLine w i = if (odd i) then
                   takeSquare w "#" "."
                 else
                   takeSquare w "." "#"

takeSquare :: Int -> String -> String -> String
takeSquare w s1 s2 = take w $ concat $ zipWith (++) (repeat s1) (repeat s2)


Measured memory_bytes: 4100
#include <bits/stdc++.h>
#include<math.h>
#include<algorithm> 
#define rep(i,n) for (int i = 0; i < (n) ; ++i)
using namespace std;
using ll = long long ;
using P = pair<int, int> ;
#define PI 3.14159265358979323846264338327950
#define INF 1e18
#define mod 1000000007

int main() {
    string s, t ;
    cin >> s >> t; 
    int ns = s.size() ;
    int nt = t.size() ;
    int ans = 1005 ;
    for(int i = 0; i <= ns - nt; i++){
        int res = 0 ;
        rep(j, nt){
            if(s[i + j] != t[j]){
                res++ ;
            }
        }
        ans = min(ans, res) ;
    }
    cout << ans << endl ;
} 

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

int main(void)
{
  int num;
  int year;
  int old_num[7];

  while(1)
    {
      cin >> num;
      if(num == 0) break;
      for(int i = 0 ; i < 7 ; i++)
	{
	  old_num[i] = 0;
	}

      for(int i = 0 ; i < num ; i++)
	{
	  cin >> year;
	  if(year < 10) old_num[0]++;
	  else if(year < 20) old_num[1]++;
	  else if(year < 30) old_num[2]++;
	  else if(year < 40) old_num[3]++;
	  else if(year < 50) old_num[4]++;
	  else if(year < 60) old_num[5]++;
	  else old_num[6]++;
	}
      for(int i = 0 ; i < 7 ; i++)
	{
	  cout << old_num[i] << endl;
	}
    }
  return 0;
}

Measured memory_bytes: 864
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <numeric>
using namespace std;

void search(int length, vector<string> &allN, vector<bool> used, string now) {
    if (now.length() == length) {
        allN.push_back(now);
        return;
    } else {
        for (int i = 1; i <= length; i++) {
            if (used[i-1]) continue;
            used[i-1] = true;
            search(length, allN, used, now+to_string(i));
            used[i-1] = false;
        }
    }
}

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

    vector<int> p(n), q(n);
    for (int i = 0; i < n; i++) cin >> p[i];
    for (int i = 0; i < n; i++) cin >> q[i];

    vector<string> allN;
    for (int i = 1; i <= n; i++) {
        vector<bool> used(n);
        used[i-1] = true;
        search(n, allN, used, to_string(i));
    }

    string pStr = "", qStr = "";
    for (int i = 0; i < n; i++) pStr += to_string(p[i]);
    for (int i = 0; i < n; i++) qStr += to_string(q[i]);

    int pCnt = 0, qCnt = 0;
    for (int i = 0; i < allN.size(); i++) {
        if (pCnt != 0 && qCnt != 0) break;
        if (pCnt == 0 && pStr == allN[i]) pCnt = i+1;
        if (qCnt == 0 && qStr == allN[i]) qCnt = i+1;
    }

    cout << abs(pCnt-qCnt) << endl;
}

Measured memory_bytes: 2424
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>

#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <functional>
#include <iostream>

using namespace std;

typedef long long llint;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define TRACE(x) cout << #x << " = " << x << endl
#define _ << " _ " <<

const int MAXN = 1e5 + 5;
const int mod  = 1e9 + 7;

int N;
char s[MAXN];
int freq[26];

int main(void)
{
  scanf("%d", &N);
  scanf("%s", s);

  REP(i, N) {
    ++freq[s[i] - 'a'];
  }

  int sol = 1;
  REP(i, 26) {
    sol = (llint)sol * (freq[i] + 1) % mod;
  }

  printf("%d\n", (sol + mod - 1) % mod);

  return 0;
}


Measured memory_bytes: 384
h, w = map(int, input().split())
a = [input() for _ in range(h)]
row = [False] * h
col = [False] * w

for i in range(h):
    for j in range(w):
        if a[i][j] == '#':
            row[i] = True
            col[j] = True

for i in range(h):
    if row[i]:
        for j in range(w):
            if col[j]:
                print(a[i][j], end='')
        print()

Measured memory_bytes: 42600
//
// Created on 2019-01-27.
//
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
template<class T> bool INRANGE(T x,T a,T b) { return a<=x&&x<=b; }

#define REP(i,n) for(int i=0;i<(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl;

#define PB push_back
#define INF 1e9
#define MOD 1e9+7
#define EPS 1e-9

typedef vector<int> vi;
typedef vector<string> vs;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

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

    int N, X, Y;
    cin >> N >> X >> Y;

    int m;
    if (N >= X+Y) m = 0;
    else m = X+Y-N;

    cout << min(X,Y) << " " << m << endl;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long int
#define ld long double
#define getFaster ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define rev(i,n,init) for(int i=n;i>=init;i--)
#define MAXN 200005
#define MOD2 998244353
#define MOD1 1e9+7
#define f first
#define s second
#define endl '\n'
#define pii pair<int,int>
#define piii pair<pii,int>
#define precise(i) cout<<fixed<<setprecision(i)
using namespace std;
const long double PI = atan(1.0)*4;
const int64_t INF=1000000000000000003;
const int32_t LOG=21;
const int MOD=MOD1;


int32_t main()
{ 
      getFaster;
      int tests=1;
      //cin>>tests;
      rep(ii,0,tests)
      {  
           int x;
           cin>>x;
           int ans=(x/500)*1000;
           x%=500;
           ans+=(x/5)*5;
           cout<<ans<<endl;
      }

      return 0;     
}

/*
 TIPS(FOR ME):
 1.) Check for corner cases (like 0 is exception case)
 2.) Check for global memory sizes,memory refreshments and its complexity 
 3.) Check for sorting criteria (if used 1-based indexing)
 4.) Check for numbers overflow (while multiplying and doing MOD)
 5.) Check for typecasting issues like int to float( while dividing numbers)
*/


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int a,b,c;
    cin >> a >> b >> c;
    if(a < b && b < c){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
    return 0;
    
}



Measured memory_bytes: 3112
paper[10][10];
dx1[]={0,1,0,-1,0};
dy1[]={0,0,1,0,-1};
dx2[]={0,1,1,0,-1,-1,-1,0,1};
dy2[]={0,0,1,1,1,0,-1,-1,-1};
dx3[]={0,1,1,0,-1,-1,-1,0,1,2,0,-2,0};
dy3[]={0,0,1,1,1,0,-1,-1,-1,0,2,0,-2};
main(){
	int x,y,sz,i,cnt,max;
	while(~scanf("%d,%d,%d",&x,&y,&sz)){
		if(sz==1){
			for(i=0;i<5;i++){
				int xx=x+dx1[i],yy=y+dy1[i];
				if(0<=xx && xx<10 && 0<=yy && yy<10)	paper[xx][yy]++;
			}
		}
		else if(sz==2){
			for(i=0;i<9;i++){
				int xx=x+dx2[i],yy=y+dy2[i];
				if(0<=xx && xx<10 && 0<=yy && yy<10)	paper[xx][yy]++;
			}
		}
		else{
			for(i=0;i<13;i++){
				int xx=x+dx3[i],yy=y+dy3[i];
				if(0<=xx && xx<10 && 0<=yy && yy<10)	paper[xx][yy]++;
			}
		}
	}
	cnt=max=0;
	for(x=0;x<10;x++)for(y=0;y<10;y++)max=paper[x][y]>max?paper[x][y]:max,!paper[x][y]&&cnt++;
	printf("%d\n%d\n",cnt,max);
	exit(0);
}

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

#define repr(i,a,b) for (int i=a; i<b; i++)
#define rep(i,n) for (int i=0; i<  n; i++)
 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
 
const long long INF = 1LL << 60;
#define PI 3.14159265359 

template<typename T>
void remove(std::vector<T>& vector, unsigned int index)
{
    vector.erase(vector.begin() + index);
}

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

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



int main(){
    int A, B;
    cin >> A >>B;

    cout << max(0,A-B*2) << endl;





}


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

using namespace std;

#define ll long long;
#define pb push_back



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

  if( ans <= c)cout << ans << endl;
  else cout << c << endl;

    return 0;
}


Measured memory_bytes: 256
if __name__ == '__main__':
    n = int(input())
    list =[0]*86
    list[0]=2
    list[1]=1

    for i in range(2,86):
        list[i]=list[i-1]+list[i-2]

    if n ==86:
        print("939587134549734843")
    else:
        print(list[n])

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

#define ll long long int
#define vi vector<int>
#define ii pair< int , int >
#define vii vector<ii>
#define FOR(i, n) for(ll i = 0; i < (ll)n; i++)
int MAX(int a, int b){return (a > b) ? a:b;}
int MIN(int a, int b){return (a < b) ? a:b;}
int ABS(int x){return (x > 0) ? x:-x;}
int left(int x){return (x<<1);}
int right(int x){return (x<<1)+1;}
int lsone(int x){return (x&(-x));}

const int maxn = 105, maxk = 1e5+5;
const int MOD = 1e9 + 7;

int n, k, a[maxn];
int ans[maxn][maxk];

int main(){
	scanf("%d %d", &n, &k);
	for(int i = 0; i < n; i++){
		scanf("%d", &a[i]);
	}
	for(int pos = n; pos >= 0; pos--){
		for(int rem = 0; rem <= k; rem++){
			if(pos == n){
				if(rem > 0) ans[pos][rem] = 0;
				else ans[pos][rem] = 1;
			}else{
				//Add (pos+1, rem), (pos+1, rem-1), .. (pos+1, rem-a[pos])
				ans[pos][rem] = ans[pos+1][rem];
				if(rem-a[pos] > 0)
				ans[pos][rem] = (ans[pos][rem]-ans[pos+1][rem-a[pos]-1]+MOD)%MOD;
			}
		}
		for(int rem = 1; rem <= k; rem++){
			ans[pos][rem] = (ans[pos][rem] + ans[pos][rem-1])%MOD;
		}
	}
	int finalAns = ans[0][k];
	if(k > 0) finalAns = (finalAns-ans[0][k-1]+MOD)%MOD;
	printf("%d\n", finalAns);
}

Measured memory_bytes: 41216
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define _GLIBCXX_DEBUG
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
const ll INF = 9223372036854775807;

int main() {
  string S, T;cin >> S >> T;
  int C = 0;
  rep(i, S.size()) {
    if(S.at(i) != T.at(i)) C++;
  }
  if(C == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 3600
import java.util.Arrays;
import java.util.Scanner;


public class Main {
	static String a = "apple";
	static String p = "peach";
	
	public static void main(String[] args) {
		new Main().solve();
	}
	
	void solve(){
		Scanner sc = new Scanner(System.in);
		String[] str = sc.nextLine().split(" ");
		boolean f = false;
		
		for(String v :str){
			if(f){
				System.out.print(" ");
			}else{
				f = true;
			}
			
			if(v.indexOf("apple") >= 0){
				System.out.print(v.replaceAll(a, p));
			}else if(v.indexOf("peach") >=0){
				System.out.print(v.replaceAll(p, a));
			}else{
				System.out.print(v);
			}
		}
		
		System.out.print("\n");
	}
	
	void debug(Object... os){
		System.err.println(Arrays.deepToString(os));
	}
}

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

int main() {
  string A, B;
  cin >> A;
  B = "No";
  
  if (A.at(0) == A.at(1))
    if (A.at(2) == A.at(3))
      if (A.at(0) != A.at(2))
        B = "Yes";
  if (A.at(0) == A.at(2))
    if (A.at(1) == A.at(3))
      if (A.at(0) != A.at(1))
        B = "Yes";
  if (A.at(0) == A.at(3))
    if (A.at(1) == A.at(2))
      if (A.at(0) != A.at(1))
        B = "Yes";
  cout << B << endl;
}


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

using namespace std;

int main()
{
  string a, b;

  cin >> a >> b;

  if (a == "H")
  {
    if (b == "H")
    {
      cout << "H"
           << "\n";
    }
    else
    {
      cout << "D"
           << "\n";
    }
  }
  else
  {
    if (b == "D")
    {
      cout << "H"
           << "\n";
    }
    else
    {
      cout << "D"
           << "\n";
    }
  }
}

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

using namespace std;

int main() {
  int N, D;
  
  vector<pair<int, int>> points;
  
  cin >> N >> D;
  
  for (int i = 0; i < N; i++) {
    int in1, in2;
    
    cin >> in1 >> in2;
    
    points.push_back(make_pair(in1, in2));
  }
  
  int ans = 0;
  
  for (int i = 0; i < N; i++) {
    long long f = points[i].first;
    long long s = points[i].second;
    
    if ((long long)D * D >= f * f + s * s) {
      ans++;
    }
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 5312
// This code writed by chtholly_micromaker(MicroMaker)
#include <bits/stdc++.h>
#define reg register
#define pii pair<int,int>
using namespace std;
const int MaxN=20;
template <class t> inline void read(t &s)
{
	s=0;
	reg int f=1;
	reg char c=getchar();
	while(!isdigit(c))
	{
		if(c=='-')
			f=-1;
		c=getchar();
	}
	while(isdigit(c))
		s=(s<<3)+(s<<1)+(c^48),c=getchar();
	s*=f;
	return;
}
vector<pii > Says[MaxN];
int a[MaxN];
int n,ans;
inline bool checkmate()
{
	for(int i=1;i<=n;++i)
	{
		if(a[i]==1)
		{
			for(int j=0;j<(int)Says[i].size();++j)
			{
				if(a[Says[i][j].first]==1&&Says[i][j].second==0)
					return false;
				if(a[Says[i][j].first]==0&&Says[i][j].second==1)
					return false;
			}
		}
		/*
		else
		{
			for(int j=0;j<(int)Says[i].size();++j)
			{
				if(a[Says[i][j].first]==1&&Says[i][j].second==1)
					return false;
				if(a[Says[i][j].first]==0&&Says[i][j].second==0)
					return false;
			}
		}
		*/
	}
	return true;
}
inline void dfs(int dep,int step)
{
	if(dep>n)
	{
		if(step<=ans)
			return;
		if(checkmate())
			ans=step;
		return;
	}
	a[dep]=1;
	dfs(dep+1,step+1);
	a[dep]=0;
	dfs(dep+1,step);
	return;
}
signed main(void)
{
	cin>>n;
	reg int Ai;
	for(int i=1;i<=n;++i)
	{
		cin>>Ai;
		for(int j=1;j<=Ai;++j)
		{
			reg int A,B;
			cin>>A>>B;
			Says[i].push_back(make_pair(A,B));
		}
	}
	dfs(1,0);
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 256
fun main(args: Array<String>) {
    caddi2018c()
}

private fun primeFactorization(n: Long): Map<Long, Long> {
    val factors = mutableMapOf<Long, Long>()
    var temp = n
    var i = 2L
    while (i * i <= temp) {
        while (temp % i == 0L) {
            factors[i] = (factors[i] ?: 0) + 1
            temp /= i
        }
        i++
    }
    if (temp > 1) factors[temp] = 1
    return factors
}

fun caddi2018c() {
    val (n, p) = readLine()!!.split(" ").map { it.toLong() }

    val primes = primeFactorization(p)

    val answer = primes
        .map { Math.max(1, Math.pow(it.key.toDouble(), (it.value / n).toDouble()).toLong()) }
        .fold(1L) { acc, l -> acc * l }

    println(answer)
}


Measured memory_bytes: 37776
import java.util.*;
class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    long x = sc.nextLong();
    long y = 100;
    int count = 0;
    while(x > y){
      count = count + 1;
      
      y = y + y / 100;
    }
    
    System.out.println(count);
    sc.close();
  }
}

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

int main() {
    int n;
    scanf("%d", &n);
    vector<int> v(n);
    rep(i, n) {
        scanf("%d", &v[i]);
    }
    if (n == 2) {
        printf("%f", ((float)v[0] + (float)v[1]) / 2.0);
        return 0;
    }
    sort(v.begin(), v.end());
    float equate = 0;
    rep(i, n) {
        if (i == 0) {
            equate = (float)v[i];
        } else {
            equate = (equate + (float)v[i]) / 2.0;
        }
    }
    printf("%f", equate);
    return 0;
}

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

string S; long long N, r, c[29];

int main() {
	cin >> S;
	N = S.size();
	for (int i = 0; i < N; i++) c[S[i] - 'a']++;
	
	r = N * (N - 1) / 2LL;
	for (int i = 0; i < 26; i++) r -= c[i] * (c[i] - 1LL) / 2LL;
	cout << r + 1LL << endl;
	return 0;
}

Measured memory_bytes: 640
parseInt(x)=parse(Int,x)
parseMap(x::Array{SubString{String},1})=map(parseInt,x)

function main()
	a,b = readline() |> split |> parseMap
	x = zeros(Int,100,100)
	println("100 100")
	for i in 1:a-1
		x[2*(div(i,48))+2,2*(i%48)+2] = 1
	end
	for i in 1:b-1
		x[50+2*(div(i,48))+2,2*(i%48)+2] = 1
	end
	for i in 1:50
		for j in 1:100
			if x[i,j] == 1
				print('.')
			else
				print('#')
			end
		end
	    println("")
	end
	for i in 51:100
		for j in 1:100
			if x[i,j] == 1
				print('#')
			else
				print('.')
			end
		end
		println("")
	end
end

main()


Measured memory_bytes: 113448
#include <bits/stdc++.h>
#define FOR(i,bg,ed) for(ll i=(bg);i<(ed);i++)
#define REP(i,n) FOR(i,0,n)
#define REP1(i,n) for(ll i=1;i<=(n);i++)
#define MOD 1000000007
#define int long long
#define all(c) (c).begin(), (c).end()
#define uniq(c) c.erase(unique(all(c)), (c).end())
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const int INF = 1e9;



signed main()
{
    int X, t;

    cin >> X >> t;
    cout << max(X - t, 0LL) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n";
long long M = 1e9+7;
long long power(long long a, long long p)
{
    if(p==0) return 1;
    long long ans= power(a,p/2);
    ans =(ans * ans) % M;
    if(p%2) ans = (ans*a) % M;
    return ans;
}

bool isPrime(long long n)
{
    if (n <= 1)
        return false;
    for (long long i = 2; i < n; i++)
        if (n % i == 0)
            return false;
    return true;
}
long long SieveOfEratosthenes(long long n, long long a)
{
    bool prime[n+1];
    memset(prime, true, sizeof(prime));
    for (long long p=2; p*p<=n; p++)
    {
        if (prime[p] == true)
        {
            for (long long i=p*p; i<=n; i += p)
                prime[i] = false;
        }
    }
    for (long long p=2; p<=n; p++)
       if (prime[p])
       {
           if(a%p==0)
           {
               return (a-p);
           }
       }
}
long long nCr(int n, int r)
{
    if(r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;
    for(i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }
    return ans;
}
//int vis[51][51];
//int x[]={1,0,0,-1};
//int y[]={0,1,-1,0};
/* void dfs_visit(long long n,long long a, long long b)
{
    vis[a][b]=1;
    for(int i=0; i<4; i++)
    {

        int p=a+x[i];
        int q=b+y[i];
        if(p>=0 && p<n && q>=0 && q<n && vis[p][q]==0)
        {
           // cout<<p<<" "<<q<<endl;
            vis[p][q]=1;
            dfs_visit(n,p,q);
        }
    }
}
*/
long long fun(long long a)
{
    long long co=1,res=0;
    while(a>0)
    {
        if(a%2==0)
        {
            res=co;
        }
        a/=2;
        co++;
    }
    return res;
}

int main()
{
    IOS;
    long long a,b,c,d,e,h,l,n,t,f,m,f1=0,flag=0,flag1=0,co=0,co1=0,co2=0,arr1[100001]={0},sum=0,sum1=0,ma=0,ma1=0,mi=1000000000000000001;
    long long g,co3=0,co4=0,co5=0,co6=0,co7=0,co8=0,mul=1,sum2=0,sum3=0,mu=1,mu1=1;
    long long a1,b1,a2,b2,a3,b3,a4,b4,a5,b5,b6;
    double pi=2 * acos (0.0);
    string str,str1,str2,str3,str4,str5,str6;
    char ch,ch1;
    //vector<long long>v; //vector<long long> v(n+1);
    //vector<long long>v1;
   // vector<string>vs;
   // vector<string>vs1;
    //map<long long,long long>mp;
    //set<long long>s;
    //stack<long long> stk;
    //vector< pair<long long,long long> >v3;
    //map<long long,long long>::iterator it;
    //map<string,string>::iterator it;
   // vector<pair<char, pair<int,int> > > v3;
    //vector< pair<char,int > > v1;
    //int x[]={1,1,1,0,0,-1,-1,-1};
    //int y[]={0,1,-1,1,-1,1,-1,0};
    //int x[]={1,0,0,-1};
    //int y[]={0,1,-1,0};
    cin>>a>>b>>c>>d;
    sum+=min(a,d);
    d-=min(a,d);
    if(d==0)
    {
        cout<<sum<<endl;
        return 0;
    }
    d-=min(b,d);
    if(d==0)
    {
        cout<<sum<<endl;
        return 0;
    }
    sum-=min(c,d);
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const ll mod = 1000000007;
const ll INF = mod * mod;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
typedef vector<int> vec;
typedef vector<string> svec;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define int long long

int n, k;
P p[100100];

void solve() {
    cin >> n >> k;
    rep(i, n) {
        int a, b; cin >> a >> b;
        p[i] = make_pair(a, b);
    }
    sort(p, p + n);
    int cnt = 0,i = 0;
    while(true) {
        cnt += p[i].sc; //更新を忘れるな
        if(cnt >= k) {
            cout << p[i].fr << endl;
            break;
        }
        i ++; //数値の変更には最新の注意を払うべし
    }

}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//init();
	solve();
	//cout << "finish" << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,sum=0;
	cin>>n;
	int a[105]={0},b[105]={0};
	for(int i=2;i<=n;i++)
	cin>>a[i];
	b[2]=a[2];
	b[n+1]=a[n];
	for(int i=3;i<=n;i++)
	{
		if(a[i-1]<a[i])
		b[i]=a[i-1];
		else
		b[i]=a[i];
		
	}
	for(int i=2;i<=n+1;i++)
	{
		sum=sum+b[i];
		
	}
	cout<<sum;
} 

Measured memory_bytes: 256
//#pragma GCC optimize ("O3")
//#pragma GCC target ("sse4")

#include <bits/stdc++.h>

using namespace std;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "


// CHECK THE LIMITS
typedef long long ll;

const int MOD = 1000000007;
const ll INFLL = 1e18;
const int INF = 1e9;
const int NMAX = 1000001;

int gcd(int a, int b) {
  return b ? gcd(b, a%b) : a;
} 

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

    int a,b,c,d;
    cin >> a >> b >> c >> d;

    int turn = 0;
    while(a > 0 && c>0)
    {
	if(turn==0)
	{
	    c-=b;
	}
	else
	    a-=d;
	if(a <= 0)
	{
	    cout << "No";
	    return 0;
	}
	else if(c <=0)
	{
	    cout << "Yes";
	    return 0;
	}
	turn^=1;
    }
    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std; 
 
#define IOS ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define endl "\n"
#define int long long 

bool sortcol( const vector<int>& v1, const vector<int>& v2 ) {return v1[0] < v2[0];}
 bool sortbysec(const pair<string,int> &a, 
              const pair<string,int> &b) 
{ 
    return (a.second > b.second); 
} 
int32_t main(){
	IOS;
		int a,b;
		cin >> a >> b;
		cout << a*b << endl;
	return 0;	
}


Measured memory_bytes: 3612
'use strict'

const main = (input) => {
    input = input.split(' ').map(v => parseInt(v))
    const a = input[0]
    const b = input[1]
    const c = input[2]
    if(a === b){
        console.log(c)
    }else if(a === c){
        console.log(b)
    }else{
        console.log(a)
    }
}

main(require('fs').readFileSync('/dev/stdin', 'utf-8'))

Measured memory_bytes: 21192
#include <iostream>
#include <vector>
using namespace std;
const int MOD = 1000000007;
int dp[2100];

int main() {
    int S; cin >> S;
    dp[0] = 1;
    for (int i = 1; i <= S; i++) {
        for (int j = 0; j <= i - 3; j++) {
            dp[i] += dp[j];
            dp[i] %= MOD;
        }
    }
    cout << dp[S] << endl;
    return 0;
}

Measured memory_bytes: 3620
#include <stdio.h>
#include <stdlib.h>
#include <stdio.h>
#include <math.h>
#include <cctype>

#include <iostream>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <algorithm>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i,l,n) for(int (i)=(int)(l);(i)<(int)(n);(i)++)
#define d_arr(arr, h, w) rep(i,(h) ){ cout << "["; rep(j,(w) ) { cout << (arr)[i][j] << ", "; } cout << "]" << endl;}
#define IN(x,s,g) ((x) >= (s) && (x) < (g))
#define ISIN(x,y,w,h) (IN((x),0,(w)) && IN((y),0,(h)))
#define print(x) printf("%d\n",x);
#define print_a(x) rep(jejeje,x.size()){ cout << x[jejeje] << " "; }

typedef pair<int ,int> P;



int main()
{
    int n,tmp;
    vector<int> x; //[0,n-1]
    cin >> n; //変数の個数
    rep(i,n){
        cin >> tmp;
        x.push_back(tmp);
    }
    unsigned long long int dp[100][21] = {0}; //[0,n-2] [0,20]
    // 総数 : [今いる変数id:0-ori][今までの総和]
    // dp[i][j]:=i番目の数まで使って(足すか引くかして)jを作ることが出来る通りの数

    rep(i,n) rep(j,21) dp[i][j] = 0;

    dp[0][x[0]] = 1;
    rep(i,n-1){
        if( i==0 ) {continue;}
        rep(j,21){
            if( j+x[i] < 21 ){ dp[i][j+x[i]] += dp[i-1][j];}
            if( j-x[i] > -1 ){ dp[i][j-x[i]] += dp[i-1][j];}
        }
    }
    cout << dp[n-2][x[n-1]] << endl;
}

Measured memory_bytes: 1232
cha='abcdefghijklmnopqrstuvwxyz'
dig=[]
N=int(input())
d=0
n=0
ls=[]
while n<=N:
  n+=(26**d)
  ls.append(n)
  d+=1
# print(d,n,ls)
N-=n
n=N
for _ in range(d-1):
  dig.append(n%26)
  n//=26
ans=[]
for i in range(len(dig)):
  ans.append(cha[dig[i]])
ans.reverse()
print(*ans,sep='')


Measured memory_bytes: 9192
import java.util.Arrays;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		while (true) {
			int n = scanner.nextInt();
			if (n == 0)
				break;
			int[][] ns = new int[n][2];
			while (n-- > 0) {
				ns[n][0] = scanner.nextInt();
				ns[n][1] = scanner.nextInt();
			}
			int m = scanner.nextInt();
			int[][] ms = new int[m][2];
			while (m-- > 0) {
				ms[m][0] = scanner.nextInt();
				ms[m][1] = scanner.nextInt();
			}
			int len = ns.length + ms.length;
			int[][] num = Arrays.copyOf(ns, len);
			System.arraycopy(ms, 0, num, ns.length, ms.length);
			Arrays.sort(num, new Comparator<int[]>() {
				@Override
				public int compare(int[] a, int[] b) {
					if (a[0] == b[0]) {
						return a[1] - b[1];
					}
					return a[0] - b[0];
				}
			});
			/*for (int[] a : num)
				System.out.println(Arrays.toString(a));*/
			int[] dp = new int[len];
			Arrays.fill(dp, 1);
			for (int i = 0; i < len; i++) {
				for (int j = 0; j < i; j++) {
					if (num[i][0] > num[j][0] && num[i][1] > num[j][1])
						dp[i] = Math.max(dp[i], dp[j] + 1);
				}
			}
			int ans = 0;
			for (int i = 0; i < len; i++) {
				ans = Math.max(ans, dp[i]);
			}
			System.out.println(ans);
		}
	}
}

Measured memory_bytes: 24716
# include <iostream>

const int MAX_W = 50;
const int MAX_H = 50;

int w, h;

int c[MAX_H][MAX_W];

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

void dfs(int x, int y) {
	c[y][x] = 0;
	for (int i = 0; i < 8; ++i) {
		int nx = x + dx[i];
		int ny = y + dy[i];
		if (nx >= 0 && ny >= 0 && nx < w&&ny < h&&c[ny][nx] == 1)
			dfs(nx, ny);
	}
}

int solve() {
	int sum = 0;
	for (int i = 0; i < h; ++i) {
		for (int j = 0; j < w; ++j) {
			if (c[i][j] == 1) {
				++sum;
				dfs(j, i);
			}
		}
	}
	return sum;
}

int main() {
	while (1) {
		std::cin >> w >> h;
		if ((w + h) == 0)
			break;
		for (int i = 0; i < h; ++i) {
			for (int j = 0; j < w; ++j)
				std::cin >> c[i][j];
		}
		int res = solve();
		std::cout << res << std::endl;
	}
	return 0;
}

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

struct StCond                  // 材料質量・限界量
{
  int m_nWaterA;
  int m_nWaterB;
  int m_nSugerC;
  int m_nSugerD;
  int m_nConcE;
  int m_nLimitF;
};

struct StAmt                   // 使用量
{
  StAmt() : m_nAmtA(0), m_nAmtB(0), m_nAmtC(0), m_nAmtD(0) { }

  int m_nAmtA, m_nAmtB, m_nAmtC, m_nAmtD;
};

struct StRslt                  // 出力結果
{
  StRslt() : m_nAllMass(0), m_nSugerMass(0) { }

  int m_nAllMass, m_nSugerMass;
};

void fnInput(StCond& roCond)
{
  cin >> roCond.m_nWaterA >> roCond.m_nWaterB >> roCond.m_nSugerC >> roCond.m_nSugerD;
  cin >> roCond.m_nConcE  >> roCond.m_nLimitF;
}

void fnAmtClear(string sProc, const StCond& cnroCond, StAmt& roAmt)
{ 
  if      (sProc == "A")
    { roAmt.m_nAmtA = 0; roAmt.m_nAmtB = 0; roAmt.m_nAmtC = 0; roAmt.m_nAmtD = 0; }
  else if (sProc == "B")
    { roAmt.m_nAmtB = 0; roAmt.m_nAmtC = 0; roAmt.m_nAmtD = 0; }
  else if (sProc == "C")
    { roAmt.m_nAmtC = 0; roAmt.m_nAmtD = 0; }
  else if (sProc == "D")
    { roAmt.m_nAmtD = 0; }
}

int fnAmtSumup(string sProc, const StCond& cnroCond, const StAmt& cnroAmt)
{ 
  if (sProc == "ALL")
    return  (cnroCond.m_nWaterA * cnroAmt.m_nAmtA + cnroCond.m_nWaterB * cnroAmt.m_nAmtB) * 100
          + (cnroCond.m_nSugerC * cnroAmt.m_nAmtC + cnroCond.m_nSugerD * cnroAmt.m_nAmtD);
  else                       // sProc == "SUG"         
    return  (cnroCond.m_nSugerC * cnroAmt.m_nAmtC + cnroCond.m_nSugerD * cnroAmt.m_nAmtD);
}

double fnConcCalc(const StCond& cnroCond, const StAmt& cnroAmt)
{
  static double stnLimtConc = 0.0;

  if (!stnLimtConc)
    stnLimtConc = cnroCond.m_nConcE / (100.0 + cnroCond.m_nConcE);

  double nNowConc =  (double)fnAmtSumup("SUG", cnroCond, cnroAmt)
                    /        fnAmtSumup("ALL", cnroCond, cnroAmt);

  if (stnLimtConc < nNowConc)  return 0.0;
  else                         return nNowConc;
}

void fnConcCheck(const StCond& cnroCond, StRslt& roRslt)
{
  StAmt oAmt;
  double nMaxConc = -1.0;

  fnAmtClear("A", cnroCond, oAmt);
  while (true)
  {
    fnAmtClear("B", cnroCond, oAmt);
    if (fnAmtSumup("ALL", cnroCond, oAmt) > cnroCond.m_nLimitF)  break;

    if (!oAmt.m_nAmtA)  oAmt.m_nAmtB = 1;
    while (true)
    {
      fnAmtClear("C", cnroCond, oAmt);
      if (fnAmtSumup("ALL", cnroCond, oAmt) > cnroCond.m_nLimitF)  break;

      while (true)
      {
        fnAmtClear("D", cnroCond, oAmt);
        if (fnAmtSumup("ALL", cnroCond, oAmt) > cnroCond.m_nLimitF)  break;

        while (true)
        {
          if (fnAmtSumup("ALL", cnroCond, oAmt) > cnroCond.m_nLimitF)  break;

          double nNowConc = fnConcCalc(cnroCond, oAmt);
          if (nMaxConc < nNowConc)
          {
            nMaxConc = nNowConc;
            roRslt.m_nAllMass = fnAmtSumup("ALL", cnroCond, oAmt);
            roRslt.m_nSugerMass = fnAmtSumup("SUG", cnroCond, oAmt);
          }
          oAmt.m_nAmtD++;
        }
        oAmt.m_nAmtC++;
      }
      oAmt.m_nAmtB++;
    }
    oAmt.m_nAmtA++;
  }
}

int main()
{
  StCond oCond;
  StRslt oRslt;

  fnInput(oCond);
  fnConcCheck(oCond, oRslt);
  cout << oRslt.m_nAllMass << " " << oRslt.m_nSugerMass << endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<sstream>
#include<string>
#include<numeric>
#include <algorithm>
#include<math.h>
#include<cstdio>
#include<string.h>
#include<stdio.h>
#include<stdlib.h>




using namespace std;
typedef long long ll;
struct point{
  int x;
  int y;

};
int gcd( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
int lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int input(){
  int x;
  cin>>x;
  return x;
}

int moji(char in)
{
    int ans = (int)in-(int)'a';
    if((ans < 0) || (ans > 25)){
        ans = 26;
    }
    return ans;
}
const int VV=10;//場合に応じてVVの値のみ変更する必要あり
//dijkstra(s)sがスタート地点でそこからの最短距離を配列dで表す。正の重みのみ使用可能
int cost[VV][VV];
int d[VV];
bool used[VV];
void dijkstra(int s){
  fill(d,d+VV,100000);
  fill(used,used+VV,false);
  d[s]=0;
  while(true){
    int v=-1;
    for(int u=0;u<VV;u++){
      if(!used[u]&&(v==-1||d[u]<d[v]))v=u;
    }
    if(v==-1)break;
    used[v]=true;
    for(int u=0;u<VV;u++){
      d[u]=min(d[u],d[v]+cost[v][u]);
    }
  }

}

int compare_int(const void *a, const void *b)//qsort(quick sort利用時に使用)
{
    return *(int*)a - *(int*)b;
}





int main(){
  int N;
  cin>>N;
  int a[N];
  int sum=0;
  for(int i=0;i<N;i++){
    cin>>a[i];
    int x=a[i];
    for(int j=0;;j++){
      if(x%2==0){
        x/=2;
        sum++;
      }else{
        break;
      }

    }
  }
  cout<<sum<<endl;

  



  





  



}


  

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <time.h>

using namespace std;
typedef long long ll;
#define pl pair<ll,ll>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(itr,c) for(__typeof(c.begin()) itr=c.begin(); itr!=c.end(); itr++)
#define dbg(x) cout << #x"="<< (x) << endl
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back(a) 
#define in(x) cin >> x;
#define all(x) (x).begin(), (x).end()
#define INF 2147483600
#define fi first
#define se second

pl dp[60][60];
int main(){
	ll n,a,b;
	cin>>n>>a>>b;
	vector<ll> v(n);
	rep(i,n)cin>>v[i];
	rep(i,n){
		rep(j,n){
			dp[i][j].fi=-1;
		}
	}
	dp[0][0].fi=0;
	dp[0][0].se=1;
	rep(i,n){
		rep(j,n){
			//何も追加しない場合
			if(dp[i+1][j].fi<dp[i][j].fi){
				dp[i+1][j].se=dp[i][j].se;
				dp[i+1][j].fi=dp[i][j].fi;
			}else if(dp[i+1][j].fi==dp[i][j].fi){
				dp[i+1][j].se+=dp[i][j].se;
			}
			//追加する場合
			// dp[i+1][j+1]=max(dp[i][j]+v[i],dp[i+1][j+1]);
			if(dp[i+1][j+1].fi<dp[i][j].fi+v[i]){
				dp[i+1][j+1].se=dp[i][j].se;
				dp[i+1][j+1].fi=dp[i][j].fi+v[i];
			}else if(dp[i+1][j+1].fi==dp[i][j].fi+v[i]){
				dp[i+1][j+1].se+=dp[i][j].se;
			}
		}
	}

	long double ans=-1;
	ll num=0;
	FOR(i,a,b+1){
		if(ans<(long double)dp[n][i].fi/i){
			ans=(long double)dp[n][i].fi/i;
			num=dp[n][i].se;
		}else if(ans==((long double)dp[n][i].fi/i)){
			num+=dp[n][i].se;
		}
	}

	printf("%Lf\n", ans);
	cout<<num<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
using namespace std;
using P = pair<int, int>;

const int N_MAX = 100005;
vector<P> edge[N_MAX];
int color[N_MAX];

void dfs(int v, int p=-1, int c=0){
    int col = 1;
    for(P u : edge[v]){
        if (col == c)col++;
        if (u.first == p)continue;
        color[u.second] = col;
        dfs(u.first, v, col);
        col++;
    }
}

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

    memset(color, 0, sizeof(color));
    dfs(1);
    int k = 0;
    for(int i = 0; i < n-1; i++){
        k = max(k, color[i]);
    }
    cout << k << endl;
    for(int i = 0; i < n-1; i++){
        cout << color[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 11288
use std::io::*;
use std::str::FromStr;

pub fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

pub fn read_n<T: FromStr>(n: usize) -> Vec<T> {
    read_n_logic::<T>(n, vec![])
}

pub fn read_n_logic<T: FromStr>(n: usize, mut a: Vec<T>) -> Vec<T> {
    match n {
        0 => a,
        _ => {
            a.push(read::<T>());
            read_n_logic(n - 1, a)
        }
    }
}
use std::cmp::{max, min};

fn isKaibun(s: &str) -> bool {
    let mut check = true;
    let mut cnt = 0;
    let s_char: Vec<char> = s.chars().collect();
    let s_len = s.len();
    while cnt < s_len / 2 {
        if s_char[cnt] != s_char[s_len - cnt - 1] {
            check = false
        }

        cnt += 1;
    }
    check
}

fn main() {
    let s: String = read();
    let s_len = s.len();
    let a = &s[0..(s_len - 1) / 2];
    let b = &s[(s_len + 3) / 2 - 1..];
    if isKaibun(&s) && isKaibun(a) && isKaibun(b) {
        println!("{}", "Yes");
    } else {
        println!("{}", "No");
    }
}


Measured memory_bytes: 4352
#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
int num[4][3][10]={};
for(int i=0;i<n;i++){
int b, f, r, v;
cin>>b>>f>>r>>v;
num[b-1][f-1][r-1] += v;
}
for(int i=0;i<4;i++){
if(i) cout<<"####################"<<endl;
for(int j=0;j<3;j++){
for(int k=0;k<10;k++){
cout<<" "<<num[i][j][k];
}
cout<<endl;
}
}
return 0;
}


Measured memory_bytes: 3092
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using ld=long double;
using st=string;
using ch=char;
typedef pair<ll,ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<P> vP;
typedef vector<ch> vc;
typedef vector<vc> vvc;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,n) FOR(i,0,n)
#define ROF(i,a,b) for(ll i=a;i>=b;i--)
#define per(i,a) ROF(i,a,0)
#define pb push_back
const ll MOD=1000000007;
const ll MOD2=998244353;
const ld PI=acos(-1);
const ll INF=1e18;
st abc="abcdefghijklmnopqrstuvwxyz";
st ABC="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
struct edge{ll to,cost;};

vl G[100000];
vl visited(100000,0);

void bfs(ll s){
  queue<ll> que;
  que.push(s);
  visited[s]=1;
  while(!que.empty()){
    ll v=que.front();
    que.pop();
    ll x=G[v].size();
    rep(i,x){
      ll nv=G[v][i];
      if(visited[nv]==1){
        continue;
      }
      visited[nv]=1;
      que.push(nv);
    }
  }
}

int main() {
  ll n,m;
  cin >> n >> m;
  rep(i,m){
    ll x,y,z;
    cin >> x >> y >> z;
    x--;y--;
    G[x].pb(y);
    G[y].pb(x);
  }
  ll cnt=0;
  rep(i,n){
    if(visited[i]==0){
      bfs(i);
      cnt++;
    }
  }
  cout << cnt << endl;
}

Measured memory_bytes: 11040
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <climits>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;

const int MOD = (int)1e9 + 7;
const int N = 300000;
ll fact[N];
ll invfact[N];

void init_fact() {
    fact[0] = 1;
    FOR(i, 1, N - 1) fact[i] = fact[i - 1] * i % MOD;
}

ll power(ll x, ll n) {
    if(n == 0) return 1;
    else if(n == 1) return x % MOD;
    else if(n % 2 == 0) {
        ll buf = power(x, n / 2);
        return buf * buf % MOD;
    } else {
        ll buf = power(x, n / 2);
        return buf * buf % MOD * x % MOD;
    }
}

void init_inv() {
    REP(i, N) invfact[i] = power(fact[i], MOD - 2) % MOD;
}

ll comb(int n, int r) {
    return fact[n] * invfact[n - r] % MOD * invfact[r] % MOD;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int h, w, a, b;
    cin >> h >> w >> a >> b;
    init_fact();
    init_inv();

    ll ans = 0;
    REP(i, w - b) 
        ans = (ans + comb(h - a - 1 + b + i, b + i) * comb(a - 1 + w - b - 1 - i, a - 1) % MOD) % MOD;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 4992