akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define what_is(x) cerr << #x << " is " << x << endl;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define st first
#define nd second
#define endl '\n'

typedef long long ll;
typedef pair<int,int> pii;
const int N = 1e5+5;
const int INF = 1e9;
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846;
double a, b, v;
int main()
{
	IOS
	// freopen("input.txt", "r", stdin);
	cin >> a >> b >> v;
	v /= a;
	double ans;
	if (v < a*b/2) {
		double x = 2*v/b;
		ans = atan(x/b);
	} else {
		double x = (2*v)/a - b;
		double y = b - x;
		ans = atan(a/y);
	}
	ans = 180*ans/PI;
	ans = 90 - ans;
	cout << fixed << setprecision(10);
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    int L[10];
    rep(i, N) cin >> L[i];
    sort(L, L + N);
    int sum = 0;
    rep(i, N - 1) sum += L[i];
    if (sum > L[N - 1]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define dd(x) cout << #x << " = " << x << ", "
#define de(x) cout << #x << " = " << x << endl
#define rep(i,a,b) for(int i=(a);i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
//INF = 1 061 109 567 ; INF + INF = 2 122 219 134 ;
//LINF = 4 557 430 888 798 830 399 ; LINF + LINF = 9 114 861 777 597 660 798 ;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3f;
const int MOD = (int)1e9+7;
const int N = (int)1e5+7;

//浮点型运算
const db eps = 1e-6;
bool eq(const db &a, const db &b) { return fabs(a - b) < eps; }
bool ls(const db &a, const db &b) { return a + eps < b; }
bool le(const db &a, const db &b) { return eq(a, b) || ls(a, b); }

//--------变量--------//

int a, b;
char s[N];

//--------函数--------//

void Init() {
}

int Solve() {
	scanf("%s", s);
	rep(i, 0, a) {
		if (s[i] < '0' || s[i] > '9') return !puts("No");
	}
	if (s[a] != '-') return !puts("No");
	rep(i, a+1, a+b+1) {
		if (s[i] < '0' || s[i] > '9') return !puts("No");
	}
	if (s[a+b+1] != '\0') return !puts("No");
	return !puts("Yes");
}

//--------main--------//

int main ()
{
	while (~scanf("%d%d", &a, &b)) {
		Init();
		Solve();
	}
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.lang.Math;
public class Main{
    public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	while(scan.hasNext()) {
	    String input = scan.nextLine();
	    String[] inputs = input.split(" ");
	    double r = Double.parseDouble(inputs[0]);
	    double pi = Math.PI;
	    double area = r * r * pi;
	    double circumference = 2 * r * pi;
	    System.out.println(String.format("%.6f", area) + " " +String.format("%.6f", circumference));
	}
    }
}

Measured memory_bytes: 26552
#include <bits/stdc++.h>
using namespace std;
int n,a[100009],b[100009],c[100009];
int main() {
    cin>>n;
    for(int i=1;i<=n;i++){
        cin>>a[i]>>b[i]>>c[i];
            a[i]+=max(b[i-1],c[i-1]);
            b[i]+=max(a[i-1],c[i-1]);
            c[i]+=max(a[i-1],b[i-1]);
    }
    cout<<max(a[n],max(b[n],c[n]));
}


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



int main() {
  int n,m,x;
  cin >> n >>m >>x;
  int c[n];
  int a[n][m];
  rep(i,n){cin>> c[i];
    rep(k,m){cin >> a[i][k];}}
  ll ans=mod;

  for (int tmp = 0; tmp < (1 << n); tmp++) {
    bitset<12> s(tmp);
    // ビット列を出力
        int q[m]={};
        for(int i=0;i<n;i++){
            if(s[i]==1){rep(k,m){q[k]+=a[i][k];}}
        }
        bool qq=1;
        rep(k,m){if(q[k]<x){qq=0;}}
        if(qq==1){
            ll p=0;
            rep(w,n){if(s[w]==1){p+=c[w];}}
                ans=min(ans,p);}
  }
    if(ans==mod){cout << -1 << endl;}else{cout << ans << endl;}
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
constexpr int mod=1000000007;
constexpr int mod1=998244353;
vector<int> dx={0,-1,0,1},dy={1,0,-1,0};
bool inside(int y,int x,int h,int w){
	if(y<h && y>=0 && x<w && x>=0) return true;
	return false;
}





int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,d;cin >> n >> d;
	cout << (n+2*d)/(2*d+1) << endl;
}


Measured memory_bytes: 256
import java.io.*;

class Main{
	public static void main(String[] args) throws Exception{
		int x, ans;
	
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		x = Integer.parseInt(br.readLine());
		
		ans = x*x*x;
		System.out.println(ans);
	}
}

Measured memory_bytes: 16868
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
//#include <bits/stdc++.h>

#define all(v) v.begin(), v.end()
typedef long long ll;
#define rep(i, z, n) for(int i = z; i < n; i++)
//const int INF = 1<<29;
//const int MODINF = 1000000007;
using namespace std;

int main(){
    int N;
    cin >> N;
    vector<double> v(N);
    rep(i, 0, N) cin >> v.at(i);
    sort(all(v));
    rep(i, 0, N - 1){
        v.at(i + 1) = (v.at(i) + v.at(i + 1)) / 2;
    }
    cout << fixed << setprecision(10) << v.at(N - 1) << endl;
}

Measured memory_bytes: 3764
n = int(input())
s =     input()
if n < 3:
  print(0)
  exit

result = s.count('R') * s.count('G') * s.count('B')
for i in range(n):
  for j in range(i+1, n):
    k = 2*j - i
    if k < n and s[k] != s[i] and s[k] != s[j] and s[j] != s[i]:
      result -= 1

print(result)


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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> coord;

int main(){
    ll a,b;
    cin >> a >>b ;

    if( a >= 13 ) cout << b << endl;
    else if( a >= 6 ) cout << b/2 << endl;
    else cout << 0 << endl;
    
    return 0;
}


Measured memory_bytes: 256
#include<set>
#include<string>
#include<stdio.h>
#include<stdlib.h>
#include<string>
#include<math.h>
#include<vector>
#include<iostream>
using namespace std;
string sss;
set<string>SS;
vector<int>PP[26];
int my_min(int a,int b)
{
    return a<b ?a:b;
}
int main()
{
    int N;
    cin >> sss >>N;
    for(int i=0;i<sss.length();i++)
        PP[sss[i]-'a'].push_back(i);
    for(char s='a';s<='z';s++)
    {
        for(int i=0;i<PP[s-'a'].size();i++)
        {
            string ss;
            int z=PP[s-'a'][i];
            for(int k=z;k<my_min(z+5,sss.length());k++)
            {
                ss+=sss[k];
                SS.insert(ss);
            }
        }
        if(SS.size()>=N)
        {
            int now=1;
            set<string> ::iterator it= SS.begin();
            while(now<N)
                it++,now++;
            cout << *it<<endl;
            return 0;
        }
    }
    
    return 0;
}


Measured memory_bytes: 384
while true do
  times=gets.chomp.to_i
  if times==0 then
    break
  else
    pointa=0
    pointb=0
    for i in 0...times do
      cards=gets.chomp.split
      
      if cards[0].to_i>cards[1].to_i then
        pointa=pointa+cards[0].to_i+cards[1].to_i
      elsif cards[0].to_i<cards[1].to_i then
        pointb=pointb+cards[0].to_i+cards[1].to_i
      else
        pointa=pointa+cards[0].to_i
        pointb=pointb+cards[1].to_i
      end
    end
    printf("%d %d\n",pointa,pointb)
  end
end

Measured memory_bytes: 6852
#include <set>
#include <cstdio>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

using namespace std;

char mine[6][5][5];
char oppo[6][5][5];

int basex[] = { 7 * 1 + 1, 7 * 0 + 1, 7 * 1 + 1, 7 * 2 + 1, 7 * 3 + 1, 7 * 1 + 1 };
int basey[] = { 7 * 0 + 1, 7 * 1 + 1, 7 * 1 + 1, 7 * 1 + 1, 7 * 1 + 1, 7 * 2 + 1 };

char right[9][5][6]={
  {
    ".....",
    "...|.",
    ".....",
    "...|.",
    "..-.."
  },
  {
    "..-..",
    "...|.",
    "..-..",
    ".|...",
    "..-.."
  },
  {
    "..-..",
    "...|.",
    "..-..",
    "...|.",
    "..-.."
  },
  {
    ".....",
    ".|.|.",
    "..-..",
    "...|.",
    "....."
  },
  {
    "..-..",
    ".|...",
    "..-..",
    "...|.",
    "..-.."
  },
  {
    "..-..",
    ".|...",
    "..-..",
    ".|.|.",
    "..-.."
  },
  {
    "..-..",
    "...|.",
    ".....",
    "...|.",
    "....."
  },
  {
    "..-..",
    ".|.|.",
    "..-..",
    ".|.|.",
    "..-.."
  },
  {
    "..-..",
    ".|.|.",
    "..-..",
    "...|.",
    "..-.."
  }
};

char buff[21][60];

void sayuu(char c[5][5]){
  REP(y,5) REP(x,2) swap(c[y][x], c[y][4-x]);
}
void jouge(char c[5][5]){
  REP(y,2) REP(x,5) swap(c[y][x], c[4-y][x]);
}
void rotr(char c[5][5]){
  char t[5][5];
  REP(y,5) REP(x,5){
    if(c[y][x] == '|')
      t[y][x] = '-';
    else if(c[y][x] == '-')
      t[y][x] = '|';
    else
      t[y][x] = c[y][x];
  }
  REP(y,5)REP(x,5)
    c[y][x] = t[4-x][y];
}

int main(){
  while(true){
    int me[6];
    int op[6];

    REP(i,21) scanf("%s", buff[i]);
    if(buff[0][0] == '0') break;

    REP(i,6){
      REP(y,5) REP(x,5){
	mine[i][y][x] = buff[basey[i] + y][basex[i] + x];
	oppo[i][y][x] = buff[basey[i] + y][29 + basex[i] + x];
      }
    }
    
    sayuu(mine[0]);
    rotr(mine[1]); sayuu(mine[1]);
    sayuu(mine[2]);
    rotr(mine[3]); rotr(mine[3]); rotr(mine[3]); sayuu(mine[3]);
    sayuu(mine[4]);
    sayuu(mine[5]); jouge(mine[5]);

    sayuu(oppo[0]);
    rotr(oppo[1]); sayuu(oppo[1]);
    sayuu(oppo[2]);
    rotr(oppo[3]); rotr(oppo[3]); rotr(oppo[3]); sayuu(oppo[3]);
    sayuu(oppo[4]);
    sayuu(oppo[5]); jouge(oppo[5]);

    //REP(i,6){printf("mine[%d]:\n", i); REP(y,5){REP(x,5)putchar(mine[i][y][x]); puts("");}}
    //REP(i,6){printf("oppo[%d]:\n", i); REP(y,5){REP(x,5)putchar(oppo[i][y][x]); puts("");}}

    REP(i,6){
      me[i] = 0;
      op[i] = 0;
      REP(j,9){
	bool ok = true;
	REP(y,5){
	  REP(x,5){
	    if(mine[i][y][x] != right[j][y][x]){
	      ok = false;
	    }
	  }
	  if(!ok) break;
	}
	if(ok){
	  me[i] = j + 1;
	  break;
	}
      }
      REP(j,9){
	bool ok = true;
	REP(y,5){
	  REP(x,5){
	    if(oppo[i][y][x] != right[j][y][x]){
	      ok = false;
	    }
	  }
	  if(!ok) break;
	}
	if(ok){
	  op[i] = j + 1;
	  break;
	}
      }

      //if(op[i] == 0 || me[0] == 0) puts("error");
    }

    int win = 0;
    int lose = 0;
    REP(i,6) REP(j,6){
      if(me[i] > op[j]) win++;
      else if(me[i] < op[j]) lose++;
    }

    puts(win >= lose ? "HIGH" : "LOW");
  }
  return 0;
}

Measured memory_bytes: 0
#include <cstdio>
#include <climits>
#include <cassert>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <numeric>
#include <functional>
#include <tuple>
#include <list>
#include <map>
#include <queue>
#include <stack>
#include <set>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define FOR(x,xs) for(auto &x: xs)

using namespace std;
typedef long long ll;
typedef pair<int,int> PI;
typedef pair<ll,ll> PL;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<double, int> PDI;

struct bar {
  ll x, y, r;
};

int main() {
  ios::sync_with_stdio(false);
  bar s, t;
  cin >> s.x >> s.y >> t.x >> t.y;
  int N;
  cin >> N;
  vector<bar> ps(N);
  FOR(p,ps) {
    cin >> p.x >> p.y >> p.r;
  }
  ps.push_back({s.x, s.y, 0});
  ps.push_back({t.x, t.y, 0});
  vector<vector<double>> cost(N+2, vector<double>(N+2));
  REP(i,0,N+2) {
    REP(j,0,N+2) {
      if(i == j) {
        cost[i][j] = 0.0;
      } else {
        double dst = sqrt((ps[i].x - ps[j].x) * (ps[i].x - ps[j].x) +
                          (ps[i].y - ps[j].y) * (ps[i].y - ps[j].y));
        cost[i][j] = max(0.0, dst - ps[i].r - ps[j].r);
      }
    }
  }
  priority_queue<PDI, vector<PDI>, greater<PDI>> que;
  que.emplace(0.0, N);
  vector<bool> visited(N+2, false);
  vector<double> dist(N+2, 1e30);
  dist[N] = 0.0;
  while (!que.empty()) {
    int current = que.top().second;
    que.pop();
    if (visited[current]) {
      continue;
    }
    visited[current] = true;
    REP(i,0,N+2) {
      double d = dist[current] + cost[current][i];
      if (d < dist[i]) {
        dist[i] = d;
        que.emplace(d, i);
      }
    }
  }

  cout << setprecision(12) << dist[N+1] << endl;
  return 0;
}


Measured memory_bytes: 14200
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <utility>
#include <algorithm>
#include <cstdio>
#include <iomanip>
#include <queue>
#include <deque>
#include <stack>
#include <fstream>
#include <cmath>
#include <random>
#include <complex>
#include <functional>
#include <bitset>
#include <sstream>
#include <cassert>
#include <time.h>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)
using namespace std;
typedef vector<ll> vec;
typedef vector<vec> mat;

const ll inf = 1LL << 60;

template<class T> inline void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}
template<class T> inline void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}
void printvec (vec &v) {
    Rep (i, (ll)v.size()) {
        cout << v[i] << " \n"[i+1 == (ll)v.size()];
    }
}

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

    string S, T;
    cin >> S >> T;

    ll ns = S.size(), nt = T.size();


    ll ans = inf;
    Rep (i, ns-nt+1) {
        string ssub = S.substr(i, nt);
        ll tmp = 0;
        Rep (j, nt) {
            tmp += ssub[j] != T[j];
        }

        chmin(ans, tmp);
    }

    cout << ans << endl;
}

