akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>

using namespace std;

int main()
{
    char str[4];
    bool cap[3]={1,0,0};
    while(cin>>str)
    {
        if(str[0]=='0')break;
        if(str[0]=='A'&&str[2]=='B'||str[2]=='A'&&str[0]=='B'){
            swap(cap[0],cap[1]);
        }
        if(str[0]=='A'&&str[2]=='C'||str[2]=='A'&&str[0]=='C'){
            swap(cap[0],cap[2]);
        }
        if(str[0]=='B'&&str[2]=='C'||str[2]=='B'&&str[0]=='C'){
            swap(cap[1],cap[2]);
        }
    }
    for(int i=0;i<3;++i){
        if(cap[i]){
            switch(i){
                case 0: cout<<'A'<<endl;return 0;
                case 1: cout<<'B'<<endl;return 0;
                case 2: cout<<'C'<<endl;return 0;
            }
        }
    }
}

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

const int K = 102, S = 33004, mod = 1e9 + 7;
int n, k, sn, s[S], dp[K][S * 2];

int C(int i) {
	if(i == sn) return s[i] - sn; // # //
	return s[i] - s[i + 1];
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin >> n >> k;
	sn = sqrt(n);
	for(int i = 1; i <= sn; ++i) {
		s[i] = n / i;
	}
	for(int i = 1; i <= 2 * sn; ++i) {
		dp[0][i] = 1;
	}
	for(int i = 1; i <= k; ++i) {
		for(int j = 1; j <= sn; ++j) {
			dp[i][j] = dp[i - 1][2 * sn + 1 - j];
		}
		for(int j = 1; j <= sn; ++j) {
			dp[i][2 * sn + 1 - j] = ((long long)dp[i - 1][j] * C(j)) % mod;
		}
		for(int j = 1; j <= 2 * sn; ++j) {
			(dp[i][j] += dp[i][j - 1]) %= mod;
		}
	}
	cout << dp[k][2 * sn] << endl;
	return 0;
}


Measured memory_bytes: 26368
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	ll x, y, d;
	cin >> x >> y >> d;
	ll a = y / d;
	ll b = (x == 0 ? -1 : (x - 1) / d);
	cout << a - b << endl;
}

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

 
int main(){

 
    long double A,B,H,M;
    cin >> A >> B >> H >> M;
    long double pi = 3.1415926535;
 
 
    long double theta = abs(0.5*(60*H-11*M)*pi/180);
    // cout << theta;
    long double result;
 
    
        result = sqrt(pow(A,2) + pow(B,2) - 2 * A * B * cosl(theta));
    
    cout << fixed << setprecision(15) << result;
}

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

using namespace std;

int main(){
  long double a,b,x; cin >> a >> b >> x; 
  long double ang;
  if(x > a*a*b/2){
    ang = atan(2*(a*a*b-x)/(a*a*a));
  }else{
    ang = atan((a*b*b)/(2*x)); 
  }
  
  cout << setprecision(12) << ang * 180/3.14159265358979;
  return 0;
  
}

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

int main() {
  int N;
  cin >> N;
  int i = 0;
  int sum = 30;
  int A;
  while(i < N) {
    int t = 0;
    cin >> A;
    while(A % 2 == 0) {
      A /= 2;
      t++;
      }
    if(sum > t) {
      sum = t;
    }
    
    i++;    
  }
  cout << sum << endl;
}

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

int main(){
  int X;
  cin >> X;
  vector<bool> expo(X+1);
  
  expo[1] = 1;
  for(int b = 2; b <= X; b++){
    int v = b*b;
    while(v <= X){
      expo[v] = 1;
      v *= b;
    }
  }
  for(int i = X; i >= 1; i--){
    if(expo[i]){
      cout << i << endl;
      return 0;
    }
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <vector>
#include <functional>
#include <algorithm>

using namespace std;

struct edge {
	int to;
	long long int cost;
};

typedef pair<long long int, int> P;

int V;
vector<edge> G[105];
long long int d[105];

void dijkstra(int s) {
	priority_queue<P, vector<P>, greater<P> > que;
	fill(d, d+V+1, 2<<29);
	d[s] = 0;
	que.push(P(0, s));

	while (!que.empty()) {
		P p = que.top();
		que.pop();
		int v = p.second;
		if (d[v] < p.first) {
			continue;
		}
		for (int i = 0; i < G[v].size(); i++) {
			edge e = G[v][i];
			if (d[e.to] > d[v] + e.cost) {
				d[e.to] = d[v] + e.cost;
				que.push(P(d[e.to], e.to));
			}
		}
	}
}

int main() {
	int n, k;
	while (cin >> n >> k) {
		if (n == 0 && k == 0) {
			break;
		}
		V = n;
		for (int i = 0; i < 105; i++) {
			G[i].clear();
		}
		int p;
		for (int i = 0; i < k; i++) {
			cin >> p;
			if (p == 0) {
				int a, b;
				cin >> a >> b;
				dijkstra(a);
				if (d[b] == (2<<29)) {
					cout << -1 << endl;
				} else {
					cout << d[b] << endl;
				}
			} else {
				int c, d, e;
				cin >> c >> d >> e;
				edge k;
				k.to = d;
				k.cost = e;
				G[c].push_back(k);
				k.to = c;
				G[d].push_back(k);
			}
		}
	}
	return 0;
}

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

int main()
{
    int X, A, B;
    cin >> X >> A >> B;
    if (-A + B <= 0)
        cout << "delicious" << endl;
    else
    {
        if (-A + B <= X)
            cout << "safe" << endl;
        else
            cout << "dangerous" << endl;
    }
    return 0;
}

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

int main(){
    string s0, s1;
    cin >> s0 >> s1;
    int cntr = 0;
    for(int i=0; i<3; i++){
        if(s0[i] == s1[i])
            cntr++;
    }
    cout << cntr;
    return 0;
}

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

int main()
{
    int n;
    cin >> n;
    
    string str = to_string(n);
    
    if(str.at(0)=='9' || str.at(1)=='9') cout << "Yes" << endl;
    else cout << "No" << endl;
}


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

using int32 = int_fast32_t;
using int64 = int_fast64_t;

const int32 INF = 1e9;
const int32 MOD = 1e9+7;
const int64 LLINF = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define ALL(obj) (obj).begin(),(obj).end()
#define pii pair<int32,int32>
#define pll pair<int64,int64>
#define pb(a) push_back(a)
#define mp make_pair

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int32 W,H,x,y;
    cin >> W >> H >> x >> y;
    printf("%.6f ", (double)W * H / 2);
    if(x * 2 == W && y * 2 == H){
        printf("1\n");
    }else{
        printf("0\n");
    }
    return 0;
}

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

int n;
bool flag;

int main(){

    scanf("%d", &n);

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

        int t, x, y;
        scanf("%d %d %d", &t, &x, &y);

        int nt = x+y;
        if (t < nt || t%2 != nt%2){
            flag = 1;
        }

    }

    if (flag) printf("No");
    else printf("Yes");

    return 0;

}


