akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			while (true) {
				boolean chikachika = true; //点滅するフラグ
				int a = sc.nextInt(); //第一入力
				int b = sc.nextInt(); //第二入力
				char output[][] = new char[a][b]; //二次元配列作成
				if(a == 0 && b == 0) {
					break; //00のときループを抜ける
				}
				for(int i = 0; i < a; i++) {
					for(int j = 0; j < b; j++) {
						if(chikachika){
							output[i][j] = '#';
						}else {
							output[i][j] = '.';
						}
						chikachika = !chikachika; //点滅
						System.out.print(output[i][j]);
					}
					System.out.println(); //改行
					if(b % 2 == 0) {
						chikachika = !chikachika; //偶数の場合フラグ変更
					}
				}
				System.out.println(); //改行
			}
		}
	}
}



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

template<class RandomAccessIterator, class T>
bool range(RandomAccessIterator first, RandomAccessIterator last, const T& value){
    while(last - first > 1){
        auto mid = first + (last - first) / 2;
        (*mid < value ? first : last) = mid;
    }
    return *last == value;
}

int main(){
    long long n;
    cin >> n;
    
    vector<long long> S(n + 2);
    for(int i = 1; i <= n; ++i)cin >> S[i];
    S[n + 1] = numeric_limits<int>::max();
    
    long long q;
    cin >> q;
    
    long long T, ans(0);
    for(int i = 0; i < q; ++i){
        cin >> T;
        ans += range(S.begin(), S.end(), T);
    }
    cout << ans << endl;
}


Measured memory_bytes: 3628
n = gets.to_i
h = {}
n.times do
  s = gets
  h[s.chomp]=34
end

for m in ["S", "H", "C", "D"] do
  for i in 1..13 do
    puts "#{m} #{i}" if !h.has_key?(m+" "+i.to_s)
  end
end


Measured memory_bytes: 6848
#include <bits/stdc++.h>
using namespace std;
#define int long long   // <-----!!!!!!!!!!!!!!!!!!!
 
#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n)-1;i>=0;i--)
#define rrep2(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define printV(v) for(auto&& x : v){cout << x << " ";} cout << endl
#define printVV(vv) for(auto&& v : vv){for(auto&& x : v){cout << x << " ";}cout << endl;}
#define printP(p) cout << p.first << " " << p.second << endl
#define printVP(vp) for(auto&& p : vp) printP(p);
 
typedef long long ll;
typedef pair<int, int> Pii;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<Pii> vp;
const int inf = 1e9;
const int mod = 1e9 + 7;
typedef vector<vector<int>> Graph;
 
typedef unsigned long long ull;
const ull B = 1e9 + 7;
 
int N;
Graph G;
map<ull, int> cnt; // {hash, num}
 
ull dfs(int v) {
    ull ret = 1;
    for (auto nxt : G[v]) {
        ret += dfs(nxt) * B;
    }
    cnt[ret]++;
    return ret;
}
 
signed main() {
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
 
    cin >> N;
    G.resize(N);
    rep(i, N - 1) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        G[a].emplace_back(b);
    }
 
    dfs(0);
 
    int ans = 0;
    for (auto p : cnt) {
        ans += p.second * (p.second - 1) / 2;
    }
 
    cout << ans << endl;
}

Measured memory_bytes: 19244
#include <stdio.h>

#define MAX 100000

int
partition(int array[], int p, int r)
{
        int i, j;
        int a;
        int standard_num;

        standard_num = array[r];
        i = p - 1;

        for (j = p; j < r; j++) {
                if (array[j] <= standard_num) {
                        i++;
                        a = array[i];
                        array[i] = array[j];
                        array[j] = a;
                }
        }
        a = array[i + 1];
        array[i + 1] = array[r];
        array[r] = a;

        return i + 1;
}

int
main(void)
{
        int array[MAX];
        int array_len;
        int i;
        int standard;

        scanf("%d", &array_len);

        for (i = 0; i < array_len; i++)
                scanf("%d", &array[i]);

        standard = partition(array, 0, (array_len - 1));

        for (i = 0; i < array_len; i++) {
                if (i)
                        printf(" ");
                if (i == standard)
                        printf("[");

                printf("%d", array[i]);

                if (i == standard)
                        printf("]");
        }

        printf("\n");

        return 0;
}



Measured memory_bytes: 2144
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define INF 1e9

#define int long long

int N,L;
string s;
vector <string>S;
signed main(){
  cin>>N>>L;
  for(int i=0;i<N;i++){
    cin>>s;
    S.push_back(s);
  }
  sort(S.begin(),S.end());
  for(int i=0;i<N;i++){
    cout<<S[i];
  }
  cout<<endl;

}


Measured memory_bytes: 256
// Last Change: 06/29/2019 21:04:03.
#include <algorithm>
#include <array>
#include <bitset>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

namespace NS {
void LoopUntilZeroInpput() {
  int hogegegege = 0;
  while (cin >> hogegegege && hogegegege != 0) {
  }
}
} // namespace NS

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

  map<char, int> mp;
  for (int i = 0; i < 4; ++i) {
    ++mp[S[i]];
  }

  if (mp.size() == 2) {
    if (mp[S[0]] == 2) {
      cout << "Yes" << endl;
    } else {
      cout << "No" << endl;
    }
  } else {
    cout << "No" << endl;
  }

  //NS::LoopUntilZeroInpput();
}


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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define pb push_back
#define pf push_front
#define mod 1000000007
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define Cout(n) cout<<(n)<<endl
#define INF 1000000000000000000LL

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;
typedef vector<string> vs;
const double pi = acos(-1.0);

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

int main()
{
	ll n,h,a,sum=0;
	cin >> h >> n;
	rep(i,n){
		cin >> a;
		sum+=a;
	}
	cout << (sum>=h?"Yes\n":"No\n");
	return 0;
}


Measured memory_bytes: 256
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
import std.exception;

