akhauriyash/Code-Regression huggingface dataset:
/*input
100000 100000
*/
/*

**************************
*						 *
* AUTHOR :: knight_coder *
*						 *
**************************

*/
#include<bits/stdc++.h>
#define lld          long long int
#define pb          push_back
#define ppb         pop_back
#define	endl		'\n'
#define mii         map<lld,lld>
#define msi         map<string,lld>
#define mis         map<lld, string>
#define mpi         map<pair<lld ,lld >,lld >
#define pii         pair<lld,lld>
#define vi          vector<lld>
#define vpi 		vector<pii>
#define vs          vector<string>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (lld)x.size()
#define hell        1000000007
#define rrep(i,m,n)	for(lld i=m;i>=n;i--)
#define rep(i,m,n)	for(lld i=m;i<n;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define what_is(x)  cerr << #x << " is " << x << endl;
#define pr(x) 		cout<< x << " ";
#define pre(x)		cout<< x << endl ;
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
std::mt19937_64 rng(std::chrono::steady_clock::now().time_since_epoch().count());
template<typename T>
using ordered_set = tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>; 
//change null_type to get ordered_map
#define N  100005
#define DEC(N)	cout << std::fixed; cout << setprecision(N);
lld expo(lld base,lld exponent,lld mod){
    lld ans=1;
    while(exponent!=0){
        if(exponent&1) ans=(1LL*ans*base)%mod;
        base=(1LL*base*base)%mod;
        exponent>>=1;
    }
    return ans%mod;
}
void solve()
{
	lld n,k;
	cin >> n >> k;
	lld ans=0;
	lld cnt[k+1];
	rep(i,1,k+1){
		lld t=k/i;
		lld res=expo(t,n,hell);
		cnt[i]=res;
	} 
	rrep(i,k,1){
		lld t2=0;
		for(lld j=2*i;j<=k;j+=i){
			t2=(t2+cnt[j])%hell;
		}
		cnt[i]=(cnt[i]-t2+hell)%hell;
	}
	rep(i,1,k+1){
		ans=(ans+(i*cnt[i])%hell)%hell;
	}
	cout << ans << endl;
}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int tests=1;
	//cin>>tests;
	while(tests--)
	{
		solve();
	}
}

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

bool check(char a){
    if(a == 'A'||a == 'C'||a == 'T'||a == 'G'){
        return true;
    }else{
        return false;
    }
}

int main(){
    string S;
    cin >> S;
    int ans = 0;
    for(int i=0;i<S.size();i++){
        if(check(S.at(i))){
            if(i==S.size()-1) ans = max(ans,1);
            for(int j=i+1;j<S.size();j++){
                if(!check(S.at(j))) break;
                ans = max(ans, j-i+1);
            }
        }
    }
    cout << ans <<endl;
    return 0;
}

Measured memory_bytes: 3512
#include<iostream>
#include<algorithm>
#include<string>
#include<cstdlib>
#include<map>
#include<iomanip>
#include<sstream>
#include<vector>
#include<stack>
#include<math.h>
#include<queue>
#include<complex>
#include<random>
#include<ctime>
using namespace std;



const long long int mod=1000000007;
const long long int INF=99999999999999999;

long long int m,res=0,a[200005],d[200005],c[200005],sum=0;
bool atta;
string str[305];

int main() {
	cout << fixed << setprecision(10);
    cin>>m;
    for(int i=0;i<m;i++){
        cin>>d[i]>>c[i];
        res+=d[i]*c[i];
        sum+=c[i];
    }
    if(res<10){
        cout<<sum-1<<endl;
    }else{cout<<sum+(res-10)/9;}
} 


Measured memory_bytes: 4352
import std.stdio;

const int Y = 5001;

int[5][Y+1] board;
int n, d, p, q, count, height;

void main(){
	while (readf("%d\n", &n), n) {
		foreach (i; 0..Y) board[i] = 0;
		board[Y] = 1;
		foreach (i; 0..n) {
			readf("%d %d %d\n", &d, &p, &q);
			q--;
			if (d == 1) putH();
			else putV();
			del(Y-1);
		}
		count = 0;
		foreach (y; 0..Y)
			foreach (x; 0..5)
				if(board[y][x]) count++;
		writeln(count);
	}
}

void putH(){
	int t = 0;
	bool f;
	while (1) {
		f = false;
		foreach (i; 0..p) 
			if (board[t][i+q]) f = true;
		if(f) break;
		t++;
	}
	foreach (i; 0..p) board[t-1][i+q] = 1;
}

void putV(){
	int t = 0;
	while (!board[t][q]) t++;
	foreach (i; 0..p) board[t-i-1][q] = 1;
}

void del(int h){
	if (h < 0) return;
	int sum = 0;
	foreach(i; board[h]) sum += i;
	if (sum == 0) return;
	if (sum == 5) {
		for (int y = h; y > 0; y--) {
			sum = 0;
			foreach(i; board[h]) sum += i;
			if (!sum) break;
			board[y] = board[y-1];
		}
		h++;
	}
	del(h-1);
}

Measured memory_bytes: 1800
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int64_t x, k, d; cin >> x >> k >> d;
  if (x<0){x=-x;} 
  
  if (x > d){
    int64_t n = x/d;
    
    if (n>=k){
    x=x-d*k;
    cout << x << endl;
    }
    else {
      x=x%(n*d);
      if((k-n)%2==1){
        x=x-d;
        cout << -x << endl;
      }
      else {
        cout << x << endl;
      }
    }
  }
    
  else if (x == d){
    if (k%2==1){cout << 0 << endl;}
    else {cout << x << endl;}
  }
    
  else {
    if (k%2==1){
    x=x-d;
    cout << -x << endl;
    }
    else {
      cout << x << endl;
    }
  }
}

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

