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


using namespace std;
using ull = unsigned long long;

double Distance(const vector<int>& x, const vector<int>& y, int p)
{
    double d {};
    int n = x.size();
    if (p != numeric_limits<int>::max())
    {
        for (int i = 0; i < n; ++i)
            d += pow(abs(x[i] - y[i]), p);

        d = pow(d, 1 / static_cast<double>(p));
    }
    else
    {
        for (int i = 0; i < n; ++i)
            d = max(d, static_cast<double>(abs(x[i] - y[i])));
    }

    return d;
}

int main()
{
    int n;
    cin >> n;
    
    vector<int> x(n);
    vector<int> y(n);
    for (int i = 0; i < n && cin >> x[i]; ++i);
    for (int i = 0; i < n && cin >> y[i]; ++i);

    cout << fixed << setprecision(8);

    for (auto i : {1, 2, 3, numeric_limits<int>::max()})
    {
        cout << Distance(x, y, i) << endl;
    }


    return 0;
}

Measured memory_bytes: 3456
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
int t;
int a,b,c;
int main()
{
    scanf("%d",&t);
    int ok = 1;
    int time,lastx,lasty;
    time = lastx = lasty = 0;
    while(t--)
    {
        cin>>a>>b>>c;
        int now = abs(b-lastx)+abs(c-lasty);
        int nowt = a - time;
        if(nowt<now)ok = 0;
        else
        {
            int m = nowt-now;
            if(m&1)ok = 0;
        }
        time = a;
        lastx=b;
        lasty=c;
    }
    if(ok)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <numeric>
#include <utility>
#include <tuple>

#define REP(i, a, b) for (int i = int(a); i < int(b); i++)
using namespace std;
using ll = long long int;
using P = pair<ll, int>;

// clang-format off
#ifdef _DEBUG_
#define dump(...) do{ cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; PPPPP(__VA_ARGS__); cerr << endl; } while(false)
template<typename T> void PPPPP(T t) { cerr << t; }
template<typename T, typename... S> void PPPPP(T t, S... s) { cerr << t << ", "; PPPPP(s...); }
#else
#define dump(...) do{ } while(false)
#endif
template<typename T> vector<T> make_v(size_t a, T b) { return vector<T>(a, b); }
template<typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }
template<typename T> bool chmin(T &a, T b) { if (a > b) {a = b; return true; } return false; }
template<typename T> bool chmax(T &a, T b) { if (a < b) {a = b; return true; } return false; }
template<typename T> void print(T a) { cout << a << endl; }
template<typename T, typename... Ts> void print(T a, Ts... ts) { cout << a << ' '; print(ts...); }
template<typename T> istream &operator,(istream &in, T &t) { return in >> t; }
// clang-format on

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n;
    cin, n;
    vector<P> a(n);
    REP(i, 0, n) {
        ll b;
        cin, b;
        a[i] = {b, i};
    }
    sort(a.rbegin(), a.rend());
    auto dp = make_v(n + 1, n + 1, 0LL);
    REP(i, 0, n) {
        REP(j, 0, i + 1) {
            int l = abs(j - a[i].second);
            chmax(dp[i + 1][j + 1], dp[i][j] + l * a[i].first);
            int r = abs(n - i + j - a[i].second - 1);
            chmax(dp[i + 1][j], dp[i][j] + r * a[i].first);
        }
    }
    ll ans = 0;
    REP(i, 0, n + 1) {
        chmax(ans, dp[n][i]);
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 34620
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;
int main()
{
    int K;
    cin >> K;
    rep(i, K) {
        cout << "ACL";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 3632
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cctype>
#include<cmath>
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<set>
#include<map>
#include<bitset>
#include<utility>
#include<string>

using namespace std;

main(){
  int n,m,i,j;
  while(1){
    int now=1;
    int nin;
    int f=0;
    int ans=0;
    int s[1010]={0};
    cin >> n >> m ;
    if(n==0 && m==0){
      break;
    }
    for(i=1;i<=n;i++){
      cin >> s[i];
    }
    for(i=1;i<=m;i++){
      cin >> nin;
      if(f==0){
	now+=nin;
	if(now>=n){
	  ans=i;
	  f++;
	  continue;
	}
	now+=s[now];
	if(now>=n){
	  ans=i;
	  f++;
	}
      }
    }
    cout << ans << endl;
  }
}

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

string s;
int n;
int dp[20][2];

int solve(int i, int f)
{
    if(i == n) return 0;
    if(dp[i][f] != -1) return dp[i][f];
    int ans = 0;
    for(int d = 0; d <= (f? 9 : s[i]-'0'); d++)
        ans = max(ans, d + solve(i+1, f? 1 : (d < s[i]-'0')));
    return dp[i][f] = ans;
}

int main() 
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    while(cin >> s)
    {
        n = s.size();
        memset(dp, -1, sizeof dp);
        cout << solve(0,0) << '\n';
    }
    return 0;
}

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

namespace app152
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            decimal a = decimal.Parse(str[0]);
            decimal b = decimal.Parse(str[1]);

            decimal A = 0;
            if (b == 1)
            {
                A = a;
            }
            else
            {
                for (int i = 0; i < b; i++)
                {
                    A = 10 * A;
                    A += a;
                }
            }

            decimal B = 0;
            if (a == 1)
            {
                B = b;
            }
            else
            {
                for (int i = 0; i < a; i++)
                {
                    B = 10 * B;
                    B += b;
                }
            }

            if (a < b)
            {
                Console.Write(A);
            }
            else
            {
                Console.Write(B);
            }
        }
    }
}


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

