akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#ifdef LOCAL_DEBUG
#define DEBUG 1
#define CERR if(DEBUG) cerr
#define MACRO(_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,NAME,...) NAME
#define pr(...) CERR<<MACRO(__VA_ARGS__,pr10,pr9,pr8,pr7,pr6,pr5,pr4,pr3,pr2,pr1)(__VA_ARGS__)<<endl
#define pr1(a) (#a)<<"="<<(a)<<" "
#define pr2(a,b) pr1(a)<<pr1(b)
#define pr3(a,b,c) pr1(a)<<pr2(b,c)
#define pr4(a,b,c,d) pr1(a)<<pr3(b,c,d)
#define pr5(a,b,c,d,e) pr1(a)<<pr4(b,c,d,e)
#define pr6(a,b,c,d,e,f) pr1(a)<<pr5(b,c,d,e,f)
#define pr7(a,b,c,d,e,f,g) pr1(a)<<pr6(b,c,d,e,f,g)
#define pr8(a,b,c,d,e,f,g,h) pr1(a)<<pr7(b,c,d,e,f,g,h)
#define pr9(a,b,c,d,e,f,g,h,i) pr1(a)<<pr8(b,c,d,e,f,g,h,i)
#define pr10(a,b,c,d,e,f,g,h,i,j) pr1(a)<<pr9(b,c,d,e,f,g,h,i,j)
#define prArr(a){CERR<<(#a)<<"={";int i=0;for(auto t:(a))CERR<<(i++?", ":"")<<t;CERR<<"}"<<endl;}
#else
#define DEBUG 0
#define pr(...)
#define prArr(a)
#endif
using namespace std;
using Int = long long;
using _int = int;
using ll = long long;
using Double = long double;
const Int INF = (1LL<<60)+1e9; // ~ 1.15 * 1e18
const Int mod = (1e9)+7;
const Double EPS = 1e-8;
const Double PI = 6.0 * asin((Double)0.5);
using P = pair<Int,Int>;
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
template<class T1, class T2> ostream& operator<<(ostream& o,pair<T1,T2> p){return o<<"("<<p.first<<","<<p.second<<")";}
template<class T1, class T2, class T3> ostream& operator<<(ostream& o,tuple<T1,T2,T3> t){return o<<"("<<get<0>(t)<<","<<get<1>(t)<<","<<get<2>(t)<<")";}
template<class T1, class T2> istream& operator>>(istream& i,pair<T1,T2> &p){return i>>p.first>>p.second;}
template<class T> ostream& operator<<(ostream& o,vector<T> a){Int i=0;for(T t:a)o<<(i++?" ":"")<<t;return o;}
template<class T> istream& operator>>(istream& i,vector<T> &a){for(T &t:a)i>>t;return i;}
//INSERT ABOVE HERE
class Combination{
public:
  typedef long long ll;
  ll N;
  ll mod;
  vector<ll> fac;
  vector<ll> finv;
  vector<ll> inv;


  Combination(ll N = 1e6,ll mod = 1e9 + 7): N(N), mod(mod), fac(N+1), finv(N+1), inv(N+1){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(Int i = 2; i <= N; i++){
      fac[i] = fac[i-1] * i % mod;
      inv[i] = mod - inv[mod%i] * (mod / i) % mod;
      finv[i] = finv[i-1] * inv[i] % mod;
    }
  }

  function<ll(ll,ll)> get = [&](ll n,ll r){
    if( n < r ) return 0LL;
    if( n < 0 || r < 0) return 0LL;
    return fac[n] * (finv[r] * finv[n-r] % mod) % mod;
  };
};
auto nCr = (new Combination())->get;


Int calc(Int n, Int k){return nCr(n-1, k - 1);}

signed main(){
  srand((unsigned)time(NULL));
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  Int N, K;
  cin>>N>>K;
  Int M = N - K;
  for(Int i=1;i<=K;i++){
    if(N == K){
      if(i == 1) cout<<1<<endl;
      else cout<<0<<endl;
      continue;
    }
    Int a = calc(K, i);
    Int b = calc(M, i+1) + calc(M, i) * 2 + calc(M, i - 1);
    pr(a, b, M, i - 1, calc(M, i));
    Int ans = a * b % mod;
    cout<<ans<<endl;
  }

  return 0;
}


Measured memory_bytes: 23680
import java.util.Scanner;


public class Main {
	
	public static final int mod = 1_000_000_007;

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

		long n = sc.nextInt();
		long a = sc.nextInt();
		long b = sc.nextInt();
		long c = sc.nextInt();
		
		long aPct = div(a,a+b);
		long bPct = div(b,a+b);
		
		long comb = 1;
		long ans = 0;
		for (int i=0;i<n;i++) {
			ans += pow(aPct, n)*pow(bPct, i)%mod*comb%mod*(n+i)%mod;
			ans %= mod;
			ans += pow(bPct, n)*pow(aPct, i)%mod*comb%mod*(n+i)%mod;
			ans %= mod;
			comb = div(comb*(n+i)%mod, i+1);

		}
		long l = div(a+b,100);

		System.out.println (div(ans, l));
	}
	
	static long pow (long x, long y) {
		if (y==0) {
			return 1;
		} else if (y%2==0) {
			long a = pow(x,y/2);
			return a*a%mod;
		} else {
			long a = pow(x,y/2);
			return (a*a%mod)*x%mod;
		}
	}
	
	static long div (long x, long y) {
		return (x*pow(y, mod-2))%mod;
	}




}


Measured memory_bytes: 21844
N = int(input())
H = [int(i) for i in input().split()]

is_true = True
before_tmp = 1
for i in range(N - 1):
    # 差分を計算
    tmp = H[i + 1] - H[i]
    if tmp < 0 and (tmp <= -2 or before_tmp <= -1):
        is_true = False
        break
    # 0の場合は飛ばす
    if tmp != 0:
        before_tmp = tmp

if is_true:
    print('Yes')

else:
    print('No')


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

