akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
#define int long long
#define vel vector<long long>
#define vvel vector<vel>
#define vvvel vector<vvel>
void mmin(int &a, int b) { a = min(a, b); }
void mmax(int &a, int b) { a = max(a, b); }
void sor(vel &v) { sort(v.begin(), v.end()); }
int zero() { return 0; }
int gcd(int a, int b) {
	if (a < b) return gcd(b, a);
	if (b == 0) return a;
	int r = a % b;
	return gcd(b, r);
}
int ord(int a,int p) {
	if (a%p != 0) return 0;
	return 1 + ord(a / p,p);
}
int rui(int a, int n) {
	if (n == 0) {
		return 1;
	}
	return a * rui(a, n - 1);
}
signed main() {
	int n;
	cin >> n;
	int ans = 0;
	for (int i = 0; i < 4; i++) {
		int x = n % 10;
		if (x == 2) {
			ans++;
		}
		n = n / 10;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

ll find_next(vector<int>& v, ll tmp, int n) {
  vector<int>::iterator itr = lower_bound(v.begin(), v.end(), tmp%n+1);
  return tmp + (*itr - tmp % n);
}

int main() {
  string s, t;
  cin >> s >> t;
  string s2 = s + s;
  int n = s.size();
  vector<vector<int> > A(26);
  rep(i, s2.size()) {
    A[int(s2[i] - 'a')].push_back(i);
  }
  ll tmp = -1;
  rep(i, t.size()) {
    if(A[int(t[i] - 'a')].size() == 0) {
      cout << -1 << endl;
      return 0;
    }
    tmp = find_next(A[int(t[i] - 'a')], tmp, n);
  }
  if(tmp < 1e+100 * n)
    cout << tmp + 1 << endl;
  else
    cout << -1 << endl;
  return 0;
}


Measured memory_bytes: 1980
#include <iostream>

using namespace std;

int main() {
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        int x = i;
        if (x % 3 == 0) {
            cout << " " << i;
            continue;
        }
        while(true) {
            if ( x % 10 == 3) {
                cout << " " << i;
                break;
            }
            x /= 10;
            if(!x) break;
        }

    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 3100
/**
DufauX-XuafuD
**/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define reset(x) memset(x,-1,sizeof(x))
#define CheckBit(a,b) (a&(1ll<<b))
#define SetBit(a,b) a=(a|(1ll<<b))
#define UnSetBit(a,b) a=(a&(~(1ll<<b)))
#define maxx 10000006
#define PI 2*acos(0.0)
const long long INF = 2000000000000000000LL;	// 2e18
const int inf = 0x3f3f3f3f;	// 1061109567
const long double EPS = 1e-9;
//bitset<maxx/2>vis;
//bitset<maxx>pr;
//int mobi[maxx+10];
//vector<ll>prime;
//void sieve(){
//    ll x=maxx/2, y=sqrt(maxx)/2;
//    for(ll i=1;i<=y;i++){
//        if(vis[i]==0){
//            for(ll j=(i*(i+1)*2);j<x;j+=(2*i)+1)
//                vis[j]=1;
//        }
//    }
//    prime.push_back(2);
//    for(ll i=3;i<maxx;i+=2)
//        if(vis[i/2]==0)
//        prime.push_back(i);
//}
//void generate_mobius()
//{
//    for(int i=0;i<maxx;i++)mobi[i]=1;
//    for(int i=2;i<maxx;i++){
//        if(!pr[i]){
//            mobi[i]*=-1;
//            for(int j=i+i;j<maxx;j+=i){
//                pr[j]=1;
//                mobi[j]*=(j%(i*i)?-1:0);
//            }
//        }
//    }
//}
//bool isprime(ll a)
//{
//    if(a==1)return false;
//    if(a==2)return true;
//    if(a%2==0)return false;
//    for(ll i=0;i<prime.size() && prime[i]*prime[i]<=a;i++)
//        if(a%prime[i]==0)return false;
//    return true;
//}
/* Calculate ( a*b ) %c */
inline ll mulmod(ll a, ll b, ll c) {
    ll ret = 0 , cur = a % c ;
    while(b) { if(b%2) ret=(ret+cur)%c; cur=(cur<<1)%c; b=b>>1; }
    return ret%c;
}
//Calculate (b^p)%m || modular inverse: b^-1 = bigmod(b, m-2, m)
inline ll bigmod(ll b, ll p, ll m){
    ll ret = 1, cur = b % m;
    while(p) { if(p&1) ret=(ret*cur)%m; cur=(cur*cur)%m; p=p>>1; }
    return ret;
}
inline ll modulo(ll a,ll b,ll c) { //Same as big mod, use for numbers over 1e10
    ll ret = 1 , cur = a%c ;
    while(b) { if(b%2) ret=mulmod(ret,cur,c); cur=mulmod(cur,cur,c); b=b>>1; }
    return ret%c ;
}
inline ll power(ll b, ll p){
    ll ret = 1, cur = b;
    while(p) { if(p&1) ret=(ret*cur); cur=(cur*cur); p=p>>1; }
    return ret;
}
ll lcm(ll a,ll b)
{
    return (a/__gcd(a,b))*b;
}
ll gcd(ll a,ll b)
{
    return __gcd(a,b);
}
ll t[200];
void Dufaux()
{
    ll n,sum=0,m,a,b;
    cin>>n;
    for(int i=1;i<=n;i++)cin>>t[i],sum+=t[i];
    cin>>m;
    for(int i=1;i<=m;i++){
        cin>>a>>b;
        cout<<sum-t[a]+b<<endl;
    }
}
int main()
{
    FastIO;
	///sieve();
	///generate_mobius();
	int test=1;
	while(test--){
        Dufaux();
	}
	return 0;
}






Measured memory_bytes: 3664
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,n) for(int i = (a); i < (n); ++i)
#define ALL(a) (a).begin(), (a).end()
#define debug_v(v,N) for(int i=0;i<N;i++) { cout << v[i] << " "; } cout << endl;
#define debug_vv(v,H,W) for(int i=0;i<H;i++) { for(int j=0;j<W;j++) { cout << v[i][j] << " "; } cout << endl; }

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef pair<int, int> pii;

void Main()
{
	int N; cin >> N;
	priority_queue<double, vector<double>, greater<double>> pq;
	rep(i,N) {
		double _v; cin >> _v;
		pq.push(_v);
	}
	while (pq.size() > 1) {
		double a = pq.top(); pq.pop();
		double b = pq.top(); pq.pop();
		pq.push((a + b) / 2);
	}
	cout << pq.top() << endl;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
using System.Linq;
class Program
{
    static void Main()
    {
        string s = Console.ReadLine();
        int n = s.Length - 1;
        ulong ans = 0;
        for (uint i = 0; i < (uint)Math.Pow(2, n); i++)
        {
            long v = (int)Char.GetNumericValue(s[0]);
            for (int j = 0; j < n; j++)
            {
                if ((i >> j & 1) == 0)
                {
                    v *= 10;
                    v += (int)Char.GetNumericValue(s[j + 1]);
                }
                else
                {
                    ans += (ulong)v;
                    v = (int)Char.GetNumericValue(s[j + 1]);
                }
            }
            ans += (ulong)v;
        }
        Console.WriteLine(ans);
    }
}

Measured memory_bytes: 11220
#include <bits/stdc++.h>
#define ll long long
using namespace std;
string a;
int m;
int mod=1e9+7;
long long out = 0;
int dp[10005][105],pref[10005][105];
void dawaj( string e)
{
	pref[0][0]=1;
	for(int i=1;e.size()>=i;i++)
	{
		int cyfra=e[i-1]-'0';
		for(int r=0;m>r;r++)
		{
			for(int c=0;9>=c;c++)
			{
				dp[i][(r+c)%m]=(dp[i][(r+c)%m]+dp[i-1][r])%mod;
			}
			for(int c=0;cyfra>=c;c++)
			{
				if(c==cyfra)
					{
						pref[i][(r+c)%m]=(pref[i][(r+c)%m] + pref[i-1][r])%mod;
					}
				else
					{
						dp[i][(r+c)%m] = ( dp[i][(r+c)%m ] + pref[i-1][r] )% mod;
					}

			}
		}
	}
}
int main(){
	cin>>a>>m;
	dawaj(a);
	cout<<(dp[a.size()][0]+pref[a.size()][0]-1+mod)%mod;
	return 0;
}


Measured memory_bytes: 8448
#include <iostream>
#include <iomanip> // << fixed << precision(10)
#include <vector>
#include <string>
#include <map>
#include <set>
#include <cmath>
#include <algorithm>
using namespace std;

#define FOR(i,s,t) for(int i=s;i<t;i++)
#define REP(i,n) FOR(i,0,n)
#define PRINT(s) cout << s << "\n"
#define SORT(A) sort(A.begin(), A.end())
#define EACHPRINT(A, T) for_each(begin(A), end(A), [&](T i){ cout << i << " "; });cout << "\n"
#define MOD 1000000007

typedef long lint;
typedef pair<lint, lint> P;
bool lessPair(const P& l, const P& r){return l.second < r.second;}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    lint K; cin >> K;
    lint A; cin >> A;
    lint B; cin >> B;

    if(B-A<=2) {
      PRINT(1+K);
      return 0;
    }

    if(K <= A) {
      PRINT(1+K);
      return 0;
    }
    

    K = K-(A-1);
    lint res = 0;

    if(K%2 == 1) {
      res = A+(B-A)*(K/2);
      res += 1;
      
    } else {
      res = A+(B-A)*(K/2);
    }

    cout << res << "\n";

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sanyes ios_base::sync_with_stdio(0), cout.tie(0); cin.tie(0);
#define llong long long
#define pb push_back
#define bpc __builtin_popcount

const llong mxn = 1e6 + 7;
const llong mod = 1e9 + 7;
const llong inf = 1e18 + 9;

using namespace std;

llong n, a[mxn], k, dp[101][mxn], sum2, sum1, dp2[101][mxn];
bool ok = 0;

int main (){
    cin >> n >> k;
    for (int i = 1; i <= n; i ++){
        cin >> a[i];
    }dp[0][0] = 1;
    for(int i = 1; i <= n; i ++){
        for (int j = 0; j <= k; j ++){
            dp[i][j] = dp[i - 1][j];
            if(j != 0){
                dp[i][j] = dp[i][j] + dp[i][j - 1];
                dp[i][j] %= mod;
            }if(j > a[i]){
                dp[i][j] = dp[i][j] - dp[i - 1][j - a[i] - 1];
                dp[i][j] += mod;
                dp[i][j] %= mod;
            }//cout << dp[i][j] << ' ';
        }//cout << endl;
    }cout << dp[n][k];
    return 0;
}


Measured memory_bytes: 291072
V = {"a", "i", "u", "e", "o"}
while True:
    N = int(input())
    if N==0:
        exit()
    L = []
    maxs = 0
    for _ in range(N):
        s = input()
        s_ = s[0]
        for i in range(len(s)-1):
            if s[i] in V:
                s_ += s[i+1]
        maxs = max(maxs, len(s_))
        L.append(s_ + "."*(51-len(s_)))
    L.sort()
    k = 1
    for s1, s2 in zip(L[:-1], L[1:]):
        while k != 51 and s1[:k] == s2[:k]:
            k += 1
    if k==51:
        print(-1)
    else:
        print(k)



Measured memory_bytes: 5620
mod = 10**9+7
S = input()
s = len(S)
dp = [[0 for i in range(4)]for j in range(s+1)]
mod = 10**9+7
 
dp[0][0] = 1
 
for j in range(4):
    for i in range(s):
        dp[i+1][j] = dp[i][j]%mod
        if S[i] == "?":
            dp[i+1][j] = dp[i][j]*3%mod
            if j > 0:
                dp[i+1][j] += dp[i][j-1]%mod
        else:
            if "ABC".index(S[i])+1 == j:
                dp[i+1][j] += dp[i][j-1]%mod
print(dp[s][3]%mod)

Measured memory_bytes: 27568
#[macro_use]
mod input {

use std;
use std::io;

const SPLIT_DELIMITER: char = ' ';

#[macro_export]
#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

#[allow(dead_code)]
pub fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
pub fn p<T>(t: T)
where
    T: std::fmt::Display,
{
    println!("{}", t);
}

#[allow(dead_code)]
pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let vec_line = input_vector();
        v.push(vec_line);
    }
    v
}

#[allow(dead_code)]
pub fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

#[allow(dead_code)]
pub fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}

}