#define ll          long long
#define ld          long double
#define pb          push_back
#define pii         pair<int,int> 
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define F         first
#define S           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define mem(x)      memset(x,0,sizeof(x));
#define what_is(x)  cerr << #x << " is " << x << endl;
#define rep(i,a,b)  for(int i=a;i<b;i++)

using namespace std;

void solve(){
    int n,m;
    cin>>n>>m;
    ll dp[n+1][m+1];
    char a[n+1][m+1];

    rep(i,0,n+1)a[i][0]='#';

    rep(i,0,m+1)a[0][i]='#';

    rep(i,1,n+1)
        rep(j,1,m+1)cin>>a[i][j];

    mem(dp);

    dp[1][1]=1;
    

    rep(i,1,n+1){
        rep(j,1,m+1){
            if(a[i][j]=='#')continue;
            dp[i][j]=(dp[i][j]+dp[i][j-1])%hell;
            dp[i][j]=(dp[i][j]+dp[i-1][j])%hell;        
        }
 
    }

    cout<<dp[n][m];
}



int main(){
    // #ifndef ONLINE_JUDGE
    // // for getting input from input.txt
    // freopen("input.txt", "r", stdin);
    // // for writing output to output.txt
    // freopen("output.txt", "w", stdout);
    // #endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    
   

    int t=1,i=1;
    //cin>>t;
    

    while(t--){
       // cout<<"Case #"<<i++<<": ";
        solve();
    
    }

    return 0;
}

Measured memory_bytes: 9088
//B - Golden Apple
//20190912
using System;
using System.Linq;

namespace B
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int N = input[0];
            int D = input[1];

            int ans = 0;

            ans = (int)Math.Ceiling(N / (D * 2.0 + 1.0));
            

            Console.WriteLine(ans);

        }
    }
}


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

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

using namespace std;
using ll = long long;

void solve();

int main(void){
    string S;
    cin >> S;
    int alp[26] = {0};
    int lenS = S.length();
    rep(i, lenS){
        alp[S[i]-'a']++;
    }
    int index = -1;
    rep(i, 26) if(alp[i] == 0){ index = i; break;} //未使用の文字はindex + 'a'
    if(index == -1){
        int boarder = -1;
        int val;
        for(int j = 25; j >= 1; j--){
            if(S[j-1] <= S[j]){boarder = j-1; val = S[j-1] - 'a'; break;}
        }
        if(boarder == -1) cout << -1 << endl;
        else{
            int temp[26] = {0};
            for(int j = boarder; j < lenS; j++){
                temp[S[j]-'a']++;
            }
            string conc = "";
            rep(j, boarder) conc += S[j];
            for(int j = val+1; j < lenS; j++){
                if(temp[j] == 1){
                    conc += j + 'a';
                    break;
                }
            }
            cout << conc << endl;
        }
    }
    else{
        S += index + 'a';
        cout << S << endl;
    }
    return 0;
}

void solve(){}

Measured memory_bytes: 256
#include <stdio.h>

int main () {

    int n, min, i, x, s, t;

    scanf("%d", &n);

    min = 1000000001; t = -1000000001;

    for (i = 0; i < n; i++) {
        scanf("%d", &x);
        s = x - min;
        if (s >= t && i != 0)
            t = s;
        if (min > x)
            min = x;
    }

    printf("%d\n", t);

    return 0;

}


Measured memory_bytes: 2140
ans =[]

while true
  args = gets.split(" ").map{|e|e.to_i}
  break if args[0] == -1 && args[1] == -1 && args[2] == -1
  if args[0] == -1 || args[1] == -1
    ans.push "F"
  elsif args[0] + args[1] >= 80
    ans.push "A"
  elsif args[0] + args[1] >= 65
    ans.push "B"
  elsif args[0] + args[1] >= 50
    ans.push "C"
  elsif args[0] + args[1] >=30
    if args[2] >=50
      ans.push "C"
    else
      ans.push "D"
    end
  elsif args[0] + args[1] < 30
    ans.push "F"
  end
end
ans.each {|e|
puts e
}

Measured memory_bytes: 8632
#include<stdio.h>
#include<string.h>
#include <ctype.h>

int main(){
    char text[1001]; // 一行に入力される文字列数は最大で100文字
    //char end[11] = "END_OF_TEXT";
    int i;
    int count = 0;
    char input[11];

    // 一回目の単語読み取り
    scanf("%s", input);

    while(1){
        scanf("%s", text);

        if(strcmp(text, "END_OF_TEXT") == 0){
            printf("%d\n", count);
            break;
        }

        for(i = 0; text[i] != '\0'; i++){
            text[i] = tolower(text[i]);
        }
        if(strcmp(text,input) == 0) {
            count++;
        }
    }
    return 0;
}



Measured memory_bytes: 1988
using System;
using System.Globalization;
using System.IO;
using System.Linq;

namespace AtCoder
{
    internal class Program
    {
        static void Main(string[] args)
        {
            var sr = new InputReader(Console.In);
            //var sr = new InputReader(new StreamReader("input.txt"));
            using (var sw = Console.Out)
            //using (var sw = new StreamWriter("output.txt"))
            {
                Solve(sr, sw);
            }
        }


        internal static void Solve(InputReader sr, TextWriter sw)
        {
            var n = sr.NextInt32();

            var i = 0;
            var sum = 0;
            while (true)
            {
                if (sum >= n)
                {
                    sw.WriteLine(i);
                    return;
                }
                sum += ++i;
            }
        }
    }
    internal class InputReader : IDisposable
    {
        private bool isDispose;
        private readonly TextReader sr;

        public InputReader(TextReader stream)
        {
            sr = stream;
        }

        public void Dispose()
        {
            //Dispose(true);
            GC.SuppressFinalize(this);
        }

