akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define endl '\n'
int mod=1e9+7;

signed main(){
  int h,w;
  cin>>h>>w;
  vector<string> hw(h);
  for(int i=0;i<h;i++)cin>>hw[i];

  int px[]={1,0,-1,0};
  int py[]={0,-1,0,1};
  int ans=0;

  for(int i=0;i<h;i++){
    for(int j=0;j<w;j++){
      if(hw[i][j]=='#'){
        int a=1;
        int b=0;
        hw[i][j]='@';
        queue<int> qx;
        queue<int> qy;
        queue<int> ab;
        qx.push(j);
        qy.push(i);
        ab.push(1);
        while(!qx.empty()){
          int nx=qx.front();
          int ny=qy.front();
          int nab=ab.front();
          qx.pop();
          qy.pop();
          ab.pop();
          //cout<<ny<<" "<<nx<<endl;
          for(int k=0;k<4;k++){
            int nnx=nx+px[k];
            int nny=ny+py[k];
            if(nnx>=0&&nnx<w&&nny>=0&&nny<h){
              if(nab==1){
                if(hw[nny][nnx]=='.'){
                  b++;
                  qx.push(nnx);
                  qy.push(nny);
                  ab.push(2);
                  hw[nny][nnx]='@';
                }
              }else{
                if(hw[nny][nnx]=='#'){
                  a++;
                  qx.push(nnx);
                  qy.push(nny);
                  ab.push(1);
                  hw[nny][nnx]='@';
                }
              }
            }
          }
        }
        //cout<<a<<" "<<b<<endl;
        ans+=a*b;
      }
    }
  }
  cout<<ans<<endl;
}


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

#define rep(i,n) for(int i = 0; i < n; i++)
#define Rep(i,n) for(int i = 1; i <= n; i++)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
template<class T> using V = vector<T>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/b;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }


int lcs(string s, string t) { // 最長共通部分列長
  int n = s.size();
  int m = t.size();
  vector<vector<int>> dp(n+1,vector<int>(m+1));
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < m; j++) {
      if(s[i] == t[j]) {
        dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + 1);
      }
      dp[i+1][j+1] = max(dp[i+1][j+1], dp[i+1][j]);
      dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j+1]);
    }
  }
  return dp[n][m];
}


int main(){
    int n;
    cin >> n;
    rep(i,n) {
        string s, t;
        cin >> s >> t;
        int ans = lcs(s,t);
        cout << ans << endl;
    }
}


Measured memory_bytes: 6856
#include<iostream>
#include<algorithm>
using namespace std;
#define rep(i,n) for(int i = 0 ; i < (n) ; ++i )
#define req(i,n) for(int i = 1 ; i < (n) ; ++i)
typedef long long ll;
int main(){
  int n;
  while(cin >> n , n){
    ll d[n] , v[n];
    rep(i,n) cin >> d[i] >> v[i];
    ll a = d[0];//lcm
    req(i,n) a = d[i]*a / __gcd(d[i],a);
    ll b[n];
    rep(i,n) b[i] = v[i] * a / d[i];
    ll c = b[0];
    req(i,n) c = __gcd(c,b[i]);
    rep(i,n) cout << b[i] / c << endl;;
  }
}


Measured memory_bytes: 3124
import math
a, b, h, m = map(int, input().split())
alpha = 30.0 * h + (30 * m / 60)
beta = m * 6.0
if alpha < beta:
    theta = beta - alpha
else:
    theta = alpha - beta
print(math.sqrt(a**2 + b**2 - 2 * a * b * math.cos(math.radians(theta))))

Measured memory_bytes: 62292
#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define rep1(i,n) for(ll i=1;i<(ll)n;i++)
#define repf(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define repr(i,a,b) for(ll i=(ll)a;i<(ll)b;i--)
#define Fi first
#define Se second
typedef pair<ll, ll> pll;
const ll MAX = 1000000;
const char ENDL = '\n';


int main() {
	ll N, K, Ans;
	multiset<ll> abc;
	cin >> N >> K;
	vector<ll> a(N), b(N);
	vector<pll>	pairs(N);
	rep(i, N) {
		cin >> a[i] >> b[i];
		pairs[i] = make_pair(a[i], b[i]);
	}
	sort(pairs.begin(), pairs.end());

	ll sub = 0;
	rep(i, N) {
		if (sub < K) {
			Ans = pairs[i].Fi;
			sub += pairs[i].Se;
		}
		else
			break;
	}
	
	cout << Ans << ENDL;
	return 0;
}

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

using ll = long long;
using pii = pair<int, int>;
template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i, n) rep2(i, 0, n)
#define rep2(i, m, n) for (int i = m; i < (n); i++)
#define ALL(c) (c).begin(), (c).end()

constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }

template <class T, class U>
void chmin(T& t, const U& u) {
    if (t > u) t = u;
}
template <class T, class U>
void chmax(T& t, const U& u) {
    if (t < u) t = u;
}

template <class T, class U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
    os << "(" << p.first << "," << p.second << ")";
    return os;
}

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
    os << "{";
    rep(i, v.size()) {
        if (i) os << ",";
        os << v[i];
    }
    os << "}";
    return os;
}

#ifdef LOCAL
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << H;
    debug_out(T...);
}
#define debug(...) \
    cerr << __LINE__ << " [" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define dump(x) cerr << __LINE__ << " " << #x << " = " << (x) << endl
#else
#define debug(...) (void(0))
#define dump(x) (void(0))
#endif

ll dp[2010][2010];

