akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <vector>
#include <iostream>
#include <queue>
#include <bits/stdc++.h>

#define rep(i,n) for (int i=0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<ll> vl;

int main() {
    ios::sync_with_stdio(0); cin.tie(0);
    int n, m;
    cin >> n >> m;
    priority_queue <int> a;
    rep(i, n) {
        int t;
        cin >> t;
        a.push(t);
    }
    
    rep(i, m){
        int c = a.top(); a.pop();
        a.push(c / 2);
    }
    
    ll ans = 0;
    while(!a.empty()){
        ans += a.top(); a.pop();
    }
    cout << ans << endl;

}


Measured memory_bytes: 892
def main():
    n, m = (int(i) for i in input().split())
    a = [input() for i in range(n)]
    b = [input() for i in range(m)]
    
    equal_flag = False
    k = 0
    for i in range(n):
        for j in range(n-m+1):
            if a[i][j:j+m] == b[k]:
                plus = 1
                while k+plus != m:
                    if i+plus >= n or a[i+plus][j:j+m] != b[k+plus]:
                        break
                    plus += 1
                else:
                    equal_flag = True
        if equal_flag:
            print("Yes")
            break
    else:
        print("No")
 
if __name__ == '__main__':
    main()

Measured memory_bytes: 39024
// https://atcoder.jp/contests/agc002/tasks/agc002_b
#include <bits/stdc++.h>
using namespace std;
const int MxN = 1e5+10;
int ar[MxN];
bool vis[MxN];

int main() {
    int n,m,c=0;
    cin>>n>>m;
    vis[0] = 1;
    for(int i=0;i<n;i++) ar[i]=1;
    for(int i=0;i<m;i++) {
        int x,y;cin>>x>>y;
        x--;y--;
        vis[y] |= vis[x];
        ar[x]--;
        ar[y]++;
        if (ar[x]==0) vis[x] = 0;
    }
    for(int i=0;i<n;i++)
        if(vis[i])
            c++;
    cout<<c<<"\n";
}

Measured memory_bytes: 4080
#include<bits/stdc++.h>
using namespace std;
int n;
int main(){
	scanf("%d",&n);
	switch(n%10){
		case 2:case 4:case 5:case 7:case 9:puts("hon");break;
		case 0:case 1:case 6:case 8:puts("pon");break;
		case 3:puts("bon");break;
	}
}

Measured memory_bytes: 3716
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
#define dump(x)                             \
    if (dbg) {                              \
        cerr << #x << " = " << (x) << endl; \
    }
#define overload4(_1, _2, _3, _4, name, ...) name
#define FOR1(n) for (ll i = 0; i < (n); ++i)
#define FOR2(i, n) for (ll i = 0; i < (n); ++i)
#define FOR3(i, a, b) for (ll i = (a); i < (b); ++i)
#define FOR4(i, a, b, c) for (ll i = (a); i < (b); i += (c))
#define FOR(...) overload4(__VA_ARGS__, FOR4, FOR3, FOR2, FOR1)(__VA_ARGS__)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define bit(n, k) ((n >> k) & 1) /*nのk bit目*/
namespace mydef {
const int INF = 1ll << 60;
const int MOD = 1e9 + 7;
template <class T>
bool chmin(T& a, const T& b) {
    if (a > b) {
        a = b;
        return 1;
    } else
        return 0;
}
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    } else
        return 0;
}
void Yes(bool flag = true) {
    if (flag)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
}
void No(bool flag = true) {
    Yes(!flag);
}
void YES(bool flag = true) {
    if (flag)
        cout << "YES" << endl;
    else
        cout << "NO" << endl;
}
void NO(bool flag = true) {
    YES(!flag);
}
template <typename A, size_t N, typename T>
void Fill(A (&array)[N], const T& val) {
    std::fill((T*)array, (T*)(array + N), val);
}
bool dbg = false;
}  // namespace mydef
using namespace mydef;
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vp vector<pair<int, int>>
#define vvp vector<vector<pair<int, int>>>
#define pi pair<int, int>
//#define P pair<int, int>
//#define V vector<int>
//#define S set<int>
#define asn ans

int N;
string s, t;

void solve() {
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    cin >> N >> s >> t;
    int ans = N * 2;
    for (int i = 0; i <= N; i++) {
        if (t.substr(0, i) == s.substr(N - i, i))
            chmin(ans, N * 2 - i);
    }
    cout << ans << endl;

    solve();
    return 0;
}


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

int main()
{
    string s;
    int n;
    char abc [] = 
    {
        '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'
    };

    cin >> n;
    cin.ignore();
    getline(cin, s);

    for(int i = 0; i < s.size(); i++)
    {
        for(int j = 0; j < 26; j++)
        {
            if(s[i] == abc[j])
            {
                s[i] = abc[(j + n) % 26];
                break;
            }
        }
    }

    cout << s << endl;



    return 0;
}

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

using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    int n;
    cin >> n;

    int a[n+1];
    for(int i=0; i<n; i++){
        cin >> a[i];
    }

    int ans = 0, temp = 0;
    for (int i=0; i+1<n; i++){

        if (a[i+1] <= a[i])
            temp += 1;
        else
            temp = 0;

        ans = max(ans, temp);
    }

    cout << ans;
    return 0;
}


Measured memory_bytes: 640
/*
* @Author: _dp95
* @Date:   2020-04-13 06:45:19
*/
#include "bits/stdc++.h"
using namespace std ;

#define timesaver ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

typedef long long ll ;
typedef long double ldb ;

#define mp make_pair
#define pb push_back
#define F first
#define S second
#define nl '\n'

#define all( x ) x.begin(),x.end() 
#define sz( x ) ( int )( x ).size( )
#define mem( a, val ) memset(a, val, sizeof( a ) )
#define deci( x ) cout<<fixed<<setprecision( x );
#define bitcount( x ) __builtin_popcountll( x )