Measured memory_bytes: 128
import sys

input = lambda: sys.stdin.readline().rstrip()


def solve():
    r, d, x = map(int, input().split())
    xl = [0] * 11
    xl[0] = x
    for i in range(10):
        xl[i + 1] = r * xl[i] - d

    for i in range(1, 11):
        print(xl[i])


if __name__ == '__main__':
    solve()


Measured memory_bytes: 2940
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String str  = sc.nextLine();
        String[] astr = str.split(" "); //状況に合わせて
        Boolean flag  = true;
        int[] in_data = Stream.of(astr).mapToInt(x->{
            try{
                return Integer.parseInt(x);
            }
            catch(Exception e){
                e.printStackTrace();
            }
            return 0;
        }).toArray();
        sc.close();
        int a = in_data[0];
        int b = in_data[1];
        int ans = 0;

        if(a > 9 || b > 9){
            ans = -1;
            System.out.println(ans);
        }
        else{
            ans = a * b;
            System.out.println(ans);
        }

    }

}

Measured memory_bytes: 28372
#include <iostream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
using namespace std;
typedef long long LL;
LL i,j,k,n,m;
LL mod=1000000007;
string s;

int main() {
  cin >>n >> k;
  cout << n -k +1 << endl;
  return 0;
}


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

using namespace std;

int main(){
    string S; cin >> S;
    
    int ans = 0;
    
    for(int i = 0 ; i < S.size() - 1 ; i ++){
        if(S[i] != S[i + 1]) ans ++;
    }
    
    cout << ans << endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <queue>

using namespace std;

class Data{
public:
	Data(string nameIn, int timeIn) : _time(timeIn), _name(nameIn){}
	string _name;
	int _time;
};

queue<Data> array;
int n, t;
int cntTime = 0;

void calc(){
	int queueEmptyCnt = 0;
	while(!(queueEmptyCnt == n)){
		if(array.front()._time <= t){
			cntTime += array.front()._time;
			cout << array.front()._name << " " << cntTime << endl;
			array.pop();
			queueEmptyCnt++;
		}
		else{
			cntTime += t;
			array.front()._time -= t;
			Data dataMove(array.front()._name, array.front()._time);
			array.pop();
			array.push(dataMove);
		}
	}
}

int main(){
	cin >> n >> t;
	string nameIn;
	int timeIn;
	for(int i=0; i<n; ++i){
		cin >> nameIn >> timeIn;
		Data dataIn(nameIn, timeIn);
		array.push(dataIn);
	}
	calc();
	return 0;
}


Measured memory_bytes: 6220
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  cin >> a >> b;
  int p = a * b;
  if (p % 2 == 0) {
    cout << "Even" << endl;
  }
  else {
    cout << "Odd" << endl;  
  }
}

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

using namespace std;

typedef long long ll;

int main()
{
  ll n, T;
  cin >> n >> T;
  string eqation;
  cin >> eqation;
  ll sum = 0LL;
  eqation += '+';
  int maxk = 0;
  string hoge = to_string(n);
  string piyo = to_string(T);
  for(int i = 0; i < (int)eqation.size(); i+=4){
    int k = eqation[i+2] - '0';
    maxk = max(k, maxk);
    if(maxk * (hoge.size()-1) + (piyo.size()-1) > 9){
      sum += 1000000000;
      break;
    }
    sum += (ll)pow(n, k);
  }
  if((sum)*T > 1000000000) cout << "TLE" << endl;
  else cout << sum*T << endl;
  return 0;
}

Measured memory_bytes: 3416
//----------------------------------------------------------------------
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
//----------------------------------------------------------------------

using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph = vector<vector<int>>;

int main(void) {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> jobs(m);
    REP(i, n) {
        int a, b;
        cin >> a >> b;
        if( a > m) continue;
        jobs[m-a].push_back(b);
    }
    priority_queue<int> q;
    ll ans = 0;
    for(int i = m-1; i >= 0; --i) {
        for(int b : jobs[i]) {
            q.push(b);
        }
        if(!q.empty()) {
            ans += q.top();
            q.pop();
        }
    }
    cout << ans << endl;
    return 0;
}

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

#define rep(i,n) for(int i = 0;i<n;i++)
#define vv(Type,Name, n,m,d)vector<vector<Type>> Name(n, vector<Type>(m, d))
#define P pair
using namespace std;
using ll = long long;


int main(void) {

	ios::sync_with_stdio(false);
	cin.tie(0);

	string str;
	cin >> str;

	int ans = 0;
	rep(i, str.size()/2) {
		if (str[i] != str[str.size() - i - 1]) ans++;
	}
		
	cout << ans << endl;

	return 0;
}


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

ans = sum(b)

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

print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

#define DBG cerr << '!' << endl;
#define REP(i,n) for(int (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(int (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(int (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)

using namespace std;

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;


int main()
{
	string str;cin >> str;
	
	int a,b;
	
	REP(i,str.size())
	{
		if(str[i] == 'A')
		{
			a = i;break;
		}
	}
	REP(i,str.size())
	{
		if(str[i] == 'Z')
		{
			b = i;
		}
	}
	
	cout << b - a + 1 << endl;
	
	return 0;
}

Measured memory_bytes: 640
#!/usr/bin/ruby
# -*- coding: utf-8 -*-

