akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <stdlib.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
const ll mod=1000000007;
const ll INF=1e15;
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define U_ERASE(V) V.erase(unique(ALL(V)), V.end())
#define pb push_back
#define mp make_pair
#define MODP(A,B) A=(A+B)%mod

typedef pair<double,double> Pd;
vec dx={1,0,-1,0};
vec dy={0,1,0,-1};
ll N,P; 
long long ruijou(ll n, ll k){
    if(k==0) return 1;
    ll x=k/2;
    long long t=ruijou(n,x);
    
    if(k%2==1) return (n*t*t)%P;
    else return (t*t)%P;
}

int main(){
    cin>>N>>P;
    string S; cin>>S;
    vec d;
    rep(i,N) d.pb(S.at(i)-'0');
    //dp[0][0]=1;
    ll ans=0;

    if(P==2 || P==5) rep(i,N) if(d.at(i)%P==0) ans+=(i+1);

    if(P!=2 && P!=5){
        ll memory=0;
        vec x(P,0);
        x.at(0)++;
        reverse(ALL(d));
        rep(i,N){
            memory=(memory+ruijou(10,i)*d.at(i))%P;
            x.at(memory)++;
        }
        //rep(i,P) cout<<x.at(i)<<' ';
        rep(i,P) ans+=((x.at(i)-1)*x.at(i)/2);
    }
    cout<<ans<<endl;

}

Measured memory_bytes: 2680
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

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

int main() {
	int a, b; scanf("%d%d", &a, &b);
	
	printf("%d\n", (a + b) >> 1);
	return 0;
}



Measured memory_bytes: 3232
//Mahir Ratanpara (DA-IICT)
#include<bits/stdc++.h>
using namespace std;
#define Ff(i,a,n) for(i=a;i<n;i++)
#define Fr(i,a,n) for(i=a;i>n;i--)
#define ll long long
#define FAST ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
typedef pair<ll, ll>	pa;
typedef vector<ll>		vc;
typedef vector<pa>		vp;
typedef vector<vc>		vvc;
int mpow(int base, int exp); 
void ipgraph(ll n,ll m);
void dfs(int u, int par);
const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vc g[N];

int main() {
    FAST;
    ll t, i, j, k, p, q, r, x, y, u, v, n, m;
    cin>>k>>n>>m;
	x=m/k;
	if(n<=x*k)
	cout<<"OK";
	else
	{
		cout<<"NG";
	}
	
    return 0;
}

int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}

void ipgraph(ll n, ll m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
		g[u-1].pb(v-1);
		g[v-1].pb(u-1);
	}
}

void dfs(int u, int par){
	for(int v:g[u]){
		if (v == par) continue;
		dfs(v, u);
	}
}

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;

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

    ll N; cin >> N;
    vector<P> lis;

    for (int i = 0;i < N;i++){
        ll a,b; cin >> a >> b;
        lis.push_back(P(b,a));
    }

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

    ll sum = 0;
    for (int i = 0;i < N;i++){
        sum += lis[i].second;
        if(sum > lis[i].first){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;

}

Measured memory_bytes: 5872
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
using namespace std;
int parent[100000];
void init(int n){
  for(int i=0;i<n;i++){
    parent[i]=i;
  }
}
int find(int x){
  if(parent[x]==x){
    return x;
  }
  else{
    return parent[x]=find(parent[x]);
  }
}
bool same(int x,int y){
    return find(x)==find(y);
  }
void unite(int x,int y){
  x=find(x);
  y=find(y);
  if(x==y){
    return;
  }
  parent[x]=y;
}
int main(){
  int N,M;
  cin>>N>>M;
  init(N);
  int p[100000];
  for(int i=1;i<N+1;i++){
    cin>>p[i];
  }
  int x[100000],y[100000];
  for(int i=0;i<M;i++){
    cin>>x[i]>>y[i];
    unite(x[i],y[i]);
  }
  int answer=0;
  for(int i=1;i<N+1;i++){
    if(same(p[i],p[p[i]])==1){
      answer++;
    }
  }
  cout<<answer<<endl;
}

/*int parent[100000];
void init(int n){ //初期設定
  for(int i=0;i<n;i++){
    parent[i]=i;
  }
}
int find(int x){ //親を見つける
  if(parent[x]==x){
    return x;
  }
  else{
    return parent[x]=find(parent[x]); //親の親をたどる
  }
}
bool same(int x,int y){ //真偽
  return find(x)==find(y);
}
void unite(int x,int y){ //親どうしをつなぐ
  x=find(x);
  y=find(y);
  if(x==y){
    return;
  }
  parent[x]=y;
}
int main(){
  int N,Q;
  cin>>N>>Q;
  init(N);
  int P[200000],A[200000],B[200000];
  for(int i=0;i<Q;i++){
    cin>>P[i]>>A[i]>>B[i];
    if(P[i]==0){
      unite(A[i],B[i]);
    }
    else{
      if(same(A[i],B[i])==1){
        cout<<"Yes"<<endl;
      }
      else{
        cout<<"No"<<endl;
      }
    }
  }
}*/

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

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

#define INF 2e9
#define ALL(v) v.begin(), v.end()

int main(int argc, char const *argv[]) {
  string s;
  cin>>s;
  int cnt=0;
  rep(i,3){
    if(s[i]=='1'){
      cnt++;
    }
  }
  cout<<cnt<<endl;
  return 0;
}


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


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


	ll N, K;
	cin >> N >> K;

	int A[200001];
	rep1(i, N) cin >> A[i];

	int c[200001] = {};
	int B[200001] = {};
	for (int i = N; i >= 1; i--) {
		if (c[A[i]] == 0) {
			c[A[i]] = i;
		}
		else {
			B[i] = c[A[i]];
			c[A[i]] = i;
		}
	}

	int C[200002] = {};
	for (int i = N; i >= 1; i--) {
		if (B[i] == 0) {
			C[i] = A[i];
		}
		else {
			C[i] = C[B[i] + 1];
		}
	}
	rep(i, N + 1) ce(C[i]);

	ce("");

	int D[200001] = {};
	rep(i, 200001) D[i] = -1;
	rep1(i, N) {
		if (D[A[i]] == -1) {
			if (i + 1 <= N + 1) D[A[i]] = C[i + 1];
		}
	}
	D[0] = C[1];

	rep(i, N + 1) ce(D[i]);

	int vis[200001] = {};

	int num = 0;
	int k = 0;
	vector<int> ans;
	while (vis[k] == 0) {
		vis[k] = 1;
		k = D[k];
		ans.pb(k);
		num++;
	}
	ce("");
	ce(num);

	int num2 = 0;
	int vis2[200001] = {};
	while (vis2[k] == 0) {
		vis2[k] = 1;
		k = D[k];
		num2++;
	}
	ce(num2);

	if (K >= 2) {
		K -= 2;
		if (K >= num) {
			K = (K - num + num2) % num2 + num - num2;
		}


		int tmp = 0;
		rep1(i, N) {
			if (A[i] == ans[K]) {
				tmp = i;
				break;
			}
		}
		vector<int> kotae;
		for (int i = tmp + 1; i <= N; i++) {
			if (B[i] == 0) kotae.pb(A[i]);
			else i = B[i];
		}

		rep(i, kotae.size()) cosp(kotae[i]);

	}
	else {

		vector<int> kotae;
		int tmp = 0;
		for (int i = tmp + 1; i <= N; i++) {
			if (B[i] == 0) kotae.pb(A[i]);
			else i = B[i];
		}

		rep(i, kotae.size()) cosp(kotae[i]);
	}



	Would you please return 0;
}

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

