akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll=long long;
using ld=long double;
//#define int long long
//#define _CRT_SECURE_NO_WARNINGS
#define rep(i, n) for (int i = 0; i < n; i++)
#define _GLIBCXX_DEBUG
const int MOD = 1e9 + 7;
const int INF = 1e18 + 9;
constexpr long double pi = 3.141592653589793238462643383279;
int fact(int i) {
    if (i == 0) return 1;
    return (fact(i - 1)) * i;
}
int gcd(int a, int b) {
    if (b == 0) return a;
    return gcd(b, a % b);
}
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}
int keta(int n) {
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
int ketasum(int n) {
    int sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
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;
}
char toSmall(char c) { // 大文字を小文字へ
    return (c + 0x20);
}
char toLarge(char c) { // 小文字を大文字へ
    return (c - 0x20);
}
float myPower(int a, int n) { // aのn乗の計算
    float x = 1;
    while (n > 0) { // 全てのbitが捨てられるまで
        if (n & 1) { // 一番右のbitが１のとき
            x *= a;
        }
        a *= a;
        n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
    }
    return x;
}
int s;
int main(void) {
    cin >> s;
    ll cnt = 0, now = s;
    map<ll, bool> ma;
    ma[s] = 1;
    while (true) {
        if (now % 2 == 0) {
            now /= 2;
            cnt++;
            if (ma[now]) {
                cout << cnt + 1 << endl;
                return 0;
            }
            ma[now] = 1;
        }
        else {
            now = now * 3 + 1;
            cnt++;
            if (ma[now]) {
                cout << cnt + 1 << endl;
                return 0;
            }
            ma[now] = 1;
        }
    }
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define rrep(i, n) for(int i = n-1; i >= 0; --i)
#define fi first
#define se second
using namespace std;
using lint = long long;
using uint = unsigned int;
using ulint = unsigned long long;
using ldouble = long double;
using pii = pair<int, int>;
using pli = pair<lint, lint>;
using pdd = pair<double, double>;
using pld = pair<ldouble, ldouble>;
using v1i = vector<int>;
using v1li = vector<lint>;
using v2i = vector<vector<int>>;
using v2li = vector<vector<lint>>;
using v3i = vector<vector<vector<int>>>;
using v3li = vector<vector<vector<lint>>>;
using v1b = vector<bool>;
using v2b = vector<vector<bool>>;
using v3b = vector<vector<vector<bool>>>;
using v1c = vector<char>;
using v2c = vector<vector<char>>;
using v3c = vector<vector<vector<char>>>;
constexpr lint mod1 = 1e9+7;
constexpr lint mod2 = 998244353;

int main(){
  int n; cin >> n;
  unordered_set<string> u;
  rep(i, n){
    string s; cin >> s;
    u.insert(s);
  }
  cout << u.size() << "\n";
  return 0;
}

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

long long sum,n,a[400000];


int main(void){
    scanf("%lld",&n);
    for(int i = 0;i < 3 * n;i++)
        scanf("%lld",&a[i]);;

    sort(a,a + n * 3);
    for(int i = 0;i < n;i++)
        sum += a[3 * n - i * 2 - 2];

    printf("%lld\n",sum);
    return 0;
}

Measured memory_bytes: 2560
import sys
sys.setrecursionlimit(10**7)

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

dp = [-1] * N
dp[0] = 0

for i in range(1, N):
    if i == 1:
        dp[i] = dp[i - 1] + abs(h[i] - h[i - 1])
    else:
        dp[i] = min(dp[i - 1] + abs(h[i] - h[i - 1]), dp[i - 2] + abs(h[i] - h[i - 2]))

print(dp[N - 1])

Measured memory_bytes: 20612
n = int(input())
x = list(map(int, input().split()))

x2 = x.copy()
x2.sort()
tmp = x2[n // 2]
tmp2 = x2[n // 2 - 1]

for i in x:
    if i <= tmp2:
        print(tmp)

    else:
        print(tmp2)


Measured memory_bytes: 26772
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

string S, T;
ll dp[3005][3005];

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

	cin >> S >> T;
	S = "!" + S;
	T = "@" + T;
	memset(dp, 0, sizeof(dp));

	for (ll i = 1; i <= S.length(); i++) {
		for (ll j = 1; j <= T.length(); j++) {
			if (S[i] == T[j]) {
				dp[i][j] = dp[i-1][j-1] + 1;
			}
			else {
				dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
			}
		}
	}

	ll r = S.length(), c = T.length();
	string ans;
	while (r > 0 && c > 0) {
		if (S[r] == T[c]) {
			ans.push_back(S[r]);
			r--;
			c--;
		}
		else if (dp[r][c] == dp[r-1][c]) {
			r--;
		}
		else {
			c--;
		}
	}

	reverse(ans.begin(), ans.end());
	ans.pop_back();
	cout << ans << "\n";

	return 0;
}


Measured memory_bytes: 70784
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(ll i##_len=(n) ,i=i##_len-1;i>=0;--i)
#define repi(i,a,b) for(ll i=ll(a);i<=ll(b);++i)
#define ALL(f,x,...) ([&](decltype((x)) xxxx) { return (f)(begin(xxxx), end(xxxx), ## __VA_ARGS__); })(x)
#define lim 1000000007ll
#include<bits/stdc++.h>
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using pii = std::pair<ll,ll>;
using namespace std;
template<class T>T 
chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T>T 
chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template <class T> T 
gcd(T a, T b){if (a < b) {a ^= b;b ^= a;a ^= b;} return b ? gcd(b, a % b) : a;}
template <class T> T 
lcm(T a, T b){return a * b / gcd(a, b);}
vector<char> 
string_to_vector_char(const string& input){vector<char> out(input.length());rep(i,input.length()){out[i]=input[i];}return out;}
map<char,int> 
count_same_elements(const vector<char>& v){map<char,int>cmap; for_each(v.begin(),v.end(),[&cmap](int x){cmap[x]++;}); return cmap; }
template<class A,class B> vector<B> 
mapf(const vector<A>& v,const function<B(A)>& func){vector<B> v_(v.size());rep(i,v.size()){ v_[i]=func(v[i]); }return v_;}
template<class A,class B> vector<B> 
adjacent_map(const vector<A>& v,const function<B(A,A)>& func){vector<B> v_(v.size()-1);rep(i,v.size()-1){ v_[i]=func(v[i+1],v[i]); }return v_;}
template<class A> bool
all_of(const vector<A>& v){bool flag=true;rep(i,v.size()){ if(v[i]<1){flag=false;}; }return flag;}
template<class A> bool
any_of(const vector<A>& v){bool flag=false;rep(i,v.size()){ if(v[i]>0){flag=true; break;}; }return flag;}
template<class A> bool
none_of(const vector<A>& v){bool flag=true;rep(i,v.size()){ if(v[i]>0){flag=false;}; }return flag;}
template<class T,class U>
void msg_with_compare(T A,T B,U A_greater_B,U A_eq_B,U A_less_B){
    if(A==B){cout<<A_eq_B<<"\n";}else if(A>B){cout<<A_greater_B<<"\n";}else{cout<<A_less_B<<"\n";}}
template<class B,class T>
void msg_with_boolean(B A,T true_msg,T false_msg){cout<< ( A? true_msg:false_msg);}
template<class B,class T>
void msg_with_boolean(B A1,B A2,T both_true_msg,T true_false_msg,T false_true_msg,T both_false_msg){
    if(A1){if(A2){cout<<both_true_msg;}else{cout<<true_false_msg;}
    }else{if(A2){cout<<false_true_msg;}else{cout<<both_false_msg;}}
}
template<class T>
void scan_vector(long long size,vector<T>& vector){
    vector.resize(size);
    for(long long i=0;i<size;++i){
        cin>>vector[i];
    }
}

ll a,b;
vector<ll> v;
string s;
void input(){
    cin>>a>>b;
}
void src(){
    ll n=(b-a);
    cout<<n*(n+1)/2-b;
}   

int main(int argc,char* argv[]){
    ios::sync_with_stdio(false);
 //   ifstream in( argv[1] ); cin.rdbuf(in.rdbuf());
    input();
    src();    
    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <vector>
#include <cctype>
#include <algorithm>
#include <functional>
#include <cmath>
#include <string>
#include <cstring>
#include <vector>
#include <numeric>
#include <iomanip>
#include <limits>

#define roop(i, n) for(int i=0;i<n;i++)
#define DIV 1000000007
//static const long double pi = 3.1415926535897932;

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

char toSmall(char c) { // 大文字を小文字へ
	return (c + 0x20);
}

char toLarge(char c) { // 小文字を大文字へ
	return (c - 0x20);
}

float myPower(int a, int n) { // aのn乗の計算
	float x = 1;
	while (n > 0) { // 全てのbitが捨てられるまで
		if ( n & 1) { // 一番右のbitが１のとき
			x *= a;
		}
		a *= a;
		n >>= 1; // bit全体を右に1つシフトして一番右を捨てる
	}
	return x;
}

ll combination(ll n, ll r) { // nCr の計算
	if (n < 0 || r < 0 || r > n) return -1;

	if (n - r < r) r = n - r;
	if (r == 0) return 1;
	if (r == 1) return n;

	vector<ll> num(r);
	vector<ll> den(r);

	for (ll i = 0; i < r; i++) {
		num[i] = n - r + i + 1;
		den[i] = i + 1;
	}

	for (ll p = 2; p <= r; p++) {
		ll pivot = den[p - 1];
		if (pivot > 1) {
			ll offset = (n - r) % p;
			for (ll k = p - 1; k < r; k += p) {
				num[k - offset] /= pivot;
				den[k] /= pivot;
			}
		}
	}
	ll result = 1;
	for (ll k = 0; k < r; k++) {
		if (num[k] > 1) result *= num[k];
	}
	return result;
}

vector<string> split(const string& src, const char* delim = ",") { //カンマ区切り
	vector<string> vec;
	string::size_type len = src.length();

	for (string::size_type i = 0, n; i < len; i = n + 1) {
		n = src.find_first_of(delim, i);
		if (n == string::npos) {
			n = len;
		}
		vec.push_back(src.substr(i, n - i));
	}

	return vec;
}

bool check_int(string str)
{
	if (all_of(str.cbegin(), str.cend(), [](char ch) { return isdigit(ch);}))
	{
		return true;
	}
	return false;
}

struct rest{
	string s;
	int p;
	int num;

	bool operator<(const rest& right) const {
		return s == right.s ? p > right.p : s < right.s;
	}
};

int main() {
	int n;
	cin >> n;
	vector<rest> r(n);
	for (int i = 0; i < n; i++) {
		cin >> r[i].s >> r[i].p;
		r[i].num = i+1;
	}

	sort(r.begin(), r.end());
	for (int i = 0; i < n; i++) {
		cout << r[i].num << endl;
	}
	return 0;
}

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

int n;
int a;
int b;

int main(){
  cin >> n;
  cin >> a;
  cin >> b;
  int sub;
  if(a>b) sub = a - b;
  if(a<=b) sub = b - a;
  sub = sub -1 ;
  if(sub%2==1) cout << "Alice" << endl;
  else cout << "Borys" << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int  n,cnt=0;
  cin>>n;
  string s;
  cin>>s;
  for(int i=0;i<n-2;i++)
  {
    if(s[i]=='A'&&s[i+1]=='B'&&s[i+2]=='C')
    {
      cnt++;
      i++;
    }
  }
  cout<<cnt;
  return 0;
}

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

using namespace std;

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

typedef int _loop_int;
#define REP(i,n) for(_loop_int i=0;i<(_loop_int)(n);++i)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG2(x,y) cout<<#x<<": "<<x<<" "<<#y<<": "<<y<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

bool cmp(const tuple<int,int,ll>& i, const tuple<int,int,ll>& j) {
    return get<0>(i) < get<0>(j);
}

string ltrim(string s){return s.substr(s.find_first_not_of(" "));}
string rtrim(string s){return s.substr(0, s.find_last_not_of(" ")+1);}
string trim(string s){return rtrim(ltrim(s));}

int main() {
    ios::sync_with_stdio(false); cin.tie(0);
    const int GROUND = 20000;
    const int SZ = GROUND*2+1;
    //vi csum[SZ];
    vi down[SZ], up[SZ];
    string s;
    cin>>s;
    int now = GROUND; 
    int flg = false;
    REP(i,s.size()){
        switch (s[i])
        {
        case '\\': 
            //csum[++now].emplace_back(i);
            down[++now].emplace_back(i);
            flg = true;
            break;
        case '/':
            //--now;
            
            //csum[now--].emplace_back(i);
            
            if(!down[now].empty()){
                up[now].emplace_back(i);
            }
            now--;
            break;
        }
    }

    ll ans=0;
    //queue<tuple<int,int,ll>> areas;
    vector<tuple<int,int,ll>> areas;
    FORR(i,0,SZ){
        FOR(j,0, min(down[i].size(), up[i].size())){
            //DEBUG2( up[i][j],down[i][j]);
            int left=down[i][j];
            int right=up[i][j];
            ll area = up[i][j]-down[i][j];
            ans += area;
            areas.emplace_back(make_tuple(left,right,area));
        }
    }

    sort(ALL(areas),cmp);

    int tmp=0;
    vl ans2;
    REP(i,areas.size()){
        if(tmp < get<1>(areas[i])){
            tmp = get<1>(areas[i]);
            ans2.emplace_back(get<2>(areas[i]));
        }else{
            ans2[ans2.size()-1] += get<2>(areas[i]);
        }
        //DEBUG2(get<0>(areas[i]), get<1>(areas[i]));
    }

    string ans3 = to_string(ans2.size()) + " ";
    REP(i,ans2.size()){
        ans3 += to_string(ans2[i]) + " ";
    }

    ans3 = rtrim(ans3);
    cout<<ans<<endl;
    cout << ans3 << endl;
    return 0;
}


Measured memory_bytes: 5732
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
#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 chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please


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


	int N;
	cin >> N;
	ll A[200000];
	rep(i, N) cin >> A[i];

	ll kotae = 0;
	ll mae = A[0];
	rep1(i, N - 1) {
		ll are = max(0ll, mae - A[i]);

		mae = A[i] + are;
		kotae += are;
	}
	co(kotae);

	Would you please return 0;
}

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

typedef long long ll;

int main(){
    int n, k;
    cin >> n >> k;

    ll zero = 0, half = 0;
    for(int i = 1; i <= n; i++){
        if(i%k == 0)    zero++;
        if(k%2 == 0 && i%k == k/2)  half++;
    }

    ll ans;
    if(k % 2 == 0){
        ans = zero*zero*zero + half*half*half;
    }else{
        ans = zero*zero*zero;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var n,sum,max int
	fmt.Scanf("%d",&n)
	
	lengths := make([]int,n)
	sum = 0
	max = 0
	
	for i := 0; i < len(lengths); i++ {
		fmt.Scanf("%d",&lengths[i])
		sum += lengths[i]
		if lengths[i] > max {
			max = lengths[i]
		}
	}
	
	sum -= max;
	
	if sum <= max {
		fmt.Printf("No")
	} else {
		fmt.Printf("Yes")
	}
}

Measured memory_bytes: 512
s=input()
flag=1
if s=='keyence':
  flag=0
for i in range(len(s)):
  for j in range(1,len(s)-i+1):
    if (s[:i]+s[i+j:])=='keyence':
      flag*=0
if flag==0:
  print('YES')
else:
  print('NO')


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

int lex_smaller(char* s1, char* s2)
{
	int i;
	for (i = 0; s1[i] != 0 && s2[i] != 0; i++) {
		if (s1[i] < s2[i]) return 1;
		else if (s1[i] > s2[i]) return -1;
	}
	if (s1[i] == s2[i]) return 0;
	else if (s1[i] == 0) return 1;
	else return -1;
}

int main()
{
	char S[51], T[51];
	scanf("%s", S);
	scanf("%s", T);
	
	int i, j, k, ls, lt;
	char ans[51] = {}, tmp[51] = {};
	for (ls = 0; S[ls] != 0; ls++);
	for (lt = 0; T[lt] != 0; lt++);
	for (i = 0; i <= ls - lt; i++) {
		for (j = 0; j < lt; j++) if (S[i+j] != T[j] && S[i+j] != '?') break;
		if (j == lt) {
			if (ans[0] == 0) {
				for (k = 0; k < ls; k++) ans[k] = (S[k] == '?')? 'a': S[k];
				for (j = 0; j < lt; j++) ans[i+j] = T[j];
			} else {
				for (k = 0; k < ls; k++) tmp[k] = (S[k] == '?')? 'a': S[k];
				for (j = 0; j < lt; j++) tmp[i+j] = T[j];
				if (lex_smaller(tmp, ans) == 1) {
					for (k = 0; k < ls; k++) ans[k] = tmp[k];
				}
			}
		}
	}
	
	if (ans[0] != 0) printf(ans);
	else printf("UNRESTORABLE\n");
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 128
#define _USE_MATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
using namespace std;

long long combination(int n, int r)
{
    if(n < r)
        return 0;
    if(n-r < r)
        r = n-r;
    long long ret = 1;
    for(int i=0; i<r; i++){
        ret *= (n--);
        ret /= i+1;
    }
    return ret;
}

int main()
{
    int n, a, b;
    cin >> n >> a >> b;
    vector<long long> v(n);
    map<long long, int> cnt;
    for(int i=0; i<n; ++i){
        cin >> v[i];
        ++ cnt[v[i]];
    }

    sort(v.rbegin(), v.rend());
    double ans1 = accumulate(v.begin(), v.begin() + a, 0.0) / a;

    while(!cnt.empty()){
        int x = cnt.rbegin()->second;
        if(x > a)
            break;
        a -= x;
        b = a;
        cnt.erase(--cnt.end());
    }

    int x = 0;
    if(!cnt.empty())
        x = cnt.rbegin()->second;
    long long ans2 = 0;
    for(int i=a; i<=min(x,b); ++i)
        ans2 += combination(x, i);

    cout.setf(ios_base::fixed, ios_base::floatfield);
    cout << setprecision(10);
    cout << ans1 << endl << ans2 << endl;

    return 0;
}


Measured memory_bytes: 256
import math
import collections

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

n = int(input())

c = collections.Counter(prime_factorize(n))

d = list(c.values())

# d = 2 #素数
ans = 0
# print(c)
x = 1
for i in d:
    s = i
    x=1
    while s>0:
        s = s - x
        # print(x,"引いて",s)
        x +=1
        if s>=0:
            ans+=1

print(ans)

Measured memory_bytes: 9384
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
cin>>n;
int a[n];
int k=1;
int cnt=0;
for(int i=0;i<n;i++)
{
    cin>>a[i];
    if(a[i]==k)
    {
        k++;
        cnt++;
    }
}
if(cnt==0)cout<<-1;
else cout<<n-cnt;
 
 
 
}


Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>

typedef std::string::const_iterator State;

std::string S;

// paren: [paren*] [number]
// number: [0-9]+

// int level = 0;

int solve(State& s){
    s++;
    if(std::isdigit(*s)){
        int n = 0;
        for(;std::isdigit(*s);s++){
            n = 10 * n + (*s - '0');
        }
        s++;
        // printf("%d: %d\n", level, n);
        return (n+1) / 2;
    }

    // level++;
    std::vector<int> v;
    for(;;){
        if(*s == '['){
            v.push_back(solve(s));
        }else{
            break;
        }
    }
    s++;

    std::sort(v.begin(), v.end());
    int res = 0;
    for(int i=0;i<(v.size()+1)/2;i++){
        res += v[i];
    }

    // printf("%d: %d\n", --level, res);
    return res;
}

int main(){
    int N;
    std::cin >> N;

    while(N--){
        std::cin >> S;

        State s = S.begin();
        std::cout << solve(s) << std::endl;
    }
}

Measured memory_bytes: 1280
#include <cstdio>
#include <cctype>
#include <cstring>
#include <algorithm>
#include <cmath>
int read(){
	register int x = 0;
	register char f = 1, ch = getchar();
	for (; !isdigit(ch); ch = getchar()) if (ch == '-') f ^= 1;
	for (; isdigit(ch); ch = getchar()) x = (x << 1) + (x << 3) + (ch ^ '0');
	return f ? x : -x;
}
double a, b, s;
bool check(double t){
	t = tan(t / 180 * 3.14159265);
	double y = sqrt(2 * s / t), x = t * y;
	if (x < a + 1e-9) return y < b + 1e-9;
	x = a / t, y = (s - x * a / 2) / a;
	return x + y < b + 1e-9;
}
int main(){
	a  = read(), b = read(), s = read() / a;
	double l = 1e-9, r = 90 - 1e-9, md;
	for (register int i = 1; i <= 100; ++i)
		if (check(md = (l + r) / 2)) r = md; else l = md;
	printf("%.10lf\n", 90 - r);
}

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

#define rep(i, n) for (int i = 0; i < (n); i++)
#define contains(v, t) (find(v.begin(), v.end(), t) != v.end())
#define MOD 1000000007
using ll = long long;
using ull = unsigned long long;

int main() {
  int n;
  string s;
  cin>>n>>s;
  int ans = 0;
  int cur = 0;
  rep(i, n) {
    if (s.at(i) == 'I') {
      cur++;
      ans = max(ans, cur);
    } else {
      cur--;
    }
  }
  cout << ans;
}


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

int main() {
    char c;
    cin >> c;
    if (c >= 'A' && c <= 'Z') {
        cout << "A" << endl;
    } else {
        cout << "a" << endl;
    }
    return 0;
}

Measured memory_bytes: 3552
#include<bits/stdc++.h>
 #include<cmath>
using namespace std;
typedef long long ll;
ll maxi(ll a, ll b, ll c){
    if(a>=b && a>=c){
        return a;
    }
    else if(b>=a && b>=c){
        return b;
    }
    else{
        return c;
    }
}
int main()
{
ll n;
cin>>n;
ll a[n];
ll b[n];
ll c[n];
for(ll i=0;i<n;i++){
    cin>>a[i];
    cin>>b[i];
    cin>>c[i];
}
ll dp[n][3];
dp[0][0]=a[0];
dp[0][1]=b[0];
dp[0][2]=c[0];
for(ll i=1;i<n;i++){
    dp[i][0]=a[i]+ max(dp[i-1][1],dp[i-1][2]);
        dp[i][1]=b[i]+max(dp[i-1][0],dp[i-1][2]);
    dp[i][2]=c[i]+max(dp[i-1][1],dp[i-1][0]);

}
cout<<maxi(dp[n-1][0],dp[n-1][1],dp[n-1][2])<<endl;
    return 0;
}

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

using namespace std;

typedef long long ll;

void solve() {
	ll n, x;
	cin >> n >> x;
	
	vector<int> candies(n);	
	
	for(auto &p: candies) {
		cin >> p;
	}

	ll operations = 0;
	
	if (candies[0] > x) {
		operations += candies[0] - x;
		candies[0] = x;	
	}
	
	for (int i = 1; i < n; i++) {
		if (candies[i-1] + candies[i] > x) {	
			int limit = x - candies[i-1];
			operations += candies[i] - limit;
			candies[i] = limit;
		}
	}

	cout << operations << endl;

}

int main() {
	ll t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}
	return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<fstream>
#include<string>
#include<vector>
#include<utility>
#include<algorithm>
#include<climits>
#include<set>
#include<map>
#include<cmath>
#include<iomanip>
#include<iterator>
#include<queue>
#include<stack>
#include<cctype>
#include<deque>

//by Skeef79

//НЕ ИСПОЛЬЗУЙ endl, есть свой en!!
//Иногда нужно не просто придумывать решение, а метматически расписать систему уравнений
//для задач с cin/cout в большом кол-ве - gnu , иначе вижуалки. А ваще пробуй два если TL

//для интерактивок - cout<<flush
// cin.tie и sync_with_stdio убирать для интерактивок

typedef long long ll;
typedef long double ld;

#define pb push_back
#define en '\n'
#define for0(i,n) for(int i = 0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define allr(x) (x).rbegin(),(x).rend()
#define vec vector
#define pii pair<int,int>
#define pll pair<ll,ll>

using namespace std;

const int INF = 1e9 + 1233;
const ll LINF = 1e18 + 1233;

template<typename T> void print(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cout << a[i] << ' ';
}

template <typename T> void Input(vector<T>& a)
{
	for (int i = 0; i < a.size(); i++)
		cin >> a[i];
}

const int NMAX = 2 * 100000;
ll a[NMAX];
ll t[4 * NMAX];
ll tAdd[4 * NMAX];

void push(int v, int vl, int vr)
{
	if (tAdd[v] != 0)
	{
		t[v] += tAdd[v] * (ll(vr - vl + 1));
		if (vl != vr)
		{
			tAdd[2 * v + 1] += tAdd[v];
			tAdd[2 * v + 2] += tAdd[v];
		}

		tAdd[v] = 0;
	}
}

ll query(int v, int vl, int vr, int l, int r)
{
	push(v, vl, vr);

	if (r < vl || vr < l)
		return 0;
	if (vl >= l && vr <= r)
		return t[v];
	int vm = vl + (vr - vl) / 2;
	ll ql = query(2 * v + 1, vl, vm, l, r);
	ll qr = query(2 * v + 2, vm + 1, vr, l, r);
	return ql + qr;
}

void modify(int v, int vl, int vr, int l, int r, ll val)
{
	push(v, vl, vr);
	if (r < vl || vr < l)
		return;
	if (vl >= l && vr <= r)
	{
		tAdd[v] = val;
		push(v, vl, vr);
		return;
	}

	int vm = vl + (vr - vl) / 2;
	modify(2 * v + 1, vl, vm, l, r, val);
	modify(2 * v + 2, vm + 1, vr, l, r, val);
	t[v] = t[2 * v + 1] + t[2 * v + 2];
}

int timer = 0;
vector<int> tin, tout;
vector<vector<int>> e;
vector<int> obhod;

void dfs(int v, int p = -1)
{
	tin[v] = timer++;
	
	obhod.pb(v);

	for (auto to : e[v])
	{
		if (to == p)
			continue;
		dfs(to, v);
	}

	tout[v] = timer;
}

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

	int n, q;
	cin >> n >> q;
	tin = vector<int>(n + 1);
	tout = vector<int>(n + 1);
	e = vector<vector<int>>(n + 1);
	for (int i = 0; i < n - 1; i++)
	{
		int u, v;
		cin >> u >> v;
		e[u].pb(v);
		e[v].pb(u);
	}

	dfs(1);

	while (q--)
	{
		int v;
		ll x;
		cin >> v >> x;
		modify(0, 0, n - 1, tin[v], tout[v] - 1, x);
	}

	vector<int> ans(n+1);
	for (auto to : obhod)
	{
		ans[to] = query(0, 0, n - 1, tin[to], tin[to]);
	}
	for (int i = 1; i <= n; i++)
		cout << ans[i] << ' ';

}





Measured memory_bytes: 38264
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <queue>
typedef long long ll;
using namespace std;

int main(void){
  ll n,m,i,a;
  priority_queue<ll> q;
  ll sum=0;

  cin>>n>>m;

  for(i=0;i<n;i++){
    cin>>a;
    q.push(a);
  }
  
  for(i=0;i<m;i++){
    a=q.top();
    q.pop();
    q.push(a/2);
  }

  for(i=0;i<n;i++){
    sum+=q.top();
    q.pop();
  }
  cout<<sum<<endl;

  return 0;
}


Measured memory_bytes: 1400
#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;
    if (a > b) swap(a, b);
    rep(i, b) cout << a;
    cout << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m,p,y;
	cin>>n>>m;
	map<int,int>mp[100000];
	for(int i=0;i<m;i++){
		cin>>p>>y;
		mp[--p][y]=i;
	}
	int ans1[100000],ans2[100000];
	for(int i=0;i<n;i++){
		int j=0;
		for(auto x:mp[i]){
			ans1[x.second]=i;
			ans2[x.second]=j;
			j++;
		}
	}
	for(int i=0;i<m;i++)
		cout<<setw(6)<<setfill('0')<<++ans1[i]<<setw(6)<<++ans2[i]<<endl;
}


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



int main(){
    long double r;
    cin >> r;

    long double ans = r * 2 * M_PI;
  
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3760
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

#define IOS ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define I insert
#define endl '\n'
#define all(x) x.begin(), x.end()

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
template<class T> using oset=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;


using vvll = vector< vector<ll> >;
using vll = vector<ll> ;

const ll maxs = 1e6+5;
const ll lmaxs = 20;
ll mod = 1e9+7;
ll oo = 1e15;


ll fast(ll x,ll y){
    ll res=1;
    while(y){
        if(y&1)
            res = (res*x)%mod;
        x = (x*x)%mod;
        y >>= 1;
    }
    return res;
}

ll inv(ll n){
    return fast(n,mod-2);
}

void pre(){


}

void solve(){
    mod  = 998244353;
    ll n,s;
    cin >> n >> s;
    ll a[n+1];
    for(ll i=1;i<=n;i++){
        cin >> a[i];
    }
    ll dp[n+1][s+1];
    memset(dp,0,sizeof dp);
    ll inv2 = inv(2);
    dp[0][0] = fast(2,n);
    for(ll i=1;i<=n;i++){
        for(ll j=0;j<=s;j++){
            dp[i][j] = dp[i-1][j];
            if(j>=a[i])
                dp[i][j] += dp[i-1][j-a[i]]*inv2;
            dp[i][j] %= mod;
        }
    }

    cout << dp[n][s] << endl;

}

int main(){
    // #ifndef ONLINE_JUDGE
    // freopen("input00.txt","r",stdin);
    // #endif
    IOS;
    pre();
    ll T = 1;
    //cin>>T;
    while(T--){
        solve();   
    }
    return 0;
}

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


void solve(long long R){
    cout << 2 * R * 3.141592653589793238 << endl;
}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    long long R;
    scanf("%lld",&R);
    solve(R);
    return 0;
}


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

int main(){
  int N;
  std::cin >> N;
  std::vector<int> A_arr(N), B_arr(N);
  for(int i = 0; i < N; i++) std::cin >> A_arr[i];
  for(int i = 0; i < N; i++) std::cin >> B_arr[i];

  int ans = 0;
  for(int nd = 29; nd >= 0; nd--){
    int nth = 1<<nd;
    for(int i = 0; i < N; i++){
      A_arr[i] %= 2*nth;
      B_arr[i] %= 2*nth;
    }
    std::sort(B_arr.begin(), B_arr.end());
    auto bb=B_arr.begin(), be = B_arr.end();
    int nab = 0;
    for(auto&& a: A_arr){
      nab += std::distance(std::lower_bound(bb, be, 2*nth-a), std::lower_bound(bb, be, nth-a));
      nab += std::distance(std::lower_bound(bb, be, 2*nth), std::lower_bound(bb, be, 3*nth-a));
      nab %= 2;
    }
    if(nab) ans += nth;
  }

  std::cout << ans << std::endl;

  return 0;
}



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

#define rep(i,j,n) for(int i=j;i<n;++i)
#define all(i) i.begin(),i.end()
#define rall(i) i.rbegin(), i.rend()
#define INF 1e9
#define LINF 1e18
const int mod = 1e9 + 7;

typedef long long i64;
typedef pair<int, int> pi;

template <class T> using vt = vector<T>;
template <class T> using vvt = vector<vector<T>>;

i64 gcd(i64 n, i64 m) {return (m == 0? n : gcd(m, n % m));}
i64 lcd(i64 n, i64 m) {return (n / gcd(n, m) * m);}
int dx[] = {1, 0, -1, 0};
int dy[] = {0, 1, 0, -1};

template <class Monoid, class OperatorMonoid = Monoid> class LazySegmentTree {
  using F = std::function<Monoid(Monoid, Monoid)>;
  using G = std::function<Monoid(Monoid, OperatorMonoid, int)>;
  using H = std::function<OperatorMonoid(OperatorMonoid, OperatorMonoid)>;

  private:
    int n;
    std::vector<Monoid> seg;
    std::vector<OperatorMonoid> lazy;

    const F f;
    const G g;
    const H h;
    const Monoid M1;
    const OperatorMonoid OM1;

    void lazyUpdate(int k, int l, int r) {
      if(lazy[k] == OM1) return;

      if(2 * k + 1 < 2 * n - 1) {
        lazy[2 * k + 1] = h(lazy[2 * k + 1], lazy[k]);
        lazy[2 * k + 2] = h(lazy[2 * k + 2], lazy[k]);
      }
      seg[k] = g(seg[k], lazy[k], r - l);
      lazy[k] = OM1;
    }

  public:
    LazySegmentTree(int sz, const F f, const G g, const H h, const Monoid &M1, const OperatorMonoid &OM1) : f(f), g(g), h(h), M1(M1), OM1(OM1) {
      n = 1;
      while(n < sz) n *= 2;
      seg.resize(2 * n - 1, M1);
      lazy.resize(2 * n - 1, OM1);
    }

    void update(int a, int b, Monoid x, int k = 0, int l = 0, int r = -1) {
      if(r < 0) r = n;

      lazyUpdate(k, l, r);

      if(b <= l || r <= a) return;

      if(a <= l && r <= b) {
        lazy[k] = h(lazy[k], x);
        lazyUpdate(k, l, r);
      }
      else {
        update(a, b, x, 2 * k + 1, l, (l + r) / 2);
        update(a, b, x, 2 * k + 2, (l + r) / 2, r);
        seg[k] = f(seg[k * 2 + 1], seg[k * 2 + 2]);
      }
    }

    Monoid query(int a, int b, int k = 0, int l = 0, int r = -1) {
      if(r < 0) r = n;

      lazyUpdate(k, l, r);

      if(b <= l || r <= a) return M1;
      if(a <= l && r <= b) return seg[k];
      Monoid vl = query(a, b, 2 * k + 1, l, (l + r) / 2);
      Monoid vr = query(a, b, 2 * k + 2, (l + r) / 2, r);
      return f(vl, vr);
    }
};

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

  int n, q;
  cin >> n >> q;
  LazySegmentTree<int> seg(n, [](int a, int b){ return a + b; },
                              [](int a, int b, int len){ return a + b * len; },
                              [](int a, int b){ return a + b; }, 0, 0);
  rep(i, 0, q) {
    int c;
    cin >> c;
    if(c == 0) {
      int s, t, x;
      cin >> s >> t >> x;
      seg.update(s - 1, t, x);
    }
    else {
      int x;
      cin >> x;
      cout << seg.query(x - 1, x) << endl;
    }
  }
}


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

const string YES = "Yes";
const string NO = "No";

auto solve(long long N, std::vector<long long> a){
    int fs = 0;
    int os = 0;
    for(const auto& v : a) {
        fs += static_cast<int>((v % 4) == 0);
        os += static_cast<int>((v % 2) == 1);
    }

    return (os <= fs) ? YES :
           ((os == (fs + 1)) && ((fs + os) == a.size())) ? YES:
            NO;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> a(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&a[i]);
    }
    auto result = solve(N, std::move(a));
    cout << result << endl;
    return 0;
}


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

using namespace std;

using ll = long long;

template<typename T> using V = std::vector<T>;
using Vi = V<int>;
using VVi = V<V<int>>;
using Vl = V<ll>;
using VVl = V<V<ll>>;
using Vs = V<string>;

template<typename T1, typename T2> using P = std::pair<T1, T2>;
using Pii = P<int, int>;
using Pll = P<ll, ll>;
using Pdd = P<double, double>;

template<typename T1, typename T2> using M = std::map<T1, T2>;
using Mii = M<int, int>;
using Msi = M<string, int>;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define REP2(i,s,e) for(int i=(int)(s);i<(int)(e);++i)
#define RREP(i,s,e) for(int i=(int)(s);i>=(int)(e);--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin(),ie=(c).end();i!=ie;++i)
#define ALL(c) (c).begin(), (c).end()

const double PI = acos(-1);
const ll MOD = 1e9+7;


int n, m;
string s;

int main() {
    cin >> n;

    V<V<Pii>> e(n+1);
    REP(i, n-1) {
        int u, v, w;
        cin >> u >> v >> w;
        e[u].push_back({v, w});
        e[v].push_back({u, w});
    }

    priority_queue<P<ll, int>, V<P<ll, int>>, greater<P<ll, int>>> q;
    Vl costs(n+1, 1e18);
    q.push({0, 1});
    costs[1] = 0;

    while (!q.empty()) {
        ll cost = q.top().first;
        int node = q.top().second;
        q.pop();
        if (costs[node] < cost) continue;

        FOR(i, e[node]) {
            if (costs[i->first] > cost + i->second) {
                costs[i->first] = cost + i->second;
                q.push({costs[i->first], i->first});
            }
        }
    }

    REP2(i, 1, n+1) {
        if (costs[i]%2 == 0) {
            std::cout << 0 << '\n';
        } else {
            std::cout << 1 << '\n';
        }
    }

    return 0;
}


Measured memory_bytes: 7296
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
#define pq_pair_tB priority_queue <pair<ll,ll>, vector<pair<ll,ll> > , greater<pair<ll,ll> > >
#define pq_pair_ts priority_queue <pair<ll,ll> > //第二成分の大きさが関係ない
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}

