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

int main() {
  int n, d;
  std::cin >> n >> d;
  std::vector<int> a(n);
  for (int i = 0; i < n; ++i) std::cin >> a[i];
  std::vector<int> p(n + 1);
  p[0] = d;
  for (int i = 0; i < n; ++i) {
    if (a[i] <= p[i]) {
      p[i + 1] = p[i] - a[i];
    } else if (a[i] <= p[i] + p[i] - 1) {
      p[i + 1] = a[i] - p[i];
    } else {
      p[i + 1] = p[i];
    }
  }
  std::vector<int64_t> dp(n + 1);
  dp[n] = 0;
  for (int i = n - 1; i >= 0; --i) {
    if (a[i] > 2 * dp[i + 1] + 1) dp[i] = dp[i + 1];
    else dp[i] = dp[i + 1] + a[i];
  }
  int q; std::cin >> q;
  while (q--) {
    int i;
    std::cin >> i;
    if (p[n] == 0 && p[i - 1] <= dp[i]) {
      std::cout << "NO\n";
    } else {
      std::cout << "YES\n";
    }
  }
  return 0;
}


Measured memory_bytes: 11008
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#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 SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

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

int n, m;
vector<int> a(5005), b(5005);

bool ch(int x, int y){
  int i=0, j=x;
  while(i<n && j<y){
    if(a[i]==b[j]) j++;
    i++;
  }

  if(j>=y) return true;
  return false;
}

bool search(int x){
  for(int i=0, j=x; j<m; j++, i++){
    if(ch(i, j)) return true;
  }

  return false;
}

int main(){
  scanf("%d%d", &n, &m);
  REP(i, n) scanf("%d", &a[i]);
  REP(i , m) scanf("%d", &b[i]);

  int l=0, r=m, mid;
  REP(i, 100){
    mid=(l+r)/2;
    if(search(mid)) l=mid;
    else r=mid;
  }

  printf("%d\n", l);
}

Measured memory_bytes: 1228
#include <cstdio>
#include <cstdint>
#include <climits>
#include <vector>
#include <algorithm>
#include <utility>
#include <numeric>
#include <string>
#include <tuple>

class disjoint_set {
public:
  using size_type = size_t;

private:
  mutable std::vector<intmax_t> M_c;
  mutable std::vector<size_t> M_e;

public:
  disjoint_set() = default;
  disjoint_set(disjoint_set const&) = default;
  disjoint_set(disjoint_set&&) = default;

  disjoint_set(size_t n): M_c(n, -1), M_e(n, 0) {}

  disjoint_set& operator =(disjoint_set const&) = default;
  disjoint_set& operator =(disjoint_set&&) = default;

  void reset() { M_c.assign(M_c.size(), -1); }

  size_type representative(size_type v) const {
    if (M_c[v] < 0) return v;
    return (M_c[v] = representative(M_c[v]));
  }

  bool unite(size_t u, size_t v) {
    u = representative(u);
    v = representative(v);
    if (u == v) {
      M_e[v] += 1;
      return false;
    }
    if (-M_c[u] > -M_c[v]) std::swap(u, v);
    M_c[v] += M_c[u];
    M_c[u] = v;
    M_e[v] += M_e[u] + 1;
    return true;
  }

  bool equivalent(size_t u, size_t v) const {
    return (representative(u) == representative(v));
  }

  size_type size() const noexcept { return M_c.size(); }
  size_type size(size_type v) const {
    return -M_c[representative(v)];
  }

  size_type edges(size_type v) const { return M_e[representative(v)]; }
};

int main() {
  size_t n, h, w;
  scanf("%zu %zu %zu", &n, &h, &w);

  using edge_type = std::tuple<intmax_t, size_t, size_t>;
  std::vector<edge_type> es;
  es.reserve(n);
  for (size_t i = 0; i < n; ++i) {
    size_t r, c;
    intmax_t a;
    scanf("%zu %zu %jd", &r, &c, &a);
    --r, --c;
    es.emplace_back(a, r, h+c);
  }
  std::sort(es.rbegin(), es.rend());

  disjoint_set ds(h+w);
  intmax_t res = 0;
  for (auto const& e: es) {
    size_t r, c;
    intmax_t a;
    std::tie(a, r, c) = e;

    if (ds.size(r) + ds.size(c) >= ds.edges(r) + ds.edges(c) + 1) {
      res += a;
      ds.unite(r, c);
    }
  }
  printf("%jd\n", res);
}


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

using namespace std;