void main() {
  int n;
  readf (" %d", &n);
  auto s = new int[n+1];
  immutable int all = (n * (n + 1)) / 2;
  foreach (i; 1 .. n) {
    s[i] = all - i;
  }
  debug stderr.writeln (s[1..n+1]);
  bool[int] block;
  //if (n & 1) {block[ 1 * (n + 1) + ((n + 1) >> 1)] = true;}
  {
    int i = 1, j = n;
    if (j & 1) --j;
    while (i < j) {
      block[ i * (n + 1) + j] = true;
      ++i;
      --j;
    }
  }
  Tuple!(int, int)[] t;
  void addEdge (int i, int j) {
    s[i] += j;
    s[j] += i;
    t ~= tuple (i, j);
  }
  s[] = 0;

  foreach (i; 1 .. n) {
    foreach (j; i+1 .. n + 1) {
      if (i * (n + 1) + j in block) continue;
      addEdge (i, j);
    }
  }
  debug stderr.writeln(s[1 .. n + 1]);
  writeln (t.length);
  foreach (const ref p; t) {
    writeln (p[0], ' ', p[1]);
  }
  foreach (i; 2 .. n + 1) {
    enforce (s[i] == s[i-1]);
  }
}



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

using namespace std;
using ll = long long;
using vec = vector<ll>;
using mat = vector<vec>;

#define INF (1LL << 60)
#define MOD 1000000007
#define PI 3.14159265358979323846

#define REP(i,m,n) for(ll (i)=(m),(i_len)=(n);(i)<(i_len);++(i))
#define FORR(i,v) for(auto (i):v)
#define ALL(x) (x).begin(), (x).end()
#define PR(x) cout << (x) << endl
#define PS(x) cout << (x) << " "
#define SZ(x) ((ll)(x).size())
#define MAX(a,b) (((a)>(b))?(a):(b))
#define MIN(a,b) (((a)<(b))?(a):(b))
#define ASC(x) sort(ALL((x)))
#define DESC(x) sort(ALL((x)),greater<ll>())
#define REV(x) reverse(ALL((x)))
#define eb emplace_back

int main()
{
    ll N;
    cin >> N;
    
    string S;
    while(N > 0) {
        S += (char)((N-1) % 26 + 'a');
        N -= (N-1) % 26;
        N /= 26;
    }
    REV(S);
    PR(S);

    return 0;
}

/*

26 * 26 + 26

*/

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
const int N = 2e5+5;
const int M = 1e6+5;
const LL Mod = 1e18;
#define pi acos(-1)
#define INF 1e8
#define INM INT_MIN
#define pb(a)  push_back(a)
#define mk(a,b) make_pair(a,b)
#define dbg(x) cout << "now this num is " << x << endl;
#define met0(axx) memset(axx,0,sizeof(axx));
#define metf(axx) memset(axx,-1,sizeof(axx));
#define sd(ax) scanf("%d",&ax)
#define sld(ax) scanf("%lld",&ax)
#define sldd(ax,bx) scanf("%lld %lld",&ax,&bx)
#define sdd(ax,bx) scanf("%d %d",&ax,&bx)
#define sddd(ax,bx,cx) scanf("%d %d %d",&ax,&bx,&cx)
#define sfd(ax) scanf("%lf",&ax)
#define sfdd(ax,bx) scanf("%lf %lf",&ax,&bx)
#define pr(a) printf("%d\n",a)
#define plr(a) printf("%lld\n",a)
LL L[N],r[N];
int main()
{
    int n;sd(n);
    for(int i=1;i<=n;++i) sldd(L[i],r[i]);
    sort(L+1,L+n+1);
    sort(r+1,r+n+1);
    if(n&1)//奇数时
    {
        LL ans = r[(n+1)/2]-L[(n+1)/2]+1;
        plr(ans);
    }
    else
    {
        LL maxx = (r[n/2]+r[n/2+1]);
        LL mixx = (L[n/2]+L[n/2+1]);
        LL ans = maxx-mixx+1;
        plr(ans);
    }
   // system("pause");
    return 0;
}

Measured memory_bytes: 6952
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m), b(m);
  rep(i, m) {
    cin >> a[i] >> b[i];
    a[i]--, b[i]--;
  }

  vector<bool> f(n, false), t(n, false);
  rep(i, m) {
    if (a[i] == 0) f[b[i]] = true;
    if (b[i] == n - 1) t[a[i]] = true;
  }

  rep(i, n) {
    if (f[i] && t[i]) {
      cout << "POSSIBLE" << endl;
      return 0;
    }
  }
  cout << "IMPOSSIBLE" << endl;


  
  return 0;
}

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

int n, m;
bool g[10][10];
bool h[10];
int res = 0;

void dfs(int i){
  bool flag = true;
  rep(j, n){
    if(!h[j]){
      flag = false;
    }
  }
  if(flag){
    res++;
    return;
  }
  rep(j, n){
    if(g[i][j] && !h[j]){
      h[j] = true;
      cerr << i << " "<< j << endl;
      dfs(j);
      h[j] = false;
    }
  }
}

int main(){
  cin >> n >> m;
  rep(i, m){
    int a, b;
    cin >> a >> b;
    g[a - 1][b - 1] = g[b - 1][a - 1] = true;
  }
  rep(i, n) h[i] = 0;
  rep(i, n){rep(j, n)cerr << g[i][j];cerr << endl;}
  h[0] = true;
  dfs(0);
  cout << res << endl;
  return 0;
}

Measured memory_bytes: 256
#define ll long long
#define ffor(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--)
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<cmath>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#define SIZE 100001
#define MOD 1000000007
#define INF 100000000
using namespace std;
int n,m;
bool G[51][51];
bool memo[51];

void dfs(int c){
    memo[c] = true;
    REP(j, n){
        if(G[c][j] == false) continue;
        if(memo[j]) continue;
        dfs(j);
    }

}


