akhauriyash/Code-Regression huggingface dataset:
//============================================================================
// Name        : AOL.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cctype>
#include <string>
#include<algorithm>

using namespace std;



int main(){


	long long n;
	long long l;
	long long r;
	int d;
	cin>>n;

	for(long long i=1; i<n+1; i++){
		cin>>l>>r;
		d+=(r-l)+1;
	}

	cout<<d<<endl;

}


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

#define REP(i, start, count) for (int i = (start); i < (int)(count); ++i)
#define rep(i, count) REP(i, 0, count)
#define ALLOF(c) (c).begin(), (c).end()

typedef long long ll;
typedef unsigned long long ull;

int n;
vector<int> w;
vector<vector<int>> dp;

// メモ化再帰（トップダウン）に書いていく
int rec(int l, int r) {
    int res = 0;
    // もう計算してる
    if (dp[l][r] != -1) return dp[l][r];

    // 範囲内に2個以上ない
    if (abs(r - l) <= 1) return 0;

    // lとrをはじき出せるパターン
    // - wの差が1
    // - 範囲内部 [l + 1, r - 1) が全て取り除ける(範囲r - l からスミの2個を除いたもの)
    if(abs(w[l] - w[r - 1]) <= 1 && rec(l + 1, r - 1) == r - l - 2) {
        res = r - l;
    }

    // 区間を細分化して解くパターン
    for(int mid = l + 1; mid <= r - 1; mid++) {
        res = max(res, rec(l, mid) + rec(mid, r));
    }

    return dp[l][r] = res;
}

int main(void)
{
    int d;
    cin >> d;
    while (d != 0) {
        n = d;
        w.assign(n, 0);
        dp.assign(310, vector<int>(310, -1));
        
        rep(i, n)
        {
            cin >> w[i];
        }

        cout << rec(0, n) << endl;

        cin >> d;
    }
    return 0;
}


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

public class Main {
	
	static int computeMaxProfit(int n, int[] R) {
		int max = -999999999;
		int min = R[0];
		
		for(int i = 1; i < n; i++) {
			max = Math.max(max, R[i] - min);
			min = Math.min(min, R[i]);
		}
		
		return max;
	}
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] R = new int[n];
		for(int i = 0; i < n; i++) {
			R[i] = sc.nextInt();
		}
		
		System.out.println(computeMaxProfit(n, R));
		
	}
}



Measured memory_bytes: 100628
object Main extends App {

  import scala.math._

  val Array(n, d) = scala.io.StdIn.readLine.split(" ").map(_.toInt)

  val x = (1 to n).map { i =>
    scala.io.StdIn.readLine.split(" ").map(_.toInt).toList
  }

  var ans = 0
  (0 until n - 1).foreach { i =>
    (i + 1 until n).foreach { j =>
      val sum = (0 until d).map { k =>
        //println(x(i)(k) + " " + x(j)(k))
        Math.pow(abs(x(i)(k) - x(j)(k)), 2)
      }.sum
    //  println(sum)
      val sq = sqrt(sum).toInt
      if (sq * sq == sum) {
        ans += 1
      }
    }
  }

  println(ans)
}


Measured memory_bytes: 25536
//agrawal117
//chahatagrawal117
#include<bits/stdc++.h>
#define endl '\n'
#define mod 1000000007
typedef long long int ll;
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
  
    ll n; cin>>n;
    ll dp[n+3]={0};
    dp[0]=1;
    for(int i=3;i<=n;i++){
        for(int j=3;j<=n;j++){
            if(i-j>=0) dp[i]=(dp[i]+dp[i-j])%mod;
        }
    }
    cout<<dp[n]<<endl;
}

Measured memory_bytes: 3644
from collections import deque
import math
import os
import random
import re
import sys
#n=list(map(int, input().split()))
#n=map(int, input().split())
N = int(input())
A = list(map(int, input().split()))
A.sort(reverse=True)
if N == 2:
    print(A[0])