use input::*;

fn main() {
    let (h, w): (usize, usize);
    input!(h, w);
    let n: usize;
    input!(n);
    let mut a = input_vector::<usize>();
    let mut vp = 0;

    let mut v = vec![vec![0; w]; h];
    let (mut hh, mut ww): (usize, usize) = (0, 0);

    let mut is_right = true;

    loop {
        if a[vp] <= 0 {
            vp += 1;
        }
        if vp == a.len() {
            break;
        }
        a[vp] -= 1;

        v[hh][ww] = vp + 1;

        if ww == 0 && !is_right {
            is_right = true;
            hh += 1;
        } else if ww == w - 1 && is_right {
            is_right = false;
            hh += 1;
        } else if is_right {
            ww += 1;
        } else if !is_right {
            ww -= 1;
        }
    }

    for vv in v {
        for vvv in vv {
            print!("{} ", vvv);
        }
        println!("");
    }
}

Measured memory_bytes: 4352
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <list>
#include <string>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <iomanip> // setprecisionを使用するのに必要 cout << fixed << setprecision(15) << p でpを小数点以下15桁表示
using namespace std;
#define REPD(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) REPD(i, 0, n)
#define DIV0 1000000007
typedef long long ll;
#define fin(ans) cout << (ans) << '\n'
/*

*/
int main()
{
    ll a,b,c,d;
    cin >> a >> b >> c >> d;
    if(a >= c){
        ll temp;
        temp = a;
        a = c;
        c = temp;
        temp = b;
        b = d;
        d = temp;
    }
    ll ans;
    //並び順がa,b,c,d or a,c,b,d or a,c,d,bになった
    if(a*b < 0 && c*d < 0){
        ans = max(a*c,b*d);
    }else if(a*b > 0 && c*d >0){
        //どちらも0を跨いでいない
        if(a*c <0){
            ans = min(abs(a),abs(b))*min(abs(c),abs(d))*-1;
        }else{
            ans = max(abs(a),abs(b))*max(abs(c),abs(d));
        }
    }else{
        if(a*b >= 0 && a > 0){
            ans = d*b;
        }else if(a*b >= 0 && a <= 0){
            ans = c * a;
        }else if(a*b < 0 && c > 0){
            ans = d*b;
        }else{
            ans = c*a;
        }
    }
    fin(ans);
    return 0;
}