bool a[100000];

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

	ll s;
	cin >> s;

	ll idx =  0;
	while(1){
		idx ++;
		ll b = log2(s);
		if(pow(2, b) == s){
			if(a[b] == true){
				cout << idx << endl;
				return 0;
			}else{
				a[b] = true;
			}
		}

		if(s % 2 == 0) s /=2;
		else s = s*3 + 1;


	}



	//cout << fixed << setprecision(16) << ans << endl;
	return 0;
}


Measured memory_bytes: 512
n, q = map(int, input().split())
edges = [[] for _ in range(n)]
counter = [0] * n
for a, b in [list(map(int, input().split())) for _ in range(n - 1)]:
    edges[a - 1].append(b - 1)
    edges[b - 1].append(a - 1)
for p, x in [list(map(int, input().split())) for _ in range(q)]:
    counter[p - 1] += x

ret = [-1] * n
ret[0] = counter[0]
q = [0]
index = 0
while index < len(q):
    i = q[index]
    index += 1
    for j in edges[i]:
        if ret[j] < 0:
            q.append(j)
            ret[j] = counter[j] + ret[i]

print(' '.join(str(c) for c in ret))

Measured memory_bytes: 130836
import string

n = int(input())
sLst = list(input() for _ in range(n))

index = 0
tmp = 51
for i in range(n):
    if len(sLst[i]) <= tmp:
        tmp = len(sLst[i])
        index = i
