akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define BUF_SIZE 15

int is_eof(int a, int b) {
  return (!a && !b);
}

int main(void) {
  FILE *fp = stdin;
  char line[BUF_SIZE];

  int ans[5] = {0}; int pos = 0;
  while(1) {
    if(!fgets(line, BUF_SIZE, fp)) return 0;
    int num, seq;
    sscanf(line, "%d %d", &num, &seq);
    if(is_eof(num, seq)) break;
    int *sum = malloc(sizeof(int)*(num+1));
    memset(sum, 0, sizeof(int)*(num+1));

    int i;
    for(i = 1; i <= num; i++) {
      if(!fgets(line, BUF_SIZE, fp)) return 0;
      int n;
      sscanf(line, "%d", &n);
      sum[i] += sum[i-1] + n;
    }

    int max = 0;
    for(i = seq; i <= num; i++) {
      int m = sum[i] - sum[i-seq];
      if(m > max) max = m;
    }

    ans[pos++] = max;
  }

  int i;
  for(i = 0; i < pos; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}


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

int main(){
long long a[51]={0},n;
cin>>n;
for(long long i=1;i<=50;i++){
	a[i]=(n/50)+i-1;
}n%=50;
for(long long i=1;i<=n;i++){
	for(int j=1;j<=50;j++){
		a[j]--;
	}
	a[i]+=51;
}
cout<<50<<endl;
for(int i=1;i<50;i++)cout<<a[i]<<" ";cout<<a[50];
return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pl;
#define all(a) (a).begin(),(a).end()
#define overload4(_1, _2, _3, _4, name, ...) name
#define rep1(n) for(ll i = 0;i < (n);i++)
#define rep2(i,n) for(ll i = 0;i < (n);i++)
#define rep3(i,a,b) for(ll i = (a);i < (b);i++)
#define rep4(i,a,b,c) for(ll i = (a);i < (b);i += (c))
#define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep1(n) for(ll i = (n)-1;i >= 0;i--)
#define rrep2(i,n) for(ll i = (n)-1;i >= 0;i--)
#define rrep3(i,a,b) for(ll i = (a)-1;i >= (b);i--)
#define rrep4(i,a,b,c) for(ll i = (a)-1;i >= (b);i -= (c))
#define rrep(...) overload4(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define SHOW(x) cout << #x << ": " << x << endl;
template<class T> ll sumArr(const T& a){ return accumulate(all(a), 0LL);}
template<class T> auto minArr(const T& a){ return *min_element(all(a));}
template<class T> auto maxArr(const T& a){ return *max_element(all(a));}
template<class T> void DEBUG_PRINT(T tmp){cout<<tmp<<endl;}
template<class T1,class... T2> void DEBUG_PRINT(T1 tmp,T2... tmp2){cout<<tmp<<" ";DEBUG_PRINT(tmp2...);}
ll gcd(ll a, ll b){ while(b){ ll c = b; b = a % b; a = c; } return a; }
ll lcm(ll a, ll b){ if(!a || !b) return 0; return a / gcd(a, b) * b; }
const ll INF=1e18,MOD = 1e9+7;
const int iINF = 1e9;

inline ll mod(ll a){
    return (a + MOD)%MOD;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    ll n,type = 1,ans = 1;
    bool flag = true;//一番左のブロックか?
    cin>>n;
    string s[2];
    rep(i,2)cin>>s[i];
    rep(i,n){
        if(flag){
            flag = false;
            if(s[0][0] == s[1][0]){
                type = 0;
                ans *= 3;
            }
            else{
                ans *= 6;
                i++;
            }

        }
        else if(s[0][i] == s[1][i]){
            //type == 0
            if(type == 0){
                ans *= 2;
                ans = mod(ans);
            }
            else{
                type = 0;
            }
        }
        else{
            //type == 1
            i++;
            if(type == 0){
                type = 1;
                ans *= 2;
                ans = mod(ans);
            }
            else{
                ans *= 3;
                ans = mod(ans);
            }
        }
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <sstream>
#include <bitset>
#include <cassert>
#include <fstream>
#include <queue>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
	#define DBG(X) cout << #X << "=" << (X) << '\n';
#else
	#define DBG(X)
#endif

using std::cin;
using std::cout;
using std::vector;
using std::string;
using std::pair;
using std::swap;
using std::sort;
using std::lower_bound;
using std::unique;
using std::abs;

using int64 = long long int;
using pii   = pair<int, int>;
using pii64 = pair<int64, int64>;

const int NIL = -1;
const int INF = (int)2e9;
const int64 INF64 = (int64)2e18;

void init_IO() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
}

template<typename T>
std::ostream& operator<<(std::ostream& os, const vector<T>& vec) {
	os << '[';
	int fst = 1;

	for(auto& elem: vec) {
		if(fst == 0) {
			os << ' ';
		}

		os << elem;
		fst = 0;
	}

	os << ']';
	return os;
}

void solve() {
	int64 x, a;
	cin >> x >> a;

	cout << (x < a ? 0 : 10) << '\n';
}

int main() {
	init_IO();
	solve();

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include<numeric>
#include<map>
#include<unordered_map>
#include<queue>
#include<deque>
 
using namespace std;
using ll=long long;
#define rep(i,n)  for(ll i=0;i<n;++i)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()
 
#define MOD 1000000007

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

    ll a[n];
    ll cntz[61] = {};
    ll cnto[61] = {};
    rep(i, n){
        cin >> a[i];
        ll value = 1;
        rep(j, 61){
            if(a[i]&value)cnto[j]++;
            else cntz[j]++;
            value*=2;
        }
    }

    ll ans = 0;


    rep(i, n){
        ll value = 1;
        rep(j, 61){
            ll add = value%MOD;
            // cout << j << " " <<  value << " MOD " << add << endl;
            if(a[i]&value)ans = (ans+(add*cntz[j])%MOD)%MOD, cnto[j]=max((ll)0, cnto[j]-1);
            else ans = (ans+(add*cnto[j])%MOD)%MOD, cntz[j]=max((ll)0, cntz[j]-1);
            value*=2;
        }
    }

    cout << ans << endl;

}

Measured memory_bytes: 2560
package main
import(
  "fmt"
  "strconv"
)
func main(){
  var s, ans, n string
  fmt.Scan(&s)
  ans=string(s[0])
  a:=len(s)-2
  n=strconv.Itoa(a)
  ans+=n
  ans+=string(s[len(s)-1])
  fmt.Println(ans)
}


Measured memory_bytes: 512
L=int(input())
S=str(bin(L))[2:][::-1]
N=len(S)
print(N,(N-1)*2+S.count("1")-1)
for i in range(N-1):
    print(i+1,i+2,0)
    print(i+1,i+2,2**i)
for i in range(N-1):
    if S[i]=="1":
        L-=2**i
        print(i+1,N,L)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define INF 0x3f3f3f3f
set <int>s[100005];
int n,m,k,a,b,f[100005],fn[100005],c[100005];
int getfather(int x)
{
    return x==f[x]?x:f[x]=getfather(f[x]);
}
void Union(int x,int y)
{
    int u=getfather(x),v=getfather(y);
    if(u!=v) f[v]=u;
}
int main()
{
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++)
        f[i]=i;
    while(m--)
    {
        cin>>a>>b;
        c[a]++;
        c[b]++;
        Union(a,b);
    }
    for(int i=1;i<=n;i++) f[i]=getfather(i);
    for(int i=1;i<=n;i++) fn[f[i]]++;
    while(k--)
    {
        cin>>a>>b;
        if(f[a]==f[b])
        {
            s[a].insert(b);
            s[b].insert(a);
        }
    }
    for(int i=1;i<=n;i++)
    {
        int x=fn[f[i]]-c[i]-s[i].size()-1;
        cout<<x<<' ';
    }
}



Measured memory_bytes: 16384
import qualified Data.ByteString.Char8 as BS
import Data.Maybe
import Control.Monad
import Data.List

main :: IO ()
main = do
  [w, h] <- map read . words <$> getLine
  p <- replicateM w $ do
    p1 <- fst . fromJust . BS.readInt <$> BS.getLine
    return (True, p1)
  q <- replicateM h $ do
    q1 <- fst . fromJust . BS.readInt <$> BS.getLine
    return (False, q1)
  let
    r = sortOn snd $ p ++ q
    solve _ [] = 0
    solve (x, y) ((b, c):l) = if b
      then (h+1-y)*c + solve (x+1, y) l
      else (w+1-x)*c + solve (x, y+1) l
  print $ solve (0, 0) r


Measured memory_bytes: 74108
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int i,j,temp,size,num,sum=0;
	string str;
	cin >> str;
	for(i=0;i<str.size();i++)
	{
		if(str[i] == '1')
			sum+=1;
		else if(str[i] == '2')
			sum+=2;
		else if(str[i] == '3')
			sum+=3;
		else if(str[i] == '4')
			sum+=4;
		else if(str[i] == '5')
			sum+=5;
		else if(str[i] == '6')
			sum+=6;
		else if(str[i] == '7')
			sum+=7;
		else if(str[i] == '8')
			sum+=8;
		else if(str[i] == '9')
			sum+=9;
	}
	if(sum % 9 == 0)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 3744
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cstring>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<long long, long long> P;
#define rep(i, n) for(long long i=0; i<n; i++)
#define reps(i, s, e) for(long long i=s; i<e; i++)
#define repr(i, n) for(long long i=n-1; i>=0; i--)
#define reprs(i, s, e) for(long long i=e-1; i>=s; i--)


template<typename T>
T gcd(T n, T m){

    if(m > n)  swap(n, m);

    if(m == 0) return n;

    T r = n % m;
    if(r == 0) return m;
    else       return gcd(m, r);
}



template<typename U>
U lcm(U n, U m){
    return n / gcd(n, m) * m;
}


int main(){

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

    ll a, b; cin >> a >> b;
    cout << lcm(a, b) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
typedef vector<int> vi;
typedef vector<ll> vl;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define IN cin >> 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (m-1); i >= (int)(n); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - a) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}

//ll ncr[100][100];
//ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

//ll npr[100][100]={};
//ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

//ll nHr(int n,int r){ret nCr(n+r-1,r);}

///////////////////////////////////////////////////////////////////////////



int main(){
    
    double w,h,x,y;
    cin >> w >> h >> x >> y;

    
    if(x == w/2 && y == h/2){
	double ans3 = w*h/2;

	printf("%.10lf %d\n",(double)ans3,1);
	
	ret 0;
    }

    double ans = (h) * w / 2;
    printf("%.10lf %d\n",ans,  0);
	
  
    return  0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<N;i++)
typedef long long ll;

int main(){
  int D;
  ll G;
  cin>>D>>G;
  int P[10],C[10];
  rep(i,D) cin>>P[i]>>C[i];
  bool all[10];
  int ans = 1e9;
  rep(i,(1<<D)){
    int cnt = 0;
    ll score = 0;
    memset(all,0,10);
    rep(j,D) {
      if(i & (1<<j)) {
        cnt += P[j];
        score += P[j] * 100 * (j+1);
        score += C[j];
        all[j] = true;
      }
    }
    if(score < G) {
      int tg = D - 1;
      while(all[tg]) tg--;
      rep(j,P[tg]-1){
        score += 100 * (tg+1);
        cnt++;
        if(score >= G) break;
      }
    }
    if(score >= G) ans = min(ans,cnt);
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int mod=1e9+7;
//const int mod=998244353;
const double eps = 1e-10;
const double pi=acos(-1.0);
const int maxn=1e5+10;
const ll inf=0x3f3f3f3f;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    string s;
    cin>>s;
    int a=0,b=0;
    for(int i=0;i<s.length();i++)
        if(s[i]=='A')a++;
        else b++;
    if(a&&b)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 256
from scipy.sparse.csgraph import csgraph_from_dense,dijkstra

sx,sy,gx,gy=map(int,input().split())
n=int(input())
arr=[[sx,sy,0]]+[list(map(int,input().split())) for _ in range(n)]+[[gx,gy,0]]
g=[[-1]*(n+2) for _ in range(n+2)]
for i in range(n+2):
  x1,y1,r1=arr[i]
  for j in range(n+2):
    x2,y2,r2=arr[j]
    g[i][j]=max(0.0,((x1-x2)**2+(y1-y2)**2)**0.5-(r1+r2))
g=csgraph_from_dense(g,null_value=-1)
ans=((sx-gx)**2+(sy-gy)**2)**0.5
print(min(ans,dijkstra(g,indices=0)[n+1]))

Measured memory_bytes: 107292
#include <cstdio>
using namespace std;
#define INF (1<<29)

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

int N,M,R;
int d[201][201];
int r[9];
int A,B,C;
int res;
bool used[9];

void dfs(int c,int las,int dist)
{
    if(c==R+1)
    {
        if(res>dist)res=dist;
        return;
    }
    REP(i,1,R+1) if(!used[i])
    {
        used[i]=true;
        if(las==-1)dfs(c+1,i,0);
        else dfs(c+1,i,dist+d[r[las]][r[i]]);
        used[i]=false;
    }
}

int main()
{
    scanf("%d%d%d",&N,&M,&R);
    REP(i,1,N+1) REP(j,1,N+1) if(i!=j)d[i][j]=INF;
    REP(i,1,R+1) scanf("%d", &r[i]);
    for(int i=1;i<=M;i++)
    {
        scanf("%d%d%d",&A,&B,&C);
        if(d[A][B]>C)d[A][B]=d[B][A]=C;
    }

    REP(k,1,N+1) REP(i,1,N+1) REP(j,1,N+1)
        if(d[i][j]>d[i][k]+d[k][j])
            d[i][j]=d[i][k]+d[k][j];

    res=INF;
    dfs(1,-1,0);
    printf("%d\n",res);
}


Measured memory_bytes: 256
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int n;
	scanf("%d", &n);
	printf("Christmas\n");
	rep(i, 25 - n){
	  printf("Eve\n");
	}
	
	Please AC;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

#define M 100000

int aa[M], bb[M];

int compare(const void *a, const void *b) {
	int i = *(int *) a;
	int j = *(int *) b;

	return aa[i] != aa[j] ? aa[i] - aa[j] : bb[j] - bb[i];
}

int main() {
	static int ii[M];
	int n, m, i, b, ans;

	scanf("%d%d", &n, &m);
	for (i = 0; i < m; i++) {
		scanf("%d%d", &aa[i], &bb[i]);
		ii[i] = i;
	}
	qsort(ii, m, sizeof *ii, compare);
	ans = 1;
	b = n + 1;
	for (i = 0; i < m; i++) {
		if (aa[ii[i]] >= b) {
			ans++;
			b = n + 1;
		}
		if (b > bb[ii[i]])
			b = bb[ii[i]];
	}
	printf("%d\n", ans);
	return 0;
}


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

int selectionSort(int A[], int N) {
    int minj;
    int cnt = 0;
    for (int i = 0; i < N-1; ++i) {
        minj = i;
        for (int j = i; j < N; ++j) {
            if (A[j] < A[minj]) {
                minj = j;
            }
        }
        swap(A[i], A[minj]);
        if (i != minj) cnt++;
    }

    return cnt;
}

int main() {
    int N; cin >> N;
    int A[100];
    for (int i = 0; i < N; ++i) {
        cin >> A[i];
    }
    int cnt;

    cnt = selectionSort(A, N);

    for (int i = 0; i < N; ++i) {
        if (i) cout << " ";
        cout << A[i];
    }
    cout << endl;
    cout << cnt << endl;

    return 0;
}


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

using namespace std;

typedef long long ll;
const int MAX = 1e5 + 1;

vector<int> edges[MAX];
int in_degree[MAX];
int x, y;
bool visited[MAX];
int dist[MAX];


int main() {

	int N, M;
	cin>>N>>M;
	for (int i = 1;i <= M;++i) {
		cin>>x>>y;
		edges[x].push_back(y);
		in_degree[y] += 1;
	}
	
	function<void(int )> dfs = [&] (int v){
		assert(!visited[v]);
		visited[v] = true;
		for (auto adj : edges[v]) {
			dist[adj] = max(dist[adj], dist[v] + 1);
			in_degree[adj] -= 1;
			if (!in_degree[adj]) {
				dfs(adj);
			}
		}
	};
	
	for (int i = 1;i <= N;++i) {
		if (!visited[i] && !in_degree[i]) {
			dfs(i);
		}
	}
	
	int ans = INT_MIN;
	for (int i = 1;i <= N;++i) {
		ans = max(ans, dist[i]);
	}
	
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 12800
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define int long long
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int n, a, x[60];
int dp[60][2600];
vector<int> vec;

signed main() {
	cin >> n >> a;
	for (int i = 0; i < n; i++) {
		cin >> x[i];
		vec.push_back(x[i] - a);
	}
	for (int i = 0; i < n; i++) {
		dp[i + 1][1300 + vec[i]]++;
		for (int j = 0; j < 2600; j++) {
			dp[i + 1][j] += dp[i][j];
			if (0 <= j + vec[i] && j + vec[i] < 2600)dp[i + 1][j + vec[i]] += dp[i][j];
		}
	}
	cout << dp[n][1300] << endl;
}

Measured memory_bytes: 1280
s = input()
k = int(input())
f = lambda x: (ord('a') - ord(x))%26
ans = ''
for c in s:
    if k>=f(c):
        ans += 'a'
        k -= f(c)
    else:
        ans += c
ans = ans[:-1] + chr(ord('a') + (ord(ans[-1])-ord('a')+k)%26)
print(ans)

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

#define REP(i,n) for(long long i = 0; i < (n); i++)
#define FOR(i, m, n) for(long long i = (m);i < (n); ++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQR = priority_queue<T,vector<T>,greater<T>>;

const ll MOD = (ll)1e9 + 7;
const ll MOD2 = 998244353;
const ll HIGHINF = (ll)1e18;
const ll LOWINF = (ll)1e15;
const long double PI = 3.1415926535897932384626433;

template<typename T> vector<T> make_v(size_t N,T init){return vector<T>(N,init);}
template<typename... T> auto make_v(size_t N,T... t){return vector<decltype(make_v(t...))>(N,make_v(t...));}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max<T>(a,b);}
template <class T> void chmin(T& a, const T b){a=min<T>(a,b);}
void YN(bool flg) {cout << ((flg) ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << ((flg) ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << ((flg) ? "yes" : "no") << endl;}

int main() {
    int X,A; cin >> X >> A;
    cout << (X<A?0:10) << endl;


    return 0;
}


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

using namespace std;

constexpr int N = 100;
constexpr int K = 100;

int freq[N + 1];

int main() {
	int ans, n, k, d, a, i;

	scanf("%d%d", &n, &k);

	while (k--) {
		scanf("%d", &d);

		for (i = 1; i <= d; i++) {
			scanf("%d", &a);
			freq[a]++;
		}
	}

	ans = 0;

	for (i = 1; i <= n; i++) {
		if (freq[i] == 0) {
			ans++;
		}
	}

	printf("%d\n", ans);

	return 0;
}

Measured memory_bytes: 3844
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
	"strings"
)

func getNextLine(scanner *bufio.Reader) string {
	var buffer string
	for {
		line, isPrefix, _ := scanner.ReadLine()
		buffer += string(line)
		if isPrefix == false {
			break
		}
	}
	return buffer
}

func getIntList(scanner *bufio.Reader) []int {
	list := strings.Split(getNextLine(scanner), " ")
	l := len(list)
	result := make([]int, l)
	for i := 0; i < l; i++ {
		result[i], _ = strconv.Atoi(list[i])
	}
	return result
}

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := bufio.NewReader(fp)
	writer := bufio.NewWriter(os.Stdout)

	var n int
	fmt.Sscan(getNextLine(scanner), &n)

	aa := getIntList(scanner)
	flag := true
	counts := 0
	for flag {
		flag = false
		for i := n - 1; i > 0; i-- {
			if aa[i] < aa[i-1] {
				aa[i], aa[i-1] = aa[i-1], aa[i]
				flag = true
				counts++
			}
		}
	}

	for i := 0; i < n; i++ {
		fmt.Fprint(writer, aa[i])
		if i < n-1 {
			fmt.Fprint(writer, " ")
		}
	}

	fmt.Fprintln(writer, "")
	fmt.Fprintln(writer, counts)
	writer.Flush()
}



Measured memory_bytes: 1196
import heapq
n,m = map(int,input().split())
a = list(map(int,input().split()))
arr = []
for v in a:
    v*=-1
    heapq.heappush(arr,v)
cur=0
while(m>0 and len(arr)>0):
    next = heapq.heappop(arr)
    next = abs(next)
    next//=2
    if next>0:
        next*=-1
        heapq.heappush(arr,next)
    m-=1
for v in arr:
    cur+=abs(v)
print(cur)


Measured memory_bytes: 14180
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <chrono>
#include <stack>
#include <string>
#include <bitset>
#include <unordered_map>
#include <cstdio>
#include <limits>
#include <vector>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <fstream>
#include <numeric>
#include <sstream>
#include <cassert>
#include <tuple>
#include <iomanip>
#include <random>
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <fstream>
using namespace std;
#define F first
#define S second
#define mp make_pair
#define pb push_back
#define popb pop_back()
#define ll long long
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define forn(x) for(int i=1;i<=x;i++) 
#define sforn(x, y) for(int i=1;i<=x;i++)for(int j=1;j<=y;j++)
#define pii pair<int, int>
#define speed ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

/*
    LOL KEK CHEBUREK
 
    PIHALITI
 
 */

int main(){ speed;
    ll n;
    cin >> n;
    cout << (n-1) / 2 << endl;
    return 0;
}

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

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);

  string s;cin>>s;
  if(s.size()%2==1){
      puts("No");return 0;
  }
  for(int i=0;i<s.size();i+=2){
    if(s[i]=='h'&&s[i+1]=='i'){
    }else{
      puts("No");return 0;
    }
  }
      puts("Yes");
  
  return 0;
}


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

long long int pwr(long long int n, long long int k){
	long long int temp=1;
	while(n--){
		temp = temp*k;
	}
	return temp;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
	long long int n;
	cin>>n;
	long long int cnt=0;
	for(int i=0; i<n; i++){
		long long int temp;
		cin>>temp;
		if(temp%2==0) cnt++;
	}
	
	cout<<pwr(n,3)-pwr(cnt,2);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,K,x;
  int t = 0;
  cin >> N >> K;
  for(int i = 0; i < N;i++){
    cin >> x;
    if (K-x >= x){      
      t += x;
    }
    else if ( K-x < x){
      t += K-x;
    }
  }
  cout << t*2 <<endl;    
}

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

C = [B[i]-A[i] for i in range(N)]

P = sum(filter(lambda x: x<0, C))
M = list(filter(lambda x: x>1, C))
M = list(map(lambda x: x//2, M))

M = sum(M)
if abs(M) >= abs(P):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 4852
#include<bits/stdc++.h>                                                      
using namespace std;
int main()
{
  int N;
  cin >> N;
  vector<int> H(N);
  for(int i=0; i<N; i++)
    cin >> H.at(i);
  int count=0;
  int ans=1;
  for(int i=1; i<N; i++){
    for(int j=0; j<i; j++){
      if(H.at(i)>=H.at(j))
        count++;
    }
    if(count==i)
      ans++;
    count=0;
  }
  cout << ans << endl;
}

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

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

	vector<int> ac(n);
	vector<int> pena(n);

	rep(i, m){
		int a;
		string s;
		cin >> a >> s;
		a--;
		if(ac.at(a))
			continue;
		if(s == "AC")
			ac.at(a) = 1;
		else
			pena.at(a)++;
	}
	int AC = 0, PENA = 0;
	rep(i, n){
		AC += ac.at(i);
		if(ac.at(i)){
			PENA += pena.at(i);
		}
	}
	cout << AC << " " << PENA << endl;

}


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

int main(){
  int n,p=0,y=0,w=0,g=0,i=0,all=0;
  cin>>n;
  while(i<n){
    char color;
    cin>>color;
    if(color == 'P'&&p<=0){
      p++;
      all++;
    }else if(color == 'Y'&&y<=0){
      y++;
      all++;
    }else if(color=='W'&&w<=0){
      w++;
      all++;
    }else if(color =='G'&&g<=0){
      g++;
      all++;
    }
    i++;
  }
  if(all==3){
    cout<<"Three"<<endl;
  }else{
    cout<<"Four"<<endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a,b,c;
int main(){
	cin>>a>>b>>c;
	for(int i=a;i<a+c;i++){
		if(i>b)continue;
		printf("%d\n",i);
	}
	for(int i=b-c+1;i<=b;i++){
		if(i<a+c)continue;
		printf("%d\n",i);
	}
	return 0;
}


Measured memory_bytes: 256
#pragma comment(linker, "/stack:20000000")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx")

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>

#define se second
#define fi first
#define ss size()
#define pb push_back
#define mp make_pair
#define ins insert
#define ll long long
#define y1 y12313312312
#define endl '\n'
#define gcd __gcd
//#define int ll

using namespace std;
//using namespace __gnu_pbds;

//template <typename T> using ordered_set = tree<T, null_type, std::less<T>, rb_tree_tag, tree_order_statistics_node_update>;

const int N = 2e5 + 40, T = 4 * N, inf = 1e9 + 7;

int n, m, f, r, l, e, w, o, z, test, id;
ll a[N], d[N];

void freop()
{
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
}

void boos()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

main()
{
    //freop();
    boos();
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        //cout << a[i] << " ";
    }
    //cout << endl;
    d[0] = 0;
    d[1] = abs(a[1] - a[0]);
    for (int i = 2; i < n; i++)
    {
        d[i] = min(d[i - 1] + abs(a[i] - a[i - 1]), d[i - 2] + abs(a[i] - a[i - 2]));
    }
    cout << d[n - 1];
}


Measured memory_bytes: 1792
#include <iostream>
#include <sstream>
#include <regex>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>

using namespace std;
using ll = long long int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i, a, b)  for(int i = (a); i < (b) ; i++)
#define pb push_back
#define SORT(v,n) sort(v, v+n)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define elif else if
#define int ll
//const int INF = 100100100;
const int INF = (1LL << 32);
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
//a 3
//b
//c 29
int X, n;
vector<int> a;

int N[1000000];

signed main() {
	ios::sync_with_stdio(false);
	string in;
	string out;
	cin >> in;
	rep(i, in.size()) {
		if (i % 2 == 0) {
			out += in[i];
		}
	}
	cout << out << endl;
	return 0;
}



Measured memory_bytes: 592
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

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

		int n = Integer.parseInt(sc.next());
		int d = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());

		int cnt = x;

		List<Integer> array = new ArrayList<>();

		for (int i = 0; i < n; i++) {
			array.add(Integer.parseInt(sc.next()));
		}


		for (int a : array) {
			for (int i = 0; i <= d; i++) {
				if (a * i + 1 <= d) {
					cnt++;
				}
			}
		}
		System.out.println(cnt);
	}
}