const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};

const int MAX = 2*1000*1000 + 10 ;
const ll INF = 1e18 ;
const int MOD = 1e9 + 7 ;

signed main( ){
  timesaver ;
  string s ;
  cin >> s ;
  for( char c : s )
    cout << (c==','?' ':c);
  cout << nl ;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <utility>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
using namespace std;
#define INF 1000000007
#define LINF 1000000000000000007
#define MOD 1000000007
#define int long long
#define rep(i, n) for (int i = 0; i < n; i++)
#define repb(i, n) for (int i = n - 1; i >= 0; i--)
#define MODE 1
#ifdef MODE
#define DEB(X) cout << #X << ": " << X << " ";
#define ARDEB(i, X) cout << #X << "[" << i << "]: " << X[i] << " ";
#define END cout << endl;
#else
#define DEB(X) \
    {          \
    }
#define ARDEB(i, X) \
    {               \
    }
#define END \
    {       \
    }
#endif
typedef pair<int, int> P;
struct edge{int to,cost;};

typedef long long ll;

int ans,ans2;
int n,a,b,v[211111];

int C[55][55];
void comb_table(int N){
	for(int i=0;i<=N;++i){
		for(int j=0;j<=i;++j){
			if(j==0 or j==i){
				C[i][j]=1LL;
			}else{
				C[i][j]=(C[i-1][j-1]+C[i-1][j]);
			}
		}
	}
}


signed main(){

	cin>>n>>a>>b;
	rep(i,n)cin>>v[i];
	sort(v,v+n,greater<>());
	double ave=0;
	int befco=0,aftco=0;
	rep(i,a)ave+=v[i];
	rep(i,n){
		if(v[a-1]==v[i]){
			if(i<a)befco++;
			else aftco++;
		}
	}
	ave/=double(a);
	printf("%.6lf \n",ave);
	//cout<<befco<<" "<<aftco<<endl;
	comb_table(n);
	if(v[0]!=v[a-1]){
		ans=C[befco+aftco][befco];
	}
	else{
		for(int i=a;i<=b;i++){
			ans+=C[befco+aftco][i];
		}
	}
	cout<<ans<<endl;
}


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

char str[101];

int seg_length(int a,int b){
	int len=0;
	while('A'<=str[a]&&str[a]<='Z'&&a<=b){
		len++;
		a++;
	}
	int n=0,t;
	while('0'<=str[a]&&str[a]<='9'&&a<=b){
		t= str[a]-'0';
		n= n*10+t;
		a++;
	}
	if(n){
		if(str[a]=='('){
			int tozi=a, level=1;
			while(level){
				tozi++;
				if(str[tozi]=='(')level++;
				else if(str[tozi]==')')level--;
			}
			len+= n*seg_length(a+1,tozi-1);
			len+= seg_length(tozi+1,b);
		}
		else{
			len+= n+ seg_length(a+1,b);
		}
	}
	if(1000000<len)len= 1000001;
	return len;
}
char search(int a,int b,int target){
	while('A'<=str[a]&&str[a]<='Z'&&a<=b){
		if(target==0)return str[a];
		target--;
		a++;
	}
	int n=0,t;
	while('0'<=str[a]&&str[a]<='9'&&a<=b){
		t= str[a]-'0';
		n= n*10+t;
		a++;
	}
	if(n){
		if(str[a]=='('){
			int tozi=a, level=1;
			while(level){
				tozi++;
				if(str[tozi]=='(')level++;
				else if(str[tozi]==')')level--;
			}
			int len= seg_length(a+1,tozi-1);
			if(target<n*len){
				return search(a+1,tozi-1, target%len);
			}
			return search(tozi+1,b, target-n*len);
		}
		else{
			if(target<n)return str[a];
			return search(a+1,b, target-n);
		}
	}
	return '0';
}
int main(){
	int index,len;
	while(cin>>str>>index, str[0]!='0'||index!=0){
		cout<<search(0,strlen(str)-1, index)<<endl;
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    string s,t;
    cin >> s >> t;
    cout << t << s << endl;


    return 0;
}

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

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

	for (long long int i=0; i<(1<<n); i++) {
		std::bitset<18> bs(i);
		if (bs.count() == k) {
			std::cout << i << ":";
			for (int j=0; j<n; j++) {
				if (bs.test(j)) std::cout << " " << j;
			}
			std::cout << std::endl;
		}
	}
	
	return 0;
}



Measured memory_bytes: 3100
import java.util.*;
import java.io.*;

class Main {

	Scanner in;
	PrintWriter out;

	int[] hh;
	int[] cc;

	public static void main(String... args) {
		new Main().solve();
	}

	void solve() {
		in = new Scanner(new InputStreamReader(System.in));
		// out = new PrintWriter(System.out);

		int n = in.nextInt();
		hh = new int[n];
		cc = new int[n];
		Arrays.fill(cc, -1);

		for (int i = 0; i < n; ++i) {
			hh[i] = in.nextInt();
		}

		System.out.println(calc_cost2());
	}

	int calc_cost2() {
		int len = hh.length;
		cc[len-1] = 0;
		cc[len-2] = Math.abs(hh[len-1]-hh[len-2]);
		for (int i = len-3; i >= 0; --i) {
			cc[i] = Math.min(cc[i+1]+Math.abs(hh[i]-hh[i+1]),
							 cc[i+2]+Math.abs(hh[i]-hh[i+2]));
		}

		return cc[0];
	}

	int calc_cost(int i, int cost) {
		int len = hh.length;
		if (i == len - 1) return cost;
		if (i == len - 2)
			cc[i] = cost + Math.abs(hh[i] - hh[len-1]);
		else
			cc[i] = Math.min(calc_cost(i+1, cost + Math.abs(hh[i]-hh[i+1])),
						calc_cost(i+2, cost + Math.abs(hh[i]-hh[i+2])));
		return cc[i];
	}
}


Measured memory_bytes: 64020
n = int(input())
a = list(map(int, input().split()))

tmp = []
from collections import Counter
c = Counter(a)
for k in c.keys():
    if c[k] >= 2:
        tmp.append(k)
    if c[k] >= 4:
        tmp.append(k)

tmp.sort()

if len(tmp) >= 2:
    print(tmp[-1] * tmp[-2])
else:
    print(0)


Measured memory_bytes: 18316
import java.util.*;

class Main {
	public static void main(String args[]) {
		
		Scanner sc = new Scanner(System.in);
		int K = Integer.parseInt(sc.next());
		int X = Integer.parseInt(sc.next());
		
      	int k = K - 1;
      
      	for(int i = X - k;i<=X+k;i++) {
			System.out.println(i);
        }
	}
}


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

int main()
{
  int N, A = 0, B = 0;
  int Card[100];
  cin >> N;
  for (int i = 0; i < N; i++)
    cin >> Card[i];

  sort(Card, Card + N, greater<int>());

  for (int i = 0; i < N; i++)
    (i % 2 == 0) ? A += Card[i] : B += Card[i];
    
  cout << A - B << endl;
  return 0;
}

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

int main(){
  char s[2];
  for(int i=0; i<3; i++)
  {
    cin >>s[i];
  }
  if(s[0]==s[1] && s[1]==s[2]){cout <<"No";}
  else{cout <<"Yes";}
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#define MAX 1100
using namespace std;


int main(){
    int N,X,m,minn=120000;
    scanf("%d%d",&N,&X);
    for(int i=1;i<=N;i++){
        scanf("%d",&m);
        X-=m;
        minn=min(m,minn);
    }
    N+=X/minn;
    printf("%d\n",N);
    return 0;
}


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

ll dp[105][100005];
int main(){
    int N,W;cin>>N>>W;
    ll val[N+1][2];
    for(int i=1;i<=N;i++)cin>>val[i][0]>>val[i][1];
    for(int i=1;i<=N;i++){
        for(int j=1;j<=W;j++){
            if(j<val[i][0])dp[i][j]=dp[i-1][j];
            else dp[i][j]=max(dp[i-1][j],dp[i-1][j-val[i][0]]+val[i][1]);
        }
    }
    cout<<dp[N][W]<<endl;

    return 0;
}

Measured memory_bytes: 79360
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i,n) for(int i=0;i<(n);++i)
#define ll long long
const long long INF = 1LL<<60;
const long long mod = 100000007;
using Graph = vector<vector<int>>;

int main(){
    string S;
    cin >> S;
    bool bus = true;
    if(S=="AAA"||S=="BBB") bus = false;
    if(bus) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3640
#include<iostream>

using namespace std;

int main(){
  int a,b,c,d;
  int l,r;
  
  cin>>a>>b>>c>>d;
  
  l=a+b;
  r=c+d;
  
  if(l>r)
    cout<<"Left"<<endl;
  else if(l==r)
    cout<<"Balanced"<<endl;
  else if(l<r)
    cout<<"Right"<<endl;
  
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) (v).begin(),(v).end()
#define out(a) cout << (a) << endl
using namespace std;
using ll = long long;

int digit(int num){
    int d=0;
    while(num != 0){
        d += num % 10;
        num /= 10;
    }
    return d;
}


int main(){
    int n, a, b;
    cin >> n >> a >> b;
    int sum=0;

    for(int i=1; i<=n; i++){
        int x = digit(i);
        if(a <= x && x <= b) sum += i;
    }

    out(sum);

}

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

namespace AtCoder_20190707_1
{
    class Program
    {
        static void Main(string[] args)
        {            
            string[] s = Console.ReadLine().Split(' ');
            int a = int.Parse(s[0]);
            int b = int.Parse(s[1]);

            int mouth = 1;
            int count = 0;

            while(mouth < b)
            {
                mouth += a - 1;
                count++;
            }

            Console.WriteLine(count.ToString());
        }
    }
}


Measured memory_bytes: 13140
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(int i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) (cout << (x) << endl)
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
#define fs first
#define sc second
// 多倍長
#include <boost/rational.hpp>
#include <boost/multiprecision/cpp_int.hpp>
using boost::rational;
using boost::multiprecision::cpp_int;

const int INF = 1e9;
const ll LLINF = 1e16;
const ll MOD = 1e9+7;
template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}
 
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}
 