        public string NextString()
        {
            var result = sr.ReadLine();
            return result;
        }

        public int NextInt32()
        {
            return int.Parse(NextString());
        }

        public long NextInt64()
        {
            return long.Parse(NextString());
        }

        public string[] NextSplitStrings()
        {
            return NextString()
                .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        }

        public string[] NextSplitInts()
        {
            return NextString()
                .Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
        }

        public T[] ReadArray<T>(Func<string, CultureInfo, T> func)
        {
            return NextSplitStrings()
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
        }

        public T[] ReadArrayFromString<T>(Func<string, CultureInfo, T> func, string str)
        {
            return str.Split(new[] { ' ' }, StringSplitOptions.RemoveEmptyEntries)
                .Select(s => func(s, CultureInfo.InvariantCulture))
                .ToArray();
        }

        //protected void Dispose(bool dispose)
        //{
        //    if (isDispose) return;
        //    if (dispose)
        //    {
        //        sr.Close();
        //    }
        //    isDispose = true;
        //}

        //~InputReader()
        //{
        //    Dispose(false);
        //}
    }
}

Measured memory_bytes: 13140
#include<stdio.h>

int main(void){
  int i,j;
  int n;
  double h;
  int class[6];

  for(i=0;i<6;i++)class[i] = 0;

  scanf("%d",&n);

  for(i=0;i<n;i++){
    scanf("%lf",&h);
    if(h<165)class[0]++;
    else if(h<170)class[1]++;
    else if(h<175)class[2]++;
    else if(h<180)class[3]++;
    else if(h<185)class[4]++;
    else class[5]++;
  }

  for(i=0;i<6;i++){
    printf("%d:",i+1);
    for(j=0;j<class[i];j++)putchar('*');
    putchar('\n');
  }

  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i = (a);i <= (b);i++)
#define pii pair<int,int>
#define fi first
#define se second
using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int inf = 0x3f3f3f3f;
const int maxn = 2e5 + 5;
const int maxm = 1e6 + 5;
const double eps = 1e-8;
const double pi = acos(-1.0);
ll gcd(ll a,ll b){return !b?a:gcd(b,a%b);}
int a,b;
double x = 0.08,y = 0.1;
int main(){
//	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	cin >> a >> b;
	bool ok = 1;
	for(int i = 1;;i++){
		if((int)floor(x * i) == a && (int)floor(y * i)== b){
			cout << i << endl;
			break;
		}
		if(i > 10000){
			ok = 0;
			break;
		}
	}
	if(!ok) cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define X first
#define Y second
#define pb emplace_back
#define FOR(i,a,b) for(int (i)=(a);i<(b);++(i))
#define EFOR(i,a,b) for(int (i)=(a);i<=(b);++(i))
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define rreps(X,S,Y) for (int (X) = (Y)-1;(X) >= (S);--(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())

using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef ll LL;
typedef pii PII;
typedef pll PLL;
template<class T> using vv=vector<vector<T>>;
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
const ll MOD=1e9+7;

int N;
string S;
char buf[214514];
int cnt[26];
int q[214514];
int inv[214514];
LL BIT[214514];
vector<int> poss[26];

void Add(int k, int x) {
  ++k;
  while (k <= 214500) {
    BIT[k] += x;
    k += k&-k;
  }
}

LL Sum(int k) {
  LL ret = 0;

  ++k;
  while (k > 0) {
    ret += BIT[k];
    k -= k&-k;
  }
  return ret;
}

bool cmp(pii a, pii b) {
  int c = a.first;
  int i = a.second;
  int n = poss[c].size();
  --n;
  int d = b.first;
  int j = b.second;
  int m = poss[d].size();
  --m;
  if (c == d) return i < j;
  if (poss[c][i] < poss[d][j] && poss[d][m-j] < poss[c][n-i]) return true;
  if (poss[d][j] < poss[c][i] && poss[c][n-i] < poss[d][m-j]) return false;
  return poss[c][i] < poss[d][j];
}

int main() {
  scanf("%s", buf);
  N = strlen(buf);
  S = buf;
  rep(i, N) {
    poss[S[i]-'a'].eb(i);
  }

  int cnt = 0;
  rep(i, 26) {
    int t = poss[i].size()%2;
    cnt += t;
    if (t == 1) {
      int k = poss[i].size()/2;
      inv[N/2] = poss[i][k];
    }
  }

  if (cnt > 1) {
    puts("-1");
    return 0;
  }

  cnt = 0;
  vector<pii> qs;
  rep(i, 26) {
    int k = poss[i].size();
    rep(j, k/2) {
      qs.eb(pii(i, j));
    }
  }
  sort(all(qs), cmp);

  assert(qs.size() == N/2);
  rep (i, N/2) {
    auto p = qs[i];
    int c = p.first;
    int k = p.second;
    int m = poss[c].size();
    inv[i] = poss[c][k];
    inv[N-1-i] = poss[c][m-1-k];
  }

  /*rep (i, N) {
    printf("%d ", inv[i]);
  }puts("");*/

  LL ans = 0;
  rep(i, N) {
    ans += Sum(N+10) - Sum(inv[i]);
    Add(inv[i], 1);
  }
  printf("%lld\n", ans);
}


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

public class Main {
    public static void main(String args[]){
        Scanner sc = new Scanner(System.in);

        int n = sc.nextInt();

        final int Amax = (int)1e6;

        int baisuu[] = new int[Amax + 1];
        Arrays.fill(baisuu,0);

        int presentBaisuu[] = new int[n];

        for(int i = 0; i < n; i++){
            int x = sc.nextInt();
            presentBaisuu[i] = x;

            //同じ数を弾く処理
            if(baisuu[x] >= 1){
                baisuu[x]++;
                continue;
            }

            //0番目のindexは使わない
            for(int j = 1; j <= Amax / x; j++){
                baisuu[j * x]++;
            }
        }

        int ans = 0;
        for(int k = 0; k < n; k++){
            if(baisuu[presentBaisuu[k]] == 1){
                ans++;
            }
        }

        System.out.println(ans);

    }
}



Measured memory_bytes: 63944
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
 
using namespace std;
 
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
 
int getInt() {
    int s;
    scanf("%d", &s);
    return s;
}
 
typedef long long ll;
const ll mod = 1000000007;
 
ll x[100000];
ll f[100000 + 10];
ll rf[100000 + 10];
 
ll mpow(ll b, ll e) {
    ll ans = 1;
    while(e){
        if(e % 2 == 1) ans = (ans * b) % mod;
        b = (b * b) % mod;
        e = e / 2;
    }
    return ans;
}
 
int main(){
    const int n = getInt();
    REP(i,n) x[i] = getInt();
 
    f[0] = 1;
    REP(i,n) f[i + 1] = f[i] * (i + 1) % mod;

    ll ans = 0;
    ll acc = 0;
    for(int i = 1; i < n; i++) {
        acc = (acc + mpow(i, mod - 2)) % mod;
        ans = (ans + (x[i] - x[i - 1]) * acc % mod) % mod;
    }
 
    ans = ans * f[n - 1] % mod;
 
    printf("%lld\n", ans);
 
    return 0;
}

Measured memory_bytes: 1792
import Text.Printf
import Control.Applicative

ccircle :: [Double] -> [Double]
ccircle (x1 : y1 : x2 : y2 : x3 : y3: _) = [px, py, r]
    where
        f :: Floating a => a -> a -> a -> a -> a
        f a1 a2 b1 b2 = (/ 2.0) $ (a1 + a2) * (a1 - a2) + (b1 + b2) * (b1 - b2)
        f12 = f x1 x2 y1 y2
        f23 = f x2 x3 y2 y3
        det = (x1 - x2) * (y2 - y3) - (y1 - y2) * (x2 - x3)
        px = (/ det) $ f12 * (y2 - y3) + f23 * (y2 - y1)
        py = (/ det) $ f12 * (x3 - x2) + f23 * (x1 - x2)
        r = sqrt $ (x1 - px) * (x1 - px) + (y1 - py) * (y1 - py)

main :: IO ()
main = do
    _ <- getLine
    ans <- map ccircle . map (map read) . map words . lines <$> getContents
    mapM_ (\[px, py, r] -> printf "%.3g %.3g %.3g\n" px py r) ans

Measured memory_bytes: 4528
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_macros)]
#![allow(unused_imports)]