int main(){
    //int n,m;
    cin >> n >> m;

    REP(i,51){
        REP(j,51){
            G[i][j] = false;
        }
    }

    int a[51],b[51];

    REP(i, m){
        cin >> a[i] >> b[i];
        a[i]--;
        b[i]--;
        G[a[i]][b[i]] = true;
        G[b[i]][a[i]] = true;
    }

    int ans = 0;
    REP(i, m){
        G[a[i]][b[i]] = false;
        G[b[i]][a[i]] = false;
        
        REP(k, 51) memo[k] = false;

        dfs(0);

        int flag = 0;
        REP(k, n){
            if(memo[k] == false){
                flag = 1;
                break;
            }
        }
        if(flag == 1) ans++;
        G[a[i]][b[i]] = true;
        G[b[i]][a[i]] = true;
    }

    cout << ans << endl;
}

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

int n;
const int N=1e+5+5;
vector<int> adj[N];
int dist1[N],dist2[N];
int ans=0;
void dfs(int v,int p,int d)
{
    dist1[v]=d;
    for(auto it:adj[v])
        if(it!=p)
            dfs(it,v,d+1);
}
void dfs2(int v,int p,int d)
{
    dist2[v]=d;
    if(dist1[v]<=d)
        return;
    for(auto it:adj[v])
    {
        if(it!=p)
        {
            dfs2(it,v,d+1);
        }
    }
    if(adj[v].size()==1)
        ans=max(ans,dist1[v]-1);
}
int main()
{
    int v,u;
    cin>>n>>v>>u;
    for(int i=0;i<n-1;i++)
    {
        int a,b;
        cin>>a>>b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    dfs(u,u,0);
    dfs2(v,v,0);
    cout<<ans;
}

Measured memory_bytes: 10624
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <bitset>
#include <cstdlib>
#include <cmath>
#include <set>
#include <list>
#include <deque>
#include <map>
#include <queue>
#include <fstream>
#include <cassert>
#include <cmath>
#include <sstream>
#include <time.h>
#include <complex>
#include <iomanip>
//#include <unordered_set>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef pair<int,int> ii;
typedef pair<double,double> dd;
typedef pair<char,char> cc;
typedef vector<ii> vii;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> l4;
const double eps = 0.005;
const int maxn = 200010;
const ll mod = 1e9+7;
const int INF = 1e9;
const double pi = acos(-1);
typedef double Matrix[maxn][maxn];
int n;
ii xv[maxn];
int rk[maxn];
map<int,int> mm;
ii lr[maxn];
ll seg[4*maxn];
ll dp[maxn];
void insert(int cur, int l, int r, int p, ll x) {
    if (l == r) {
        seg[cur] = x;
        return;
    }
    int mid = (l+r)/2;
    if (mid >= p) {
        insert(2*cur,l,mid,p,x);
    } else {
        insert(2*cur+1, mid+1, r, p, x);
    }
    seg[cur] = (seg[2*cur]+seg[2*cur+1])%mod;
}

ll query(int cur, int l, int r, int L, int R) {
    if (L <= l && R >= r) {
        return seg[cur];
    }
    if (l > R || r < L) {
        return 0;
    }
    int mid = (l+r)/2;
    ll ret = 0;
    if (mid >= L) {
        ret += query(2*cur, l, mid, L, R);
    }
    if (mid < R) {
        ret += query(2*cur+1, mid+1, r, L, R);
    }
    return ret;
}

int main() {
    scanf("%d",&n);
    int x,v;
    for (int i = 0; i < n; i++) {
        scanf("%d%d",&x,&v);
        xv[i] = {v,x};
        mm[x];
    }
    int tot = 0;
    for (auto it = mm.begin(); it != mm.end(); it++) {
        it->second = tot++;
    }
    sort(xv,xv+n);
    for (int i = 0; i < n; i++) {
        rk[mm[xv[i].second]] = i;
    }
    int pt1 = 0;
    int pt2 = n-1;
    for (int i = 0; i < n; i++) {
        int x = xv[rk[i]].second;
        while (xv[pt1].second < x) {
            pt1++;
        }
        lr[i].second = pt1+1;
    }
    for (int i = n-1; i >= 0; i--) {
        int x = xv[rk[i]].second;
        while (xv[pt2].second > x) {
            pt2--;
        }
        lr[i].first = pt2+1;
    }
    sort(lr,lr+n);
    int pos = 0;
    for (int i = 1; i <= n; i++) {
        if (lr[pos].first == i) {
            while (lr[pos].first == i) {
                int l = lr[pos].second;
                dp[i] += query(1, 1, n, max(l-1,1), i);
                pos++;
                if (l == 1) dp[i]++;
                dp[i] %= mod;
                insert(1, 1, n, i, dp[i]);
            }
        }
    }
    cout << dp[n] << endl;
    return 0;
}






Measured memory_bytes: 21376
/*************************************************\
           In the name of almighty ALLAH
                 MD.Faysal Hasan
                Comilla Univesity
\*************************************************/

#include<bits/stdc++.h>
using namespace std;

#define     ikarus_101  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef     long long             ll;
typedef     long double           ld;
typedef     unsigned long long    ull;
typedef     vector<ll>            vll;
typedef     pair<ll,ll>           pll;
typedef     vector<pll>           vpl;
typedef     map<ll,ll>            mll;
typedef     multiset<ll>          msl;
typedef     multimap<ll,ll>       Mll;
using pqboro=priority_queue<ll,vll,less<ll>>;
using pqchoto=priority_queue<ll,vll,greater<ll>>;

#define    all(str)       str.begin(),str.end()
#define    sajo(str)      sort(str.begin(),str.end())
#define    rev(str)       reverse(str.begin(),str.end())
#define    usajo(str)     sort(str.rbegin(),str.rend())
#define    vin(a)         for(auto &it : a) cin>>it
#define    vout(a)        for(auto it:a) cout<<it<<' ';cout<<nn
#define    vmax(a)        *max_element(all(a))
#define    vmin(a)        *min_element(all(a))
#define    pb             push_back
#define    eb             emplace_back
#define    mkp(x,y)       make_pair(x,y)
#define    F              first
#define    S              second
#define    yes            cout<<"Yes"<<nn
#define    no             cout<<"No"<<nn
#define    nn             "\n" ///endl
#define    rep(i,n)       for (i=0;i<n;++i )
#define    rep1(i,n)      for (i=1;i<=n;++i )

#define    min3(a,b,c)    min(a,min(b,c))
#define    max3(a,b,c)    max(a,max(b,c))
#define    sqr(x)         ((x)*(x))
#define    pi             2*acos(0.0)
#define    gcd(a,b)       __gcd(a,b)
#define    lcm(a,b)       (a/gcd(a,b))*b
#define    mem(a,b)       memset(a,b,sizeof (a))
#define    dec(x)         cout<<fixed<<setprecision(x)
#define    none(n)         __builtin_popcountll(n)

template < typename T > string toString ( T Number ) { stringstream ss ; ss << Number ; return ss.str() ; }
template < typename T > ll toll ( T str ) { stringstream ss ; ss << str ; ll num ; ss >> num ; return num ; }
ll power(ll n , ll k) { if(k == 0) return 1 ; if(k&1) return n*sqr(power(n,k/2)) ; else return sqr(power(n,k/2)); }

const   int  N   =   2e5+7;
const   int  M   =   1e9+7;
const   ll  inf  =   0x7f7f7f7f7f7f7f7f;
const   int dx[] =   {+1,+2,+2,+1,-1,-2,-2,-1};
const   int dy[] =   {-2,-1,+1,+2,+2,+1,-1,-2};

int main() {ikarus_101

    ll n,m,i,j,k,x;

    string s ; cin>>s;
    n = s.size();
    ll ct = 0;
    rep(i,n)
    {
        ct += (s[i]-48);
    }
    if(ct%9==0) {
        yes;
    }
    else {
        no;
    }













    return 0;
}


Measured memory_bytes: 3744
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue>
#include <climits> 
#include <time.h>

int main()
{
 //clock_t start=clock();
    long X;
    std::cin >> X;
    long temp=100;
    long year=0;
    while(temp<X){
        year++;
        temp=1.01*temp;
    }
    std::cout << year << std::endl;
    //clock_t end=clock();
//std::cout << static_cast<double>(end-start)/CLOCKS_PER_SEC * 1000.0 << std::endl;
    return 0;
}

Measured memory_bytes: 3636
// BWOTSHEWCHB

#include <bits/stdc++.h>

using namespace std ;

#define pb push_back
#define in insert
#define X first
#define Y second

const int MAXN = 1e6 + 69 , MOD = 1e9 + 7 ; 

int n , m , ans , mark[MAXN] , dist[MAXN] ;
vector <int> top , g[MAXN] , rev[MAXN] ;

void dfs(int v) {
	mark[v] = 1 ;
	for ( auto u : g[v] )
		if ( !mark[u] )
			dfs(u) ;
	top.pb(v) ;
}

int32_t main() {
	ios::sync_with_stdio(false) ;
	cin.tie(0) ; cout.tie(0) ;
	cin >> n >> m ;
	int v , u ;
	for ( int i = 1 ; i <= m ; i ++ )
		cin >> v >> u , g[v].pb(u) , rev[u].pb(v) ;
	for ( int i = 1 ; i <= n ; i ++ )
		if ( !mark[i] )
			dfs(i) ;
	while ( top.size() ) {
		int v = top.back() ;
		for ( auto u : rev[v] )
			dist[v] = max(dist[v] , dist[u] + 1) ;
		top.pop_back() ;
		ans = max(ans , dist[v]) ;
	}
	cout << ans << "\n" ;
}


Measured memory_bytes: 60284
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPR(i, n) for(int i = (int)(n); i >= 0; i--)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

int main() {
    ll N, M;
    cin >> N >> M;
    priority_queue<ll> A;
    ll a;
    ll total = 0;
    
    REP(i, N) {
        cin >> a;
        A.push(a);
    }

    while (M--) {
        ll top = A.top();
        A.pop();
        A.push(top/2);
    }

    while (!A.empty()) {
        total += A.top();
        A.pop();
    }
    
    cout << total << endl;
    return 0;
}



Measured memory_bytes: 1400
import sys 
import numpy as np

def main():
    grid = np.array(sys.stdin.read().split(), dtype=np.int64).reshape(3, 3)
    
    grid = grid - grid[0]
    grid = grid.T 
    grid = grid - grid[0]
    if np.all(grid == 0):
        ans = 'Yes'
    else:
        ans = 'No'
    print(ans)

if __name__ == "__main__":
    main()


Measured memory_bytes: 12488
#include<iostream>
#include <string> 
#include <vector>  
#include<math.h>
#include <algorithm>
#include<iomanip>
#define INF 1000000000
#define LM 55555
using namespace::std;

long long D;
double bc, now, C, H, W, X, Y, ans, r,l,numcon,N,M;
string S,s;


int main() {
	cin >>N>>M>>D;

	if (D != 0) {
		H = (M - 1) / N;
		W = 2*(N - D) / N;
	}
	else {
		H = (M - 1) / N;
		W = (N - D) / N;
	}

	if (H*W >= 0) {
		cout <<setprecision(10)<< H*W << endl;
	}
	else {
		cout << setprecision(10) <<(-(H*W)) << endl;
	}
	return 0;

}




Measured memory_bytes: 256
import itertools
import decimal
import math
import collections
import sys
input = sys.stdin.readline


# S=(input())
# N=int(input())
# N,K=map(int,input().split())
# ListA=list(map(int,input().split()))
# ListA.sort()#reverse=True)



def resolve():
    N=int(input())
    AC=0
    WA=0
    TLE=0
    RE=0
    for i in range(N):
        S=input().strip()
        if(S=="AC"):
            AC+=1
        elif(S=="WA"):
            WA+=1
        elif(S=="TLE"):
            TLE+=1
        else:
            RE+=1
    print("AC x "+str(AC))
    print("WA x "+str(WA))
    print("TLE x "+str(TLE))
    print("RE x "+str(RE))
    


resolve()




Measured memory_bytes: 9840
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <random>
#include <chrono>
#include <string>
#include <bitset>
#include <cassert>
#include <queue>
#include <memory>

//#pragma comment(linker, "/STACK:16777216")
//#pragma GCC optimize("O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("unswitch-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,sse4.1,sse4.2,abm,mmx,avx,avx2,popcnt,tune=native")

using namespace std;

//mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

#define ll long long
#define ull unsigned long long
//#define double long double
#define int ll
//#define int ull
//#define int short
//#define int unsigned short
//#define int unsigned int
#define mp make_pair
#define F first
#define S second
#define pii pair<int, int>
#define hash hash228
const int SZ = 1e5 + 4;
const double EPS = 1e-7;
const int mod = 998244353;
const int hashpow = 127;
const int inf = 2e9;

int a, b, c;

void read() {
    cin >> a >> b >> c;
}

void solve() {
    swap(a, b);
    swap(a, c);
    cout << a << " " << b << " " << c << "\n";
}

signed main() {

#ifdef __LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif

//    int t;
//    cin >> t;
//    for (int i = 0; i < t; ++i) {
        read();
        solve();
//    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
#include <algorithm>
using namespace std; //std::の省略のため
using ll = long long;

#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
const int MAX = 510000;

long long fac[MAX], finv[MAX], inv[MAX];

int main()
{

    ll n;
    cin >> n;

    ll sum = 0;

    for (ll i = 1; i < n; i++)
    {
        sum += (n - 1) / i;
    }

    cout << sum << endl;
}


Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N= Integer.parseInt(sc.next());
		String S =sc.next();
		char[] c = S.toCharArray();
		int check=1;
		if(N%2==0){
			for(int i=0;i<N/2;i++){
				if(c[i]!=c[i+N/2]){
					check=0;
					break;
				}
			}

			if(check==1){
				System.out.println("Yes");
			}else{
				System.out.println("No");
			}
		}else{
			System.out.println("No");
		}

	}

}