3.times do
  tcard = gets.split.map(&:to_i)
  intime = (tcard[0] * 60 + tcard[1]) * 60 + tcard[2]
  res = (tcard[3] * 60 + tcard[4]) * 60 + tcard[5] - intime
 
  h = res / 3600
  res %= 3600
  m = res / 60
  s = res % 60
  puts "#{h} #{m} #{s}"
end

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

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

#define fr first
#define sc second

int main(){
	int a,b;
	cin >> a >> b;
	char c[102][102];
	int h = 100, w = 100;
	for(int i = 0 ; i < 100 ; i ++){
		for(int j = 0 ; j < 50 ; j ++){
			c[i][j] = '#';
		}
		for(int j = 50 ; j < 100 ; j ++){
			c[i][j] = '.';
		}
	}
	vector<P> A,B;
	for(int i = 0 ; i < 100 ; i += 2){
		for(int j = 0 ; j < 49 ; j += 2){
			A.push_back(P(i,j));
		}
		for(int j = 51 ; j < 100 ; j += 2){
			B.push_back(P(i,j));
		}
	}
	for(int i = 0 ; i < a-1 ; i ++){
		c[A[i].fr][A[i].sc] = '.';
	}
	for(int i = 0 ; i < b-1 ; i ++){
		c[B[i].fr][B[i].sc] = '#';
	}
	cout << 100 << " " << 100 << endl;
	for(int i = 0 ; i < 100 ; i ++){
		for(int j = 0 ; j < 100 ; j ++){
			printf("%c",c[i][j]);
		}
		puts("");
	}
}



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

int main() {
	int n, m, ans[100001]={}, wacount[100001]={}, anssum=0, wasum=0;
	cin>>n>>m;
	for(int i=0;i<m;i++){
		int pi; char si[2];
		cin>>pi>>si;
		if(ans[pi]==0&&si[0]=='W') wacount[pi]++;
		if(ans[pi]==0&&si[0]=='A') ans[pi]++; 
	}
	for(int i=1;i<=n;i++){
		if(ans[i]==1){
			anssum++;
			wasum+=wacount[i];
		}
	}
	
	cout<<anssum<<' '<<wasum;
	
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<cmath>
#include<iomanip>
#define pai 3.14159265358979323846
using namespace std;
int main()
{
	double a,b,h,m,ans=0;
	cin>>a>>b>>h>>m;
	h=h*30+m*0.5;
	if(m!=0) m=m*6; 
	double ang;
	if(m>=h) ang=m-h;
	else ang=h-m;
	if(ang>180)ang=360-ang;
	if(ang==180){
		ans=a+b;
	}
	else if(ang==0){
		if(a>b)ans=a-b;
		else ans=b-a;
	}
	//cout<<ang<<" ";
	else{
		ang=ang/180*pai;
		ans=sqrt(a*a+b*b-2*a*b*cos(ang));
	}
	cout<<fixed<<setprecision(20)<<ans;
}
//ans=sqrt(a*a+b*b-2abcosα)

Measured memory_bytes: 4156
#include <iostream>
#include <algorithm>
using namespace std;
int main(void){
    int n,d,x,ans=0;
    cin>>n>>d>>x;
    for(int i=0;i<n;i++){
        int a;cin>>a;
        ans+=d/a;
        if(d%a!=0)ans++;
    }
    cout<<ans+x<<endl;
    
    
}


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

using namespace std;
using ll = long long;

int main() {
    ll x;
    cin >> x;
    int i = 1;
    ll c = 100;
    while (true) {
        c *= 1.01;
        if (c >= x) {
            break;
        }
        i++;
    }
    cout << i << endl;
    return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
ll fact[200010];
ll powmod(ll x,ll n){
    if(n == 0)return 1;
    ll ans = powmod(x*x%MOD,n/2);
    if(n % 2)ans = ans * x % MOD;
    return ans;
}
ll divmod(ll a,ll b){
    return ((a%MOD) * (powmod(b,MOD-2)%MOD)) % MOD;
}
ll combi(ll n,ll r){
    /*
    ll num = 1;
    for(ll i = 1;i <= r;i++){
        num = divmod((n-i+1)*num,i);
    }
    */
    return divmod(fact[n], (fact[n-r] * fact[r]) % MOD);
}
main(){
    fact[0] = 1;
    rep(i,1,200010)fact[i] = (fact[i-1] * i) % MOD;
    ll H,W,A,B;
    cin >> H >> W >> A >> B;
    ll ans = 0;
    rep(i,1,H-A+1){
        ll x1 = 1, x2 = B, x3 = W;
        ll y1 = 1, y2 = i, y3 = H;
        ans += (combi(x2 - x1 + y2 - y1, y2 - y1) * combi(x3 - x2 + y3 - y2 - 1, y3 - y2)) % MOD;
        ans %= MOD;
    }
    cout << ans << endl;
}

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

using namespace std;

namespace geometry
{	
	typedef double D;
	typedef complex<D> P;
	typedef pair<P, P> S;
	typedef S L;
	typedef pair<P, D> C;
	typedef vector<P> Poly;
	
	#define EPS 		(1e-10)
	#define EQ(a, b) 	(abs((a) - (b)) < EPS)
	#define EQV(a, b) 	(EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()))
	
	D norm(P a) { return a.real() * a.real() + a.imag() * a.imag(); }
	
	D dot(P a, P b) { return a.real() * b.real() + a.imag() * b.imag(); }
	D cross(P a, P b) { return a.real() * b.imag() - a.imag() * b.real(); }
	
	bool isOrthogonal(P a1, P a2, P b1, P b2) { return EQ(dot(a1 - a2, b1 - b2), 0.0); }
	bool isOrthogonal(L a, L b) { return isOrthogonal(a.first, a.second, b.first, b.second); }
	bool isParallel(P a1, P a2, P b1, P b2) { return EQ(cross(a1 - a2, b1 - b2), 0.0); }
	bool isParallel(L a, L b) { return isParallel(a.first, a.second, b.first, b.second); }
	
	bool isPointOnLine(P a, P b, P c) { return EQ(cross(b - a, c - a), 0.0); }
	bool isPointOnLine(L a, P b) { return isPointOnLine(a.first, a.second, b); }
	bool isPointOnSegment(P a, P b, P c) {
		return EQ(cross(b - a, c - a), 0.0) &&
		       (dot(b - a, c - a) > -EPS) &&
			   (dot(a - b, c - b) > -EPS);
	}
	bool isPointOnSegment(S a, P b) { return isPointOnLine(a.first, a.second, b); }
	
	D distanceLP(P a, P b, P c) { return abs(cross(b - a, c - a)) / abs(b - a); }
	D distanceLP(L a, P b) { return distanceLP(a.first, a.second, b); }
	D distanceSP(P a, P b, P c) {
		if (dot(b - a, c - a) < EPS) return abs(c - a);
		if (dot(a - b, c - b) < EPS) return abs(c - b);
		return abs(cross(b - a, c - a)) / abs(b - a);
	}
	D distanceSP(S a, P b) { return distanceSP(a.first, a.second, b); }
	
	bool intersect(P a1, P a2, P b1, P b2) {
		return (cross(a2 - a1, b1 - a1) * cross(a2 - a1, b2 - a1) < EPS) &&
		       (cross(b2 - b1, a1 - b1) * cross(b1 - b1, a2 - b1) < EPS);
	}
	bool intersect(S a, S b){
		return intersect(a.first, a.second, b.first, b.second);
	}
	
	P project(S s, P p){
		P base = s.second - s.first;
		D r = dot(p - s.first, base) / (norm(base));
		return s.first + base * r;
	}
	P reflect(S s, P p){
		return p + (project(s, p) - p) * 2.0;
	}
}

using namespace geometry;

int main()
{
	D x1, y1, x2, y2, xq, yq;
	while (~scanf("%lf,%lf,%lf,%lf,%lf,%lf", &x1, &y1, &x2, &y2, &xq, &yq)){
		S s( P(x1, y1), P(x2, y2) );
		P p = reflect(s, P(xq, yq));
		printf("%f %f\n", p.real(), p.imag());
	}
}

Measured memory_bytes: 1236
#include<stdio.h>
 
int main()
{
    while (1)
    {
        char num[1001];
        scanf("%s", num);
        if (num[0] == '0') break;
        int n, sum = 0;
        for (n = 0; num[n] != '\0'; n++)
        {
            sum += num[n] - '0';
        }
        printf("%d\n", sum);
    }
 
    return 0;
}

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

int main(void) {
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<int64_t> A(N);
  rep(i, N) { cin >> A[i]; }

  int64_t answer = 0;
  for (int i = 0; i < N - 1; ++i) {
    for (int j = i + 1; j < N; ++j) {
      answer = max(answer, abs(A[i] - A[j]));
    }
  }
  cout << answer << endl;
  return 0;
}


Measured memory_bytes: 3628
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>
#include<set>
 
using namespace std;
 
#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define P(p) cout<<(p)<<endl;
#define PP(p) cout<<(p)<<" ";
#define pb push_back
#define mp make_pair
#define INF 1e18

typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef pair<int, int> pi;
//int dy[8]={1,1,1,0,-1,-1,-1,0};
//int dx[8]={-1,0,1,1,1,0,-1,-1};
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};

int N,M;
int a,b;

void input(){
    cin>>a>>b;
}

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    cout<<a*b<<endl;
    return 0;
}