use std::str::FromStr;
use std::io::*;
use std::collections::*;
use std::cmp::*;

struct Scanner<I: Iterator<Item = char>> {
    iter: std::iter::Peekable<I>,
}

macro_rules! exit {
    () => {{
        exit!(0)
    }};
    ($code:expr) => {{
        if cfg!(local) {
            writeln!(std::io::stderr(), "===== Terminated =====")
                .expect("failed printing to stderr");
        }
        std::process::exit($code);
    }}
}

impl<I: Iterator<Item = char>> Scanner<I> {
    pub fn new(iter: I) -> Scanner<I> {
        Scanner {
            iter: iter.peekable(),
        }
    }

    pub fn safe_get_token(&mut self) -> Option<String> {
        let token = self.iter
            .by_ref()
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>();
        if token.is_empty() {
            None
        } else {
            Some(token)
        }
    }

    pub fn token(&mut self) -> String {
        self.safe_get_token().unwrap_or_else(|| exit!())
    }

    pub fn get<T: FromStr>(&mut self) -> T {
        self.token().parse::<T>().unwrap_or_else(|_| exit!())
    }

    pub fn vec<T: FromStr>(&mut self, len: usize) -> Vec<T> {
        (0..len).map(|_| self.get()).collect()
    }

    pub fn mat<T: FromStr>(&mut self, row: usize, col: usize) -> Vec<Vec<T>> {
        (0..row).map(|_| self.vec(col)).collect()
    }

    pub fn char(&mut self) -> char {
        self.iter.next().unwrap_or_else(|| exit!())
    }

    pub fn chars(&mut self) -> Vec<char> {
        self.get::<String>().chars().collect()
    }

    pub fn mat_chars(&mut self, row: usize) -> Vec<Vec<char>> {
        (0..row).map(|_| self.chars()).collect()
    }

    pub fn line(&mut self) -> String {
        if self.peek().is_some() {
            self.iter
                .by_ref()
                .take_while(|&c| !(c == '\n' || c == '\r'))
                .collect::<String>()
        } else {
            exit!();
        }
    }

    pub fn peek(&mut self) -> Option<&char> {
        self.iter.peek()
    }
}

fn main() {
    let cin = stdin();
    let cin = cin.lock();
    let mut sc = Scanner::new(cin.bytes().map(|c| c.unwrap() as char));
    let X: usize = sc.get();
    let Y: usize = sc.get();
    let ans = X + Y / 2;
    println!("{}", ans);
}


Measured memory_bytes: 4352
#include<cstdio>
#include<cmath>
#include<iostream>
using namespace std;
int main()
{
	int a,b,k;
	cin>>a>>b>>k;
	for(int i=min(a,b);i>=1;i--){
		if(a%i==0&&b%i==0){
			k--;
			if(k==0){
				cout<<i;
				break;
			}
		}
	}
}

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

#define loop(lp) for(int lp2 = 0; lp2 < lp; lp2 ++)
#define ascent(i, a, b) for(int i = a; i < b; i ++)