// 指定した文字cが文字列に何文字入ってるか
ll stringcount(string s, char c) {
    return count(s.cbegin(), s.cend(), c);
}


// 割り算の切り上げ処理
template<typename T>
T rp(T a, T b) {
  return (a + b - 1) / b;
}

// 桁和
template<typename T>
T digsum(T n) {
    T res = 0;
    while(n > 0) {
        res += n%10;
        n /= 10;
    }
    return res;
}

// 回文判定
bool kai (string s) {
    string t{s};
    reverse(begin(t), end(t));
    return s == t;
}

using pint = pair<int, int>;
using pll = pair<ll, ll>;


int main(void)
{
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int n,k;
    cin >> n >> k;
    string s;
    cin >> s;
    int score = 0;
    rep(i, n - 1) if(s[i] == s[i + 1]) score++;
    int ans = min(score + 2 * k, n - 1);
    print(ans);

}




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

using namespace std;

#define _for(i,j,N) for(int i = (j);i < (N);i++)
#define _rep(i,j,N) for(int i = (j);i <= (N);i++)
#define _dec(i,N,j) for(int i = (N-1);i >= (j);i--)
#define _rec(i,N,j) for(int i = (N);i >=(j);i--)
#define ALL(x) x.begin(),x.end()
#define MEM(a,n) memset(a,n,sizeof(a))
#define fst first
#define scd second
#define PB push_back
#define MP make_pair

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