Measured memory_bytes: 3156
// atcoder/abc144/D/main.cpp
// author: @___Johniel
// github: https://github.com/johniel/

#include <bits/stdc++.h>

#define each(i, c) for (auto& i : c)
#define unless(cond) if (!(cond))

using namespace std;

typedef long long int lli;
typedef unsigned long long ull;
typedef complex<double> point;

template<typename P, typename Q> ostream& operator << (ostream& os, pair<P, Q> p) { os << "(" << p.first << "," << p.second << ")"; return os; }
template<typename P, typename Q> istream& operator >> (istream& is, pair<P, Q>& p) { is >> p.first >> p.second; return is; }
template<typename T> ostream& operator << (ostream& os, vector<T> v) { os << "("; each (i, v) os << i << ","; os << ")"; return os; }
template<typename T> istream& operator >> (istream& is, vector<T>& v) { each (i, v) is >> i; return is; }

template<typename T> inline T setmax(T& a, T b) { return a = std::max(a, b); }
template<typename T> inline T setmin(T& a, T b) { return a = std::min(a, b); }

int main(int argc, char *argv[])
{
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  double a, b, x;
  while (cin >> a >> b >> x) {
    if (x < (a * a * b) / 2.0) {
      double c = 2.0 * x / (a * b);
      // double r = 90.0 - asin(c / b);
      double r = atan(b / c);
      printf("%.10lf\n", r * 180.0 / M_PI);
    } else {
      double c = 2.0 * (a * a * b - x) / (a * a);
      double r = atan(c / a);
      printf("%.10lf\n", r * 180.0 / M_PI);
    }
  }

  return 0;
}


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

using namespace std;
#define ll long long int

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

	string n;
	cin>>n;
	if(n[1]=='R')
		cout<<"ABC";
	else
		cout<<"ARC";

	return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using ll = long long;
using P = pair<int, int>;
const int mod = 1000000007;

template <std::uint_fast64_t Modulus> class modint {
    using u64 = std::uint_fast64_t;
    
public:
    u64 a;
    
    modint(const u64 x = 0) noexcept : a(x % Modulus) {}
    u64 &value() { return a; }
    const u64 &value() const { return a; }
    modint operator+(const modint rhs) const  {
        return modint(*this) += rhs;
    }
    modint operator-(const modint rhs) const {
        return modint(*this) -= rhs;
    }
    modint operator*(const modint rhs) const {
        return modint(*this) *= rhs;
    }
    modint operator/(const modint rhs) const {
        return modint(*this) /= rhs;
    }
    modint &operator+=(const modint rhs) {
        a += rhs.a;
        if (a >= Modulus) {
            a -= Modulus;
        }
        return *this;
    }
    modint &operator-=(const modint rhs) {
        if (a < rhs.a) {
            a += Modulus;
        }
        a -= rhs.a;
        return *this;
    }
    modint &operator*=(const modint rhs) {
        a = a * rhs.a % Modulus;
        return *this;
    }
    modint &operator/=(modint rhs) {
        u64 exp = Modulus - 2;
        while (exp) {
            if (exp % 2) {
                *this *= rhs;
            }
            rhs *= rhs;
            exp /= 2;
        }
        return *this;
    }
};