else:
    ans = 0
    for i in range(N-1):
        if i == 0:
            ans += A[0]
        else:
            ans += A[(i+1)//2]
    print(ans)#if > plus - mid 1 
    # for i in middle off

Measured memory_bytes: 32636
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <climits>
using namespace std;
#define MOD 998244353
 
long long powmod(int n){
    long long ret = 1;
    for(int i=0; i<n; i++){
        ret *= 2;
        ret %= MOD;
    }
    return ret;
}
 
bool isColinear(pair<int, int> xy1, pair<int, int> xy2, pair<int, int> xy3){
    return (xy1.first-xy2.first)*(xy3.second-xy1.second)==(xy3.first-xy1.first)*(xy1.second-xy2.second);
}
 
 
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<pair<int, int>> xy(N);
    for(int i=0; i<N; i++) cin >> xy[i].first >> xy[i].second;
 
    long long mns = 1 + N + N*(N-1)/2;
    for(int i=0; i<N; i++){
        for(int j=i+1; j<N; j++){
            int cnt = 2;
            for(int k=0; k<N; k++){
                if(k == i || k == j) continue;
                if(!isColinear(xy[i], xy[j], xy[k])) continue;
                if(k < j) break;
                cnt++;
            }
            if(cnt >= 3){
                mns += powmod(cnt);
                mns %= MOD;
                mns += MOD - (1 + cnt + cnt*(cnt-1)/2);
                mns %= MOD;
            }
        }
    }
    long long ans = powmod(N);
    ans += MOD - mns;
    ans %= MOD;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    int W, H, x, y, r;
    scanf("%d %d %d %d %d", &W, &H, &x, &y, &r);
    if(0<=(x-r)&&(x+r)<=W&&0<=(y-r)&&(y+r)<=H){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 2096
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <inttypes.h>
#include <stdint.h>
#include <string.h>
#include <wchar.h>

#define MIN(a, b) (a < b ? a : b)
#define MAX(a, b) (a > b ? a : b)
#define ABSS(a, b) ((a) > (b) ? (a) - (b) : (b) - (a))

int64_t A[200000];

int main(void) {
	char S[1001];
	uint64_t w;

	scanf("%s\n%"PRIu64, S, &w);

	uint64_t pos = 0;
	while (pos < strlen(S)) {
		putchar(S[pos]);

		pos += w;
	}

	return 0;
}


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

#define ll long long
#define f(i,s,e) for(int i=s;i<e;i++)
#define rf(i,s,e) for(int i=e;i>=s;i--)
#define fr first
#define sc second
#define pb push_back
#define  vii vector<int>
#define vll vector<ll>
#define vpii vector<pair<int ,int >>
#define vpll vector<pair<ll, ll> >
#define  pii pair<int,int>
const long mod =998244353;
const int N = 2e3+5;
const long long inf= 1e18;

ll gcd(ll a ,ll b){if(b==0) return a;return gcd(b,a%b);}
ll mul(ll a ,ll b){return (a%mod * b%mod )%mod;}
ll mpower(ll a, ll b){if(b==0) return 1;ll temp=mpower(a,b/2);if(b%2==0){return mul(temp,temp);}else{	return mul(mul(temp,temp) , a);}}
ll inv(ll a){return mpower(a,mod-2);}
ll ncr(ll n, ll r){if(r==0)return 1;ll ans=n%mod;ans=mul(ans,ncr(n-1,r-1));ans=mul(ans,inv(r));	return ans;}
ll power(ll a, ll b){if(b==0) return 1;ll temp=power(a,b/2);if(b%2==0)return temp*temp;else return temp*temp*a;}


void solve()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    bool flg=0;
    int ans=0;
    while(true)
    {
        if(flg)
        {
            a-=d;
            if(a<=0){ans=0;
            break;}
            flg=0;
        }
        else
        {
            c-=b;
            if(c<=0){ans=1;
            break;
            }
            flg=1;
        }
        //cout<<a<<" "<<c<<endl;
    }
    
    if(ans)cout<<"Yes";
    else cout<<"No";
    
    
} 

int main()
{
	ios_base :: sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    while(t--)
    {
        solve();
    }
}

Measured memory_bytes: 3616
import java.util.*;

class Main{

	public static void main(String[] args){
	
		Scanner sc = new Scanner(System.in);

		int max = 0;
		int min = 100;

		for(int i = 0; i<3; i++){
			int A = sc.nextInt();
			max = Math.max(max,A);
			min = Math.min(min,A);
		}
			System.out.println(max - min);
	}
}

Measured memory_bytes: 21716
/************************************************
   Start coding only after you have clear idea. 
*************************************************/

#include <bits/stdc++.h>

#define x first
#define y second
#define pii pair<int,int>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long LL;
const int maxm = 2e3+23;
const int maxn = 2e5+35;
int main(){
    int x; cin >> x;
    int g = __gcd(x,360);
    x = x/g; int ans = 360/g;
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3552
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;

using ll=long long;
using P =pair<int,int>;

int main() {
  int a;
  string s;
  cin>>a>>s;
  if(s.size()<=a){
    cout<<s<<endl;
  }else{
    rep(i,a)cout<<s[i];
    cout<<"..."<<endl;
  }
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
using i64 = int64_t;
using namespace std;

int64_t divceil(int64_t a, int64_t b) {
    return a / b + (a > 0 && a % b ? 1 : 0);
}

int main() {
    i64 D, G;
    cin >> D >> G;
    vector<pair<i64, i64>> data(D);
    for (int i = 0; i < D; i++) {
        i64 p, c;
        cin >> p >> c;
        data[i] = {p, c};
    }
    vector<int> perm(D);
    for (int i = 0; i < D; i++) perm[i] = i;
    i64 ans = 1e14;
    do {
        i64 sum = 0, ans_ = 0;
        for (int i = 0; i < D; i++) {
            int j = perm[i];
            i64 p, c;
            tie(p, c) = data[j];
            i64 a = p * (j + 1) * 100 + c;
            i64 comp = sum + a - G;
            if (comp >= 0) {
                ans_ += min(p, divceil(G - sum, (j + 1) * 100));
                break;
            } else {
                sum += a;
                ans_ += p;
            }
        }
        ans = min(ans, ans_);
    } while (next_permutation(WHOLE(perm)));
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define cina(a, n) for (int i = 0; i < n; ++i){ cin >> a[i]; }
#define ll long long

using namespace std;

int main () {
	
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	int n, m, x;
	cin >> n >> m >> x;
	int c[n], a[n][m];
	for (int i = 0; i < n; ++i) {
		cin >> c[i];
		for (int j = 0; j < m; ++j) {
			cin >> a[i][j];
		}
	}

	int ans = 99999999;
	int all = 1 << n;
	for (int mask = 0; mask < all; ++mask) {
		int level[m];
		memset(level, 0, sizeof(level));
		int cost = 0;
		for (int i = 0; i < n; ++i) {
			if ((mask >> i) & 1) {
				cost += c[i];
				for (int j = 0; j < m; ++j) {
					level[j] += a[i][j];
				}
			}
		}
		bool ok = true;
		for (int i = 0; i < m; ++i) {
			if (level[i] < x) {
				ok = false;
				break;
			}
		}
		if (ok) {
			ans = min(ans, cost);
		}
	}
	if (ans == 99999999) {
		cout << -1;
	} else {
		cout << ans;
	}

	return 0;
}

Measured memory_bytes: 3576
n = int(input())
for x in range(1, n + 1):
    i = x
    if i % 3 == 0:
        print(' {}'.format(x), end = '')
    else:
        while i >= 1:
            if i % 10 == 3:
                print(' {}'.format(x), end = '')
                break
            i = i // 10
print('')




Measured memory_bytes: 5872
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

int main(){ _;
  int n,k;cin>>n>>k;
  int result=k;
  REP(i,n-1){
    result*=(k-1);
  }
  cout<<result<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,sum=0,x,p;
    cin>>n;
    if(n>=500)
    {
        x=n/500;
        p=n%500;
        sum=1000*x+(p/5*5);
        cout<<sum<<endl;
    }
    else
    {
        sum=(n/5)*5;
        cout<<sum<<endl;
    }
}


Measured memory_bytes: 256
import time
from random import randint
d = int(input())
c = list(map(int,input().split()))
starttime = time.time()
timelimit = 1.8
ans = []
fin = [1]*d
pen = [0]*26
sattemp = 0
sat = 0
sl = [list(map(int,input().split())) for i in range(d)]
for i in range(d):
    s = sl[i]
    sp = sum(pen)
    temp = -(10**9)
    for j in range(26):
        if s[j]-(sp-pen[j]) > temp:
            temp = s[j]-(sp-pen[j])
            tempans = j+1
    ans += [tempans]
    sat += s[tempans-1]-sp+pen[tempans-1]
    for j in range(26):
        pen[j] += c[j]
        pen[tempans-1] = 0
fin = ans
ans = []
pen = [0]*26
# while time.time() - starttime <= timelimit:
#     ans = fin
#     d1 = randint(0,d-1)
#     d2 = randint(d1,min(d-1,d1+15))
#     if randint(0,1):
#         ans[d1],ans[d2] = ans[d2],ans[d1]
#         # print(1)
#     else:
#         ans[d1] = randint(1,26)
#         # print(0)
#     pen = [0]*26
#     sattemp = 0
#     for i in range(d):
#         # print(i,fin,fin[i])
#         s = sl[i]
#         sp = sum(pen)
#         tempans = ans[i]
#         sattemp += s[tempans-1]-sp+pen[tempans-1]
#         for j in range(26):
#             pen[j] += c[j]
#             pen[tempans-1] = 0
#         # print(sattemp)
#     if sattemp > sat:
#         fin = ans
#         sat = sattemp
#         # print(sat)
for i in fin:
    print(i)
# print(sat)



Measured memory_bytes: 83744
#include <cstdio>
#include <vector>

int main(void){
	int n, min_edge, next_node, count, sum;
	scanf("%d", &n);
	std::vector< std::vector<int> > edges;
	std::vector<int> isUsed;
	edges.resize(n);
	isUsed.resize(n);
	for(int i=0;i<n;i++){
		isUsed[i]=-1;
		edges[i].resize(n);
		for(int j=0;j<n;j++){
			scanf("%d", &edges[i][j]);
		}
	}

	min_edge=3000;
	isUsed[0] = 1;
	count = 0;
	sum=0;
	while(count<n-1){
		for(int i=0;i<n;i++){
			if(isUsed[i]==1){
				for(int j=0;j<n;j++){
					if (isUsed[j]==-1 && edges[i][j]>-1 && edges[i][j]<min_edge){
						min_edge = edges[i][j];
						next_node = j;
					}
				}
			}
		}
		sum += min_edge;
		isUsed[next_node]=1;
		min_edge = 3000;
		count += 1;
	}
	printf("%d\n", sum);
	return 0;
}

Measured memory_bytes: 2748
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i <= (int)(n); i++)
 
int main(){
  int n, cake = 4, conuts = 7;
  cin >> n;
  for(int i = (int)(n/7); i >= 0; i--){
    rep(j, (int)(n/4)){
      if((n - (i * 7) - (j * 4)) == 0){
        cout << "Yes" << endl;
        exit(0);
      }
    }
  }
  cout << "No" << endl;
}

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

int main(){
    ll N;
    cin >> N;
    if(N % 2){
        cout << 0 << endl;
        return 0;
    }
    
    ll now = 0;
    int cnt = -1;
    while(N >= pow(5, now)){
        cnt++;
        now += 1;
    }
    ll ans = 0;
    for(int i=1;i<=cnt;i++){
        ans += N/(2*ll(pow(5, i)));
    }
    cout << ans << endl;

}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int n,t[100],a,L,R,M,ans;
int main(){
  while(cin>>n&&n){
    for(int i=0;i<n;i++){
      cin>>t[i];
    }
    cin>>a;

    L=0;
    R=n-1;
    ans=0;
    while(L<=R){
      M=(L+R)/2;
      ans++;
      //cout<<t[M]<<endl;
      if(t[M]==a){
	break;
      }else if(t[M]>a){
	R=M-1;
      }else{
	L=M+1;
      }
    }
    cout<<ans<<endl;
  }
  
  return 0;
}

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

using namespace std;

int
main(void){
	int n; cin >> n;
	vector<int> vec(n);
	for(int i = 0; i < n; i++) cin >> vec[i];
	vector<int> ans(n);
	int k = 0;
		for(int i = n/2; i < n; i++){
			ans[i] = k;
			k += 2;
		}
		k = 1;
		for(int i = n/2 - 1; i >= 0; i--){
			ans[i] = k;
			k += 2;
		}
	if(n%2 == 1) reverse(ans.begin(), ans.end());
	for(int i = 0; i < n; i++){
		cout << vec[ans[i]] << " ";
	}
}

Measured memory_bytes: 3712
#include<cstdio>
const int N=200003,M=26;
char s[N];
int n,i,j,f[N],nxt[N][M],k,usd[N];
void init(){
	scanf("%s",s+1);
	while(s[n+1]){
		n++;
		usd[s[n]-97]=1;
	}
	for(j=0;j<M;j++)
		nxt[n+1][j]=n+1;
	for(i=n;i;i--){
		for(j=0;j<M;j++)
			nxt[i][j]=nxt[i+1][j];
		nxt[i][s[i]-97]=i;
	}
}
int min(int x,int y){
	return x<y?x:y;
}
void work(){
	for(i=n+1;i;i--){
		f[i]=1<<30;
		for(j=0;j<M;j++)
			f[i]=min(f[i],f[nxt[i][j]+1]+1);
	}
	for(i=1;i<=n;){
		for(j=0;j<M;j++)
			if(f[i]==f[nxt[i][j]+1]+1)
			break;
		printf("%c",j+97);
		i=nxt[i][j]+1;
	}
}
int main(){
	init();
	work();
	return 0;
}

Measured memory_bytes: 21504
#include <bits/stdc++.h>
using namespace std;
#pragma warning(disable : 4996)
#define gc getchar_unlocked
#define fo(i, n) for (i = 0; i < n; i++)
#define ll long long
#define si(x) scanf("%d", &x)
#define sl(x) scanf("%I64d", &x)
#define ss(s) scanf("%s", s)
#define pb push_back
#define em emplace_back
#define mp make_pair
#define F first
#define S second
#define endl '\n'
#define clr(x) memset(x, 0, sizeof(x))
#define PI 3.1415926535897932384626
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
const int mod = 1e9 + 7;
int epow(int base, int pow)
{
    int result = 1;
    while (pow)
    {
        if (!(pow % 2))
        {
            base = (base * base) % mod;
            pow /= 2;
        }
        else
        {
            result = (result * base) % mod;
            pow--;
        }
    }
    return result;
}
int main(void)
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n = 0, m = 0, i = 0;
    sl(n), sl(m);
    vl res;
    fo(i, m)
    {
        ll val;
        sl(val);
        res.em(val);
    }
    ll o = accumulate(res.begin(), res.end(), 0);
    if (o > n)
        cout << -1;
    else if (o == n)
        cout << 0;
    else
    {
        ll result = n - o;
        cout << result;
    }
}

Measured memory_bytes: 3820
#include<bits/stdc++.h> 
using namespace std;
typedef long long ll;
template<typename T1,typename T2> bool chmin(T1 &a,T2 b){if(a<=b)return 0; a=b; return 1;}
template<typename T1,typename T2> bool chmax(T1 &a,T2 b){if(a>=b)return 0; a=b; return 1;}
int dx[4]={0,1,0,-1}, dy[4]={1,0,-1,0};
long double eps = 1e-9;
long double pi = acos(-1);

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(20);

    ll a,b;
    cin>>a>>b;
    cout << a*b << endl;
}

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

public class MainClass
{
	public const long Giri = 1000000007;
	public const long DpInf = 99999999999999;
	
	
	public static void Main(string[] args)
	{
		var p = Console.ReadLine().ToInt();
		Console.WriteLine((p-2)*180);
	}
	
	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str, int offset = 0)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt() + offset;
		return r;
	}
}