int main(){
  int count, tmp;
  int maxVal, minVal;
  long long sum;
  sum = 0;
  cin >> count;

  for(int i = 0; i < count; i++){
    cin >> tmp;
    if(i == 0){
      maxVal = tmp;
      minVal = tmp;
    }else{
      if(maxVal < tmp){
        maxVal = tmp;
      }
      if(minVal > tmp){
        minVal = tmp;
      }
    }
    sum += tmp;
  }
  cout << minVal << " " << maxVal << " " << sum << endl;
  return 0;
}



Measured memory_bytes: 3096
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <queue>
#include <set>
#include <stack>
#include <map>
#include <unordered_map>
#include <cmath>
#include <utility> // pair make_pair
#include <algorithm>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits> // LLONG_MAX, LLONG_MIN, INT_MIN, INT_MAX
#include <assert.h>

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))
#define fill(x,y) memset(x,y,sizeof(x))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define ll long long
//#define int ll
#define INF INT_MAX/10
#define MOD 1000000007

using namespace std;
using Pi = pair<int, int>;
using Graph = vector<vector<int> >;
using WeightGraph = vector<vector<Pi> >;

int Input[100100];

// factorize
vector<pair<ll, ll> > prime_factorize(ll n) {
  vector<pair<ll, ll> > res;
  for (ll p = 2; p * p <= n; p++) {
    if (n %p != 0) continue;
    int num = 0;
    while (n % p == 0) {
      num++;
      n /= p;
    }
    res.push_back(make_pair(p,num));
  }
  if (n != 1) res.push_back(make_pair(n, 1));
  return res;
}

// enumerate divisors
vector<int> enum_div(int n) {
  vector<int> res;
  for (int i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      res.push_back(i);
      if (i * i != n) {
        res.push_back(n/i);
      }
    } 
  }
  sort(res.begin(), res.end());
  return res;
}

int main() {
  int N; cin >> N;
  int ans = 0;
  for (int i = 1; i <= 9; i++) {
    for (int j = 1; j <= 9; j++) {
      if (i*j == N)  {
        ans = 1;
      }
    }
  }
  if (ans == 0) {
    cout << "No" << endl;
  } else {
    cout << "Yes" << endl;
  }
  
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

using namespace std;

void yesno(bool b) {
    if (b) {
        cout << "Yes" << endl;
    }     else {
        cout << "No" << endl;
    }

}


int main(){
    double L;
    double ans = 0;
    cin >> L;
    ans += (L / 3.0) * (L / 3.0) * (L / 3.0);
    cout << setprecision(50) << ans << endl;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  int count = 0;
  for(int i = 0; i < n; i++) {
    cin >> a[i];
    if(a[i] != i + 1) count++;
  }
  if(count > 2) cout << "NO\n";
  else          cout << "YES\n";
  return 0;
}

Measured memory_bytes: 256
n = int(input())
b = [int(x) for x in input().split()]

total = 0
for i in range(n):
    if i == 0:
        total += b[0]
    elif i == n - 1:
        total += b[-1]
    else:
        total += min(b[i - 1], b[i])

print(total)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long int
#define MOD 1000000007
#define oo 1000000000000000000
#define forr(i,n) for(ll i=0;i<n;i++)
#define fastio ios_base::sync_with_stdio(false); cin.tie(0) ; cout.tie(0);
#define all(x) x.begin(),x.end()
#define eb emplace_back
#define pb push_back
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
 
using namespace __gnu_pbds; 
using namespace std;

ll valueOfIndex(ordered_set&s , ll i){ return *(s.find_by_order(i)); }
ll indexOfValue(ordered_set&s , ll x){ return s.order_of_key(x); }
ll add(ll a, ll b,ll p=MOD) { a%=p; b%=p; return (a+b + p)%p;}
ll mul(ll a, ll b,ll p=MOD) { a%=p; b%=p; return (a*b + p)%p;} // __int128
ll power(ll x,ll n,ll p=MOD){ if(x==0) return 0; if(n==0 || x==1) return 1LL;
    ll r = (power(x,n/2,p))%p; if(n&1) return mul(mul(r,r,p) , x,p); else return mul(r,r,p);
}
ll inv(ll x){return power(x,MOD-2);}

vector<int> a,b;
int n;
void __sol(){
    cin >> n; a.assign(n,0); b.assign(n,0);
    forr(i,n) cin >> a[i] >> b[i];
    sort(all(a)); sort(all(b));
    if(n%2){
        cout << b[n/2] - a[n/2]+1;
    }
    else{
        ll ans = 0;
        double p = (double(a[n/2]) + double(a[n/2 - 1]))/2.0;
        if(p==(ll)p){
            p -= 0.5;
            ans--;
        }
        double q = (double(b[n/2]) + double(b[n/2 - 1]))/2.0;
        if(q == (ll)q){
            q += 0.5;
            ans--;
        }
        ans += (ll)( q - p + 1.0) + ((ll)( q - p + 1.0)) - 1 ;
        cout << ans;
    }
    return;
}


int main(){
    fastio
    ll tc=1;// cin >> tc;
    while(tc--) __sol();
    return 0;
}

Measured memory_bytes: 4700
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0,i##_len=(int)(n);i<i##_len;i++)
#define rep1(i,n)for(int i=1,i##_len=(int)(n);i<=i##_len;i++)
#define rrep(i,n) for(int i=(int)(n)-1;0<=i;i--)
#define rrep1(i,n) for(int i=(int)(n);1<=i;i--)

#define each(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define all(obj) (obj).begin(),(obj).end() 

#define pcount __builtin_popcount
#define SZ(x) ((int)(x).size())
#define LEN(x) ((int)(x).length())

#define dump(x)  cerr << #x << " = " << (x) << endl;

#define endl "\n"

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

typedef long long lint;

using namespace std;
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	multimap<lint,lint>task;
	lint n,count=0;
	cin>>n;
	rep(i,n){
		lint a,b;
		cin>>a>>b;
		task.insert(make_pair(b,a));
	}
	each(it,task){
		count+=(*it).second;
		if((*it).first<count){
			cout<<"No"<<endl;
			return 0;
		}
	}
	cout<<"Yes"<<endl;
}

Measured memory_bytes: 12800
#include <stdio.h>
#include <iostream>
#include <vector>
#include <list>
#include <cmath>
#include <fstream>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <iterator>
#include <cstdlib>

using namespace std;