int main() {
    int N;
    cin >> N;
    V<int> A(N);
    rep(i, N) cin >> A[i];
    V<pii> B(N);
    rep(i, N) B[i] = mp(A[i], i);
    sort(ALL(B));
    reverse(ALL(B));

    for (int l = 0; l <= N; ++l) {
        for (int r = 0; r < N - l; ++r) {
            int use = l + r;
            chmax(dp[l + 1][r],
                  dp[l][r] + abs(l - B[l + r].se) * (ll)B[l + r].fi);
            chmax(dp[l][r + 1],
                  dp[l][r] + abs(N - 1 - r - B[l + r].se) * (ll)B[l + r].fi);
        }
    }
    ll ans = 0;
    rep(i, N + 1) { chmax(ans, dp[i][N - i]); }
    cout << ans << endl;

    return 0;
}

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


int main () {
    int a, b, c;
    cin >> a >> b >> c;
    
    int res = 0;
    
    if (a % 2 == 1 or b % 2 == 1 or c % 2 == 1) {
        res = 0;
    }
    
    else if (a == b and b == c) {
        res = -1;
    }
    
    else {
        while (a % 2 == 0 and b % 2 == 0 and c % 2 == 0) {
            res += 1;
            int p, q, r;
            p = (b + c) / 2;
            q = (c + a) / 2;
            r = (a + b) / 2;
            a = p;
            b = q;
            c = r;
        }
    }
    
    cout << res << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cassert>
#include<stdexcept>
#include<utility>
#include<functional>
#include<numeric>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<array>
#include<stack>
#include<queue>
#include<deque>
#include<vector>
#include<complex>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<string>
#include<bitset>
using namespace std;
using ll=long long;

using MP=map<pair<int,int>,ll>;
using VM=vector<MP>;
using VVM=vector<VM>;

vector<ll> a;

const ll INF=1e18;
ll dfs(int l,int r,int rateL,int rateR,VVM& dp){
    if(l>r) return 0;
    if(l==r) return (rateL+rateR)*a[l];
    pair<int,int> key={rateL,rateR};
    if(dp[l][r].count(key)) return dp[l][r][key];
    ll res=INF;
    for(int i=l;i<=r;i++){
        ll vl=dfs(l,i-1,rateL,rateL+rateR,dp);
        ll vr=dfs(i+1,r,rateL+rateR,rateR,dp);
        res=min(res,vl+vr+a[i]*(rateL+rateR));
    }
    return dp[l][r][key]=res;
}
int main(){
    int n;
    cin>>n;
    a.resize(n);    
    for(int i=0;i<n;i++) cin>>a[i];

    VVM dp(n,VM(n));
    ll res=dfs(1,n-2,1,1,dp);
    res+=a[0]+a[n-1];
    cout<<res<<endl;
    return 0;
}


Measured memory_bytes: 8448
#include <stdio.h>

int main(){

	int H[100], W[100];
	int i, j, k,p;
	for (k = 0;; k++){
		scanf("%d %d", &H[k], &W[k]);
		if (H[k] == 0 && W[k] == 0)
			break;
	}

	for (p = 0; p < k; p++){
		for (i = 0; i < H[p]; i++){
			for (j = 0; j < W[p]; j++){
				if (i!=0&&i!=H[p]-1&&j!=0&&j!=W[p]-1){ 
					printf(".");
				}
				else{
					printf("#");
				}
				
			}
			printf("\n");
		}
		
			printf("\n");
		
	}
}

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


int main() {
    int H, W;
    cin >> H >> W;

    vector<vector<char>> C(H*2, vector<char>(W));
    for (int i = 0; i < H*2; i += 2) {
        for (int j = 0; j < W; ++j) {
            cin >> C[i][j];
        }
        copy(C[i].begin(), C[i].end(), C[i+1].begin());
    }

    for (int i = 0; i < H * 2; ++i) {
        for (int j = 0; j < W; ++j) {
            if (j==W-1) cout << C[i][j] << endl;
            else cout << C[i][j];
        }
    }
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/optional.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;

void solve()
{
    int64_t K, N;
	std::cin >> K >> N;
	std::vector<int64_t> A(N + 1);
	for (int64_t i = 0; i < N; i++)
	{
		std::cin >> A[i];
	}
	A[N] = A[0] + K;

	int64_t longest = 0;

	for (int64_t i = 1; i < N + 1; i++)
	{
		int64_t dist = A[i] - A[i - 1];
		longest = std::max(dist, longest);
	}

	std::cout << K - longest << std::endl;
}

int main()
{
	std::cin.tie(nullptr);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	solve();
}


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

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n, m=0, cnt = 0;
  cin >> n;
  vector<int> vec(n);
  for (int i = 0; i < n; i++) {
    cin >> vec[i];
    m = max(m, vec[i]);
  }
  bool minus = false;
  for (int i = 1; i <= m; i++) {
    for (int j = 0; j < n; j++) {
      if (j==0 && vec[j] >= i) {
        cnt++;
        minus = false; 
      }
      if (vec[j] < i && minus==false) {
        minus = true;
      }
      else if (vec[j] >= i && minus==true) {
        cnt++;
        minus = false;
      }
    }
  }
  cout << cnt << '\n';
}


Measured memory_bytes: 256
n = int(input())
A = list(map(int, input().split()))

MAX = 10**18


def main():
    for a in A:
        if a == 0:
            print(0)
            return
    total = 1
    for a in A:
        total *= a
        if total > MAX:
            print(-1)
            return

    print(total)


main()


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

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

//マクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define INF 1000000000000 //10^12
#define MOD 10000007 //10^9+7
#define PB push_back
#define MP make_pair
#define F first
#define S second

int main(int argc, char const *argv[]) {
    int n,l;
    cin >> n >> l;
    int aji[n];
    int eat,ans=0;
    int sum = 0;
    REP(i,n)
    {
        aji[i] = l + i;
        sum += aji[i];
    }
    
    REP(i,n)
    {
        int tmp = 0;
        REP(j,n)
        {
            if (i == j) continue;
            tmp+=aji[j];
        }
        if (abs(sum - tmp) < abs(sum - ans)) ans = tmp;
    }
    cout << ans << endl;
    return 0;
}


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

public class Main {

    public static void main(String[] args)throws Exception {
        InputReader in = new InputReader(System.in);
        PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
        // write your code here //
        int x = in.nextInt();
        int sum = 0;
        for (int i = 1; i < 4; i++) {
            sum += (int) Math.pow(x, i);
        }
        pw.println(sum);
        pw.close();
    }



    /******************************
     ** IO STUFF STARTS FROM HERE**
     ******************************/

    static void debug(Object...obj) {
        System.err.println(Arrays.deepToString(obj));
    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream));
            tokenizer = null;
        }

        //InputReader in = new InputReader(new FileReader("File_Name"));
        public InputReader(FileReader file) {
            reader = new BufferedReader(file);
            tokenizer = null;
        }

        public String next() {

            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens())
                    tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                return null;
            }

            return tokenizer.nextToken();
        }

        public String nextLine() {
            String line = null;
            try {
                tokenizer = null;
                line =  reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
            return line;
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

        public double nextDouble() {
            return Double.parseDouble(next());
        }

        public long nextLong() {
            return Long.parseLong(next());
        }

        public boolean hasNext(){
            try {
                while (tokenizer == null || !tokenizer.hasMoreTokens())
                    tokenizer = new StringTokenizer(reader.readLine());
            }
            catch (Exception e) {
                return false;
            }
            return true;
        }
    }
}