Measured memory_bytes: 11092
#include <iostream>
#include <numeric>
#include <stdio.h>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
#define rep(i, n) for (long long i = 0; i < (long long)(n); i++)






int main() {
	int x,a;
	cin >>x>>a;
	string s = "No";
	if (x == 4 || x == 6 || x == 9 || x == 11) {
		x = 1;
	}
	else if (x==2) {
	}
	else {
		x = 0;
	}
	
	if (a == 4 || a == 6 || a == 9 || a == 11) {
		a = 1;
	}
	else if (a == 2) {
	}
	else {
		a = 0;
	}

	if (x == a) {
		s = "Yes";
	}
	cout <<s<< endl;
}


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

typedef unsigned long long ULL;
typedef long long LL;

using namespace std;

void process();

int main(){
    int N;
    int count=0;
    string s;
    int i;
    cin >> N;
    cin >> s;
    for(i=0;i<N-2;i++){
        if( s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C'){
            count++;
        }
    }
    cout << count << endl;
    return 0;
}

void process(){
    
}

Measured memory_bytes: 256
/*                                                                                 
	Author :- Gaurang_Kothiya
	
	Quote :- " Practice makes a man perfect. "		
*/  
 
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>  
#include <ext/pb_ds/tree_policy.hpp> 
#include <functional>
#include <bitset>
#include <cstdint>
#include <initializer_list>
 