int main(){
    int n;
    int B,F,R,V;
    int v[4][3][10] = {};
    
    cin >> n;
    
    for(int i=1;i<=n; i++){
        cin >> B >> F >> R >>V;
        v[B-1][F-1][R-1] += V;
    }
    
    for(int i = 0;i<=3;i++){
        for(int j = 0;j<=2;j++){
            for(int k = 0;k<=9;k++){
                cout<< " " << v[i][j][k];
            }
            cout << endl;
        }
        if(i<3) cout << "####################" << endl;
    }

}

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

int main(void)
{
    int a, b;
    cin >> a >> b;
    if ((double)(a + b) / 2.0 > (a + b) / 2)
    {
        cout << (a + b) / 2 + 1;
    }
    else
    {
        cout << (a + b) / 2;
    }
    return 0;
}

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

namespace AtCoder2 {
	class Program {
		static void Main(string[] args) {
	var inputArray = retreiveLongArray();
			var inputCount = 2;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			long K = inputArray[0];
			long S = inputArray[1];

			// <=Kの制約を考えない場合
			var count = 0;

			var max = Math.Min(S, K);

			for (int x = 0; x <= max; x++) {

				for (int y = 0; y <= Math.Min(K,S-x); y++) {

					var z = S - x - y;
					if(z <= K) {
						count++;
					}
				}
			}


			//XがK+1以上を超える場合
			long xOver = 0;
			for (var x = K+1; x <= S; x++) {
				xOver += Math.Max(0, S - x);
			}
			//yがk+1以上　ただしxがk未満
			long yOver = 0;
			for (var y = K + 1; y <= S; y++) {
				var xz = S - y;
				if (xz > S) {//xがk以上のケースを除く
					 xz = xz - (xz - (S));
				}
				yOver += Math.Max(0, xz);
			}

			//答えの出力
			Console.WriteLine(count);

		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray = Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static long[] retreiveLongArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var longArray = inputArray.Select(s => long.Parse(s));
			return longArray.ToArray();
		}
	}
}