Measured memory_bytes: 32680
n,x = map(int,input().split())
li = list(map(int,input().split()))

li2 = [i-x for i in li]
li3 = [abs(i) for i in li2]
b = li3[0]

def gcd(x,y):
    if x < y:
        x,y = y,x
    if y == 0:
        return x
    z = x % y
    return gcd(y,z)

for i in li3:
    b = gcd(b,i)

print(b)

Measured memory_bytes: 14224
import numpy as np
N , M = map(int, input().split())
ans = np.zeros(N)
S_C = []
for _ in range(M):
  s, c = map(int, input().split())
  for i, j in S_C:
    if s == i and c != j:
      print(-1)
      quit()
  ans[s-1] = c
  S_C.append([s, c])

if ans[0] == 0 and [1, 0] in S_C and N > 1:
  print(-1)
  quit()
if ans[0] == 0 and [1, 0] not in S_C and N > 1:
  ans[0] = 1
print(int("".join([str(int(x)) for x in ans])))

Measured memory_bytes: 12508
import sys
input = sys.stdin.readline

import heapq
def dijkstra_heap(s):
    #始点sから各頂点への最短距離
    d = [float("inf")] * N
    used = [True] * N #True:未確定
    d[s] = 0
    used[s] = False
    edgelist = []
    for e in edge[s]:
        heapq.heappush(edgelist,e)
    while len(edgelist):
        minedge = heapq.heappop(edgelist)
        #まだ使われてない頂点の中から最小の距離のものを探す
        if not used[minedge[1]]:
            continue
        v = minedge[1]
        d[v] = minedge[0]
        used[v] = False
        for e in edge[v]:
            if used[e[1]]:
                heapq.heappush(edgelist,[e[0]+d[v],e[1]])
    return d

################################
N = int(input()) # 頂点数
W = N - 1 # 辺の数

edge = [[] for i in range(N)]
#edge[i] : iから出る道の[重み,行先]の配列
for i in range(W):
    x, y, z = [int(x) for x in input().split()]
    edge[x - 1].append([z, y - 1])
    edge[y - 1].append([z, x - 1])
Q, K = [int(x) for x in input().split()]

K_costs = dijkstra_heap(K - 1) # Kから各頂点へのコスト

for _ in range(Q):
    x, y = [int(x) for x in input().split()]
    print(K_costs[x - 1] + K_costs[y - 1])


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

int main() {
	int n,k;
	cin >> n >> k;
	int arr[n];
	
	for(int i=0;i<n;i++)
	cin >> arr[i];
	
	int dp[n];
	memset(dp,0,sizeof dp);
	
	for(int i=1;i<n;i++)
	{
		dp[i]=INT_MAX;
		for(int j=1;j<=k;j++)
		{
			if(i>=j)
			{
				dp[i]=min(dp[i],abs(arr[i]-arr[i-j])+dp[i-j]);
			}
		}
	}
	
	cout << dp[n-1] << endl;
	
	return 0;
}

Measured memory_bytes: 1024
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define ar array
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());



signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);

	char c;
  cin >> c;
  if(c>='a'){
    cout << 'a' << endl;
  }
  else {
    cout << 'A' << endl;
  }
  


return 0;
}
///....


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define MOD 1000000007
#define MOD2 998244353
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define sz(x) (ll)x.size()
#define F first
#define S second
#define FOR(i,a,b) for(ll i=a;i<=b;++i)
#define ROF(i,a,b) for(ll i=a;i>=b;--i)
#define trace(x) cerr<<#x<<": "<<x<<'\n';
typedef long long ll;
using namespace std;
using namespace __gnu_pbds;
#define T int
#define ordered_set tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>
auto clk=clock();
 
ll mexp(ll a, ll b, ll m){
    ll ans=1;
    a%=m;
    while(b){
        if(b&1) ans=ans*a%m;
        b>>=1;
        a=a*a%m;
    }
    return ans;
}

const int N = 200005;
 
ll h[N];

int main(){
    IOS
    srand(chrono::high_resolution_clock::now().time_since_epoch().count());
    int n, k;
    cin >> n >> k;
    ll sum = 0LL;
    FOR(i,1,n){
        cin >> h[i];
    }
    sort(h+1,h+n+1);
    FOR(i,1,n-k){
        sum += h[i];
    }
    cout << sum;

    cerr<<endl<<endl<<"Time: "<<fixed<<setprecision(12)<<(long double)(clock()-clk)/CLOCKS_PER_SEC<<" ms"<<endl<<endl;
 
    return 0;
}