Measured memory_bytes: 21716
#include <iostream>
 
using namespace std;
 
int main(){
    int n, m;
    cin >> n >> m;
    int A[n][m], b[m];
    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++){
        cin >> b[i];
    }
 
    for(int i = 0; i < n; i++){
        int sum = 0;
        for(int j = 0; j < m; j++){
            sum += A[i][j] * b[j];
        }
        cout << sum << endl;
    }
 
    return 0;
}

Measured memory_bytes: 3100
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int n = sc.nextInt();
		int[] p = new int[n];
		int[] dis = new int[102];
		for(int i = 0; i < n; i++) {
			p[i] = sc.nextInt();
		}
		for(int i = 0;i < 102; i++) {
			dis[i] = i;
			for(int j = 0; j <n ;j++) {
				if(p[j]==dis[i]) {
					dis[i] = -100;
					break;
				}
			}
		}
		int min = Integer.MAX_VALUE;
		int ans = -1;
		for(int i = 0; i < 102; i++) {
			int temp = Math.abs(x-dis[i]);
			if(temp < min) {
				min = temp;
				ans = i;
			}
		}
		System.out.println(ans);
	}
}

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

int main() {
	int n;
	long long ans = 0;
	cin >> n;
	vector<int>a(n);
	map<int, long long>b;

	for (int i = 0; i < n; i++) {
		cin >> a[i];
		b[a[i]]++;
	}
	for (auto p : b) {
		ans += p.second * (p.second - 1) / 2;
	}
	for (int i = 0; i < n; i++) {
		cout << max(ans - (b[a[i]] - 1), (long long)0) << endl;
	}
}


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