using namespace std;
using namespace __gnu_pbds;  

#define data_set(type) tree<type,null_type,less<type>,rb_tree_tag,tree_order_statistics_node_update>
#define speed ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define ld long double
#define f(i,x,n) for(auto i=x;i<=n;i++)
#define fe(x,v)   for(auto &x :v)
#define nf(i,x,n) for(auto i=n;i>=x;i--)
#define all(a)   a.begin(),a.end()
#define rall(a)  a.rbegin(),a.rend()
#define ook(num) order_of_key(num)
#define fbo(num) find_by_order(num)
#define gcd(a,b) __gcd(a,b)
#define pub push_back
#define pob pop_back
#define puf push_front
#define pof pop_front
#define RE rend()
#define RB rbegin()
#define B begin()
#define E end()
#define acc(v, x) accumulate(all(v), x)
#define p(a,b) pair<a,b>
#define F first
#define S second
#define sz size()
#define v(x) vector<x>
#define m(a,b) map<a,b>
#define u_m(a,b) unordered_map<a,b>
#define mm(a,b) multimap<a,b>
#define s(a) set<a>
#define us(a) unordered_set<a>
#define ms(a) multiset<a>
#define maxy __LONG_LONG_MAX__
#define miny INT_MIN
#define PI 3.14159265358979323846
const ll inf= 1e9;
const ll inf64= 1e18;
const ll MOD= 1e9 +7;

const int n= 1e7 +3;
ll dp[n];

void Solve()
{
	dp[1]=1;
	f(i,2,10000000) dp[i]=2;
	f(i,2,10000000)
	{
		for(int j=2*i ; j<= 10000000; j+=i)
		{
			dp[j] ++;
		}
	}
	ll ans=0;
	int n;
	cin>>n;
	f(i,1,n)
	{
		ans += (i*dp[i]) ;
	}
	cout<<ans;
}
 
signed main() 
{
	speed		

	int q=1;
	//cin>>q;
	
	while(q--)
	Solve();
		
	return 0;
} 

Measured memory_bytes: 81768
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		String TBD = "TBD";
		String HEISEI = "Heisei";

		LocalDate tbdFirstDay = LocalDate.of(2019, 5, 1);

		Scanner sc = new Scanner(System.in);
		String input = sc.nextLine();
		LocalDate dateTime = LocalDate.parse(input, DateTimeFormatter.ofPattern("yyyy/MM/dd"));
		if (dateTime.isBefore(tbdFirstDay)) {
			System.out.println(HEISEI);
		} else {
			System.out.println(TBD);
		}

	}
}


Measured memory_bytes: 28884
#include <stdio.h>
#include <algorithm>
using namespace std;