Measured memory_bytes: 1792
while True:
  b, r, g, c, s, t = map(int, input().split())
  if b + r + g + c + s + t == 0:
    break
  normal_game = t - b * 5  - r * 3
  bonus_game  = b * 5 + r * 3
  print(100 + bonus_game * 16 + 15 * b + 15 * r + 7 * g + 2 * c + 3 * s - t * 3)


Measured memory_bytes: 5592
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
#define REP(i, d, n) for(int i=(d); i<(n); i++)
typedef long long ll;
const int mod = 1e9 + 7;
int main() {
  string s;
  cin >> s;
	
  s[3] = '8';
  
  cout << s << endl;
  
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <queue>
#include <deque>
#include <stack>
#include <algorithm>
#include <bitset>
#include <cstdio>
#include <cmath>

using namespace std;

int main() {
    int n;
    string s;
    cin >> n >> s;

    int cnt = 0;
    for (int i = 0; i < n-2; i++) {
        if (s[i] == 'A' && s[i+1] == 'B' && s[i+2] == 'C') {
            cnt++;
        }
    }

    cout << cnt << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define mp make_pair
#define pb push_back
#define ip pair<ll,ll>
#define ff first
#define ss second
#define MAX 1000005
const ll MOD = 998244353;

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

	ll n,s;
	cin>>n>>s;
	ll a[n];
	for(int i=0;i<n;i++)
		cin>>a[i];
	ll dp[n+1][s+1];
	memset(dp,0,sizeof(dp));
	dp[0][0] = 1;
	for(int i=0;i<n;i++){
		for(int j=0;j<=s;j++){
			if(j < a[i])
				dp[i+1][j] = 2*dp[i][j]%MOD;
			else
				dp[i+1][j] = (2*dp[i][j] + dp[i][j-a[i]])%MOD;
		}
	}

	cout<<dp[n][s]<<endl;
}

Measured memory_bytes: 74040
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int mod = 998244353;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int  N;
    cin >> N;
    vector<int>A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    vector<int>cnt(N,INF);
    for(int i = N-1; i >= 0; i--) {
        auto it = upper_bound(cnt.begin(),cnt.end(),A[i]);
        cnt[it-cnt.begin()] = A[i];
    }
    cout << lower_bound(cnt.begin(),cnt.end(),INF)-cnt.begin() << endl;
}

Measured memory_bytes: 4816
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <cstdio>
#include <string>
#include <vector>
#include <random>
#include <chrono>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <sstream>
#include <assert.h>
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <unordered_map>
using namespace std;

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(bool x) {cerr << (x ? "true" : "false");}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}

template<typename T, typename V> void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";} void _print() {cerr << "]\n";}
template <typename T, typename... V>void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifdef HOME
#warning CHECK int:ll::INT_MAX:LLONG_MAX
#define maxn 20
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define maxn 2000006
#define gcd __gcd
#define debug(x...)
#endif

#define ff first
#define endl '\n'
#define ss second
#define inf 0x3f3f3f3f
#define MOD 1000000007
#define PI 3.14159265358979323846264338327950L
#define f(i,x,n) for(int i=x;i<=n;i++)
#define fr(i,x,n) for(int i=x;i>=n;i--)
struct _ { ios_base::Init i; _() { ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL); } } _;

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


int main() {

	string s; cin >> s;
	s = "*" + s;
	if (s[3] == s[4] and s[5] == s[6]) cout << "Yes";
	else cout << "No";

	return 0;
}

Measured memory_bytes: 3016
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define per(i,b,a) for(int i=b;i>=a;i--)
#define For(i,a,b) for(int i=a;i<=b;i++)
#define Forenska(it,c) for(__typeof((c).begin()) it=(c).begin();it!=(c).end();it++)
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define sqr(x) ((x)*(x))
#define lowbit(x) ((x)&(-x))
#define GREATER(x) x,vector<x>,greater<x>
#define randIn(L,R) (((LL)rand()*rand())%(R-L)+L)
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
typedef pair<LL,LL> pLL;
typedef vector<int> vec;
typedef vector<LL> vecL;
typedef vector<pii> vecP;
typedef vector<pLL> vecPL;
typedef vector<string> vecS;
typedef vector<vec> mat;
typedef complex<double> point;
const long double PI=3.14159265358979323846264338327950;
const LL INFLL=0x3f3f3f3f3f3f3f3f;
const int INF=0x3f3f3f3f;
const long double EPS=1e-10;
int read()
{
    int x=0;
    char ch=' ';
    bool flag=false;
    while(ch<'0' || ch>'9')
    {
        if(ch=='-')flag=true;
        ch=getchar();
    }
    while(ch>='0' && ch<='9')
    {
        x=(x<<3)+(x<<1)+ch-'0';
        ch=getchar();
    }
    return flag?-x:x;
}
int lcm(int a,int b)
{
	return a/__gcd(a,b)*b;
}
const int MAX_N=105;
int H,W,n;
vec a;
int grid[MAX_N][MAX_N];
int main()
{
	cin>>H>>W>>n;
	a.resize(n);
	rep(i,0,n)cin>>a[i];
	rep(i,0,H)
	{
		if(i%2)
		{
			rep(j,0,W)
			{
				grid[i][j]=a.size();
				a.back()--;
				if(!a.back())a.pop_back();
			}
		}
		else 
		{
			per(j,W-1,0)
			{
				grid[i][j]=a.size();
				a.back()--;
				if(!a.back())a.pop_back();
			}
		}
	}
	rep(i,0,H)
	{
		rep(j,0,W)
		{
			cout<<grid[i][j]<<" ";
		}
		cout<<endl;
	}
	return 0;
}




