akhauriyash/Code-Regression huggingface dataset:
module.exports=function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1)(n(2).readFileSync("/dev/stdin","UTF-8"))},function(e,t){e.exports=function(e){var t=e.split("\n")[0];25==t?console.log("Christmas"):24==t?console.log("Christmas Eve"):23==t?console.log("Christmas Eve Eve"):22==t&&console.log("Christmas Eve Eve Eve")}},function(e,t){e.exports=require("fs")}]);

Measured memory_bytes: 7372
#include <bits/stdc++.h>
#define xx first
#define yy second
#define mp make_pair
#define pb push_back
#define mset(x, y) memset(x, y, sizeof x)
#define mcpy(x, y) memcpy(x, y, sizeof x)
using namespace std;

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

inline int Read()
{
	int x = 0, f = 1, c = getchar();
	for (; !isdigit(c); c = getchar())
		if (c == '-')
			f = -1;
	for (;  isdigit(c); c = getchar())
		x = x * 10 + c - '0';
	return x * f;
}

const int MAXN = 2005;
const int mod = 1e9 + 7;

int n, m, f[MAXN][MAXN][2];

int main()
{
#ifdef wxh010910
	freopen("data.in", "r", stdin);
#endif
	n = Read(), m = Read();
	f[n][0][0] = 1;
	for (int i = n; i; i --)
		for (int j = n; ~j; j --)
		{
			f[i - 1][j][0] = (f[i][j][0] + f[i][j][1]) % mod;
			f[i - 1][j + 1][1] = (f[i][j][0] + f[i][j][1]) % mod;
			if (j)
				f[i][j - 1][0] = (f[i][j - 1][0] + f[i][j][0]) % mod;
		}
	int ret = (f[1][n - m][0] + f[1][n - m][1]) % mod;
	for (int i = 1; i <= n - m - 1; i ++)
		ret = (ret << 1) % mod;
	return printf("%d\n", ret), 0;
}


Measured memory_bytes: 31616
import collections
N = int(input())
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
c = collections.Counter(prime_factorize(N))
d = list(c.items())
cnt = 0
for i in range(len(d)):
  for j in range(10 ** 8):
    if j * (j + 1) <= 2 * d[i][1] < (j + 1) * (j + 2):
      cnt += j
      break
    else:
      pass
print(cnt)

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

vector<int> zalgo(string s) {
  int n = s.size();
  vector<int> a(n, 0);
  a[0] = n;
  int i = 1, j = 0;
  int l = n;
  while (i < l) {
    while (i + j < l && s[j] == s[i + j]) {
      j++;
    }
    if (j == 0) {
      i++;
      continue;
    }
    a[i] = j;
    int k = 1;
    while (l - i > k && k < j - a[k]) {
      a[i + k] = a[k];
      k++;
    }
    i += k;
    j -= k;
  }
  return a;
}

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

  int ans = 0;
  rep(i, n) {
    string ress;
    FOR(j, i, n) {
      ress += s[j];
    }
    vector<int> resa(n - i);
    resa = zalgo(ress);
    rep(j, n - i) {
      ans = max(ans, min(j, resa[j]));
    }
  }
  cout << ans << endl;



  
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int INF = 1e9;
const int MOD = 998244353;

int main()
{
  int n;
  cin >> n;
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  int ca = ((n - 1) / a + 1) * b, cb = ((n - 1) / c + 1) * d;
  cout << min(ca, cb) << endl;

  return 0;
}



Measured memory_bytes: 3116
d,g=map(int,input().split())
pc = [list(map(int,input().split())) for _ in range(d)]
ans = float("inf")

for bit in range(1<<d):
  sum=0
  count=0
  nokori=set(range(1,d+1))
  for i in range(d):
    if bit&(1<<i):
      sum += pc[i][0]*100*(i+1)+pc[i][1]
      count+= pc[i][0]
      nokori.discard(i + 1)
  if sum<g:
    a=g-sum
    num=max(nokori)
    n=min(pc[num-1][0],-(-a//(num*100)))
    count+=n
    sum+=n*num*100
  if sum>=g:
    ans=min(ans,count)
print(ans)

Measured memory_bytes: 42604
n, m, q = map(int, input().split())
tmp = [[0] * 510 for _ in range(510)]
for _ in range(m):
    l, r = map(int, input().split())
    tmp[l][r] += 1
for i in range(1, 501):
    for j in range(1, 501):
        tmp[i][j] += tmp[i-1][j]
        tmp[i][j] += tmp[i][j-1]
        tmp[i][j] -= tmp[i-1][j-1]
for _ in range(q):
    ans = 0
    ll, rr = map(int, input().split())
    print(tmp[rr][rr]-tmp[rr][ll-1]-tmp[ll-1][rr]+tmp[ll-1][ll-1])
    

Measured memory_bytes: 18616
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "debug.h"
#else
#define dump(...)
#endif
#define endl '\n'
#define ll long long
#define FOR(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 2147483647
#define LLINF 9223372036854775807LL
#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 TOUPPER(s) transform(s.begin(), s.end(), s.begin(), ::toupper)
#define TOLOWER(s) transform(s.begin(), s.end(), s.begin(), ::tolower)
#define FILLZERO(s, n)                      \
    do {                                    \
        ostringstream os;                   \
        os << setw(n) << setfill('0') << s; \
        s = os.str();                       \
    } while (0);
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end()) //sortしてからつかうこと
#define INIT                               \
    std::cin.tie(nullptr);                 \
    std::ios_base::sync_with_stdio(false); \
    cout << std::fixed << std::setprecision(10);

template <typename T>
vector<T> make_vec(size_t a, T n) { return vector<T>(a, n); }
template <typename T, typename... Ts>
auto make_vec(size_t a, Ts... ts) { return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...)); }
template <class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
    for (T &x : vec)
        is >> x;
    return is;
}

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;