#define pb push_back

using namespace std;

int main() {
  int N, M;
  map<int, string> sysID;

  cin >> N;
  ascent(i, 0, N) {
    string tmp;
    cin >> tmp;
    sysID.insert(make_pair(i, tmp));
  }

  cin >> M;
  bool door = false; //if the door opened, then "true"
  ascent(i, 0, M) {
    string card;
    cin >> card;
    //   cout << "  " << card << endl;

    ascent(j, 0, N) {
      //cout << "   " << sysID[j] << endl;
      if(sysID[j] == card) {
	if(door) {
	  cout << "Closed by " << card << endl;
	}
	else {
	  cout << "Opened by " << card << endl;
	}

	door = !door;
	break;
      }

      if(j == N-1) {
	cout << "Unknown " << card << endl;
      }
    }
  }

  return 0;
}

Measured memory_bytes: 1236
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <iterator>
#include <map>
#include <numeric>
#include <set>
#include <vector>
#include <queue>

using namespace std;

typedef long long ll;
typedef long double ld;

constexpr int INF = 1e9;
constexpr ll BIGINF = 1e18;
constexpr double EPS = 1e-16;
constexpr int MOD = 1e9 + 7;

void preambule() {
  cin.tie(0);
  cout.precision(16);
  cout << fixed;
}

int a;
int b;

void input() {
  cin >> a >> b;
}

void solve() {
  cout << 1.0 * a / b << '\n';
}

int main() {
#ifdef _DEBUG
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  preambule();
  input();
  solve();
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const long long inf=1e16+10;
long long a[10];
signed main(){
	long long k,m,n;
	long long ans=inf,sum;
	scanf("%lld%lld%lld%lld%lld%lld",&n,&a[1],&a[2],&a[3],&a[4],&a[5]);
	for(register int i=1;i<=5;i++)ans=min(a[i],ans);
	sum=(n-1)/ans+1;
	printf("%lld\n",sum+4);
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
        // write your code here
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int m = sc.nextInt();

        int[] array = new int[n];
        int sum = 0;

        int count = 0;

        for (int i = 0; i < n; i++) {
            array[i] = sc.nextInt();
            sum += array[i];
        }

        double limit = ((double) sum) / (4 * m);

        for (int i = 0; i < n; i++) {
            if (array[i] >= limit) {
                count++;
            }
        }

        System.out.println(count >= m ? "Yes" : "No");
    }
}

Measured memory_bytes: 23764
A = [list(map(int,input().split())) for _ in range(3)]
N = int(input())
B = [int(input()) for _ in range(N)]

for i in range(N):
    for j in range(3):
        for k in range(3):
            if A[j][k]==B[i]:
                A[j][k] = 0

ans = 'No'
for i in range(3):
    if A[i] == [0,0,0]:
        ans = 'Yes'
    if [A[0][i],A[1][i],A[2][i]]==[0,0,0]:
        ans = 'Yes'

if [A[0][0],A[1][1],A[2][2]]==[0,0,0]:
    ans = 'Yes'

if [A[0][2],A[1][1],A[2][0]]==[0,0,0]:
    ans = 'Yes'

print(ans)   

Measured memory_bytes: 38384
var lines = []; var result = 0;
var readline = require('readline');

var rl = readline.createInterface({
    input: process.stdin,
    output: process.stdout,
});

rl.on('line', function (x) {
    lines.push(x);
})

rl.on('close', function () {

    var N = Number(lines[0].split(" ")[0])

    for (var i = 0; i < 100; i++) {
        for (var j = 0; j < 100; j++) {
            var ans = 4 * i + 7 * j;
            if (ans === N) { console.log("Yes"); return (0) }
        }
    }
    console.log("No")

});

Measured memory_bytes: 21192
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
const ld eps = 1e-9;

vector<int>v;
int memo[101][101][10];
int solve(int l, int r,int t) {
	if (memo[l][r][t] != -1)return memo[l][r][t];
	if (l == r)return memo[l][r][t] = true;
	if (l+1 == r)return memo[l][r][t] = v[l]==t;
	if (l > r)assert(false);
	if (all_of(v.begin()+l, v.begin()+r, [&](const int n) {return n == t; }))return memo[l][r][t] = true;
	
	bool ok = false;
	for (int k = l + 1; k < r; ++k) {
		if (solve(l, k, t) && solve(k, r, t))ok = true;
	}
	if (t == 0) {
		if (v[l] == v[r - 1]) {
			if (solve(l + 1, r - 1, v[l]))ok = true;
		}
	}
	else {
		if (solve(l, r, 0))ok = true;
		if (v[l] == v[r - 1]) {
			if (solve(l + 1, r - 1, v[l]))ok = true;
		}
	}
	return memo[l][r][t] = ok;
}

int main() {
	for (int i = 0; i < 101; ++i) {
		for (int j = 0; j < 101; ++j) {
			for (int k = 0; k < 10; ++k) {
				memo[i][j][k] = -1;
			}
		}
	}
	int N; cin >> N;
	v.resize(N);
	for (int i = 0; i < N; ++i)cin >> v[i];
	int ans = solve(0, N,0);
	cout << (ans ? "yes" : "no") << endl;
	return 0;
}

Measured memory_bytes: 3524
(* Vicfred
 * https://atcoder.jp/contests/abc126/tasks/abc126_a
 * implementation
 * *)