int get_int(){int x;scanf("%d",&x);return x;}
LL get_ll(){LL x;scanf("%lld",&x);return x;}
double get_db(){double x;scanf("%lf",&x);return x;}

template<typename T> int chmin(T &a,T &b){if(a > b){a = b;return 1;}else return 0;}
template<typename T> int chmax(T &a,T &b){if(a < b){a = b;return 1;}else return 0;}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& v) {_for(i,0,v.size()) os << v[i] << " ";return os;}
template<typename T>
ostream& operator<<(ostream& os,const set<T>& v){for(auto a:v) os << a <<" ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& v){os << v.fst <<" "<<v.scd << " ";return os;}
template<typename T1,typename T2>
ostream& operator<<(ostream& os,const map<T1,T2>& v){for(auto a:v) cout << a << endl;return os;}

static const int dx[8] = { 1,  0, -1,  0,  1, -1,  1, -1};
static const int dy[8] = { 0,  1,  0, -1,  1, -1, -1,  1};
const double pi  = acos(-1.0);
const double eps = 1e-8;
const LL  INF  = 0x3f3f3f3f3f3f3f3f;
const int inf  = 0x3f3f3f3f;

const int maxn = 1e5+5;

LL dp[6005][2];
int N,T;
struct cake{
    int w,v;
    cake(int w = 0,int v = 0):w(w),v(v){;}
    bool operator<(const cake & o){
        return w < o.w;
    }
};


cake cakes[3005];


int main()
{
    MEM(dp,0);
    cin >> N >> T;
    int t = 1;

    _for(i,0,N){
        int w,v;
        cin >> w >> v;
        cakes[i] = cake(w,v);
    }

    sort(cakes,cakes + N);

    _for(i,0,N){
        LL w,v;
        w = cakes[i].w;
        v = cakes[i].v;
        _for(j,0,T){
            dp[w + j][t] = max(dp[j][t^1] + v , dp[w + j][t^1]);
        }
        t = t ^ 1;
    }

    LL maxnum = 0;
    _for(j,0,6005){
        maxnum = max(maxnum,dp[j][t^1]);
    }

    cout << maxnum <<endl;

    return 0;
}


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

int main() {
    int64_t A, B, K;
    cin >> A >> B >> K;
    int64_t e_a = min(B+1, A+K);
    for(int i=A; i < e_a; i++) {
        cout << i << endl;
    }

    int64_t b_s = B-K + 1;
        for (int i=b_s; i <= B; i++) {
            if (e_a <= i) {
                cout << i << endl;
            }
        }

    return 0;
}

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

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


Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int flag=0,i,k,l,n;
	scanf("%d",&n);
	//int a[2*n];
	for(i=0;i<n;i++){
		scanf("%d%d",&k,&l);
		if (k==l) flag++;
		else flag=0;
		if (flag==3) break;
	}
	if (flag==3) printf("Yes\n");
	else printf("No\n");
	return 0;
}


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

int main() {
    ll N;
    cin >> N;
    vector<int> A(N);
    for(int i=1;i<N;i++){
        int a;
        cin >> a;
        A[a-1]++;
    }
    for(int i=0;i<N;i++){
        cout << A[i] << endl;
    }
    return 0;
}

Measured memory_bytes: 4052
def main():
    import sys,heapq,math
    input = sys.stdin.readline

    n,m = map(int,input().split())
    a = list(map(int,input().split()))

    tank = []
    for e in a:
        heapq.heappush(tank,-e)
    
    for i in range(m):
        heapq.heappush(tank,heapq.heappop(tank)/2.0)

    res = 0
    for e in tank:
        res += math.floor(-e)
    print(res)

if __name__ == '__main__':
    main()

Measured memory_bytes: 82840
'''catupper

'''

import sys
sys.setrecursionlimit(1000000)#DFSは再帰の上限回数に注意

n = int(input())
edge = [[] for i in range(n)]
a = [0] * n#頂点を格納しておく配列
b = [0] * n

color_dict = {}#色を覚えておく
k = 0

def dfs(x, last = -1, ban_color = -1):
#lastは、どこから来たか、逆走を防ぐ。使っちゃいけない色も引数
    global k#グローバル変数
    color = 1
    for to in edge[x]:
        if to == last:continue
        #来た頂点に戻ろうとしたら、何もしない
        if color == ban_color:color += 1
        #使っちゃいけない色なら、新しい色にする
        color_dict[(x, to)] = color
        dfs(to, x, color)
        #次の頂点toについてDFS。来たのはxから。前の頂点で使った色はダメ。
        color += 1#色を新しくする
    k = max(k, color-1)#何色を使ったか、覚えておく

for i in range(n-1):
    a[i], b[i] = map(int, input().split())
    a[i] -= 1#0-indexにする
    b[i] -= 1
    edge[a[i]].append(b[i])#無向グラフ
    edge[b[i]].append(a[i])

dfs(0)#最初の頂点をDFSに入れてスタート
print(k)#まず、何色必要かを出力

for i in range(n-1):#辺の色を1から頂点番号-1まで出力
    if (a[i], b[i]) in color_dict:#辞書から答を出力
        print(color_dict[(a[i], b[i])])
    else:
        print(color_dict[(b[i], a[i])])

Measured memory_bytes: 84520
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc =new Scanner(System.in);
    int N =sc.nextInt();
    int X =sc.nextInt();
    int T =sc.nextInt();
    int w =N/X;
    if(N%X==0){
      System.out.println(w*T);}
    else{System.out.println((w+1)*T);}
  }
}

Measured memory_bytes: 35528
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int x,k1=0,k2=0;
    cin>>x;
    while(x>=500){
        x=x-500;
        k1++;
    }
    while(x>5&&x<500){
        x=x-5;
        k2++;
    }
    long long res=k1*1000+k2*5;
    cout<<res;
    return 0;
}


Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,queue,copy