Measured memory_bytes: 11348
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define repeat(i,a,b) for(int i=(a),i##__end=(b);i<i##__end;i++)
#define repeat_back(i,a,b) for(int i=(b)-1,i##__end=(a);i>=i##__end;i--)
#define mst(a,x) memset((a),(x),sizeof(a))

int main(){
	//ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
	ll n;
	cin>>n;
	printf("%.10f\n",double((n+1)/2)/n);
	return 0;
}


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

typedef long long ll;
typedef unsigned long long ull;

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

  ll ans = 0;
  for (ll i = 0; i < s.size(); ++i) {
    if (s[i] == t[i]) ++ans;
  }

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

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

#define rep(i,n) for(int i = 0; i < (n); ++i)
#define ll long long
const ll MOD = 1e9+7;
const ll INF = 1e18;
const double pi = acos(-1);

int main(void)
{
    ll n; cin>>n;
    vector<string> s(n);
    map<string,ll> mp;
    rep(i,n){
        cin>>s[i];
        mp[s[i]]++;
    }
    ll ans=0;
    for(auto x:mp){
        if(mp.size()>0) ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 24948
#ifndef BZ
#pragma GCC optimize "-O3"
#endif
#include <bits/stdc++.h>
#define FASTIO ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
#define rep(i, l, r) for (ll i = (l); i < (r); ++i)
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
#define pii pair<int, int>
#define pll pair<ll, ll>
#define pli pair<ll, int> 
#define pdd pair<ld, ld> 
#define pb push_back
#define reset(x,v) memset(x,v,sizeof(x))
#define mod 1000000007
using namespace std;

int main(){
    FASTIO
    int n;
    cin >> n;
    int a[n+1], b[n];
    rep(i, 0, n+1){
    	cin >> a[i];
    }
    rep(i, 0, n){
    	cin >> b[i];
    }
    ll s = 0;
    rep(i, 0, n){
    	ll t = min(a[i], b[i]);
    	s += t;
    	a[i] -= t;
    	b[i] -= t;
    	t = min(a[i+1], b[i]);
    	s += t;
    	a[i+1] -= t;
    	b[i] -= t;
    }
    cout << s;
    return 0;
}

Measured memory_bytes: 1024
sa = gets.chomp.split(//)

def solve(s, sa)
  if sa.size == 0
    if s.split.map(&:to_i).sum == 7
      return "#{s.split.join}=7"
    else
      return nil
    end
  end
  sa_new = sa.clone
  s1 = sa_new.shift
  solve("#{s} +#{s1}", sa_new) || solve("#{s} -#{s1}", sa_new)
end

s0 = sa.shift
puts solve(s0, sa)


Measured memory_bytes: 14268
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <fstream>
using namespace std;
inline int toInt(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string toStr(T x) { ostringstream sout; sout << x; return sout.str(); }
typedef vector<int> vi;
typedef vector<vi>  vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n) FOR(i,0,(n)-1)
const double EPS = 1e-10;
const double PI = acos(-1.0);
const int INF = INT_MAX / 10;

int main() {
	int n, l;
	while (cin >> n >> l, n) {
		vector<pii> ants(n);
		REP(i, n) {
			char d;
			cin >> d >> ants[i].second;
			if (d == 'R') {
				ants[i].first = 1;
			}
			else {
				ants[i].first = -1;
			}
		}

		int left = n, sec = 0, ans = -1;
		while (true) {
			sec++;
			ans = -1;
			REP(i, n) {
				ants[i].second += ants[i].first;
			}

			REP(i, n) {
				if (ants[i].first != 0) {
					if (ants[i].second == 0) {
						ans = i + 1;
						ants[i].first = 0;
						left--;
					}
					else if (ants[i].second == l) {
						if (ans == -1) {
							ans = i + 1;
						}
						ants[i].first = 0;
						left--;
					}
				}
			}

			if (n != 1) {
				REP(i, n) {
					FOR(j, i, n - 1) {
						if (ants[i].second == ants[j].second && ants[i].first != 0) {
							ants[i].first *= -1;
							ants[j].first *= -1;
						}
					}
				}
			}

			if (left == 0) {
				cout << sec << " " << ans << endl;
				break;
			}
		}
	}

	return 0;
}

Measured memory_bytes: 1196
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end())
#define VRSORT(v) sort(v.rbegin(), v.rend())
#define ll long long
#define pb(a) push_back(a)
#define MOD 1000000007
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

typedef vector<unsigned int>vec;
typedef vector<vec> mat;
//typedef tuple<ll, ll, ll> T;

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

void add(ll& a, ll b){a = (a+b) % MOD;}

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

#define INF 1e9
char maze[1010][1010];
int d[1010][1010];
int h,w;
queue<P> que;

void bfs(){
    while(!que.empty()){
        P p = que.front();que.pop();
        REP(i,4){
            int nh=p.first + dy[i],nw=p.second+dx[i];
            if(0<=nh && nh<h && 0<=nw && nw<w){
                if(maze[nh][nw]=='#') continue;
                que.push(P(nh,nw));
                maze[nh][nw]='#';
                d[nh][nw]=d[p.first][p.second]+1;
            }
        }
    }
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin>>h>>w;
    REP(i,h) REP(j,w){
        cin>>maze[i][j];
        if(maze[i][j]=='#'){
            que.push({i,j});
        }
    }
    int ans=0;
    bfs();
    REP(i,h) REP(j,w){
        ans = max(ans,d[i][j]);
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 11408
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

struct fast_io {
	fast_io(){
		std::cin.tie(nullptr);
		std::ios::sync_with_stdio(false);
	};
} fio;


template<typename T>
class lazy_segment_tree{
	int n;
	T fval;
	vector<T> dat, lazy;
	
public:
	
	lazy_segment_tree(){
		
	}
	
	lazy_segment_tree(int n_, T val){
		init(n_, val);
	}
	
	~lazy_segment_tree(){
		
	}
	
	void init(int n_, T val){
		fval = val;
		
		n = 1;
		
		while(n < n_) n *= 2;
		
		dat.resize(2 * n - 1);
		lazy.resize(2 * n - 1, fval);
	
		for(int i = 0; i < 2 * n - 1; i++) dat[i] = fval;
	}
	
	void eval(int k, int l, int r){
		
		if(lazy[k] != fval){
			// dat[k] = dat[k] + lazy[k]/(r - l);
			dat[k] = min(dat[k], lazy[k]);
			if(r - l > 1) {
				lazy[2*k+1] = min(lazy[2*k+1] , lazy[k]);
				lazy[2*k+2] = min(lazy[2*k+2] , lazy[k]);
			}
			
			lazy[k] = fval;
		}
	}
	
	void update(int a, int b, T x, int k = 0, int l = 0, int r = -1){
		if(r < 0) r = n;
		eval(k, l, r);
		if(b <= l || r <= a) {return ;}
		if(a <= l && r <= b){
			// lazy[k] = lazy[k] + (r - l) * x;
			lazy[k] = min(lazy[k], x);
			eval(k, l, r);
		} else {
			update(a, b, x, 2*k+1, l, (l+r)/2);
			update(a, b, x, 2*k+2, (l+r)/2, r);
			dat[k] = min(dat[2*k+1], dat[2*k+2]);
		}
	}
	
	T query(int a, int b, int k = 0, int l = 0, int r = -1){
		if(r < 0) r = n;
		eval(k, l, r);
		if(r <= a || b <= l){
			return INF;
		}
		if(a <= l && r <= b){
			return dat[k];
		}else {
			T vl = query(a, b, k * 2 + 1, l, (l + r) / 2 );
			T vr = query(a, b, k * 2 + 2, (l + r) / 2, r);
			return min(vl, vr);
		}
	}
};

signed main(){
	cout<<fixed<<setprecision(10);
	
	int N, Q;
	lazy_segment_tree<long long> lseg, lseg2;
	int ans = 0;
	
	cin>>N>>Q;
	
	lseg.init(N+4, N);
	lseg2.init(N+4, N);
	
	for(int i = 0; i < Q; i++){
		int a, b;
		
		cin>>a>>b;
		
		if(a == 1) {
			int t = lseg.query(b, b+1);
			
			ans += t - 1 - 1;
			// cout<<"t1 = "<<t<<endl;
			lseg2.update(1, t+1, b);
			
		} else if(a == 2) {
			int t = lseg2.query(b, b+1);
			
			ans += t - 1 - 1;
			// cout<<"t2  = "<<t<<endl;
			lseg.update(1, t+1, b);
		}
		// cout<<"ans = "<<ans<<endl;
		
		// for(int i = ){
		// }
	}
	
	ans = (N - 2) * (N - 2) -  ans;
	
	cout<<ans<<endl;
	
	return 0;
}

Measured memory_bytes: 19572
#include <bits/stdc++.h>
    #define ll long long
    using namespace std;
    int main() {
      int value;
      int a[3];
      cin >> value;
      a[0] = (value % 10);
      value /= 10;
      a[1] = (value % 10);
      value /= 10;
      a[2] = (value % 10);
      value /= 10;
      // cout << a[0] << a[1] << a[2];
      if (a[0] == 7 or a[1] == 7 or a[2] == 7) {
        cout << "Yes";
      } else {
        cout << "No";
      }
    }

Measured memory_bytes: 3620
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD 1000000007ll 
#define pb push_back
#define vl vector<ll>
#define pll pair<ll,ll>
#define mp make_pair
using namespace std;
#define pi (long double)3.14159265358979323846 
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 struct sch{
  ll s,e,t;
};
bool sortinrev(const struct sch &a, const struct sch &b) 
{ 
    return (a.s < b.s); 
}
ll gcd(ll a, ll b) 
{ 
    if (b == 0) 
        return a; 
    return gcd(b, a % b);  
      
}
ll lcm(ll a,ll b)
{
  return a*b/gcd(a,b);
}
ll power(ll x, ll y, ll p) 
{ 
    ll res = 1; 
    x = x % p;  
    while (y > 0) 
    {
        if (y & 1) 
            res = (res*x) % p; 
        y = y>>1; // y = y/2 
        x = (x*x) % p; 
    } 
    return res; 
}
int main()
{
    ll x;
    cin>>x;
    if(x>=30)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'
int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end());
	int p = a[n / 2];
	int q = a[n / 2 - 1];
	cout << (p - q) << endl;
}

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

#ifdef LOCAL
#include "../dump.hpp"
#else
#define dump(...)
#endif

#define rep(i,n) for(ll i=0,i##_cond=(n);i<i##_cond;++i)
#define FOR(i,a,b) for(ll i=(a),i##_cond=(b);i<i##_cond;++i)
#define ROF(i,a,b) for(ll i=(a)-1,i##_cond=(b);i>=i##_cond;--i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
#define SUM(a) accumulate(all(a),0)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define fst first
#define snd second
#define mp make_pair

typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<ll,ll> pii;

const ll inf = 1ll<<62;
const ll mod = 1e9+7;

#define int ll

vi dx = {1, 0, -1, 0, 1, -1, -1, 1}, dy = {0, 1, 0, -1, 1, 1, -1, -1};

main()
{
  while(1){
    int h,w; cin >> w >> h;
    if(h == 0) break;
    vvi s(h,vi(w));
    rep(i,h) rep(j,w) cin >> s[i][j];
    vvi look(h,vi(w));

    int ans = 0;
    rep(i,h) rep(j,w){
      if(not look[i][j] and s[i][j]){
	ans++;
	queue<pii> q;

	q.push(pii(i,j));
	look[i][j] = 1;

	while(not q.empty()){
	  pii p = q.front();
	  q.pop();

	  rep(k, sz(dx)){
	    int nx = p.fst + dx[k], ny = p.snd + dy[k];
	    if(0 <= nx and nx < h and 0 <= ny and ny < w and s[nx][ny] and look[nx][ny] == 0){
	      q.push(pii(nx, ny));
	      look[nx][ny] = 1;
	    }
	  }
	}
      }
    }
    //dump(look);
    cout << ans << endl;
  }
}


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

int main(){
    string n;
    cin >> n;
    rp(i,3){
        if(n[i]=='1') n[i]='9';
        else if(n[i]=='9') n[i]='1';
    }
    cout << n << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstdlib>
#include <vector>
#include <array>
#include <map>
#include <algorithm>
#include <queue>
#include <stack>
#include <cmath>
#include <climits>
#include <cstdio>
#include <iomanip>

using namespace std;
typedef long long int ll;

int main(int argc, char const *argv[])
{
    ll n, k;
    cin >> n >> k;
    long double ans = 0;

    for (ll i = 1; i <= n; i++)
    {
        ll temp = i;
        ll cnt = 0;
        while (temp < k)
        {
            cnt++;
            temp *= 2;
        }

        ans += 1.0l / n * pow(1 / 2.0l, cnt);
    }

    cout << setprecision(12) << ans << endl;
}

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

int main(){
  char s[3];
  int cnt = 0;
  cin >> s[0] >> s[1] >> s[2];
  
  for(int i = 0; i < 3; i++){
    if(s[i] == 'R' && s[i] != s[i+1]){
      cnt++;
      break;
    }else if(s[i] == 'R'){
      cnt++;
    }
  }
  
  cout << cnt << endl;
}  

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

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //freopen("in.inp", "r", stdin);
    //freopen("ou.out", "w", stdout);
    string s;
    cin>>s;
    int nho=1;
    int kq=1;
    int i=1;
    while (i<s.size())
    {
        if (nho==1)
        {
            if (s[i]!=s[i-1]) {kq++; i++;}
            else
            {if (i+2<=s.size()) {nho=2; kq++; i=i+2;}
            else break;}
        }
        else
        {
            kq++; i++; nho=1;
        }
    }
    cout<<kq;
    return 0;
}


Measured memory_bytes: 720
#include <cmath>
#include <cstdio>
#include <vector>
#include <iostream>
#include <algorithm>
#include <iterator>
#include <stack>
#include <queue>
#include <string>
#include <map>
#define mp make_pair
#define pb push_back
#define p push
#define FOR(a,c) for(int a = 0;a<c;a++)
#define ll long long
#define abs(x) (x<0 ? (-x) : x)
#define getI(a) scanf("%d",&a)
#define getII(a,b) scanf("%d %d",&a,&b)
#define getIII(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define getL(a) scanf("%lld",&a)
#define getLL(a,b) scanf("%lld %lld",&a,&b)
#define getLLL(a,b,c) scanf("%lld%lld%lld",&a,&b,&c)
#define getddd(a,b,c) scanf("%lf%lf%lf",&a,&b,&c)
#define BEND(c) (c).begin(),(c).end()
#define fi first
#define se second
#define pi 3.1415926535897932384626
#define getS(a) scanf("%s",a)
#define pfi(a) printf("%d\n",a);
#define pfii(a,b) printf("%d %d\n",a,b);
#define pfl(a) printf("%lld\n",a);
#define pfll(a,b) printf("%lld %lld\n",a,b);
#define  SIZE 1000000007

using namespace std;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vl;
typedef vector<pair<int,int>> vpi;
typedef vector<pair<long long,long long>> vpl;
typedef pair<int,int> pii;
typedef pair <ll,ll> pll;


int gcd(int a, int b) {
    while (a > 0 && b > 0)
        if (a > b) a %= b;
        else b %= a;
    return a + b;
}

int lcm(int a, int b) {
    return a*b / gcd(a,b);
}

int grid [1003][1003];


long long fast_exp(long long n,long long k){
    if(k == 0)
        return 1;
    if(k==1)
        return n;

    long long temp = fast_exp(n,k>>1);

    if((k&1)==1)
        return (n*temp*temp)%SIZE;
    return (temp*temp)%SIZE;

}
ll isprime(ll i){
    if (i==2 || i == 3){
        return 0;
    }
    bool ctr =0;
    for(ll k = 2;k*k <i;k++){
        if(i%k==0)ctr=1;
    }
    if(ctr)return 1;
    else return 0;

}

/*
double x1,x2,y11,y2,v1,v2;
double timet=0;
double f ( double dd){
    timet = 0;
    timet +=sqrt(((dd-x1)*(dd-x1)+(0-y11)*(0-y11)))/v1;
    timet +=sqrt(((dd-x2)*(dd-x2)+(0-y2)*(0-y2)))/v2;
    return timet;
}

double tesearch(double left,double right,double eps = 1e-7){
    while(right-left > eps){
        double mid1= left+(right-left)/3;
        double mid2 = right-(right-left)/3;
        if(f(mid1) > f(mid2)){
            left = mid1;
        }else{
            right=mid2;
        }

    }
    return f(left);
}
*/
int main (){

/*
    ll a,b;
    cin >>a>>b;
    ll t;
    vl vec;
    vl vec2;
    vl vec1;
    ll sum1 =0;
    ll sum2 = 0;
    ll sum =0;
    FOR(x,a){
     getL(t);
     vec.pb(t);
     sum+=t;
     vec1.pb(sum1);
     sum1+=t;




    }
    for(ll j = a-1;j>=0;j--){
        vec2.pb(sum2);
        sum2+=vec[j];
    }

    ll res =0 ;


    for(ll i = 0 ; i < a ;i ++){



        for(ll j = 0;j<a;j++){
            if((sum-vec1[i]-vec2[j])>=b)res++;
            else break;
        }

    }
cout << res;

*/











    ll w,h;
    cin >> w>>h;
    double x,y;
    cin >>x>>y;

    ll res2=0;
    double  mid1= (double)w/2.0;
    double  mid2= (double)h/2.0;
    if ( x == mid1 && y == mid2)res2=1;
    double res = (double)w * (double)h / 2.0;
    cout <<fixed << res <<" "<< res2;
    return 0;
}

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

int main()
{
    int N, K, x;
    cin >> N >> K;

    int sum = 0;

    for (int i = 0; i < N; i++)
    {
        cin >> x;
        sum += ((x < K - x) ? x : K - x) * 2;
    }

    cout << sum << endl;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# AtCoder Beginner Contest


if __name__ == '__main__':
    from itertools import product
    from heapq import nlargest

    n, m = list(map(int, input().split()))
    xyz = [list(map(int, input().split())) for i in range(n)]
    ans = 0

    # See:
    # https://beta.atcoder.jp/contests/abc100/submissions/2691346
    for a, b, c in product((-1, 1), repeat=3):
        summed_xyz = [0 for _ in range(n)]
        i = 0

        for x, y, z in xyz:
            summed_xyz[i] = (x * a) + (y * b) + (z * c)
            i += 1

        ans = max(ans, sum(nlargest(m, summed_xyz)))

    print(ans)


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

//repetition
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

//container util
#define all(x) (x).begin(),(x).end()

//typedef
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<ll, ll> PLL;

//const value
//const ll MOD = 1e9 + 7;
//const int dx[] = {0,1,0,-1};//{0,0,1,1,1,-1,-1,-1};
//const int dy[] = {1,0,-1,0};//{1,-1,0,1,-1,0,1,-1};

//conversion
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
inline ll toLL(string s) {ll v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}


int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll h;
  cin >> h;
  ll ans = 1;
  ll prev = 1;
  while (h > 1) {

    ans += prev*2LL;
    prev *= 2;
    h /= 2;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import sys

def solve(r, g):
    print(2*g-r)

def readQuestion():
    ws = sys.stdin.readline().strip().split()
    r = int(ws[0])
    ws = sys.stdin.readline().strip().split()
    g = int(ws[0])
    return (r, g,)

def main():
    solve(*readQuestion())

# Uncomment before submission
main()


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

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


#define rep(i,n) for(ll (i)=0; (i)<(ll)(n); (i)++)
#define frep(i,m,n) for(ll (i)=(m); (i)<=(ll)(n); (i)++)
#define rrep(i,n) for(ll (i)=(n)-1; (i)>-1; (i)--)
#define frrep(i,m,n) for(ll (i)=(n); (i)>(ll)(m); (i)--)
#define ALL(x) (x).begin(), (x).end()

const ll INF = 100100100100100100;
const ll MOD = 1000000007;

// get abs
ll my_abs(ll a);
// a^n
ll a_n(ll a, ll n);
// get gcd
ll my_gcd(ll a, ll b);
// a^(-1) % MOD 
ll inv(ll a);
// (a+b+c)%MOD
ll madd(ll a, ll b, ll c);
// (a-b)%MOD
ll msub(ll a, ll b);
// (a*b*c)%MOD
ll mtime(ll a, ll b, ll c);


int main() {
    ll N, T;
    cin >> N >> T;
    vector<P> a;
    rep(i, N) {
        ll c, t;
        cin >> c >> t;
        if(t <= T) {
            a.push_back(make_pair(c,t));
        }
    }
    if(a.size() == 0) {
        cout << "TLE" << endl;
    }
    else {
        sort(ALL(a));
        cout << a[0].first << endl;
    }
    return 0;
}

ll my_abs(ll a) {
    if(a >= 0) return a;
    else return -1 *a;
}

ll a_n(ll a, ll n) { 
    if(n == 0) return 1;
    
    ll ret = a, count = 1;
    while(count * 2 < n) {
        ret *= ret;
        count *= 2;
    }
    if(count == n) return ret;
    else return (ret * a_n(a, n-count));
}

ll my_gcd(ll a, ll b) {
    if(b == 0) return a;
    return my_gcd(b, a%b);
}

ll inv(ll a) {
    return a_n(a, MOD-2);
}

ll madd(ll a, ll b, ll c) {
    ll ret = (a+b) % MOD;
    return (ret+c) % MOD;
}

ll msub(ll a, ll b) {
    if(a < b) return (a-b+MOD) % MOD;
    else return (a-b) % MOD;
}

ll mtime(ll a, ll b, ll c) {
    ll ret = (a*b) % MOD;
    return (ret*c) % MOD;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
      	//データ取り込み
		Scanner sc = new Scanner(System.in);
		//int N = sc.nextInt();
    	//int M = sc.nextInt();
      	//String S = sc.next();
      	int list[] = new int[3];
      	for(int i=0;i<3;i++){
        	list[i] = sc.nextInt();
        }
      	Arrays.sort(list);
      	System.out.println((list[1]-list[0])+(list[2]-list[1]));
    }
}

Measured memory_bytes: 22996
#include<iostream>
#include<algorithm>
#include<cstring>
#include<string.h>
#include<limits.h>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<map>
#include<set>

#define P pair<int,int>
#define x first
#define y second

using namespace std;
const int maxn = 25;
char str[maxn][maxn];
int num[maxn][maxn];
int dir[][2] = {{1,0},{-1,0},{0,1},{0,-1}};
int n,m,ans,res;

queue<P>Q;

int main(void) {
	int BFS(int start_x,int start_y);
	scanf("%d%d",&n,&m);
	for(int i = 1; i <= n; i ++) {
		for(int j = 0; j <= m; j ++) {
			scanf("%c",&str[i][j]);
		}
	}
	ans = 0,res = 0;
	for(int i = 1; i <= n; i ++) {
		for(int j = 1; j <= m; j ++ ) {
			if(str[i][j] == '#') continue;
			res = BFS(i,j);
			ans = max(ans,res);
		}
	}
	cout << ans << endl;
	return 0;
}

bool Check(int x,int y) {
	if(x < 1 || y < 1 || x > n || y > m) return false;
	if(str[x][y] == '#' || num[x][y]) return false;
	if(str[x][y] == '.') return true;
}

int BFS(int start_x,int start_y) {
	P a,b;
	int count = 0;
	memset(num,0,sizeof(num));
	while(!Q.empty()) Q.pop();
	a.x = start_x,a.y = start_y;
	Q.push(a);
	while(!Q.empty()) {
		a = Q.front();
		Q.pop();
		count = max(count,num[a.x][a.y]);
		int v = num[a.x][a.y];
		for(int i = 0; i < 4; i ++) {
			b.x = a.x + dir[i][0];
			b.y = a.y + dir[i][1];
			if(!Check(b.x,b.y)) continue;
			if(b.x != start_x || b.y != start_y) { // 要保证不会回到最初的点,因为这种方法我们没有进行标记 
				num[b.x][b.y] = v + 1;
				Q.push(b);
			}
			/*
			   如果不加特殊判断的话就会出现错误,下面是特殊样例:
			   2 2
			   #.
			   #. 
			*/
			
		}
	}
	return count;
}

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

const int M=25;
int a[M];

int main()
{
	int n;
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	int ans=0;
	for(int i=1;i<n-1;i++)
	{
		if(a[i-1]<a[i]&&a[i]<a[i+1] 
		 ||a[i-1]>a[i]&&a[i]>a[i+1])
			ans++;
	}
	cout<<ans<<endl;
	return 0;
}

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

#define MAX 200000
#define SENTINEL 2000000000
typedef long long llong;

int L[MAX / 2 + 2], R[MAX / 2 + 2];

llong merge(int A[], int n, int left, int mid, int right)
{
	int i, j, k;
	llong cnt = 0;
	int n1 = mid - left;
	int n2 = right - mid;
	for (i = 0; i < n1; i++) L[i] = A[left + i];
	for (i = 0; i < n2; i++) R[i] = A[mid + i];
	L[n1] = R[n2] = SENTINEL;
	i = j = 0;
	for (k = left; k < right; k++)
	{
		if (L[i] <= R[j])
			A[k] = L[i++];
		else
		{
			A[k] = R[j++];
			cnt += n1 - i;
		}
	}
	return cnt;
}

llong mergesort(int A[],int n, int left, int right)
{
	int mid;
	llong v1, v2, v3;
	if (left + 1 < right)
	{
		mid = (left + right) / 2;
		v1 = mergesort(A, n, left, mid);
		v2 = mergesort(A, n, mid, right);
		v3 = merge(A, n, left, mid, right);
		return v1 + v2 + v3;
	}
	else return 0;

}
int main()
{
	int A[MAX], n, i;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> A[i];
	}
	llong ans = mergesort(A, n, 0, n);
	cout << ans << endl;
	return 0;

}


Measured memory_bytes: 4664
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define DVSORT(v) sort(v.begin(), v.end(),greater<int>())
#define SORT(v, n) sort(v, v+n)
#define DSORT(v,n) sort(v, v+n,greater<int>())
#define vi vector<int>
#define pb push_back
#define P pair<int,int>
 
template <class T> void chmin(T&a,const T&b) { a = min(a,b); }
template <class T> void chmax(T&a,const T&b) { a = max(a,b); }
 
void print(){cout<<endl;}
template <class Head, class... Tail>
void print(Head&& h,Tail&&... t){ 
	if(sizeof...(t)==0)
		cout<<h;
	else
		cout<<h<<' ';
	print(move(t)...);
}
 
const double EPS =1e-9;
const long INF =2147483647;//32bit 2*1e+9
const long MOD =1e+9+7;
#define PI 3.14159265258979
 
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};
 
int main(void){
	string S,target="AKIHABARA";
	cin>>S;
	if((int)S.length()>9){
		puts("NO");
		return 0;
	}

	if(S[0]!='A') S.insert(S.begin(),'A');
	if(S[(int)S.length()-1]!='A') S+='A';
	REP(i,(int)S.length()-1){
		if(S[i]=='H'&&S[i+1]=='B'){
			S.insert(S.begin()+i+1,'A');
		}else if(S[i]=='B'&&S[i+1]=='R'){
			S.insert(S.begin()+i+1,'A');
		}
	}
	if(S==target) puts("YES");
	else puts("NO");
	return 0;
}


Measured memory_bytes: 256
#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 main() {
	double A, B, C, D, E, F;
	while (cin >> A >> B >> C >> D >> E >> F) {
		double Y = (C * D - A * F) / (B * D - A * E);
		double X = (C - B * Y) / A;
		cout<< fixed<<setprecision(3)<< X << ' ' << Y << endl;
	}

}


Measured memory_bytes: 3192
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        A solver = new A();
        solver.solve(1, in, out);
        out.close();
    }

    static class A {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            // 入力
            int a = Integer.parseInt(in.next());
            int b = Integer.parseInt(in.next());
            int ans = a * b;

            // 出力
            out.println(ans);

        }

    }
}



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