Measured memory_bytes: 384
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 25;
const int MOD = 1e9+7;
 
int main() {
	int n;
	cin >> n;
	string s, t;
	cin >> s >> t;
	rep(i,n) cout << s[i] << t[i];
	cout << endl;
	return 0;
}

Measured memory_bytes: 3552
#include<iostream>
#include <algorithm>
#include <functional>
#include<vector>
#include<math.h>
#include<bitset>
#include<string>
#include <deque>
#include<queue>
#include <iomanip>
#include<map>
#include <random>
#include<type_traits>
#include<stack>
#include <sstream> 
#include <limits>
#include <numeric>
#include<string.h>
using namespace std;
#define ll long long int
#define all(v) begin(v), end(v)
#define REP(i, n) for(int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for(int i = (int)(s); i < (int)(n); i++)
//typedef vector<int> V;
//typedef vector<VV> VVV;


int main() {
	int n, k;
	string s;

	cin >> n >> k;
	k--;
	cin >> s;
	s[k] = s[k] + 32;
	cout << s << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define PI 3.14159265358979323846
#define MAXINF (1e18L)
#define INF (1e9L)
#define EPS (1e-9)
#define MOD ((ll)(1e9+7))
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define pb push_back
#define fi first
#define se second
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
template<class T> void pr_vec(vector<T> &v, char ep=' '){int n=v.size();REP(ni,n){cout<<v[ni];if(ni!=n-1)cout<<ep;}cout<<endl;};
template<class T> inline bool chmin(T& a, T b){return a>b ? a=b, true : false;}
template<class T> inline bool chmax(T& a, T b){return a<b ? a=b, true : false;}
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;

int main(void)
{
    int X;
    cin >> X;
    if(400 <= X && X <= 599) pr(8);
    if(600 <= X && X <= 799) pr(7);
    if(800 <= X && X <= 999) pr(6);
    if(1000 <= X && X <= 1199) pr(5);
    if(1200 <= X && X <= 1399) pr(4);
    if(1400 <= X && X <= 1599) pr(3);
    if(1600 <= X && X <= 1799) pr(2);
    if(1800 <= X && X <= 1999) pr(1);
}

Measured memory_bytes: 3592
#include <bits/stdc++.h>
using namespace std;
#define int             long long
#define hey				cout<<"here";
#define gcd(a, b) 		__gcd(a, b)
#define lcm(a, b) 		((a)*1ll * (b)) / gcd(a, b)
#define pb              push_back
#define mp              make_pair
#define setbits(x)      __builtin_popcountll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x)         	fixed<<setprecision(10)<<x
#define nl			    "\n"
#define w(x)            int x; cin>>x; while(x--)
#define fre(i,a,n)      for (int i = a; i <= n; ++i)
#define fr(i,n)		    for (int i = 0; i < n; ++i)
#define rf(i,a,n)       for (int i = n; i >=a; --i)
#define FIO             ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

vector<int> gr[100003];
int dp[100003]={0};
int visited[100003];

int dfs(int src,int dist){
	if(dp[src]!=-1) return dp[src];
	if(!visited[src]){
		visited[src]=1;
		for(auto nbr: gr[src]){
			dist=max(dist,1+dfs(nbr,0));
		}
	}
	//cout<<"dp of "<<src<<" "<<dist<<nl;
	return dp[src]=dist;
}

int32_t main()
{
	FIO;

	int n,m,i,j;
	cin >> n>>m;
	fr(i,m){
		int x,y;
		cin>>x>>y;
		gr[x].pb(y);
	}
	int ans=0;
	memset(dp,-1,sizeof dp);
	fre(i,1,n){
		int val=dfs(i,0);
		//cout<<val<<"-\n";
		ans=max(ans,val);
	}

cout<<ans;



}


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

#define ll long long int
const int mod = 1e9 + 7;

string X,Y;
int n = 3000,m = 3000;

string getString(char x)
{
    string s(1, x);
    return s;
}

string answer(){
    int LCS[n+1][m+1];
    for(int i=0;i<=n;i++){
        for(int j=0;j<=m;j++){
            if(i==0 or j==0){
                LCS[i][j] = 0;
                continue;
            }
            if(X[i-1]==Y[j-1]){
                LCS[i][j] = LCS[i-1][j-1] + 1;
            }
            else{
                if(LCS[i][j-1]>LCS[i-1][j]){
                    LCS[i][j] = LCS[i][j-1];
                }
                else{
                    LCS[i][j] = LCS[i-1][j];
                }
            }

        }
    }

    string ans = "";
    int u = n,v = m;
    while(LCS[u][v]!=0){
       //cout<<u<<" "<<v<<endl;
        if(X[u-1]==Y[v-1]){
            ans = X[u-1] + ans;
            u--;
            v--;
        }
        else{
            if((LCS[u][v-1])==(LCS[u][v])){
                int target = LCS[u][v] - 1;
                for(int k=(v-1);k>=0;k--){
                    if(LCS[u][k]==target){
                        v = k+1;
                        break;
                    }
                }
            }
            else if((LCS[u-1][v])==(LCS[u][v])){
                int target = LCS[u][v] - 1;
                for(int k=(u-1);k>=0;k--){
                    if(LCS[k][v]==target){
                        u = k+1;
                        break;
                    }
                }
            }
        }
    }
    return ans;
}

int main() {
    cin>>X;
    n = X.length();
    cin>>Y;
    m = Y.length();
    string ans = answer();
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 38796
//C

#include <iostream>
using namespace std;

int main()
{
    int X, Y;

    cin >> X >> Y;

    if((Y>=2*X)&&(Y<=4*X))
    {
        if(Y%2 == 0)
        {
            cout << "Yes";
        }
        else
        {
            cout << "No";
        }
    }
    else
    {
        cout << "No";
    }

    return 0;
}

Measured memory_bytes: 3108
import sys
readline = sys.stdin.readline

def main():
    N, K = map(int, readline().rstrip().split())
    if K == 0:
        print(N ** 2)
        return
    ans = 0
    for b in range(K, N+1):
        r = (N+1) % b
        p = (N+1) // b
        ans += (b-K) * p + max(0, r - K)

    print(ans)


if __name__ == '__main__':
    main()

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

long long dp[101][4][4][4];

int main() {
  int N;
  scanf("%d", &N);
  // AGCT -> 0123
  for (int i=0; i<4; i++) {
    for (int j=0; j<4; j++) {
      for (int k=0; k<4; k++) {
        dp[3][i][j][k] = 1;
      }
    }
  }
  dp[3][0][1][2] = dp[3][0][2][1] = dp[3][1][0][2] = 0;

  for (int i=4; i<=N; i++) {
    for (int j=0; j<4; j++) { // 3
      for (int k=0; k<4; k++) { // 2
        for (int l=0; l<4; l++) { // 1
          for (int m=0; m<4; m++) { // new character
            if (k==0 && l==1 && m==2) continue;
            if (k==0 && l==2 && m==1) continue;
            if (k==1 && l==0 && m==2) continue;
            if (j==0 && l==1 && m==2) continue;
            if (j==0 && k==1 && m==2) continue;
            dp[i][k][l][m] += dp[i-1][j][k][l];
            dp[i][k][l][m] %= 1000000007;
          }
        }
      }
    }
  }
  long long ans = 0;
  for (int i=0; i<4; i++) {
    for (int j=0; j<4; j++) {
      for (int k=0; k<4; k++) {
        ans += dp[N][i][j][k];
        ans %= 1000000007;
      }
    }
  }
  printf("%lld\n", ans);
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Numerics;
using static System.Console;
using static System.Math;
using static System.Array;

class Program
{
	public static void Main()
	{
		var n = long.Parse(ReadLine());
		var a = ReadLine().Split().Select(long.Parse).ToArray();
		BigInteger result = 0;
		for(int i = 0; i < n; i++)
		{
			result += a[i];
		}
		result = result * result;
		for(int i = 0; i < n; i++)
		{
			result -= a[i] * a[i];
		}
		result = (result / 2) % 1000000007;
		WriteLine(result);
	}
}

Measured memory_bytes: 44676
#include<stdio.h>

int main()

{
  int A,P,apie;
  scanf("%d %d",&A,&P);
  apie=((A*3)+P)/2;
  if(apie>=1)
  {
      printf("%d\n",apie);
  }

  else
  {
      printf("0\n");
  }
  return 0;
}


Measured memory_bytes: 1680
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        // c= 縦４行、r = 横５列
        int r = sc.nextInt();
        int c = sc.nextInt();
        int rSum = 0;
        int spreadSheet[][] = new int[r + 1][c + 1];
        for(int i = 0; i < r; i++){
            for(int j = 0; j < c; j++){
                spreadSheet[i][j] = sc.nextInt();
                rSum += spreadSheet[i][j];
            spreadSheet[i][c] = rSum;
            }
            rSum = 0;
        }
        int cSum = 0;
        for(int i = 0; i < c + 1; i++){
            for(int j = 0; j < r;j++){
            cSum += spreadSheet[j][i];
            spreadSheet[r][i] = cSum;
                
            }
            cSum = 0;
        }
        
        for(int i = 0; i < r + 1; i++){
            for(int j = 0; j < c + 1; j++){
                if(j != c){
                    System.out.print(spreadSheet[i][j] + " ");
                    
                }else{
                    System.out.print(spreadSheet[i][j]);
                }
            }
            System.out.println();
        }
    }
}



Measured memory_bytes: 41040
import sys
from collections import *
import heapq
import math
import bisect
from itertools import permutations,accumulate,combinations,product
from fractions import gcd
def input():
    return sys.stdin.readline()[:-1]
def ruiseki(lst):
    return [0]+list(accumulate(lst))
mod=pow(10,9)+7
al=[chr(ord('a') + i) for i in range(26)]

n=int(input())
a=list(map(int,input().split()))
cnt1=0
now=0
for i in range(n):
    now+=a[i]
    if i%2==0:
        if now<=0:
            cnt1+=1-now
            now=1
    else:
        if now>=0:
            cnt1+=now+1
            now=-1
cnt2=0
now=0
for i in range(n):
    now+=a[i]
    if i%2==1:
        if now<=0:
            cnt2+=1-now
            now=1
    else:
        if now>=0:
            cnt2+=now+1
            now=-1

print(min(cnt1,cnt2))

Measured memory_bytes: 88812
#include <stdio.h>

int main(void) {
  int n, i, x;

  scanf("%d", &n);

  for (i = 1; i <= n; i++) {
    if (i % 3 == 0) {
      printf(" %d", i);
      continue;
    }

    for (x = i; x; x /= 10) {
      if (x % 10 == 3) {
        printf(" %d", i);
        break;
      }
    }
  }

  putchar('\n');

  return 0;
}

Measured memory_bytes: 600
use std::cmp;
use std::fmt::Debug;
use std::str::FromStr;
#[allow(dead_code)]
fn read_as_vec<T>() -> Vec<T>
where
    T: FromStr,
    <T as FromStr>::Err: Debug,
{
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim()
        .split_whitespace()
        .map(|c| T::from_str(c).unwrap())
        .collect()
}

#[allow(dead_code)]
fn read_as_string() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

fn enum_pats(n: usize, x: usize, cur: &mut Vec<usize>) -> Vec<Vec<usize>> {
    if x >= n {
        return vec![cur.clone()];
    }

    let mut res = enum_pats(n, x + 1, cur);
    cur.push(x);
    let mut tmp = enum_pats(n, x + 1, cur);
    cur.pop();
    res.append(&mut tmp);
    return res;
}

fn main() {
    let line: Vec<usize> = read_as_vec();
    let (h, w, k) = (line[0], line[1], line[2]);

    let mut c: Vec<Vec<char>> = vec![];
    for _ in 0..h {
        c.push(read_as_string().chars().collect::<Vec<char>>());
    }
    let mut tmp: Vec<usize> = vec![];
    let mut ans: usize = 0;
    let pats: (Vec<Vec<usize>>, Vec<Vec<usize>>) =
        (enum_pats(h, 0, &mut tmp), enum_pats(w, 0, &mut tmp));

    for h_pat in &pats.0 {
        for w_pat in &pats.1 {
            // println!("h_pat = {:?}", h_pat);
            // println!("w_pat = {:?}", w_pat);
            let mut counter: usize = 0;
            for h in h_pat {
                counter += c[*h]
                    .iter()
                    .enumerate()
                    .filter(|(i, x)| w_pat.contains(i) && **x == '#')
                    .count();
            }
            if counter == k {
                //println!("let count");
                ans += 1;
            }
        }
    }

    println!("{}", ans);
}


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

class _C
{
	void _()
	{
		var S = _Ss()[0];

		var l = new int[26];


		for (var i=0;i<S.Length ;i++) {
			l [S[i] - 'a' ]++;
		}

		for (var i = 0; i < 26; i++)
		{
			if ((l[i] % 2) == 1) {
				Console.WriteLine("No");
				return;
			}
		}

		Console.WriteLine("Yes");
	}	

	static void Main(string[] args)
  {
    new _C()._();
  }

  #region

  string _S()
  {
    return Console.ReadLine();
  }

  string[] _Ss()
  {
    return Console.ReadLine().Split();
  }

  int[] _N(int n)
  {
    var x = new int[n];
    for (var i = 0; i < n; i++)
    {
      x[i] = int.Parse(Console.ReadLine());
    }
    return x;
  }

  int[] _Ns()
  {
    var ss = Console.ReadLine().Split();

    var x = new int[ss.Length];
    for (var i = 0; i < ss.Length; i++)
      x[i] = int.Parse(ss[i]);

    return x;
  }
  #endregion
}



Measured memory_bytes: 2648
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string.h>
using namespace std;
#define endl '\n'
#define ll long long
#define pi pair<int, int>
#define f first
#define s second

int n;
string s;

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> s;
	n = s.size();
	
	ll ret = 0;
	for(int i = 0; i < n; i++) (ret += s[i] - '0') %= 9;
	
	cout << (!ret ? "Yes" : "No") << endl;

	return 0;
}