signed main() {
    INIT;
    cin >> S;
    UNIQUE(S);
    REP(i, S.size()) {
        if (S[i] == 'W')
            ans++;
    }
    chmin(ans, (ll)S.size() - ans);
    if (S[0] == S.back())
        cout << ans * 2 << endl;
    else
        cout << ans * 2 - 1 << endl;
}

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

#include <assert.h>    // LON
#include <math.h>    // sqrt()


using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;
//typedef pair<int, int> P;
typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }


//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef priority_queue<ll, vector<ll>, greater<ll>> PQ_ASK;
const int mod = 1000000007;

int main() {

    ll n, t;
    cin >> n >> t;

    vector<P> times(n);

    rep(i, n) {
        ll ti;
        cin >> ti;
        P p = {ti, ti + t};
        times[i] = p;
    }

    for (ll i = 0; i < n - 1; i++) {
        times[i].second = min(times[i].second, times[i + 1].first);
    }

    ll ans = 0;
    for (P p : times) {
        ans += p.second - p.first;
    }
    cout << ans << endl;


}



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

int main() {
	int n, k;
	cin >> n >> k;
	if (n % 2 == 0 && n/2 >= k) {
		cout << "YES" << endl;
	}
	else if (n % 2 == 1 && n / 2 + 1 >= k) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}

Measured memory_bytes: 256
/* monkukui 競技プログラミング用のテンプレート  (ここから) */
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
using ll = long long int;
using lnt = long long int;
using graph = vector<vector<int>>;
using wgraph = vector<vector<pair<int, long long int>>>;
long long int INF = 1001001001001001LL;
int inf = 100100100;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;
long long int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
long long int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
inline void yes(){ cout << "yes" << endl; }
inline void Yes(){ cout << "Yes" << endl; }
inline void YES(){ cout << "YES" << endl; }
inline void no(){ cout << "no" << endl; }
inline void No(){ cout << "No" << endl; }
inline void NO(){ cout << "NO" << endl; }
inline void possible(){ cout << "possible" << endl; }
inline void Possible(){ cout << "Possible" << endl; }
inline void POSSIBLE(){ cout << "POSSIBLE" << endl; }
inline void impossible(){ cout << "impossible" << endl; }
inline void Impossible(){ cout << "Impossible" << endl; }
inline void IMPOSSIBLE(){ cout << "IMPOSSIBLE" << endl; }

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define drep(i,n) for(int i = (n)-1; i >= 0; i--)
#define srep(i,s,t) for(int i = s; i < t; i++)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back

/* monkukui 競技プログラミング用のテンプレート (ここまで)*/

int main(){
 
  int n; cin >> n;
  double ans = (n - (double)(n / 2)) / n;

  printf("%.10f\n", ans);

  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <string>
#include <cstring>
#include <cctype>
#include <ctime>
#include <climits>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <tuple>
#include <bitset>
#include <cmath>
#include <algorithm>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#include <complex>
#include <random>
#include <cassert>
#include <chrono>
#include <cstdint>
#include <functional>
 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace std;
using namespace __gnu_pbds;
 
#ifndef M_PI
#define M_PI 3.141592653589793238462643383279
#endif
 
#define int long long
 
#define mp make_pair
#define mt make_tuple
#define fr first
#define sc second
#define pb push_back
#define pp pop_back
#define all(x) x.begin(), x.end()
#define get0 get<0>
#define get1 get<1>
#define get2 get<2>
#define get3 get<3>
 
#define debug(x) cerr << #x << " = " << x << ", line = " << __LINE__ << endl
 
typedef long long ll;
typedef long double ld;
typedef unsigned int ui;
typedef tuple<long long, long long, long long> tlll;
typedef tuple<int, int, int> tiii;
typedef tuple<int, int, int, int> tiiii;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
 
const int MOD = 1e9 + 7;
 
 
 
int32_t main()
{
#ifdef chikibambony
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#else
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#endif
    int n;
    cin >> n;
    vector<int> a(n), b(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }
    for (int j = 0; j < n; ++j) {
        cin >> b[j];
    }
    reverse(all(b));
    int c = -1;
    for (int i = 0; i < n; ++i) {
        if (a[i] == b[i]) {
            c = a[i];
            break;
        }
    }
    int l = 0;
    for (int i = 0; i < n; ++i) {
        if (a[i] == c && b[i] == c) {
            l = i;
            break;
        }
    }
    int r = -1;
    for (int i = n - 1; i >= 0; --i) {
        if (a[i] == c && b[i] == c) {
            r = i;
            break;
        }
    }
 
    for (int i = 0; i < n; ++i) {
        if (a[i] != c && b[i] != c && l <= r) {
            swap(b[i], b[l]);
            ++l;
        }
    }
 
    if (l <= r) {
        cout << "No\n";
        return 0;
    }
 
    cout << "Yes\n";
 
    for (int i = 0; i < n; ++i) {
        cout << b[i] << ' ';
        assert(b[i] != a[i]);
    }
    cout << "\n";
 
    return 0;
}

Measured memory_bytes: 6380
a, b, c, d = input()

if a==b and c==d and a==d:
  print('No')

elif a==b and c==d:
  print('Yes')
  
elif a==c and b==d:
  print('Yes')
  
elif a==d and b==c:
  print('Yes')

else:
  print('No')

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
//#define f(i,a,n) for(ll i=a;i<n;i++)
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll isPrime(int n) 
{ 
	// Corner cases 
	if (n <= 1) 
		return 1; 
	if (n <= 3) 
		return 2; 

	// This is checked so that we can skip 
	// middle five numbers in below loop 
	if (n % 2 == 0 || n % 3 == 0) 
		return 1; 

	for (int i = 5; i * i <= n; i = i + 6) 
		if (n % i == 0 || n % (i + 2) == 0) 
			return 1; 

	return 2; 
} 

ll fact(ll n){ll res = 1;for (ll i = 2; i <= n; i++)res = res * i,res%=1000000007; 
    return res; } 
 
 int gcd(int a, int b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b); 
} 
  
 
ll findlcm(ll arr[], int n) 
{ 
   
    ll ans = arr[0]; 
  
    
    for (int i = 1; i < n; i++) 
        ans = (((arr[i] * ans)) / 
                (gcd(arr[i], ans))); 
  
    return ans; 
} 
 
 
int main() 
{
    fast;
    ll t=1;
    //cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        for(ll i=0;i<3;i++)
        {
            if(n%10==(n%100-((n%10)*10)))
            {
                cout<<"Bad";
                exit(0);
            }
            n=n/10;
        }
        cout<<"Good";
	
    } 
    return 0;
}


