akhauriyash/Code-Regression huggingface dataset:
// abc.051.C - Back and Forth

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

int main( void ) {
    int sx, sy, tx, ty;
    cin >> sx >> sy >> tx >> ty;

    int disx = abs( tx - sx );
    int disy = abs( ty - sy );

    int sum = disx * 2 + disy * 2;

    // 1周目
    for( int i = 0; i < sum; i++ ) {
        //上
        if( i < disy ) cout << 'U';
        //右
        else if(  i <disy + disx)
            cout << 'R';
        //下
        else if(i < sum - disx )
            cout << 'D';
        else
            cout << 'L';
    }

	//半径が1ずつ増える
    disx += 1;
    disy += 1;

	//四角形の合計+遠回りの+4
    sum = disx * 2 + disy * 2 + 4;

    // 2周目
    for( int i = 0; i < sum; i++ ) {
        //スタートから左に
        if( i == 0 ) cout << 'L';
        //上
        else if( i < 1+disy )
            cout << 'U';
        //右
        else if( i < ( 1 + disy + disx ) )
            cout << 'R';
        //目標に向けて1つ下に
        else if( i == ( 1 + disy + disx ) )
            cout << 'D';
        //目標から1つ右に
        else if( i == ( 2 + disy + disx ) )
            cout << 'R';
        //下
        else if( i < ( 3 + disy *2+ disx ) )
            cout << 'D';
        else if( i < sum - 1 )
            cout << 'L';
        //スタートに向けて
        else
            cout << 'U';
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("O3")
using namespace std;
#define fi first
#define se second
#define pb push_back
#define loop(i, a, b) for (int i=a; i<(b); i++)
typedef long long ll;
typedef pair<int,int> pi;
const int INF = 1e9;
const int MOD = 1000000007;

vector<vector<char>> maze;
vector<pi> good;
vector<pi> bad;
int n,m;

void test_case() {
	int a;
	cin>>a;
	cout<<a*(1+a*(1+a))<<endl;
}

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int t = 1;
	// cin >> t;
	for (int i = 1; i <= t; i++) {
		test_case();
	}
	return 0;
}

Measured memory_bytes: 3644
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const int maxn = 1e5 + 5;
const int MOD = 1e9 + 7;

ll inv[maxn],pow2[maxn];
string s;
ll res[maxn];
vector<int>pos;

void inverse(int n, int p) {
    inv[1] = 1;
    for (int i=2; i<=n; ++i) {
        inv[i] = (ll) (p - p / i) * inv[p%i] % p;
    }
}

ll quickmod(ll a,ll b)
{
    ll ans = 1;
    while(b)
    {
        if(b&1)
        {
            ans=(ans*a)%MOD;
            b--;
        }
        b/=2;
        a=((a%MOD)*(a%MOD))%MOD;
    }
    return ans;
}


int main()
{
   ios::sync_with_stdio(false); cin.tie(0);cout.tie(0);
   cin >> s;
   int n = s.size();
   pow2[0] = 1ll;
   for(int i = 1; i <= n + 1; i++) pow2[i] = (pow2[i-1] * 2) % MOD;
   inverse(n,MOD);
   ll ans = 0;
   ll x = inv[2];
   for(int i = 1 ; i <= n ; i++){
        ll sum = quickmod(1 + x,i - 1);
        //cout << sum << endl;
        res[i] = (sum * pow2[i]) % MOD;
   }
   int cnt = 0;
   //cout << res[1] << endl;
   for(int i = 0; i < n ; i++){
       if(s[i] == '1') {
        ans += (quickmod(3,n - i - 1) * pow2[cnt]) % MOD;
        cnt ++;
      }
      //cout << ans << endl;
   }
   ans = (ans + pow2[cnt]) % MOD;
   cout << ans << endl;
   return 0;

}

Measured memory_bytes: 2768
#include<bits/stdc++.h>
#define cls ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define Mod 998244353
#define ll long long int
#define sf scanf
#define pf printf
#define ref(i,a,b) for(ll i=a;i<b;i++)
using namespace std;
ll n, a, b, k;
const int maxn = 3e5 + 5;
ll fac[maxn];
ll inv[maxn];


ll pow_mod(ll a, ll b, ll p) {
	ll ret = 1;
	while (b) {
		if (b & 1) ret = (ret*a) % p;
		a = (a*a) % p;
		b >>= 1;
	}
	return ret;
}
ll C(ll m) {
	return fac[n] * inv[m] % Mod*inv[n - m] % Mod;
}

int main() {
	cls;
	cin >> n >> a >> b >> k;
	fac[0] = 1;
	ref(i, 1, n + 1) {
		fac[i] = fac[i - 1] * i%Mod;
	}
	inv[1] = inv[0]=1;
	ref(i, 2, n + 1) {
		inv[i] = pow_mod(fac[i], Mod - 2, Mod);
	}
	ll ans = 0;
	ref(i, 0, n + 1) {
		ll t = a * i;
		if (t <= k && (k - t) % b == 0) {
			ll j = (k - t) / b;
			if (max(i, j)>n) {
				continue;
			}
			ans = (ans + C(i)*C(j)%Mod) % Mod;
		}
	}
	cout << ans << endl;
}


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

#define int long long
#define fast_io(); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define loop(i,a,b) for(int i=a;i<b;i++)
#define all(x) x.begin(),x.end()
#define us unordered_set
#define um unordered_map
#define ms multiset
#define mm multimap
#define pb push_back
#define pf push_front
#define ins insert
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define _max max_element
#define _min min_element
#define tc(T) int T; cin>>T; while(T--)
#define q(q) int q; cin>>q; while(q--)
#define pi 3.1415926535897932384626433832
const int pinf=((int)2e18);
const int ninf=((int)-2e18);
const int mod=1000000007;

using namespace std;

int power(int x,int n,int M)
{
    if(n==0)
        return 1;
    else if(n%2 == 0)
        return power((x*x)%M,n/2,M);
    else
        return (x*power((x*x)%M,(n-1)/2,M))%M;
}

bool vowel(char c)
{
    return(c=='a' or c=='e' or c=='i' or c=='o' or c=='u' or c=='A' or c=='E' or c=='I' or c=='U' or c=='O');
}

int32_t main()
{
    fast_io();

    //FILE *fptr1=freopen("in.txt","r",stdin);
    //FILE *fptr2=freopen("in.txt","w",stdout);


    int l,r,d;
    cin>>l>>r>>d;

    int c=0;

    loop(i,l,r+1)
    {
        if(i%d==0)
            c++;
    }
    cout<<c;




    return 0;
}


Measured memory_bytes: 3604
#include <iostream>
#include <cstdio>

int comp_num = 0;
int A[500000];
int L[500000/2 + 3];
int R[500000/2 + 3];

void DumpArray(int *A, int n)
{
    for (int i = 0; i < n; i++) {
        std::cout << A[i];
        if (i != n - 1) {
            std::cout << " ";
        }
    }
    std::cout << std::endl;
}

void Merge(int *A, int left, int mid, int right)
{
    int n1 = mid - left;
    int n2 = right - mid;

    for (int i = 0; i < n1; i++) {
        L[i] = A[left + i];
    }
    for (int i = 0; i < n2; i++) {
        R[i] = A[mid + i];
    }

    L[n1] = 1000000001;
    R[n2] = 1000000001;

    int i = 0, j = 0;
    for (int k = left; k < right; k++) {
        comp_num++;
        if (L[i] <= R[j]) {
            A[k] = L[i];
            i++;
        } else {
            A[k] = R[j];
            j++;
        }
    }
}

void MergeSort(int *A, int left, int right)
{
    if (left + 1 < right) {
        int mid = (left + right) / 2 ;
        MergeSort(A, left, mid);
        MergeSort(A, mid, right);
        Merge(A, left, mid, right);
    }
}

int main(int argc, char *argv[])
{
    int n;
    int A[500000];

    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &A[i]);
    }

    MergeSort(A, 0, n);

    DumpArray(A, n);
    std::cout << comp_num << std::endl;
    return 0;
}