int main(){
    int N,M; cin>>N>>M;
    vector<bool> CL(N+1,0);
    int AC=0;
    int WA=0;
    vector<int> WAarray(N+1,0);
    for(int i=0;i<M;i++){
        int num;cin>>num;
        string result;cin>>result;
        if(CL.at(num))continue;
        if(result=="AC"){
            AC++;
            WA+=WAarray.at(num);
            CL.at(num)=1;
        }else if(result=="WA"){
            WAarray.at(num)++;
        }
        
    }
    cout<<AC<<" "<<WA<<endl;
}

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

using namespace std;

#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second

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

// #define DEBUG_MODE
#ifdef DEBUG_MODE
#define dump(x) cout << #x << " : " << x << endl
#define LINE cout << "line : " << __LINE__ << endl
#define dumpV(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << endl
#define STOP assert(false)
#else
#define dump(x) ;
#define LINE     ;
#define dumpV(v);
#define STOP     ;
#endif
#define mp2 make_pair

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fi<<", "<<a.se<<')';
    return out;
  }
}


const int INF = 1e9;
const ll MOD_1 = 1e9 + 7;
const ll MOD_2 = 1e9 + 9;
const ll BASE_1 = 1009;
const ll BASE_2 = 1007;
double EPS = 1e-8;