Measured memory_bytes: 23892
#include<bits/stdc++.h>
#define forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */

int main() {
    string t;
    cin >> t;
    rep(i, t.size()) {
        if(t[i] == '?') t[i] = 'D';
    }
    cout << t << endl;
    return 0;
}

Measured memory_bytes: 3676
#include <stdio.h>

int main(void)
{
    char s[50][51];
    int h,w,t,i,j;
    scanf("%d%d",&h,&w);
    for(i=0;i<h;i++)scanf("%s",s[i]);
    for(i=0;i<h;i++){
        for(j=0;j<w;j++){
            t=0;
            if(s[i][j]!='#'){
                if(i-1>=0){
                    if(s[i-1][j]=='#')t++;
                }
                if(i-1>=0&&w>j+1){
                    if(s[i-1][j+1]=='#')t++;
                }
                if(w>j+1){
                    if(s[i][j+1]=='#')t++;
                }
                if(h>i+1&&w>j+1){
                    if(s[i+1][j+1]=='#')t++;
                }
                if(h>i+1){
                    if(s[i+1][j]=='#')t++;
                }
                if(h>i+1&&j-1>=0){
                    if(s[i+1][j-1]=='#')t++;
                }
                if(j-1>=0){
                    if(s[i][j-1]=='#')t++;
                }
                if(h-1>=0&&j-1>=0){
                    if(s[i-1][j-1]=='#')t++;
                }
                printf("%d",t);
            }
            else printf("#");
        }
        puts("");
    }
    return 0;
}