modint<mod> f(modint<mod> x, int exp)
{
    modint<mod> ans;
    if (exp==0) {
        ans.a = 0;
        return ans;
    }
    else if (exp==1) {
        return x;
    }
    else if (exp%2==0){
        return f(x*x, exp/2);
    }
    else {
        return f(x*x, exp/2)*x;
    }
    
}

modint<mod> combination(modint<mod>a, modint<mod>b)
{
    modint<mod> ans;
    ans.a = 1;
    modint<mod> x;
    x.a = 1;
    rep(i, b.a) {
        ans *= a;
        a.a --;
        ans /= x;
        x.a ++;
    }
    return ans;
}

int main(){
    ll n, a, b;
    cin >> n >> a >> b;
    modint<mod> nmod;
    modint<mod> amod;
    modint<mod> bmod;
    modint<mod> vmod;
    nmod.a = n;
    amod.a = a;
    bmod.a = b;
    vmod.a = 2;
    

    modint<mod> ans;
    ans = f(vmod, n);
    //cout << ans.a << endl;
    ans.a --;
    //cout << ans.a << endl;
    ans -= combination(nmod, amod);
    //cout << ans.a << endl;
    ans -= combination(nmod, bmod);
    
    
    cout << ans.a << endl;
    return 0;
}


Measured memory_bytes: 256
# 2020/05/06
# AtCoder Beginner Contest 064 - D

# Input
n = int(input())
s = list(input())
nestlv = 0
nestmax = 0
nestmin = 0
lcnt = 0
rcnt = 0

for i in range(n):
    if s[i] == '(':
        nestlv = nestlv + 1
        nestmax = max(nestmax, nestlv)
    elif s[i] == ')':
        nestlv = nestlv - 1
        nestmin = min(nestmin, nestlv)

ans = ''.join(s)
for i in range(nestmin*(-1)):
    ans = '(' + ans

nestlv = nestlv - nestmin
if nestlv > 0:
    for i in range(nestlv):
        ans = ans + ')'

# Output
print(ans)


Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
using namespace std;
int a,b;
int main()
{
  scanf("%d%d",&a,&b);
  printf("%d",(a-1)*(b-1));
  return 0;
}


Measured memory_bytes: 256
/*#define _USE_MATH_DEFINES
#include<cmath>*/
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define rREP(i,a,n) for(int (i)=(n)-1; (i)>=(a);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 2147483647;
constexpr ll mod = 1000000007;

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;
}	

int x[4] = { 0,1,0,-1 };
int y[4] = { 1,0,-1,0 };


int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int h, w; cin >> h >> w;
	vector<string>maze(h);
	int ans = 0;
	rep(i, h)cin >> maze[i];
	rep(i, h) {
		rep(j, w) {
			if (maze[i][j] == '#')continue;
			vector<vector<int>>is(h, vector<int>(w, -1));
			queue<pair<int, int>>xy;
			xy.emplace(j, i);
			is[i][j] = 0;
			while (!xy.empty()) {
				pair<int,int>p = xy.front();
				xy.pop();
				rep(k, 4) {
					int ny = p.second + y[k], nx = p.first + x[k];
					if (out(ny, nx, h, w) || is[ny][nx] != -1 || maze[ny][nx] == '#')continue;
					is[ny][nx] = is.at(p.second).at(p.first) + 1;
					xy.emplace(nx, ny);
					ans = max(ans, is[ny][nx]);
				}
			}
		}
	}
	cout << ans << "\n";

	

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cmath>  
#include <cstdlib>
#include <ctime>
#include <algorithm>
#include <numeric>
#include <functional>
#include <string> 
#include <vector>
#include <bitset>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>

using namespace std;
using ll = long long;

#define REP(i,n) for(long long i = 0; i < (n); i++)
#define FOR(i, m, n) for(long long i = (m);i < (n); ++i)
#define ALL(obj) (obj).begin(),(obj).end()

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;

const ll MOD = (ll)1e9 + 7;
const ll MOD2 = 998244353;
const ll LLINF = (ll)1e18;
const ll INTINF = (ll)1e9;
const long double PI = 3.1415926535897932384626433;