int main() {
  string s, s1, s2;
  cin >> s;
  s1 = s.substr(0, 4);
  s2 = s.substr(4, 8);

  cout << s1 << " " << s2 << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
#include <numeric>
using namespace std; using ll = long long; using ld = long double;  using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
using vs = vector<string>; using tll = tuple<ll, ll, ll>; using vtll = vector<tll>;
const ld PI = 3.1415926535897932;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define rep1(n) for(ll i=0;i<n;++i)
#define rep2(i,n) for(ll i=0;i<n;++i)
#define rep3(i,a,b) for(ll i=a;i<b;++i)
#define rep4(i,a,b,c) for(ll i=a;i<b;i+=c)
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define mp make_pair
#define mt make_tuple
void in() {}
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.first > secondElof.first;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop, bitSearch, bitList, nod//
//gcdlcm, isPrime, eratos, primeFactorize, Npow, combination, divisor, modinv,  digitDP//
//dfs, bfs, dijkstra, WarshallFloyd, BellmanFord, UnionFind, Kruskal ,RMQ, LCA//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R, Q;
ll MOD = 1000000007; ll INF = 1LL << 60; ll ans = 0; ll z = 0, o = 1;
vl flag; vll path; vl D;
//***********//
vl divisor(ll n) {
	vl ret;
	for (ll i = 2; i * i <= n; ++i) {
		if (n % i == 0) {
			ret.push_back(i);
			if (i != 1 && i * i != n) ret.push_back(n / i);
		}
	}
	ret.push_back(n);
	return ret;
}

int main() {
	cin >> N;
	ans = 0; // N=K
	if (N == 2) {
		cout << 1;
		exit(0);
	}
	vl P(1000001);
	for (k = 2; k <= 1000000; k++) {
		ll n = N;
		while (n % k == 0) n /= k;
		if (n == 1) {
			ans++; P[k] = 1;
		}
		else {
			if ((n - 1) % k == 0) {
				ans++;
				P[k] = 1;
			}
		}
	}
	if (N > 1000000) ans++;
	vl D = divisor(N - 1); //debug(D);
	for (i = 0; i < D.size(); i++) {
		if (D[i] > 1000000) ans++;
		else if (!P[D[i]]) ans++;
	}
	cout << ans;
}


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

int main(){
    int a, b, k;
    cin >> a >> b >> k;

    set<int> ans;

    for(int i = a; i <= min(a + k - 1, b); i++){
        ans.insert(i);
    }
    for(int i = b; i >= max(b - k + 1, a); i--){
        ans.insert(i);
    }

    int set_size = ans.size();

    for(auto itr = ans.begin(); itr != ans.end(); ++itr){
        cout << *itr << endl;
    }
}

Measured memory_bytes: 256
#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, M; scanf("%d %d", &N, &M);
  vector<ll> X(N), Y(N), Z(N);
  for (int i = 0; i < N; ++i) {
    scanf("%lld %lld %lld", &X[i], &Y[i], &Z[i]);
  }
  ll ans = -1;
  vector<int> signs = { 1, -1 };
  for (int i = 0; i < (1 << 3); ++i) {
    vector<pair<ll, int>> v;
    for (int j = 0; j < N; ++j) {
      ll a = X[j] * signs[((i >> 2) & 1)];
      ll b = Y[j] * signs[((i >> 1) & 1)];
      ll c = Z[j] * signs[((i >> 0) & 1)];
      v.push_back(make_pair(a + b + c, j));
    }
    sort(v.begin(), v.end(), greater<pair<ll, int>>());
    ll sx = 0, sy = 0, sz = 0;
    for (int j = 0; j < M; ++j) {
      int ix = v[j].second;
      sx += X[ix];
      sy += Y[ix];
      sz += Z[ix];
    }
    ll sum = abs(sx) + abs(sy) + abs(sz);
    ans = max(ans, sum);
  }

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  FOR(i,0,n)
#define pai 3.14159265358979323846
const int INF = 1001001001;
typedef long long ll;
int A[3][3], N;
bool punched[3][3];
bool ok[3][3];
int a[3][3],n;
using Graph = vector<vector<int>>;
vector<vector<int>> field;
vector<bool> seen;

const int MOD = 1000000007;
typedef pair<int,int> P;
 
int main(){
  int n;
  cin >> n;
  int cnt = 0,ans,a=1;
  while (n>=a){
	  a *= 2;
  }
  a/=2;
	cout << a << endl;
  
} 

Measured memory_bytes: 256
fun main(arr:Array<String>) {
    val (r, d, x2000) = readLine()!!.split(" ").map { it.toLong() }
    val ans = mutableListOf<Long>()
    var prev = x2000
    for(i in (2001..2010)) {
        val tmp = r*prev-d
        println(tmp)
        prev = tmp
    }

}

Measured memory_bytes: 37864
#include <cstdio>
#include <iostream>
#include <string>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <algorithm>

using namespace std;

int K, T;

int main() {
	int suma = 0, maxa = 0;
	scanf("%d%d", &K, &T);
	for (int i = 0; i < T; ++i) {
		int x;
		scanf("%d", &x);
		suma += x;
		maxa = max(maxa, x);
	}
	suma -= maxa;
	printf("%d\n", K - suma - min(suma + 1, maxa));
	return 0;
}

Measured memory_bytes: 256
while True:
    m,f,r=map(int,input().split())
    if m==-1 and f==-1 and r==-1:
        break
    elif m==-1 or f==-1:
        print("F")
    else:
        s=m+f
        if s>=80:
            print("A")
        if 65<=s<80:
            print("B")
        if 50<=s<65:
            print("C")
        if 30<=s<50:
            if r>=50:
                print("C")
            else:
                print("D")
        if s<30:
            print("F")
            


Measured memory_bytes: 5596
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <iterator>
#pragma warning(disable:4996)
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define MOD 1000000007
using namespace std;



int main(int argc, char* argv[])
{
    long n,a,b;
    scanf("%ld%ld%ld", &n, &a,  &b);

    printf("%ld %ld\n", MIN(a,b), MAX(a+b-n,0));
 
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e18
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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;

signed main()
{
    string t;
    cin >> t;
    int d = 0;
    int pd = 0;
    for (int i = 0; i < t.size(); i++)
    {
        if(t[i]=='?'){
            t[i] = 'D';

        } 
    }     
    cout << t << endl;

    return 0;
}

Measured memory_bytes: 3756
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    long long a[100009],b[100009],ans=0;
    scanf("%d",&n);
    for(int i=1;i<=n+1;i++)
        scanf("%lld",&a[i]);
    for(int i=1;i<=n;i++)
        scanf("%lld",&b[i]);
    for(int i=1;i<=n;i++)
    {
        if(b[i]>=a[i])
        {
            ans+=a[i];
            b[i]-=a[i];
            if(b[i]>=a[i+1])
            {
                ans+=a[i+1];
                a[i+1]=0;
            }
            else
            {
                ans+=b[i];
                a[i+1]-=b[i];
            }
        }
        else
            ans+=b[i];
    }
    printf("%lld",ans);
    return 0;
}


Measured memory_bytes: 1792
//#include<bits/stdc++.h>
#include<cstdio>
#include<string>
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

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	char C = getcha();
	int A = C - '0';
	while ((C = getcha()) >= '0') A = A * 10 + C - '0';
	return A;
}

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


	int N = getint(), K = getint(), Q = getint();

	int P[100001];
	rep1(i, N) {
		P[i] = K - Q;
	}
	rep(i, Q) {
		P[getint()]++;
	}
	string S;
	rep1(i, N) {
		if (P[i] > 0) S += "Yes\n";
		else S += "No\n";
	}
	printf("%s", S.c_str());

	Would you please return 0;
}