#define EPS (1e-10)
#define EQ(a,b) (abs((a) - (b)) < EPS)
#define EQV(a,b) (EQ((a).real(),(b).real()) && EQ((a).imag(),(b).imag()))

typedef complex<double> P;
typedef long long ll;

const int MAX_SIZE = 10000;
const int MAX_PRIME = 100000;


int prime[MAX_PRIME+1];
bool isPrime[MAX_PRIME+1];
int p;

void erats(){
	// primeツδ環スツトツづーツ渉可甘コツ可サ
	fill(isPrime,isPrime+MAX_PRIME,true);
	p = 0;
	isPrime[0] = isPrime[1] = false;

	for(int i = 2; i <= MAX_PRIME; i++){
		if(isPrime[i]){
			prime[p++] = i;
		}
		else
			continue;

		// ツづ督づゥツつ「ツづ可つゥツつッツづゥ
		for(int j = 2*i; j <= MAX_PRIME; j+=i){
			isPrime[j] = false;
		}
		cout << flush;
	}
}


int main(){

	erats();
	int n;
	while(cin>>n){
		vector<int> v[2];
		for(int i = 1; i <= n; i++){
			v[0].push_back(i);
			v[1].push_back(i);
		}
		sort(v[0].begin(),v[0].end());
		sort(v[1].begin(),v[1].end(),greater<int>());
		int cnt=0;
		for(int i = 0; i < v[0].size(); i++){
			if(isPrime[v[0][i]]&&isPrime[v[1][i]]){
				cnt++;
			}
		}
		cout<<cnt<<endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1000000007;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

// #include <boost/multiprecision/cpp_dec_float.hpp>
// #include <boost/multiprecision/cpp_int.hpp>
// namespace mp = boost::multiprecision;
// using Bint = mp::cpp_int;
// using Real = mp::number<mp::cpp_dec_float<1024>>;

int main(){
    string S, T;
    cin >> S >> T;
    set<string> D;
    for(int i = 0; i < S.size() - T.size() + 1; i++){
        string test = S;
        bool flag = true;
        for(int j = 0; j < T.size(); j++){
            if(test.at(i + j) == '?' || test.at(i + j) == T.at(j)){
                test.at(i + j) = T.at(j);
            } else {
                flag = false;
                break;
            }
        }

        if(flag){
            for(int j = 0; j < S.size(); j++){
                if(test.at(j) == '?') test.at(j) = 'a';
            }
            D.insert(test);
        }
    }
    if(D.size() != 0) cout << *D.begin() << endl;
    else cout << "UNRESTORABLE" << endl;
}

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

#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define fcin ios::sync_with_stdio(false); cin.tie(nullptr);
#define INF 0x3f3f3f3f
#define all(x) x.begin(), x.end()
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

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

template <typename A, typename B>
string to_string(pair<A, B> p){
    return "(" + to_string(p.fi) + ", " + to_string(p.se) + ")";
}

template <typename T>
string to_string(T v){
    string s = "{";
    bool first = true;
    for(const auto & x : v){
        if(!first) s += ", ";
        first = false;
        s += to_string(x);
    }
    return s + "}";
}

void debug_out(){ cerr << endl;}
template <typename First, typename... Next>
void debug_out(First F, Next... N){
    cerr << " " << to_string(F);
    debug_out(N...);
}

#ifdef LOCAL
    #define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
    #define debug(...) 1
#endif

int main(){
    fcin;

    int n;
    cin >> n;

    cout << (n + 1)/2 << endl;
    return 0;
}



Measured memory_bytes: 256
N, M = list(map(int, input().split()))
INF = 10**9
D = [[INF ]*N for _ in range(N)]
P = [[None]*N for _ in range(N)]
for _ in range(M):
    a, b, c = list(map(int, input().split()))
    if a>b: a,b = b,a
    D[a-1][b-1] = D[b-1][a-1] = c
    P[a-1][b-1] = P[b-1][a-1] = (a-1)*N+b-1

for k in range(N):
    for i in range(N):
        for j in range(i+1, N):
            Dikj = D[i][k] + D[k][j]
            if D[i][j] > Dikj:
                D[i][j] = D[j][i] = Dikj
                P[i][j] = P[j][i] = (P[i][k], P[k][j])

E = set()
for i in range(N):
    for j in range(i+1, N):
        queue = [P[i][j]]
        while queue:
            queue_new = []
            for q in queue:
                if type(q) is tuple:
                    for x in q:
                        queue_new.append(x)
                else:
                    E.add(q)
            queue = queue_new

print(M-len(E))

Measured memory_bytes: 3700
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define endl '\n'
using namespace std;
const ll mod = (ll)1e9+7;
const int INF = 0x3f3f3f3f;
ll max(ll a, ll b){return a > b ? a : b;}
ll min(ll a, ll b){return a < b ? a : b;}

int a[100001];

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, l, x;
    cin >> n >> x;
    for(int i=0; i<n; i++)
    {
        cin >> a[i];
    }
    int c=1, aa=0;
    for(int i=0; i<n; i++)
    {
        aa+=a[i];
        if(aa>x) break;
        c++;
    }
    cout << c;
}

//TODO: 56
//come back to 50D, 55D, DP-J



Measured memory_bytes: 256
N, K = map(int, input().split())
a_list = list(map(int, input().split()))

ans = float('inf')
for bit in range(2**(N-1)):
    pre_num = a_list[0]
    ans_pre = 0
    count = 1
    index = []
    for i in  range(N-1):
        if bit & (1<<i):
            count+=1
            index.append(i+1)
            if pre_num >= a_list[i+1]:
                ans_pre += pre_num-a_list[i+1]+1
            
                pre_num += 1
                
            else:
                pre_num = a_list[i+1]
                
        else:
            pre_num = max(pre_num, a_list[i+1]+1)
    if count >= K:
        ans = min(ans, ans_pre)
            
print(ans)

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

public class Main {

	public static void main(String[] args) throws Exception{
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader (is);
		String input[] = br.readLine().split("");
		int nFlag = 0;
		int wFlag = 0;
		int sFlag = 0;
		int eFlag = 0;
		/*int distanceX = 0;
		int distanceY = 0;
		HashMap<String,Integer> dir = new HashMap<String,Integer>();
		dir.put("N",1);
		dir.put("W",-1);
		dir.put("S",-1);
		dir.put("E",1);*/
		for(String s:input) {
			/*if(s.equals("N") || s.equals("S")) {
				if(distanceY > 0 && s.equals("S")) {
					distanceY +=
				}
				distanceY +=dir.get(s);
			}else if(s.equals("W") || s.equals("E")) {
				distanceX +=dir.get(s);
			}*/
			if(s.equals("N")) {
				nFlag = 1;
			}else if(s.equals("S")) {
				sFlag = 1;
			}else if(s.equals("W")) {
				wFlag = 1;
			}else if(s.equals("E")) {
				eFlag = 1;
			}
		}
		if((nFlag == sFlag) && wFlag ==  eFlag ) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

}


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

int main(void){
    // Your code here!
    int H,W;cin>>H>>W;
    char S[H][W];
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cin>>S[i][j];
        }
    }
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            if(S[i][j]=='.'){
                int count=0;
                for(int k=max(0,i-1);k<=min(H-1,i+1);k++){
                    for(int l=max(0,j-1);l<=min(W-1,j+1);l++){
                        if(S[k][l]=='#'){
                            count++;
                        }
                    }
                }
                S[i][j]=count+'0';
            }
        }
    }
    for(int i=0;i<H;i++){
        for(int j=0;j<W;j++){
            cout<<S[i][j];
        }
        cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 3596
DELTA = 1e-6

while true
  n = gets.chomp.to_i
  break if n == 0

  cnts = []
  n.times do
    x, y = gets.chomp.split(",").map{|s| s.to_f}
    cnts.push [x, y]
  end

  cps = []
  for i in (0...n)
    x0, y0 = cnts[i]
    for j in ((i + 1)...n)
      x1, y1 = cnts[j]
      vx = x1 - x0
      vy = y1 - y0
      d = vx * vx + vy * vy
      if (d <= 4.0 + DELTA)
        sd = Math.sqrt(d)
        hsd = sd / 2
        ul = Math.sqrt(1.0 - hsd * hsd)

        ux = -vy / sd * ul
        uy =  vx / sd * ul
        cx = (x0 + x1) / 2
        cy = (y0 + y1) / 2

        cps.push [cx + ux, cy + uy]
        cps.push [cx - ux, cy - uy]
      end
    end
  end

  max_ov = 1

  for cp in cps
    cx, cy = cp
    ov = 0

    for cnt in cnts
      x, y = cnt
      ov += 1 if (x - cx) ** 2 + (y - cy) ** 2 <= 1.0 + DELTA
    end

    max_ov = ov if max_ov < ov
  end

  puts max_ov
end

Measured memory_bytes: 6172
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <cstring>
using namespace std;
typedef long long ll;
int main()
{
    //freopen("input.in", "r", stdin);
    ll n, m;
    while(scanf("%lld%lld", &n, &m)!=EOF){
        if(n>m){
            ll tmp=n;
            n=m;
            m=tmp;
        }
        if(n==m || n+1==m)
            printf("Brown\n");
        else printf("Alice\n");
    }
    return 0;
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author yassin
 */

#include <bits/stdc++.h>

using namespace std;

class abc088_c {
public:
    void solve(istream& in, ostream& out) {
        constexpr int n = 3;
        int c[n][n];
        for (int i = 0; i < n; ++i) {
            for (int j = 0; j < n; ++j) {
                in >> c[i][j];
            }
        }
        int a[3], b[3];
        for (a[0] = -1000; a[0] <= 1000; ++a[0]) {
            a[1] = c[1][0] - c[0][0] + a[0];
            a[2] = c[2][0] - c[0][0] + a[0];
            b[0] = c[0][0] - a[0];
            b[1] = c[0][1] - a[0];
            b[2] = c[0][2] - a[0];
            bool ok = true;
            for (int i = 0; i < n; ++i) {
                for (int j = 0; j < n; ++j) {
                    if (a[i] + b[j] != c[i][j]) {
                        ok = false;
                    }
                }
            }
            if (ok) {
                out << "Yes\n";
                return;
            }
        }
        out << "No\n";
    }
};

int main() {
	std::ios::sync_with_stdio(false); cin.tie(nullptr);
	abc088_c solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

int64_t gcd(int64_t a,int64_t b){
  while(b!=0){
    int64_t temp=a%b;
    a=b;
    b=temp;
  }
  return a;
}

int main(){
  int X;
  cin >> X;
  cout << 360/gcd(X,360) << endl;
  return 0;
}


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

int main() {
	int a, b, c, x, y, z;
	cin >> a >> b >> c;

	x = a + b;
	y = b + c;
	z = c + a;

	if (x <= y && x <= z)
		cout << x << endl;

	else if (y <= x && y <= z)
		cout << y << endl;

	else
		cout << z << endl;

}


Measured memory_bytes: 384
// Example program
#include <iostream>
#include <string>
#include <stdio.h>

int main()
{
    long long int n,b,r;
    scanf("%lld %lld %lld ",&n,&b,&r);
   //check for complete pairs
   long long int totalBalls = b+r;
   long completePairs = n/totalBalls;
   long remainingBalls = n%totalBalls;
   long answer = completePairs*b;
   if(remainingBalls<=b){
       answer+=remainingBalls;
   }
   else{
       answer+=b;
   }
   printf("%ld",answer);
}


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

int main(){
	long long a[3];
	cin>>a[0]>>a[1]>>a[2];
	sort(a+0,a+3);
	if(a[0]+a[1]==a[2]){
		cout<<"Yes";
	}else cout<<"No";
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#define llint long long
#define mod 1000000007

using namespace std;

llint pow(llint a, llint n)
{
	if(n == 0) return 1;
	if(n % 2){
		return ((a%mod) * (pow(a, n-1)%mod)) % mod;
	}
	else{
		return pow((a*a)%mod, n/2) % mod;
	}
}

struct SegTree{
	llint size;
	vector<llint> seg;
	
	SegTree(){}
	SegTree(llint size){
		this->size = size;
		seg.resize(1<<(size+1));
	}
	
	void init()
	{
		for(llint i = 0; i < (1<<(size+1)); i++) seg[i] = 0;
	}
	
	void update(llint i, llint val)
	{
		i += (1 << size);
		seg[i] = val;
		while(i > 1){
			i /= 2;
			seg[i] = (seg[i*2] + seg[i*2+1]) % mod;
		}
	}

	llint query(llint a, llint b, llint k, llint l, llint r)
	{
		if(b < l || r < a) return 0;
		if(a <= l && r <= b) return seg[k];
		llint lval = query(a, b, k*2, l, (l+r)/2);
		llint rval = query(a, b, k*2+1, (l+r)/2+1, r);
		return (lval + rval) % mod;
	}
	llint query(llint a, llint b)
	{
		return query(a, b, 1, 0, (1<<size)-1);
	}
};

llint n;
llint dp[1000005][2];
SegTree seg(20);
llint sum[1000005];

int main(void)
{
	cin >> n;
	const llint inv = pow(n-1, mod-2);
	
	dp[0][0] = 1;
	for(int i = 1; i <= n; i++){
		if(i >= 3) dp[i][0] = sum[i-2];
		dp[i][0] *= inv, dp[i][0] %= mod;
		dp[i][0] += dp[i-1][0], dp[i][0] %= mod;
		dp[i][1] = (dp[i-1][0] * (n-1)) % mod;
		dp[i][1] %= mod;
		sum[i] = (sum[i-1] + dp[i][1]) % mod;
	}
	
	llint ans = (dp[n][0] + dp[n][1]) % mod;
	
	for(int i = 1; i <= n-1; i++){
		ans += (dp[i][1] * (n-1)) % mod;
		ans %= mod;
	}
	
	for(int i = 1; i < n; i++){
		llint tmp = (dp[n-i][1] * (n-i)) % mod;
		tmp *= inv, tmp %= mod;
		ans += tmp, ans %= mod;
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 40064
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin >> n;
	string s;
	cin >> s;
	char c=s[0];
	int f=1;
	for(int i=1;i<n;i++) {
		if(s[i]==c) ;
		else {
			f++;
			c=s[i] ;
		}
	}
	cout <<f<<endl;
	return 0;
}



Measured memory_bytes: 512
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;

const long long MOD = 1000000007;

void solve(long long H, long long W, vector<string> a){
    vector<vll> dp(H, vll(W, 0));
    dp[0][0]=1;
    REP(i, H){
        REP(j, W){
            if(a[i][j]=='#')
                continue;
            if(i > 0)
                dp[i][j]+= dp[i-1][j];
            if(j > 0)
                dp[i][j]+= dp[i][j-1];
            dp[i][j] = dp[i][j] % MOD;
        }
    }
    cout << dp[H-1][W-1]<<endl;
}

int main(){
    long long H;
    scanf("%lld",&H);
    long long W;
    scanf("%lld",&W);
    vector<string> a(H);
    for(int i = 0 ; i < H ; i++){
        cin >> a[i];
    }
    solve(H, W, move(a));
    return 0;
}


Measured memory_bytes: 9216
//@samraj2k
//#2ksr
//Don't copy my codes. They produce wrong output.
#include<bits/stdc++.h>
using namespace std;

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

Measured memory_bytes: 256
#include<cstdio>
int A[100000];
int i;
int j;
void partition(int A[], int p, int r)
{
    i = p-1;
    j = p;
    int x = A[r];
    while(j<=r-1)
    {
        if(A[j] <= x)
        {
            i = i+1;
            int cur = A[i];
            A[i] = A[j];
            A[j] = cur;
        }
        j++;
    }
    //int cur = A[i+1];
    A[r] = A[++i];
    A[i] = x;
}
int main()
{
    int n;
    scanf("%d", &n);
    for(int k=0; k<n; k++)
        scanf("%d", &A[k]);
    partition(A,0,n-1);
    for(int k=0; k<n; k++)
    {
        if(k)  printf(" ");
        if(k == i)
            printf("[%d]",A[k]);
        else
            printf("%d",A[k]);
    }
    printf("\n");

    return 0;
}


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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine().Split(' ');
            var x = int.Parse(s[0]);
            var a = int.Parse(s[1]);
            bool isyesorno = false;
            bool yes = false;
            if (!isyesorno)
            {
                if (x < a)
                {

                    Console.WriteLine("0");

                }
                else
                {
                    Console.WriteLine("10");

                }
               
            }
            else
            {
                if (yes)
                {
                    Console.WriteLine("Yes");
                }
                else
                {
                    Console.WriteLine("No");
                }
            }

            #if DEBUG
                Console.WriteLine("続行するには何かキーを押してください．．．");
                Console.ReadKey();
            #endif
        }
    }
}


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

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

    ll ans = 0;
    if (k <= a) {
        ans += k;
        cout << ans << endl;
        return 0;
    }
    ans += a;

    if (k>a+b) {
        ans -= (k-a-b);
        cout << ans << endl;
        return 0;
    }

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


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

int main(){
	int m,d,sum=0,a,b;
	cin >> m >> d;
	for(int i=1;i<=m;i++){
		for(int j=1;j<=d;j++){
			a = j%10;
			b = j/10;
			if(a>=2 && b>=2 && a*b==i) sum++;
		}
	}
	cout << sum << endl;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
using namespace std;
int n,i,siz[100005],l[100005],r[100005],cnt=0,pos=0,con,rt=0;
char s[100005];
void add(int x,int y)
{
	l[++cnt]=x;
	r[cnt]=y;
}
int main()
{
	scanf("%s",s);
	n=strlen(s);
	for(i=0;i<n;i++)siz[i+1]=s[i]-'0';
	for(i=0;i<=n/2;i++)
	{
		if(siz[i]!=siz[n-i])
		{
			printf("-1");
			return 0;
		}
	}
	con=0;
	if(siz[1]==0)
	{
		printf("-1");
		return 0;
	}
	for(i=1;i<=n/2;i++)
	{
		if(siz[i])
		{
			add(rt,pos+1);
			rt=++pos;
			con++;
			while(con<i)
			{
				add(rt,++pos);
				con++;
			}
		}
	} 
	add(rt,n);
	rt=n;
	for(i=pos+1;i<n;i++)add(i,n);
	for(i=1;i<=cnt;i++)
	{
		if(l[i]&&r[i])printf("%d %d\n",l[i],r[i]);
	}
	return 0;
}

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

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

using namespace std;
using ll = long long;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int a; cin >> a;
  string s; cin >> s;
  if (a >= 3200) cout << s << endl;
  else cout << "red" << endl;
}

Measured memory_bytes: 892
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORS(i, m, n) for (int i = m; i <= n; i++)
#define INF 2e9
#define MOD (1000000007)
#define EPS 1e-9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef long long int lli;
int gcd(int m, int n)
{
    return (m % n == 0) ? n : gcd(n, m % n);
}
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    vector<int> a(N);
    vector<int> l(N);
    vector<int> r(N);
    REP(i, N)
    {
        cin >> a[i];
    }
    l[0] = a[0];
    r[N - 1] = a[N - 1];
    REPS(i, N - 1)
    {
        l[i] = gcd(l[i - 1], a[i]);
        r[N - 1 - i] = gcd(r[N - 1 - (i - 1)], a[N - 1 - i]);
    }
    //   cout << l[N - 1] << " " << r[0] << "\n";
    int ans = max({l[N - 2], l[N - 1], r[1]});
    REPS(i, N - 2)
    {
        ans = max(ans, gcd(l[i - 1], r[i + 1]));
    }
    cout << ans << "\n";
}

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

int main(){
  int n, a,b,c,d;
  vector<vector<vector<int> > > bld(4,vector<vector<int> >(3, vector<int>(10)));
  cin >> n;
  while(n--){
    cin >> a >> b >> c >> d;
    bld[a-1][b-1][c-1] += d;
  }

  for(int i=0; i<4; i++){
    for(int j=0; j<3; j++){
      for(int k=0; k<10; k++){
	cout << " " << bld[i][j][k];
      }
      cout << endl;
    }
    if(i!=3)
      cout << "####################" << endl;
  }

  return 0;
}

Measured memory_bytes: 1212
import sys
input = sys.stdin.readline
import numpy as np


def read():
    N, M, C = map(int, input().strip().split())
    B = np.empty(M, dtype=np.int)
    A = np.empty((N, M), dtype=np.int)
    B[:] = input().strip().split()
    for i in range(N):
        A[i] = input().strip().split()
    return N, M, C, B, A

def solve(N, M, C, B, A):
    return np.count_nonzero(np.sum(A*B, axis=1) + C > 0)

if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))