sys.setrecursionlimit(10**7)
inf=10**20
mod=10**9+7
dd=[(-1,0),(0,1),(1,0),(0,-1)]
ddn=[(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS(): return sys.stdin.readline().split()
def S(): return input()

def main():
  n,W=LI()
  dp=[[0 for _ in range(W+1)]for __ in range(n+1)]
  w=[]
  v=[]
  for _ in range(n):
    a,b=LI()
    w.append(a)
    v.append(b)

  # dp[i+1][j] iまでで最大化
  for i in range(n):
    for j in range(W+1):
      dp[i+1][j]=max(dp[i+1][j],dp[i][j])
      if j+w[i]<=W:
        dp[i+1][j+w[i]]=max(dp[i+1][j+w[i]],dp[i][j]+v[i])
  return dp[n][W]

# main()
print(main())


Measured memory_bytes: 180056
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define se second
#define fi first
#define ll long long
#define INF INT_MAX
#define mod 1000000007
#define chutiyaap ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
using namespace std;
ll pw(ll a, ll b) {
    if (b == 0) return 1;
    ll t = pw(a, b / 2);
    if (b % 2 == 0) return (t * t)%mod;
    else return ((t * t)%mod * a)%mod;
}
int main()
{
	int a;cin>>a;
	cout<<a+a*a+a*a*a;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;

int main() {
int N,M,X;
cin >> N >> M >> X;
vector<int> c(N);
vector<vector<int>> a(N,vector<int>(M));
for (int i = 0;i < N;i++) {
    cin >> c.at(i);
    for (int j = 0;j < M;j++) {
        cin >> a.at(i).at(j);
    }
}
int mini = INF;

for (int tmp = 0; tmp < (1 << N); tmp++) {
    vector<int> ti(M);
  bitset<12> s(tmp);
  int ans = 0;
  for (int i = 0;i < N;i++) {
      if (s.test(i)) {
          ans += c.at(i);
          for (int j = 0;j < M;j++)  ti.at(j) += a.at(i).at(j);
      }
      bool bo = true;
  for (int i = 0;i < M;i++) {
      if (ti.at(i) < X) bo = false;
  }
  if (bo == true) mini = min(mini,ans); 
  }
  
}
if (mini == INF) cout << -1 << endl;
else cout << mini << endl;


return 0;
}

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

int main()
{
int L,R;
scanf("%d %d",&L,&R);
int i,j,s;
int m=2018;
for(i=L;i<R;i++){
  for(j=i+1;j<=R;j++){
    s=((i%2019)*(j%2019))%2019;
    if(s==0){
      printf("0\n");
      exit(0);
    }
    if(s<=m)m=s;
  }
}
printf("%d\n",m);
return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
int main() {
  int N, M;
  cin >> N >> M;
  vector<int> p(M);
  vector<string> S(M);
  rep(i,M) cin >> p.at(i) >> S.at(i);
  vector<int> AC(N, 0);
  vector<int> WA(N, 0);
  rep(i,M){
    if(AC.at(p.at(i)-1) == 0){
    if(S.at(i) == "AC"){
      AC.at(p.at(i)-1) = 1;
    } else if (AC.at(p.at(i)-1) == 0){
        WA.at(p.at(i)-1)++;
    }
    }
  }
  int ACsum = 0;
  int WAsum = 0;
  rep(i,N){
    ACsum += AC.at(i);
    if(AC.at(i) == 1){
      WAsum += WA.at(i);
    }
  }
  cout << ACsum << " " << WAsum << endl;
  return 0;
}


Measured memory_bytes: 6912
#include <cstdio>
#define N 200005

int n;
int a[N], cnt[N];

int main() {
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", a + i);
        ++cnt[a[i]];
    }
    long long ans = 0;
    for (int i = 1; i <= n; ++i) ans += (long long)cnt[i] * (cnt[i] - 1) >> 1;
    for (int i = 1; i <= n; ++i) printf("%lld\n", ans - cnt[a[i]] + 1);
    return 0;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ll n; cin >> n;
	ll ans = 0;
	for(ll i = 1; i * i <= n; i++){
		if(n % i) continue;
		ll sang = n / i;
		if(sang - 1 > i)
			ans += sang - 1;
	}
	cout << ans << "\n";
	return 0;
}


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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n, m, a[55], b[55];
vector<int> v[55];
void solve(){
	cin >> n >> m;
	for(int i = 0; i < m; i++){
		cin >> a[i] >> b[i];
		a[i]--; b[i]--;
		v[a[i]].push_back(b[i]);
		v[b[i]].push_back(a[i]);
	}
	
	int cnt = m;
	for(int i = 0; i < m; i++){
		queue<int> q;
		q.push(a[i]);
		bool used[55] = {};
		used[a[i]] = 1;
		while(!q.empty()){
			int p = q.front(); q.pop();
			if(p==b[i]){
				cnt--;
				break;
			}
			for(int j = 0; j < v[p].size(); j++){
				if(p==a[i]&&v[p][j]==b[i]) continue;
				if(used[v[p][j]]) continue;
				used[v[p][j]] = 1;
				q.push(v[p][j]);
			}
		}
	}
	cout << cnt << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <queue>
#include <array>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <map>

#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;
using lli = long long int;
using ll = long long;

int main() {
    lli N;
    cin >> N;

    vector<lli> A(N);
    vector<lli> B(N);
    vector<lli> C(N-1);

    for (lli i = 0; i < N; ++i) {
        cin >> A[i];
    }
    for (lli i = 0; i < N; ++i) {
        cin >> B[i];
    }
    for (lli i = 0; i < N - 1; ++i) {
        cin >> C[i];
    }

    lli result = 0;

    for (lli i = 0; i < N; ++i) {
        lli index = A[i];
        result += B[index - 1];

        if (i != N - 1 && A[i] + 1 == A[i + 1]) {
            result += C[index - 1];
        }
    }

    cout << result << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < (int)n; i++)
#define all(x) x.begin(), x.end()
#define MOD 1000000007//1e9+7
typedef long long ll;
using namespace std;
int main()
{
  vector<string> a(3);
  REP(i,3){
    cin >> a[i];
  }
  cout << a[0][0] << a[1][1] << a[2][2] << endl;
}



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() {
    int P, Q, R;
    cin >> P >> Q >> R;
    cout << min({P + Q, P + R, Q + R}) << endl;

  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#include<stdio.h>
#include<vector>
using namespace std;
#define rep(s,i,n) for(int i=s;i<n;i++)
#define c(n) cout<<n<<endl;
#define ic(n) int n;cin>>n;
#define sc(s) string s;cin>>s;
#define mod 1000000007
#define f first
#define s second
#define int long long
pair<int,int> a[114514];
signed main(){
	ic(n)
	rep(0,i,n){
		cin>>a[i].first;
	}
	rep(0,i,n){
		a[i].second=i;
	}
	sort(a,a+n);
	c(a[0].second+1)	
}	



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

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;

#define REP(i, n, m) for(ll i=n; i<(ll)m; ++i)
#define IREP(i, n, m) for(ll i=n-1; i>=m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#define all(v) v.begin(), v.end()

int main(){
    ll r;
    cin >> r;

    cout << (r*r) << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define erep(i, n) for (ll i = 0; i <= (ll)(n); ++i)
#define FOR(i,a,b) for (ll i = (a); i < (ll)(b); ++i)
#define EFOR(i,a,b) for (ll i = (a); i <= (ll)(b); ++i)

typedef pair<int, int> P;


int main() {
    int n; cin >> n;
    ll k; cin >> k;
    vector<int> a(n);
    rep(i, n) {
        cin >> a[i];
        a[i]--;
    }

    vector<int> seen(n, -1);
    int now = 0;
    seen[0] = 0;
    int move = 1;
    while(true) {
        now = a[now];
        if(seen[now] != -1) {
            break;
        }
        seen[now] = move;
        move++;
    }


    if(k <= move) {
        now = 0;
        while(k > 0) {
            now = a[now];
            k--;
        }
        cout << now+1 << endl;
        return 0;
    } else {
        k -= seen[now];
        ll p = k%(move-seen[now]);
        rep(_, p) {
            now = a[now];
        }
    }

    cout << now + 1 << endl;

    return 0;

}


/**
6 3
6 5 2 5 3 2
 **/

Measured memory_bytes: 4840
use std::io::{Read, stdin};
use std::str::FromStr;
use std::cmp::max;


fn main() {
    let n: usize = read();
    let mut f: Vec<[bool; 10]> = Vec::new();
    for _ in 0..n {
        let mut h = [false; 10];
        for i in 0..10 {
            let u: i64 = read();
            if u == 1 { h[i] = true; }
        }
        f.push(h);
    }
    let mut p: Vec<[i64; 11]> = Vec::new();
    for _ in 0..n {
        let mut h = [0; 11];
        for i in 0..11 {
            h[i] = read();
        }
        p.push(h);
    }
    let mut ans = -10e8 as i64;
    for i in 0..1 << 10{
        let mut sales = 0;
        let mut onaji = vec![0; n];

        let mut cnt = 0;
        for j in 0..10 {
            if (1 << j) & i == 0 {
                cnt += 1;
                for k in 0..n {
                    if f[k][j] { onaji[k] += 1; }
                }
            }
        }

        if cnt != 0{
            for k in 0..n {
                sales += p[k][onaji[k]];
            }
            ans = max(ans, sales);
        }
    }
    println!("{}", ans);
}


fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

Measured memory_bytes: 4352
#include<iostream>
#include<math.h>
#include<algorithm>
#include<stdint.h>
#include<vector>
#include<deque>
#include<stack>
#include<string>
#include<cstring>
#include<time.h>
#include<array>
#include<iomanip>
#include<list>
#include<set>
#include<unordered_map>
#include<unordered_set>
#include<random>
#include<bitset>
#include <queue>
#include <map>


using namespace std;
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using ldouble = long double;


//BDD,ZDD,kdtree, bdtree,bicalc, bolonoy, doloney,chinesemod,segmenttree,daikusutora, saidairyuu, 2bugurahu, heirokenshutu, topologicalsort, kyourenketuseibun


#define PRI(s) cout << s << endl
#define PRIY PRI("Yes")
#define PRIN PRI("No")

int ctoi(char c) {
	switch (c)
	{
	case '0': return 0;
	case '1': return 1;
	case '2': return 2;
	case '3': return 3;
	case '4': return 4;
	case '5': return 5;
	case '6': return 6;
	case '7': return 7;
	case '8': return 8;
	case '9': return 9;
	default:
		cout << "ERR_ctoi" << endl;
		return -1;
	}
}
int main() {
	
	int a, b, t;
	cin >> a >> b >> t;
	PRI((t / a) * b);
	return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <math.h> 
#include <string> 
#include <algorithm>
#include <numeric>
#include <cmath>
using namespace std;

int main() {

	long N , K ; cin >> N >> K ;
	long res = 1;

	for (int i = 1; i <= N; i++) res += min(res, K);

	cout << res << endl;

}

Measured memory_bytes: 256
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<bitset>
#include<iomanip>
#include<list>
#include <numeric>
using namespace std;
typedef unsigned long long int ulint;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define RE return 0
//ios::sync_with_stdio(false);
//std::cin.tie(0);
//<< setprecision(20)
const int mod=(int)1e9+7;
const llint big=(llint)(2.19e15+1)*18;
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
template <class T> void soun(T& ar)
{sort(ar.begin(),ar.end());ar.erase(unique(ar.begin(),ar.end()),ar.end());}
llint gcd(llint a,llint b){if(a%b==0){return b;}else{return gcd(b,a%b);}}
llint lcm(llint a,llint b){return a/gcd(a,b) *b;}
template<class T,class U> auto LB(T& ve,U in){return lower_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto UB(T& ve,U in){return upper_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto LBI(T& ve,U in){return LB(ve,in)-ve.begin();}
template<class T,class U> auto UBI(T& ve,U in){return UB(ve,in)-ve.begin();}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
int main(void){
	llint n,a,b,c,d,i,j,k;cin>>n>>a>>b>>c>>d;
	llint kai[1001]={0};
	kai[0]=1;
	for(i=1;i<=1000;i++){kai[i]=(kai[i-1]*i)%mod;}
	//cerr<<"kai[6]="<<kai[6]<<endl;
	llint gya[1001]={0};
	gya[1000]=1;llint bgen=kai[1000];
	for(int h=0;h<30;h++){
		if((mod-2)&(1<<h)){gya[1000]*=bgen;gya[1000]%=mod;}
		bgen*=bgen;bgen%=mod;
	}
	for(i=999;i>0;i--){gya[i]=gya[i+1]*(i+1)%mod;}
	//cerr<<"gya[1]="<<gya[1]<<endl;
	llint dp[1001]={0};dp[0]=kai[n];
	for(i=a;i<=b;i++){
		llint ddp[1001]={0};
		llint rui[1001]={0};rui[0]=1;
		for(k=1;k<=d;k++){rui[k]=rui[k-1]*gya[i]%mod;}
		for(k=1;k<=d;k++){rui[k]*=gya[k];rui[k]%=mod;}
		for(j=0;j<=n;j++){
			for(k=c;k<=d;k++){
				int ter=j+k*i;if(n<ter){break;}
				ddp[ter]+=dp[j]*rui[k];
				ddp[ter]%=mod;
			}
		}
		for(j=0;j<=n;j++){dp[j]+=ddp[j];dp[j]%=mod;}
	}
	cout<<dp[n]<<endl;RE;
}


Measured memory_bytes: 256
odd=["R","U","D"]
even=["L","U","D"]
 
S=input()
 
k=0
for i in range(0,len(S),2):
  if S[i] not in odd:
    break
  else:
    k=k+1
 
for i in range(1,len(S),2):
#  print(i)
  if S[i] not in even:
#    print("No")
    break
  else:
    k=k+1
 
if k==len(S):
  print("Yes")
else:
  print("No")

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

int n, ans[200001];

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

    cin >> n;
    for(int i = 0; i < n - 1; i++) {
        int a;
        cin >> a;
        ans[a]++;
    }

    for(int i = 1; i <= n; i++)
        cout << ans[i] << '\n';
    return 0;
}


Measured memory_bytes: 4440
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <vector>
#include <cmath>
#include <queue>
#include <algorithm>
using namespace std;
#define INF (2e9)
const int maxv=10000+10;
const int maxe=100000+10;
int V,E;

int vis[maxv];
list<int> out;
vector<int> g[maxv];
int indege[maxv];
void bfs(int s)
{
    queue<int> que;
    que.push(s);
    while(!que.empty())
    {
        int u=que.front();que.pop();
        out.push_back(u);
        for(int i=0;i<g[u].size();i++)
        {
            int v=g[u][i];
            indege[v]--;
            if(!vis[v]&&indege[v]==0)
            {
                vis[v]=1;
                que.push(v);

            }
        }
    }
}
void top_sort()
{
    memset(vis,0,sizeof(vis));
    memset(indege,0,sizeof(indege));
    for(int i=0;i<V;i++)
    {
        for(int j=0;j<g[i].size();j++)
        {
            int v=g[i][j];
            indege[v]++;
        }
    }
    for(int i=0;i<V;i++)
    {
        if(!vis[i]&&indege[i]==0)
        {
            bfs(i);
        }
    }
    for(list<int>::iterator iter=out.begin();iter!=out.end();iter++)
    {
        printf("%d\n",*iter);
    }
}
int main()
{
//    freopen("in.txt","r",stdin);
    scanf("%d%d",&V,&E);
    int u,v;
    for(int i=0; i<E; i++)
    {
        scanf("%d%d",&u,&v);
        g[u].push_back(v);
    }
    top_sort();
    return 0;
}

Measured memory_bytes: 4268
n, m = map(int, input().split())
a = list(map(int, input().split()))
a.sort(reverse=True)

total = sum(a)

selectable = 0
for aa in a:
    if aa >= total / (4 * m):
        selectable += 1

if m <= selectable:
    print('Yes')
else:
    print('No')


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

using namespace std;


using int64 = long long;
const int mod = 1e9 + 7;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

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

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}


int main() {
  vector< int > A(3);
  cin >> A;
  sort(begin(A), end(A));
  if(A[0] == A[1] && A[1] != A[2]) {
    cout << "Yes\n";
  } else if(A[0] != A[1] && A[1] == A[2]) {
    cout << "Yes\n";
  } else {
    cout << "No\n";
  }
}


Measured memory_bytes: 256
N = int(input())
H = list(map(int, input().split(' ')))

if N == 1:
    print('Yes')
else:
    for i in range(1, N):
        if H[i - 1] < H[i]:
            H[i] -= 1

    no_flag = 0
    for i in range(1, N):
        if H[i - 1] > H[i]:
            no_flag = 1
    if no_flag == 0:
        print('Yes')
    else:
        print('No')
    #print(H)

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

using namespace std;

int main()
{
    long n, m;
    cin >> n >> m;
    long res = 0;
    for (int i = n-1; i > 0; --i)
    {
        res += i;
    }
    for (int i = m-1; i > 0; --i)
    {
        res += i;
    }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define st first
#define nd second
#define mp make_pair
#define pb push_back
#define sol (k+k)
#define sag (k+k+1)
#define orta ((bas+son)/2)
#define coc g[node][i]
#define mod 1000000007
#define inf 1000000009
#define N 1000005
using namespace std;

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

int n;
multiset < double > s;//balanced binary search tree


int main() {
    // freopen("in.txt", "r", stdin);
    // freopen("out.txt", "w", stdout);

    scanf("%d",&n);
    for(int i = 1; i <= n; i++){
      int x;
      scanf("%d",&x);
      s.insert(x);
    }
    while((int)s.size() > 1){
      double ilk = *s.begin();
      s.erase(s.begin());
      double iki = *s.begin();
      s.erase(s.begin());
      s.insert( (ilk + iki)/2 );
    }
    printf("%.10lf\n", *s.begin());
    return 0;
}


Measured memory_bytes: 256
#include<iostream>    
#include<cstdio>  
#include<stdio.h>  
#include<cstring>    
#include<cstdio>    
#include<climits>    
#include<cmath>   
#include<vector>  
#include <bitset>  
#include<algorithm>    
#include <queue>  
#include<map>  
#include<stack>
using namespace std;

long long int ans1, ans2, sum1, sum2;
int n, i;
long long int a[100005];
int main()
{
	cin >> n;
	for (i = 1; i <= n; i++)
	{
		cin >> a[i];
	}
	if (a[1] >0)
	{
		sum1 = a[1];
		ans2= a[1] + 1;
		sum2 = -1;
	}
	else if (a[1] == 0)
	{
		sum1 = 1;
		ans1 = ans2 = 1;
		sum2 = -1;
	}
	else 
	{
		sum1 = 1;
		ans1 = abs(a[1]) + 1;
		sum2 = a[1];
	}
	for (i = 2; i <= n; i++)
	{	
		if (sum1 > 0)
		{
			if (a[i] + sum1 >= 0)
			{
				ans1 += a[i] + sum1 + 1;
				sum1 = -1;
			}
			else
			{
				sum1 += a[i];
			}
		}
		else
		{
			if (a[i] + sum1 <= 0)
			{
				ans1 += abs(sum1 + a[i]) + 1;
				sum1 = 1;
			}
			else
			{
				sum1 += a[i];
			}
		}
	}
	if (sum1 == 0)
	{
		ans1++;
	}
	for (i = 2; i <= n; i++)
	{
		if (sum2 > 0)
		{
			if (a[i] + sum2 >= 0)
			{
				ans2 += a[i] + sum2 + 1;
				sum2 = -1;
			}
			else
			{
				sum2 += a[i];
			}
		}
		else
		{
			if (a[i] + sum2 <= 0)
			{
				ans2 += abs(sum2 + a[i]) + 1;
				sum2 = 1;
			}
			else
				sum2 += a[i];
		}
	}
	if (sum2 == 0)
	{
		ans2++;
	}
	cout << min(ans1, ans2) << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
#include<sstream>
#include<iterator>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> IP;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
#define upper(v,hoge) upper_bound(v.begin(),v.end(),hoge)
#define lower(v,hoge) lower_bound(v.begin(),v.end(),hoge)
#define llower(v,hoge) *lower_bound(v.begin(), v.end(), hoge)
#define lupper(v,hoge) *upper_bound(v.begin(), v.end(), hoge)

int stringTOlint(string s) {
	//string→lint
	lint Z = s.size();
	lint ret = 0;
	reverse(s);
	rep(i, Z) {
		ret += ((s[i] - '0') * pow(10, i));
	}
	return ret;
}

int main() {
	double pi = 3.1415926535;
	string S;
	int LD=0, LA=0;
	double D=0, A=0;
	double NX = 0, NY = 0, NA = 90;
	while (1) {
		cin >> S;
		if (S == "0,0") {
			cout << int(NX)*(-1) << endl << int(NY) << endl;
			return 0;
		}
		else {
			string SD, SA;
			bool flag = false;
			rep(i, S.size()) {
				if (S[i] == ',') {
					flag = true;
				}
				else {
					if (flag == false) {
						SD.push_back(S[i]);
					}
					else {
						SA.push_back(S[i]);
					}
				}
			}
			LD = stoi(SD);
			LA = stoi(SA);
			D = double(LD);
			A = double(LA);
			NX += D * cos(NA * pi / 180);
			NY += D * sin(NA * pi / 180);
			NA += A;
		}
	}
}


Measured memory_bytes: 3248
#include <stdio.h>
#include <stdlib.h>
long long int int_sort(const void * a, const void * b)
{
    if(*(long long int*)a<*(long long int*)b)
    {
        return -1;
    }
    else if(*(long long int*)a==*(long long int*)b)
    {
        return 0;
    }
    return 1;
}

int main(void)
{
    long int n;
    long long int a[200005]={};
    scanf("%ld",&n);
    for(long int p=0;p<n;p++)scanf("%lld ",&a[p]);
    long int ans=0;
    long long int sum[200005]={};
    if(n==1&&a[0]==0)
    {
        printf("1");
        return 0;
    }
    else if(n==1&&a[0]!=0)
    {
        printf("0");
        return 0;
    }
    sum[0]=a[0];
    for(long int q=0;q<n-1;q++)sum[q+1]=sum[q]+a[q+1];
    sum[n]=9999999999;
    qsort(sum,n,sizeof(sum[0]),int_sort);
    long int check=0;
    long int num=1;
    while(check<n)
    {
        while(sum[check]==sum[check+1] && check<n)
        {
            check++;
            num++;
        }
        //printf("%ld %ld##\n",sum[check],num);
        if(sum[check]==0)ans+=num;
        check++;
        ans+=num*(num-1)/2;
        num=1;
    }
    printf("%ld",ans);
}


Measured memory_bytes: 4860