int main(void){
	int n, m, x;
	int a[200], i;

	scanf("%d%d%d", &n, &m, &x);
	for (i = 0; i < m; i++){
		scanf("%d", &a[i]);
	}
	int left = 0, right = 0;
	for (i = 0; i < m; i++){
		if (a[i] < x) ++right;
		else ++left;
	}
	printf("%d\n", min(left,right));
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main(){
    
    int a;
    string s;
    cin >> a ;
    cin >> s ;
    
    if ( a >= 3200 ){
        cout << s << endl;
    }
    
    else {
        cout << "red" << endl; 
    }
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
//#include <boost/math/common_factor.hpp>
using namespace std;
#define ll long long
int main()
{
    ll a,b,p;
    cin>>a>>b;
    //p=boost::math::lcm(a,b);
    p=(a*b)/__gcd(a,b);
    cout<<p<<endl;
}


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

int h,w;
char maze[1000][1000];

bool cul(char maze[1000][1000]){
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(maze[i][j]=='.') return false;
        }
    }
    return true;
}

int main(){
    cin >> h >> w;
    typedef pair<int,int> P;
    typedef vector<P> V;
    queue <V> que;
    V initial;

    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cin >> maze[i][j];
            if(maze[i][j]=='#') initial.push_back(P(i,j));
        }
    }
    que.push(initial);
    
    if(initial.size()==h*w){
        cout << 0 << endl;
        return 0;
    }
    
    int dx[4]={0,1,0,-1};
    int dy[4]={1,0,-1,0};
    int ans=0;
    

    while(que.size()){
        V p=que.front();
        que.pop();
        V save;
    
        for(int i=0;i<p.size();i++){
            for(int j=0;j<4;j++){
                int nx=p[i].first+dx[j];
                int ny=p[i].second+dy[j];

                if(nx>=0 && nx<h && ny>=0 && ny<w && maze[nx][ny]=='.'){
                    maze[nx][ny]='#';
                    save.push_back(P(nx,ny));
                }
            }
        }
        que.push(save);
        ans++;
        if(cul(maze)) break;
    }
    printf("%d\n",ans);
}

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

struct BIT {
    int n;
    vector<int> data;

    BIT(int size) : n(size), data(n+1, 0) { }

    void add(int k, int a) {
        k++;
        while(k <= n) data[k] += a, k += (k & -k);
    }

    // [0, i) ??????(?????????????????即???)
    int sum(int k) {
        int s = 0;
        while(k > 0) s += data[k], k -= (k & -k);
        return s;
    }

    int sum(int l, int r) {
        return sum(r + 1) - sum(l);
    }
};

int main() {
    int n, q;
    cin >> n >> q;
    BIT bit(n);
    while(q--) {
        int com, x, y;
        cin >> com >> x >> y;
        if(com == 0) {
            bit.add(x - 1, y);
        }
        else {
            cout << bit.sum(x - 1, y - 1) << endl;
        }
    }
}

Measured memory_bytes: 1532
a,b,c = map(int,input().split())
def max(a,b,c):
 if a >= b >= c or a >= c >= b: return 10*a+b+c
 elif b >= c >= a or b >= a >= c: return 10*b+c+a
 elif c >= a >= b or c >= b >= a: return 10*c+a+b
print(max(a,b,c))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
const int inf = 1000000000;

int main(){
  vector<int> A(5);
  cin >> A[0] >> A[1] >> A[2] >> A[3] >> A[4];
  
  vector<int> P = { 0, 1, 2, 3, 4 };
  int final_answer = inf;
  do{
    int ans = 0;
    for(int i = 0; i < 5; i++){
      while(ans % 10 != 0) ans += 1;
      ans += A[P[i]];
    }
    final_answer = min(final_answer, ans);
  }while (next_permutation(P.begin(), P.end()));
  
  cout << final_answer << endl;
  
  return 0;
}