alst = [0] * 26
for i in range(26):
    alst[i] = sLst[index].count(string.ascii_lowercase[i])

for i in range(26):
    if alst[i] != 0:
        mint = alst[i]
        tFlg = True
        for j in range(1, n):
            if sLst[j].count(string.ascii_lowercase[i]) == 0:
                tFlg = False
                break
            else:
                mint = min(mint, sLst[j].count(string.ascii_lowercase[i]))

        if tFlg:
            alst[i] = mint
        else:
            alst[i] = 0

ans = ''
for i in range(26):
    if alst[i] != 0:
        ans += alst[i] * string.ascii_lowercase[i]

print(ans)

Measured memory_bytes: 3772
def main():
    import sys
    input=sys.stdin.readline   
    sys.setrecursionlimit(100000000)

    n=int(input())
    point=[tuple(map(int,input().split())) for _ in range(n)]
    dic={i:j for i,j in zip(point,range(n))}
    
    if n==1:
        print(1)
        exit()
        
    ans=10**9
    for i in range(n-1):
        for j in range(i+1,n):
            p=point[j][0]-point[i][0]
            q=point[j][1]-point[i][1]
            cnt=0
            visited=[True]*n

            def dfs(x,y):
                if (x+p,y+q) in dic:
                    idx=dic[(x+p,y+q)]
                    if visited[idx]:
                        visited[idx]=False
                        dfs(x+p,y+q)
                if (x-p,y-q) in dic:
                    idx=dic[(x-p,y-q)]
                    if visited[idx]:
                        visited[idx]=False
                        dfs(x-p,y-q)

            for k in range(n):
                if visited[k]:
                    visited[k]=False
                    cnt+=1
                    dfs(point[k][0],point[k][1])      
        
            ans=min(ans,cnt)  
    print(ans)