int main(){
	bool ok = false;
	int n;
	scanf("%d", &n);
	for(int i=1; i<=9; i++){
		for(int j=1; j<=9; j++){
			if(i*j==n) ok = true;
		}
	}
	if(ok) puts("Yes");
	else puts("No");	
	return 0;
}



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

using namespace std;

typedef long long ll;
typedef long double ld;

int main(){
    ios_base::sync_with_stdio(false);
	cout.precision(10);
	cout << fixed;

    ll s;
    cin >> s;
    cout << "0 0 1000000000 1 ";
    if(s%1000000000 == 0){
        cout << "0 " << s/1000000000;
        return 0;
    }
    cout << 1000000000 - s%1000000000 << " " << s/1000000000 + 1;
    return 0;
}


Measured memory_bytes: 256
/*#pragma GCC optimize("Ofast,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("fast-math")*/
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>

using namespace std;

#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define Str(x) to_string(x)
#define len(s) (int)s.size()
#define int long long
typedef long long ll;
typedef long double lld;
typedef string str;
typedef unsigned long long ull;

 main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n;
    cin >> n;
    vector <int> v(n);
    for (auto &it : v)
        cin >> it;
    sort(all(v));
    int ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            int x = v[i] + v[j];
            x = lower_bound(all(v), x) - v.begin();
            int t = x - j - 1;
            ans += t;
        }
    }

    cout << ans;
    return 0;
}


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