Measured memory_bytes: 3648
N, K = input().split()
N = int(N)
K = int(K)
ans = float(0)
gro_bairitu = 1


def probability(num, K, pro, loc_bairitu):
    global ans, gro_bairitu
    if num >= K:
        ans += pro
    else:
        loc_bairitu *= 2
        if loc_bairitu > gro_bairitu:
            gro_bairitu = loc_bairitu
        probability(2 * num, K, float(pro) / 2, loc_bairitu)


for i in range(N, 0, -1):
    probability(i, K, float(1) / N, gro_bairitu)

print("{:.10f}".format(ans))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    int H, W; cin >> H >> W;
    vector<vector<int>> squares(H, vector<int>(W));
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> squares[i][j];
        }
    }
    int count = 0;
    for (int i = 0; i < H; i++) {

    }
    stringstream ans;
    for (int i = 0; i < H; i++) {
        if (i % 2 == 0) {
            for (int j = 0; j < W; j++) {
                if (squares[i][j] % 2 != 0) {
                    if (j == W-1) {
                        if (i == H-1) continue;
                        ans << i+1 << ' ' << j+1 << ' ' << i+2 << ' ' << j+1 << "\n";
                        count++;
                        squares[i+1][j]++;
                    } else {
                        ans << i+1 << ' ' << j+1 << ' ' << i+1 << ' ' << j+2 << "\n";
                        count++;
                        squares[i][j+1]++;
                    }
                }
            }
        } else {
            for (int j = W-1; 0 <= j; j--) {
                if (squares[i][j] % 2 != 0) {
                    if (j == 0) {
                        if (i == H-1) continue;
                        ans  << i+1 << ' ' << j+1 << ' ' << i+2 << ' ' << j+1 << "\n";
                        count++;
                        squares[i+1][j]++;
                    } else {
                        ans << i+1 << ' ' << j+1 << ' ' << i+1 << ' ' << j << "\n";
                        count++;
                        squares[i][j-1]++;
                    }
                }
            }
        }
    }
    cout << count << endl;
    cout << ans.str() << flush;
}


Measured memory_bytes: 6920
from copy import deepcopy

N = int(input())
Z = [[] for i in range(N)]
for i in range(N):
    x, y = map(int, input().split())
    Z[i] = [x, y]

# p, qが決まっている場合のコスト
def cost(p, q):
    reduction = 0
    W = deepcopy(Z)
    for i in range(N):
        for j in range(N):
            if W[j][0] - W[i][0] == p and W[j][1] - W[i][1] == q:
                reduction += 1
    return N - reduction

ans = N
for i in range(N-1):
    for j in range(i+1, N):
        p = Z[j][0] - Z[i][0]
        q = Z[j][1] - Z[i][1]
        cos = cost(p, q)
        
        ans = min(ans, cos)

print(ans)

Measured memory_bytes: 3444
#!/usr/bin/env python3
import sys