Measured memory_bytes: 1668
#include<bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i, n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
void yes(){ cout << "Yes" << endl; }
void no(){ cout << "No" << endl; }
int SIZE(string s){ return (int)s.size(); }

int main(){
    int n; cin >> n;
    vector<int> a(n+1), b(n+1);
    rep(i,n+1) cin >> a[i];
    rep(i,n) cin >> b[i];
    ll ans = 0;
    rep(i,n){
        int num = min(a[i], b[i]);
        ans += num; b[i] -= num;
        int num2 = min(a[i+1], b[i]);
        ans += num2; a[i+1] -= num2;
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

int find(vector<int> &arg, int argValue)
{
	vector<int>::iterator it(arg.begin());
	int result(0);
	

	while (1)
	{
		it = find(it, arg.end(), argValue);
		
		if (it == arg.end())
		{
			return result;
		}
		
		result++;
		it++;
	}
}

int main()
{
	int pnum;
	
	cin >> pnum;
	
	vector<int> num1, num2, num3;
	num1.reserve(pnum); num2.reserve(pnum); num3.reserve(pnum);
	
	for (int i(0); i < pnum; i++)
	{
		int t1, t2, t3;
		
		cin >> t1;
		cin >> t2;
		cin >> t3;
		
		num1.push_back(t1);
		num2.push_back(t2);
		num3.push_back(t3);
	}
	
	for (int i(0); i < pnum; i++)
	{
		int tmpScore(0);
		
		if (find(num1, num1[i]) <= 1)
		{
			tmpScore += num1[i];
		}
		
		if (find(num2, num2[i]) <= 1)
		{
			tmpScore += num2[i];
		}
		
		if (find(num3, num3[i]) <= 1)
		{
			tmpScore += num3[i];
		}
		
		cout << tmpScore << endl;
	}
}

Measured memory_bytes: 3088
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef vector<int> vi; 
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,a,b) for(int i=(a);i<=(b);i++)
#define per(i,a,b) for(int i=(a);i>=(b);i--)
const int mod = 1e9+7;
const int maxn = 2e5+10;
const int inf = 0x3f3f3f3f;
queue<ll> q;
int main()
{
	ios::sync_with_stdio(false);cin.tie(0); 
	int n;
	cin>>n;
	if(n<=9) {
		cout<<n<<'\n';
		return 0;
	}
	rep(i,1,9) q.push(i);
	n-=9;
	ll ans;
	while(1) {
		ll now=q.front();q.pop();
		ll last=now%10;
		now*=10;
		if(last>=1) {
			n--;
			q.push(now+last-1);
			if(n==0) {
				ans=now+last-1;
				break;
			}
		}
		q.push(now+last);
		n--;
		if(n==0) {
			ans=now+last;
			break;
		}
		if(last<=8) {
			n--;
			q.push(now+last+1);
			if(n==0) {
				ans=now+last+1;
				break;
			}
		}
	}
	cout<<ans<<'\n';
	return 0;
}


Measured memory_bytes: 768
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<int,int>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=1000000007;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
string s;
cin>>s;
int n=s.size(),cnt=0;
for(int i=0;i<n;i++){
if(s[i]=='p')cnt++;
}
cout<<n/2-cnt<<endl;
}

Measured memory_bytes: 512
import java.util.Scanner;

class Main{

 public static void main(String args[]){

  Scanner sc = new Scanner(System.in);

	int a = sc.nextInt();

	int sec = a%60;
	int hou = a/3600;
	int min = (a-hou*3600)/60;

  System.out.println( hou+":"+min+":"+sec);

  }
}



Measured memory_bytes: 26216
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;

public class Main {

	static String[] strDay = {"Monday","Tuesday","Wednesday","Thrusday","Friday","Satuday","Sunday"};

	public static void main(String[] args) throws IOException, ParseException {

		InputStreamReader isr = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(isr);

		String str = "";
		List<String> input = new ArrayList<String>();

		while((str = br.readLine()) != null){

			String[] strList = str.split(" ");

			if(!strList[0].equals("0")){

				int month = Integer.parseInt(strList[0]);
				int date = Integer.parseInt(strList[1]);

				input.add(getDay(month, date));


			}else{
				break;
			}


		}

		for(String day : input){
			System.out.println(day);
		}

	}

	private static String getDay(int month, int date) throws ParseException{

		Calendar cal = Calendar.getInstance(Locale.JAPAN);
		SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");

		StringBuilder castMonth = new StringBuilder();
		StringBuilder castDate = new StringBuilder();

		if(month < 10){
			castMonth.append("0");
		}

		castMonth.append(Integer.toString(month));

		if(date < 10){
			castDate.append("0");
		}

		castDate.append(Integer.toString(date));


		Date today = format.parse("2004" + castMonth.toString() + castDate.toString());

		cal.setTime(today);

	    switch (cal.get(Calendar.DAY_OF_WEEK)) {
	        case Calendar.SUNDAY: return "Sunday";
	        case Calendar.MONDAY: return "Monday";
	        case Calendar.TUESDAY: return "Tuesday";
	        case Calendar.WEDNESDAY: return "Wednesday";
	        case Calendar.THURSDAY: return "Thursday";
	        case Calendar.FRIDAY: return "Friday";
	        case Calendar.SATURDAY: return "Saturday";
		    }
		return null;
	}
}