Measured memory_bytes: 3652
import java.util.Scanner;

public class Main {

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

		double r=sc.nextDouble();

		double c1=r*r*3.141592653589;
		double c2=2*r*3.141592653589;

		System.out.printf("%f %f",c1,c2);
	}
}

Measured memory_bytes: 28200
#include<bits/stdc++.h>
#pragma warning(disable:4996)
using namespace std;
const int N = 2e5 + 10;
int  a[N],n;
int main() {
	scanf("%d", &n);
	for (int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
	}
	sort(a + 1, a + n + 1);
	long long ans = a[n];
	int k = (n - 2) / 2;
	int t = (n - 2) % 2;
	for (int i = n - 1; i > n - 1 - k; i--) {
		ans += 1ll * (2 * a[i]);
	}
	if (t)ans += a[n - 1 - k ];
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 4604
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef int Int;
typedef pair<Int,Int> pii;
typedef pair<Int,double> pid;
typedef pair<double,double> pdd;
typedef pair<Int,pii> pip;
typedef pair<double,Int> pdp;
typedef vector<Int> veci;
typedef vector<double> vecd;
typedef vector<int> veci;
typedef vector<pii> vecpii;
typedef vector<double> vecd;
typedef vector<veci> mati;
typedef vector<vecd> matd;
#define A first
#define B second
#define PB(x) push_back(x)
#define EB(x) emplace_back(x)
#define ALL(x) x.begin(),x.end()
#define SZ(x) (x).size()
#define CLR(x) memset(x,0,sizeof x)
#define pdebug() printf("%d\n",__LINE__)
#define REP(i,a,b) for(int i = (a);i <= (b);i++)
#define FORO(i,n) REP(i,0,(int)n-1)
#define FORI(i,n) REP(i,1,(int)n)
#define FORIT(i,t) for(auto i = t.begin();i != t.end();i++)
#define eps 1e-6
#define sqr(x) ((x)*(x))
#define dist(_a,_b) sqrt(sqr(_a.A-_b.A)+sqr(_a.B-_b.B))
#define norm(_a) sqrt(sqr(_a.A)+sqr(_a.B))
template<typename T>void getMin(T &a,T b) { if(a > b) a = b; }
template<typename T>void getMax(T &a,T b) { if(a < b) a = b; }
template<typename T> vector<T> getVector(const int n) { return vector<T>(n); }
template<typename T> vector<T> getVector(const int n, const T a) { return vector<T>(n, a); }
template<typename T> vector<T> getEmptyVector() { return vector<T>(); }
template<typename T> void appendAll(vector<T> &a, vector<T> b) { a.insert(a.end(), b.begin(), b.end()); }
// #define X first
// #define Y second
const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, 1, -1};
const ll MOD = 1000000007;
const int MAXN = 1<<17;
const int inf = 1<<28;
const int NIL = -inf;
int popcount(int x)  { return __builtin_popcount(x); }
#define DUMP(a) \
    do { std::cout << #a " = " << (a) << ", "; } while(false)
#define DUMPLN(a) \
    do { std::cout << #a " = " << (a) << std::endl; } while(false)

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


    int N;
    cin >> N;
    vecpii A(N);
    FORO(i, N) {
        int a;
        cin >> a;
        A[i] = pii(a, N - i);
    }
    sort(ALL(A));
    set<int> S;
    int ans = N;
    for(int i = 0;i < N;) {
        int j = i;
        while(j < N && A[j].A == A[i].A) {
            auto it = S.lower_bound(A[j].B);
            if(it != S.end()) {
                ans--;
                S.erase(*it);
            }
            j++;
        }
        for(int k = i;k < j;k++) S.insert(A[k].B);
        i = j;
    }
    
    cout << ans << endl;
    
    return 0;
}

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

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

	if (a > b) {
		cout << ">" << endl;
	}
	else if (a < b) {
		cout << "<" << endl;
	}
	else {
		cout << "=" << endl;
	}
	
	return 0;
}

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

int main() {

  long long int n;

  while( true ) {

    cin >> n;

    if ( n == 0 ) break;

    int map[99][99] = {0};

    long long int x = n / 2;
    long long int y = n / 2 + 1;

    for ( long long int i = 1; i <= n * n; i++ ) {

      if ( map[x][y] == 0 ) {
	map[x][y] = i;
	x = ( x + 1 ) % n;
	y = ( y + 1 ) % n;
      }else {
	x = ( x - 1 + n ) % n;
	y = ( y + 1 ) % n;
	i--;
      }

    }

    for ( long long int i = 0; i < n; i++ ) {
      for ( long long int j = 0; j < n; j++ ) {

	if ( map[j][i] < 10 ) {
	  cout << "   " << map[j][i];
	}else if ( map[j][i] < 100 ) {
	  cout << "  " << map[j][i];
	}else {
	  cout << " " << map[j][i];
	}

      }
      cout << endl;
    }

  }

  return 0;

}

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


int main() {
    int N;
    string S;
    cin>>N>>S;
    int cnt =1;

    int i=0;
    while(true){
        char a=S[i];
        while(a==S[i+1]){
            i++;
            if(i==N-1)break;
        }
        if(i==N-1)break;
        cnt ++;
        i++;
    }
    cout<<cnt<<endl;
}

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