Measured memory_bytes: 128
/**
>>> In The Name Of GOD
**/
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> pii;
typedef pair <ll,ll> pll;

#define pb push_back
#define pp pop_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define F first
#define S second
#define bs binary_search
#define smin(x,y) (x) = min((x) ,(y))
#define smax(x,y) (x) = max((x) ,(y))
#define sz(x) (int)(x).size()
#define ssz(x) (int)(x).length()
#define all(x) (x).begin(),(x).end()

//freopen("input.txt","r",stdin); freopen("output.txt","w",stdout);

///ifstream fin("input.txt");
///ofstream fout("output.txt");


bool cmp_pair_F_2(pair <int,int> x, pair <int,int> y)
{
    return x.F>y.F;
}
bool cmp_pair_S_2(pair <int,int> x, pair <int,int> y)
{
    return x.S>y.S;
}
bool cmp_pair_S_1(pair <int,int> x, pair <int,int> y)
{
    return x.S<y.S;
}

bool cmp(int x, int y)
{
	return x>y;
}



int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    //int i,j;
	int n;
	cin >> n;
	vector < pair <string,pii> > v;
	for (int i=0;i<n;i++)
    {
        string s;
        cin >> s;
        int x;
        cin >> x;
        v.pb({s, {-x,i+1}});
    }
    sort(all(v));
    for (auto i:v)
        cout << i.S.S << endl;
    return 0;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define str to_string
#define endl "\n"
#define PI 3.141592653589
using namespace std;
using lint = long long;
template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

//AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC(*'ω'*)AC
int main(){
    string s;cin>>s;
    char rem1=s[0],rem2=s[1];
    if(rem1==rem2){
        cout<<1<<" "<<2<<endl;
        return 0;
    }
    for(int i=2;i<s.size();i++){
        if(rem1==s[i]){
            cout<<i-1<<" "<<i+1<<endl;return 0;
        }
        if(rem2==s[i]){
            cout<<i<<" "<<i+1<<endl;return 0;
        }
        rem1=rem2;rem2=s[i];
    }
    cout<<-1<<" "<<-1<<endl;
}


Measured memory_bytes: 3712
from collections import deque

n, x, y = [int(x) for x in input().split()]
x -= 1
y -= 1
BIG = 65521
ans = {i: 0 for i in range(n)}