if __name__=='__main__':
    main()

Measured memory_bytes: 3064
#include <iostream>

#include <string>

using namespace std;

int main()
{
    string s;
    cin >> s;
    if(s.length()<=10 && s.length()>=4)
    {
        int lenR=s.length();
        if(s[0]!='A')
        {
            cout<< "WA";
            return 0;
        }
        if(!(s[1]>='a' && s[1]<='z'))
        {
            cout<< "WA";
            return 0;
        }
        if(!(s[lenR-1]>='a' && s[lenR-1]<='z'))
        {
            cout<< "WA";
            return 0;
        }
        else
        {
            int count=0;
            for(int i=2;i<lenR-1;i++)
            {
                if(s[i]=='C')
                {
                    count++;
                }
                else if(!(s[i]>='a' && s[i]<='z'))
                {
                    cout<< "WA";
                    return 0;
                }
            }
            if(count!=1)
            {
                cout<< "WA";
                return 0;
            }
            cout<< "AC";
            return 0;

        }
   
    }
    else
    {
        cout<< "WA";
        return 0;
    }

}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long 
#define scn(n) scanf("%d",&n)
#define lscn(n) scanf("%lld",&n)
#define lpri(n) printf("%lld",n)
#define pri(n) printf("%d",n)
#define pln() printf("\n")
#define priln(n) printf("%d\n",n)
#define lpriln(n) printf("%lld\n",n)
#define rep(i,init,n) for(int i=init;i<n;i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define gcd __gcd
#define inf INT_MAX
#define ninf INT_MIN
using namespace std;
const ll mod=1e9+7;
const int N=1e5+4;
int main()
{
    int a,b;
    cin>>a>>b;
    if(a<b)
    pri(0);
    else
    pri(10);
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int main(int n)
{
	for(;scanf("%d",&n),n>0;)
	{
		double x=1.0,y=0.0,r;
		for(;--n;)
		{
			r=atan2(x,y)+M_PI/2;
			x-=sin(r);
			y+=-cos(r);
		}
		printf("%.2f\n%.2f\n",x,y);
	}
	return 0;
}

Measured memory_bytes: 720
//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

#define F first
#define S second
#define _sz(x) (int)x.size()
#define pb push_back

#define error(x) cout << #x << " = " << x << endl

using namespace std ;
using ll = long long ;
using ld = long double ;
using pii = pair <int , int> ;

const int N = 1e5 + 20;
int n, m;
vector <int> g[N];

int cnt[3];

int flag;
int d[N];
bool vis[N];

ll ans;

void dfs (int v)
{
	vis[v] = 1;

	for (int u: g[v])
	{
		if (vis[u] && d[u] == d[v]) flag = 2; 
		if (vis[u]) continue;
		if (!flag) flag = 1;
		d[u] = 3 - d[v];
		dfs(u);
	}
}

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

	cin >> n >> m;

	for (int i = 0, u, v; i < m; i++)
	{
		cin >> u >> v;
		u--, v--;

		g[u].pb(v);
		g[v].pb(u);
	}

	for (int i = 0; i < n; i++)
	{
		if (!vis[i])
		{
			flag = 0;
			d[i] = 1;
			dfs(i);	
		
			cnt[flag]++;
		}
	}

	ans += 2ll * cnt[0] * (n - cnt[0]);
	ans += 1ll * cnt[0] * cnt[0];

	ans += 2 * cnt[1];
	ans += cnt[2];

	ans += 2ll * cnt[1] * (cnt[1] - 1);
	ans += 1ll * cnt[2] * (cnt[2] - 1);
	ans += 2ll * cnt[1] * cnt[2];

	cout << ans << '\n';
}