Measured memory_bytes: 27732
import math

cnt=0

N,D=(int(x) for x in input().split())

for i in range(N):
  X,Y=(int(x) for x in input().split())
  box=pow(X,2)+pow(Y,2)
  tmp = math.sqrt(box)
  if D >= tmp:
    cnt = cnt+1
    
print(cnt)

Measured memory_bytes: 9140
from math import gcd
from collections import defaultdict
mod=10**9+7
_,*S=open(0)
mp=defaultdict(lambda:[0,0])
O=0
for s in S:
    a,b=map(int,s.split())
    if a==b==0:O+=1
    else:
        g=gcd(a,b)
        a//=g
        b//=g
        if a<0 or a==0<b:a,b=-a,-b
        f=0
        if b<0:a,b,f=-b,a,1
        mp[(a,b)][f]+=1
ans=1
for k in mp:x,y=mp[k];ans=ans*(pow(2,x,mod)+pow(2,y,mod)-1)%mod
print((ans+O-1)%mod)

Measured memory_bytes: 81472
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;
#define rep(i, n)  for (int i = 0; i <  (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(x) (x).begin(), (x).end()
const ll INF = ll(1e18)+1;

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

    long double a,b;
    cin >> a >> b;
    
    unsigned long long result = ll(a*b);

    cout << result;
}

Measured memory_bytes: 3748
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int CC = sc.nextInt();
        int C = 2*CC;
        int X = sc.nextInt();
        int Y = sc.nextInt();
        int ans = 0;
        if(C <= A && C <= B){
            ans = 2*Math.max(X, Y)*CC;
        }else if(C <= A && C > B){
            ans += 2*X*CC;
            ans += Math.max(0, Y-X)*B;
        }else if(C > A && C <= B){
            ans += 2*Y*CC;
            ans += Math.max(0, X-Y)*A;
        }else if(C < A+B){
            if(X >= Y){
                ans += 2*Y*CC;
                ans += Math.max(0, X-Y)*A;
            }else{
                ans += 2*X*CC;
                ans += Math.max(0, Y-X)*B;
            }
        }else{
            ans += A*X+B*Y;
        }
        System.out.println(ans);
    }
}

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

int main(void)
{
  long long int a,b,c,d;
  long long int x[4]={0};
  long long int max=0;

  scanf("%lld %lld %lld %lld",&a,&b,&c,&d);

  x[0]=a*c;
  x[1]=a*d;
  x[2]=b*c;
  x[3]=b*d;

  max=x[0];

  for(int i=1;i<4;i++)
  {
    if(max<x[i]) max=x[i];
  }

  printf("%lld\n",max);

  return 0;
}

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

#define lli long long int
#define REP(i,s,l) for(lli i=s;i<l;i++)
#define DEBUG 0
#define INF (1LL<<50)
#define MOD 1000000007