Measured memory_bytes: 12504
#include <iostream>
#include <iterator>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <numeric>
#include <iomanip>
#include <limits>
#include <set>
#include <map>
#include <type_traits>
#include <cstdint>
#include <queue>
#define _USE_MATH_DEFINES
#include <math.h>
#include <sstream> // std::stringstream
#include <bitset>  // std::bitset<N>

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

using namespace std;

//素因数分解
void factoring(ll n, map<ll, ll>& mp) {
	for (ll i = 2; i * i <= n; i++) {
		while (n % i == 0) {
			mp[i]++;
			n /= i;
		}
	}
	if (n != 1) mp[n]++;
}

//絶対値
template<class T, class U = std::make_unsigned_t<T>>
U SafeAbs( T x ) {
    return x < 0 ? -static_cast<uintmax_t>(x) : x;
}

//最大・最小
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;
}

//xのn乗
ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while (n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}
//xの逆元
ll mod_inv(ll x, ll mod) {//O(log(mod))
    return mod_pow(x, mod - 2, mod);
}

//nCr
ll ncr(ll n, ll r, ll mod){
	ll res=1;
	ll num=1,den=1;
	for(ll i=n;i>=n-r+1;i--){
		(den*=i)%=mod;
	}
	for(ll i=1;i<=r;i++){
		(num*=i)%=mod;
	}
	
	res=den*mod_inv(num,mod);

	return res%mod;
}