let n, k, s = Scanf.scanf " %d %d\n%s" @@ fun a b c -> a, b - 1 , c
let main = print_endline @@ String.mapi (fun i c -> if i = k then Char.lowercase_ascii c else c) s



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

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

    vector <int> city (2 * M);

    for (int i = 0; i < 2 * M; i++){
        cin >> city.at(i);
    }
    for (int i = 0; i < N; i++){
        int road_kazu = 0;
        for (int j = 0; j < 2 * M; j++){
            if (i + 1 == city.at(j)){
                road_kazu++;
            }
        }
        cout << road_kazu << endl;
    }
}

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

int main() {
int N, K;
  cin >> N >> K;
  vector<int> h(N);
  rep(i, N)
    cin >> h.at(i);
  vector<int> pro(N, 0);
  rep(i, N){
  if(i == 0)
    continue;
    else if(i <= K){
    pro[i] = abs(h[0] - h[i]);
    }
    else if(i > K){
      int prov = 10000100000000;
      rep2(j, i-K, i)
      prov = min(prov, pro[j]+abs(h[i]-h[j]));
      pro[i] = prov;
    }
  }
  cout << pro[N-1] << endl;
}

Measured memory_bytes: 1024
# E

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

def gcd(a,b):
    if a>b:
        a,b=b,a
    while a%b:
        a,b=b,(a%b)
    return b

def fast_factorization_init(N):
    res=list(range(N))
    for i in range(2,N):
        if i*i>N:
            break
        for j in range(i*i,N,i):
            if res[j]==j:
                res[j]=i
        if res[i]<i:
            continue
    return res            
    
min_factors=fast_factorization_init(10**6+10)
def fast_factorization(n):
    res=[]
    while n>1:
        res.append(min_factors[n])
        n//=min_factors[n]
    return list(set(res))

res2=0
P=[]
for i in range(N):
    if i!=0:
        res1=gcd(A[i],res1)
    else:
        res1=A[0]
    P += fast_factorization(A[i])

if len(set(P))==len(P):
    res2=1

if res2==1:
    print('pairwise coprime')
elif res1==1:
    print('setwise coprime')
else:
    print('not coprime')

Measured memory_bytes: 249312
#include <bits/stdc++.h>
using namespace std;
using lint = long long int;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;
template<class T> void assign(V<T>& v, int n, const T& a = T()) { v.assign(n, a); }
template<class T, class... U> void assign(V<T>& v, int n, const U&... u) { v.resize(n); for (auto&& i : v) assign(i, u...); }

const lint inf = 1e18;
template<class T> struct edge { int to; T cap; int rev; edge(int t, T c, int r) : to(t), cap(c), rev(r) {} };

void add_edge(int from, int to, auto cap, auto& g) {
  g[from].emplace_back(to, cap, g[to].size());
  g[to].emplace_back(from, 0, g[from].size() - 1);
}

template<class T> T dinic(int s, int t, VV< edge<T> > g) {
  int n = g.size();
  V<> dist, i;

  auto bfs = [&]() {
    dist.assign(n, -1);
    queue<int> q;
    dist[s] = 0; q.push(s);
    while (!q.empty()) {
      int v = q.front(); q.pop();
      for (auto&& e : g[v]) if (dist[e.to] == -1 and e.cap > 0) {
        dist[e.to] = dist[v] + 1; q.push(e.to);
      }
    }
  };

  function<T(int, T)> dfs = [&](int v, T f) {
    if (v == s) return f;
    for (; i[v] < g[v].size(); i[v]++) {
      edge<T>& e = g[v][i[v]];
      if (dist[e.to] < dist[v] and g[e.to][e.rev].cap > 0) {
        T d = dfs(e.to, min(f, g[e.to][e.rev].cap));
        if (d > 0) {
          g[e.to][e.rev].cap -= d;
          e.cap += d;
          return d;
        }
      }
    }
    return (T) 0;
  };

  T res = 0;
  while (true) {
    bfs();
    if (dist[t] == -1) return res;
    i.assign(n, 0);
    while (true) {
      T f = dfs(t, inf);
      if (f == 0) break;
      res += f; 
    }
  }
}

int main() {
  cin.tie(NULL); ios::sync_with_stdio(false);
  int n; cin >> n;
  V<lint> a(n + 1); for (int i = 1; i < n + 1; i++) cin >> a[i];
  VV< edge<lint> > g(n + 2);
  lint res = 0;
  for (int i = 1; i < n + 1; i++) {
    if (a[i] < 0) {
      add_edge(i, n + 1, -a[i], g);
    } else {
      add_edge(0, i, a[i], g);
      res += a[i];
    }
    for (int j = 2 * i; j < n + 1; j += i) {
      add_edge(j, i, inf, g);
    }
  }
  cout << res - dinic<lint>(0, n + 1, g) << '\n';
}

Measured memory_bytes: 384
#include<iostream>
#include<vector>
//#include<math.h>
#include <unordered_map>
using namespace std;

int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if(c-a+b>=0)
    {
        cout<<c-a+b;
    }
    else
    {
        cout<<0<<endl;
    }
}