int main(){
    int a, b, c, d;
    cin >> a >> b >> c >> d;

    if(abs(a - c) <= d ||(abs(a - b) <= d && abs(b - c) <= d)){
       cout << "Yes" << endl;
    }else{
       cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
//----------------------------templates
    #pragma GCC optimize ("Ofast")
    #pragma GCC target ("tune=native")
    #pragma GCC target ("avx")
    //----------------------------
    #include <bits/stdc++.h>
    using namespace std;

    typedef long long ll;
    typedef unsigned long long ull;
    #define int ll

    #define FOR(i,j,n) for (int i=(int)(j);i<(n);i++)
    #define REP(i,n) for (int i=0;i<(int)(n);i++)
    #define REPS(i,n) for (int i=1;i<=(int)(n);i++)
    #define REPN(i,n) for (int i=(int)(n)-1;i>=0;i--)
    #define REPNS(i,n) for (int i=(int)(n);i>0;i--)

    #define I(n) scanf("%lld", &(n))
    #define LL(n) scanf("%lld", &(n))
    #define pb(n) push_back((n))
    #define mp(i,j) make_pair((i),(j))
    #define eb(i,j) emplace_back((i),(j))
    #define y0 y3487465
    #define y1 y8687969
    #define j0 j1347829
    #define j1 j234892
    #define uniq(v) v.erase( unique(v.begin(), v.end()), v.end() )

    #define all(x) (x).begin(),(x).end()
    #define sz(x) ((int)(x).size())

    typedef vector<int> vi;
    typedef pair<int,int> pi;
    typedef vector<pi> vpi;
    typedef vector<vi> vvi;
    typedef vector<vpi> vvpi;
    typedef vector<vvi> vvvi;

    const int mod = 998244353;

//--------------------------------------------

int n,dp[305][90101], hv[305][90101];
vi a;

ll powll(ll base,ll power){
    ll ans = 1;
    while (power){
        if (power&1) ans = (base*ans)%mod;
        base = (base*base)%mod;
        power >>= 1;
    }
    return ans;
}

signed main(){
    I(n);
    a.resize(n);
    REP(i,n) I(a[i]);
    sort(all(a));

    int mx = 0;
    dp[0][0] = 1;
    REP(i,n){
        REP(j,mx+1){
            dp[i+1][j] = (dp[i+1][j] + dp[i][j] * 2) % mod;
            dp[i+1][j + a[i]] = (dp[i+1][j + a[i]] + dp[i][j]) % mod;
        }
        mx += a[i];
    }
    int nega = 0;
    int border = mx/2 + 1;
    FOR(j,border,mx+1)
        nega += dp[n][j];
    
    nega = nega * 3 % mod;
    // mx/2
    if (mx % 2 == 0){
        int half = dp[n][mx/2] * 3;

        mx = 0;
        hv[0][0] = 1;
        REP(i,n){
            REP(j,mx+1){
                hv[i+1][j] = (hv[i+1][j] + hv[i][j]) % mod;
                hv[i+1][j + a[i]] = (hv[i+1][j + a[i]] + hv[i][j]) % mod;
            }
            mx += a[i];
        }

        int doubl = hv[n][mx/2] * 3;
        nega = (nega + half - doubl) % mod;
    }


    cout << (powll(3,n) + mod - nega) % mod << endl;
}

Measured memory_bytes: 426240
#include <iostream>
using namespace std;
typedef long long ll;

int main() {
	ll N, D, res = 0, x, y;
	cin >> N >> D;
    for (int i = 0; i < N; ++i){
        cin >> x >> y;
        if (x*x + y*y <= D*D) res++;
    }
    cout << res << endl; 
	return 0;
}

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

const int MOD=1000000007;

int isprime(int n){
  if(n==2)return 1;
  for(int i=2;i<=ceil(sqrt(n));i++){
    if(n%i==0)return 0;
  }
  return 1;
}

int ordf(int n,int p){
  int sum=0;
  for(int i=0;;i++){
    if(n==0)break;
    n/=p;
    sum+=n;
  }
  return sum;
}

int main(){
  int i,j,cnt=0;
  int n;
  cin>>n;
  ll prod=1;
  for(i=2;i<=n;i++){
    if(isprime(i)==1){
      prod=prod*(ordf(n,i)+1)%MOD;
    }
  }
  cout<<prod<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N=2e6+10;
const double pi=3.1415926535898;
int main()
{
	cin.tie(0);cout.tie(0);ios::sync_with_stdio(0);
	int ans;
	cin>>ans;
cout<<ans+ans*ans+ans*ans*ans;
}


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


int main(){
                                                                     

    int n, m, i, j, s;


    cin >> n >> m;


    vector<int> a(n + 1);

    vector<int> b(n + 1);

    vector<int> c(m + 1);

    vector<int> d(m + 1);


    vector<int> t(n + 1);


    for( i = 1 ; i <= n ; i = i + 1 ){

         cin >> a.at(i) >> b.at(i);

         }

    for( i = 1 ; i <= m ; i = i + 1 ){

         cin >> c.at(i) >> d.at(i);

         }


    for( i = 1 ; i <= n ; i = i + 1 ){

         s = 1000000000;

         for( j = 1 ; j <= m ; j = j + 1 ){

              if( s > abs( a.at(i) - c.at(j) ) + abs( b.at(i) - d.at(j) ) ){
                  
                  s = abs( a.at(i) - c.at(j) ) + abs( b.at(i) - d.at(j) );

                  t.at(i) = j;

                  }

              }

         }


    for( i = 1 ; i <= n ; i = i + 1 ){

         cout << t.at(i) << endl;

         }


    return 0;

    }

Measured memory_bytes: 256
N,K=map(int,input().split())
dp=[0]*(K+1)
mod=10**9+7

for i in range(K,0,-1):
  sm=0
  for j in range(2*i,K+1,i):
    sm=(sm+dp[j])%mod
  dp[i]=(pow(K//i,N,mod)-sm)%mod

ans=0
for i in range(1,K+1):
  ans+=(dp[i]*i)%mod
print(ans%mod)

Measured memory_bytes: 11304
using System;
using System.Collections.Generic;
using System.Text;

namespace AtTest.C_Challenge
{
    class ABC_053
    {
        static void Main(string[] args)
        {
            Method(args);
            Console.ReadLine();
        }

        static void Method(string[] args)
        {
            long x = long.Parse(Console.ReadLine());
            int cycle = 11;
            long turnCnt = 0;
            turnCnt = x / cycle * 2;
            if (x % cycle > 0)
            {
                turnCnt += x % cycle > 6 ? 2 : 1;
            }
            Console.WriteLine(turnCnt);
        }
    }
}


Measured memory_bytes: 13140
#include <iostream>
#include <vector>
#include <algorithm>
#include <deque>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	int n; cin >> n;
	vector<int> a(n);
	for(int i=0;i<n;i++){
		cin >> a[i];
	}
	sort(a.begin(),a.end());
	if(a[n-1]-a[0]>=2){
		cout << "No" << endl;
		return 0;
	}
	else if(a[0]==a[n-1]){
		int mi=1;
		int ma=n/2;
		//cout << mi << " " << ma << endl;
		if(a[0]==n-1){
			cout << "Yes" << endl;
			return 0;
		}
		if(a[0]>=mi&&ma>=a[0]&&a[n-1]>=mi&&a[n-1]<=ma){
			cout << "Yes" << endl;
		}
		else{
			cout << "No" << endl;
		}
	}
	else{
		int cnt=0;
		for(int i=0;i<n;i++){
			if(a[0]==a[i])cnt++;
		}
		int oth=n-cnt;
		int mi=cnt+1;
		int ma=cnt+oth/2;
		//cout << mi << " " << ma << endl;
		if(a[0]>=mi-1&&ma-1>=a[0]&&a[n-1]>=mi&&a[n-1]<=ma){
			cout << "Yes" << endl;
		}
		else{
			cout << "No" << endl;
		}
	}
}

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

namespace ITP1_4_D
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.ReadLine();
            var nums = Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
            int min = nums[0];
            int max = nums[0];
            long sum = nums[0];
            foreach(var num in nums.Skip(1))
            {
                min = Math.Min(num, min);
                max = Math.Max(num, max);
                sum += num;
            }
            Console.WriteLine("{0} {1} {2}", min, max, sum);
        }
    }
}

Measured memory_bytes: 10216
N, M = map(int, input().split())
AB = [list(map(int, input().split())) for _ in range(M)]

class UnionFind:
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):  # 要素xが属するグループの根を返す
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):  # 要素xが属するグループと要素yが属するグループとを併合する
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def same(self, x, y):  # 要素x, yが同じグループに属するかどうかを返す
        return self.find(x) == self.find(y)

    def size(self, x):  # 要素xが属するグループのサイズ（要素数）を返す
        return -self.parents[self.find(x)]

    def members(self, x):  # 要素xが属するグループに属する要素をリストで返す
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):  # すべての根の要素をリストで返す
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):  # グループの数を返す
        return len(self.roots())

    def all_group_members(self):  # {ルート要素: [そのグループに含まれる要素のリスト], ...}の辞書を返す
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):  # ルート要素: [そのグループに含まれる要素のリスト]を文字列で返す
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