ll modPow(ll x, ll n, ll MOD) {
    ll ret = 1;
    while (n) {
        if (n & 1LL) (ret *= x) %= MOD;
        (x *= x) %= MOD;
        n >>= 1;
    }
    return ret;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    string s;
    cin >> n >> s;
    int l = 0, r = n;
    auto check = [&](int m) {
        if (m == 0) return true;
        dump(m);
        unordered_map<ll, int> mp;
        ll t = 0LL;
        ll a = 0, b = 0;
        {
            rep(i, m) {
                (a *= BASE_1) %= MOD_1;
                (b *= BASE_2) %= MOD_2;
                (a += s[i]) %= MOD_1;
                (b += s[i]) %= MOD_2;
            }
            t = (a << 30) + b;
        }
        mp[t] = 0;

        dump(mp2("0", t));

        REP(i, 1, n - m+1) {
            ll invA = s[i - 1] * modPow(BASE_1, m - 1, MOD_1) % MOD_1;
            ll invB = s[i - 1] * modPow(BASE_2, m - 1, MOD_2) % MOD_2;
            (a += MOD_1 - invA) %= MOD_1;
            (b += MOD_2 - invB) %= MOD_2;

            (a *= BASE_1) %= MOD_1;
            (b *= BASE_2) %= MOD_2;
            (a += s[i+m-1]) %= MOD_1;
            (b += s[i+m-1]) %= MOD_2;


            t = (a<<30) + b;
            dump(mp2(i, t));
            if(mp.count(t)) {
                if(mp[t]+m <= i) {
                    dump(mp2(mp[t], i));
                    dump(t);
                    dumpV(mp);
                    dump(s.substr(mp[t], m));
                    dump(s.substr(i, m));
                    return true;
                }
            }
            else mp[t] = i;
        }

        return false;
    };
    rep(_, 32) {
        int m = (l + r) / 2;
        if (check(m)) l = m;
        else r = m;
    }
    cout << l << endl;
    return 0;
}