#define rep(i,n) for(long long int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(long long int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(long long int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define pb(q) push_back(q)
#define P pair<int,int>
#define Abs(a,b) max(a,b)-min(a,b)
#define YES(condition) if(condition){cout << "YES" << endl;}else{cout << "NO" << endl;}
#define Yes(condition) if(condition){cout << "Yes" << endl;}else{cout << "No" << endl;}
#define Cout(x) cout<<(x)<<endl

typedef long long ll;

using namespace std;

const int INF = 1e9,MOD = 1e9 + 7;
const ll LINF = 1e18;

//while(x!=0){
            //sum+=x%10;
           // x/=10;
        //}
        //各桁の和

//pair<int,int> p[100000];
//P r[100000];
//cin >> tmp;
//p[i]=make_pair(tmp,i);
//cout << p[i].second+1 << endl;//ペアの右側つまりiを出力

//s.find(w[i])==string::npos
//findの使い方

//for(int i=0;i<n;i++){
   // b[i]=x%2;
    //x/=2;
  //}二進数

long long int n,cnt=0,ans=1,a,b,c,cmp[10000000],cmpp,data,m,h,w,x,y,xcmp,ycmp,sum=0;

string s,ww;

vector<int> z;

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

     cin >> n;
     rrep(i,2,n+1){
         cmpp=i;
        rrep(j,2,n+1){
            if(cmpp%j==0){
                cmp[j]++;
                cmpp/=j;
                while(1){
                    if(cmpp%j==0){
                        cmp[j]++;
                        cmpp/=j;
                    }
                    else{
                        break;
                    }
                }
            }
            if(cmpp==1){
                break;
            }
        }
     }
     //Cout(cmp[2]);
     rrep(i,2,n+1){
         if(cmp[i]!=0){
             ans=ans*(cmp[i]+1)%MOD;
         }
     }
     Cout(ans);
return 0;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using static System.Linq.Enumerable;
using static System.Math;

namespace ABC
{
    class ProgramD
    {
        static void Main(string[] args)
        {
            var N = int.Parse(Console.ReadLine());
            var list = Console.ReadLine().Split(" ").Select(x => int.Parse(x)).ToArray();
            var n = list.Max();
            var r = list.OrderBy(x => Math.Abs(x - n / 2.0)).ThenBy(x => x).First();
            Console.WriteLine($"{n} {r}");
        }
    }
}


Measured memory_bytes: 38516
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    ll n;
    cin >> n;
    vll v(n);
    REP(i, n) cin >> v[i];

    VSORT(v);
    double res = v[0];
    REP(i, n - 1){
        res = (res + v[i + 1]) / 2.0;
    }
    printf("%.7lf\n", res);
    return 0;
}

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

//2*ra*rb < c - a - b
// 4*a*b < (c-a-b)^2