template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max<T>(a,b);}
template <class T> void chmin(T& a, const T b){a=min<T>(a,b);}
void YN(bool flg) {cout << ((flg) ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << ((flg) ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << ((flg) ? "yes" : "no") << endl;}

int main() {
	int a,b,c; cin >> a >> b >> c;
	cout << (a*b)/2 << endl;
	return 0;
}


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

int n, sum = 0, maxn = 0;

int main() {
  cin >> n;
  for(int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    sum += x;
    maxn = max(x, maxn);
  }
  cout << sum - (maxn / 2) << endl;
  return 0;
}

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

class Node{
	public:
		int location;
		int p,l,r;
		Node(){
		}
};


class Point{
	public:
		int id,x,y;
		Point(){
		}
		Point(int id,int x,int y):id(id),x(x),y(y){
		}
		
		bool operator < (const Point &p) const{
		return id<p.id;
		}
		
		void print(){
			printf("%d\n",id);
		}
};

static const int MAX = 1000000;
static const int NIL = -1;

int N;
Point P[MAX];
Node T[MAX];

int np=0;

bool lessX(const Point &p1, const Point &p2){
	return p1.x<p2.x;
}

bool lessY(const Point &p1,const Point &p2){
	return p1.y<p2.y;
}

int makeTree(int l,int r,int depth){
	if(!(l<r)) return NIL;
	int mid = (l+r)/2;
	
	int t = np++;
	if(depth%2==0){
		sort(P+l,P+r,lessX);
	}else {
		sort(P+l,P+r,lessY);
	}
	
	T[t].location = mid;
	T[t].l = makeTree(l,mid,depth+1);
	T[t].r = makeTree(mid+1,r,depth+1);
	return t;
}


void find(int v,int sx,int tx, int sy,int ty,int depth,vector<Point> &ans){
	int x = P[T[v].location].x;
	int y = P[T[v].location].y;
	
	if(sx<=x&&x<=tx&&sy<=y&&y<=ty){
		ans.push_back(P[T[v].location]) ;
	}
	
	if(depth%2==0){
		if(T[v].l!=NIL){
			if(sx<=x) find(T[v].l,sx,tx,sy,ty,depth+1,ans);
	}
		if(T[v].r!=NIL){
			if(x<=tx) find(T[v].r,sx,tx,sy,ty,depth+1,ans);
	}
}

	else{
		if(T[v].l!=NIL){
			if(sy<=y) find(T[v].l,sx,tx,sy,ty,depth+1,ans);
	}
		if(T[v].r!=NIL){
			if(y<=ty) find(T[v].r,sx,tx,sy,ty,depth+1,ans);
		}
	}
}

int main(){
	int x,y;
	scanf("%d",&N);
	
	
	for(int i=0;i<N;i++){
		scanf("%d %d",&x,&y);
		P[i] = Point(i,x,y);
		T[i].l = T[i].r = T[i].p = NIL;	
	}
	
	np=0;
	
	int root = makeTree(0,N,0);
	
	int q;
	scanf("%d",&q);
	int sx,tx,sy,ty;
	vector<Point> ans;
	for(int i=0;i<q;i++){
		scanf("%d %d %d %d",&sx,&tx,&sy,&ty);
		ans.clear();
		find(root,sx,tx,sy,ty,0,ans);
		sort(ans.begin(),ans.end());
		for(int j=0;j<ans.size();j++){
			ans[j].print();
		}
		printf("\n");
	}
	return 0;
}



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

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

  string ans;
  if (a == b) ans = "Draw";
  else if (a == 1) ans = "Alice";
  else if (b == 1) ans = "Bob";
  else ans = ((a > b) ? "Alice" : "Bob");

  cout << ans << endl;

  return 0;
}

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

long double sq(long double x) { return x * x; }

int main() {
  int A, B, H, M; cin >> A >> B >> H >> M;
  long double two_pi = acosl(-1) * 2;
  long double ah = (long double)(H*60+M)/720 * two_pi;
  long double am = (long double)M/60 * two_pi;
  long double res =
    sqrt(sq(A*cos(ah)-B*cos(am))+sq(A*sin(ah)-B*sin(am)));
  cout << setprecision(15) << res << endl;
}

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

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  vector<vector<int>> a(3, vector<int>(n + 1, 0));
  for (int i = 1; i <= 2; i++) {
    for (int j = 1; j <= n; j++) {
      cin >> a[i][j];
      a[i][j] += max(a[i - 1][j], a[i][j - 1]);
    }
  }
  cout << a[2][n] << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
using namespace std;
int Max(int a,int b){
    if(a>b)
        return a;
    else
        return b;
}

int Min(int a,int b){
    if(a<b)
        return a;
    else
        return b;
}

int main(){
 int ans,a,b,c,x,y;
 int temp;
 while(scanf("%d%d%d%d%d",&a,&b,&c,&x,&y)==5){
    ans=0;
    if(a+b>c*2){
        ans+=Min(x,y)*c*2;
        temp=Min(x,y);
        x-=temp;
        y-=temp;
        if(x>0){
            if(a>c*2){
                ans+=x*c*2;
            }
            else{
                ans+=x*a;
            }
        }
        if(y>0){
            if(b>c*2){
                ans+=y*c*2;
            }
            else{
                ans+=y*b;
            }
        }
    }
    else{
        ans=x*a+y*b;
    }
    printf("%d\n",ans);
 }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF (1LL << 63)
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define srep(i,s,t) for(int i=(int)(s);i<(int)(t);++i)
#define each(a,b) for(auto& (a): (b))
#define all(v) (v).begin(),(v).end()
#define len(v) (int)(v).size()
#define zip(v) sort(all(v)),v.erase(unique(all(v)),v.end())
#define cmx(x,y) x=max(x,y)
#define cmn(x,y) x=min(x,y)
#define fi first
#define se second
#define pb push_back
#define show(x) cout<<#x<<" = "<<(x)<<endl
#define spair(p) cout<<#p<<": "<<p.fi<<" "<<p.se<<endl
#define sar(a,n) cout<<#a<<":";rep(pachico,n)cout<<" "<<a[pachico];cout<<endl
#define svec(v) cout<<#v<<":";rep(pachico,v.size())cout<<" "<<v[pachico];cout<<endl
#define svecp(v) cout<<#v<<":";each(pachico,v)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl
#define sset(s) cout<<#s<<":";each(pachico,s)cout<<" "<<pachico;cout<<endl
#define smap(m) cout<<#m<<":";each(pachico,m)cout<<" {"<<pachico.first<<":"<<pachico.second<<"}";cout<<endl

using namespace std;

typedef __int128 LL;
typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<P> vp;
typedef vector<string> vs;

const int MAX_N = 100005;

map<LL,int> mp;
int n,m;
vs s;

ostream& operator<<(ostream& os, const LL& v)
{
    if (v == 0) { return (os << "0"); }
    LL num = v;
    if (v < 0) {
        os << '-';
        num = -num;
    }
    string s;
    for (; num > 0; num /= 10) { s.push_back((char)(num % 10) + '0'); }
    reverse(s.begin(), s.end());
    return (os << s);
}

inline int dfs(int nw,LL p)
{
    if(mp.find(p) != mp.end()) return mp[p];
    int ct = 0;
    rep(i,n){
        if(p >> i & (LL)1){
            ct++;
        }
    }
    if(ct == 1) return 0;
    int res = m+1;
    rep(id,m){
        if(!(nw >> id & 1)){
            LL a = 0, b = 0;
            rep(i,n){
                if(p >> i & (LL)1){
                    if(s[i][id] & 1){
                        a |= (LL)1 << i;
                    }else{
                        b |= (LL)1 << i;
                    }
                }
            }
            if(a != 0 && b != 0){
                cmn(res,max(dfs(nw^(1 << id),a),dfs(nw^(1 << id),b))+1);
            }
        }
    }
    mp[p] = res;
    return res;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    while(1){
        cin >> m >> n;
        if(m == 0) break;
        s.resize(n);
        mp.clear();
        rep(i,n){
            cin >> s[i];
        }
        LL hoge = 0;
        rep(i,n){
            hoge |= (LL)1 << i;
        }
        cout << dfs(0,hoge) << "\n";
    }
    return 0;
}



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

int main() {
	int H, W;
	cin>>H>>W;
	int c[10][10];
	for(int i=0;i<10;++i){
		for(int j=0;j<10;++j){
			cin>>c[i][j];
		}
	}
	int A[H][W];
	for(int i=0;i<H;++i){
		for(int j=0;j<W;++j){
			cin>>A[i][j];
		}
	}

	// わーしゃるふろいど
	int DP[10][10];
	for(int i=0;i<10;++i){
		for(int j=0;j<10;++j){
			DP[i][j] = c[i][j];
		}
	}

	for(int k=0;k<10;++k){
		for(int i=0;i<10;++i){
			for(int j=0;j<10;++j){
				DP[i][j] = min(DP[i][j], DP[i][k] + DP[k][j]);
			}
		}
	}
	/**
	for(int i=0;i<10;++i){
		for(int j=0;j<10;++j){
			cout<<DP[i][j]<<" ";
		}
		cout<<endl;
	}
	cout<<endl;
	**/

	int ans = 0;
	for(int i=0;i<H;++i){
		for(int j=0;j<W;++j){
			if(A[i][j] != -1){
				ans += DP[A[i][j]][1];
			}
		}
	}
	cout<<ans<<endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>

using namespace std;
const long long MOD = 1e9 + 7;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ll> pdl;
typedef pair<ld, ld> pdd;
//typedef boost::multiprecision::cpp_int bigint;

ll N;
vector<ll> F;
vector<vector<ll>> P;

ll calc(ll shift) {
	ll ans =0;
	for (ll n = 0; n < N; n++) {
		ll sh = shift & F[n];
		ll b = 0;
		for (ll t = 0; t <= 10; t++) {
			b += (sh>>t) & 1;
		}
		ans += P[n][b];
	}
	return ans;
}

int main() {
	cin >> N;
	F.resize(N,0);
	P.resize(N, vector<ll>(11));
	for (ll n = 0; n < N; n++) {
		for (ll t = 0; t < 10; t++) {
			ll f;
			cin >> f;
			F[n] |= (f << t);
		}
	}
	for (ll n = 0; n < N; n++) {
		for (ll t = 0; t <= 10; t++)cin >> P[n][t];
	}
	ll ans = LLONG_MIN;
	for (ll code = 1; code < (1 << 10); code++) {
		ans = max(ans, calc(code));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib> 
#include<cstring>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define For(a,b,c) for (int (a)=(b);(a)<(c);(a)++)
#define mp make_pair
string rec_x[20],rec_y[20];
string tri[20],trj[20];
string sx[20],sy[20];
bool vis[20],vi[20];
int n,m,l,r,l1,r1;
inline void init(){
	cin>>n>>m;
	getline(cin,rec_x[0]);
	For(i,0,n)
		getline(cin,rec_x[i]);
	For(i,0,n)	{
		sx[i]=rec_x[i];
		sort(sx[i].begin(),sx[i].end());
	}
}
bool check(){
	For(i,0,m)
		For(j,0,n)
			if (trj[i][j]!=trj[m-i-1][n-j-1])	return 0;
	return 1;
}
void solve_y(int x){
	if (x==0)	{
		if (check()){
			cout<<"YES"<<endl;
			exit(0);
		}
		return; 
	}
	if (x==1){
		For(i,0,m)	
			if (!vi[i]){
				trj[l1]=rec_y[i];
				solve_y(x-1);
			}
		return;
	}
	For(i,0,m)
		For(j,i+1,m)
			if (!vi[i]&&!vi[j]&&sy[i]==sy[j]){
				trj[l1++]=rec_y[i];
				trj[r1--]=rec_y[j];
				vi[i]=vi[j]=1;
				solve_y(x-2);
				vi[i]=vi[j]=0;
				l1--;
				r1++; 
			}	
}
void solve_x(int x){
	if (x==0)	{
		For(i,0,m)
			rec_y[i]="";
		For(i,0,m)
			For(j,0,n)
				rec_y[i]=rec_y[i]+tri[j][i];
		For(i,0,m){
			sy[i]=rec_y[i];
			sort(sy[i].begin(),sy[i].end());
		}
		l1=0;
		r1=m-1;
		memset(vi,0,sizeof(vi));
		solve_y(m);
		return;
	}
	if (x==1){
		For(i,0,n)	
			if (!vis[i]){
				tri[l]=rec_x[i];
				solve_x(x-1);
			}
		return;
	}
	For(i,0,n)
		For(j,i+1,n)
			if (!vis[i]&&!vis[j]&&sx[i]==sx[j]){
				tri[l++]=rec_x[i];
				tri[r--]=rec_x[j];
				vis[i]=vis[j]=1;
				solve_x(x-2);
				vis[i]=vis[j]=0;
				l--;
				r++; 
			}
}
int main(){
	ios_base::sync_with_stdio(false);
	init();
	l=0;r=n-1;
	solve_x(n);
	cout<<"NO"<<endl;
	return 0;
}

Measured memory_bytes: 256
N = int(input())
import math

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

a = make_divisors(N)
if len(a)%2 == 1:
  print(2*int(math.sqrt(N))-2)
if len(a)%2 == 0:
  b = a[len(a)//2-1]
  c = a[len(a)//2]
  print(b+c-2)

Measured memory_bytes: 3288
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef map<int,int> mii;
typedef vector<int> vi;
typedef vector<vector<int>> vii;
typedef vector<long long> vl;
typedef vector<vector<ll>> vll;
typedef vector<bool> vb;
typedef set<int> si; 
typedef queue<int> qi;
typedef stack<int> sti;
typedef priority_queue<int> pqi;
#define fori(i,a,b) for(int i = (a); i < (b); ++i)
#define rep(i,b,a) for(int i = (b); i >= (a); --i)
#define all(a) (a).begin(), (a).end()
//#define __builtin_popcountll bitCountLL
//#define __builtin_popcount bitCount
//__builtin_ctz 末尾0的个数, __builtin_clz 前导0的个数
//__builtin_ffs 最后一个1的位置
mt19937 mt_rand(chrono::high_resolution_clock::now().time_since_epoch().count());
//std::uniform_int_distribution<long long> rg(1,1e18);
#define maxn 100005
#define Mod 1000000007
const int INF = 2e9;
const ll ML = 4e18;
    
void solve() {
    int n;
    cin >> n;
    vi a(n);
    fori(i,0,n) cin >> a[i];
    sort(all(a));
    int ans= 0;
    fori(i,0,n) {
        //if(i > 0 && a[i] == a[i-1]) continue;
        fori(j,i+1,n) {
            //if(j > i + 1 && a[j] == a[j-1]) continue;
            if(a[i] == a[j]) continue;
            fori(k, j+1, n) {
                //if(k > j + 1 && a[k] == a[k-1]) continue;
                if(a[i] + a[j] > a[k] && a[k] != a[i] && a[k] != a[j]) {
                    ans++;
                    //cout << i << " " << j << " " << k << endl;
                }
            }
        }
    }
    cout << ans << endl;
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
	//cout.precision(30); cout << fixed;
	//freopen("D:\\data_in.txt", "r", stdin);
   
    solve();
   
    /*
    clock_t start,finish;
    start = clock();
    
    finish = clock();
    cout << "\n" << (double)(finish - start) / (double)(CLOCKS_PER_SEC) * 1000 << "ms" << endl;
    */
    return 0;
}

/***************************************************************
 question:
 idea:
 tag:
 record:
 ***************************************************************/


Measured memory_bytes: 3664
use std::io;

/// 一行を読み込んで、空白で区切ったベクタにして返す
#[allow(dead_code)]
fn read<T>() -> Vec<T>
where
    T: std::str::FromStr,
    T::Err: std::fmt::Debug,
{
    let mut buf = String::new();
    io::stdin().read_line(&mut buf).unwrap();
    buf.trim()
        .split_whitespace()
        .map(|s| s.parse().unwrap())
        .collect()
}

/// n行を読み込んで、数字を空白で区切って二次元のベクタにして返す
#[allow(dead_code)]
fn read_table<T>(n: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
    T::Err: std::fmt::Debug,
{
    let mut ret: Vec<Vec<T>> = Vec::new();
    for _ in 0..n {
        ret.push(read::<T>());
    }
    ret
}

/// n行を読み込んで、1文字ずつを二次元のベクタにして返す
#[allow(dead_code)]
fn read_char_table(n: usize) -> Vec<Vec<char>> {
    let mut ret: Vec<Vec<char>> = Vec::new();
    for _ in 0..n {
        let mut buf = String::new();
        io::stdin().read_line(&mut buf).unwrap();
        let chr = buf.trim().chars().collect();
        ret.push(chr);
    }
    ret
}

/// n行を読み込んで、一次元のベクタにして返す
#[allow(dead_code)]
fn read_array<T>(n: usize) -> Vec<T>
where
    T: std::str::FromStr,
    T::Err: std::fmt::Debug,
{
    let mut array = Vec::new();

    for _ in 0..n {
        let mut buf = String::new();
        io::stdin().read_line(&mut buf).unwrap();
        array.push(buf.trim().parse().unwrap());
    }
    array
}

fn main() {
    // 数値
    let (n, t) = {
        let i = read::<usize>();
        (i[0], i[1])
    };

    // 数値テーブル
    let table = read_table::<usize>(n);

    let mut cost = 1001;
    let mut flag = false;
    for i in 0..n {
        if table[i][1] <= t && table[i][0] < cost {
            cost = table[i][0];
            flag = true;
        }
    }

    if flag == false {
        println!("TLE");
    } else {
        println!("{}", cost);
    }
}


Measured memory_bytes: 4352
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
	int a,b;
	cin>>a>>b;
	if(a+b==15)cout<<"+";
	else if(a*b==15)cout<<"*";
	else cout<<"x";
    return 0;
}


Measured memory_bytes: 768
#define __USE_MINGW_ANSI_STDIO
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <unordered_set>
#include <unordered_map>

using namespace std;

typedef long long ll;
typedef long long ull;
typedef pair<int, int> ii;

#define all(v)		((v).begin()), ((v).end())
#define sz(v)		((int)((v).size()))
#define endl		"\n"
#define fx(n)		fixed<<setprecision(n)
#define mk			make_pair	

void File()
{
#ifndef ONLINE_JUDGE
	freopen("output.txt", "w", stdout);
	freopen("input.txt", "r", stdin);
#endif
#ifdef ONLINE_JUDGE
	/*freopen("output.txt", "w", stdout);
	freopen("pyramid.in", "r", stdin);*/
#endif
}
void fast()
{
	ios::sync_with_stdio(NULL);
	cout.tie(NULL);
	cin.tie(NULL);
	//File();
}
const double pi = 2 * acos(0.0);
const ll oo = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const int nn = 2e5 + 15;
int dx[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };
int dy[8] = { 0, 0, 1, -1, 1, -1, -1, 1 };

int main()
{
	fast();
	int n;
	cin >> n;
	map<int, int>mp;
	for (int i = 0; i < n - 1; i++)
	{
		int x;
		cin >> x;
		mp[x]++;
	}
	for (int i = 1; i <= n; i++)
	{
		cout << mp[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 13040
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <cstring>
#include <map>
#include <set>
#include <algorithm>
#include <functional>
#include <queue>
#include <deque>

using namespace std;

int main(){
    int A,B;
    cin>>A;
    cin>>B;
    if(max(A,B)>min(A,B)+1){
        cout<<2*max(A,B)-1;
    }
    else{
        cout<<max(A,B)+min(A,B);
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int maxn = 1010;
int N;
double H[maxn],T,A;

int main()
{
    scanf("%d",&N);
    scanf("%lf %lf",&T,&A);
    for(int i = 1;i <= N;i++)   scanf("%lf",&H[i]);
    for(int i = 1;i <= N;i++)
    {
        H[i] = abs(T - H[i] * 0.006 - A);
    }
    int ans;
    double tmin = 1e9;
    for(int i = 1;i <= N;i++)
    {
        if(tmin > H[i])
        {
            tmin = H[i];
            ans = i;
        }
    }
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int k, x;
  int min = -1000000;
  int max = 1000000;
  cin >> k >> x;
  if(min < (x - (k - 1))){
    min = x - (k - 1);
  }
  if(max > (x + (k - 1))){
    max = x + (k - 1);
  }
  for(int i = min; i<= max; i++){
    cout << i << " ";
  }
  cout << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int h,w;
  int x=0,y=0;
  bool f = true;
  char field[8][8];
  cin >> h >> w;
  for(int x=0;x<h;x++){
    for(int y=0;y<w;y++){
      cin >> field[x][y];
    }
  }
  if(field[x][y] == '#') field[x][y] = '.';
  else f = false;
  while(((x!=h-1)||(y!=w-1))&&f){
    if(x+1!=h && field[x+1][y] == '#'){
        field[++x][y] = '.';
    }else if(y+1!=w && field[x][y+1] == '#'){
        field[x][++y] = '.';
    }else f = false;
  }
  for(int x=0;x<h;x++){
    for(int y=0;y<w;y++){
      if(field[x][y] == '#') f = false;
    }
  }
  cout << (f?"Possible":"Impossible") << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
    long long n,m,a,i,sum=0;
    scanf("%lld%lld",&n,&m);
    for(i=1;i<=m;i++)
    {
        scanf("%lld",&a);
        sum+=a;

    }
    if(n<sum)
        printf("-1");
    else {
        printf("%lld",n-sum);
    }

}


Measured memory_bytes: 1732
#include <bits/stdc++.h>
using namespace std;
#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define eb emplace_back
ll gcd(ll a,ll b){
    if(a==0)
        return b;
    else
        return gcd(b%a,a);
}
ll findGCD(vector<ll> arr,ll n) 
{ 
    ll result = arr[0]; 
    for (ll i = 1; i < n; i++) 
        result = gcd(arr[i], result);
    return result; 
}
int main() {
    SPEED;
    cout.precision(8);
    cout << fixed;
    ll n,r;
    cin>>n>>r;
  	n>=10?cout<<r:cout<<r+(100*(10-n));
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;
 
int main() {
    ll n, k;
    cin >> n >> k;

    if(k == 0) {
        out(n*n);
        re0;
    }

    ll ans = 0;
    exrep(b, k+1, n) {
        ll c = (n+1)/b;
        ll d = (n+1)%b;
        ans += (b-k)*c + max(0LL, d-k);
    }
    
    out(ans);
    re0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using vl = vector<ll>;
using vll = vector<vl>;
using Pll = pair<ll, ll>;
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define all(v) v.begin(), v.end()
#define sz(x) ((int) x.size())
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
const int MOD = 1e9+7;
const ll INF = 2e15;
template<class T> void print(const T& t){ cout << t << 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; }
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

int main(){
  ll n;
  cin >> n;
  ll count = 0;
  bool up = false;
  bool down = false;
  vl a(n);
  rep(i, n){
    cin >> a[i];
  }
  for (ll i = 1; i < n;i++){
    if(!up&&!down){
      if(a[i]>a[i-1]){
        up = true;
      }
      else if(a[i]<a[i-1]){
        down = true;
      }
    }
    else if(up){
      if(a[i]<a[i-1]){
        count++;
        up = false;
      }
    }
    else if(down){
      if(a[i]>a[i-1]){
        count++;
        down = false;
      }
    }
  }
  count++;
  print(count);
}


Measured memory_bytes: 4052
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

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

  public void run() {

    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      Card[] cards = new Card[n];
      char suit;
      int  value;

      for ( int i=0; i<n; i++ ) {
        suit = (char)br.read(); br.skip(1);
        value = Integer.parseInt(br.readLine());
        cards[i] = new Card(suit, value, i);
      }

      quickSortOfCards(cards, 0, n-1);
      dispCardArray(cards);
    }
    catch(IOException e) {
      System.out.println("IOException!");
    }
  }

  public void quickSortOfCards(Card[] card, int p, int r) {

    if( p < r) {
      int q = partitionOfCards(card, p, r);
      quickSortOfCards(card, p, q-1);
      quickSortOfCards(card, q+1, r);
    }
  }

  public int partitionOfCards(Card[] card, int p, int r) {

    int x = card[r].value;
    int i = p-1;
    Card t;

    for(int j=p; j<r; j++) {
      if(card[j].value <= x) {
        t = card[++i]; card[i] = card[j]; card[j] = t;
      }
    }
    t = card[i+1]; card[i+1] = card[r]; card[r] = t;

    return i+1;
  }

public void dispCardArray(Card[] target) {
  StringBuilder s = new StringBuilder();
  int l=target.length;
  boolean isStable = true;
  String sortState = "Stable";

  s.append(target[0]).append("\n");
  for (int i=1; i<l; i++) {
    s.append(target[i]).append("\n");
    if(isStable && target[i-1].value == target[i].value 
      && target[i-1].storedNo > target[i].storedNo) {
      sortState = "Not stable";
      isStable = false;
    }
  }

  System.out.println(sortState);
  System.out.print(s);
  }
}

class Card {
  char suit;
  int value;
  int storedNo;

  public Card( char suit, int value, int storedNo ) {
    this.suit  = suit;
    this.value = value;
    this.storedNo = storedNo;
  }
  public Card( Card card ) {
    this(card.suit, card.value, card.storedNo);
  }

  @Override
  public String toString() {
    return suit + " " + String.valueOf(value);
  }
}


Measured memory_bytes: 59520
N,A,B = map(int,input().split())
x = B-A
if x%2==0:
  print(x//2)
  
else:
  x = min(max(A-1,B-1),max(N-A,N-B))
  y = N-B+1+(B-A-1)//2
  z = A+(B-A-1)//2
  print(min(x,y,z))

Measured memory_bytes: 3064