#define ll long long int

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n,k,m,j;
    cin>>n>>k;
    ll dp[n+1],arr[n+1];
    for(int i=1;i<=n;i++)
    {
        cin>>arr[i];
    }
    dp[0]=0;
    dp[1]=0;
    for(int i=2;i<=n;i++)
    {
        dp[i]=dp[i-1]+abs(arr[i]-arr[i-1]);
        j=2;
        while(i-j>0&&j<=k)
        {
            dp[i]=min(dp[i],dp[i-j]+abs(arr[i]-arr[i-j]));
            j++;
        }
    }
    cout<<dp[n]<<endl;
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long int
#define mod 1000000007

string solve(int n) {
        string s = "";
        if(n==0)
            return s;

        while(n)
        {
            int rem = n % 26;
            n = n/26;

            if(rem == 0)
            {
                rem = 26;
                n--;
            }
            s += ('a' + rem - 1);
        }
        reverse(s.begin(), s.end());
        return s;
    }

int32_t main()
 {
	//code
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    int t,n,w,k,x,i;
    //cin>>t;
    t=1;
    while(t--)
    {
        cin>>n;
        cout<<solve(n)<<endl;
    }

	return 0;
}

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

int main(void)
{
    vector<int> nm(5);
    rep(i, 5) cin >> nm[i];
    rep(i, 5){
        if (nm[i] == 0) {
            cout << i+1 << endl;
        }
    }
}


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