int main(){
  int n;
  cin >> n;
  vector<int> x(n),a(n);
  for(int i = 0;i < n;i++){
    cin >> x.at(i);
    a.at(i) = x.at(i);
  }
  sort(a.begin(),a.end());
  int left = a.at(n/2 - 1),right = a.at(n/2);
  for(int i = 0;i < n;i++){
    if(x.at(i) <= left){
      cout << right << endl;
    }
    else{
      cout << left << endl;
    }
  }
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}
std::vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend
#define all(x) (x).begin(),(x).end()
#define size_t ll
const int mod = 1000000007;
int N,T,c,t,minc=100000;bool a=false;
int main(){
  cin >> N >> T;
  for (size_t i = 0; i < N; i++) {
    cin >> c >> t;
    if(T >= t){
      a=true;
      if(minc > c){
        minc = c;
      }
    }
  }
  if(a){
    cout << minc << endl;
  }else{
    cout << "TLE" << endl;
  }
}


Measured memory_bytes: 256
import sys
 
 
def solve(A: int, B: int, C: int, K: int):
    if (K <= A):
        print(K)
    else:
        if (K <= (A+B)):
            print(A)
        else:
            print(A-(K-A-B))
    return
 
 
# 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)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    solve(A, B, C, K)
 
if __name__ == '__main__':
    main()

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

map<int, int> H;

int main() {
	
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	
	int n; cin >> n;
	for (int i = 0; i < n; i++) {
		int u; cin >> u;
		H[u]++;
	}
	int m; cin >> m;
	for (int i = 0; i < m; i++) {
		int u; cin >> u;
		if (H.count(u) && H[u] > 0) H[u]--;
		else {
			cout << "NO\n";
			return 0;
		}
	}
	cout << "YES\n";
	
	return 0;
}


Measured memory_bytes: 12960
#include <iostream>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <cstring>
#include <iomanip>

using namespace std;
// ascending order
#define vsort(v) sort(v.begin(), v.end())
// descending order
#define vsort_r(v) sort(v.begin(), v.end(), greater<int>())
#define vunique(v) unique(v.begin(), v.end())
#define mp make_pair
#define ts(x) to_string(x)
#define rep(i, a, b) for(int i = (int)a; i < (int)b; i++)
#define repm(i, a, b) for(int i = (int)a; i > (int)b; i--)
#define bit(a) bitset<8>(a)
#define des_priority_queue priority_queue<int, vector<int>, greater<int> >
#define all(v) (v).begin(), (v).end()
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1ll << 60;

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}

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

    ll a, b, c;
    cin >> a >> b >> c;

    //if(abs(a - b) % 2 == 0 and abs(b - c) % 2 == 0 and abs(c - a) % 2 == 0) {
    if(a % 2 != 0 or b % 2 != 0 or c % 2 != 0) {
        cout << 0 << endl;
        return 0;
    }
    if(a == b and b == c) {
        cout << -1 << endl;
        return 0;
    }

    ll rsl = 1;
    bool flag = true;
    ll tmp_a = a, tmp_b = b, tmp_c = c;
    while(true) {
        if(flag) {
            tmp_a = (2 * rsl * (a + b + c) - 2 * a - b - c) / pow(2, 2 * rsl - 1);
            tmp_b = (2 * rsl * (a + b + c) - 2 * b - a - c) / pow(2, 2 * rsl - 1);
            tmp_c = (2 * rsl * (a + b + c) - 2 * c - a - b) / pow(2, 2 * rsl - 1);
            if(tmp_a % 2 != 0 or tmp_b % 2 != 0 or tmp_c % 2 != 0) {
                cout << 2 * rsl - 1 << endl;
                return 0;
            }
            flag = false;
        } else {
            ll m = rsl;
            tmp_a = (4 * m * (a + b + c) - 2 * a - 3 * b - 3 * c) / pow(2, 2 * m);
            tmp_b = (4 * m * (a + b + c) - 2 * b - 3 * a - 3 * c) / pow(2, 2 * m);
            tmp_c = (4 * m * (a + b + c) - 2 * c - 3 * a - 3 * b) / pow(2, 2 * m);
            if(tmp_a % 2 != 0 or tmp_b % 2 != 0 or tmp_c % 2 != 0) {
                cout << 2 * rsl << endl;
                return 0;
            }
            flag = true;
            rsl++;
        }
    }

}


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

int main(void){
    int a, b, c;
    cin >> a >> b >> c;
    
    int cnt = 0;
    cnt += (a % 2 + b % 2 + c % 2) % 3;
    a = a / 2 * 2;
    b = b / 2 * 2;
    c = c / 2 * 2;
    
    cnt += (max({a, b, c}) * 3 - (a + b + c)) / 2;
    
    cout << cnt << endl;
    
    return 0;
}


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

using namespace std;

#define MOD 1000000007

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

int d[100000 * 3];

int main() {
	int x, y, z;
	cin >> x >> y >> z;
	int sum = z * 100 + y * 10 + z;
	if (0 == sum % 4)cout << "YES" << endl;
	else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;

typedef long long ll;
#define READ(a) int a; cin >> a;
#define READARR(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define READMAT(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e15;
const ll mod = 1e9 + 7;

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	READ(n);
	READ(m);
	n = (1 << n) - 1;
	int dp[n + 1][m + 1] = {}, c[m + 1], b[m + 1] = {};
	
	FOR (i, 1, m)
	{
	    int x, y;
	    cin >> c[i] >> x;
	    FOR (j, 1, x) 
	    {
	        cin >> y;
	        b[i] += (1 << (--y));
	    }
	}
	
	FOR (i, 1, n) dp[i][0] = inf;
	
	FOR (j, 1, m)
	    FOR (i, 0, n)
	        dp[i][j] = min(dp[i][j - 1], dp[(b[j] & i) ^ i][j - 1] + c[j]);

	if (dp[n][m] < inf) cout << dp[n][m];
	else cout << -1;
}