Measured memory_bytes: 888
import java.io.BufferedReader;
import java.io.InputStreamReader;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve(args);
    }

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        b = b - 1;
        int c = scanner.nextInt();
        int d = scanner.nextInt();
        d = d - 1;

        if (b < c || d < a) {
        	System.out.println(0);
        }else {
        	int count = 0;
        	for (int i = 0;i<100;i++) {
        		if ((a <= i)&&(i <= b)&&
        			(c <= i)&&(i <= d)) {
        			count++;
        		}
        	}
        	System.out.println(count);
        }

    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        public String next() {
            try {
                if (i < s.length) return s[i++];
                String line = br.readLine();
                while (line.equals("")) {line = br.readLine();}
                s = line.split(reg, 0);
                i = 0;return s[i++];
            } catch (Exception e) {e.printStackTrace();}
            return null;
        }
        public int nextInt() {
            try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public double nextDouble() {
            try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public long nextLong()  {
            try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
    }
}

Measured memory_bytes: 23252
#-*-coding:utf-8-*-
import sys
input=sys.stdin.readline
import numpy as np

def main():
    n = input()
    A = np.array(input().split(),dtype=np.int32)
    answer=0

    while np.all(A%2==0):
        A//=2
        answer+=1
    print(answer)

if __name__=="__main__":
    main()

Measured memory_bytes: 27220
# @author 

import sys

class BAnOddProblem:
    def solve(self, tc=0):
        n = int(input())
        a = [int(_) for _ in input().split()]
        ans = 0
        for i, x in enumerate(a):
            i += 1
            ans += (i % 2) and (a[i - 1] % 2)

        print(ans)

solver = BAnOddProblem()
input = sys.stdin.readline

solver.solve()


Measured memory_bytes: 61812
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		solve();
	}

	public static void solve() {
        Scanner sc = new Scanner(System.in);
        PrintWriter out = new PrintWriter(System.out);
		String s = sc.nextLine();
        sc.close();
        StringBuilder sb = new StringBuilder();
        int n = s.length();
        sb.append(s.charAt(0));
        sb.append(n-2);
        sb.append(s.charAt(n-1));
        out.println(sb.toString());
        out.flush();
	}
}

Measured memory_bytes: 21460
#include<bits/stdc++.h>
using namespace std;
long long int n;
const long long int x=100000;
long long int a[x];
long long int dp[x+10];
int frog_jump(int i)
{
  long long int left=INT_MAX,right=INT_MAX;
  if(i+1==n)
    return 0;
  if(dp[i]!=-1)
    return dp[i];
  if(i+1<=n-1)
  {
    left=abs(a[i]-a[i+1])+frog_jump(i+1);
  }
  if(i+2<=n-1)
    right=abs(a[i]-a[i+2])+frog_jump(i+2);
  dp[i]=min(left,right);
  return dp[i];
  
}
int main()
{
  long long int result;
  memset(dp,-1,sizeof(dp));
  cin>>n;
  for(int i=0;i<n;i++)
  	cin>>a[i];
  result=frog_jump(0);
  cout<<result<<endl;
}

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

int main() {
	int a;
	vector<int> hon{ 2,4,5,7,9 };
	vector<int> pon{ 0,1,6,8 };
	vector<int> bon{ 3 };

	cin >> a;
	a = a % 10;

	unsigned int i;
	string answer = "error";
	for (i = 0; i < hon.size(); i++) {
		if (a == hon.at(i)) {
			answer = "hon";
		}
	}
	for (i = 0; i < pon.size(); i++) {
		if (a == pon.at(i)) {
			answer = "pon";
		}
	}
	for (i = 0; i < bon.size(); i++) {
		if (a == bon.at(i)) {
			answer = "bon";
		}
	}
	cout << answer << endl;

	return 0;

}

Measured memory_bytes: 3628
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <iomanip>
#include <queue>
#include <functional>
#include <cassert>
#include <cmath>
#include <set>

#define REP(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define NL << endl

using namespace std;
using ll = long long;
using ull = unsigned long long;


int main() {

	int n;

	cin >> n;

	ll sum = 0;
	REP(i, n) {
		int t;
		cin >> t;
		sum += t;
	}

	cout << sum - n NL;


	return 0;

}

Measured memory_bytes: 256
class Node:
    def __init__(self):
        self.parent = -1

def dfs(v, d=0):
    G[v].depth = d
    for child in G[v].children:
        dfs(child,d+1)

N = int(input())
G = [Node() for _ in range(N)]
for _ in range(N):
    idx,k,*children = [int(x) for x in input().split()]
    G[idx].children = children
    if k:
        G[idx].type = 'internal node'
    else:
        G[idx].type = 'leaf'
    for child in children:
        G[child].parent = idx

root = [i for i,x in enumerate(G) if x.parent == -1][0]
G[root].type = 'root'
dfs(root)
for i,node in enumerate(G):
    print('node {}: parent = {}, depth = {}, {}, [{}]'.format(
        i,
        node.parent,
        node.depth,
        node.type,
        ', '.join(map(str,node.children))
        )
    )


Measured memory_bytes: 40204
#include <stdio.h>

int main(void)

{
int a, b;

scanf("%d %d", &a, &b);

if(a == b)
{
printf("a == b\n");
}
else
{
if(a < b)
{
printf("a < b\n");
}
else
{
printf("a > b\n");
}
}
return 0;
}



Measured memory_bytes: 2052
#include<stdio.h>
#include<stdlib.h>

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL){ 
    y = x;
    if(z->key < x->key){ 
      x = x->left; 
    } 
    else { 
      x = x->right; 
    } 
  } 
  z->parent = y; 

  if(y == NIL){ 
    root = z; 
  } 
  else if(z->key < y->key){ 
    y->left = z; 
  }else { 
    y->right = z;
  }  

}
  
void inorder(Node u){
if(u->left!=NULL) inorder(u->left);
printf(" %d",u->key);
if(u->right!=NULL) inorder(u->right);
}

void preorder(Node u){ 
printf(" %d",u->key);
if(u->left!=NULL) preorder(u->left);
if(u->right!=NULL) preorder(u->right);
 } 


int main(){
  int n, i, x, k;
  char com[20];
  scanf("%d", &n);

  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
     
    if ( com[0] == 'i' ){
      scanf("%d", &k);
      insert(k);
    }

    else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
       preorder(root);
       printf("\n");
    } 
  }

  return 0;
}

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