Measured memory_bytes: 3648
//Shubham Vijayvargiya

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

#define pb push_back
#define mp make_pair
#define eb emplace_back
#define F first
#define S second
#define sz(a) (int)(a.size())
#define set(a,b) memset(a,b,sizeof(a))
#define let(x,a) __typeof(a) x(a)
#define rep(i, begin, end) for (ll i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define all(v) (v).begin(),(v).end()
#define sll(x) { scanf("%lld",&x); }
#define si(x) { scanf("%d",&x); }
#define slf(x) { scanf("%lf",&x); }
#define pll(x) { printf("%lld\n",x); }
#define pi(x) { printf("%d\n",x); }
#define tcases() long long testcases; cin>>testcases ; while(testcases--)

#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " = " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " = " << arg1<<" | ";__f(comma+1, args...);
}

#else
#define trace(...)
#endif

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

typedef long long ll;
typedef long double ld;
typedef pair<long long,long long> pll;
typedef vector<long long> vll;
typedef vector<pll> vpll;
typedef vector<vll> vvll;

const ll mod=1000000007;
//-----------------------------------------------------------------------------------------------------------------------------------------------//
#define N 1009
ll dp[N][N],ncr[N][N],dp2[N][N];

ll powmod(ll a,ll b){
	ll res=1;
	while(b){
		if(b&1){
			res=(res*a)%mod;
		}
		b>>=1;
		a=(a*a)%mod;
	}
	return res;
}