uf = UnionFind(N)
for i in range(M):
    uf.union(AB[i][0] - 1, AB[i][1] - 1)
print(uf.group_count() - 1)


Measured memory_bytes: 93760
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int MOD = 1000000007;

// 最大公約数
ll gcd(ll m, ll n) {
  if (n==0) return abs(m);
  else return gcd(n, m%n);
}

// 素因数分解(素因数とその指数を返す)
map<ll, int> prime_factor(ll n) {
  map<ll, int> ret;
  for (ll i=2; i*i<=n; i++) {
    while (n%i==0) {
      ret[i]++;
      n /= i;
    }
  }
  if (n!=1) ret[n] = 1;
  return ret;
}

int main() {
  ll A, B;
  cin >> A >> B;
  ll g = gcd(A, B);
  // gの素因数の個数が答え
  map<ll, int> ans = prime_factor(g);
  cout << ans.size()+1 << endl;
}

Measured memory_bytes: 256
//inlclude前用define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
//#include<deque>
#include<iomanip>
#include<set>
#include<tuple>
#include<map>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long long int ll;

//define
#define INF 1e9 
#define NUM 1000000007
#define all(x) begin(x), end(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	string s;
	cin >> s;
	string yaki = "YAKI";
	bool flag = true;

	rep(i, yaki.size()) {
		if (yaki[i] != s[i]) flag = false;
	}
	if (flag) cout << "Yes" << endl;
	else cout << "No" << endl;


	return 0;
	
}





Measured memory_bytes: 256
from collections import*
from heapq import*
n,m,*t=map(int,open(0).read().split())
d=defaultdict(list)
for a,b in zip(t[::2],t[1::2]):d[a].append(b)
q=[]
for i in sorted(d.keys())[::-1]:
    for b in sorted(d[i])[::-1][:m-i+1]:
        if len(q)<=m-i:heappush(q,b)
        elif q and q[0]<b:heappushpop(q,b)
print(sum(q))

Measured memory_bytes: 31528
#include<bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin >> n;
    int cnt1 = 0,cnt2 = 0, cnt3 = 0,i = 1;
    if(n == 4)
    cnt1++;
    else if(n == 2)
    cnt2++;
    else if(n == 1)
    cnt3++;
    while(1){
       i++;
        if(n % 2 == 0){
            n /= 2;
        }
        else
        {
            n = 3 * n + 1;
        }
        if(n == 4)
        cnt1++;
        else if(n == 2)
        cnt2++;
        else if(n == 1)
        cnt3++;
        if(cnt1 == 2 || cnt2 == 2 || cnt3 == 2){
        cout << i << endl;
        return 0;
        }
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define pll pair<ll,ll>
#define pint pll
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

ll cnt[200020];
pll p[200020];

int main(){
  int n,d,a;
  cin >> n >> d >> a;
  d+=d;
  rep(i,n)cin >> p[i].first >> p[i].second;
  sort(p,p+n);
  ll ans=0,sum=0;
  int left=0;
  rep(i,n){
    while(left<n && p[left].first+d<p[i].first){
      sum-=cnt[left];
      left++;
    }
    cnt[i]=(max(0LL,p[i].second-sum*a)+a-1)/a;
    ans+=cnt[i];
    sum+=cnt[i];
  }
  cout << ans << endl;
return 0;}

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

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define Task ""

using namespace std;
typedef long long ll;

const int maxn = 1e5 + 5;

int N, f[maxn][3];

signed main(void)
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    if (fopen("A.INP", "r")){
        freopen("A.INP", "r", stdin);
        freopen("A.OUT", "w", stdout);
    }
    if (fopen(Task".in", "r")){
        freopen(Task".in", "r", stdin);
        freopen(Task".out", "w", stdout);
    }
    cin >> N;
    for (int i=1; i<=N; ++i){
        for (int j=0; j<3; ++j){
            int cost; cin >> cost;
            for (int t=0; t<3; ++t){
                if (j != t)
                    f[i][j] = max(f[i][j], f[i-1][t] + cost);
            }
        }
    }
    cout << max({f[N][0], f[N][1], f[N][2]});
}


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