Measured memory_bytes: 764
#include<iostream>
#include<cstdio>
using namespace std;
#define MOD 1000000007
#define MAX 305
void add(int &x,int y){x+=y;if(x>=MOD)x-=MOD;}
inline int read()
{
	int x=0;bool t=false;char ch=getchar();
	while((ch<'0'||ch>'9')&&ch!='-')ch=getchar();
	if(ch=='-')t=true,ch=getchar();
	while(ch<='9'&&ch>='0')x=x*10+ch-48,ch=getchar();
	return t?-x:x;
}
int n,m,ans,a[MAX<<1];
int cnt1,cnt2,f[MAX<<1][MAX][MAX];
int S[MAX<<1];
bool vis[MAX<<1],book[MAX<<1];
int main()
{
	n=read();
	for(int i=1;i<=n+n;++i)a[i]=read();
	for(int i=1;i<=n+n;i+=2)
		if(a[i]==-1&&a[i+1]==-1)++cnt1;
		else if(a[i]>0&&a[i+1]>0)vis[a[i]]=vis[a[i+1]]=true;
		else ++cnt2,book[(~a[i])?a[i]:a[i+1]]=true;
	for(int i=n+n;i;--i)if(!vis[i])S[++m]=i;
	f[0][0][0]=1;
	for(int i=1;i<=m;++i)
		for(int j=0;j<=cnt1+cnt2;++j)
			for(int k=0;k<=cnt2;++k)
			{
				if(!f[i-1][j][k])continue;
				if(!book[S[i]])
				{
					add(f[i][j+1][k],f[i-1][j][k]);
					if(j)add(f[i][j-1][k],f[i-1][j][k]);
					if(k)add(f[i][j][k-1],1ll*k*f[i-1][j][k]%MOD);
				}
				else
				{
					add(f[i][j][k+1],f[i-1][j][k]);
					if(j)add(f[i][j-1][k],f[i-1][j][k]);
				}
			}
	ans=f[m][0][0];for(int i=1;i<=cnt1;++i)ans=1ll*ans*i%MOD;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 217344
#include <iostream>
#include <vector>

int hit(std::vector<int> a, std::vector<int> b){
    int hit_count = 0;
    for(int i = 0; i < 4; ++i){
        if(a.at(i) == b.at(i)){
            hit_count += 1;
        }
    }
    return hit_count;
}

int same_number(std::vector<int> a, std::vector<int> b){
    int same_count = 0;
    for(int i = 0; i < 4; ++i){
        for(int j = 0; j < 4; ++j){
            if(a.at(i) == b.at(j)){
                same_count += 1;
            }
        }
    }
    return same_count;
}

int main(){
    std::vector<int> a_set, b_set;
    int a[4], b[4];
    while(std::cin >> a[0] >> a[1] >> a[2] >> a[3]){
        if(a[0] == -1 or a[1] == -1 or a[2] == -1 or a[3] == -1)  break;
        for(int i = 0; i < 4; ++i){
            a_set.push_back(a[i]);
        }
        std::cin >> b[0] >> b[1] >> b[2] >> b[3];
        if(b[0] == -1 or b[1] == -1 or b[2] == -1 or b[3] == -1)  break;
        for(int i = 0; i < 4; ++i){
            b_set.push_back(b[i]);
        }
        std::cout << hit(a_set, b_set) << " " << same_number(a_set, b_set) - hit(a_set, b_set) << std::endl;
        a_set.clear();
        b_set.clear();
    }
    return 0;
}

Measured memory_bytes: 1216
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */



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

    /*
        ある数列を広義単調増加にするために必要な最小スワップ数について。
        広義単調増加にするということと、転倒数 0 ということが同値。
        ①スワップ 1 回で転倒数は高々 1 しか減らない。
        ②広義単調増加でないならば必ずスワップ によって転倒数を 1 減らせる箇所がある。
        ①②より最小スワップ数は転倒数
    */

    int n; cin >> n;
    vector<int> a(n), b(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];

    int const inf = 1<<29;
    vector<vector<int>> dp((1<<n)+1, vector<int>(55, inf));
    dp[0][0] = 0;
    // dp[mask][s] := mask にある集合を左詰めで広義単調増加に並べ、さらに最後の数字が s であるようにした時の最小スワップ数（転倒数）

    rep(bit, 1<<n) {
        int cnt = __builtin_popcount(bit);

        // まだ使っていない要素について (元の位置, 自分より左にいる要素の数+1) を持つ
        vector<pair<int, int>> rest;
        int itr = cnt;
        rep(i, n) if(!(bit&(1<<i))) rest.emplace_back(i, itr++);

        rep(s, 51) {
            if (dp[bit][s] == inf) continue;
            for(auto p: rest){
                int ns = -1;
                if (abs(p.first - cnt)%2 == 0) ns = a[p.first];
                else ns = b[p.first];

                if (ns>=s) chmin(dp[bit | 1<<p.first][ns], dp[bit][s] + (p.second - cnt));
            }
        }
    }
    
    int ans = inf;
    rep(s, 51) chmin(ans, dp[(1<<n)-1][s]);
    cout << (ans == inf? -1:ans) << endl;
    return 0;
}


Measured memory_bytes: 67968
#include<iostream>
using namespace std;
int main() {
    int a,b;
    char op;

    for(;;) {
    cin >> a >> op >> b;
    
    if(op == '?') {
        break;
    }
    
    switch(op){
        case '+' :
        cout << a+b << endl;
        break;
        case '-' :
        cout << a-b << endl;
        break;
        case '*' :
        cout << a*b << endl;
        break;
        case '/' :
        cout << a/b << endl;
        break;
    }
    }
    

}


Measured memory_bytes: 3108
#include <iostream>
#include <string>

using namespace std;

int main() {
    string s,sun,cloud,rain;
    sun = "Sunny";
    cloud = "Cloudy";
    rain = "Rainy";
    cin >> s;
    
    if(s == sun)
        cout << cloud;
    else if(s == cloud)
        cout << rain;
    else
        cout << sun;
    
    return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <cstdlib>
#include <stack>
#include <string>
using namespace std;

int main()
{
    stack<int> s;
    int a, b;
    string ss;

    while (cin >> ss) {
        switch (ss[0]) {
        case '+':
            a = s.top();    s.pop();
            b = s.top();    s.pop();
            s.push(a + b);
            break;
        case '-':
            b = s.top();    s.pop();
            a = s.top();    s.pop();
            s.push(a - b);
            break;
        case '*':
            a = s.top();    s.pop();
            b = s.top();    s.pop();
            s.push(a * b);
            break;
        default:
            s.push(atoi(ss.c_str()));
        }
    }

    cout << s.top() << endl;

    return 0;
}


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

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

    vector<vector<ll>> A(n, vector<ll>(m));
    vector<vector<ll>> B(m, vector<ll>(l));

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
            cin >> A[i][j];
        }
    }
    for (int i = 0; i < m; i++) {
        for (int j = 0; j < l; j++) {
            cin >> B[i][j];
        }
    }

    for (int i = 0; i < n; i++) {
        for (int j = 0; j < l; j++) {
            ll result = 0;
            for (int k = 0; k < m; k++) {
                result += A[i][k]*B[k][j];
            }
            if (j == l-1) printf("%lld", result);
            else printf("%lld ", result);

        }
        printf("\n");
    }

    return 0;
}



Measured memory_bytes: 3272
MODULE myQsortMod
! 構造型のクイックソート
! 問題に合わせてうまく流用するための元プログラム．
! メンバーsortObjについて，インデックスが小さいと小さい（昇順）