int main(){
	int n;
	cin >> n;
	int a,b,c;
	for(int i = 0; i < n; i++){
		cin >> a >> b >> c;
		if(sqrt(a*a) == sqrt(b*b+c*c) || sqrt(b*b) == sqrt(a*a+c*c) || sqrt(c*c) == sqrt(a*a+b*b)) cout << "YES" << endl;
		else cout << "NO" << endl;
	}
	return 0;
}

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

int main(){
  string s;
  cin>>s;
  int res=1000;
  for(char x='a';x<='z';x++){
    string cp=s;
    while(cp.size()!=0){
      for(int i=0;i<cp.size();i++){
	if(cp[i]!=x) break;
	if(i==cp.size()-1){
	  res=min(res,int(s.size()-cp.size()));
	}
      }
      string next;
      for(int i=0;i<cp.size()-1;i++){
	next+=(cp[i]==x || cp[i+1]==x ? x : 'A');
      }
      cp=next;
    }
  }
  cout<<res<<endl;
  
  return 0;
}


Measured memory_bytes: 256
import java.util.*;

class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        while(sc.hasNext()){
            int n = sc.nextInt();
            int count = 0;
            if(n>36){
                System.out.println(0);
                continue;
            }else{
                for(int a=0; a<10;a++){
                    for(int b=0; b<10; b++){
                        for(int c=0; c<10; c++){
                            for(int d=0; d<10; d++){
                                if((a+b+c+d)==n){
                                    count++;
                                }
                            }
                        }
                    }
                }
            }
            