Measured memory_bytes: 10112
N = int(input())
r = [0 for i in range(N+1)]
def prime_decomposition(n):
    i = 2
    table = []
    while i * i <= n:
        while n % i == 0:
            n //= i
            table.append(i)
        i += 1
    if n > 1:
        table.append(n)
    return table

for i in range(2, N+1):
    L = prime_decomposition(i)
    for j  in range(len(L)):
        r[L[j]] += 1
        
count = 1      
for a in r:
    if a != 0:
        count *= a+1
        count = count%(10**9+7)
        
print(count)
    

Measured memory_bytes: 3064
Imports System.Collections.Generic
Imports System.Console

Module Program
    Sub Main()
        Dim n As Integer = NextInt()
        Dim pre As Integer = -1
        Dim ans As Integer = 0

        For i As Integer = 0 To n - 1
            Dim a As Integer = NextInt()
            If a = pre Then
                ans += 1
                pre = -1
            Else
                pre = a
            End If
        Next

        WriteLine(ans)
    End Sub

    Function NextInt() As Integer
        Return CInt(NextString())
    End Function

    Function NextString() As String
        Dim result As New List(Of Char)
        Do
            Dim tmp As Integer = Read()
            If tmp < 0 Then Exit Do
            Dim nextChar As Char = Chr(tmp)

            If Not Char.IsWhiteSpace(nextChar) Then
                result.Add(nextChar)
            ElseIf nextChar <> vbCr Then
                Exit Do
            End If
        Loop
        Return New String(result.ToArray())
    End Function