def bfs(start_v):
    """ある始点からほかの全点に行くまでの最短距離を求める。"""
    qu = deque()
    qu_append = qu.append
    qu_popleft = qu.popleft
    qu_append(start_v)
    # 始点からvに移動するまでの最短距離: dist[v]
    dist = [BIG] * n

    def push(v, d):
        """始点からvまでの最短距離が算出されていないときに，その距離を保存し，
        キューに頂点vを追加する。"""
        if dist[v] != BIG:
            # 既に訪問済みで距離が求められている。
            return
        dist[v] = d
        qu_append(v)

    push(start_v, 0)

    while len(qu):
        v = qu_popleft()
        # 始点からvの次の頂点へ移動する距離。
        d = dist[v] + 1
        if v < n - 1:
            push(v + 1, d)
        if v > 0:
            push(v - 1, d)
        if v == x:
            push(y, d)
        if v == y:
            push(x, d)

    for i in range(n):
        if dist[i] != 0:
            ans[dist[i]] += 1


def main():
    for i in range(n):
        bfs(i)

    for i in range(1, n):
        print(ans[i] // 2)


if __name__ == '__main__':
    main()

# TLE


Measured memory_bytes: 52444
#include "bits/stdc++.h"

#define REP(i,num) for(int i=0;i<(num);++i)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

constexpr int atcoder_mod = 1e9+7;

using namespace std;
using ll = long long;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

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

	int N=in(),A=in(),B=in();
	
	out(min(N*A,B));
	return 0;
}


Measured memory_bytes: 256
def main():
    n = int(input())
    ac, wa, tle, re = 0, 0, 0, 0
    for i in range(n):
        s = input()
        if s == 'AC':
            ac += 1
        elif s == 'WA':
            wa += 1
        elif s == 'TLE':
            tle += 1
        elif s == 'RE':
            re += 1
    print(f"AC x {ac}")
    print(f"WA x {wa}")
    print(f"TLE x {tle}")
    print(f"RE x {re}")
    return 0

if __name__ == "__main__":
    main()
        

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

typedef long long  ll;
typedef vector<int> vec;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int>par;
typedef vector<par>vpar;

#define forn(i,n) for(ll i=0;i<n;i++)
#define wez(n) ll (n); cin>>(n);
#define setmax(a,b) (a)=max((a),(b))
#define setmin(a,b) (a)=min((a),(b))
#define pb push_back
#define mp make_pair
#define outa(a,e) forn(i,e) cout << a[i] << (i==e-1?'\n':' ')
#define oute(n) cout<<n<<"\n"

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
   /* #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif*/
    wez(n);
    vector<ll>dp(3,0);
    forn(i,n){
      vector<ll>new_dp(3,0);
      vector<int>cost(3);
      forn(j,3) cin>>cost[j];
      forn(j,3){
        forn(k,3){
          if(j!=k){
            new_dp[k]=max(new_dp[k],dp[j]+cost[k]);
          }
        }
      }
      dp=new_dp;
    }
    cout<<max(dp[0],max(dp[1],dp[2]));
return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define debug(x) cerr << #x << " " << (x) << endl
using namespace std;

const int N = 100005;
const long long mod = 1000000007ll;

int n;
long long x[N], inv[N], fac[N], ans = 0ll;

int main () {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) scanf("%lld", &x[i]);

	fac[0] = 1ll;
	for (int i = 1; i < n; i++) fac[i] = fac[i - 1] * i % mod;

	inv[1] = 1ll;
	for (int i = 2; i <= n; i++) inv[i] = (mod / i) * (mod - inv[mod % i]) % mod;

	long long now = 0ll;
	for (int i = 1; i < n; i++) now = (now + inv[i]) % mod, ans = (ans + now * fac[n - 1] % mod * (x[i + 1] - x[i]) % mod) % mod;
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define debug(x) cerr << # x << "; "<< x << endl


int main() {
	int K, X;
	cin >> K >> X;
	for (int i = X - K + 1; i < K + X; i++) {
		cout << i << " ";
	}
}

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

typedef long long  ll;

ll MOD = 1000000007;
ll INF = 100000000000000000;
double PI = 3.1415926535;

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

int main(){
  int N,M;cin >> N >> M;
  ll DATE[1010][3];
  for(int i = 0;i < N;i++){
    for(int j = 0;j < 3;j++){
      cin >> DATE[i][j];
    }
  }
  ll ans = -INF;
  for(int m = 0;m < (1 << 3);m++){
    bitset<3> S(m);
    ll sum = 0;
    priority_queue<ll> Q;
    for(int i = 0;i < N;i++){
      ll val = 0;
      for(int j = 0;j < 3;j++){
        if(S.test(j)){
          val += DATE[i][j];
        }else{
          val += -DATE[i][j];
        }
      }
      Q.push(val);
    }
    for(int i = 0;i < M;i++){
      sum += Q.top();Q.pop();
    }
    ans = max(ans,sum);
  }
  cout << ans << endl;
}


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

int main() {
  int N,K;
  cin >> N >> K;
  
  int sumOfMigration=0;

  for (int i=0; i<N; i++){
    int x;
    cin >> x;
    
    int ML_A=0;
    int ML_B=0;
    ML_A=2*x;
    ML_B=abs(2*(x-K));
    if (ML_A>ML_B)
      sumOfMigration += ML_B;
    else
      sumOfMigration += ML_A;
  }
  
  cout << sumOfMigration << endl; 
}


Measured memory_bytes: 256
n,k=(int(i) for i in input().split())

e = [[int(i) for i in input().split()] for j in range(n)]
#print(e)

dp=[[0 for i in range(k+1)] for j in range(n+1)]

for i in range(n-1,-1,-1):
  for j in range(k+1):
    if j < e[i][0]:
      dp[i][j]=dp[i+1][j]
    else:
      dp[i][j]=max(dp[i+1][j],dp[i+1][j-e[i][0]]+e[i][1])