int main()
{
//	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

	ll n,a,b,c,d;
	sll(n);sll(a);sll(b);sll(c);sll(d);

	ncr[0][0]=ncr[1][0]=ncr[1][1]=1;
	rep(i,2,n+2){
		ncr[i][i]=1;
		ncr[i][0]=1;
		rep(j,1,i){
			ncr[i][j]=(ncr[i-1][j]+ncr[i-1][j-1])%mod;
		}
	}

	rep(i,0,n+2){
		dp2[i][1]=1;		
	}

	rep(i,2,n+2){
		rep(j,1,n+2){
			if(j*i<N){
				dp2[j][i]=(dp2[j][i-1]*ncr[j*i][j])%mod;
				dp2[j][i]=(dp2[j][i]*powmod(i,mod-2))%mod;
			}
		}
	}

	rep(i,0,n+2){
		rep(j,0,n+2){
			dp[i][j]=0;
		}
	}
	dp[0][a-1]=1;
	rep(i,a,b+1){
		rep(j,0,n+1){
			if(j==0){
				dp[j][i]=1;
				continue;
			}
			dp[j][i]=dp[j][i-1];
			rep(k,c,d+1){
//				trace(k);
				if((k*i)>j)
					break;
//				trace(i,j,k);
				ll temp=(dp[j-k*i][i-1]*ncr[j][k*i])%mod;
				temp=(temp*dp2[i][k])%mod;
				dp[j][i]+=temp;
				dp[j][i]%=mod;
			}
		}
	}
	cout<<dp[n][b]<<endl;
	return 0;
}