//二分探索
bool isOk(ll index, ll key,vector<ll> &a){
	
	if(a[index]>key){
		return true;
	}
	
	return false;
}

ll bin_search(ll key, vector<ll> &a){
	
	ll l=-1;
	ll r=a.size();

	while(abs(r-l)>1){
		ll mid = (l+r)/2;
		if(isOk(mid, key, a)){
			r=mid;
		}
		else{
			l=mid;
		}
	}
	return r;
}

/*
//深さ優先探索
void dfs(vector<vector<ll>> &gra,vector<bool> &seen, ll v){

	seen[v]=true;

	for(auto next : gra[v]){
		if(seen[next]){
			continue;
		}

		dfs(gra,seen,next);
	}
	
}
*/
const ll MOD=1000000007;

ll min(ll a, ll b){
	if(a>=b){
		return b;
	}
	else{
		return a;
	}
}

void solve(){
	ll n;
	cin >> n;

	vector<tuple<ll,ll,ll>> coo(n+1,make_tuple(0,0,0));
	coo[0] = make_tuple(0, 0, 0);
	for (ll i = 1; i <= n; i++)
	{
		cin >> get<0>(coo[i]) >> get<1>(coo[i]) >> get<2>(coo[i]);
	}

	sort(coo.begin(), coo.end());

	ll x = 0;
	ll y = 0;
	ll t = 0;
	bool ans = true;
	for (ll i = 0; i < n; i++)
	{
		x = abs(get<1>(coo[i]) - get<1>(coo[i + 1]));
		y = abs(get<2>(coo[i]) - get<2>(coo[i + 1]));
		t = abs(get<0>(coo[i]) - get<0>(coo[i + 1]));
		if (x + y <= t)
		{
			if ((t - (x + y)) % 2 == 1)
			{
				ans = false;
				break;
			}
		}
		else{
			ans = false;
			break;
		}
	}

	if(ans){
		cout << "Yes" << endl;
	}
	else{
		cout << "No" << endl;
	}
}