            System.out.println(count);
        }
    }
}

Measured memory_bytes: 18972
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <functional> // std::function<void(int)>
using namespace std;
#define int long long
#define All(v) (v).begin(),(v).end()
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int Dy[8] = {-1,-1,0,1,1,1,0,-1};
int Dx[8] = {0,1,1,1,0,-1,-1,-1};
const int mod = 1000000007;
const int inf = mod*mod;
const int d5 = 111111;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,a,b;
    cin>>n>>a>>b;
    vector<int> x(n),d(n,0);
    for(int i=0;i<n;i++)cin>>x[i];
    for(int i=1;i<n;i++){
        d[i]=x[i]-x[i-1];
    }
    int res=0;
    for(int i=0;i<n;i++){
        res+=min(d[i]*a,b);
    }
    cout<<res<<endl;
}

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

public class Main {

	final static long MOD = 1000000007;
	public static String[] Ws = null;
	public static int wsIndx = 0;
	public static BufferedReader in = null;
	public static void main(String[] args) throws Exception {
		solution(args);
		if(in!=null){
			in.close();
		}
	}

	public static void solution(String[] args) throws Exception{

		int R=nextInt();

		System.out.println(R*R);

	}
	public static String[] toStringArray(String s) {
		String[] tmp = new String[s.length()];
		char[] c = s.toCharArray();
		for (int i = 0; i < tmp.length; i++) {
			tmp[i] = String.valueOf(c[i]);
		}
		return tmp;
	}