Measured memory_bytes: 19200
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  char a;
  cin>>a;
  if(a>='a' && a<='z') cout<<'a'<<endl;
  else cout<<'A'<<endl;
}



Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
using pint = pair<int, int>;
using ll = long long;
using pll = pair<ll, ll>;
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define VREP(s, ite) for (auto ite = s.begin(); ite != s.end(); ++ite)
#define FI first
#define SE second
//#define endl "\n"
#define ciosup  \
    cin.tie(0); \
    ios::sync_with_stdio(false);
#define eb emplace_back
#define vint vector<int>
constexpr ll INF = 1e9 + 7;
constexpr ll MOD = 1e9 + 7;

int main()
{
    ciosup;
    int n;
    cin >> n;
    vector<pint> a(n);
    REP(i,n){
        cin >> a[i].FI;
        a[i].SE = i;
    }
    sort(a.begin(), a.end(),greater<pint>());
    int maxval = a[0].FI;
    REP(i, n)
    {
        a[i].FI = a[i].SE;
        if (i == 0)
        {
            a[i].SE = a[i + 1].FI;
        }else{
            a[i].SE = maxval;
        }
    }
    sort(a.begin(), a.end());
    REP(i,n){
        cout << a[i].SE << endl;
    }
}

Measured memory_bytes: 3200
s = input()
t = input()

ls = len(s)
lt = len(t)
res = float("inf")
cnt = 0
for i in range(ls - lt+1):
    cnt= 0
    for j in range(lt):
        if s[i + j] != t[j]:
            cnt += 1
    res = min(res,  cnt)
print(res)   