int main() {
  long double a, b, c;
  cin >> a >> b >> c;
  
  long double eps = 1e-14;
  
  if (4*a*b < pow(c-a-b, 2) && c-a-b > 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
 
public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long[] nums = new long[N];
		for(int i=0;i<N;++i){
			nums[i] = sc.nextLong();
		}
		long[] sum = new long[N+1];
		sum[0] = 0;
		for(int i=1;i<=N;++i){
			sum[i] += sum[i-1] + nums[i-1];
		}
		Arrays.sort(sum);
		
		long ans = 0;
		int p = 0;
		while(p<N){
			if(sum[p]==sum[p+1]){
				int delta = 1;
				ans += delta;
				while(p+1+delta<=N&&sum[p]==sum[p+1+delta]){
					delta++;
					ans += delta;
				}
				p += delta;
			}
			p++;
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 79900
#include <algorithm>
#include <iostream>
#include <tuple>
#include <vector>

bool visited[1000][1000][1000] = {false};

bool sortQ(std::tuple<long long, int, int, int> t1, std::tuple<long long, int, int, int> t2) {
    return std::get<0>(t1) < std::get<0>(t2);
}

int main() {
    int X, Y, Z, K;
    std::cin >> X >> Y >> Z >> K;
    std::vector<long long> A(X), B(Y), C(Z);
    for (int i = 0; i < X; ++i) {
        std::cin >> A[i];
    }
    for (int i = 0; i < Y; ++i) {
        std::cin >> B[i];
    }
    for (int i = 0; i < Z; ++i) {
        std::cin >> C[i];
    }
    std::sort(A.begin(), A.end(), std::greater<long long>());
    std::sort(B.begin(), B.end(), std::greater<long long>());
    std::sort(C.begin(), C.end(), std::greater<long long>());

    std::vector<std::tuple<long long, int, int, int>> Q;
    Q.emplace_back(std::make_tuple(A[0] + B[0] + C[0], 0, 0, 0));
    visited[0][0][0] = true;
    for (int i = 0; i < K; ++i) {
        std::tuple<long long, int, int, int> t = Q.back();
        Q.pop_back();

        int a = std::get<1>(t);
        int b = std::get<2>(t);
        int c = std::get<3>(t);
        if (a + 1 < X && !visited[a + 1][b][c]) {
            Q.emplace_back(std::make_tuple(A[a + 1] + B[b] + C[c], a + 1, b, c));
            visited[a + 1][b][c] = true;
        }
        if (b + 1 < Y && !visited[a][b + 1][c]) {
            Q.emplace_back(std::make_tuple(A[a] + B[b + 1] + C[c], a, b + 1, c));
            visited[a][b + 1][c] = true;
        }
        if (c + 1 < Z && !visited[a][b][c + 1]) {
            Q.emplace_back(std::make_tuple(A[a] + B[b] + C[c + 1], a, b, c + 1));
            visited[a][b][c + 1] = true;
        }

        std::sort(Q.begin(), Q.end(), sortQ);

        long long sum = std::get<0>(t);
        std::cout << sum << "\n";
    }

    return 0;
}


Measured memory_bytes: 973312
#include <iostream>
#include <cstring>
#define rep(i,n) for(int i = 0; i < n; i++)
using namespace std;

int n, m;
string str;

int main(){
	while(cin >> n,n){
		cin >> m >> str;
		bool ok = false;
		int cnt = 0, ans = 0;
		rep(i,m){
			if(str[i] == 'O'){
				if(!ok) continue;
				if(i == 0) continue;
				if(str[i-1] == 'O'){
					if(cnt > n) ans += cnt-n;
					cnt = 0;
					ok = false;
				}
			} else{
				if(i == 0){
					cnt++;
					ok = true;
					continue;
				}
				if(!ok){
					cnt++;
					ok = true;
				} else{
					if(str[i-1] == 'O'){
						cnt++;
					} else{
						if(cnt > n) ans += cnt-n;
						cnt = 1;
					}
				}
			}
		}
		if(cnt > n) ans += cnt-n;
		cout << ans << endl;
	}
}

Measured memory_bytes: 2104
#include <algorithm>
#include <complex>
#include <cstdlib>
#include <ctime>
#include <time.h>
#include <iomanip>
#include <iostream>
#include <map>
#include <math.h>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>

using namespace std;
#define SAY_YES cout << "YES" << endl;
#define SAY_Yes cout << "Yes" << endl;
#define SAY_NO cout << "NO" << endl;
#define SAY_No cout << "No" << endl;
#define IFYES(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "YES" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "NO" << endl;  \
    }
#define IFYes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "Yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "No" << endl;  \
    }
#define IFyes(TRUE_OR_FALSE)   \
    if (TRUE_OR_FALSE)         \
    {                          \
        cout << "yes" << endl; \
    }                          \
    else                       \
    {                          \
        cout << "no" << endl;  \
    }
#define DEBUG_OUTPUT_ARRAY(XXX, ONE)                            \
    for (int i = 0; i < (ONE); i++)                             \
    {                                                           \
        cout << "DEBUG: i = " << i << " -> " << XXX[i] << endl; \
    }
#define DEBUG_OUTPUT_ARRAY2(XXX, ONE, TWO)                             \
    for (int i = 0; i < (ONE); i++)                                    \
    {                                                                  \
        cout << "<<< i = " << i << " >>>" << endl;                     \
        for (int j = 0; j < (TWO); j++)                                \
        {                                                              \
            cout << "DEBUG: j = " << j << " -> " << XXX[i][j] << endl; \
        }                                                              \
    }
#define DEBUG_OUTPUT_ARRAY2_BOX(XXX, ONE, TWO) \
    for (int i = 0; i < (ONE); i++)            \
    {                                          \
        cout << i << "  ";                     \
        for (int j = 0; j < (TWO); j++)        \
        {                                      \
            cout << XXX[i][j] << " ";          \
        }                                      \
        cout << endl;                          \
    }

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


const long long int mod = 998244353;
const long long int INF = 1e18;

long long int N,M,K,res=INF,A[200005];
string t;
int main()
{
    cout << fixed << setprecision(18);
    cin>>K>>N;
    for(long long int i = 0; i < N; i++){
        cin>>A[i];
    }
    res=A[0]+K-A[N-1];
    for(long long int i = 1; i < N; i++){
        
        res=max(res,A[i]-A[i-1]);
    }
    cout<<K-res<<endl;
}


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

int parity(int n){
  if(n*n*n*n%10 == 1)
    return 1;
  else
    return 0;
}

int power(int x, int y){
  int64_t n = 1ll;
  for(int i = 0; i < y; i++)
    n *= x;
  return n;
}
int digit(int x, int y){
  return x%power(10,y+1)/power(10,y);
}

int main(){
  int a, b, c;
  cin >> a >> b >> c;
  int s1 = a+b+c;
  int s2 = a*b+b*c+c*a;
  int s3 = a*b*c;
  if(s1 == 5+7+5 && s2 == 5*7+7*5+5*5 && s3 == 5*7*5)
    cout << "YES" << endl;
  else
    cout << "NO" << endl;
}

Measured memory_bytes: 256
def main():
    import sys
    from collections import defaultdict
    dic = defaultdict(int)

    input = sys.stdin.readline

    s = str(input().rstrip())
    m = 0
    before_m = 0.1

    for i in range(1, len(s) + 1):
        before_m = int(before_m*10)%2019
        m_ad = (int(s[-i]) * before_m) % 2019
        m = (m_ad + m) % 2019
        dic[m] += 1

    ans1 = 0

    for x in dic.values():
        if x > 1:
            ans1 += x * (x - 1) // 2
    ans2 = dic[0]

    print(ans1 + ans2)

if __name__ == "__main__":
    main()

Measured memory_bytes: 9704
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <map>
#include <deque>
#include <vector>
using namespace std;
typedef pair<int,int> pi;
#define F first
#define S second
#define PB push_back
const int N=2e5+10;
struct ant{
    int x;
    int y;
    bool face;
    void in(){
        char c[5];
        scanf("%d%d",&x,&y);
        scanf("%s",c);
        face=c[0]=='E';
        return ;
    }
    int pos(){return x+y;}
    bool black(){return (x+y)%2;}
};

int main(){
    vector<pi> ans,temp;
    vector<int> emp,l[2],r[2];
    map<int,vector<int>>m;
    deque<int>dq[2];
    int n,w,h,p[N];
    ant a[N];
    scanf("%d%d%d",&w,&h,&n);
    for(int i=1;i<=n;i++){
        a[i].in();
        if(m.find(a[i].pos())==m.end())m.insert({a[i].pos(),emp});
        m[a[i].pos()].PB(i);
    }
    for(pair<int,vector<int>> i:m){
        l[0].clear();
        l[1].clear();
        r[0].clear();
        r[1].clear();
        temp.clear();
        for(int j:i.S)temp.PB({a[j].x,j});
        sort(temp.begin(),temp.end());
        reverse(temp.begin(),temp.end());
        if(a[temp.front().S].black()){
            for(pi j:temp){
                if(a[j.S].face){
                    if(dq[(j.F+1)%2].empty())p[j.S]=j.S;
                    else{
                        p[j.S]=dq[(j.F+1)%2].front();
                        dq[(j.F+1)%2].pop_front();
                        dq[(j.F+1)%2].PB(j.S);
                    }
                }
                else {
                    l[j.F%2].PB(j.S);
                    dq[j.F%2].PB(j.S);
                }
            }
        }
        else{
            for(pi j:temp){
                if(a[j.S].face){
                    if(dq[j.F%2].empty())p[j.S]=j.S;
                    else{
                        p[j.S]=dq[j.F%2].front();
                        dq[j.F%2].pop_front();
                        dq[j.F%2].PB(j.S);
                    }
                }
                else {
                    l[j.F%2].PB(j.S);
                    dq[j.F%2].PB(j.S);
                }
            }
        }
        while(!dq[0].empty()){
            r[0].PB(dq[0].front());
            dq[0].pop_front();
        }
        while(!dq[1].empty()){
            r[1].PB(dq[1].front());
            dq[1].pop_front();
        }
        for(int j=0;j<r[0].size();j++)p[l[0][j]]=r[0][j];
        for(int j=0;j<r[1].size();j++)p[l[1][j]]=r[1][j];
    }
    for(int i=1;i<=n;i++)if(a[i].face)ans.PB({w-a[i].x,p[i]});
    else ans.PB({h-a[i].y,p[i]});
    sort(ans.begin(),ans.end());
    for(pi i:ans)printf("%d\n",i.S);
}


Measured memory_bytes: 29428
import math

K = int(input())
s = 0
for i in range(1,K+1):
    for j in range(i,K+1):
        temp = math.gcd(i,j)
        for k in range(1,K+1):
            s += math.gcd(temp,k)
s = s*2

for i in range(1,K+1):
    temp = math.gcd(i,i)
    for k in range(1,K+1):
        s -= math.gcd(temp,k)

print(s)

Measured memory_bytes: 9204
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
#define M 1000
ll f[M+10];
ll n, L;
vector<string> s;

ll rec(int l, int r, int d){
	if(l==r){
		ll res = 1;
		ll t = L-d+1;
		while(t%2==0){
			res *= 2;
			t /= 2;
		}
		//cerr<<l<<" "<<r<<" "<<d<<" "<<res<<endl;
		return res;
	}
	int m = l-1;
	for(int i = l; i < r; i++){
		if(s[i].size()<=d) return 0;
		if(s[i][d]=='0') m = i;
	}
	return rec(l, m+1, d+1)^rec(m+1, r, d+1);
}

int main(){
	/*f[0] = 1;
	for(int i = 1; i < M; i++){
		vector<int> d(i+1);
		for(int j = i-1; j >= 0; j--){
			d[j] = d[j+1]^f[j];
		}
		sort(all(d));
		UNIQUE(d);
		f[i] = d.size();
		for(int j = 0; j < d.size(); j++){
			if(j!=d[j]){
				f[i] = j;
				break;
			}
		}
	}
	rep(i, 200) cerr<<i<<": "<<f[i]<<endl;
	*/
	cin>>n>>L;
	s = vector<string>(n);
	rep(i, n) cin>>s[i];
	sort(all(s));
	ll res = rec(0, n, 0);
	cerr<<res<<endl;
	cout<<(res?"Alice":"Bob")<<endl;
	return 0;
}


Measured memory_bytes: 8320
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define for0(n) for(i=0; i<(n); i++)
#define for1(n) for(i=1; i<=(n); i++)


int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll _,i,j,n,a,b,e,k,u,t,x=1,m,y,q,f=1,c=0,d=0,l,p,z,o,r,g;
    string ss,s;
    cin>>n>>m;
    if(n>9||m>9)cout<<-1<<endl;
    else cout<<n*m<<endl;

}