Measured memory_bytes: 592
//Use valgrind once if the submission doesn't go through. It can detect uninitialized variables and see where they could be an issue.
#include <bits/stdc++.h>
using namespace std;

int main(){

	ios_base::sync_with_stdio(false);
    	cin.tie(NULL);

	int a,b;
	cin>>a>>b;
	cout<<a*b<<endl;
	return 0;
}


Measured memory_bytes: 3640
import java.util.Scanner;

public class Main {

	int N = 0;

	public static void main(String[] args) {
		Main myself = new Main();
		myself.execute();
	}

	/**
	 * 実処理メソッド
	 */
	public void execute() {

		Scanner sc = new Scanner(System.in);
		N = sc.nextInt();

		int fx = getfx(N);

		int mod = N % fx;

		if (mod == 0) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

		sc.close();

	}

	private int getfx(int value) {

		String strvalue = Integer.toString(N);
		// 各桁を取得して足し算する

		int sum = 0;
		int length = strvalue.length();

		for (int i = 0; i < length; i++) {
			char pos = strvalue.charAt(i);

			sum += Integer.parseInt(Character.toString(pos));
		}

		return sum;
	}

}


Measured memory_bytes: 23892
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int A,B,C,X,Y;
    cin >> A >> B >> C >> X >> Y;
    int cost1= A*X+B*Y;
    int cost2=0;
    if(X<Y){
        cost2=min(C*X*2+(Y-X)*B,C*Y*2);
    }
    else cost2=min(C*Y*2+(X-Y)*A,C*X*2);
    cout << min(cost1,cost2) << endl;
    }