print(max(dp[0]))


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

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> d(n);
    for(int i=0; i<n; i++){
        cin >> d.at(i);
    }

    sort(d.rbegin(),d.rend());

    int cnt = 1;
    for(int i=1; i<n; i++){
        if(d.at(i) == d.at(i-1))
            continue;
        cnt++;
    }

    cout << cnt << endl;
}


Measured memory_bytes: 3628
ans=0
def dfs(lim,cnt,p):
    P=p.copy()
    global ans
    if(cnt==lim):
        res=''
        for x,y in zip(S,P):
            res+=x+y
        ans+=eval(res)
        return
    dfs(lim,cnt+1,P)
    P[cnt]='+'
    dfs(lim,cnt+1,P)
    
S=input()
p=['']*(len(S))
dfs(len(S)-1,0,p)
print(ans)

Measured memory_bytes: 3064
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <map>
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;




int main() {
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	int ans = 0;
	for (int i = 11; i <= 300; i++) {
		if (i%2  == 1) {
			c = c - b;
			if (c <= 0) {
				ans = 1;
				break;
			}
		}
		if (i % 2 == 0) {
			a = a - d;
			if (a <= 0) {
				ans = 0;
				break;
			}
		}
	}
	if (ans == 1) cout << "Yes" << endl;
	else cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3588
// C++ includes
#include <bits/stdc++.h>
// 俳句
using namespace std;

// alias templates
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;

// alias declaration
using ll = long long;
using str = string;

using vll = V<ll>;
using vvll = V<vll>;
using vs = V<str>;

// loops
#define FOR(i, a, b)  for (ll i = (a); i <= (ll)(b); i++) // [a,b]
#define rFOR(i, a, b) for (ll i = (b); i >= (ll)(a); i--) // [b,a]
#define REP(i, a) FOR((i), 0, (ll)(a)-1) // [0,a-1]

// for debug
#define dbg(a) cerr << "  " << (#a) << ": " << (a) << "\n";

// procon common constants
const ll MOD_BIG = 1e9 + 7;

int main(void){
    ll n;
    cin >> n;
    switch(n%10){
        case 2:
        case 4:
        case 5:
        case 7:
        case 9:
            cout << "hon" << endl;
            break;
        case 0:
        case 1:
        case 6:
        case 8:
            cout << "pon" << endl;
            break;
        case 3:
            cout << "bon" << endl;
            break;
        default:
            break;
    }
}

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

using namespace std;

int main()
{
  int n;

  scanf("%d", &n);

  vector<int> a(n);

  for (int i = 0; i < n; i++)
  {
    scanf("%d", &a[i]);
  }

  sort(a.begin(), a.end());
  a.erase(unique(a.begin(), a.end()), a.end());

  printf("%d", a.size());
}

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

int main(){
    int n,i,j,p1,p2;
    while(1){
        cin >> n;
        if(n == 0){
            break;
        }
        p1=0;
        p2=0;
        for(int k=0;k<n;k++){
            cin >> i >> j;
            if(i > j){
                p1 += i + j;
            }
            else if(i < j){
                p2 += i + j;
            }
            else if(i == j){
                p1 += i;
                p2 += j;
            }
        }
        cout << p1 << " " << p2 << endl;
    }
}

Measured memory_bytes: 1160
#include<iostream>
#include<cstdio> 
using namespace std;
int x;
int main() {
    scanf("%d",&x);
    if(x<=599)
        puts("8");
    if(x>=600&&x<=799)
        puts("7");
    if(x>=800&&x<=999)
        puts("6");
    if(x>=1000&&x<=1199)
        puts("5");
    if(x>=1200&&x<=1399)
        puts("4");
    if(x>=1400&&x<=1599)
        puts("3");
    if(x>=1600&&x<=1799)
        puts("2");
    if(x>=1800&&x<=1999)
        puts("1");
    return 0;
}

Measured memory_bytes: 3132
#include <iostream>
#include <algorithm>
#include <climits>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cmath>

using namespace std;

int main() {
    int a,b,c,x,y;
    cin >> a >> b>> c>> x>>y;
    vector<long> p;
    // 2i
    for (int i = 0; i <= ceil(1.0 * max(x,y)); ++i) {
        long sum = c * i *2;
        if(x - i > 0) {
            sum += (x-i)*a;
        }
        if(y - i > 0) {
            sum += (y-i)*b;
        }
        p.push_back(sum);
    }
    cout << *min_element(p.begin(), p.end()) << endl;
    return 0;
}


Measured memory_bytes: 1400
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e9)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
using namespace std;

bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}