Measured memory_bytes: 6948
#include<iostream>
#include<string>
#include<sstream>
using namespace std;
int o;
string str;
int t;
string num;
int rej;
int s2i(string s){
  istringstream ss(s);
  int x;
  ss >> x;
  return x;
}
void rec(int n,string s,int v){
  //cout << n << ":"<<v <<endl;
  if(n==num.size()-1){
    if(v>o&&v<=t) {
      o=v;
      str=s;
      rej=0;
    }else if(o==v){
      rej=1;
    }
  }
  string buf;
  //buf+=num[n];
  for(int i=n+1;i<num.size();i++){
    buf+=num[i];
    //cout << s2i(buf) <<endl;
    rec(i,s+" "+buf,v+s2i(buf));
  }
}
int main(){
  cin >> t >> num;
  while(num[0]!='0'){
    o=-1;
    rej=0;
    string buf;
    for(int i=0;i<num.size();i++){
      buf+=num[i];
      //cout << s2i(buf) <<endl;
      rec(i," "+buf,s2i(buf));
    }
    //rec(0,0,num[0]-'0');

    if(o==-1) cout << "error" << endl;
    else if(rej==1) cout << "rejected" <<endl;
    else cout << o << str << endl;
    cin >> t >> num;
  }
}

Measured memory_bytes: 1220
#include <iostream>


enum {
  S,
  H,
  C,
  D
};

const char symbols[4] = {'S', 'H', 'C', 'D'};


int main() {
  int n, rank;
  char mark;
  int a[4][14] = {0};
  char deli = ' ';

  std::cin >> n;
  for (int i = 0; i < n; i ++) {
    std::cin >> mark >> rank;
    switch (mark) {
      case 'S':
        a[S][rank] = 1;
        break;
      case 'H':
        a[H][rank] = 1;
        break;
      case 'C':
        a[C][rank] = 1;
        break;
      case 'D':
        a[D][rank] = 1;
        break;
    }
  }

  for (int i = 0; i < 4; i ++) {
    for (int j = 1; j <= 13; j ++) {
      if (a[i][j] == 0) {
        std::cout << symbols[i] << deli << j << std::endl;
      }
    }
  }

  return 0;

}


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

int main() {
	ll N, D;
	cin >> N >> D;
	vector<ll> x(N), y(N);
	rep(i,N) {
		cin >> x[i] >> y[i];
	}

	int ans = 0;
	rep(i,N) if (x[i]*x[i]+y[i]*y[i]<=D*D) ans++;

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 6344
using System;

class P
{
    static void Main(string[] _)
    {
        string result = string.Empty;
        _ = Console.ReadLine().Split(' ');
        if (_[0] == "H" && _[1] == "H")
        {
            result = "H";
        }
        else if (_[0] == "D" && _[1] == "H")
        {
            result = "D";
        }
        else if (_[0] == "H" && _[1] == "D")
        {
            result = "D";
        }
        else if (_[0] == "D" && _[1] == "D")
        {
            result = "H";
        }
        else
        {
            result = "H";
        }
        Console.WriteLine(result);

    }
}


Measured memory_bytes: 13140
//#include <tourist>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <iomanip>
#include <limits>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <tuple>
#include <deque>
#include <algorithm>
#include <numeric>
#include <iomanip>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
//setprecision(15)有効数字15桁
//-std=c++14
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b)
{
    return a * b / gcd(a, b);
}
struct edge {
    int to, cost;
};
int n;
string s;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n>>s;
    string anss="";
    int b=0;
    int a=0;
    for (int i = 0; i < n; i++)
    {
        if(s[i]=='('){
            b++;
        }
        else if(b!=0&&s[i]==')'){
            b--;
        }
        else{
            a++;
        }
    }
    for(int i=0;i<a;i++){
        anss+="(";
    }
    anss+=s;
    for(int i=0;i<b;i++){
        anss+=")";
    }
    cout << anss<< "\n";
}



Measured memory_bytes: 256
#include<iostream>
#include <cstdio>
#include <cmath>
#include <cstring> 
#include <algorithm>
using namespace std;
#include <queue> 
#define ll long long
int main()
{
	int a;
	cin>>a;
	if(a==1)
	{
		cout<<0;
	}
	else
	{
		cout<<1;
	}
}

Measured memory_bytes: 3152
#include <bits/stdc++.h>
using namespace std;
int main(){
	int A,B;
	//freopen("garden.in","r",stdin);
	//freopen("garden.out","w",stdout);
	scanf("%d%d",&A,&B);
	printf("%d",(A-1)*(B-1));
	return 0;
}

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

using namespace std;