Measured memory_bytes: 9128
#include <bits/stdc++.h>
#define double long double
#define int long long
#define mii map<int,int>
#define pii pair<int,int>
#define low lower_bound
#define upp upper_bound
#define mod 1000000007 //10^9+7
#define inf (int)50000000000 //5･10^10
#define rep(i,n) for(int i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define vsort(vec) sort(all(vec))
#define vrever(vec) reverse(all(vec));
#define vunsort(vec) vsort(vec); vrever(vec);
#define bisea binary_search
#define cend cout<<endl;
#define F first
#define S second
using namespace std;
signed main() {
  int n,k=0;
  string s,t;
  cin>>n>>s>>t;
  rep(i,n) {
    if(s.substr(n-i-1,i+1)==t.substr(0,i+1)) {
      k=i+1;
    }
  }
  cout<<2*n-k<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
 



int main()
{ 
    long long int x, ans = 100, counter = 0;

    cin >> x;

    while (ans < x)
    {
        ans = ans + ans/100;
        counter++;
    }
    cout << counter;

    return 0;
    
}




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

using namespace std;

#define int long long
#define F first
#define S second
#define all(v) (v).begin(), (v).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, f, n) for(int i = (int)(f); i < (int)(n); i++)
#define each(a, b) for(auto& a : b)

typedef pair<int, int> P;

const int inf = 1LL << 55;

int n;
vector<int> w;

int dp[333][333];

int rec(int l, int r)
{
  if(l == r) return 0;
  if(l + 1 == r) return abs(w[r] - w[l]) <= 1 ? 2 : 0;

  int& ret = dp[l][r];
  if(~ret) return ret;
  ret = 0;

  if(abs(w[r] - w[l]) <= 1) {
    int temp = rec(l+1, r-1);
    if(temp == r-l-1) ret += temp + 2;
  }

  for(int i = l; i < r; i++) {
    ret = max(ret, rec(l, i) + rec(i+1, r));
  }
  
  return ret;
}

signed main()
{
  while(cin >> n, n) {
    w.resize(n);
    for(int i = 0; i < n; i++) cin >> w[i];
    memset(dp, -1, sizeof(dp));
    cout << rec(0, n-1) << endl;
  }
  return 0;
}

Measured memory_bytes: 3944
//copied from PG111002(UVa10054)
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cstring>

#define hi(_x) ((_x)>>16)
#define lo(_x) ((_x)&0xffff)
using namespace std;
#define rotate(v, index) rotate((v).begin(), (v).begin()+(index), (v).end())

inline int unite(vector<int> &u, vector<vector<int>*> &array){
  int _array, _u, _each;
  while(array.size()){
    for(_array=0; _array<array.size(); _array++){//今まで作ったeuler閉路すべてに対しuと結合できるかどうか調べる
      vector<int> each = *(array[_array]); //eachはeuler閉路を構成すると仮定する
      for(_u=0; _u<u.size(); _u++){
        for(_each=0; _each<each.size(); _each++){
          if(lo(u[_u])==hi(each[_each])){
            if(_each)rotate(each,_each); //each[_each]が先頭に来るよう頭だし
            u.insert(u.begin()+_u+1,each.begin(),each.end());
            delete array[_array];
            array.erase(array.begin()+_array);
            goto next;
          }
        }
      }
    }
    //fail
    return 0;
    next:
    /*continue*/;
  }//while
  return 1;
}

inline int sort(vector<int>&s,vector<int>&v){
  int x=hi(v[0]), y=lo(v[0]), i, a=0;
  v.erase(v.begin());
  s.push_back((x<<16)+y);
  while(1){
    for(i=0; i<v.size(); i++){
      if(lo(s[a])==hi(v[i])/*||lo(s[a])==lo(v[i])*/)goto in;//break;
    }
    /*if(i==v.size())*/break;
in:
    x=hi(v[i]), y=lo(v[i]);
    v.erase(v.begin()+i);
    //if(lo(s[a])==y)swap(x,y);
    s.push_back((x<<16)+y);
    a++;
  }//while
  return hi(s[0])==lo(s[a]);
}

char s[99];
int main(){
  int i=0, k;
  int n, l, x, y;
  vector<int> vorig;
  vector<vector<int>*> varray;
  vector<int> vunite;

  //scanf("%d",&n);
  //for(;i<n;i++){
  for(;;){
    //if(i) printf("\n");
    //printf("Case #%d\n",i+1);
    scanf("%d",&l);
    if(!l)return 0;

    for(k=0;k<l;k++){
      //scanf("%d %d",&x, &y);
      scanf("%s",s);
      x=s[0]-96,y=s[strlen(s)-1]-96;
      vorig.push_back((x<<16)+y);
    }

    while(vorig.size()){
      vector<int> *p = new vector<int>;
      if(!sort(*p,vorig))goto fail;
      varray.push_back(p);
    }

    vunite = *(varray[0]);
    delete varray[0];
    varray.erase(varray.begin());
    if(!unite(vunite,varray))goto fail;

    while(vunite.size()){
      //printf("%d %d\n",hi(vunite[0]),lo(vunite[0]));
      vunite.erase(vunite.begin());
    }
    puts("OK");
    continue;

fail:
    while(varray.size()){
      delete varray[0];
      varray.erase(varray.begin());
    }
    //puts("some beads may be lost");
    puts("NG");
    vorig.clear();
    vunite.clear();
  }//for
}//main

Measured memory_bytes: 1292
#include<bits/stdc++.h>
#define rep(i,j,k) for(int i=(int)j;i<=(int)k;i++)
#define per(i,j,k) for(int i=(int)j;i>=(int)k;i--)
using namespace std;
typedef long long LL;
const int P=1000000007;
const int N=110000;
inline void add(int &a,int b){a+=b;if(a>=P)a-=P;}
inline void dec(int &a,int b){a-=b;if(a<0)a+=P;}
int n;LL a[N];
LL A,B;
int f[N][3];
LL mes[N<<2];
void build(int me,int l,int r){
    if(l==r){
        mes[me]=a[l+1]-a[l];
        return;
    }
    int mid=(l+r)>>1;
    build(me<<1,l,mid);
    build(me<<1|1,mid+1,r);
    mes[me]=min(mes[me<<1],mes[me<<1|1]);
}
LL _ask(int me,int l,int r,int x,int y){
    if(x>y)return max(A,B)+10;
    if(x<=l&&r<=y)return mes[me];
    int mid=(l+r)>>1;
    LL ret=max(A,B)+10;
    if(x<=mid)ret=min(ret,_ask(me<<1,l,mid,x,y));
    if(y>mid)ret=min(ret,_ask(me<<1|1,mid+1,r,x,y));
    return ret;
}
LL ask(int l,int r){return _ask(1,1,n-1,l,r);}
int findit(LL S){
    int l=1;int r=n;
    int ret=n+1;
    while(l<r){
        int mid=(l+r)>>1;
        if(a[mid]>=S)ret=mid,r=mid;
        else l=mid+1;
    }
    if(a[l]>=S)ret=l;
    return ret;
}
int main(){
    scanf("%d%lld%lld",&n,&A,&B);
    if(n==1){
        printf("2\n");
        return 0;
    }
    rep(i,1,n)scanf("%lld",&a[i]);
    build(1,1,n-1);
    


    f[0][2]=1;
    rep(i,0,n){
        //0 is A
        //1 is B
        int gt=0;
        if(f[i][0]){
            gt=findit(a[i]+A);
            if(gt==i+1)add(f[i][2],f[i][0]);
            else if(ask(i+1,gt-2)>=B)add(f[gt-1][1],f[i][0]);
        }
        if(f[i][1]){
            gt=findit(a[i]+B);
            if(gt==i+1)add(f[i][2],f[i][1]);
            else if(ask(i+1,gt-2)>=A)add(f[gt-1][0],f[i][1]);
        }
        
        add(f[i+1][0],f[i][2]);
        add(f[i+1][1],f[i][2]);
    }
    int ans=f[n][2];
    printf("%d\n",ans);
    return 0;
}




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

int main() {
  char c;
  int i;
  bool b;

  cin >> c;

  char vowel[5] = {'a', 'i', 'u', 'e', 'o'};

  for (i=0;i<5;i++){
    if (c == vowel[i]) {
      b = true;
      break;
    } else {
      b = false;
    }
  }

  if (b) {
    cout << "vowel" << endl;
  } else {
    cout << "consonant" << endl;
  }
      
}

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

int main() {
    int n;
    string s, t;
    cin >> n;
    cin >> s >> t;

    for (int i = 0; i < n; i++) {
        cout << s.at(i) << t.at(i);
    }
    cout << endl;
}

Measured memory_bytes: 256
#k = int(input())
#s = input()
#a, b = map(int, input().split())
#s, t = map(str, input().split())
#l = list(map(int, input().split()))
#l = [list(map(int,input().split())) for i in range(n)]
#a = [input() for _ in range(n)]

a,b,c = map(int, input().split())

print(a*b//2)







Measured memory_bytes: 9180
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <functional>

using namespace std;
typedef long long int ll;

#define repi(i,a,b) for(ll i=a;i<b;i++)
#define rep(i,a) repi(i,0,a)
#define rrep(i,a) for(ll i=a-1;i>=0;i--)

int main(){
  ll N;
  cin >> N;
  int ans = 0;
  rep(i, N){
    ll a;
    cin >> a;
    if(a%2) ans=1;
  }
  if(ans) cout << "first" << endl;
  else cout << "second" << endl;
  return 0;
}

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

#define pb push_back
#define fi first
#define se second
typedef long long ll;

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

	int k, x;
	cin >> k >> x;
	for (int i = x - k + 1; i <= x + k - 1; ++i)
		cout << i << ' ';
	cout << '\n';
}


Measured memory_bytes: 256
a, b, k = map(int, input().split())

count = 0
i = 1
dividable_numbers = []
while True:
    if a % i == 0 and b % i == 0:
        count += 1
        dividable_numbers.append(i)

    if a < i or b < i:
        break

    i += 1

print(dividable_numbers[-k])

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

typedef long long int lli;
typedef unsigned long long int ulli;
typedef pair<int,int> pii;
typedef priority_queue< int, vector< int >, greater< int > >  minHeap;

#define ones(x) __builtin_popcount(x)
#define onesl(x) __builtin_popcountl(x)
#define onesll(x) __builtin_popcountll(x)

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define scn(n) scanf("%d",&n)
#define scnll(n) scanf("%lld",&n)
#define scn2(n,m) scanf("%d%d",&n,&m)
#define scn3(n,m,w) scanf("%d%d%d",&n,&m,&w)
#define scn2ll(n,m) scanf("%lld%lld",&n,&m)
#define atoz(v) v.begin(),v.end()
#define ratoz(v) v.rbegin(),v.rend()
#define Fill(a,v) memset(a,v,sizeof(a))
#define fi first
#define se second
#define inf 1e9
#define pi acos(-1.0)
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define mod 1000000007
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define bug(x) cerr << __LINE__ << " says: " << #x << " = " << (x) << "\n"

int Set(int N,int pos)
{
    return N=N | (1<<pos);
}
int reset(int N,int pos)
{
    return N = N & ~(1<<pos);
}
bool check(int N,int pos)
{
    return (bool)(N & (1<<pos));
}

inline int addmod(lli x,lli y)
{
    return (x%mod + y%mod)%mod;
}
inline int submod(lli x,lli y)
{
    return (x%mod - y%mod + mod)%mod;
}
inline int mulmod(lli x,lli y)
{
    return (x%mod * y%mod)%mod;
}


inline int nextSubMask(int i, int mask)
{
    return (i-1)&mask;   /// returns next  submask
}

template<typename T>
void we_r_done(T mssg)
{
    cout<<mssg;
    exit(0);
}


int main()
{
    ///freopen("output.txt","w",stdout);
   // freopen("input.txt","r",stdin);
    FastIO;

    int n,m;
    while(cin>>n>>m){
        int d[m];
        for(int i=0; i<m; i++){
            cin>>d[i];
        }
        sort(d,d+m);
        int dp[n+1] , need[23] = {0,2,5,5,4,5,6,3,7,6};

        dp[0] = 0;
        for(int i=1; i<=n; i++) dp[i] = -1;

        for(int make=1; make<=n; make++){
            for(int i=0; i<m; i++){
                if(make<need[d[i]]) continue;

                if(dp[make-need[d[i]]] == -1) continue;

                if(dp[make-need[d[i]]]+1 >= dp[make]){
                    dp[make] = dp[make-need[d[i]]] + 1;
                }
            }
        }
        assert(dp[n] != -1);
        vector<int>res;
        for(int made = n; made ;){

            for(int i=m-1; i>=0; i--){
                if(made<need[d[i]]) continue;
                if(dp[made-need[d[i]]]+1 == dp[made]){
                    res.pb(d[i]);
                    made -= need[d[i]];
                    break;
                }
            }
        }
        sort(res.rbegin(),res.rend());
        for(int t : res) cout<<t;
        cout<<endl;
    }

    return 0;
}

///sin and cos expect input in radians not degrees. so use , sin(degrees * pi / 180)
///using bs = bitset<MX>; // how many distinct number can be form?
///sort(atoz(v), [](const data x, const data y){return (x.a==y.a?x.b>y.b : x.a<y.a);});


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

int main() {
  long long a, b, c, k;
  cin >> a >> b >> c >> k;
  long long ans = 0;
  ans += min(a, k);
  k -= a;
  k -= b;
  if (k <= 0) {
    cout << ans;
    return 0;
  } else {
    ans -= min(c, k);
    cout << ans;
    return 0;
  }
  return 0;
}


Measured memory_bytes: 3636
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
typedef long long int ll;
void swap(ll *x,ll *y){ll temp;temp=*x;*x=*y;*y=temp;}
ll asc(const void *a,const void *b){return *(ll*)a-*(ll*)b;}
ll desc(const void *a,const void *b){return *(ll*)b-*(ll*)a;}
ll max(ll x,ll y){return x>y?x:y;}
ll min(ll x,ll y){return x>y?y:x;}

int main(){
    int n,l,taste[500],sum1=0,sum2=0;

    scanf("%d %d",&n,&l);
    for(int i=0;i<n;i++){
        taste[i]=l+(i+1)-1;
        //printf("taste[%d]==%d\n",i,taste[i]);
        sum1+=taste[i];
    }
    qsort(taste,n,sizeof(int),asc);
    int flg=0;
    for(int i=0;i<n;i++){
        if(!flg){
            if(taste[i]>=0){
                flg=1;
                continue;
            }
        }
        
        sum2+=taste[i];
    }
    if(!flg){
        sum2-=taste[n-1];
    }
    printf("%d\n",sum2);
    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define loop(i,x,z) for (int i=x;i<z;i++)
int n, k, A[200002];

int main()
{
	cin >> n >> k;
	loop(i, 0, n)cin >> A[i];
	loop(i, k, n)
	{
		if (A[i] > A[i - k])cout << "Yes\n";
		else cout << "No\n";
	}
}

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

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

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

    long ans = A * B / gcd(A, B);

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


Measured memory_bytes: 256
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")

#include <bits/stdc++.h>

#define pb push_back
#define fi first
#define se second
#define all(v) v.begin(), v.end()
#define sz(v) int(v.size())

using namespace std;
using ll = int64_t;

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

  int N, K, S;
  cin >> N >> K >> S;

  constexpr ll M = 1000000000;
  ll F = (S == M ? S - 1 : M);

  for (int i = 0; i < K; i++) {
    cout << S << " ";
  }
  for (int i = 0; i < N - K; i++) {
    cout << F << " ";
  }
  cout << endl;

  return 0;
}


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

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ITR(x,c) for(__typeof(c.begin() x=c.begin();x!=c.end();x++)
#define RITR(x,c) for(__typeof(c.rbegin() x=c.rbegin();x!=c.rend();x++)
#define setp(n) fixed << setprecision(n)

#define lf double
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pll pair<ll,ll>
#define pi pair<int,int>

#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ins insert

using namespace std;

ll merit[40][2];

ll calc(ll x)
{
	ll ret=0;
	rep(i, 40){
		ll mask = 1LL << i;
		if (x&mask)
			ret+=merit[i][1];
		else
			ret+=merit[i][0];
	}
	return ret;
}

int main(void)
{
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n, k; cin >> n >> k;
	vll a(n);
	rep(i, n) cin >> a[i];
	//制限なしの最適解を構成
	ll opt = 0;
	rep(i, 40){
		ll cnt = 0;
		ll mask = 1LL << i;
		rep(j, n){
			if (a[j]&mask) cnt++;
		}
		merit[i][0] = mask*cnt;
		merit[i][1] = mask*(n-cnt);
		if (2*cnt<n) opt |= mask;
	}
	ll ans = calc(opt&k);
	rep(i, 40){
		ll mask = 1LL << i;
		if (!(k&mask)) continue;
		ll cur = (k-mask)|(mask-1);
		ans = max(ans, calc(opt&cur));
	}
	cout << ans << "\n";
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define pb(a) push_back(a)
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
//typedef tuple<ll, ll, ll> T;

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

void add(ll& a, ll b){a = (a+b) % MOD;}

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int k,t;
    cin>>k>>t;
    int ans=0;
    int ma=0;
    REP(i,t){
        int a;
        cin>>a;
        ans = max(ans,a-1-(k-a));
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

const int N = 100;
int g[N][N];

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> a(m), b(m), c(m);
  for (int i = 0; i < n; ++i) {
    for (int j = 0; j < n; ++j) {
      g[i][j] = INF;
    }
    g[i][i] = 0;
  }
  for (int k = 0; k < m; ++k) {
    cin >> a[k] >> b[k] >> c[k];
    --a[k]; --b[k];
    int x = a[k], y = b[k];
    g[x][y] = min(g[x][y], c[k]);
    g[y][x] = min(g[y][x], c[k]);
  }
  for (int k = 0; k < n; ++k) {
    for (int i = 0; i < n; ++i) {
      for (int j = 0; j < n; ++j) {
        g[i][j] = min(g[i][k] + g[k][j], g[i][j]);
      }
    }
  }
  int ret = 0;
  for (int k = 0; k < m; ++k) {
    int x = a[k], y = b[k];
    if (g[x][y] != c[k]) ++ret;
  }
  cout << ret << endl;
  return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e18+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define rALL(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define dbgmint(n,arr) rep(i,n){cerr<<arr[i].x<<" ";}cerr<<endl;
#define out(a) cout<<a<<endl
#define out2(a,b) cout<<a<<" "<<b<<endl
#define vout(v) rep(i,v.size()){cout<<v[i]<<" ";}cout<<endl
#define Uniq(v) v.erase(unique(v.begin(), v.end()), v.end())
#define fi first
#define se second

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

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

template<typename T>istream& operator>>(istream&i,vector<T>&v)
{rep(j,v.size())i>>v[j];return i;}

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    Vec v(n);
    cin>>v;
    ll ans = 0;
    sort(ALL(v));
   // dbg(v);
    rep(j,n){
        rep(i,j){
            auto x = lower_bound(ALL(v),v[i]+v[j]) - v.begin();
//            dbg(v[i]+v[j]);
//            dbg(x);
            ans += max(0LL,x-1-j);
        }
    }

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


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(){
  char ch[11];
  int N,i,count=0;
  char ring[11],ringring[100][21];
  scanf("%s",ch);
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%s",ring);
    strcpy(ringring[i],ring);
    strcat(ringring[i],ring);
  }
  for(i=0;i<N;i++){
    if(strstr(ringring[i],ch)!=NULL){
      count++;
    }
  }
  printf("%d\n",count);
  return 0;
}

Measured memory_bytes: 2804
using System;
class A
{
    public static void Main()
    {
        string L=Console.ReadLine();
        string[] Ls = L.Split(' ');
        if (int.Parse(Ls[0]) == int.Parse(Ls[1]))
        {
            Console.WriteLine("Yes");
        }
        else
        {
            Console.WriteLine("No");
        }
    }
}

Measured memory_bytes: 13140
#!/usr/bin/env python3

import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

N = int(input())
L = list(map(int, input().split()))


def check(a, b, c):
    if a == b or b == c or a == c:
        return False
    if a < b + c and b < a + c and c < a + b:
        return True
    else:
        return False


count = 0
for i in range(N-2):
    for j in range(i+1, N-1):
        for k in range(j+1, N):
            count += check(L[i], L[j], L[k])


print(count)


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

public class Main {
	public static void main(String[]args){
		
		Scanner scan = new Scanner(System.in);
		
		
		int N = scan.nextInt();
		
		int[] a = new int[N];
		
		for(int i = 0;i<N;i++){
			
			a[i] = scan.nextInt();
			
		}
		
		
		Arrays.sort(a);
		
		
		System.out.println(a[N-1]-a[0]);
		
		
		
		
		
		
		
		
		
	}

}


Measured memory_bytes: 21844
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String input = scanner.nextLine();
        String[] array = input.split(" ");
        int cardA = Integer.parseInt(array[0]);
        int cardB = Integer.parseInt(array[1]);

        if(cardA == cardB) {
            System.out.println("Draw");
        } else if(cardA > cardB) {
            if(cardB == 1) {
                System.out.println("Bob");
            } else {
                System.out.println("Alice");
            }
        } else {
            if(cardA == 1) {
                System.out.println("Alice");
            } else {
                System.out.println("Bob");
            }    
        }
    }
}


Measured memory_bytes: 21844
using System;
using System.Linq;
using System.Collections.Generic;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = double.Parse(Console.ReadLine());
            var add = N % 2 == 0 ? 0 : 1;
            Console.WriteLine(((N+add) / 2) / N);
        }
    }
}