long long gcd_(long long a, long long b){
  if(a<b){
    swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}

int main(){
  
  int a,b,c;
  cin>>a>>b>>c;
  if(a>b){
    swap(a,b);
  }
  if(a<=c && c<=b){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

int digitsofnum(int n) {
	int j = 0;
	while (n > 0) {
		n = n / 10;
		j++;
	}
	return j;
}

int main()
{
	int a, b;
	vector<int> dst;
	while (cin >> a >> b)
		dst.push_back(digitsofnum(a + b));
	for (vector<int>::iterator it = dst.begin(); it < dst.end(); it++)
		cout << *it << endl;
	return 0;
}


Measured memory_bytes: 2992
import java.util.*;

public class Main{
    public static void main(String[] args) {
        
        int sum = 0;
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int k = sc.nextInt();
        int x = sc.nextInt();
        int y = sc.nextInt();
        if(n >= k){
            sum = k * x + (n - k) * y;
        }else{
            sum = n * x;
        }
        System.out.println(sum);
    }
}

Measured memory_bytes: 35672
n,m,q=gets.split.map(&:to_i)
s=q.times.map{gets.split.map(&:to_i)}
ans=[]
ary=[*1..m].repeated_combination(n).to_a
ary.each do |i|
  sum=0
  s.each do |a,b,c,d|
    if i[b-1]-i[a-1]==c
      sum+=d
    end
  end
  ans << sum
end
puts ans.max


Measured memory_bytes: 28580
#include<bits/stdc++.h>
using namespace std;
#define r(i,n) for(int i=0;i<n;i++)
int ans;
main(){
  string s;
  cin>>s;
  if(s[0]=='A')ans++;
  r(i,s.size()-1)
    if(s[i]>=s[i+1]) ans++;
  cout<< ans <<endl;
}

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

int main()
{
	string s,t;
	int total=0;
	cin>>s>>t;
	for(int i=0;i<s.size();++i)
	{
		if(s[i]!=t[i])
		{
			total++;
		}
	}
	cout<<total;
	return 0;
}

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

int main(){
    int n, m;
    cin >> n >> m;
    set<P> f;
    rep(i,m){
        int a, b;
        cin >> a >> b;
        a--; b--;
        f.insert(P(a,b));
        f.insert(P(b,a));
    }
    vector<vector<int>> g(n);
    for(auto p : f) g[p.first].push_back(p.second);
    vector<int> num(n);
    queue<int> que;
    int cnt = 0;
    rep(i,n){
        if(num[i] != 0) continue;
        cnt++;
        que.push(i);
        num[i] = cnt;
        while(!que.empty()){
            int v = que.front();
            que.pop();
            for(auto nv : g[v]){
                if(num[nv] != 0) continue;
                que.push(nv);
                num[nv] = cnt;
            }
        }
    }
    map<int,int> ma;
    rep(i,n) ma[num[i]]++;
    int ans = 0;
    for(auto p : ma) ans = max(ans, p.second);
    cout << ans << endl;
}

Measured memory_bytes: 33980
# import numpy as np
n=int(input())
l=[0]+list(map(float,input().split()))
n+=1
dp=[[0 for i in range(n)]for i in range(n)]
dp[0][0]=1
for i in range(1,n):
    for j in range(i+1):
        if j==0:
            dp[i][j] = (1-l[i])*dp[i-1][j]
        else:
            dp[i][j]=(1-l[i])*(dp[i-1][j])+l[i]*dp[i-1][j-1]
ans=0
# print(np.array(dp))
for i in range((n)//2,n):
    ans+=dp[-1][i]
print(ans)

Measured memory_bytes: 223904
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=1LL<<60;
const double EPS = 1e-10;
const ll mod=1000000007;

int main(void){
    ll n,AC=0,WA=0,TLE=0,RE=0;
    cin>>n;
    for(int i=0;i<n;i++){
        string s;
        cin>>s;
        if(s=="AC") AC++;
        if(s=="WA") WA++;
        if(s=="TLE") TLE++;
        if(s=="RE") RE++;
    }
    cout<<"AC x "<<AC<<endl;
    cout<<"WA x "<<WA<<endl;
    cout<<"TLE x "<<TLE<<endl;
    cout<<"RE x "<<RE<<endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <iomanip>
using namespace std;
int  main()
{
  ios::sync_with_stdio(false);
  long n,a,b,c;
  cin>>n>>a>>b>>c;
  vector<long>aa,bb,cc,un;
  vector<long>take(n);
  for(long i=0;i<n;i++)
  {
    cin>>take[i];
  }
  long res=50000;
  for(long i=0;i<(1<<(2*n));i++)
  {
    long tmp=i;
    long cnt=0;
    while(tmp!=0)
    {
      if(tmp%4==1)
      {
        aa.push_back(take[cnt]);
      }
      else if(tmp%4==2)
      {
        bb.push_back(take[cnt]);
      }
      else if(tmp%4==3)
      {
        cc.push_back(take[cnt]);
      }
      cnt++;
      tmp/=4;
    }
    if(aa.size()==0 or bb.size()==0 or cc.size()==0)
    {

      aa.clear();
      bb.clear();
      cc.clear();
      continue;
    }
    long tres=0;
    if(aa.size()!=0)
    {
      tres+=(aa.size()-1)*10;
      tres+=abs(a-accumulate(aa.begin(),aa.end(),0));

    }
    else{tres+=a;}
    if(bb.size()!=0)
    {
        tres+=(bb.size()-1)*10;
        tres+=abs(b-accumulate(bb.begin(),bb.end(),0));

    }
    else{tres+=b;}
    if(cc.size()!=0)
    {
      tres+=(cc.size()-1)*10;
      tres+=abs(c-accumulate(cc.begin(),cc.end(),0));
    }
    else{tres+=c;}
    res=min(res,tres);
    aa.clear();
    bb.clear();
    cc.clear();
  }
  cout<<res;

  return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define debug(x)  cout << #x << " = " << (x) << endl;
#define SORT(x) sort(all(x));
#define RSORT(x) sort(rall(x));
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vd = vector<double>;
using vb = vector<bool>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;
const int inf = 1<<29;
const ll mod = 1000000007;
const double eps = 1e-9;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//cout << fixed << setprecision(10);

ll N, x[1009], y[1009], h[1009]; vector<tuple<ll,ll,ll>> vec;

int main () {
  cin >> N;
  tuple<ll,ll,ll> G = make_tuple(-1,-1,-1);

  for (int i = 1; i <= N; i++) {
    cin >> x[i] >> y[i] >> h[i];
    if (h[i] >= 1) G = make_tuple(x[i],y[i],h[i]);
  }
  for(int Cx = 0; Cx <= 100; Cx++) {
    for (int Cy = 0; Cy <= 100; Cy++) {
      ll H = get<2>(G) + abs(get<0>(G)-Cx) + abs(get<1>(G)-Cy);
      H = max(H,0LL);
      bool flag = true;
      for (int i = 1; i <= N; i++) {
        ll hh = H - abs(x[i]-Cx) - abs(y[i]-Cy);
        hh = max(hh,0LL);
        if (h[i] != hh) flag = false;
      }
      if(flag == true) vec.push_back(make_tuple(Cx,Cy,H));
    }
  }

  if (vec.size() == 1) {
    cout << get<0>(vec[0]) << " " << get<1>(vec[0]) << " " << get<2>(vec[0]) << endl;
  }
}

Measured memory_bytes: 256