int main(int argc, char const *argv[]) {
    string str1,str2;
    cin >> str1 >> str2;
    bool ok;
    int cnt=0;
    for(int i=0;i<str1.size();i++){
        cnt = 0;
        for(int j=i;;j++){
            ok = true;
            cnt++;
            if(cnt>str1.size())break;

            int second = j - i;
            int first = j;
            if(j>=str1.size()){
                 first = j%str1.size();
            }
            //cout << str1[first] << " " << str2[second] << endl;
            if(str1[first] != str2[second]){
                //cout << "No\n";
                ok = false;
                break;
            }
        }
        if(ok){
            cout << "Yes\n";
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


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

int main(){
	int a;
	cin>>a;
	for(int b=0;b<a;b++){
		vector<int>c(3);
		for(int d=0;d<3;d++)cin>>c[d];
		sort(c.begin(),c.end());
		if(c[0]*c[0]+c[1]*c[1]==c[2]*c[2])cout<<"YES"<<endl;
		else cout<<"NO"<<endl;
		}
}

Measured memory_bytes: 3108
#include<stdio.h>
int main()
{
    int a,b,c;
    scanf("%d%d%d",&a,&b,&c);

    if(a<=b)
    {
        if(b<=c)
        {
            printf("%d\n",(a+b));
        }

        else
        {
            printf("%d\n",(a+c));
        }
    }
    else if(b<=a)
    {
        if(a<=c)
        {
            printf("%d\n", (a+b));
        }
        else
        {
            printf("%d\n", (b+c));
        }
    }
}


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

int N;
int G[110][110];
int main(){
	while(cin >> N && N>0){
		vector<vector<int> > g(110,vector<int>(110,0));
		int u,k;
		for(int i=0;i<N;i++){
			cin >> u >> k;
			for(int j=0;j<k;j++){
				int a;
				cin >> a;
				g[u-1].push_back(a); 
			}
		}
		for(int i=0;i<N;i++){
			for(int j=0;j<g[i].size();j++){
				int f = g[i][j];
				G[i][f-1] = 1;
			}
		}
		for(int i=0;i<N;i++){
			for(int j=0;j<N;j++){
				if(j!=N-1){
				cout << G[i][j] << " ";
				}else{
					cout << G[i][j] << endl;
				}
			}
		}
	}
}



Measured memory_bytes: 3288
# /usr/bin/python
# -*- coding: utf-8 -*-
#
import math


n,m,x,y = map(int, input().split())
xn = max(list(map(int, input().split()))+[x])
yn = min(list(map(int, input().split()))+[y])

if xn < yn:
  print("No War")
else:
  print("War")


Measured memory_bytes: 38376
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>

int main(){
  long  n;unsigned long tmp; long m=0;
  std::vector<std::pair<unsigned long,unsigned long> > ls;
  std::cin >> n;
  std::vector<unsigned long long> ans(n);
  ls.reserve(n+1);
  for(long i=0; i<n; ++i) {std::cin >> tmp;ls.emplace_back(std::make_pair(tmp,i));}
  ls.emplace_back(std::make_pair(0,n));
  std::sort(ls.begin(),ls.end(),[](auto a,auto b){return a.first>b.first;});
  auto target=ls.begin();
  for(auto it=ls.begin();it!=ls.cend()-1;){
    if(target->second>it->second)target=it;
    ans[target->second]+=(it->first-(++it)->first)*(++m);
  }
  for(auto x : ans) std::cout<< x <<'\n';
  std::cout.flush();
  return 0;
}

Measured memory_bytes: 3456
def s():
 n=int(input())+1
 e=[input().split()for _  in[0]*~-n]
 p=[int(e[0][0])]+list(int(x[1])for x in e)
 m=[[0]*n for _ in[0]*n]
 for i in range(n):
  for r in range(n-i-1):
   c=r+i+1
   for j in range(r+1,c):
    x=m[r][j]+m[j][c]+p[r]*p[j]*p[c]
    if 1>m[r][c]or m[r][c]>x:m[r][c]=x
 print(m[r][c])
if'__main__'==__name__:s()


Measured memory_bytes: 5712
# def rleify(s: str) -> List[Tuple[str, int]]:
def rleify(s):
    if not len(s):
        return []
    i = 0
    rle = []
    for j in range(len(s) + 1):
        if j == len(s) or s[i] != s[j]:
            rle.append((s[i], j - i))
            i = j
    return rle


s = input()
X, Y = map(int, input().split())
rle = rleify(s)
if rle[0][0] == "F":
    X -= rle[0][1]
    rle = rle[1:]
S = []
P = []
iss = True
for c, n in rle:
    if c == "T":
        if n % 2 == 1:
            iss = not iss
    else:
        if iss:
            S.append(n)
        else:
            P.append(n)

cand = {0}
for n in S:
    ncand = set()
    for c in cand:
        ncand.add(c - n)
        ncand.add(c + n)
    cand = ncand
if X not in cand:
    print("No")
    exit()

cand = {0}
for n in P:
    ncand = set()
    for c in cand:
        ncand.add(c - n)
        ncand.add(c + n)
    cand = ncand
if Y not in cand:
    print("No")
    exit()
print("Yes")


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

int main()
{
    int d, t, s;
    std::cin >> d >> t >> s;

    if (s * t >= d)
    {
        std::cout << "Yes" << '\n';
    }
    else
    {
        std::cout << "No" << '\n';
    }
}


Measured memory_bytes: 3632
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {
    public static void main(String[] args) {
        new Main().run();
    }
    
    public void run() {
        FastScanner sc = new FastScanner();
        int a = sc.nextInt();
        int b = sc.nextInt();
        if (a % 2 == 0 || b % 2 == 0) {
            System.out.println("No");
            return;
        }
        System.out.println("Yes");
    }
    
    
    class FastScanner implements Closeable{
        private final InputStream in = System.in;
        private final byte[] buffer = new byte[1024];
        private int ptr = 0;
        private int buflen = 0;
        private boolean hasNextByte() {
            if (ptr < buflen) {
                return true;
            }else{
                ptr = 0;
                try {
                    buflen = in.read(buffer);
                } catch (IOException e) {
                    e.printStackTrace();
                }
                if (buflen <= 0) {
                    return false;
                }
            }
            return true;
        }
        private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
        private boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
        public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
        public String next() {
            if (!hasNext()) throw new NoSuchElementException();
            StringBuilder sb = new StringBuilder();
            int b = readByte();
            while(isPrintableChar(b)) {
                sb.appendCodePoint(b);
                b = readByte();
            }
            return sb.toString();
        }
        public long nextLong() {
            if (!hasNext()) throw new NoSuchElementException();
            long n = 0;
            boolean minus = false;
            int b = readByte();
            if (b == '-') {
                minus = true;
                b = readByte();
            }
            if (b < '0' || '9' < b) {
                throw new NumberFormatException();
            }
            while(true){
                if ('0' <= b && b <= '9') {
                    n *= 10;
                    n += b - '0';
                }else if(b == -1 || !isPrintableChar(b)){
                    return minus ? -n : n;
                }else{
                    throw new NumberFormatException();
                }
                b = readByte();
            }
        }
        public int nextInt() {
            long nl = nextLong();
            if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
            return (int) nl;
        }
        public double nextDouble() { return Double.parseDouble(next());}
        public void close() throws IOException {
            try {
                in.close();
            } catch (IOException e) {
            }
        }
    }
}

Measured memory_bytes: 22484
left_assoc::Int->[Int]->[Bool]->Int
left_assoc store [] _    = store
left_assoc store _  []   = store
left_assoc store (x:xs) (op:ops) = left_assoc ((if op then (+) else (-)) store x) xs ops

all_pat::Int ->[[Bool]]
all_pat n = (iterate (\ls-> concat [map (b:) ls|b<-[True,False]]) [[]])!!n

n_solver::Int->Int->[Int]->[[Bool]]
n_solver n v (x:xs) = filter (\bs-> (left_assoc x xs  bs)==v) (all_pat n)

gen_str::[Int]->[Bool]->Int->String
gen_str (x:[]) []     v = (show x) ++ "=" ++ (show v)
gen_str (x:xs) (y:ys) v = (show x) ++ (if y then "+" else "-") ++ (gen_str xs ys v)

main::IO()
main=do
  str<-getLine
  let dat = map (\c-> read [c]) str
  let op_pat = head (n_solver 3 7 dat)
  putStr (gen_str dat op_pat (left_assoc (head dat) (tail dat) op_pat))
  putStr "\n"

Measured memory_bytes: 508
#include<bits/stdc++.h>
#define ll long long
const int maxn=1e5+10,mod=998244353;
using namespace std;
pair<ll,ll>nt[maxn];
ll sum=1;
bool cmp(pair<ll,ll> a,pair<ll,ll> b)
{
    return a.first>b.first;
}
ll ksm(ll a,ll b)
{
    ll ans=1;
    for(; b; b>>=1,a=a*a%mod) if(b&1) ans=ans*a%mod;
    return ans;
}
ll C(ll m,ll n)
{
    n=min(n,m-n);
    ll s1=1,s2=1;
    for(int i=1; i<=n; i++)
    {
        s1=s1*i%mod;
        s2=s2*(m-i+1)%mod;
    }
    return s2*ksm(s1,mod-2)%mod;
}

int main()
{
    ios::sync_with_stdio(false);
    string s;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        if(s[i]!='h'||s[i+1]!='i')
        {
            cout<<"No"<<endl;
            return 0;
        }
        i++;
    }
    cout<<"Yes"<<endl;

}









Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys,math
input = sys.stdin.readline
n = int(input())

a = []
tmp = n
for i in range(2, int(n**0.5//1)+1):
  if tmp%i==0:
    count = 0
    while tmp%i==0:
      count += 1
      tmp //=i
    a.append([i, count])
if tmp!=1:
  a.append([tmp,1])
if a==[]:
  if n==1:
    print(0)
    sys.exit()
  else:
    # a.append([n,1])
    print(1)
    sys.exit()
  
# print(a)

r = [k[1] for k in a]
ans = 0
for i in r:
  j = 1
  t = i
  while t>=j:
    ans += 1
    t -= j
    j += 1
print(ans)

Measured memory_bytes: 9492
/*
    In the name of
        "ALLAH"
    And say "AL-HAMD-U-LILLAH"
*/

#include<bits/stdc++.h>
#define   ll   long long
#define   llu  unsigned long long
#define   _    printf("\n")
int      take() {
    int n;
    scanf("%d",&n);
    return n;

}
double  ttake() {
    double n;
    scanf("%lf",&n);
    return n;
}
ll     takes() {
    ll n;
    scanf("%lld",&n);
    return n;

}

#define  Int            take()
#define  Dnt            ttake()
#define  LL             takes()
#define  done           {return 0;}
#define  fr(i,x,n,a)    for(int i=x;i<=n;i+=a)
#define  FR(a,b,x)      for(int i=(a);i<=(b);i+=(x))
#define  rfr(i,x,n,a)   for(int i=x;i>=n;i--)
int      cas;
#define  print          printf("Case %d:",++cas)
#define  vi             vector<int>
#define  vl              vector<ll>
#define  pb              push_back
#define  pii             pair<int,int>
#define  vii             vector<pii>
#define  pll             pair<ll,ll>
#define  pil             pair<int,ll>
#define  pli             pair<ll,int>
#define  mk              make_pair
#define  fill(x,v)       memset(x,v,sizeof x)

using    namespace      std;

bool     approximatelyEqual(float a, float b, float epsilon) {
    return fabs(a - b) <= ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}

bool     essentiallyEqual(float a, float b, float epsilon) {
    return fabs(a - b) <= ( (fabs(a) > fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}

bool     definitelyGreaterThan(float a, float b, float epsilon) {
    return (a - b) > ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}

bool     definitelyLessThan(float a, float b, float epsilon) {
    return (b - a) > ( (fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
}
#define  STR            {struct info}
#define  dbg(x)         {cout<<"ekhane"<<x<<endl;}
#define  SS             second
#define  FF             first
#define  PQ             priority_queue
#define  great          greatest
#define  less           lesser
#define  mii            map<int,int>
#define  mil            map<int,ll>
#define  mll            map<ll,ll>
#define  msb            map<string,bool>
#define  V              vector
#define  M              100005
#define  pf             printf
//////////////////////////////////////////


int main(){

    string s ; cin>>s ;
    int ans = 700 ;
    fr( i , 0 , s.size() - 1 , 1 ){
        if( s[ i ] =='o' ) ans += 100 ;
    }
cout<<ans<<"\n";
    done;
}




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

using namespace std;

  struct UnionFind{
    vector<int> par;
    UnionFind(int n) : par(n){
      for(int i=0;i<n;i++) par[i]=i;
    }
    int root(int x){
      if(par[x]==x) return x;
      return par[x]=root(par[x]);
    }

    void unite(int x,int y){
      int rx=root(x);
      int ry=root(y);
      if(rx==ry) return;
      par[rx]=ry;
    }
    bool same(int x, int y){
      int rx=root(x);
      int ry=root(y);
      if(rx==ry) return 1;
      return 0;
    }
  };
    int main(){
      int n,m;
      int x,y,z;
      cin>>n>>m;
      UnionFind tree(n);
      for(int i=0;i<m;i++){
	cin>>x>>y>>z;
	tree.unite(x-1,y-1);
      }
      vector<int> par(n+1,0);
      int res=0;
      for(int j=0;j<n;j++){
	int c =tree.same(0,j);
    if(par[tree.root(j)]==0)res++;
    par[tree.root(j)]++;
      }
      cout<<res<<endl;
      return 0;
}

Measured memory_bytes: 1280
#include<iostream>
#include<string>
#include<algorithm>

using namespace std;

int main(){
    int n;
    string bom[10];
    bool exp[10][10];
    int a, b;
    cin >> n;
    for(int t = 1;t <= n;t++){
	for(int i = 0;i < 8;i++){
	    cin >> bom[i];
	    for(int j = 0;j < 8;j++)exp[i][j] = false;
	}
	cin >> a >> b;
	exp[b - 1][a - 1] = true;
	for(int i = 0;i < 64;i++){
	    for(int j = 0;j < 8;j++){
		for(int k = 0;k < 8;k++){
		    if(bom[j][k] == '0')continue;
		    if(exp[j][k]){
			for(int l = 1;l <= 3;l++){
			    if(j + l < 8)exp[j + l][k] = true;
			    if(j - l >= 0)exp[j - l][k] = true;
			    if(k + l < 8)exp[j][k + l] = true;
			    if(k - l >= 0)exp[j][k - l] = true;
			}
		    }
		}
	    }
	}
	cout << "Data " << t << ":" << endl;
	for(int i = 0;i < 8;i++){
	    for(int j = 0;j < 8;j++){
		if(bom[i][j] == '1' && !exp[i][j])cout << '1';
		else cout << '0';
	    }
	    cout << endl;
	}
    }
}

Measured memory_bytes: 1208
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
void printhour(int S){
  int s = S % 60;
  S /= 60;
  int m = S % 60;
  int h = S / 60;
  printf("%02d:%02d:%02d", h, m, s);
}

int calc(int h, int m, int s){
  int ms = m * 60 + s;
  int hour = h / 5;
  int res = hour * 60 * 60 + ms;
  int check = (h % 5) * 12 * 60;
  if(check <= ms && ms < check + 12 * 60){
    //printf("%d %d %d -> ", h, m, s);
    //printhour(res);
    return res;
  }else{
    return -1;
  }
}
int tosecond(int h, int m, int s){
  return s + m * 60 + h * 60 * 60;
}
bool contain(int n, int ok[], int s1, int s2){
  int S = 0;
  for(int i = s1; i <= s2; i++){
    S |= ok[i];
  }
  return S == ((1<<n) - 1);
}
bool full(int n, int c[]){
  REP(i, n) if(c[i] == 0) return false;
  return true;
}

int main(){
  int n;
  while(cin>>n && n){
    int s[3];
    int ok[43200] = {};
    REP(i, n){
      REP(j, 3) cin>>s[j];
      sort(s, s + 3);
      do{
        REP(j, 60){
          int result = calc((s[0] + j) % 60, (s[1] + j) % 60, (s[2] + j) % 60);
          if(result != -1) ok[result] |= 1<<i;
        }
      }while(next_permutation(s, s+3));
    }
    int b = 0, e = 0, S = 0;
    int ans1, ans2;
    int mini = INF;
    int c[10] = {};
    while(b < 43200){
      while(e < 43200 && !full(n, c)){
        REP(i, n) if(ok[e] & (1 << i)) c[i]++;
        e++;
      }
      if(!full(n, c)) break;
      if(mini > e - b){
        mini = e - b;
        ans1 = b, ans2 = e - 1;
      }
      REP(i, n) if(ok[b] & (1 << i)) c[i]--;
      b++;
    }
    printhour(ans1); putchar(' '); printhour(ans2); putchar('\n');
  }
  return 0;
}

Measured memory_bytes: 1056
def gcd(a, b):
    if b == 0:
        return a
    else:
        return gcd(b, a % b)


N, X = map(int, input().split())
x = tuple(map(int, input().split()))

x = tuple(map(lambda a: a - X, x))

xl = map(lambda b: -b, filter(lambda a: a < 0, x))
xr = filter(lambda a: a >= 0, x)

g = 0
for xx in xl:
    g = gcd(g, xx)
for xx in xr:
    g = gcd(g, xx)
print(g)


Measured memory_bytes: 14352
#include <bits/stdc++.h>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstring>
#include <chrono>
#include <complex>
#define endl "\n"
#define ll long long int
#define vi vector<int>
#define vll vector<ll>
#define vvi vector < vi >
#define pii pair<int,int>
#define pll pair<long long, long long>
#define mod 1000000007
#define inf 1000000000000000001;
#define all(c) c.begin(),c.end()
#define mp(x,y) make_pair(x,y)
#define mem(a,val) memset(a,val,sizeof(a))
#define eb emplace_back
#define f first
#define s second

using namespace std;
int main()
{
	std::ios::sync_with_stdio(false);
	string s;
	cin >> s;

	int ans = 0;
	int cnt = 0;
	for (int i = 0; i < 3; ++i) {
		if (s[i] == 'R') {
			++cnt;
		} else {
			cnt = 0;
		}
		ans = max(ans, cnt);
	}

	cout << ans << '\n';

	return 0;
}


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

#define rep0(i, n) for(int i=0; i<(int)(n);i++)
#define rep1(i, n) for(int i=1; i<=(int)(n);i++)
#define all(x) (x).begin(), (x).end()
#define debug(a) if(flagdebug){cout << "debug (" #a "):" << endl << (a) << endl;}

using namespace std;
typedef int64_t lint;

bool flagdebug = false;

int main(){
    lint n, t;
    cin >> n >> t;
    vector<pair<lint,lint>> menu(n + 1);

    rep1(i, n){
        cin >> menu[i].first >> menu[i].second;
    }

    vector<vector<lint>> dpl(n + 2, vector<lint>(t + 1, 0));
    rep1(i,n){
        rep1(j,t){
            if(j - menu[i].first >= 0){
                dpl[i][j] = max(dpl[i - 1][j - menu[i].first] + menu[i].second, dpl[i - 1][j]);
            }else{
                dpl[i][j] = dpl[i - 1][j];
            }
        }
    }

    vector<vector<lint>> dpr(n + 2, vector<lint>(t + 1, 0));
    for(lint i = n ; i >= 1 ; i --){
        rep1(j,t){
            if(j - menu[i].first >= 0){
                dpr[i][j] = max(dpr[i + 1][j - menu[i].first] + menu[i].second, dpr[i + 1][j]);
            }else{
                dpr[i][j] = dpr[i + 1][j];
            }
        }
    }

    lint mx = 0;
    lint sum;
    rep0(i,n){
        rep0(j,t){
            sum = dpl[i][j] + dpr[i + 2][t - 1 - j] + menu[i + 1].second;
            mx = max(sum, mx);
        }
    }
    cout << mx << endl;
    return 0;
}

Measured memory_bytes: 141312
def main():
    import sys
    from operator import itemgetter
    input = sys.stdin.readline

    N = int(input())
    HP = []
    for i in range(N):
        h, p = map(int, input().split())
        HP.append((h, p, h+p))
    HP.sort(key=itemgetter(2))

    inf = 10**15
    dp = [[inf] * (N+1) for _ in range(N+1)]
    dp[0][0] = 0
    for i in range(N):
        h, p, _ = HP[i]
        for j in range(N):
            dp[i+1][j] = min(dp[i+1][j], dp[i][j])
            if j+1 <= N:
                if h >= dp[i][j]:
                    dp[i+1][j+1] = min(dp[i+1][j+1], dp[i][j] + p)
    for i in range(N, -1, -1):
        if dp[-1][i] < inf:
            print(i)
            break


if __name__ == '__main__':
    main()


Measured memory_bytes: 231304
#!usr/bin/env python3
from collections import defaultdict, deque
from heapq import heappush, heappop
from itertools import permutations, accumulate
import sys
import math
import bisect
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline())
def LS():return [list(x) for x in sys.stdin.readline().split()]
def S():
    res = list(sys.stdin.readline())
    if res[-1] == "\n":
        return res[:-1]
    return res
def IR(n):
    return [I() for i in range(n)]
def LIR(n):
    return [LI() for i in range(n)]
def SR(n):
    return [S() for i in range(n)]
def LSR(n):
    return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
mod = 1000000007

def solve():
    h,w,K = LI()
    c = [list(input()) for i in range(h)]
    for i in range(h):
        for j in range(w):
            if c[i][j] == "#":
                c[i][j] = 1
            else:
                c[i][j] = 0
    n = h+w
    ans = 0
    for b in range(1<<n):
        nc = [[i for i in j] for j in c]
        for i in range(n):
            if (b>>i)&1:
                if i < h:
                    for k in range(w):
                        nc[i][k] = 0
                else:
                    j = i-h
                    for k in range(h):
                        nc[k][j] = 0
        s = sum([sum(i) for i in nc])
        if s == K:
            ans += 1
    print(ans)
    return

#Solve
if __name__ == "__main__":
    solve()


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

using namespace std;

#define ll long long 
#define ld long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define pb push_back
#define pf push_front
#define popb pop_back
#define popf pop_front
#define ff first
#define ss second
#define endl "\n"
#define MOD 1000000007
#define MOD1 998244353
#define inf 1e18

ll GCD(ll x,ll y){if(y==0)return x;return GCD(y,x%y);}
ll LCM(ll x,ll y){return (x*y)/(GCD(x,y));}
ll LOGK(ll x,ll k){if(x>=k)return 1+LOGK(x/k,k);return 0;}
ll MPOW( ll a, ll b, ll m) { if(b==0) return 1; ll x=MPOW(a,b/2,m); x=(x*x)%m; if(b%2==1) x=(x*a)%m; return x;}
ll MINV(ll a,ll m) {return MPOW(a,m-2,m);}

class pnc{
  ll FACT_MAX,MODU;
  vector<ll> fact;
public:
  pnc( ll n, ll m) { FACT_MAX = n; fact.resize(FACT_MAX); MODU = m; MFACT_INIT(MODU);}
  void MFACT_INIT( ll m) { fact[0]=1; for(ll i=1;i<FACT_MAX;++i) fact[i]=(i*fact[i-1])%MODU;}
  ll MFACT( ll n) { return fact[n];}
  ll PERM( ll n, ll r) { return (fact[n]*::MINV(fact[n-r],MODU))%MODU;}
  ll COMB( ll n , ll r) { return (PERM(n,r)*::MINV(fact[r],MODU))%MODU;}
};

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

    ll test=1;
    // cin>>test;
    while(test--)
    {
        ll x;
        cin>>x;

        if(x>=30)
        cout<<"Yes"<<endl;
        else
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 3648
import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);

void main()
{
    long a, b, c;
    scan(a, b, c);
    foreach (i; 1 .. 10 ^^ 3)
    {
        if ((a * i) % b == c)
        {
            writeln("YES");
            return;
        }
    }
    writeln("NO");
}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}


Measured memory_bytes: 3676
#include <stdio.h>
#include <ctype.h>

int main()
{
  int i,j,n,cnt = 0;
  char w[10],t[1000],end[] = "END_OF_TEXT";

  scanf("%s",w);

  while(1)
  {
    scanf("%s",t);
    if(strcmp(t,end) == 0) break;
    
    n = strlen(t);
    for(i = 0; i < n; i++) t[i] = tolower(t[i]);
    if(strcmp(t,w) == 0) cnt++;
  }
  printf("%d\n",cnt);
  return 0;
}
  

Measured memory_bytes: 552
// È¥°É£¡Æ¤¿¨Çð! °ÑAC´ø»ØÀ´£¡
//      ¤Ø¡¡¡¡¡¡¡¡¡¡£¯|
// ¡¡¡¡/£Ü7¡¡¡¡¡¡ ¡Ï£ß/
// ¡¡ /¡¡©¦¡¡¡¡ £¯¡¡£¯								AC		AC		AC		AC
//    ©¦¡¡Z £ß,£¼¡¡£¯¡¡¡¡ /`©c						AC		AC		AC		AC
//    ©¦¡¡¡¡¡¡¡¡¡¡©c¡¡¡¡ /¡¡¡¡¡µ					AC		AC		AC		AC
// ¡¡Y¡¡¡¡¡¡¡¡¡¡`¡¡ /¡¡¡¡/  /						AC		AC		AC		AC
// ¡¡Øé¡ñ¡¡.¡¡¡ñ¡¡¡¡¡´¡¡/¡¡/						AC		AC		AC		AC
// ¡¡()¡¡ ¤Ø¡¡¡¡¡¡¡¡|¡¡£Ü¡´							AC		AC		AC		AC
// ¡¡¡¡>- ._¡¡ ¥£¡¡ ©¦ £¯£¯							AC		AC		AC		AC
// ¡¡ / ¤Ø¡¡¡¡ /¡¡/£¼| £Ü£Ü							AC		AC		AC		AC
// ¡¡ ©c_/¡¡¡¡(_£¯¡¡ ©¦£¯£¯							AC		AC		AC		AC
// ¡¡¡¡ 7¡¡¡¡¡¡¡¡¡¡¡¡¡¡|£¯							AC		AC		AC		AC
// ¡¡¡¡ £¾¨Dr£þ£þ`-¨D£ß/							AC		AC		AC		AC
//**************************************Accepted*****************************************//

#include<bits/stdc++.h>

#define all(x) x.begin(),x.end()
#define pb push_back
#define mp make_pair
#define Unique(x) x.erase(unique(all(x)),x.end);

#define CIN_FILE "input.txt"
#define COUT_FILE "output.txt"

using namespace std;

typedef long long ll;

string s;
ll ans;

int main(int argc, char const *argv[])
{
	ios::sync_with_stdio(false);
	
	cin>>s;
	int sz=s.size();
	
	for(int i=0;i<(1<<(sz-1));i++)
	{
		ll ret=(ll)(s[0]-'0');
		
		for(int j=0;j<sz-1;j++)
		{
			if(i&(1<<j))
			{
				ans+=ret;
				ret=0LL;
			}
			
			ret=(ll)(ret*10+(ll)(s[j+1]-'0'));
		}
		
		ans+=ret;
	}
	
	cout<<ans;
	
	//printf("Time used = %.4f",(double)(clock())/CLOCKS_PER_SEC);
	return 0;
}

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

// ----------- define --------------
#define int long long
#define vi vector<int>
#define vc vector<char>
#define ii pair<int,int>
#define fi first
#define sc second
#define stoi stoll
#define all(x) (x).begin(),(x).end()
#define get_bit(x, k) ((x >> k) & 1)
// ---------------------------------

void MAIN() {
  int n, k, s;
  cin >> n >> k >> s;
  for (int i = 0; i < n; i++) {
    if (i < k) cout << s << ' ';
    else {
      if (s == (int)(1e9)) cout << 1 << ' ';
      else cout << (int)(1e9) << ' ';
    }
  }
  cout << '\n';
}

signed main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 3640
m, d = map(int, input().split())
res = 0
for i in range(1, m + 1):
    for j in range(1, d + 1):
        if j >= 10 and j % 10 >= 2 and j // 10 >= 2 and (j // 10) * (j % 10) == i:
            res += 1

print(res) 

Measured memory_bytes: 66032
#include <stdio.h>

int main(int argc, char** argv)
{
	int i, j, k, r, c, num, cnt, *ar;

	cnt = 0;
	scanf("%d %d", &r, &c);
	ar = (int *)malloc(r * c * sizeof(int));

	for (i = 0; i < r; i++) {
		for (j = 0; j < c; j++) {
			scanf("%d", &ar[i * c + j]);
		}
	}

	for (i = 0; i < r + 1; i++) {
		int row_sum = 0;

		for (j = 0; j < c + 1; j++) {
			if (j == c) {
				printf("%d\n", row_sum);
			}
			else {
				if (i == r) {
					int col_sum = 0;
					for (k = 0; k < r; k++) {
						col_sum += ar[k * c + j];
					}
					printf("%d ", col_sum);
					row_sum += col_sum;
				}
				else {
					printf("%d ", ar[i * c + j]);
					row_sum += ar[i * c + j];
				}
			}
		}
	}
	return 0;
}

Measured memory_bytes: 632
#include<bits/stdc++.h>
using namespace std;
#define ll long long
//#define int long long
#define mod 1000000007
#define fast  ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define f(i,n) for(ll i=0;i<n;i++)
#define f1(i,n) for(ll i=1;i<n;i++)
#define x first
#define y second
#define mp make_pair
#define pb push_back
#define all(a) (a).begin(), (a).end()
#define ms(v,n) memset((v),n,sizeof(v));
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define sll set<ll>
#define vll vector<ll>
#define vpll vector<pll>
#define maxi(a,b,c) max(a,max(b,c))
#define maxii(a,b,c,d) max(max(a,b),max(c,d))
#define mini(a,b,c) min(a,min(b,c))
#define md(a,b)  ((a%mod)*(b%mod)+mod)%mod 
#define ad(a,b)  (a%mod+b%mod+mod)%mod
#define nl endl
#define inf 1e18
#define cases ll t;cin>>t;while(t--)
#define BLOCK 500
const double PI = 3.141592653589793238460;
typedef std::complex<double> Complex;
typedef std::valarray<Complex> CArray;
 
using namespace std;

const int N=2005;

ll dp[N][N],vis[N][N];
ll n,m;
 ll a[N],b[N];
ll go(ll i,ll j)
{
    if(i>=n||j>=m)
    return 0;

    ll &ans=dp[i][j];

    if(vis[i][j])
    return ans;

    vis[i][j]=1;
    if(a[i]==b[j])
    ans=1+go(i+1,j)+go(i,j+1);

    else
    {
    ans=go(i,j+1)+go(i+1,j);
    if(ans>=mod)
    ans-=mod;
    ans-=go(i+1,j+1);
    if(ans<0)
    ans+=mod;


    }
    

    if(ans>=mod)
    ans-=mod;

    return ans;


    
}

int main()
{
    
    fast

    
    cin>>n>>m;
   
    
    f(i,n)
    cin>>a[i];
    f(i,m)
    cin>>b[i];

    //cout<<go(0,0)+1;

    
f1(i,n+1)
f1(j,m+1)
{
    
            dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % mod;
            dp[i][j] = (dp[i][j] - dp[i - 1][j - 1] + mod) % mod;
            if (a[i-1] == b[j-1]) {
                dp[i][j] = (dp[i][j] + 1 + dp[i - 1][j - 1]) % mod;
            }


}
cout<<(dp[n][m]+1)%mod;


// ll ans=0;
// f1(i,n+1)
// f1(j,m+1)
// {
//     ans+=dp[i][j];
//     if(ans>=mod)
//     ans-=mod;
// }

// cout<<ans;

    
   


    

       
    return 0;
    
}



Measured memory_bytes: 32384
import math

def colcu (bli,ali,D):
    num = 0
    for i in range(D):
        num += (bli[i] - ali[i]) ** 2
    return math.sqrt(num)

N,D = map(int, input().split())
pli = []
for i in range(N):
  pli.append(list(map(int, input().split())))

an = 0
for i in range(N-1):
 for t in range(i+1,N):
     if colcu(pli[i],pli[t],D).is_integer():
         an += 1
print(an)

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

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

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

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

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


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

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

main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin >> s;
    if (s[2] == s[3] && s[4] == s[5]) {
        cout << "Yes\n";
    }
    else cout << "No\n";
}


Measured memory_bytes: 3604
#include<iostream>
using namespace std;
string s[1000];
int h,w;
int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,1,0,-1,1,-1,1,-1};
main()
{
	cin>>h>>w;
	for(int i=1;i<=h;i++)cin>>s[i];
	for(int i=1;i<=h;i++)s[i]="."+s[i]+".";
	for(int i=0;i<w+2;i++)s[0]+=".",s[h+1]+=".";
	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		{
			if(s[i][j]=='#')continue;
			char c='0';
			for(int r=0;r<8;r++)
			{
				c+=s[i+dx[r]][j+dy[r]]=='#';
			}
			s[i][j]=c;
		}
	}
	for(int i=1;i<=h;i++)
	{
		for(int j=1;j<=w;j++)
		{
			cout<<s[i][j];
		}
		cout<<endl;
	}
}


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

int main(){
	double A, B, H, M;
	cin >> A >> B >> H >> M;
	double arH = ((60.0 * H + M) / 720.0);
	double arM = (M / 60.0);
	double coHM = cos((arH - arM) * M_PI * 2);
	double ans2 = A * A + B * B - 2  * A * B * coHM;
	double ans = sqrt(ans2);
	printf("%.15f\n", ans);
}

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

using namespace std;

#define intt long long
#define FAST ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int N = 100005;

int n;
int a[N];

int main() {

	FAST;

	int h, a;
	cin >> h >> a;
	int ans = h / a;
	if (h % a) ans ++;
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 256
N = 4

def hit(arr1, arr2)
  n = 0
  
  N.times do |i|
    n += 1 if arr1[i] == arr2[i]
  end
  
  return n
end

def blow(arr1, arr2)
  n = 0
  
  N.times do |i|
    N.times do |j|
      n += 1 if i != j && arr1[i] == arr2[j] 
    end
  end
  
  return n
end

while line1 = gets
  arr1 = line1.split
  arr2 = gets.split
  puts "#{hit(arr1, arr2)} #{blow(arr1, arr2)}"
end

Measured memory_bytes: 6104
import java.util.Scanner;
 
public class Main {

	public static final MyScanner in = new MyScanner();

	public static void main(String[] args) {

		int X = in.nextInt();

		int handred = X / 100;
		int ten = (X % 100);

		if(X < 100) {
			System.out.println(0);
			return;
		}

		for(int i=0;i < handred;i++) {
			if (ten >= 5) ten -= 5;
			else if (ten >= 4) ten-=4;
			else if (ten >= 3) ten-=3;
			else if (ten >= 2) ten-=2;
			else if (ten >= 1) ten-=1;
			if(ten == 0) break;
		}

		if (ten == 0) {
			System.out.println(1);
		}else {
			System.out.println(0);
		}
	}

	public static class MyScanner{
		Scanner sc = new Scanner(System.in);
		String nextLine() {return sc.nextLine();}
		String next() {return sc.next();}
		int nextInt() {return Integer.valueOf(sc.next());}
		long nextLong() { return Long.valueOf(sc.next());}
	}
}

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

char a[22][22];

int n,m;

struct pos{
	int x;
	int y;
	int step;
};

pos make_pos(int a,int b,int c){
	pos ret;
	
	ret.x=a;
	ret.y=b;
	ret.step=c;
	
	return ret;
}

int bfs(int sx,int sy,int ex,int ey){
	bool vis[n+2][m+2];
	
	for(int i=0;i<=n+1;++i)
		for(int j=0;j<=m+1;++j)
			if(a[i][j]=='#')
				vis[i][j]=true;
			else
				vis[i][j]=false;
	
	queue<pos> q;
	q.push(make_pos(sx,sy,0));
	vis[sx][sy]=true;
	int move[2][4]={{0,0,-1,1},{-1,1,0,0}};
	
	while(!q.empty()){
		pos fr=q.front();
		q.pop();
		if(fr.x==ex&&fr.y==ey)
			return fr.step;
			
		pos newpo;
		for(int i=0;i<4;++i){
			int nx=fr.x+move[0][i];
			int ny=fr.y+move[1][i];
			if(vis[nx][ny])
				continue;
			vis[nx][ny]=true;
			newpo=make_pos(nx,ny,fr.step+1);
			q.push(newpo);
		}
	}
	return 0;
}

int main(){
	for(int i=0;i<22;++i)
		for(int j=0;j<22;++j)
			a[i][j]='#';
	
	cin>>n>>m;
	
	for(int i=1;i<=n;++i)
		for(int j=1;j<=m;++j)
			cin>>a[i][j];
	
	int maxv=0;
	
	for(int i1=1;i1<=n;++i1)
		for(int j1=1;j1<=m;++j1){
			if(a[i1][j1]=='#')
				continue;
			for(int i2=1;i2<=n;++i2)
				for(int j2=1;j2<=m;++j2){
					if(a[i2][j2]=='#')
						continue;
					if(i1==i2&&j1==j2)
						continue;
					
					maxv=max(maxv,bfs(i1,j1,i2,j2));
				}
		}
	
	cout<<maxv<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip> // 文字幅の指定 setw(int), 詰めたい文字の指定 setfill(char)
#include <algorithm> // sort
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define p(x) cout << (x) << endl
#define FOR(i,r,n) for(ll i=(ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n); i>=r; i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) REP(i,0,n)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define pb push_back

// 定義する？→左揃えで0埋め
// cout << setfill('0') << left << setw(4) << 12; // "0012"
// http://marycore.jp/prog/cpp/padding-left-right-zero/

const int inf = (int)1e9;
const ll INF = (ll)1e18;

// vectorの中身をcout << vs;で表示
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v)
{
    o << "{";
    for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i];
    o << "}";
    return o;
}

ll gcd (ll a, ll b) {
	while (b > 0) {
		ll t = a % b;
		a = b, b = t;
	}
	return a;
}

ll lcm (ll a, ll b) {
	return (a / gcd (a, b)) * b;
}

bool is_prime (ll n) {
		if (n < 2) return false;
		else if (n == 2) return true;
		else if (n % 2) return false;
		
		double sqrtn = sqrt(n);
		for (ll i = 3; i < sqrtn; i += 2) {
			if (n % i == 0) return false; 
		}
		return true;
}

ll ctoi(char c) {
	return (ll)(c - 48);
}

ll n, k, cnt=0, ans=0;
string s,t;

// ==================== template ============================

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

	int a, b, c, k; cin >> a >> b >> c >> k;
	int max;
	if (a >= b && a >= c) {
		max = a;
		cout << c + b + a * pow(2, k) << endl;
	}
	else if (b >= a && b >= c) {
		max = b;
		cout << a + c + b * pow(2, k) << endl;
	}
	else {
		max = c;
		cout << a + b + c * pow(2, k) << endl;
	}
}



Measured memory_bytes: 384