	public static void check() throws Exception{
		if(in == null){
			in = new BufferedReader(new InputStreamReader(System.in));
		}
		if(Ws==null || Ws.length<=wsIndx){
			Ws = in.readLine().split(" ");
			wsIndx=0;
		}
	}
	public static int nextInt()throws Exception{
		check();
		return Integer.parseInt(Ws[wsIndx++]);
	}

	public static long nextLong()throws Exception{
		check();
		return Long.parseLong(Ws[wsIndx++]);
	}

	public static String nextString()throws Exception{
		check();
		return Ws[wsIndx++];
	}

	public static int[] nextInts()throws Exception{
		check();
		int[] tmp = new int[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Integer.parseInt(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static long[] nextLongs()throws Exception{
		check();
		long[] tmp = new long[Ws.length];
		for(int i=0;i<tmp.length;i++){
			tmp[i]=Long.parseLong(Ws[i]);
		}
		wsIndx=Ws.length;
		return tmp;
	}

	public static String[] nextStrings()throws Exception{
		check();
		wsIndx=Ws.length;
		return Ws;
	}


}


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

using namespace std;

/*

        Bismillahir Rahmanir Rahim
        Problem :
        Problem Link :
        Topics :
        Solver : Masud Parves
        I Love Code More than Sharks Love Blood <3
*/

#define ff first
#define ss second
#define mp make_pair
#define SZ(a)           (int)a.size()
#define all(a)  a.begin(), a.end()
#define allr(a)  a.rbegin(), a.rend()


#define sf(a)           scanf("%d",&a)
#define sff(a,b)        scanf("%d %d",&a,&b)
#define sfff(a,b,c)     scanf("%d %d %d",&a,&b,&c)

#define f0(i,b) for(int i=0;i<(b);i++)
#define f1(i,b) for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,b,a) for(int i=(b);i>=(a);i--)

#define CIN ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
#define TEST_CASE(t) for(int zz=1 ; zz<=t ; zz++)
#define PRINT_CASE printf("Case %d: ",zz)
#define endl            "\n"
#define Debug(x)            cout<<#x " = "<<(x)<<endl
#define NOT_VISITED 0
#define IS_VISITED 1
#define WHITE 0
#define GRAY 1
#define BLACK 2

int fx[4]= {1,-1,0,0};
int fy[4]= {0,0,1,-1};

/*-----------------------Bitmask------------------*/
//int Set(int N,int pos){return N=N  (1<<pos);}
//int Reset(int N,int pos){return N= N & ~(1<<pos);}
//bool Check(int N,int pos){return (bool)(N & (1<<pos));}
/*------------------------------------------------*/

const double PI = acos(-1.0);
const double EPS = 1e-6;
const int MOD = (int)1e9+7;
const int maxn = (int)1e5+5;


typedef long long ll;
const ll inf = 5e18+100;
typedef unsigned long long ull;
typedef pair<ll, int> plli;
typedef pair<int, ll> pill;
typedef vector<int> vi;
int n, weight, W[101], P[101];
ll DP[101][maxn];

ll cal(int pos, int wgt){
	if(pos>=n || wgt<=0) {
		return 0LL;
	}

	ll &ret = DP[pos][wgt];

	if(ret != -1){
		return ret;
	}

	ret = 0LL;
	
	ret = cal(pos+1, wgt);
	if(W[pos]<=wgt){
		ret = max(ret, P[pos]+cal(pos+1, wgt-W[pos]));
	}
	return ret;
}


void solve(){

	cin >> n >> weight;

	f0(i, n){
		cin >> W[i] >> P[i];
	}

	memset(DP, -1 , sizeof(DP));

	cout << cal(0, weight) << endl;


    return;
}

int main()
{
    CIN

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    //cout << "Fi Amanillah" << endl;

    int t = 1;
    //cin >> t;

    while(t--){
        solve();
    }

    return 0;
}

Measured memory_bytes: 82552
#include<stdio.h>
 
main()
{
    int r,c;
    scanf("%d %d",&r,&c);
     
    int calc[r+1][c+1];
    calc[r][c]=0;
     
    int i,j;
     
    for(i=0;i<r;i++){
        calc[i][c]=0;
        for(j=0;j<c;j++){
            if(i==0){
                calc[r][j]=0;
            }
            scanf(" %d",&calc[i][j]);
        }
    }
     
    for(i=0;i<=r;i++){
        for(j=0;j<=c;j++){
            if(j!=0){
                printf(" ");
            }
             
            printf("%d",calc[i][j]);
             
            if(j==c){
                printf("\n");
            }
            if(j>=0 && j<=c-1){
                calc[i][c] += calc[i][j];
                if(i!=r){
                    calc[r][j] += calc[i][j];
                }
            }
        }
         
    }
    return 0;
}
            

Measured memory_bytes: 640
#include <stdio.h>

int main(void) {
  while (1) {
    char x[1001];
    scanf("%s", x);

    if (x[0]=='0') return 0;

    int sum=0;
    for (int i=0; x[i]!='\0'; i++) {
      sum+=x[i]-'0';
    }
    printf("%d\n", sum);
  }
  return 0;
}


Measured memory_bytes: 2036
#include <iostream>

using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    int n, k, s;
    cin >> n >> k >> s;
    for (int i = 0; i < k; ++i)
        cout << s << " ";
    for (int i = 0; i < n - k; ++i)
    {
        if (s != 1000000000)
            cout << s + 1 << " ";
        else
            cout << "1 ";
    }
    return 0;
}


Measured memory_bytes: 1280
import math

count = 0
N,D = map(int,input().split())
#print(N,D)
dis = 0
for i in range(N):
    X,Y = map(int,input().split())
    dis = math.sqrt(X*X+Y*Y)
    #print(math.sqrt(X*X+Y*Y))
    
    if D >= dis:
        count += 1
print(count)
    

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

struct Card
{
    char mark;
    int number;
};

void Print(Card _c[], int len)
{
    for (int i = 0; i < len; i++)
    {
        if (i != len-1) cout << _c[i].mark << _c[i].number << " ";
        else cout << _c[i].mark << _c[i].number << endl;
    }
}

bool isStable(Card a1[], Card a2[], int len)
{
    for (int i = 0; i < len; i++)
    {
        if (a1[i].mark != a2[i].mark) 
        {
            return false;
        }
    }
    return true;
}

void BubbleSort(Card _c[], int len)
{
    int j = 0;
    while (j < len-1)
    {
        for (int i = len-1; i > j; i--)
        {
            if (_c[i].number < _c[i-1].number) swap(_c[i], _c[i-1]);
        }
        j++;
    }
    Print(_c, len);
    cout << "Stable" << endl;
}

void SelectionSort(Card _c[], int len)
{
    int j = 0;
    while (j < len-1)
    {
        int minI = j;
        for (int i = j+1; i < len; i++)
        {
            if (_c[minI].number > _c[i].number) minI = i; 
        }
        swap(_c[j], _c[minI]);
        j++;
    }
    Print(_c, len);
}

int main() 
{
    Card a[40], b[40], c[40];
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) 
    {
        cin >> a[i].mark >> a[i].number;
    }
    memcpy(b, a, sizeof b);
    memcpy(c, a, sizeof c);
    BubbleSort(b, n);
    SelectionSort(c, n);
    if(isStable(b, c, n)) cout << "Stable" << endl;
    else cout << "Not stable" << endl;
}


Measured memory_bytes: 3092