Measured memory_bytes: 3648
import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * AtCoder Beginner Contest 129<br>
 * B - Balance<br>
 * <br>
 * <a href=
 * "https://atcoder.jp/contests/abc129/tasks/abc129_b">AtCoderへのリンク</a><br>
 */
public class Main {

    /**
     * エントリポイント
     */
    public static void main(String[] args) {
        // 入力
        Model m = input(System.in);
        // 演算
        int result = proc(m);
        // 出力
        System.out.println(result);
    }

    /**
     * 入力モデル
     */
    static class Model {
        /** オモリの数 */
        int N;
        /** オモリの重さリスト */
        List<Integer> list = new ArrayList<Integer>();
    }

    /**
     * 入力値より入力モデルを作成する
     */
    static Model input(InputStream in) {
        Model m = new Model();
        try (Scanner sc = new Scanner(in)) {
            String[] line1 = sc.nextLine().split(" ");
            String[] line2 = sc.nextLine().split(" ");

            m.N = Integer.parseInt(line1[0]);
            for (String str : line2) {
                m.list.add(Integer.parseInt(str));
            }
        }
        return m;
    }

    /**
     * 演算を行う
     */
    static int proc(final Model m) {
        int answer = 10000;
        int total = 0;
        int s1 = 0;
        
        for (int i = 0; i < m.N; i++) {
            total += m.list.get(i);
        }

        for (int i = 0; i < m.N; i++) {
            s1 += m.list.get(i);
            int s2 = total - s1;
            answer = Math.min(answer, Math.abs(s1 - s2));
        }
        return answer;
    }
}


Measured memory_bytes: 23892
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long ll;
struct Trio{
	int to,v;
	ll cost;
	bool operator<(const Trio& right)const{
		return (cost > right.cost);
	}
};