Measured memory_bytes: 32256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
////////////////////////////



int main(){fastio
    ll n,m;cin>>n>>m;
    ll a[n];rep(i,0,n-1)cin>>a[i];
    sort(a,a+n);
    ll ok=0,ng=inf;
    while(abs(ok-ng)>1){
        ll mid=(ok+ng)/2;
        ll cou=0;
        rep(i,0,n-1){
            ll p=lower_bound(a,a+n,mid-a[i])-a;
            cou+=n-p;
        }
        if(cou>=m)ok=mid;
        else ng=mid;
    }
    ll sum[n+1];sum[n]=0;
    for(ll i=n-1;i>=0;i--)sum[i]=sum[i+1]+a[i];
    ll ans=0;
    ll count=0;
    //cout<<ok<<endl;
    for(ll i=n-1;i>=0;i--){
        ll p=lower_bound(a,a+n,ok+1-a[i])-a;
        //cout<<p<<" "<<count<<endl;
        
        if(count+n-p<=m){
            ans+=sum[p]+(n-p)*a[i];
            count+=n-p;
        }
    }
    ans+=(m-count)*ok;
    cout<<ans<<endl;
    
    
    return 0;
}
/*
 
 3 6
 100 1 1
 */


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define rep(i, n) for (int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
 
int main(void){
    int l, r, d;
    cin>>l>>r>>d;
    int ans = 0;
    for(int i = l;i<=r;i++){
        if(i%d == 0) ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3632
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int (i)=(int)(m);(i)<(int)(n);++(i))
#define rREP(i,m,n) for(int (i)=(n)-1;(i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;

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;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) :x((x% mod + mod) % mod) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

int main() {
	init();

	ll N, K; cin >> N >> K;
    mint ans = 0;
    rep(i, K, N + 2) {
        ll mx = ((ll)i * (2 * N - i + 1)) / 2;
        ll mn = ((ll)i * (i - 1)) / 2;
        ans += mx - mn + 1;
	}
    cout << ans.x << "\n";

	return 0;
}

Measured memory_bytes: 3620
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<queue>
#include<string>
#include<set>
#include<utility>
#include<vector>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i=0; i<n; i++)
#define per(i, n) for(int i=n-1; i>=0; i--)
#define reps(i, n) for(int i=1; i<n; i++)
#define pers(i, n)  for(int i=n-1; i>=1; i--)

const int INF = 1001001001;

void solve(){
  int n;  cin >> n;
  string s, sl="", sr=""; cin >> s;
  int cnt=0, scnt=0;;
  for(int i=0; i<n; ++i){
    if(s[i]=='(') cnt++;
    else {
      if(cnt>0)  {
        cnt--;
        scnt++;
      }
    }
  }
  rep(i, n-cnt-scnt*2) sl+="(";

  cnt=0, scnt=0;;
  for(int i=n-1; i>=0; --i){
    if(s[i]==')') cnt++;
    else {
      if(cnt>0)  {
        cnt--;
        scnt++;
      }
    }
  }
  rep(i, n-cnt-scnt*2) sr+=")";
  cout << sl << s << sr << endl;
}

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


Measured memory_bytes: 256
I, O, T, J, L, S, Z = map(int, input().split())

width = 0


if L % 2 + J % 2 + I % 2 >= 2 and L*J*I > 0:
    width += 6
    L -= 1
    J -= 1
    I -= 1

width += O * 2

width += I // 2 * 4
I %= 2

width += L // 2 * 4
L %= 2

width += J // 2 * 4
J %= 2


print(width // 2)

Measured memory_bytes: 61916
import math
a,b,h,m=map(int,input().split())
kak=abs(6*m-(h+m/60)*30)
#print(kak)
kakok=math.radians(kak)
#print(kakok)
ans=(a**2+b**2-2*a*b*math.cos(kakok))**0.5
print(ans)

Measured memory_bytes: 9492
#include <bits/stdc++.h>
#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 all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define bit(n) (1<<(n))
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template < typename T > string tost( const T& n ) { ostringstream stm; stm << n; return stm.str();}
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;}
int const INF = 1001001001;

bool kaibun (string s) {
    string rs = s;
    reverse(rs.begin(), rs.end());
    if(s == rs) return true;
    else return false;
}

int main()
{
cin.tie(0);
ios::sync_with_stdio(false);
string s;
cin >> s;
int n = SZ(s);
string t = s.substr(0, (n-1)/2), u = s.substr((n+1)/2);
if(kaibun(s) && kaibun(t) && kaibun(u)) cout << "Yes" << endl;
else cout << "No" << endl;
return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

void swap(char *a,char *b);

int main(void){
  char str[128];
  unsigned short n,*a,*b,dif;
  int i,j,k;
  int len;

  while(scanf("%hu%*c",&n) && n){
    scanf("%s%*c",str);
    a=(unsigned short *)calloc(n,sizeof(unsigned short));
    b=(unsigned short *)calloc(n,sizeof(unsigned short));
    for(i=0;i<n;i++){
      scanf("%hu %hu%*c",a+i,b+i);
      (*(a+i))--;
      (*(b+i))--;
    }
    for(i=n-1;i>=0;i--){
      dif=*(b+i)-*(a+i);
      str[*(a+i)]=((str[*(a+i)]-'a')+dif)%26+'a';
      str[*(b+i)]=((str[*(b+i)]-'a')+dif)%26+'a';
      swap(str+*(a+i),str+*(b+i));
    }
    puts(str);
    free(a);
    free(b);
  }
  return 0;
}

void swap(char *a,char *b){
  char tmp;
  tmp=*a;
  *a=*b;
  *b=tmp;
}

Measured memory_bytes: 0
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<functional>
#include <random>
#include<iostream>
#include<iomanip>
using namespace std;



int main() {
	string S;

	cin >> S;

	char prev = S[0];
	bool skip = false;
	int ans = S.length();
	for (int i = 1; i < S.length(); i++) {
		if (!skip) {
			if (S[i] == prev) {
				ans--;
				skip = true;
			}
			prev = S[i];
		}else {
			skip = false;
			prev = '0';
		}

	}
	cout << ans;
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <map>
#include <numeric>
#include <set>
#include <iomanip>
#include <functional>
#define FOR(i, a, n) for (long long i = (a); i < (n); i++)
#define REP(i, n) for(long long i = 0; i < (n); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
using namespace std;

typedef long long ll;

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

	ll a, b;

	cin >> a >> b;

	if (a == 1 || b == 1) {
		cout << 1 << endl;
		return 0;
	}

	ll c = a * b;

	if (c % 2 == 0) {
		a = c / 2;
	}
	else
	{
		a = (c + (2 - 1)) / 2;
	}

	cout << a << endl;

	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
const int Mod=998244353;
long long fac[300005],inv[300005];
long long quipow(long long x,long long n)  
{
    long long res=1;
    while(n>0)
    {
        if(n&1) res=res*x%Mod;
        x=x*x%Mod;
        n>>=1;
    }
    return res;
}
int main()
{
	int n;long long k,A,B,ans=0;
	fac[0]=fac[1]=1;
	for(int i=2;i<=300000;i++)fac[i]=fac[i-1]*i%Mod;
	inv[300000]=quipow(fac[300000],Mod-2);
	for(int i=299999;i>=0;i--)inv[i]=inv[i+1]*(i+1)%Mod;
	scanf("%d%lld%lld%lld",&n,&A,&B,&k);
	for(int i=0;i<=n&&i*A<=k;i++)
	{
		if((k-i*A)%B) continue;
		int j=(int)((k-i*A)/B);
		if(j>n) continue;
		ans=(ans+1ll*fac[n]*fac[n]%Mod*inv[i]%Mod*inv[j]%Mod*inv[n-i]%Mod*inv[n-j]%Mod)%Mod;
	}
	printf("%lld",ans);
}


Measured memory_bytes: 4864
(n,m),*a=[map(int,t.split())for t in open(0)]
p=[-1]*-~n
for a in a:
 a,b=sorted(map(r:=lambda x:x*(p[x]<0)or r(p[x]),a),key=p.__getitem__)
 if a-b:p[a]+=p[b];p[b]=a
print(sum(i<0for i in p)-2)

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull; 
typedef vector<int> vi;
typedef pair<int,int> pi;

#define F first
#define S second
#define PB push_back
#define MP make_pair
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define SQ(a) (a)*(a)

template <class T, class U> ostream& operator<< (ostream &out, pair<T,U> c) { out << "(" << c.first << " "; out << c.second << ")"; return out; }
template <class T> ostream& operator<< (ostream &out, vector<T> c) { for (auto it = c.begin(); it != c.end(); ++it) { if (it != c.begin()) out << " "; out << *it; } return out; }
template <class T> ostream& operator<< (ostream &out, set<T> c) { for (auto it = c.begin(); it != c.end(); ++it) { if (it != c.begin()) out << " "; out << *it; } return out; }
const double PI  = 3.141592653589793238463;


int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n, r = 2, l = 2;
    cin >> n;
    if(n == 1){
        cout << 1;
    }
    else
    {
        while(r <= n){
            l = r;
            r *= 2;
        }
        cout << l;
    }
    cout << endl;
}

Measured memory_bytes: 256
X= int(input())
if(X>=400 and X<=599):
	print(8)
elif(X>599 and X<800):
    print(7)
elif(X>=800 and X<1000):
    print(6)
elif(X>=1000 and X<1200):
    print(5)
elif(X>=1200 and X<1400):
    print(4)
elif(X>=1400 and X<1600):
    print(3)
elif(X>=1600 and X<1800):
    print(2)
elif(X>=1800 and X<2000):
    print(1)

Measured memory_bytes: 9132
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
int main(){
    char a[105];
    cin>>a;
    bool flag=false;
	int l1=strlen(a);  
    for(int i=0;i<l1;i++)
	{
        if(a[i]=='C')
		{
            flag=true;
        }
        if(a[i]=='F'&&flag==true)
		{
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>

int main() {
  	int a,b,c; std::cin >> a >> b >> c;
    
    if(a == b && c != b || a == c && b != c || b == c && a != c) std::printf("Yes");
    else std::printf("No");

	return 0;
}


Measured memory_bytes: 256
s = gets.chomp.split("")

cnt = 0
cntmax = 0
s.each do |si|
  if si == "A" || si == "C" || si == "G" || si == "T"
    cnt += 1
    if cntmax < cnt
      cntmax = cnt
    end
  else
    cnt = 0
  end
end
puts cntmax

Measured memory_bytes: 3836
#include <stdio.h>
#define max(p,q)((p)>(q)?(p):(q))

int a[200010];
int cum[200010];
int main(){
	int n,k;
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++)scanf("%d",a+i);
	for(int i=0;i<n;i++)cum[i+1]=cum[i]+a[i];
	int ans=0;
	for(int i=k;i<=n;i++)ans=max(ans,cum[i]-cum[i-k]);
	printf("%.10f",(ans+k)/2.0);
}

Measured memory_bytes: 3272
#include <fstream>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <sstream>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <cmath>
#include <queue>
#include <random>

using namespace std;

#define INT_MAX_VALUE 2147483647
#define LONG_LONG_MAX_VALUE 9223372036854775807
#define ll long long

struct XX{
    string name;
    ll v;
    ll cnt1;
    ll cnt2;
    ll cnt3;
    ll ten;
    ll q;
};

class xxGreater {
public:
    bool operator()(const XX& riLeft, const XX& riRight) const {
        //第2条件
        if((riLeft.q) == (riRight.q)){
            return riLeft.q < riRight.q;//<:昇順(小さいものから順番)、>:降順(大きいものから順番)
            //プライオリティキューの場合は > で、top()すると値の小さいものがとれる
        }
        //第1条件
        return (riLeft.q) < (riRight.q);
    }
};


//map<long long,long long> prime_f(long long n){
//    map<long long,long long>res;
//    for(int i=2;i*i<=n;i++){
//        while(n%i==0){
//            ++res[i];
//            n/=i;
//        }
//    }
//    if(n!=1)res[n]=1;
//    return res;
//}



int main(int argc, const char * argv[])
{
    //scanf("%s",S);
    //scanf("%d",&N);
    //scanf("%lld %lld",&target1,&target2);
    //sscanf(tmp.c_str(),"%dd%d%d",&time[i], &dice[i], &z[i]);
    //getline(cin, target);
    //ifstream ifs( "1_06.txt" );//テスト用
    //ifs >> a;
    //ここから
    
    //入力高速化
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string S;
    cin >> S;
    int a[26];
    for(int i=0;i<26;i++){
        a[i]=0;
    }
    for(int i=0;i<S.size();i++){
        a[*S.substr(i,1).c_str()-'a']=1;
    }
    string tmp="";
    for(int i=0;i<26;i++){
        if(a[i]==0){
            tmp='a'+i;
            break;
        }
    }
    if(tmp==""){
        for(int i=0;i<26;i++){
            a[i]=0;
        }
        a[*S.substr(25,1).c_str()-'a']=1;
        for(int i=1;i<26;i++){
            int index=*S.substr(25-i,1).c_str()-'a';
            for(int j=index+1;j<26;j++){
                if(a[j]==1){
                    string tmpp="";
                    tmpp='a'+j;
                    cout << S.substr(0,25-i)+ tmpp<< endl;
                    return 0;
                }
            }
            a[index]=1;
        }
        cout << "-1" << endl;
        return 0;
    }else{
        cout << S+tmp << endl;
    }

    //ここまで
    //cout << "ans" << endl;改行含む
    //printf("%.0f\n",ans);//小数点以下表示なし
    //printf("%.7f\n",p);
    
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <queue>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <bitset>
#include <set>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define RREP(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define all(i,n) (i),(i+n)

int dx4[4]={1,0,-1,0};
int dy4[4]={0,-1,0,1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

typedef pair<int, int> P;
typedef pair<string, int> SP;
typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const int MAX_V = 1e6+1;
const ll mod = 1000000007;

// --------------------------------------
int h, n;
int a[1005], b[1005];
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);

  cin >> h >> n;
  int ma = 0;
  REP(i, n) {
    cin >> a[i] >> b[i];
    ma = max(ma, b[i]);
  }
  int dp[n + 1][h + ma + 1];

  REP(i, n + 1) REP(j, h + ma + 1) dp[i][j] = INF;
  REP(i, n + 1) dp[i][0] = 0;

  REP(i, n) {
    FOR(j, 1, h + ma) {
      dp[i + 1][j] = min(dp[i][j], dp[i + 1][max(0, j - a[i])] + b[i]);
    }
  }

  int ans = INF;
  FOR(i, h, h + ma) {
    ans = min(ans, dp[n][i]);
  }

  cout << ans << endl;
}


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

using namespace std;

int a[100007];

int main(){
    int n, k, q;
    cin >> n >> k >> q;
    if(k - q > 0){
        for (int i = 0; i < n; ++i)
            cout << "Yes\n";
        return 0;
    }
    for (int i = 0; i < n; ++i){
        a[i] = k - q;
    }
    for (int i = 0; i < q; ++i){
        int q;
        cin >> q;
        q--;
        a[q] ++;
    }
    for (int i = 0; i < n; ++i){
        if(a[i] > 0)
            cout << "Yes";
        else
            cout << "No";
        cout << "\n";
    }

}


Measured memory_bytes: 896
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))

ans = 0

for i in range(n):
    ans += b[a[i]-1]
    if i < n-1: 
        if a[i+1] - a[i] ==1:
            ans += c[a[i]-1]    
print(ans)

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

#define int long long
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep1(i,n) for(int i=1;i<=(int)(n);++i)
#define rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end())
#define vdelete(v) (v).erase(unique(all(v)), (v).end())
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF LONG_LONG_MAX

long double a,b,x;

signed main() {
    cin >> a >> b >> x;
    if (x < a*a*b/2) {
        long double A = (2*x)/(a*b);
        cout << setprecision(20) << atan(b/A)*180/M_PI << endl;
    }
    else {
        x = a*a*b - x;
        long double B = (2*x)/(a*a);
        cout << setprecision(20) << atan(B/a)*180/M_PI << endl;
    }
}





Measured memory_bytes: 256
h , w = map(int, input().split())


if h == 1 or w ==1:
	print(1)
	exit()
elif w % 2 == 0:
	print(h * w // 2)
	exit()
elif w % 2 == 1:
	if h % 2 == 0:
		print(h * w // 2)
		exit()
	elif h % 2 == 1:
		print((h * w // 2) + 1)
		exit()

Measured memory_bytes: 3060
#include<stdio.h>
#include<string.h>

#define M 1046527
#define NIL -1
#define L 14

char A[M][L];

//???????????????????????°??????
int getChar(char c){
  if(c == 'A') return 1;
  else if(c == 'C') return 2;
  else if(c == 'G') return 3;
  else if(c == 'T') return 4;
}

//key?????????
long long getKey(char str[]){
  long long sum=0,p=1,i;
  for(i=0 ; i<strlen(str) ;i++){
    sum += p*(getChar(str[i]));
    p *= 5;
  }
  return sum;
}

int h1(int key){
   return key % M;
}

int h2(int key){
   return 1 + (key%(M-1));
}

int find(char str[]){
  long long key,i,h;
  key = getKey(str); //??????????????°???
  for(i=0 ; ; i++){
    h = (h1(key) + i*h2(key)) % M;
    if(strcmp(A[h],str) == 0) return 1;
    else if(strlen(A[h]) == 0) return 0;
  }
  return 0;
}

int insert(char str[]){
  long long key,i,h;
  key = getKey(str);
  for(i=0 ; ; i++){
    h = (h1(key) + i*h2(key)) % M;
    if(strcmp(A[h],str) == 0) return 1;
    else if(strlen(A[h]) == 0){
      strcpy(A[h], str);
      return 0;
    }
  }
  return 0;
}

int main(){
  int i,n,h;
  char str[L], com[9];

  scanf("%d", &n);
  for (i=0 ; i<n ; i++) A[i][0] = '\0';

  for (i=0 ; i<n ; i++){
    scanf("%s %s",com,str);

    if (com[0] == 'i'){
      insert(str);
    }
    else {
      if(find(str)){
        printf("yes\n");
      }
      else {
        printf("no\n");
      }
    }
  }

  return 0;
}

Measured memory_bytes: 14916
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int h = scan.nextInt();
			int m = scan.nextInt();
			int s = scan.nextInt();
			h = scan.nextInt() - h;
			m = scan.nextInt() - m;
			s = scan.nextInt() - s;
			while(h < 0 || m < 0 || s < 0){
				if(s < 0){
					m -= 1;
					s += 60;
				}
				if(m < 0){
					h -= 1;
					m += 60;
				}
			}
			System.out.println(h + " " + m + " " + s);
		}
	}
}

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

public class Main {
    static Scanner sc= new Scanner(System.in);
    public static void main(String[] args){
        while(sc.hasNext()){
            run();
        }
    }
    static void run(){
        String[] A=sc.nextLine().split(" ");
        String[] B=sc.nextLine().split(" ");
        int Hit=0;
        int Blow=0;
        for(int i=0;i<4;i++){
            if(A[i].equals(B[i])){
                Hit++;
            }
            if(Arrays.asList(A).contains(B[i])){
                Blow++;
            }
        }
        Blow-=Hit;
        System.out.println(Hit+" "+Blow);
        
    }
}

Measured memory_bytes: 17176
using System;
using System.Linq;

namespace Search
{
    class Binary_Search
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var S = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            Console.ReadLine();
            var T = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

            var C = Count(S, T);
            Console.WriteLine(C);
        }

        public static int Count(int[] S, int[] T)
        {
            var c = 0;
            var Smax = S.Last();
            var Smin = S[0];
            var Tmax = T.Max();
            var Tmin = T.Min();
            if (Smax < Tmin || Tmax < Smin)
                return 0;
            else
            {
                for (int i = 0; i < T.Length; i++)
                {
                    var left = 0;
                    var right = S.Length - 1;
                    while (left <= right)
                    {
                        var mid = left + (right - left) / 2;
                        if (S[mid] == T[i]) { c++; break; }
                        if (S[mid] < T[i]) left = mid + 1;
                        else right = mid - 1;
                    }
                }
            }
            return c;

        }
    }
}

Measured memory_bytes: 22908
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main()
{
    ll n,k;
    cin>>n>>k;
    ll c1=0;
    for(ll i=0;i<n;i++)
    {
        ll a;
        cin>>a;
        if(a>=k)
            c1++;
    }
    cout<<c1<<endl;
    return 0;
}


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

int main() {
	// your code goes here
	int a,b,c;
	cin>>a>>b>>c;
	if(a<b && b<c){
		cout << "Yes" << endl;
		}else {
			cout << "No" << endl;
		}
		
	return 0;
}

Measured memory_bytes: 1156
#include <iostream>
#include <bits/stdc++.h>
#define loop(i,N) for(int i=0;i<N;i++)
#define vi vector<int>
#define vs vector<string>
#define vl vector<long long int>
#define vpi vector<pair<int,int>>
#define msi map<string,int>
#define mil map<int,long long int>
#define lli long long int

using namespace std ;

int main()
{
    string s;
    cin>>s;
    string t="AKIHABARA";
    bool found = true;
    if(s.size()>t.size()){
        found = false;
    }else{
        int i=0;

        loop(j,t.size()){
            if(s[i]==t[j]){
                i++;
            }else if(t[j]!='A'){
                found = false;
                break;
            }
        }
        if(i!=s.size()){
                found = false;
        }

    }

    cout << (found?"YES":"NO")<<endl;
    return 0;
}



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

using namespace std;
typedef long long ll;

int main() {
    string s;
    cin >> s;
    int cnt = 0;
    for (int i = 0; i < 3; i++) {
        if (s[i] == 'R') cnt++;
    }
    if (cnt == 2 && s[1] == 'S') cnt = 1;
    cout << cnt << "\n";
}


Measured memory_bytes: 3620
#include <iostream>
#include <string>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <cmath>
#include <cstdlib>
#include <queue>
#include <stack>
#include <iomanip>

using namespace std;

#define REP(i, n) for(ll i = 0;i < n;i++)
#define REPR(i, n) for(ll i = n;i >= 0;i--)
#define FOR(i, m, n) for(ll i = m;i < n;i++)
#define FORR(i, m, n) for(ll i = m;i >= n;i--)
#define REPO(i, n) for(ll i = 1;i <= n;i++)
#define ll long long
#define INF (ll)1 << 60
#define MINF (-1 * INF)
#define ALL(n) n.begin(),n.end()
#define MOD (ll)1000000007
#define P pair<ll, ll>



ll n, m;
vector<ll> ans;
int main() {
	cin >> n >> m;
	if (n == 1 and m == 1) {
		cout << "-1" << endl;
		return 0;
	}
	if (n == 1 and m == 0) {
		cout << "0 0 1 1" << endl;
		return 0;
	}
	ll a = pow(2, n);
	if(a <= m) {
		cout << "-1" << endl;
		return 0;
	}
	REPR(i, pow(2, n) - 1) {
		if (i != m)ans.push_back(i);
	}
	ans.push_back(m);
	REP(i, pow(2, n)){
		if (i != m)ans.push_back(i);
	}
	ans.push_back(m);
	REP(i, ans.size()) {
		if (i != 0)cout << " ";
		cout << ans[i];
	}
	cout << endl;
}

Measured memory_bytes: 3952
//edpc_f.cpp
//Sat Jan 12 16:27:42 2019

#include <iostream>
#include <string>
#include <queue>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

int main(){
	string s,t;
	cin >> s >> t;

	int dp[s.length()+1][t.length()+1];
	fill(dp[0],dp[0]+t.length()+1,0);

	for (int i=1;i<s.length()+1;i++){
		dp[i][0] = 0;
		for (int j=1;j<t.length()+1;j++){
			if (s[i-1]==t[j-1]){
				dp[i][j] = dp[i-1][j-1]+1;
			}else{
				dp[i][j] = max(dp[i][j-1],dp[i-1][j]);
			}
		}
	}

	int x = s.length();
	int y = t.length();
	string ans = "";
	while (x>0&&y>0){
		if (dp[x][y] == dp[x-1][y]){
			x--;
		}else if (dp[x][y] == dp[x][y-1]){
			y--;
		}else {
			ans.push_back(s[x-1]);
			x--;
			y--;
		}
	}

	reverse(ans.begin(),ans.end());
	cout << ans << endl;

}

Measured memory_bytes: 35456
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
const ll MOD=1e9+7;
const int INF=1e9;
const ll LINF=(ll)1e18;

ll modpow(ll x,ll n){
    ll res=1;
    while(n>0){
        if(n&1)res=res*x%MOD;
        x=x*x%MOD;
        n>>=1;
    }
    return res;
}

struct Combination{
    vector<ll> fac,finv,inv;
    Combination(int mx){init(mx);}
    void init(int mx){
        fac.resize(mx+1);
        finv.resize(mx+1);
        inv.resize(mx+1);
        fac[0]=fac[1]=1;
        finv[0]=finv[1]=1;
        inv[1]=1;
        for(int i=2;i<=mx;i++){
            fac[i]=fac[i-1]*i%MOD;
            inv[i]=MOD-inv[MOD%i]*(MOD/i)%MOD;
            finv[i]=finv[i-1]*inv[i]%MOD;
        }
    }
    ll operator()(int n,int k){
        if(n<k)return 0;
        return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
    }
};

int main(){
    ll n,k;
    cin>>n>>k;
    ll ans[n];
    ans[0]=1;
    Combination comb(2*n);
    for(int i=1;i<=n-1;++i){
        ans[i]=(comb(n,i)*comb(2*n-1-i-n+i,i))%MOD;
        ans[i]=(ans[i]+ans[i-1])%MOD;
    }
    cout<<ans[min(k,n-1)]<<endl;
}


Measured memory_bytes: 11136
n = int(input())
s = input()
left = 0
right = n // 2 + 1
while right - left > 1:
    mid = (right + left) // 2
    length = mid
    check = set()
    for i in range(n - length + 1):
        s1 = s[i:i+length]
        check.add(s1)
        if s[i+length: i + 2*length] in check:
            left = mid
            break
    else:
        right = mid
print(left)

Measured memory_bytes: 99292
import java.util.*;

public class Main{
  public static void main(String[]args){
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.nextLine());
    String S = sc.next();
    
    int ans = 0;
    for(int i = 0; i < N; i++){
      char c = S.charAt(i);
      if(i == 0){
        ans++;
      }else{
        if(c != S.charAt(i-1)){
          ans++;
        }
      }
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 24276
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Practice
{
    class Program
    {
        static void Main(string[] args)
        {
            Solve();
        }
        private const long MOD = 1000000007;
        static void Solve()
        {
            var o = ReadAndParseIntArr();
            var list = new List<int>(o);
            list.Sort();
            bool b = list[0] == 5 && list[1] == 5 && list[2] == 7;
            string ans = b ? "YES" : "NO";
            Console.WriteLine(ans);
        }
        
        #region よく使う便利関数
        private static bool isPrime(long x)
        {
            if (x == 2) { return true; }
            if (x < 2 || x % 2 == 0) { return false; }
            long i = 3;
            while (i * i <= x)
            {
                if (x % i == 0) { return false; }
                i = i + 2;
            }
            return true;
        }
        private static long lcm(long x, long y)
        {
            return x / gcd(x, y) * y;
        }
        private static long gcd(long x, long y)
        {
            return y > 0 ? gcd(y, x % y) : x;
        }
        private static long pow(long x, long n)
        {
            if (n == 0) { return 1; }
            long res = pow(x * x % MOD, n / 2);
            if (n % 2 == 1)
            {
                res = res * x % MOD;
            }
            return res;
        }
        private static int ReadAndParseInt()
        {
            return int.Parse(Console.ReadLine());
        }
        private static int[] ReadAndParseIntArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
        }
        private static long ReadAndParseLong()
        {
            return long.Parse(Console.ReadLine());
        }
        private static long[] ReadAndParseLongArr()
        {
            return Array.ConvertAll(Console.ReadLine().Split(' '), long.Parse);
        }
        #endregion
    }
}

Measured memory_bytes: 13268
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <limits>
#include <string>
#include <bitset>
#include <functional>
#include <iomanip>

using namespace std;
using lint = long long;
using vb = vector<bool>;
using vi = vector<int>;
using vl = vector<int>;
using pii = pair<int, int>;
using pll = pair<lint, lint>;
using pqi = priority_queue<int>;
using pql = priority_queue<lint>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repr(i, n) for (int i = (n); i > 0; i--)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
#define repf(i, f, n) for (int i = (f); i < (n); i++)
#define mp(x, y) make_pair((x), (y))
#define all(x) (x).begin(), (x).end()
#define allr(x) (x).rbegin(), (x).rend()
#define foreach(it, x) for (auto it = (x).begin(); it != (x).end(); it++)
#define space (char)0x20

constexpr lint MOD = 1e9 + 7;
int A, B, C, D, E, F, G, H, I, J, K, L, M, N;
int O, P, Q, R, S, T, U, V, W, X, Y, Z;
// string s;
vi ans;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
 
	cin >> N >> X >> Y;
    X--; Y--;
    ans.assign(N, 0);
 
    rep(i, N) {
        rep(j, N) {
            int l = min(i, j);
            int r = max(i, j);
            int c1 = r - l;
            int c2 = abs(X - l) + abs(Y - r) + 1;
            ans[min(c1, c2)]++;
        }
    }
 
    rep1(i, N-1) {
        cout << ans[i] / 2 << endl;
    }
	return 0;
}

Measured memory_bytes: 256
#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()
{
    // input
    int n;
    std::cin >> n;
    vector<int> l(n);

    rep(i, n) cin >> l[i];
    int ans = 0;
    rep(i, n)rep(j, n)rep(k,n) {
        if (i < j && j < k) {
            if (l[i] == l[j]) continue;
            if (l[i] == l[k]) continue;
            if (l[k] == l[j]) continue;
            if ((ll)l[i] + l[j] + l[k] <= max({l[i], l[j], l[k]}) * 2) continue;
            ans++;
        }
    }

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

}

Measured memory_bytes: 3576
//#pragma GCC         optimize("O3")
#include            <bits/stdc++.h>
#include            <ext/pb_ds/assoc_container.hpp>
#include            <ext/pb_ds/tree_policy.hpp>
#define FastIO      ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define pb          push_back
#define mp          make_pair
#define mem(x,i)    memset(x,i,sizeof(x))
#define ff          first
#define ss          second
#define popcount(x) __builtin_popcount(x)
#define all(x)      x.begin(),x.end()
#define Case(t)     for(int ks=1;ks<=t;ks++)
#define fileout     freopen("output.txt","w",stdout)
#define filein      freopen("input.txt","r",stdin)
#define D(x)        cerr<< __LINE__ <<": "<< #x << " = "<<(x) <<'\n';
#define endl        '\n'

using namespace std;
//using namespace __gnu_pbds;

using ll  = long long;
using ld  = long double;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pil = pair<int,ll>;

const int INF    = 0x3f3f3f3f;
const ll LL_INF  = 0x3f3f3f3f3f3f3f3f;
const double PI  = acos(-1);
const double eps = 1e-4;
const int mod    = 1e9+7;
const int mx     = 300005;
/*template <typename T>  using orderedSet =
    tree<T, null_type, less_equal<T>,
    rb_tree_tag, tree_order_statistics_node_update>;//find_by_order,order_of_key*/

/*------------------------------Graph Moves----------------------------*/
//const int fx[]= {+1,-1,+0,+0};
//const int fy[]= {+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

//ll powmod(ll a,ll b){ll res=1;a%=mod;assert(b>=0);for(; b; b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
/*----------------------BitMask-----------------------------------------*/
//inline int setBit(int N,int pos){return N=N | (1<<pos);}
//inline int resetBit(int N,int pos){return N= N & ~(1<<pos);}
//inline bool checkBit(int N,int pos){return (bool) (N& (1<<pos));}

int main()
{
    int n;
    cin>>n;
    int arr[n];
    for(int i=0;i<n;i++) cin>>arr[i];
    int ans=0;
    while(1)
    {
        int mux=0;
        for(int i=0;i<n;i++) mux=max(mux,arr[i]);
        if(mux==0) break;
        int cnt=0;
        for(int i=0;i<n;i++)
        {
            if(arr[i]==mux)
            {
                while(i<n && arr[i]==mux)
                {
                    arr[i]--;
                    i++;
                }
                i--;
                cnt++;
            }
        }
        ans+=cnt;
    }
    cout<<ans;
}



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

using namespace std;
using ll=long long;
using ull=unsigned long long;
using pii=pair<int,int>;

#define INF LONG_MAX
#define MOD 1000000007
#define rng(a) a.begin(),a.end()
#define rrng(a) a.end(),a.begin()

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

  int x,A,B;
  cin>>x>>A>>B;
  int xA=abs(x-A);
  int xB=abs(x-B);
  if(xA<xB)cout<<"A"<<endl;
  else cout<<"B"<<endl;
  return 0;
}


Measured memory_bytes: 256