def main():
    X, Y = map(int, input().split())
    if (X + Y) % 3 != 0:
        print(0)
        exit()
    n = (X+Y) // 3
    if X < n or Y < n:
        print(0)
        exit()
    r = X - n

    # nCrを計算する
    a = [None] * (n+1)
    inva = [None] * (n+1)
    a[0] = 1
    inva[0] = 1
    p = 10**9 + 7

    for i in range(1, n+1):
        a[i] = i * a[i-1] % p
        inva[i] = pow(i, p-2, p) * inva[i-1] % p

    ans = (a[n] * inva[r] % p) * inva[n-r] % p
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 62940
n=int(input())
t,x,y=[],[],[]

for i in range(n):
    a,b,c=map(int,input().split())
    t.append(a)
    x.append(b)
    y.append(c)

current=[0,0]
for i in range(n):
    next=[x[i]-current[0],y[i]-current[1]]
    if abs(sum(next))>t[i] or (abs(sum(next))+t[i])%2!=0:
        print('No')
        exit()
print('Yes')

Measured memory_bytes: 11772
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define int long long
#define pb push_back
#define x first
#define y second
#define mk(a,b) make_pair(a,b)
#define rr return 0
#define sqr(a) ((a)*(a))
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

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

template<class value, class cmp = less<value> >
using ordered_set = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class value, class cmp = less_equal<value> >
using ordered_multiset = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class key, class value, class cmp = less<key> >
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
const int INF = 1e9, MOD = 1e9 + 7; /// think
const ll LINF = 1e18;


const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
inline bool inside (int x, int y, int n, int m) {
    return 0 <= x && 0 <= y && x < n && y < m;
}

template<class T> bool umin (T &a, T b) {return a > b ? (a = b, true) : false; }
template<class T> bool umax (T &a, T b) {return a < b ? (a = b, true) : false; }

main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int ans = INF, n;
    cin >> n;
    vector <int> a(n);
    for (auto &i : a) cin >> i;
    for (int i = -100; i <= 200; i++) {
        int res = 0;
        for (int j = 0; j < n; j++) {
            res += sqr(i - a[j]);
        }
        umin(ans, res);
    }
    cout << ans << '\n';
}


Measured memory_bytes: 3660
#include <bits/stdc++.h>
typedef unsigned long long ull;
typedef long long ll;
#define __TRUE "Yes"
#define __FALSE "No"
#define cout(x) cout << (x) << endl
#define MAX 100001
using namespace std;

int main() {
  int m;
  cin >> m;
  cout << 48-m << endl;
}

Measured memory_bytes: 256
/*
 ALLAH is Almighty....
*/
#include <bits/stdc++.h>
using namespace std;
#define pi acos(-1.0)
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);cout << setprecision(12)
#define rep(i,a,n) for (ll i=a;i<n;i++)
#define per(i,a,n) for (ll i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((ll)(x).size())
#define cin1(x) cin >> x
#define cin2(x, y) cin >> x >> y
#define cin3(x, y, z) cin >> x >> y >> z
#define cin4(x, y, z, _) cin >> x >> y >> z >> _
#define cin5(x, y, z, p, q) cin >> x >> y >> z >> p >> q
#define cou(x) cout << x
#define cous(x) cout << x << " "
#define coul(x) cout << x << "\n"
#define ret(x) return x
#define MAX 1000000007
#define start int main() {   fastio
#define finish ret(0); }
#define Test ll _t; cin1(_t); rep(w, 0, _t)
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define cntv(v,a) count(v.begin(),v.end(),a)
#define fans(x) \
    if ( x  ) coul("YES"); \
    else coul("NO")
#define mset(x, y) memset(x, y, sizeof(x))
#define fileshow  freopen("input.txt","r",stdin); freopen("output.txt","w",stdout)

struct point{    int x, y, ind;   char ch;  };
typedef long long ll;
typedef vector<ll> VI;
typedef pair<ll,ll> PII;
typedef double db;
//mt19937 mrand(random_device{}());
const ll mod=1000000007;
//ll rnd(ll x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}ret(res);}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}
ll fact[13];
void factorial() {   fact[0]=1;  rep(i, 1, 12) fact[i]=(fact[i-1]*i);  }
 //for sieve function
//void sieve() {    rep(i, 2, MAX)  {  if (spf[i] == 0) {  spf[i] = i;   sie.pb(i);  }    for (ll j=0; j<SZ(sie) && i*sie[j] <= MAX && sie[j] <= spf[i]; j++)   spf[i * sie[j]] = sie[j]; }   }
bool cmp(point A, point B){   if(A.x != B.x) ret(A.x < B.x);  ret(A.y < B.y);   }
//void segPre(ll l, ll h, ll in) {  ll segTree[3*mx];   if ( l == h ){  segTree[ in ] = arr[ l ];   return;  }   ll m = (l + h) / 2; pre(l, m, 2*in);  pre(m+1, h, 2*in+1);    segTree[ in ] = segTree[ in*2 ] | segTree[ in*2+1 ];   segTree[ in ] = segTree[ in*2 ] ^ segTree[ in*2+1 ];    }
// head collected
// Don't use variable name as --> prev, time, _t, w, y1
// Don't use ceil and pow function


ll h1, m1, h2, m2, ne;
string s1, s2;
ll ans, an;
ll ax[ 1050 ];
ll ay[ 1050 ];


start;

    cin1( s1 );

    rep( i, 0, SZ( s1 ) )
        if ( s1[ i ] == '?' )
            s1[ i ] = 'D';


    coul( s1 );

finish


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

int N, M, A[1 << 18], B[1 << 18], dp[1009][1 << 12];

int main() {
	cin >> N >> M;
	for (int i = 0; i < M; i++) {
		int t; cin >> B[i] >> t;
		for (int j = 0; j < t; j++) { int u; cin >> u; u--; A[i] += (1 << u); }
	}
	for (int i = 0; i <= M; i++) {
		for (int j = 0; j < (1 << N); j++) dp[i][j] = (1 << 30);
	}
	dp[0][0] = 0;
	for (int i = 0; i < M; i++) {
		for (int j = 0; j < (1 << N); j++) dp[i + 1][j] = dp[i][j];
		for (int j = 0; j < (1 << N); j++) dp[i + 1][j | A[i]] = min(dp[i + 1][j | A[i]], dp[i][j] + B[i]);
	}
	int z = dp[M][(1 << N) - 1];
	if (z == (1 << 30)) z = -1;
	cout << z << endl;
	return 0;
}