#define ll long long
#define ld long double
#define COIN const int
#define ite iterator
#define PII pair<int,int>
#define PSI pair<string,int>
#define PIS pair<int,string>

#define REP(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define REPD(i,n) for((i)=(n)-1;(i)>=0;(i)--)

#define ALL(c) (c).begin(), (c).end()
#define sz(s) (s).size()
#define CLEAR(x) memset(x,0,sizeof x);

#define MP make_pair
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define X first
#define Y second

#define VI vector<int>
#define VS vector<string>
#define VII vector<PII>
#define VVI vector<VI>

#define PIII 3.1415926
#define PI 3.14
/*****************************************************************************/

using namespace std;

int main()
{
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	ll x,n=100,i=1; cin >>x;
	while (1) {
		ll y=n/100;
		n+=y;
		if (n>=x) {
			cout <<i;
			return 0;
		}
		i++;
	}
}
/******************************************************************************
******************************************************************************/


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d;
	scanf("%d%d%d%d",&a,&b,&c,&d);
	while(1)
	{
		c-=b;
		if(c<=0)
		{
			puts("Yes");
			return 0;
		}
		a-=d;
		if(a<=0)
		{
			puts("No");
			return 0;
		}
	}
	return 0;
}

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

using namespace std;

#define FOR(i, n) for(int i = 0; i < (int) n; i++)
#define PB push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define F first
#define S second

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;

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

	string s; cin >> s;
	if(s.back() == 's')
		cout << s << "es\n";
	else
		cout << s << "s\n";

	return 0;
}


Measured memory_bytes: 3656
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner stdIn=new Scanner(System.in);
		int m[]=new int[51],f[]=new int[51],r[]=new int[51],i,j,s;
		for(i=0;;i++){
			m[i]=stdIn.nextInt();
			f[i]=stdIn.nextInt();
			r[i]=stdIn.nextInt();
			if(m[i]==-1&&f[i]==-1&&r[i]==-1)break;
		}
		
		for(j=0;j<i;j++){
			s=m[j]+f[j];
			if(m[j]==-1||f[j]==-1)System.out.println("F");
			else if(s>=80)System.out.println("A");
			else if(s>=65)System.out.println("B");
			else if(s>=50)System.out.println("C");
			else if(s>=30&&r[j]>=50)System.out.println("C");
			else if(s>=30)System.out.println("D");
			else System.out.println("F");
		}
	}
}


Measured memory_bytes: 26424
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, d, x;
  cin >> n >> d >> x;
  int a[n];
  for(int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int ans = x;
  for(int i = 0; i < n; i++) {
    for(int j = 1; j <= d; j += a[i]) {
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip> // cout<<setprecision(n)
#include <functional> // std::function<void(int)>
using namespace std;
#define All(v) (v).begin(),(v).end()
const long long mod = 1000000007;
const long long inf = mod*mod;
const double EPS=1e-10;
const double INF=1e+10;
const double PI=acos(-1.0);
signed main(){
    int a,b,c;
    cin>>a>>b>>c;
    cout<<max({a+b,a-b,a*b})<<endl;
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
#define all(a)  (a).begin(),(a).end()
typedef long long ll;
const ll mod=1000000007;
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)

int main() {
  int n,m;cin >>n >> m;
  vector<string> a(n),b(m);
  repi(i,0,n) cin >> a[i];
  repi(i,0,m) cin >> b[i];
  bool found = false;
  for(int i=0;i<n-m+1;++i){
    for(int j=0;j<n-m+1;++j){
      bool tmp = true;
      for(int k=0;k<m ;++k){
        string row = a[j+k].substr(i,m);
        if(row != b[k]){
          tmp=false;
          break;
        }
      }
      if(tmp) {
        found = true;
        break;
      }
    }
    if(found) break;
  }
  if(found){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		int X = sc.nextInt();
		int Z = 0;
		for(int i=0;i<=A;i++) {//Aの加算
			for(int j = 0;j <= B;j++) {//Bの加算
				for(int k = 0;k <= C;k++) {//Cの加算
					if(500*i+100*j+50*k == X)Z += 1;					
				}
			}	
		}
		System.out.println(Z);
	}
	}

Measured memory_bytes: 21716
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<long long> vll;
typedef pair<int,int> pint;
typedef pair<long long, long long> pll;

#define MP make_pair
#define PB push_back
#define ALL(s) (s).begin(),(s).end()
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P) 
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P) 
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P) 
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s; }

int n, m;
int a, b;

int main() {
    while (cin >> n >> m) {
        for (int i = 0; i < m; ++i) {
            cin >> a >> b;
            int ju = min(min(a-1, b-1), min(n-a, n-b));

            cout << (ju%3) + 1 << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 1160
#include<iostream>
#include<cmath>
#include<string>

using namespace std;


int main(){
    int A1,A2,A3;
    string answer;
    for(int i=0;i<3;i++){
        cin >> A1 >> A2 >> A3;
    }
    if(A1+A2+A3>21) answer="bust";
    else answer="win";
    cout <<answer<< endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <climits>
#include <string>
#include <stdlib.h>
#include <algorithm>

using namespace std;
 
int ascSort(const void* v1, const void* v2) {
    const int _v1 = *((const int*)v1);
    const int _v2 = *((const int*)v2);
 
    if ( _v1 < _v2 ) {
        return 1;
    } else if ( _v1 > _v2 ) {
        return -1;
    } else {
        return 0;
    }
}

int main() {
	int a,b;
	cin>>a>>b;
	if(a==b){
		cout<<"Draw";
	}else if((a>b || a==1) && b!=1){
		cout << "Alice";
	}else{
		cout << "Bob";
	}
	return 0;
}

Measured memory_bytes: 256