! 他の言語だとpairとかにあたるものを作りたい．
      implicit none
      integer, parameter, private :: p = 16
      
      type myData
        ! setter,getterは作らないで，メインプログラムから直接アクセス．
        
        ! ソートの基準
        integer(p) :: sortObj
        ! その他のデータ
        integer(p) :: a
      end type myData
      
      interface Qsort
        module procedure :: myQsort
      end interface
      
      contains
      pure recursive function myQsort( a ) result( r )
        implicit none
        type(myData), intent(in) :: a(:)
        type(myData) :: r( size(a) )
        integer(p) :: sample(3), len ,i,j
        
        len = size( a )
        if( len<=1 )then
          r = a
        else
          !select pivot
          sample(1:3) = [a(1)%sortObj, a(len/2)%sortObj, a(len)%sortObj]
          do i = 1,2
            do j = 2,3
              if( sample(i)>sample(j) )then
                len = sample(i) !len is now buffer
                sample(i) = sample(j)
                sample(j) = len
              end if
            end do
          end do
          
          r = [ myQsort( pack(a(:), a(:)%sortObj< sample(2)) ), &
                         pack(a(:), a(:)%sortObj==sample(2))  , &
                myQsort( pack(a(:), a(:)%sortObj> sample(2)) ) ]
        end if
      end function myQsort
      end MODULE myQsortMod
      
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

      PROGRAM Megalomania
      use myQsortMod
      IMPLICIT NONE
      INTEGER,PARAMETER :: prec = 16
      integer(prec) :: n
      type(myData),allocatable :: ab(:)
      integer(prec) :: i,time
      
      read*,n
      allocate( ab(n) )
      do i = 1,n
        read*,ab(i)%a,ab(i)%sortObj
      end do
      
      ab = qsort( ab )
      
      time = 0
      do i = 1,n
        !finish work
        time = time + ab(i)%a
        if( time>ab(i)%sortObj )then
          print*,'No';stop
        end if
        
      end do
      
      print*,'Yes'
      
      
      
      stop
      !debugg
      
      
      
      END PROGRAM

Measured memory_bytes: 39244
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for (int i = 0; i< (n); ++i)
const int INF = 1001001001;