Measured memory_bytes: 256
loop do
  n = gets.to_i.to_s(8)
  break if n=="0"
  for i in 0..(n.size-1)
    c = n[i]
    if '4'<=c
      c.next!
    end
    if '6'<=c
      c.next!
    end
    print c
  end
  print "\n"
end

Measured memory_bytes: 6108
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <vector>
#include <algorithm>
#include <set>
using namespace std;

int main()
{
   string s;
   long long k;
   cin >> s >> k;
   long long i;
   for(i = 0;i <s.size();++i){
       if(s.at(i) != '1'){
           break;
       }
   }
   if(i == s.size()){
       i = 0;
   }
   if(k < i+1){
       cout << s.at(0) << endl;
   }else{
       cout << s.at(i) << endl;
   }
   return 0;
}

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

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

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

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

s64 n, m;
s64 s[100001];
vs64 a;

s64 check(s64 x)
{
    s64 ret = 0;
    for (int i = n - 1; i >= 0; --i)
    {
        auto it = lower_bound(a.begin(), a.end(), x - a[i]);
        if (it == a.end()) break;
        ret += a.end() - it;
    }
    return ret;
}

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

    cin >> n >> m;
    a.resize(n);
    rep (i, n)
    {
        cin >> a[i];
    }

    sort(a.begin(), a.end());
    rep (i, n)
    {
        s[i + 1] = s[i] + a[i];
    }

    s64 l = 2 * a[0], r = 2 * a[n - 1];
    while (l + 1 < r)
    {
        s64  mid = (l + r) / 2;
        if (check(mid) > m)
        {
            l = mid;
        }
        else
        {
            r = mid;
        }
    }

    s64 ans = 0;
    s64 num = 0;
    for (int i = n - 1; i >= 0; --i)
    {
        auto it = lower_bound(a.begin(), a.end(), r - a[i]);
        if (it == a.end()) break;
        num += a.end() - it;
        ans += a[i] * (a.end() - it) + (s[n] - s[it - a.begin()]);
    }

    while (num != m)
    {
        for (int i = n - 1; i >= 0; --i)
        {
            if (num == m) break;
            s64 temp = upper_bound(a.begin(), a.end(), l - a[i]) - lower_bound(a.begin(), a.end(), l - a[i]);
            ans += l * MIN(temp, m - num);
            num += MIN(temp, m - num);
        }
        --l;
    }

    cout << ans << "\n";
    return 0;
}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define FORL(i,x) for(int i=head[x];i;i=nxt[i])
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define PB push_back
#define MP make_pair
#define PI 3.14159265359
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 main() {
  ll N;
  cin >> N;
  ll A[N-1],B[N-1],C[N];
  vector<vector<ll>> v(N+1);
  ll ans = 0;
  vector<bool> visited(N+1, false);

  FOR(i,0,N-2){
    cin >> A[i] >> B[i];
    v[A[i]].PB(B[i]);
    v[B[i]].PB(A[i]);
  }
  FOR(i,0,N-1){
    cin >> C[i];
    ans += C[i];
  }
  sort(C,C+N,greater<ll>());
  ans -= C[0];

  queue<ll> que;
  que.push(1);
  ll output[N+1];
  ll ref = 0;

  while(que.size()>0){
    ll now = que.front(); que.pop();
    if(visited[now]) break;

    output[now] = C[ref];
    ++ref;
    visited[now] = true;
    for(ll x: v[now]){
      if(!visited[x]) que.push(x);
    }
  }

  cout << ans << endl;
  FOR(i,1,N) cout << output[i] << " ";
  cout << endl;




}



Measured memory_bytes: 1280