int main(){
	
	solve();
	
    return 0;
}



Measured memory_bytes: 5632
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N;
	cin >> N;
	int A[100000];
	rep(i, N) A[i] = -1;

	int k = N - 1;

	rep(i, N) {
		int a;
		cin >> a;
		auto itr = lower_bound(A + k, A + N, a) - 1;
		*itr = a;
		if (itr == A + k) k--;
	}

	co(N - k - 1);

	Would you please return 0;
}

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

int main()
{
	ios::sync_with_stdio(false);
	
	int n;
	string s;
	long long b[5];
	
	for(int i=0;i<5;i++)
		b[i]=0;
	
	cin>>n;
	
	for(int i=0;i<n;i++)
	{
		cin>>s;
		
		if(s[0]=='M')
			b[0]++;
		if(s[0]=='A')
			b[1]++;
		if(s[0]=='R')
			b[2]++;
		if(s[0]=='C')
			b[3]++;
		if(s[0]=='H')
			b[4]++; 
	}
	
	long long ans=0;
	
	for(int i=0;i<5;i++)
		for(int j=i+1;j<5;j++)
		{
			for(int k=j+1;k<5;k++)
			{
				ans=ans+b[i]*b[j]*b[k];
			}
		}
	
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
int main(){
    ll n,A[200001],num[200001]={0},ans=0;
    cin>>n;
    rep(i,n) cin>>A[i],num[A[i]]++;
    rep(i,n) ans+=num[i+1]*(num[i+1]-1)/2;
    rep(i,n) cout<<ans-num[A[i]]+1<<"\n";
}

Measured memory_bytes: 5760
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <vector>
#include <cstring>
#include <queue>
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
using namespace std;
using ll = long long;
using ld = long double;
using ull = unsigned long long;
using uld = unsigned long long;
using P = pair<int,int>;
ll MAX(ll a,ll b,ll c){return max(a,max(b,c));}
ll MIN(ll a,ll b,ll c){return min(a,min(b,c));}
const ll mod = 1e9+7;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
template<class T> inline bool chmax(T &a,T& b){if(a < b){a = b; return true;} else return false;}
template<class T> inline bool chmin(T &a,T& b){if(a > b){a = b; return true;} else return false;}
int main(){
    string s;
    cin >> s;
    string data[7] = {"SUN","MON","TUE","WED","THU","FRI","SAT"};
    rep(i,7){
        if(s == data[i]) cout << 7 - i << endl;
    }
}

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

using namespace std;

int main() {
  int a,p;
  cin >> a >> p;
  
  int sum = (a*3+p)/2;
  cout << sum << endl;
}

Measured memory_bytes: 3644
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <string>
using namespace std;

int main(){

    int N;
    cin >> N;
    vector<int> A(N);
    for(int i = 0; i < N; i++) cin >> A[i];

    int64_t ans = 0;
    int Amin = 1e9, minus = 0;
    for(int i = 0; i < N; i++){
        ans += abs(A[i]);
        Amin = min(Amin, abs(A[i]));
        if(A[i] < 0) minus++;
    }

    if(minus % 2) cout << ans - (2 * Amin) << endl;
    else cout << ans << endl;

    return 0;
}

Measured memory_bytes: 640
A = gets.to_i
B = gets.to_i
C = gets.to_i
X = gets.to_i

count = 0
for i in 0..A do
  for j in 0..B do
    for k in 0..C do
      count += 1 if 500 * i + 100 * j + 50 * k == X
    end
  end
end

puts count


Measured memory_bytes: 1788
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()
w = ''
sc = 0

for i in range(n):
  
  if i < k:
    if t[i] == 'r':
      sc += p
      w += 'w'
    if t[i] == 's':
      sc += r
      w += 'w'
    if t[i] == 'p':
      sc += s
      w += 'w'
  elif i >= k and t[i] != t[i-k]:
    if t[i] == 'r':
      sc += p
      w += 'w'
    if t[i] == 's':
      sc += r
      w += 'w'
    if t[i] == 'p':
      sc += s
      w += 'w'
  elif i >= k and t[i] == t[i-k] and w[i-k] =='l':
    if t[i] == 'r':
      sc += p
      w += 'w'
    if t[i] == 's':
      sc += r
      w += 'w'
    if t[i] == 'p':
      sc += s
      w += 'w'
  else:
    w += 'l'
    
print(sc)

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

int main(void){
    
    int P, Q, R;
    cin >> P >> Q >> R;
    int N[3] = {P, Q, R};
    sort(N, N+3);
    
    int ans = N[0] + N[1];
    
    cout << ans << endl;
    
}

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

#include <iomanip>
int main() {
    cout << fixed << setprecision(12);
    int n, m; cin >> n >> m;
    int d; cin >> d;
    int cnt = (d == 0 ? n : 2 * (n - d));
    cout << 1.0 * cnt * (m - 1) / n / n << endl;
    return 0;
}


Measured memory_bytes: 256
def insertion_sort(seq):
    print(' '.join(map(str, seq)))
    for i in range(1, len(seq)):
        key = seq[i]
        j = i - 1
        while j >= 0 and seq[j] > key:
            seq[j+1] = seq[j]
            j -= 1
        seq[j+1] = key
        print(' '.join(map(str, seq)))
    return seq

n = int(input())
seq = list(map(int, input().split()))
insertion_sort(seq)

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    vector<ll> x(n),y(n),z(n);
    rep(i,n){
        ll a,b;
        cin >> a >> b;
        x[i]=a-b;
        y[i]=a+b;
    }
    sort(x.begin(),x.end());
    sort(y.begin(),y.end());
    ll ans=max(x[n-1]-x[0],y[n-1]-y[0]);
    cout << ans << "\n";
    return 0;
}   