int main() {

    int N, T, A;
    cin >> N >> T >> A;

    int h;
    double t[N];
    rep(i, N){
        cin >> h;
        t[i] = T - h * 0.006;
    }
    double min = INF;
    int minIndex = -1;
    rep(i, N){
        if(min > abs(A-t[i])){
            min = abs(A-t[i]);
            minIndex = i;
        }
    }


    int ans = minIndex+1;
//    string ans;
//    if(N <= A){
//        ans = "Yes";
//    }else{
//        ans = "No";
//    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0; i<(n); ++i)
using namespace std;
using ll=long long;
int main(){
    int n,m;
    cin>>n>>m;
    vector<int>x(m),y(m);
    vector<bool>ok(n);
    map<int,int>mp;
    rep(i,n){
        mp[i+1]++;
        ok[i+1]=false;
    }
    ok[1]=true;
    rep(i,m){
        cin>>x[i]>>y[i];
        mp[x[i]]--;
        mp[y[i]]++;
        if(ok[x[i]]==true){
            ok[y[i]]=true;
            if(mp[x[i]]==0){
                ok[x[i]]=false;
            }
        }
    }
    int ans=0;
    for(int i=1; i<=n; ++i){
        if(ok[i]==true){
            ans++;
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 5760
#include <iostream>
#include <queue>
#include <map>
#include <utility>

using namespace std;
int data[70][31]={};
int ans[31][31]={1};
int dx[4]={-1,0,1,0};
int dy[4]={0,-1,0,1};

int main(){
	int w,h;
	while(cin>>w>>h){
		if(!w && !h){
			break;
		}
		for(int i=0;i<h;i++){
			for(int j=0;j<w;j++){
				//visit[i][j]=0;
				ans[i][j]=0;
			}
		}
		ans[0][0]=1;
		for(int i=0;i<2*h-1;i++){
			if(i%2==0){
				for(int j=0;j<w-1;j++){
					cin>>data[i][j];
				}
			}
			else{
				for(int j=0;j<w;j++){
					cin>>data[i][j];
				}
			}
		}

		/*for(int i=0;i<2*h-1;i++){
			for(int j=0;j<w;j++){
				cout<<data[i][j]<<" ";
			}
			cout<<endl;
		}*/
		//---input---

		queue<pair<int,int> > q;
		q.push(make_pair(0,0));
		pair<int,int> now;
		while(!q.empty()){
			now=q.front();
			q.pop();
			if(h-1==now.first && w-1==now.second){
				break;
			}
			//cout<<now.first<<" "<<now.second<<" "<<visit[now.first][now.second]<<endl;
			/*if(visit[now.first][now.second]){
				//cout<<"visited"<<endl;
				continue;
			}*/
			//visit[now.first][now.second]=1;
			for(int i=0;i<4;i++){
				if(ans[now.first+dy[i]][now.second+dx[i]]==0){
					if(i==0 && data[2*now.first][now.second-1]==0 && 0<=now.second+dx[i]){
						//cout<<"hidari"<<endl;
						q.push(make_pair(now.first+dy[i],now.second+dx[i]));
						ans[now.first+dy[i]][now.second+dx[i]]=ans[now.first][now.second]+1;
					}
					else if(i==1 && data[2*now.first-1][now.second]==0 && 0<=now.first+dy[i]){
						//cout<<"ue"<<endl;
						q.push(make_pair(now.first+dy[i],now.second+dx[i]));
						ans[now.first+dy[i]][now.second+dx[i]]=ans[now.first][now.second]+1;
					}
					else if(i==2  && data[2*now.first][now.second]==0 && w>now.second+dx[i]){
						//cout<<"migi"<<endl;
						q.push(make_pair(now.first+dy[i],now.second+dx[i]));
						ans[now.first+dy[i]][now.second+dx[i]]=ans[now.first][now.second]+1;
					}
					else if(i==3 && data[2*now.first+1][now.second]==0 && h>now.first+dy[i]){
						//cout<<"sita"<<endl;
						q.push(make_pair(now.first+dy[i],now.second+dx[i]));
						ans[now.first+dy[i]][now.second+dx[i]]=ans[now.first][now.second]+1;
					}
				}
			}
		}
		cout<<ans[h-1][w-1]<<endl;
	}
	return 0;
}


Measured memory_bytes: 3172
#include <iostream>

int main() {
  int a, b;
  std::cin >> a >> b;

  int palindromic_number_count = 0;
  for (int i = a; i <= b; i++) {
    int one_thousands_place = i / 10000;
    int thousands_place = i / 1000 % 10;
    int tens_place = i / 10 % 10;
    int ones_place = i % 10;
    if (one_thousands_place == ones_place && thousands_place == tens_place) {
      palindromic_number_count++;
    }
  }
  std::cout << palindromic_number_count << std::endl;
}


Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;

public class NewClassC
{
    static void Main(string[] args)
    {
        ABC_C();
    }

    static void ABC_A()
    {
        int[] arr = new int[] { 1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51 };

        var line = Console.ReadLine().Trim();
        int k = Int32.Parse(line);
        Console.WriteLine(arr[k - 1]);
    }
    static void ABC_B()
    {
        var line = Console.ReadLine().Trim().Split(' ').ToArray();
        ulong h = ulong.Parse(line[0]);
        ulong w = ulong.Parse(line[1]);

        ulong odd = h / 2 + h % 2;
        ulong a = h - odd;

        ulong ww = w / 2 + w % 2;
        ulong aw = w - ww;

        ulong res = odd * ww + a * aw;
        Console.WriteLine(res);
    }
    static void ABC_C()
    {
        var line = Console.ReadLine().Trim().Split(' ').ToArray();
        ulong a = ulong.Parse(line[0]);
        ulong b = ulong.Parse(line[1]);
        ulong c = ulong.Parse(line[2]);

        if(c < (a + b)) Console.WriteLine("No");
        else if ((4 * a * b) < ((c - a - b) * (c - a - b))) Console.WriteLine("Yes");
        else Console.WriteLine("No");
    }
    static void ABC_D()
    {

    }
    static void ABC_E()
    {

    }
    static void ABC_F()
    {

    }
}


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

vector<int> g[100001];
int dp[100001][2];
int p[100001];
int root = -1;

void dfs(int me){
    int ccnt = 0;
    for(auto &nxt: g[me]){
        if(nxt == p[me]) continue;
        p[nxt] = me;
        ccnt++;
        dfs(nxt);
    }
    if(ccnt >= 2){
        int one = 1;
        for(auto &nxt: g[me]){
            if(nxt == p[me]) continue;
            dp[me][0] += max(1, dp[nxt][1]);
            dp[me][1] += max(1 - one, dp[nxt][1]);
            if(dp[nxt][1] == 0){
                one = 0;
            }
        }
    /*
    }
    else if(ccnt == 2){
        int w[2] = {0};
        for(auto &nxt: g[me]){
            if(nxt == p[me]) continue;
            if(w[0] == 0) w[0] = nxt;
            else w[1] = nxt;
        }
        int candi1 = max(1, dp[w[0]][0]) + dp[w[1]][1];
        int candi2 = max(1, dp[w[1]][0]) + dp[w[0]][1];
        dp[me][1] = 
        dp[me][0] = max(1, dp[w[0]][0]) + max(1, dp[w[1]][0]);
        */
    }else{
        for(auto &nxt: g[me]){
            if(nxt == p[me]) continue;
            dp[me][0] += max(1, dp[nxt][0]);
            dp[me][1] = dp[nxt][1];
        }
    }
}

int main(){
    int n;
    scanf("%d",&n);
    for(int i=1;i<n;i++){
        int aa, bb;
        scanf("%d%d",&aa,&bb);
        g[aa].push_back(bb);
        g[bb].push_back(aa);
        if(g[aa].size() >= 3) root = aa;
        if(g[bb].size() >= 3) root = bb;
    }
    if(root == -1){
        printf("1\n");
        return 0;
    }
    p[root] = root;
    dfs(root);
    printf("%d\n", dp[root][1]);
}


Measured memory_bytes: 10368
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.io.UncheckedIOException;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Deque;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;

public class Main {
    public void exec(Stdin stdin, PrintWriter stdout) {
        int n = stdin.readInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = stdin.readInt();
        }

        Map<Integer, Integer> s = new HashMap<>();
        for (int v : a) s.put(v, s.getOrDefault(v, 0) + 1);

        int c = 0;
        for (int v : a) {
            List<Integer> factors = new ArrayList<>();
            for (int i = 1; i * i <= v; i++) {
                if (v % i == 0) {
                    factors.add(i);
                    factors.add(v / i);
                }
            }

            boolean ok = true;
            for (int factor : factors) {
                if (factor == v) {
                    if (s.get(factor) > 1) ok = false;
                } else {
                    if (s.containsKey(factor)) ok = false;
                }
            }
            if (ok) c++;
        }

        stdout.println(c);
    }

    public static void main(String[] args) {
        Stdin stdin = new Stdin();
        PrintWriter stdout = new PrintWriter(System.out, false);
        new Main().exec(stdin, stdout);
        stdout.flush();
    }


    public static class Stdin {
        private BufferedReader stdin;
        private Deque<String> tokens;
        private Pattern delim;

        public Stdin() {
            stdin = new BufferedReader(new InputStreamReader(System.in));
            tokens = new ArrayDeque<>();
            delim = Pattern.compile(" ");
        }

        public String nextString() {
            if (tokens.isEmpty()) {
                delim.splitAsStream(readLine()).forEach(tokens::addLast);
            }
            return tokens.pollFirst();
        }

        public int readInt() {
            return Integer.parseInt(nextString());
        }

        private String readLine() {
            try {
                return stdin.readLine();
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }
    }
}


Measured memory_bytes: 78816
#include <cstdio>
#include <algorithm>

int main() {
  
  int a[28] = {};
  
  for(int i=0;i<28;i++) {
    scanf("%d", &a[i]);
  }
  
  std::sort(a, a+28);
  
  int c=1;
  for(int i=1;i<31;i++) {
    if(a[i-c]!=i) {
      printf("%d\n", i);
      c++;
    }
  }
  
  return 0;
}

Measured memory_bytes: 1040
N = int(input())
T = []
for i in range(N):
    for _ in range(int(input())):
        x, y = map(int, input().split())
        T.append((i, x - 1, y))

ans = 0
for i in range(1 << N):
    is_kind = [i >> j & 1 for j in range(N)]
    if all(not is_kind[j] or is_kind[x] == y for j, x ,y in T):
        ans = max(ans, sum(is_kind))
print(ans)


Measured memory_bytes: 3064