End Module


Measured memory_bytes: 19920
#include <bits/stdc++.h>
    typedef long long ll;
    #define pb push_back
    #define f first
    #define s second
    #define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    #define endl '\n'
    #define mem(a , v)  memset(a , v , sizeof(a))
using namespace std;
const int MAX=3002;
const int inf = 1e9+77;
const int MOD = 1e9+7;
ll x[MAX];

char ALPH[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};


char ALPH_C[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char vowels[6]={'a','e','i','o','u','y'};

ll power(ll x,ll y){
         if(y==0)
         return 1;
         ll s=power(x,y/2);
         s*=s;
         if(y%2==1)
         s*=x;
         return s;
}
void sortString(string &str)
{
   sort(str.begin(), str.end());
   //cout << str;
}
string s,t;
int n,m;
int dp[MAX][MAX];

bool valid(int i,int j){
    return (i>=0&&i<n&&j>=0&&j<m);
}
int lcs(int i,int j){
if(i==s.size()||j==t.size()) return 0;

  int &res=dp[i][j];
  if(res!=-1){
    return res;
  }
  if(s[i]==t[j]) res=lcs(i+1,j+1)+1;

  else {
     int y1=0,y2=0;
    if(valid(i+1,j)){
        y1=lcs(i+1,j);
    }
    if(valid(i,j+1)){
        y2=lcs(i,j+1);
    }
    res=max(y1,y2);
  }


return res ;


}



void build(int i,int j){
if(i==s.size()||j==t.size()) return;


  if(s[i]==t[j]){
    cout<<s[i];
    build(i+1,j+1);
  }

  else {
     int y1=0,y2=0;
    if(valid(i+1,j)){
        y1=lcs(i+1,j);
    }
    if(valid(i,j+1)){
        y2=lcs(i,j+1);
    }
    if(y1>y2){
         build(i+1,j);
    }
    else{
         build(i,j+1);
    }
  }


return;


}




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

     cin>>s>>t;
     n=s.size();
     m=t.size();
     mem(dp,-1);
     lcs(0,0);

     build(0,0);


    //cout << "Hello world!" << endl;
    return 0;
}


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