Measured memory_bytes: 3760
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
using namespace std;

pair<int,int> solve(int n){
  vector<pair<int,int>> list;
  for(int i=0;i<n;i++){
    int p,d1,d2;
    cin>>p>>d1>>d2;
    list.push_back(make_pair(d1+d2,p));
  }
  sort(list.begin(),list.end());
  return list[list.size()-1];
}

int main(){
  int n;
  while(cin>>n,n!=0){
    auto ans = solve(n);
    cout<<ans.second<<" "<<ans.first<<endl;
  }
}

Measured memory_bytes: 1328
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPA(i,n) for(int i=1;i<(n);++i)
#define MOD ((int)1e9 + 7)
#define INF ((int)1e9)
#define ALL(x) (x).begin(),(x).end()
#define ctoi(x) (x - 'a') 
#define CTOI(x) (x - 'A')
using namespace std;
int main(){
    int N;
    cin >> N;
    int sum = 0;
    int ans = 100000;
    REPA(i,N+1){
        int d;
        cin >> d;
        sum += d;
        ans = min(sum / i,ans);
    }
    cout << ans << endl;
    return 0;
}



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

#define rep(i, N) for (int i = 0; i < N; i++)
#define rep1(i, N) for (int i = 1; i <= N; i++)
const int intinf = numeric_limits<int>::max();

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