Measured memory_bytes: 13140
#include <stdio.h>
int main(void){
    int i, a[10000];
    for(i = 0; i < 10000; i++){
        scanf("%d", &a[i]);
        if(a[i] == 0){
            break;
        }
        printf("Case %d: %d\n", i + 1, a[i]);
    }
    return 0;
}


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

#define REP(i,num) for(ll i=0;i<(num);++i)
#define FOR(i,c,num) for(ll (i)=(c);(i)<(num);++(i))
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=ll>
T in(){T x; cin >> x; return (x);}
template<typename T=ll,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return 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)...);}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);

	auto H=in(),W=in();
	vvll M(H,vll(W,0)),C(H,vll(W,0));
	REP(i,H){
		auto S=in<string>();
		REP(j,W){
			if(S[j]=='#') M[i][j]=1;
		}
	}
	C[0][0]=1;
	queue<ll> Q;
	Q.push(0);
	while(!Q.empty()){
		auto V=Q.front();
		Q.pop();
		ll u=V%W,v=V/W;
		if(u<W-1 && !M[v][u+1]){
			if(C[v][u+1]==0){
				Q.push(u+1+v*W);
			}
			C[v][u+1]+=C[v][u];
			C[v][u+1]%=atcoder_mod;
		}
		if(v<H-1 && !M[v+1][u]){
			if(C[v+1][u]==0){
				Q.push(u+(v+1)*W);
			}
			C[v+1][u]+=C[v][u];
			C[v+1][u]%=atcoder_mod;
		}
	}
	out(C[H-1][W-1]);
	return 0;
}