Measured memory_bytes: 16640
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const int inf = 1e9 + 10;
const ll INF = 1e18;
const ld EPS = 1e-10;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

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

  cout << n * (n - 1) / 2 + m * (m - 1) / 2 << endl;




  
  return 0;
}

Measured memory_bytes: 256
H,W = map(int,input().split())
S = [list(input()) for i in range(H)]
for i in range(H):
    for j in range(W):
        if S[i][j] == '.':
            count = 0
            if i!=0:
                if j!=0 and S[i-1][j-1]=='#':
                    count+=1
                if S[i-1][j]=='#':
                    count+=1
                if j!=W-1 and S[i-1][j+1]=='#':
                    count+=1
            if j!=0 and S[i][j-1]=='#':
                count+=1
            if j!=W-1 and S[i][j+1]=='#':
                count+=1
            if i!=H-1:
                if j!=0 and S[i+1][j-1]=='#':
                    count+=1
                if S[i+1][j]=='#':
                    count+=1
                if j!=W-1 and S[i+1][j+1]=='#':
                    count+=1
            print(count, end='')
        else:
            print(S[i][j], end='')
    print()

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

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

int main()
{
    ll a, b;
    cin >> a >> b;
    ll x = gcd(a, b);
    cout << a * b / x << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

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

const ll mod = 1000000007;

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

  int n;
  cin >> n;
  string s;
  cin >> s;
  int q;
  cin >> q;
  vector<int> k(q);
  for (auto &x: k) cin >> x;

  vector<ll> ans(q);
  for (int i = 0; i < q; i++) {
    ll d = 0;
    ll m = 0;
    ll m_total = 0;
    queue<ll> m_delta;
    for (int j = 0; j < n; j++) {
      if (j-k[i] >= 0) {
        if (s[j-k[i]] == 'D') {
          d--;
          auto m_first = m_delta.front();
          m_delta.pop();
          m -= m_total - m_first;
        }
      }
      if (s[j] == 'D') {
        d++;
        m_delta.push(m_total);
      }
      else if (s[j] == 'M') {
        m += d;
        m_total++;
      }
      else if (s[j] == 'C') {
        ans[i] += m;
      }
    }
  }

  for (auto &x: ans) cout << x << endl;

  return 0;
}


Measured memory_bytes: 9484
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>

using namespace std;

#define ll long long
#define db double
#define clr(a, b) memset(a, b, sizeof(a))

const int maxn = 5e5 + 10;
const int inf = 0x7ffffff;

int x, y, a, b, c;
int p[maxn], q[maxn], r[maxn];
bool cmp(int x, int y) { return x > y; }
void solve()
{
    cin >> x >> y >> a >> b >> c;
    for (int i = 1; i <= a;i++)
        cin >> p[i];
    sort(p + 1, p + a + 1, cmp);
    for (int i = 1; i <= b;i++)
        cin >> q[i];
    sort(q + 1, q + b + 1, cmp);
    for (int i = 1; i <= c;i++)
        cin >> r[i];
    sort(r + 1, r + c + 1, cmp);
    priority_queue<int, vector<int>, greater<int>> pq;
    ll sum = 0;
    for (int i = 1; i <= min(x, a); i++)
        sum += 1ll * p[i], pq.push(p[i]);
    x -= min(x, a);
    for (int i = 1; i <= min(y, b); i++)
        sum += 1ll * q[i], pq.push(q[i]);
    y -= min(y, b);
    int pos = 1;
    for (int i = 1; i <= x;i++)
        sum += r[pos], pq.push(r[pos++]);
    for (int i = 1; i <= y;i++)
        sum += r[pos], pq.push(r[pos++]);
    while ((int)pq.top()<r[pos])
    {
        sum += (r[pos] - pq.top());
        pq.pop();
        pos++;
    }
    cout << sum << "\n";
}

int main()
{
    //freopen("out","w",stdout);
    ios::sync_with_stdio(false);
    cin.tie(0);
    int T = 1;
    //cin >> T;
    while(T-- > 0)
        solve();

}

Measured memory_bytes: 4216
/*Bismillahir Rahmanir Rahim*///{
#include <bits/stdc++.h>
#include <ext/numeric>
using namespace std; using __gnu_cxx::power;
using ll = long long; using ull = unsigned long long; using ld = long double;
const ll llinf = (1ll<<61)-1;
const double eps = 1e-6, ldeps = 1e-9;
struct Dbg {
static constexpr auto &os = cout;   // replace by cerr in interactive.
template<class C> static auto dud(C *x)->decltype(os << *x, 0);
template<class C> static char dud(...);
template<class C> typename enable_if<sizeof dud<C>(0)!=1, Dbg&>::type operator<<(const C &x) { os << x; return *this; }
template<class C> Dbg &dump(C b, C e) {
    *this << "\n[";
    int cur = 0;
    for (C i = b; i!=e and cur<26; i++, cur++) *this << ", "+2*(i==b) << *i;
    return *this << ']';
}
template<class C> typename enable_if<sizeof dud<C>(0)==1, Dbg&>::type operator<<(const C &x) {
    return dump(begin(x), end(x));
}
template<class C, size_t X> typename enable_if<!is_same<C, const char>::value, Dbg&>::type operator <<(C (&x)[X]) {
    return dump(begin(x), end(x));
}
template<class B, class C> Dbg &operator <<(const pair<B, C> &x) {
    return *this << '{' << x.first << ", " << x.second << '}';
}
Dbg &operator<<(ostream&(*x)(std::ostream&)) { os << x; return *this; }
} dbg;
void err(istringstream *iss) { delete iss; }
template<class C, class... Args> void err(istringstream *iss, const C &val, const Args &... args) {
    string name; *iss >> name; if (name.back()==',') name.pop_back();
    dbg << name << " = " << val << "; ", err(iss, args...);
}
#define bug(args...) dbg << __LINE__ << ": ", err(new istringstream(#args), args), dbg << endl
#define cbug(a, args...) if (a) bug(args);
#define ASSERT(a, o, b, args...) if (!((a)o(b))) bug(a, b, ##args), assert((a)o(b));
#define sl(a) int(strlen(a))
#define sz(a) int(a.size())
int T, Q, cn;//}
const int inf = 1000000007, mxn = 100005;