Measured memory_bytes: 7912
d, n = map(int, input().split())
ans = 0
#cnt = 0
a = []

# numが100で割り切れる回数を返す
def getCount(num):
    cnt = 0

    while num % 100 == 0:
        cnt += 1
        num //= 100

    return cnt

idx = 1
while True:
    if len(a) > n:
        break
    temp = (100**d) * idx
    if getCount(temp) == d:
        a.append(temp)
    idx += 1

print(a[n-1])


Measured memory_bytes: 38384
local mce, mfl, msq, mmi, mma = math.ceil, math.floor, math.sqrt, math.min, math.max

local up = {}
local down = {}
local a = {}
local n = io.read("*n")
for i = 1, n do a[i] = io.read("*n") end
up[1], down[1] = 1, 1
for i = 1, n - 1 do
  if(a[i] < a[i + 1]) then
    down[i + 1] = mmi(down[i] + 1, up[i] + 1)
    up[i + 1] = mmi(down[i] + 1, up[i])
  elseif(a[i + 1] < a[i]) then
    down[i + 1] = mmi(down[i], up[i] + 1)
    up[i + 1] = mmi(down[i] + 1, up[i] + 1)
  else
    down[i + 1] = mmi(down[i], up[i] + 1)
    up[i + 1] = mmi(up[i], down[i] + 1)
  end