int main(void){
	int n,m,v0,a,b,c;
	cin>>n>>m;
	vector<int> x(m),y(m);
	vector<ll> t(m);
	rep(i,m) cin>>x[i]>>y[i]>>t[i];
	cin>>v0>>a>>b>>c;
	vector<Trio> G[(n+1)*2][c];
	ll dp[(n+1)*2][c];
	rep(i,m)rep(v,c){
		int nextv=(a*v+b)%c;
		ll cost=t[i]*v;
		G[x[i]][v].push_back({y[i],nextv,cost});
		G[y[i]][v].push_back({x[i],nextv,cost});
		G[n+x[i]][v].push_back({n+y[i],nextv,cost});
		G[n+y[i]][v].push_back({n+x[i],nextv,cost});
	}
	rep(v,c) G[n][v].push_back({n*2,v,0});

	rep(i,(n+1)*2)rep(v,c) dp[i][v]=LLONG_MAX;
	dp[1][v0]=0;
	priority_queue<Trio,vector<Trio>> qu;
	qu.push({1,v0,0});
	while(qu.size()){
		Trio u=qu.top(); qu.pop();
		if(u.to==n+1){
			cout<<dp[u.to][u.v]<<endl;
			return 0;
		}
		if(dp[u.to][u.v] < u.cost)continue;
		for(auto e:G[u.to][u.v]){
			if(dp[e.to][e.v] > dp[u.to][u.v] + e.cost){
				dp[e.to][e.v] = dp[u.to][u.v] + e.cost;
				qu.push({e.to,e.v,dp[e.to][e.v]});
			}
		}
	}
}

Measured memory_bytes: 28360
N = int(input())
ans_list =[0] * 1000000
for i in range(100):
  a = i+1
  for j in range(100):
    b = j+1
    for l in range(100):
      c = l+1
      ans_list[(a**2+b**2+c**2+a*b+a*c+b*c)-1] += 1
for i in range(N):
  print(ans_list[i])

Measured memory_bytes: 82120
#include <iostream>
#include <vector>
#include <string>

using namespace std;

long long solve(const string& S){
	const int N = S.size()/2;
	vector<vector<long long>> dp(N+1, vector<long long>(N+1, 0));
	string red(N, '.');
	string blue(N, '.');
	long long res = 0;
	for(int i=0;i<(1<<N);i++){
		int r = 0, b = 0;
		for(int j=0;j<N;j++){
			if(i&(1<<j)){ red[r] = S[j]; ++r; }
			else { blue[b] = S[j]; ++b; }
		}
		for(int j=0;j<=N;j++){
			for(int k=0;k<=N;k++) dp[j][k] = 0;
		}
		dp[0][0] = 1;
		for(int j=0;j<=N;j++){
			for(int k=0;k<=N;k++){
				if(j+k == N) res += dp[j][k];
				if(j+k >= N) continue;
				if(j < r && red[r-j-1] == S[j+k+N]){
					dp[j+1][k] += dp[j][k];
				}
				if(k < b && blue[b-k-1] == S[j+k+N]){
					dp[j][k+1] += dp[j][k];
				}
			}
		}
	}
	return res;
}

int main(){
	int N;
	while(cin >> N){
		string S; cin >> S;
		cout << solve(S) << endl;
	}
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
const double PI = 3.141592653589793238;
const double EPS = 1e-10;
int main() {
	ll X, Y;
	cin >> X >> Y;
	if (abs(X - Y) <= 1) cout << "Brown" << endl;
	else cout << "Alice" << endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main() {
int nSum = 0, n;
int nVal[] = {1, 5, 10, 50, 100, 500};
for (int i=0; i<6; ++i) {
cin >> n;
nSum += n*nVal[i];
if (nSum >= 1000) {
cout << 1 << endl;
return 0;
}
}
cout << 0 << endl;
return 0;
}

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

int main(int argc, char** argv)
{
    int prev_time = 0;
    int prev_x = 0;
    int prev_y = 0;
    int n = 0;
    bool is_success = true;

    std::cin >> n;

    for(int ii = 0; ii < n; ++ii)
    {
        int cur_time, cur_x, cur_y = 0;

        std::cin >> cur_time >> cur_x >> cur_y;

        int diff_time = cur_time - prev_time;
        int diff_x = std::abs(cur_x - prev_x);
        int diff_y = std::abs(cur_y - prev_y);

        if ((diff_time % 2 != (diff_x + diff_y) % 2) ||
            (diff_time < diff_x + diff_y))
        {
            is_success = false;
        }

        cur_time = prev_time;
        cur_x = prev_x;
        cur_y = prev_y;
    }

    std::string result = is_success ? "Yes" : "No";
    std::cout << result << std::endl;

}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define ff first
#define ss second
//#define pb push_back
#define mp make_pair
#define sz size()
#define all(a)  A.begin(), A.end()
#define mem(a, b)     memset(a, b, sizeof(a))
#define f0(i,b) for(int i=0;i<(b);i++)
#define f1(i,b) for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,b,a) for(int i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(int i=(a);i!=(b);i+=(c))


#define forr(i,n) for(i=0; i<n; i++)
#define whilee(i,t) while(i!=t)
#define pb(x) push_back(x);

//sort(A.begin(),A.end());
//binary_search(A.begin(),A.end(),x);
//reverse(A.begin(), A.end());
//cout << *max_element(A.begin(), A.end());
//cout << *min_element(A.begin(), A.end());
//accumulate(A.begin(), A.end(), 0);
//next_permutation(A.begin(), A.end());
//prev_permutation(A.begin(), A.end());


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

    //vector <int> A;
    //deque <int> A;
    //queue <int> A;
    //stack <int> A;
    //set <int> A;
    //map <int,int> A;
    //pair <int,int> A ;
    //vector <pair <int,int>> A ;
    //string S, T;
    ll i, j, k, a, b, c, l, m, n, p, q, r, s, t, x, y, z, cnt=0;
    cin>>n>>k;
    if(n==2 || k==2)
    {
           cout<<"No"<<endl;
    }
    else
    {
        cout<<"Yes"<<endl;
    }
    return 0;
}




Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int n,ans=1;
  scanf("%d",&n);
  
  char s[n+1];
  scanf("%s",s);
  
  for(int i=0;i<n-1;i++){
    if(s[i]!=s[i+1]) ans+=1;
  }
  
  printf("%d",ans);
  return 0;
}