#define MOD 1000000007

void solveC()
{
    ll a, b, c;
    cin >> a >> b >> c;
    if (c - a - b < 0)
    {
        cout << "No" << endl;
        return;
    }
    cout << (c * c + a * a + b * b - 2 * (a * c + b * c + a * b) > 0 ? "Yes" : "No") << endl;
}

int N;
void d(string s, int n)
{
    if (s.length() == N)
    {
        cout << s << endl;
        return;
    }

    int a;
    for (int i = 0; i <= n; i++)
    {
        char c = 'a' + i;

        d(s + c, n);
    }
    char c = 'a' + n + 1;
    d(s + c, n + 1);
}

void solveD()
{
    cin >> N;
    d("a", 0);
}

void solveE()
{
    string a, b, c;
    cin >> a >> b >> c;
}

int main()
{
    solveC();
    return 0;
}


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

using namespace std;

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)

using ll = long long;
using P = std::tuple<int,int>;

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

std::string blocks[300];

int H, W;
int dp[301][301], cs[301][301];

int cost(int first){
    fill(&dp[0][0], &dp[0][0]+301*301, 1001001001);
    
    int second = first + 1;

    dp[0][0] = 0;

    for(int i=0;i<H;++i){ // cs[i][0]
        cs[i][0] = 0;
        
        int firstBottom = H - 1 - i;
        for(int x=0;firstBottom-x>=0;++x){
            if(blocks[firstBottom-x][first] == blocks[H-1-x][second]){
                ++cs[i][0];
            }
        }

        for(int x=0;i+x<H;++x){
            cs[i+x+1][x+1] = cs[i+x][x];

            if(blocks[(H-1)-(i+x)][first] == blocks[(H-1)-x][second]){
                --cs[i+x+1][x+1];
            }
        }
    }

    for(int j=1;j<H;++j){ // cs[0][j]
        cs[0][j] = 0;
        
        int secondBottom = H - 1 - j;
        for(int x=0;secondBottom-x>=0;++x){
            if(blocks[H-1-x][first] == blocks[secondBottom-x][second]){
                ++cs[0][j];
            }
        }

        for(int x=0;j+x<H;++x){
            cs[x+1][j+x+1] = cs[x][j+x];

            if(blocks[(H-1)-x][first] == blocks[(H-1)-(j+x)][second]){
                --cs[x+1][j+x+1];
            }
        }
    }
    
    for(int i=0;i<=H;i++){
        for(int j=0;j<=H;j++){
            if(i == H && j == H){continue;}
            
            int c = cs[i][j];

            if(i < H){
                dp[i+1][j] = min(dp[i+1][j], dp[i][j] + c);
            }
            if(j < H){
                dp[i][j+1] = min(dp[i][j+1], dp[i][j] + c);
            }
        }
    }

    return dp[H][H];
}

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

    std::cin >> H >> W;

    for(int i=0;i<H;++i){
        std::cin >> blocks[i];
    }

    int res = 0;
    for(int i=0;i<W-1;++i){
        res += cost(i);
    }

    std::cout << res << std::endl;
}


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