int main(){
#ifdef LOCAL
    freopen("./input.txt", "r", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    vector<int> a(n);
    
    for (int i = 0; i < n; i++){
        cin >> a[i];
    }
    int ok = 1;
    for (auto i : a) {
        if(i%2 == 0){
            if((i%3) && (i%5))ok = 0;
        }
    }
    
    if(ok){
        cout << "APPROVED" << "\n";
    }else{
        cout << "DENIED" << "\n";
    }
    return 0;
}


Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input():
    return sys.stdin.readline().rstrip()

def main():
    class UnionFind():
        def __init__(self,n):
            self.par=[i for i in range(n)]
            self.siz=[1]*n
            
        def root(self,x):
            while self.par[x]!=x:
                x=self.par[x]
            return x
        
        def unite(self,x,y):
            x=self.root(x)
            y=self.root(y)
            if x==y:
                return False
            if self.siz[x]<self.siz[y]:
                x,y=y,x
            self.siz[x]+=self.siz[y]
            self.par[y]=x
            return True
        
        def is_same(self,x,y):
            return self.root(x)==self.root(y)
        
        def size(self,x):
            return self.siz[self.root(x)]
    
    N,M=map(int,input().split())
    Q=[]
    for _ in range(M):
        Q.append(tuple(map(lambda x:int(x)-1,input().split())))
    uf=UnionFind(N)
    l_ans=[]
    ans=N*(N-1)//2
    for _ in range(M):
        l_ans.append(ans)
        a,b=Q.pop()
        siz_a,siz_b=uf.size(a),uf.size(b)
        if uf.unite(a,b):
            ans-=siz_a*siz_b
    for _ in range(M):
        print(l_ans.pop())
        
    
    

if __name__ == '__main__':
    main()


Measured memory_bytes: 76636
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define show(x) for(auto i: x){cout << i << " ";}
typedef long long ll;
typedef pair<int, string> P;

int main()
{
    int n, m;
    cin >> n >> m; 
    vector<P> a;
    rep(i, m){ int tmpp;  string tmps; cin >> tmpp >> tmps; tmpp--; a.emplace_back(tmpp, tmps);}

    vector<pair<bool, int>> ac_flag(n, make_pair(false, 0));

    rep(i, m){
        if (a[i].second == "AC"){
            if (!ac_flag[a[i].first].first){
                ac_flag[a[i].first].first = true;
            }
        } else {
            if (!ac_flag[a[i].first].first){
                ac_flag[a[i].first].second++;
            }
        }
    }

    int ac_cnt = 0;
    int wa_cnt = 0;
    for(auto ac : ac_flag){
        if (ac.first == true){
            ac_cnt++;
            wa_cnt+=ac.second;
        }
    }

    cout << ac_cnt <<  " "<< wa_cnt << endl;
}



Measured memory_bytes: 7280
#include <stdio.h>
int main(void){
  int i,a,b,t,ct=0;
  scanf("%d%d%d",&a,&b,&t);
  for(i=1;i<t+1;i++){
    if(i%a==0){
      ct+=b;
    }
  }
  printf("%d\n",ct);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
const ll MOD = 1000000007;

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

    ll ans = 2 * (x / 11);
    x %= 11;
    if(1 <= x && x <= 6){
        ans += 1;
    }else if(6 < x){
        ans += 2;
    }
    cout << ans << endl;

    return 0;
}

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

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


Measured memory_bytes: 256
# include <iostream>
# include <cstring>
# include <string>
# include <vector>
# include <cmath>
# include <sstream>
# include <iomanip>
# include <algorithm>
using namespace std;

# define repl(i, a, b)	for(int i=(int)(a);i<(int)(b);i++)
# define rep(i, n)	repl(i, 0, n)
typedef long long ll;

int main(){
	string str;
	cin >> str;
	for(int i=0;i<4;i++){
		cout << str[i];
	}
	cout << " ";
	for(int i=4;i<str.size();i++){
		cout << str[i];
	}
	cout << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;


int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    int n = 0;
    for (int i = 0; i < s.size(); ++i)
    {
        if (s[i] == '+')
            n++;
        else
            n--;
    }
    cout << n;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	int c[55][30];
	while(~scanf("%d",&n)){
		memset(c,0,sizeof(c));
		for(int i=0; i<n; i++){
			char s[55]; int len;
			scanf("%s",s);
			len=strlen(s);
			for(int j=0; j<len; j++){
				c[i][s[j]-'a']++;
			}
		}
		char ans[55];
		int num=0;
		for(int i=0; i<26; i++){
			int mi=100000;
			for(int j=0; j<n; j++){
				mi=min(c[j][i],mi);
			}
			char c='a'+i;
			for(int i=0; i<mi; i++){
				ans[num++]=c;
			}
		}
		ans[num]='\0';
		printf("%s\n",ans);
	}
	return 0;
}

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

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

int main()
{
    int N;
    cin >> N;
    vector<int> A1(N);
    vector<int> A2(N);
    rep(i, N)
    {
        cin >> A1.at(i);
    }
    rep(i, N)
    {
        cin >> A2.at(i);
    }

    int max = -1;
    int sum1 = 0;
    rep(i, N)
    {
        sum1 += A1.at(i);
        int sum2 = 0;
        for (int j = i; j < N;j++)
        {
            sum2 += A2.at(j);
        }

        if(max < (sum1 + sum2))
        {
            max = sum1 + sum2;
        }
    }

    cout << max << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <cassert>

using namespace std;
typedef long long LL;
template <typename F, typename S> std::ostream& operator<<(ostream& os, const pair<F,S>& p) {
    os << "(" << p.first << "," << p.second << ")"; return os; }
template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "["; for(const T& a: v){ os << a << ", "; } os << "]"; return os; }
template <typename K, typename V> ostream& operator<<(ostream& os, const map<K,V>& m) {
    os << "{"; for(const auto& p: m){ os << p.first <<":"<< p.second << ", "; } os << "}"; return os; }


vector<LL> zalgorithm(string& S){
    vector<LL> A(S.size());
    A[0] = S.size();
    int i = 1, j = 0;
    while (i < S.size()) {
      while (i+j < S.size() && S[j] == S[i+j]) ++j;
      A[i] = j;
      if (j == 0) { ++i; continue;}
      int k = 1;
      while (i+k < S.size() && k+A[k] < j) A[i+k] = A[k], ++k;
      i += k; j -= k;
    }
    return A;
}

int main(){
    LL n;
    cin >> n;
    string s;
    cin >> s;
    LL ans = 0;
    for(LL i = 0; i < n; ++i){
        string s2 = s.substr(i);
        vector<LL> a = zalgorithm(s2);
        for(LL j = 1; j < a.size(); ++j){
            ans = max(ans, min(j, a[j]));
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
class in{struct It{int it;const bool rev;explicit constexpr It(int it_, bool rev=false):it(it_),rev(rev){}int operator*(){return it;}bool operator!=(It& r){return it!=r.it;}void operator++(){rev?--it:++it;}};const It i,n;public:explicit constexpr in(int n):i(0),n(n<0?0:n){}explicit constexpr in(int i,int n):i(i,n<i),n(n){}const It& begin(){return i;}const It& end(){return n;}};

#include <bits/stdc++.h>
using namespace std;

int Scc(const vector<vector<int>>& adj, vector<int>& color) {
    const int n = adj.size();
    vector<int> num(n, 0), low(n, 0), sta;
    color.assign(n, 0);
    deque<bool> inS(n, 0);
    int t = 0, colnum = 0;
    function<void(int)> visit = [&](int cur) {
        low[cur] = num[cur] = ++t;
        sta.emplace_back(cur); inS[cur] = 1;
        for(int nxt : adj[cur]) {
            if(num[nxt] == 0) {
                visit(nxt);
                low[cur] = min(low[cur], low[nxt]);
            } else if(inS[nxt])
              low[cur] = min(low[cur], num[nxt]);
        }
        if(low[cur] == num[cur]) {
            while(true) {
                int nxt = sta.back(); sta.pop_back(); inS[nxt] = false;
                color[nxt] = colnum;
                if(cur == nxt) break;
            }
            ++colnum;
        }
    };
    for(int v : in(n))
      if(num[v] == 0)
        visit(v);
    return colnum;
}

using i64 = long long;
const i64 MOD = 1e9 + 7;
int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int n, m;
    cin >> n >> m;
    vector<vector<int>> __adj(n);
    for(int _ : in(m)) {
        int u, v;
        cin >> u >> v;
        --u; --v;
        __adj[u].emplace_back(v);
    }
    vector<int> color;
    int col = Scc(__adj, color);
    vector<vector<int>> radj(col);
    vector<int> deg(col, 0);
    vector<bitset<1000>> used(col, bitset<1000>(0));
    for(int v : in(n))
      for(int u : __adj[v])
        if(color[v] != color[u] && used[color[u]][color[v]] == 0)
          radj[color[u]].emplace_back(color[v]), ++deg[color[v]], used[color[u]][color[v]] = 1;
    vector<i64> dp(col, -1LL);
    i64 ans = 1LL;
    function<i64(int)> dfs = [&](int v) {
        assert(v != -1);
        i64& res = dp[v];
        if(res != -1LL) return res;
        res = 1LL;
        for(int u : radj[v])
          res = res * dfs(u) % MOD;
        return ++res;
    };
    for(int v : in(col)) {
        if(dp[v] != -1LL || deg[v] != 0) continue;
        ans = ans * dfs(v) % MOD;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3360
using System;

namespace A___Red_or_Not
{
    class Program
    {
        static void Main (string[] args)
        {
            var a = int.Parse (Console.ReadLine ());
            var s = Console.ReadLine ();
            if (a >= 3200)
            {
                Console.WriteLine (s);
            }
            else
            {
                Console.WriteLine ("red");
            }
        }
    }
}

Measured memory_bytes: 11092
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include<string>
#include<iostream>
#include<set>
#include<map>
#include<bitset>
 
using namespace std;
typedef long long ll;
#define i_7 1000000007
#define i_5 1000000005
 
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    else return c+i_7;
}
typedef pair<int,int> i_i;
typedef pair<ll,ll> l_l;
ll inf=1000000000000;/*10^12*/
#define rep(i,l,r) for(ll i=l;i<=r;i++)
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
 
 
//////////////////////////////////////
 
int main(){
    int a[3];rep(i,0,2)cin>>a[i];
    sort(a,a+3);
    cout<<a[2]-a[0]<<endl;
    return 0;
}

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

int main()
{
        int a, b, c;
        int num;

        cin >> num;

        for(int i=0; i<num; i++){
                cin >> a >> b >> c;
                if( a>=b && a>=c ){
                        (a*a == b*b+c*c) ? cout<<"YES\n" : cout<<"NO\n";
                }else if( b>=a && b>=c ){
                        (b*b == a*a+c*c) ? cout<<"YES\n" : cout<<"NO\n";
                }else if( c>=a && c>=b ){
                        (c*c == b*b+a*a) ? cout<<"YES\n" : cout<<"NO\n";
                }
        }

        return 0;
}

Measured memory_bytes: 1124
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define repA(a,i,n) for(int i=a;i<n;i++)
#define trav(a,x)for(auto &a: x)
#define fll(a) memset(a,0,sizeof(a));
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define fst first
#define sec second
#define itr(it,x) for(auto it=x.begin();it!=x.end();it++)
typedef long long ll;
typedef long double ld;
typedef pair<int,int>pii;
typedef vector<int>vi;
typedef map<int,int>ma;
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL);
void fopen()
{
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);	
}
bool func(int n,int i,int c)
{
	if(n==1)
	{
		if(c==2)
			{return true;}
		return false;
	}
	//cout<<n<<endl;
	if(i>9 || c>2){return false;}
	if(n%i==0)
	{
		return func(n/i,i,c+1)||func(n/i,i+1,c+1)||func(n,i+1,c);
	}
	return func(n,i+1,c);
}
int main()
{
	fastio;
	//fopen();
	int n;
	cin>>n;
	//cerr<<func(n,1,0);
	if(n==1 || n==2 || n==3 || n==5 || n==7)
		{cout<<"Yes";exit(0);}
	if(func(n,2,0)){cout<<"Yes";exit(0);}
	cout<<"No";
}

Measured memory_bytes: 256