Measured memory_bytes: 256
from operator import*
from copy import*
class TP:
    def __init__(self, cond, init=0, right=add, left=sub):
        self.cond = cond
        self.init = init
        self.next_right = right
        self.next_left = left
    
    def __call__(self, A, uniq=True):
        cond = self.cond
        next_right, next_left = self.next_right, self.next_left
        s = deepcopy(self.init)
        n = len(A)
        X = {}
        r = 0
        for l in range(n):
            if not uniq:
                X[l] = r
            while r < n and cond(s, A[r]):
                s = next_right(s, A[r])
                r += 1
                X[l] = r
            if l == r:
                r += 1
            else:
                s = next_left(s, A[l]) if l+1 != r else deepcopy(self.init)
        return list(X.items())
    
    def maximum(self, A):
        X = self.__call__(A)
        return max(r-l for l, r in X) if X else 0
    
    def count(self, A):
        X = self.__call__(A, False)
        return sum(r-l for l, r in X)
 
n, *a = map(int, open(0).read().split())
print(TP(lambda s, n: s + n == s ^ n).count(a))

Measured memory_bytes: 56200
#include <stdio.h>
int main(){
  int a,b,c,t,u;
  scanf("%d%d%d",&a,&b,&c);
  if(a<b && b<c){
    printf("%d %d %d\n",a,b,c);}
  else if(a<=b && b>=c && a<=c){
    t=b;
    b=c;
    c=t;
    printf("%d %d %d\n",a,b,c);}
  else if(a>=b && b<=c && a<=c){
    t=a;
    a=b;
    b=t;
    printf("%d %d %d\n",a,b,c);}
  else if(a<=b && b>=c && a>=c){
    t=a;
    a=c;
    c=t;
    u=b;
    b=c;
    c=u;

    printf("%d %d %d\n",a,b,c);}
  else if(a>=b && b>=c && a>=c){
    t=a;
    a=c;
    c=t;
    printf("%d %d %d\n",a,b,c);}
  else if(a>=b && b<=c && a>=c){
    t=a;
    a=b;
    b=t;
    u=c;
    c=b;
    b=u;
    printf("%d %d %d\n",a,b,c);}
 return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
using namespace std;
int main(){
    int i,ii,j,jj,n,v;
    cin>>n;
    vector<int>a(n);
    for(i=0;i<n;i++){
        cin>>a.at(i);
    }
    for(i=1;i<n;i++){
        for(j=0;j<n;j++)cout<<a.at(j)<<(j!=n-1?" ":"\n");
        v=a.at(i);
        for(j=i-1;j>=0&&a[j]>v;j--){
            a.at(j+1)=a.at(j);
        }
        a.at(j+1)=v;
    }
    for(j=0;j<n;j++)cout<<a.at(j)<<(j!=n-1?" ":"\n");
    return 0;
}


Measured memory_bytes: 3100
N=int(input())
*A,=map(int,input().split())
A.sort()
M=10**9+7
ans=0
B=[0]*N
if N%2:
    i=1
    while i<N:
        B[i]=B[i+1]=i+1
        i+=2
    if A==B:
        ans=pow(2,N//2,M)
else:
    i=0
    while i<N:
        B[i]=B[i+1]=i+1
        i+=2
    if A==B:
        ans=pow(2,N//2,M)
print(ans)

Measured memory_bytes: 20480
use proconio::input;
use proconio::marker::Chars;

struct Helper {
  pub max: usize,
  pub maze: Vec<Vec<char>>,
  pub col_size: usize,
  pub row_size: usize
}

impl Helper {
  pub fn new(maze: Vec<Vec<char>>) -> Helper {
    let col_size = maze[0].len() - 1;
    let row_size = maze.len() - 1;
    Helper { max: 0, maze, col_size, row_size }
  }
  
  pub fn traverse(&mut self, r: usize, c: usize, val: usize) {
    if self.maze[r][c] == '#' {
      return
    }
    self.maze[r][c] = '#';

    let mut base_stack: Vec<(usize, usize)> = vec![(r, c)];
    while 0 < base_stack.len() {
      let mut stack: Vec<(usize, usize)> = vec![];
      while 0 < base_stack.len() {
        let (r,c) = base_stack.remove(0);        
        if r < self.row_size && self.maze[r+1][c] != '#' {
          self.maze[r+1][c] = '#';
          stack.push((r+1, c));
        }
        
        if 0 < r && self.maze[r-1][c] != '#' {
          self.maze[r-1][c] = '#';
          stack.push((r-1, c));
        }
        
        if c < self.col_size && self.maze[r][c+1] != '#' {
          self.maze[r][c+1] = '#';
          stack.push((r, c+1));
        }
        
        if 0 < c && self.maze[r][c-1] != '#' {
          self.maze[r][c-1] = '#';
          stack.push((r, c-1));
        }
      }
      base_stack = stack;
      self.max += 1;
    }
    self.max -= 1;
  }
}

fn main() {
  input! {
    h: usize,
    w: usize,
    maze: [Chars;h]
  }
  
  let mut max = 0;
  for r in 0..h {
    for c in 0..w {
      let mut helper = Helper::new(maze.clone());
      helper.traverse(r, c, 0);
      max = std::cmp::max(max, helper.max);
    }
  }

  println!("{}", max);
}

Measured memory_bytes: 2120
import java.util.Scanner;
class Main{
public static void main(String[] args){
Scanner scan =new Scanner(System.in);
String str1=scan.next();
String str2=scan.next();
String str3=scan.next();
int a=Integer.parseInt(str1);
int b=Integer.parseInt(str2);
int c=Integer.parseInt(str3);
if(a<b&&b<c)
System.out.println("Yes");
else
System.out.println("No");
}
}

Measured memory_bytes: 26260