string s;

int main(){
	cin >> s;
	int len = s.size();
	if (len == 2)
	{
		cout << s << endl;
		return 0;
	}
	reverse(s.begin(), s.end());
	cout << s << endl;
	return 0;
}

Measured memory_bytes: 384
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(1000000)


# Debug output
def chkprint(*args):
    names = {
        id(v): k
        for k, v in inspect.currentframe().f_back.f_locals.items()
    }
    print(', '.join(
        names.get(id(arg), '???') + ' = ' + repr(arg) for arg in args))


# Binary converter
def to_bin(x):
    return bin(x)[2:]


def li_input():
    return [int(_) for _ in input().split()]


def gcd(n, m):
    if n % m == 0:
        return m
    else:
        return gcd(m, n % m)


def gcd_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = gcd(v, L[i])

    return v


def lcm(n, m):
    return (n * m) // gcd(n, m)


def lcm_list(L):
    v = L[0]

    for i in range(1, len(L)):
        v = lcm(v, L[i])

    return v


# Width First Search (+ Distance)
def wfs_d(D, N, K):
    """
    D: 隣接行列(距離付き)
    N: ノード数
    K: 始点ノード
    """

    dfk = [-1] * (N + 1)
    dfk[K] = 0

    cps = [(K, 0)]
    r = [False] * (N + 1)
    r[K] = True
    while len(cps) != 0:
        n_cps = []
        for cp, cd in cps:
            for i, dfcp in enumerate(D[cp]):
                if dfcp != -1 and not r[i]:
                    dfk[i] = cd + dfcp
                    n_cps.append((i, cd + dfcp))
                    r[i] = True

        cps = n_cps[:]

    return dfk


# Depth First Search (+Distance)
def dfs_d(v, pre, dist):
    """
    v:  現在のノード
    pre: １つ前のノード
    dist: 現在の距離

    以下は別途用意する
    D: 隣接リスト(行列ではない)
    D_dfs_d: dfs_d関数で用いる，始点ノードから見た距離リスト
    """

    global D
    global D_dfs_d

    D_dfs_d[v] = dist

    for next_v, d in D[v]:
        if next_v != pre:
            dfs_d(next_v, v, dist + d)

    return


def sigma(N):
    ans = 0
    for i in range(1, N + 1):
        ans += i
    return ans


class Combination:
    def __init__(self, n, mod):

        g1 = [1, 1]
        g2 = [1, 1]
        inverse = [0, 1]
        for i in range(2, n + 1):
            g1.append((g1[-1] * i) % mod)
            inverse.append((-inverse[mod % i] * (mod // i)) % mod)
            g2.append((g2[-1] * inverse[-1]) % mod)
        self.MOD = mod
        self.N = n
        self.g1 = g1
        self.g2 = g2
        self.inverse = inverse

    def __call__(self, n, r):
        if (r < 0 or r > n):
            return 0
        r = min(r, n - r)
        return self.g1[n] * self.g2[r] * self.g2[n - r] % self.MOD


# --------------------------------------------

dp = None


def main():
    a, b, c = li_input()

    if sum([a, b, c]) - max(a, b, c) == max(a, b, c):
        print("Yes")
    else:
        print("No")


main()


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

using namespace std;

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

using _loop_int = int;
#define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)

#define CHMIN(a,b) (a)=min((a),(b))
#define CHMAX(a,b) (a)=max((a),(b))
#define ALL(v) (v).begin(),(v).end()

#define DEBUG(x) cerr<<#x<<": "<<(x)<<endl
#define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl

const ll MOD = 1000000007ll;

int main(){
    int w,h,x,y;
    cin>>w>>h>>x>>y;
    int ans = 0;
    if(2*x==w && 2*y==h)ans = 1;
    printf("%.4f %d\n",0.5*w*h,ans);
    return 0;
}


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

using namespace std;

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

    int n;
    cin >> n;
    cout << 1000 * (n / 500) + 5 * ((n % 500) / 5) << "\n";
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(void){
  int high,max1=0,max2=0,max3=0;
  for(int i=1;i<=10;i++){
    cin >> high;
    if(high>max1){
      max3=max2;
      max2=max1;
      max1=high;
    }
    else if(max2<high && high<=max1){
      max3=max2;
      max2=high;
    }
    else if(max3<high && high<=max2){
      max3=high;
    }
  }
  cout << max1 << endl << max2 << endl << max3 << endl;
}



Measured memory_bytes: 3088