int n, a[mxn];
ll ans;
ll memo[3][mxn];
bitset<mxn> vstd[3];
ll dp(int prv, int at) {
    if (at==n+1) return prv/2;
    auto &ret = memo[prv][at];
    if (vstd[prv][at]) return ret;
    vstd[prv][at] = 1;
    ret = 0;
    int mp = min(a[at], prv);
    for (int i = 0; i <= mp; i++) {
        ret = max(ret, i+(prv-i)/2+dp(a[at]-i, at+1));
    }
    return ret;
}

signed main() { cin.tie(0)->sync_with_stdio(0); cin.exceptions(cin.failbit); cout.precision(11);
    cin >> n;
    for (int i = 1; i <= n; i++) {
        cin >> a[i];
        int tmp = ((a[i]&1) ? a[i]-1 : max(a[i]-2, 0));
        a[i] -= tmp, ans += tmp/2;
    }
    cout << ans+dp(0, 1) << '\n';
}// 9 1 1 1 1 1 2 2 2 1

Measured memory_bytes: 9344
#include <stdio.h>
#include <string.h>
#include <math.h>

int main(void)
{
    char str[80];
    int i,j,k;
    double x;
    double sum;
    int len;

    sum = 0.0;
    while (scanf("%s", str) != EOF)
    {
        len = strlen(str);
        for (i = 0; i < len; i++){
            if ('0' <= str[i] && str[i] <= '9'){
                j = i;
                while (1){
                    if ('0' <= str[i] && str[i] <= '9'){
                        i++;
                    }
                    else{
                        break;
                    }
                }
                i--;
                x = 0.0;
                for (k = i; k >= j; k--){
                    sum += (double)(str[k] - '0') * pow(10.0, x);
                    x++;
                }
                //i++;
            }
        }
    }
    printf("%d\n", (int)sum);

    return (0);
}


Measured memory_bytes: 2076
#include <stdio.h>
#define buf 1000001
int i,j,a,c,d,cnt=0,b[buf],left,right,mid,key;
void binary_search(int d);

int main(void){
	scanf("%d",&a);
	for(i=0;i<a;i++)
		scanf("%d",&b[i]);
	scanf("%d",&c);
	for(j=0;j<c;j++){
		scanf("%d",&d);
    		binary_search(d);
	}
	printf("%d\n",cnt);
	return 0;
}

void binary_search(int d){
	left = 0;
	right = a;
	while(left < right){
		mid = (left + right)/2;
		if(b[mid] == d){
			cnt++;
			break;
		}
        	else if(d < b[mid])
            		right = mid;
        	else if(d > b[mid])
            		left = mid+1;
	}
}

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

#define REP(i,a,b)	for (int i = (a); i < (b); i++)
#define FOR(i,n)	REP (i, 0, n)

int main(void)
{
  int n, d[100];
  cin >> n;
  FOR(i, n) cin >> d[i];

  set<int> values;
  FOR(i, n) values.insert(d[i]);

  cout << values.size() << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream> 
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <sstream>
#include <vector>

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)



int main() {
	int i = 0, j = 0, n,ans,ans2;
	cin >> n;
	if (12 >= n) {
		cout << n << endl;
		return 0;
	}
	ans = n * 100 / 108;
	ans2 = n * 100 % 108;
	if (n <100) {
		if (ans2 == 0) {
			cout << ans << endl;
			return 0;
		}
		if (ans2 * 10 / 108 ==0) {
			cout << ":(" << endl;
			return 0;
		}
		else {
			cout << ans + 1 << endl;
			return 0;
		}
		
	}
	
	if (ans2!=0) {
		if (ans2 * 10 / 108 ==0) {
			cout << ":("  << endl;
			return 0;
		}
		else{
			cout << ans + 1 << endl;
			return 0;
		}
		
	}
	else {
		
		cout << ans << endl;
	}
	return 0;
}

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

using namespace std;
typedef long long ll;