end
print(mmi(up[n], down[n]))


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

int main(){
    int a, b;
    cin >> a >> b;
    int ans;
    ans = max(a+b, max(a-b, a*b));
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 256
// Copyright 2019 yaito3014
#include "bits/stdc++.h"
using namespace std;

int main() {
  cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int> A(N);
  for (auto& v : A)cin >> v;
  cout << (all_of(begin(A), end(A), [](int v) { return v % 2 == 0; }) ? "second" : "first") << endl;
}

Measured memory_bytes: 892
n,m = map(int,input().split())
H = [[0 for _ in range(n)] for _ in range(n) ]

for _ in range(m):
    a, b = map(int,input().split())
    H[a-1][b-1] = 1
    H[b-1][a-1] = 1
    
l = [0 for _ in range(n)]
ans = 0

def dfs(node,visited):
    global ans
    if visited.count(0) == 0:
        ans += 1 
        return 0
    else:
        visited[node] = 1
        for node_,edge_ in enumerate(H[node]):
            if edge_ == 1 and visited[node_] != 1:
                visited[node_] = 1
                visited[node] = 1
                dfs(node_,visited)
                
                #忘れない！！！
                visited[node_] = 0
dfs(0,l)
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl "\n"
#define ll long long
#define int ll
#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define FORS(i, a, b) for (int i = (int)(a); i <= (int)(b); i++)
#define REP(i, x) for (int i = 0; i < (int)(x); i++)
#define REPS(i, x) for (int i = 1; i <= (int)(x); i++)
#define RREP(i, x) for (int i = ((int)(x)-1); i >= 0; i--)
#define RREPS(i, x) for (int i = ((int)(x)); i > 0; i--)
#define INF (1 << 30)
#define LLINF (1LL << 60)
#define vi vector<int>
#define vvi vector<vector<int>>
#define pi pair<int, int>
#define ALL(a) (a).begin(), (a).end()
#define BIT(n) (1LL << (n))
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
constexpr ll mod = 1e9 + 7;
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};
ll A, B, C, D, E, F, G, H, N, M, L, K, P, Q, R, W, X, Y, Z;
string S, T;
ll ans = 0;

template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

void func(int H, int W) {
    FOR(h, 1, H) {
        int tmp = 0;
        int w = W / 2;
        if (W & 1) {
            int a1 = (H - h) * w;
            int a2 = (H - h) * (w + 1);
            int a3 = h * W;
            tmp = max(a1, max(a2, a3)) - min(a1, min(a2, a3));
        } else {
            int a1 = (H - h) * w;
            int a2 = h * W;
            tmp = max(a1, a2) - min(a1, a2);
        }
        ans = min(ans, tmp);
    }
}

signed main() {
    cin >> H >> W;
    if (H % 3 == 0 || W % 3 == 0) {
        cout << 0 << endl;
        return 0;
    }
    ans = min(W, H);
    func(H, W);
    func(W, H);
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <iostream>
#include <math.h>
#include <assert.h>
#include <vector>
#include <queue>
#include <string>
#include <map>
#include <set>

using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-9;
static const double PI = acos(-1.0);

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, n) for (int i = (s); i < (int)(n); i++)
#define FOREQ(i, s, n) for (int i = (s); i <= (int)(n); i++)
#define FORIT(it, c) for (__typeof((c).begin())it = (c).begin(); it != (c).end(); it++)
#define MEMSET(v, h) memset((v), h, sizeof(v))

int n, m, p;
int pos;
char str[10000];
map<string, vector<int> > mapto;
map<vector<int>, string> mapfrom;
map<string, string> convert;
vector<int> error;

vector<int> formula();
vector<int> factor() {
  vector<int> lhs;
  if (str[pos] == '(') {
    pos++;
    lhs = formula();
    pos++;
  } else {
    string s;
    while (isalpha(str[pos])) { s += str[pos++]; }
    if (!convert.count(s)) { return error; }
    if (!mapto.count(convert[s])) { return error; }
    lhs = mapto[convert[s]];
  }
  return lhs;
}

vector<int> term() {
  vector<int> lhs = factor();
  if (lhs == error) { return error; }
  while (str[pos] == '*' || str[pos] == '/') {
    int s = str[pos] == '*' ? 1 : -1;
    pos++;
    vector<int> rhs = factor();
    if (rhs == error) { return error; }
    REP(i, n) {
      lhs[i] += s * rhs[i];
    }
  }
  return lhs;
}

vector<int> formula() {
  vector<int> lhs = term();
  if (lhs == error) { return error; }
  while (str[pos] == '+' || str[pos] == '-') {
    pos++;
    vector<int> rhs = term();
    if (rhs == error) { return error; }
    REP(i, n) {
      if (lhs[i] != rhs[i]) { return error; }
    }
  }
  return lhs;
}

int main() {
  error = vector<int>(1, -1000000000);
  while (scanf("%d %d %d", &n, &m, &p), n|m|p) {
    pos = 0;
    mapto.clear();
    mapfrom.clear();
    REP(i, m) {
      string s;
      cin >> s;
      vector<int> vect(n, 0);
      REP(i, n) {
        scanf("%d", &vect[i]);
      }
      mapto[s] = vect;
      mapfrom[vect] = s;
    }
    scanf("%s", str);
    REP(i, p) {
      string from, to;
      cin >> from >> to;
      convert[from] = to;
    }
    vector<int> ans = formula();
    while (pos > strlen(str));
    if (ans[0] <= -100000) {
      puts("error");
    } else if (mapfrom.count(ans)) {
      printf("%s\n", mapfrom[ans].c_str());
    } else {
      puts("undefined");
    }
  }
}

Measured memory_bytes: 0