public class Main {
    public static void main(String args[]) throws IOException {

    	// ??\??????????????????????????????
		BufferedReader r = new BufferedReader (new InputStreamReader (System.in));
		String s = r.readLine();

    	// ??\???????????????????????°????????????
		int n = Integer.parseInt(s);

    	// ??°??????3?????????
		n = n * n * n;

    	// ?????????????????????
    	System.out.println(n);
    }
}

Measured memory_bytes: 24224
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <utility>
#include <cstdio>
#include <vector>
#include <string>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#define my_abs(x) ((x) < 0 ? -(x) : (x))
#define mp std::make_pair
#define pb push_back
#define X first
#define Y second
#define MOD 1000000007
typedef long long ll; 
struct data
{
	int u, v, w; 
	inline bool operator <(const data &a) const
	{
		return w < a.w; 
	}
} arr[2005]; 
int fa[1005]; 
inline ll quick_pow(ll a, int n)
{
	ll res = 1; 
	while (n)
	{
		if (n & 1)
			res = res * a % MOD; 
		a = a * a % MOD; 
		n >>= 1; 
	}
	return res; 
}
int getfa(int u)
{
	if (u == fa[u])
		return u; 
	return fa[u] = getfa(fa[u]); 
}
inline bool unite(int u, int v)
{
	u = getfa(u); 
	v = getfa(v); 
	fa[u] = v; 
	return u != v; 
}
int main()
{
	// freopen("ARC093-E.in", "r", stdin); 
	int n, m; 
	ll x; 
	scanf("%d%d%lld", &n, &m, &x); 
	for (int i = 0; i < m; i++)
	{
		scanf("%d%d%d", &arr[i].u, &arr[i].v, &arr[i].w); 
		arr[i].u--; 
		arr[i].v--; 
	}
	std::sort(arr, arr + m); 
	int cntx = 0, cnty = 0; 
	bool flg = false; 
	for (int i = 0; i < m; i++)
	{
		for (int j = 0; j < n; j++)
			fa[j] = j; 
		ll sum = arr[i].w * unite(arr[i].u, arr[i].v); 
		for (int j = 0; j < m; j++)
			sum += arr[j].w * unite(arr[j].u, arr[j].v); 
		if (!i && sum == x)
			flg = true; 
		if (sum < x)
			cntx++; 
		if (sum == x)
			cnty++; 
	}
	if (flg)
		printf("%lld\n", quick_pow(2, m - cnty) * (quick_pow(2, cnty) + MOD - 2) % MOD);
	else
		printf("%lld\n", 2 * quick_pow(2, m - cntx - cnty) * (quick_pow(2, cnty) + MOD - 1) % MOD); 
	return 0; 
}


Measured memory_bytes: 256