int main(){
  ll N,K,S;
  cin >> N >> K >> S;
  if(S==1){
    for(int i=0;i<K;i++) cout << 1 << " ";
    for(int i=0;i<N-K;i++) cout << 2 << " ";
  }else if(S==2){
    for(int i=0;i<K;i++) cout << 2 << " ";
    for(int i=0;i<N-K;i++) cout << 3 << " ";
  }else{
    for(int i=0;i<K;i++) cout << S << " ";
    for(int i=0;i<N-K;i++) cout << S-1 << " ";
  }
  cout << endl;

  return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <string>
using namespace std;
int main() {
    string s,t;
    cin>>s;
    int n=s.size();
    for(int i=0;i<n;++i){
        if(i%2==0){
            t+=s[i];
        }
    }
    cout<<t<<endl;
    return 0;
}


Measured memory_bytes: 512
MOD = 10 ** 9 + 7
N, M = gets.split.map(&:to_i)
A = M.times.map { gets.to_i }

danger = Array.new(N + 10, false)
A.each do |a|
  danger[a] = true
end
dp = Array.new(N + 10, 0)
dp[0] = 1

0.upto(N - 1) do |i|
  next if danger[i]

  if !danger[i + 1]
    dp[i + 1] = (dp[i + 1] + dp[i]) % MOD
  end

  if !danger[i + 2]
    dp[i + 2] = (dp[i + 2] + dp[i]) % MOD
  end
end

puts dp[N] % MOD


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

int main(void) {
	int n, k;
	cin >> n >> k;
	vector<int> a;
	for (int i = 0; i < n; i++) {
		a.push_back(0);
		cin >> a[i];
	}
	for (int i = k+1; i <= n; i++) {
		cout << ((a[i - k - 1] < a[i - 1]) ? "Yes\n" : "No\n");
	}
	return 0;
}

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

const int N = 2e5 + 50;

int head[N], nxt[N], ver[N], cnt, n, SG[N];

inline void add(int u, int v)
{
	nxt[++cnt] = head[u], ver[cnt] = v, head[u] = cnt;
}

inline void solve(int x, int fa = -1)
{
	for (int i = head[x]; i; i = nxt[i])
	{
		int y = ver[i];
		if (y != fa)
		{
			solve(y, x);
			SG[x] ^= SG[y] + 1;
		}
	}
}

inline char nc()
{
	static char buf[1000000], *p1 = buf, *p2 = buf;
	return p1 == p2 && (p2 = (p1 = buf) + fread(buf, 1, 1000000, stdin), p1 == p2) ? EOF : *p1++;
}

inline int read()
{
	int res = 0;
	char ch;
	do ch = nc(); while (ch < 48 || ch > 57);
	do res = res * 10 + ch - 48, ch = nc(); while (ch >= 48 && ch <= 57);
	return res;
}

int main()
{
	n = read();
	for (int i = 1; i < n; ++i)
	{
		int x = read(), y = read();
		add(x, y), add(y, x);
	}
	solve(1);
	puts(SG[1] ? "Alice" : "Bob");
	return 0;
}


Measured memory_bytes: 6400
#include<bits/stdc++.h>
using namespace std;
const int maxn = 105;
char s[maxn];

bool check(int l, int r){
	for(int i = 0 ; i <= r - l ; i++){
		if(s[l + i] != s[r - i])return false;
	}
	return true;
}

int main(){
	cin >> s + 1;
	int n = strlen(s + 1);
	if(check(1,n) && check(1, (n - 1) / 2) && check((n + 3) / 2, n))cout << "Yes\n";
	else cout << "No\n";
}

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

int main()
{
 int n,a,b;
  cin >> n >> a >> b;
  int cnt = 0;
  for (int i = 0;i < n;i++)
  {
   int tmp;
    cin >> tmp;
    if (tmp < a || tmp >= b)
      cnt++;
  }
  cout << cnt << endl;
}

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

#define ll long long int
#define ull unsigned long long int
#define db double
#define ld long double
#define MOD 1000000007
#define inf (1LL << 62)
#define pi acos(-1.0)
#define si(a) scanf("%lld",&a)
#define sd(n) scanf("%lf", &n)
#define for1(i, stop) for(ll i = 1; i <= stop; i++)
#define for0(i, stop) for(ll i = 0; i < stop; i++)
#define rep1(i, start) for(ll i = start; i >= 1; i--)
#define rep0(i, start) for(ll i = (start-1); i >= 0; i--)
#define loop(i, start, stop, inc) for(ll i = start; i <= stop; i += inc)
#define pb(v,a) v.push_back(a)
#define pll pair <ll, ll>
#define mp make_pair
#define pbp(v,a,i) v.push_back(make_pair(a,i))
#define srt(v) sort(v.begin(),v.end())
#define rv(v) reverse(v.begin(),v.end())
#define ms(n, i) memset(n, i, sizeof(n))
#define debug printf("Debug\n");
#define en '\n'



#define _fastio  ios_base:: sync_with_stdio(false); cin.tie(0); cout.tie(0);
ll divisors[10000003];
int main()
{

    ll n,sm=0;;
    cin>>n;
    for (ll i = 1; i <= n; ++i)
        for (ll j = i; j <= n; j += i)
            ++divisors[j];
    for(ll i=1;i<=n;i++)
        sm+=i*divisors[i];
    cout<<sm<<en;
}


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

using namespace std;

typedef long long ll;

const int INF = 1e9;
const ll LLINF = 1e18;
const ll MOD = (ll)1e9 + 7;

int main()
{
  int N; scanf("%d", &N);
  vector<int> freqs(1e5 + 5, 0);
  int a;
  for (int i = 0; i < N; ++i) {
    scanf("%d", &a);
    ++freqs[a];
    ++freqs[a + 1];
    ++freqs[a + 2];
  }
  int ans = *max_element(freqs.begin(), freqs.end());
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 640
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] h = new int[n];
        for(int i = 0;i < n;i++){
            h[i] = sc.nextInt();
        }
        
        int cnt = 1;
        int max = h[0];
        for(int i = 1;i < n;i++){
            if (max <= h[i]) {
                cnt++;
                max = h[i];
            }
        }
        System.out.println(cnt);
    }
}

Measured memory_bytes: 23764
import scala.io.StdIn
import scala.collection.mutable

object Main extends App {
  val Array(n, k, q)  = StdIn.readLine().split(" ").map(_.toInt)

  var cnt : mutable.Map[Int, Int] = mutable.Map()

  (1 to q).foreach { i =>
    val j =  StdIn.readLine().toInt
    val v = cnt.getOrElse(j, 0)
    cnt += (j -> (v + 1))

  }

  val icnt = cnt.toMap

  (1 to n).map { i =>

    val condition = icnt.getOrElse(i, 0) + k - q
    if (condition > 0) "Yes" else "No"
  }.foreach { v => println(v) }
}


Measured memory_bytes: 62764
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(i64 (i) = (s);(i) < (e);(i)++)
#define rev(i,s,e) for(i64 (i) = (s);(i) --> (e);)
#define all(x) x.begin(),x.end()

template<class T>
static inline std::vector<T> ndvec(size_t&& n, T val) noexcept {
  return std::vector<T>(n, std::forward<T>(val));
}

template<class... Tail>
static inline auto ndvec(size_t&& n, Tail&&... tail) noexcept {
  return std::vector<decltype(ndvec(std::forward<Tail>(tail)...))>(n, ndvec(std::forward<Tail>(tail)...));
}

int main() {
  string N;
  cin >> N;
  i64 K;
  cin >> K;

  auto dp = ndvec(N.size() + 1, 5, 2, 0ll);
  dp[0][0][0] = 1;
  for(i64 i = 0;i < N.size();i++) {
    for(i64 k = 0;k <= K;k++) {
      rep(over, 0, 2) {
        i64 V = (i64)(N[i] - '0') + 1;
        rep(next, 0, (over ? 10ll : V)) {
          i64 nf = over || (next < V - 1);
          dp[i + 1][k + !!(next != 0)][nf] += dp[i][k][over];
        }
      }
    }
  }
  cout << dp[N.size()][K][0] + dp[N.size()][K][1] << endl;
}


Measured memory_bytes: 256