Measured memory_bytes: 19368
#include<iostream>
using namespace std;
int main(){
	int m,l;
	cin>>m>>l;
	if(m==1&&m!=l){
	cout<<"Alice";
	}else if(l==1&&l!=m){
	cout<<"Bob";
	}else if(m>l){
	cout<<"Alice";
}else if(m<l){
	cout<<"Bob";
	}else if(m==l){
	cout<<"Draw";
}
	}

Measured memory_bytes: 256
import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

public class Main {

    static class Pair {
        int first;
        int second;
        int index;
        Pair(int f, int s, int i) {
            first = f;
            second = s;
            index = i;
        }
    }

    public static void main(String[] args) {
        Scanner std = new Scanner(System.in);
        int n = std.nextInt();
        int m = std.nextInt();
        PriorityQueue<Pair> pq = new PriorityQueue<>(new Comparator<Pair>() {
            @Override
            public int compare(Pair o1, Pair o2) {
                return o1.second - o2.second;
            }
        });

        for (int i = 0; i < m; i++) {
            Pair p = new Pair(std.nextInt(), std.nextInt(), i);
            pq.add(p);
        }

        int[] counts = new int[n];

        String[] results = new String[m];

        while (!pq.isEmpty()) {
            Pair p = pq.poll();
            int number = counts[p.first - 1] + 1;
            String res = String.format("%06d%06d", p.first, number);
            counts[p.first - 1]++;
            results[p.index] = res;
        }

        Arrays.stream(results).forEach(System.out::println);
    }
}


Measured memory_bytes: 148656
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

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

int main() {
	long long int n, k;
	cin >> n >> k;
	vector<P> dd;
	long long int a, b;
	for (long long int i = 0; i < n; i++) {
		cin >> a >> b;
		dd.push_back(P(a, b));
	}
	sort(dd.begin(), dd.end());
	long long int sum = 0;
	for (long long int i = 0; i < n; i++) {
		sum += dd[i].second;
		if (sum >= k) {
			cout << dd[i].first << endl;
			break;
		}
	}
	return 0;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
#define MAX (ll)(1e5 + 7)
#define INF (ll)(4e18)
#define MOD (ll)(998244353)

using namespace std;
using ll = long long;
using cd = complex<double>;

int main ()  {
	ll  n;
	cin >> n;
	ll ans = 0;
	for (ll i = 2; i * i <= n; i++) {
		ll cc = 0;
		while (n % i == 0) {
			cc++;
			n /= i;
		}
		ll  ss = 0;
		for (ll  i = 1; ss + i <= cc; i++, ans++) {
			ss += i;
		}
	}
	if (n > 1) {
		ans++;
	}
	cout << ans << "\n";
}
		
		


Measured memory_bytes: 3632