akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define ll long long
const int mod=1e9+7;
using namespace std;

int a[100];
ll dp[55][2550];
int main()
{
    //freopen("input.txt","r",stdin);
    ios::sync_with_stdio(false);
    int N,A;cin>>N>>A;
    for(int i=1;i<=N;i++)
    {
        cin>>a[i];
    }
    ll sum=0,ans=0;
    dp[0][0]=1;
    for(int i=1;i<=N;i++)
        for(int j=i;j>=1;j--)
            for(int k=2550;k>=a[i];k--)
                dp[j][k]+=dp[j-1][k-a[i]];
    for(int i=1;i<=N;i++)
    {
        sum+=dp[i][i*A];
    }
    cout<<sum<<endl;
}



Measured memory_bytes: 1280
/*
 * author :Sadik Hassan(_sad_)
 *
*/
#include "bits/stdc++.h"
using namespace std;
using   ll       =    long long;
using   ld       =    long double;
#define nl            "\n"
#define pb            push_back
#define fi            first
#define se            second
#define MP            make_pair
#define PI            (acos(-1.0))
#define rep1(i,n)     for(int i=1;i<=n;i++)
#define rep(i,n)      for(int i=0;i<n;i++)
#define SZ(s)         (int)s.size()
#define all(x)        (x).begin(), (x).end()
#define rall(x)       (x).rbegin(), (x).rend()
#define w(t)          int t;cin>>t;while(t--)
#define TSU(s)        transform(s.begin(),s.end(),s.begin(),::toupper);
#define TSL(s)        transform(s.begin(),s.end(),s.begin(),::tolower);
#define _SAD()     	  ios::sync_with_stdio(0),cin.tie(0),cout.tie(0),cout<<fixed<<setprecision(15);

typedef vector<int>vi;
typedef vector<ll>vii;
typedef set<int>si;
typedef set<ll>sii;
/*---------------------------------------------------------------------*/

const int N = (int)1e6+1;
const ll MOD =(ll)1e9+1147483647;
const ll INF = (ll)1e18+5;

int main()
{
    _SAD()
    int n;
    cin>>n;
    vi a(n);
    ll ans=1000,gu=1000,cnt=0;
    rep(i,n)cin>>a[i];
    rep(i,n-1)
    {
        if(a[i]<a[i+1])
        {
            int j=i;
            while(a[i]<a[i+1]&&i+1<n)i++;
            ll mut=gu/a[j];
            gu%=a[j];
            gu+=(mut*a[i]);
           // i++;
        }
    }
    cout<<gu<<nl;
    return 0;
}


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

int main()
{
    #ifdef insomnia
    //freopen("in.txt","r",stdin) ;
    //freopen("out.txt","w",stdout) ;
    #endif // insomnia
    int n , m ;
    while(~scanf("%d %d",&n,&m)){
        printf("%d\n",(n-1)*(m-1)) ;
    }
    return 0 ;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<string>
#include<algorithm>
#include<vector> 
#include<limits>
#include<numeric>
#include<type_traits>
#include<math.h>
using namespace std;
typedef long long ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
#define in(x) cin >> x
#define out(str) cout << str << endl

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

ll A,B,Q,swest,seast,twest,teast,ans,top,bot,mid;

int main(){
    cin>>A>>B>>Q;
    ll s[A],t[B],x[Q];
    rep(i,A){
        cin>>s[i];
    }
    rep(i,B){
        cin>>t[i];
    }
    rep(i,Q){
        cin>>x[i];
    }
    sort(s,s+A);
    sort(t,t+B);
    // rep(i,A){
    //     out(s[i]);
    // }
    rep(i,Q){
        ans=1e15;
        if(x[i]<s[0]){
            swest=-100000000000;
            seast=s[0];
        }
        else if(x[i]>s[A-1]){
            swest=s[A-1];
            seast=1e14;
        }
        else{
            bot=0;
            top=A-1;
            mid=(top+bot)/2;
            while(true){
                if(s[mid]<=x[i]&&s[mid+1]>=x[i]){
                    swest=s[mid];
                    seast=s[mid+1];
                    break;
                }
                else{
                    if(s[mid]>x[i]){
                        top=mid;
                        mid=(top+bot)/2;
                    }
                    else{
                        bot=mid;
                        mid=(top+bot)/2;
                    }
                }
            }
        }
        if(x[i]<t[0]){
            twest=-100000000000;
            teast=t[0];
        }
        else if(x[i]>t[B-1]){
            twest=t[B-1];
            teast=1e14;
        }
        else{
            bot=0;
            top=B-1;
            mid=(top+bot)/2;
            while(true){
                if(t[mid]<=x[i]&&t[mid+1]>=x[i]){
                    twest=t[mid];
                    teast=t[mid+1];
                    break;
                }
                else{
                    if(t[mid]>x[i]){
                        top=mid;
                        mid=(top+bot)/2;
                    }
                    else{
                        bot=mid;
                        mid=(top+bot)/2;
                    }
                }
            }
        }
        // printf("swest : %lld seast : %lld\n",swest,seast);
        // printf("twest : %lld teast : %lld\n",twest,teast);
        ans=min(ans,abs(x[i]-min(swest,twest)));
        // out(ans);
        ans=min(ans,abs(x[i]-max(seast,teast)));
        // out(ans);
        ans=min(ans,abs(min(x[i]-swest,teast-x[i])*2+max(x[i]-swest,teast-x[i])));
        // out(ans);
        ans=min(ans,abs(min(x[i]-twest,seast-x[i])*2+max(x[i]-twest,seast-x[i])));
        out(ans);
    }
}


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

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

  if(n%10 == 7) {
    cout << "Yes" << endl;
  } else if(n/100==7) {
    cout << "Yes" << endl;
  } else if((n%100-n%10)/10 == 7) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

  return 0;
}


Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define INF 1100000000

using namespace std;
typedef long long ll;

int main()
{
  int N, T;
  cin >> N >> T;
  int ma = -1;
  int cnt = 0;
  int miA = INF;
  REP(i, N) {
    int A;
    cin >> A;
    int bf = A - miA;
    if (ma == bf) cnt++;
    else if (ma < bf) ma = bf, cnt = 1;
    miA = min(miA, A);
  }
  cout << cnt << endl;

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cmath>
using namespace std;
int n,m,K,num[202020];
int cnt[101][101];
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
	{
		int x=i,top=0;
		while(x) num[++top]=x%10,x/=10;
		cnt[num[top]][num[1]]++;
	}
	// for(int i=1;i<=9;i++)
		// for(int j=1;j<=9;j++)
			// if(cnt[i][j]) cout<<i<<" "<<j<<" "<<cnt[i][j]<<endl;
	long long ans=0;
	for(int i=1;i<=9;i++)
	{
	//	ans-=cnt[i][i];
		for(int j=1;j<=9;j++)
		ans+=1LL*cnt[i][j]*cnt[j][i];
	// cout<<i<<" "<<ans<<endl;
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <queue>

using namespace std;

typedef long long ll;
typedef vector<int> vint;
typedef vector<vector<int> > vvint;
typedef vector<long long> vll, vLL;
typedef vector<vector<long long> > vvll, vvLL;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<n;++i)
#define mod (ll)(1e9+7)
#define FIX(a) ((a)%mod+mod)%mod
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define fi first
#define se second
#define pb push_back
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    string ans = "";
    while(n>0){
        int x = (n-1)%26;
        ans = (char)(x+'a') + ans;
        n = (n-1)/26;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  Int m,d;
  cin>>m>>d;
  Int ans=0;
  for(Int i=1;i<=m;i++){
    for(Int j=10;j<=d;j++){
      string s=to_string(j);
      if(s[0]<'2'||s[1]<'2') continue;
      if((s[0]-'0')*(s[1]-'0')==i) ans++;
    }
  }
  cout<<ans<<endl;
  return 0;
}


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

#define Fast ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define FO freopen("in.txt", "r", stdin)
#define FC freopen("out.txt", "w", stdout)
#define aise cout<<"aise"<<endl
#define pb push_back
#define pf push_front
#define ppb pop_back
#define ppf pop_front
#define mp make_pair
#define ll long long
#define all(x) x.begin(), x.end()
#define mset(v, a) memset(v, a, sizeof(v))
#define pll pair< ll, ll >
#define pdd pair< double, double >
#define ff first
#define ss second
#define pi acos(-1.0)
#define mxN 2010
#define inf 1e14
#define MOD 1000000007

int main()
{

    string ss;
    cin >> ss;
    ll a = ss[0]- '0', b = ss[1]- '0', c = ss[2]- '0', d = ss[3]- '0';
    for(ll i = 0; i < 2; i++)
    {

        for(ll j = 0; j < 2; j++)
        {

            for(ll k = 0; k < 2; k++)
            {

                ll ans = a;
                if(i==0) ans+=b;
                else ans-=b;
                if(j==0) ans+=c;
                else ans-=c;
                if(k==0) ans+=d;
                else ans-=d;
                if(ans==7)
                {

                    cout << a;
                    if(i==0) cout << "+";
                    else cout << "-";
                    cout << b;
                    if(j==0) cout << "+";
                    else cout << "-";
                    cout << c;
                    if(k==0) cout << "+";
                    else cout << "-";
                    cout << d;
                    cout << "=";
                    cout << 7;
                    return 0;
                }
            }
        }
    }
}


Measured memory_bytes: 256
INT = lambda: int(input())
INTM = lambda: map(int,input().split())
STRM = lambda: map(str,input().split())
STR = lambda: str(input())
LIST = lambda: list(map(int,input().split()))
LISTS = lambda: list(map(str,input().split()))
def do():
    n=INT()
    ct=0
    while n!=0:
        ct+=1
        n=n//2
    print(2**(ct-1))
if __name__ == '__main__':
    do()

Measured memory_bytes: 3188
program bingo
  implicit none
  integer :: a(3,3), n, b, i, j, k
  logical :: x
  read(*,*) a
  read(*,*) n
  do i = 1, n
    read(*,*) b
    do j = 1, 3
      do k = 1, 3
        if (a(j,k) == b) a(j,k) = -1
      end do
    end do
  end do
  x = a(1,1) < 0 .and. a(2,2) < 0 .and. a(3,3) < 0
  x = x .or. (a(3,1) < 0 .and. a(2,2) < 0 .and. a(1,3) < 0)
  do i = 1, 3
    x = x .or. all(a(i,:) < 0)
    x = x .or. all(a(:,i) < 0)
  end do
  write(*,'(a)') trim(merge("Yes","No ",x))
end program bingo

Measured memory_bytes: 256
// --------------
// Tejas Pandey  |
// 21 - 03 - 20  |
// AtCoder BC 159|
// --------------

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

#define mod 998244353
#define vi vector<int>
typedef long long int ll;

int main (void)
{
  //freopen("in.txt","r",stdin);
  //freopen("out.txt","w",stdout);
  ll n,m;
  cin >> n >> m;
  cout << (n*(n - 1))/2 + (m*(m - 1))/2;
  return 0;
}

Measured memory_bytes: 256
from fractions import gcd
from math import sqrt, floor

a, b = map(int, input().split())
mx, mi = max(a, b), min(a, b)

g = gcd(b, a % b)

div = []
for i in range(1, int(g**0.5)+1):
    if g % i == 0:
        div.append(i)
        if i != g // i:
            div.append(g//i)

def is_prime(x):
    if x == 2: return True
    if not x % 2: return False
    for j in range(3, floor(sqrt(x))+1, 2):
        if not x % j: return False
    else: return True

ans = 0
for d in div:
    ans += is_prime(d)

print(ans)


Measured memory_bytes: 66136
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> vp;
typedef vector<PL> vpl;
typedef vector<vector<P>> vvp;
typedef vector<vector<PL>> vvpl;
const int INF = 1001001001;
const ll LINF = 1e18;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}


int main(){
    string s; cin >> s;
    ll ans_0 = 0, ans_1 = 0;
    REP(i, s.size()){
        if(i%2 == 0){
            if(s[i] == '0') ans_1++;
            else ans_0++;
        }
        else{
            if(s[i] == '0') ans_0++;
            else ans_1++;
        }
    }
    cout << min(ans_0, ans_1) << endl;
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<(int)(n);i++)
#define rrep(i, n) for(int i=((int)(n));i>0;i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)	
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define REVSORT(c) SORT(c);REVERSE(c)
#define ALL(x) (x).begin(),(x).end()
#define INF 1e9
const long long MOD = 1000000007;
typedef long long ll;

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

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
using namespace std;

#define ll long long
#define pb push_back

int main(){

	int N;
	vector<ll> A, B;
	cin >> N;
	A.pb(0);
	B.pb(0);
	for(int i = 1; i <= N; i ++){
		ll a;
		cin >> a;
		A.pb(a);
		B.pb(a);
	}
	ll ans1 = 0, ans2 = 0;
	for(int i = 1; i <= N; i ++){
		A[i] = A[i] + A[i - 1];
		if(i % 2 == 0){
			if(A[i] <= 0){
				ans1 += 1 - A[i];
				A[i] = 1;
			}
		}
		else{
			if(A[i] >= 0){
				ans1 += A[i] + 1;
				A[i] = -1;
			}
		}
		//cout << A[i] << " ";
	}
	//cout << endl;
	for(int i = 1; i <= N; i ++){
		B[i] = B[i] + B[i - 1];
		if(i % 2 == 0){
			if(B[i] >= 0){
				ans2 += B[i] + 1;
				B[i] = -1;
			}
		}
		else{
			if(B[i] <= 0){
				ans2 += 1 - B[i];
				B[i] = 1;
			}
		}
		//cout << B[i] << " ";
	}
	//cout << endl;
	cout << min(ans1, ans2) << endl;
	
	return 0;
}

Measured memory_bytes: 2036
def prime_factorization(n):  # 素因数分解
    res = []
    for i in range(2, int(n ** 0.5) + 1):
        if n % i == 0:
            cnt = 0
            while n % i == 0:
                cnt += 1
                n //= i
            res.append((i, cnt))
    if n > 1:
        res.append((n, 1))
    return res


if __name__ == "__main__":
    N = int(input())
    pf = prime_factorization(N)
    ans = "{}:".format(N)
    for k, v in pf:
        ans += (" {}".format(k)) * v
    print(ans)


Measured memory_bytes: 5640
#include <bits/stdc++.h>
using namespace std;
 
#define MAXN (int)(2*1e5 + 1)
#define F first
#define S second
#define endl "\n"
#define MOD (int)(1e9 + 7)
#define lli long long int
#define sz(a) int(a.size())
#define DEBUG if(0) cout << "aqui" << endl;
#define PI 2 * acos(0.0)
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int dddx[] = {1, -1, 0, 0, 1, 1, -1, -1};
int dddy[] = {0, 0, 1, -1, 1, -1, 1, -1};

int n;
string s;

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

  cin >> n;
  cin >> s;
  string aux = s.substr(0, sz(s)/2);
  string aux2 = s.substr(sz(s)/2, sz(s));

  // cout << aux << " " << aux2 << endl;  
  
  if(aux == aux2) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define L long long
#define pb push_back
#define pi pair<int,int>
#define pii pair<pair<int,int>,int>
#define aa first
#define bb second
#define xx aa.aa
#define yy aa.bb
#define zz bb
#define mp make_pair
#define mpp(a,b,c) mp(mp(a,b),c)
using namespace std;
int r,c,n,m,f[200010];
pi x[200010];
inline int get()
{
	int x,y;
	scanf("%d%d",&x,&y);
	if(x==0)
	  return y+1;
	else if(y==c)
	  return x+c+1;
	else if(x==r)
	  return r+c+1+c-y;
	else if(y==0)
	  return r+c+c+1+r-x;
	else
	  return 0;
}
inline bool chk(int l,int r)
{
	if(r<l)
	  return 1;
	if(f[x[l].bb]>r)
	  return 0;
	return chk(l+1,f[x[l].bb]-1) && chk(f[x[l].bb]+1,r);
}
int main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int i,j,k;
	scanf("%d%d%d",&r,&c,&n);
	for(i=1;i<=n;i++)
	  {
	   j=get();
	   k=get();
	   if(j && k)
	     {
		  m++;
		  x[2*m-1]=mp(j,m);
		  x[2*m]=mp(k,m);
		 }
	  }
	sort(x+1,x+2*m+1);
	for(i=1;i<=2*m;i++)
	  f[x[i].bb]=i;
	if(chk(1,2*m))
	  printf("YES\n");
	else
	  printf("NO\n");
	return 0;
}


Measured memory_bytes: 3456
#include <iostream>
#include <algorithm>
#include <limits>
#include <vector>
#include <map>
#include <cmath>
#include <limits>
#include <iomanip>
#include <queue>
#include <string.h>
#include <bitset>
#define ll long long int
#define ld long double
#define rep(i,n) for(int i = 0;i < n;i++)
#define rep1(i,n) for(int i = 1;i < n;i++)
#define co(x) cout << x << endl
#define cosp(x) cout << x << " "
#define all(x) x.begin(),x.end()
#define allr(x) x.begin(),x.end(),greater<int>()
#define P pair<ll,ll>
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define INF 1ll << 60
#define PI 3.14159265359

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i,n) cin >> a[i];
	int ans = 0;
	int f = 0;
	int cnt = 1;
	rep(i,n){
		if(a[i] == cnt){
			f = 1;
			cnt++;
		}
		else{
			ans++;
		}
	}
	if(f == 0){
		cout << -1 << endl;
	}
	else{
		cout << ans << endl;
	}
	return 0;
}

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

using namespace std;

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

	if (x >= r && x <= w - r && y >= r && y <= h - r)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;

	return 0;
}



Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define IFOR(i,a,b) for(int i=(b-1);i>=(a);--i)
#define RPT(i,a,b) for(int i=(a);i<((a)+(b));++i)
#define IRPT(i,a,b) for(int i=((a)+(b)-1);i>=(a);--i)
#define BITBOOL(x,a) (((x)>>(a))&1)
int main(){
  int n, k, q; cin >> n >> k >> q;
  vector<int> a(n,k-q);
  RPT(i,0,q) {int b;cin>>b;--b;a[b]++;}
  FOR(i,0,n) {if(a[i]>0) cout << "Yes"; else cout << "No"; cout << endl;}
}

Measured memory_bytes: 1024
from collections import defaultdict

h,w,m = map(int,input().split())

bombw = [0]*w
bombh = [0]*h
dd = defaultdict(bool)
# print(bomb)
for i in range(m):
    hi,wi = map(int,input().split())
    bombw[wi-1] += 1
    bombh[hi-1] += 1
    dd[str(hi-1)+"-"+str(wi-1)] = True
    # print(bomb)
maw = max(bombw)
mah = max(bombh)
# print(maw,mah)
inmaw = [i for i, x in enumerate(bombw) if x == maw]
inmah = [i for i, x in enumerate(bombh) if x == mah]
# print(inmaw,inmah)

ans = maw + mah
# print(bomb)
# print(ans)
for i in inmah:
    for j in inmaw:
        if not dd[str(i)+"-"+str(j)]:
            print(ans)
            exit()
print(ans-1)

Measured memory_bytes: 213312
def getInput():
    return [int(i) for i in input().rstrip().split(' ')]


def sumNum(num, sums):
    if num == 0:
        return sums
    sums += num % 10
    num = num // 10
    return sumNum(num, sums)

N, A, B = getInput()

ret = []
for i in range(1, N + 1):
    sums = sumNum(i, 0)    

    if sums < A or sums > B:
        continue
    else:
        ret.append(i)

print(sum(ret))

Measured memory_bytes: 3420
list=input().split(" ")
n=int(list[0])
m=int(list[1])

list=input().split(" ")
card=[]
for i in range(n):
    card.append(int(list[i]))

magic=[]
for j in range(m):
    list=input().split(" ")
    x=int(list[0])
    y=int(list[1])
    magic.append([y,x])

card=sorted(card)
#print(card)
magic=sorted(magic, reverse=True)
#print(magic)
switch=1
nowpos=0
count=0
kosu=magic[0][1]

while switch==1:
    #print(card[count])
    #print(magic[nowpos][0])
    if card[count]<magic[nowpos][0]:
        card[count]=magic[nowpos][0]
    else:
        switch=0
    count+=1
    if magic[nowpos][1]>1:
        magic[nowpos][1]-=1
    else:
        nowpos+=1
        if nowpos==m:
            switch=0
    if count==n:
        switch=0

#print(card)
print(sum(card))

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

int main()
{
	int H, A, B;
	int cnt = 0;

	cin >> H >> A >> B;

	for ( int i = A; i <= B; i++ ) {
		cnt += H % i == 0;
	}

	cout << cnt << endl;

	return ( 0 );
}


Measured memory_bytes: 3116
from collections import Counter
def main():
    N = int(input())
    d = Counter()
    for _ in range(N):
        t = ''.join(sorted(input()))
        d[t] += 1
    r = 0
    for v in d.values():
        if v == 1:
            pass
        r += v * (v - 1) // 2
    return r

print(main())




Measured memory_bytes: 18236
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		StringBuilder sb = new StringBuilder();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		long sum = 0, odd = 0;
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
			sum += a[i];
			if (i % 2 != 0) {
				odd += a[i];
			}
		}
		long[] x = new long[n];
		x[0] = sum - 2 * odd;
		sb.append(x[0]);
		for (int i = 1; i < n; i++) {
			x[i] = 2 * a[i - 1] - x[i - 1];
			sb.append(" " + x[i]);
		}
		System.out.println(sb);
	}
}

Measured memory_bytes: 63148
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pint pair<int, int>
#define pll pair<ll, ll>
#define vint vector<int >
#define vll vector<ll >
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i,n) for (int i = 0; i < (n); ++i)
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main(){
    int n,m,p;
    cin >> n >> m;
    string s;
    vector <vector<int> > mon(n, vector<int>(3));
    // mon[][0]:"num of AC"
    // mon[][1]:"num of WA"
    // mon[][2]:"flag"

    REP(i,n){
        mon[i][0] = 0;
        mon[i][1] = 0;
        mon[i][2] = 0;
    }
    
    REP(i,m){
        cin >> p >> s;
        if(mon[p-1][2]==0 && s=="AC"){
            mon[p-1][0]=1;
            mon[p-1][2]=1;
        }else if(mon[p-1][2]==0 && s=="WA"){
            mon[p-1][1]++;
        }
    }

    ll ans_ac=0, ans_wa=0;

    REP(i,n){
        ans_ac += mon[i][0];
        if(mon[i][2]==1){
            ans_wa += mon[i][1];
        }
    }

    cout << ans_ac << " " << ans_wa << endl;
    return 0;
}

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

int main(){
    int N,p[100];
    cin>>N;
    for(int i=0;i<N;i++){
        cin>>p[i];
    }
    int MAX=0;
    for(int i=1;i<=N;i++){
        int cnt=0;
        for(int j=0;j<N;j++){
            if(i<=p[j]) cnt++;
        }
        if(cnt>=i) MAX=i;
    }
    cout<<MAX<<endl;

    return 0;
}


Measured memory_bytes: 3100
#include <bits/stdc++.h>
using ll=long long;
using namespace std;
#define rep_i(i, n) for (int i = 0; i < (n); ++i)
#define rep_ll(i, n) for (long long i = 0; i < (n); ++i)
#define r_rep_i(i, start, end) for (int i = (start); i < (end); ++i)
#define r_rep_ll(i, start, end) for (long long i = (start); i < (end); ++i)
#define debug_vi(v) copy((v).begin(), (v).end(), ostream_iterator<int>(cout, " "));
#define debug_vll(v) copy((v).begin(), (v).end(), ostream_iterator<long long>(cout, " "));
#define debug_vd(v) copy((v).begin(), (v).end(), ostream_iterator<double>(cout, " "));
#define sort_v(v) sort((v).begin(), (v).end()); //昇順
#define d_sort_vi(v) sort((v).begin(), (v).end(), greater<int>()); //降
#define d_sort_vll(v) sort((v).begin(), (v).end(), greater<long long>()); //降
#define d_sort_vd(v) sort((v).begin(), (v).end(), greater<double>()); //昇順
#define say(t) cout << (t) << endl;
#define sum_vi(v) accumulate((v).begin(), (v).end(), 0);
#define sum_vll(v)accumulate((v).begin(), (v).end(), 0LL);

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;}
const int IINF=(1<<30);
const ll LLINF = 1LL<<60;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  ll x;cin >> x;
  
  ll ans;
  ans = (x/500)*1000;
  ans += ((x%500)/5)*5;
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<cstdint>
#include<cstring>
#include<iostream>
#include<vector>
#include<memory>
#include<algorithm>
#include<utility>

using namespace std;


int64_t A[200];
int64_t N;

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

	int64_t test = 0;
	for (int i = 0; i < N; ++i) {
		test |= A[i];
	}

	int ans = 0;
	while ((test &1) == 0) {
		test /= 2;
		++ans;
	}

	cout << ans << endl;

    return 0; 
}



Measured memory_bytes: 256
p=1
while p==1:
    a,b=map(int,input().split())
    if a==0 and b==0:
        break
    else:
        c="#"*b
        print(c)
        for i in range(a-2):
            d="."*(b-2)
            print("#"+d+"#")
        print(c)    
    print()        


Measured memory_bytes: 5612
#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define RFOR(i,a,b) for(int i=a;i>=b;i--)
#define inf 0x3f3f3f3f
using namespace std;

const int maxn = 2e5+5;
typedef unsigned long long ULL;
typedef long long ll;

int n,m,A[maxn];
vector<int>G[maxn];

int main(){
    cin>>n>>m;
    FOR(i,1,n)scanf("%d",&A[i]);
    FOR(i,1,m){
        int u,v;scanf("%d%d",&u,&v);
        G[u].push_back(v);
        G[v].push_back(u);
    }
    int ans=0;
    FOR(i,1,n){
        bool ok=true;
        for(auto v:G[i]){
            if(A[v]>=A[i])ok=false;
        }
        if(ok)ans++;
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 11640
#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <queue>
#include <bitset>
#include <map>
#include <math.h>
#include <utility>

using namespace std;

const double PI = acos(-1);

int main(){

    int N, M, X;
    cin >> N >> M >> X;

    vector<int> C(N);
    vector<vector<int>> A(N, vector<int>(M)); // N*M 行列

    for (int i = 0; i < N; i++){
        cin >> C[i];
        for (int j = 0; j < M; j++){
            cin >> A[i][j];
        }
    }

    int money_min = 10000000;
    bool possibility = false;

    for (int bit = 0; bit < (1<<N); bit++){ // (1<<N)は 0b00...01を左へNbit移動. つまり2^N回のループ

        vector<int> score(M, 0);
        int money = 0;
        bool clear = true;

        vector<int> S;
        for (int i = 0; i < N; i++){
            if (bit & (1<<i)){
                S.emplace_back(i); // bit 内で1が含まれる桁を保存 0-indexed
            }
        }

        for (int i = 0; i < (int)S.size(); i++){
            for (int j = 0; j < M; j++){
                score[j] += A[S[i]][j];
            }
            money += C[S[i]];
        }

        // X の条件を満たすか 判定
        for (int j = 0; j < M; j++){
            if (score[j] < X){
                clear = false;
            }
        }

        if (clear) {
            money_min = min(money_min, money);
            possibility = true;
        }

        // cout << bit << ":" << clear << ":" << money << endl;
        // cout << "score:" ;
        // for (int j = 0; j < M; j++){
        //     cout << score[j] << " ";
        // }
        // cout << endl;
    }

    if (!possibility) {
        cout << -1 <<endl;
    } else {
        cout << money_min << endl;
    }


    return 0;
}


Measured memory_bytes: 3192
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main{

	Scanner sc=new Scanner(System.in);

	int INF=1<<28;
	double EPS=1e-9;

	void run(){
		int a=sc.nextInt()+sc.nextInt()+sc.nextInt()+sc.nextInt();
		int b=sc.nextInt()+sc.nextInt()+sc.nextInt()+sc.nextInt();
		println(max(a, b)+"");
	}

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

	void print(String s){
		System.out.print(s);
	}

	void println(String s){
		System.out.println(s);
	}

	public static void main(String[] args){
		// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		new Main().run();
	}
}

Measured memory_bytes: 12000
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
//ll mod = 998244353;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main() {
    int n, m;
    cin >> n >> m;
    vector<int> x(m);
    rep(i, m) cin >> x[i];
    if (m == 1 || n >= m) {
        cout << 0 << endl;
        return 0;
    }
    sort(x.begin(), x.end());
    vector<int> diff(m-1);
    rep(i, m-1) {
        diff[i] = x[i+1] - x[i];
    }
    sort(diff.rbegin(), diff.rend());
    int ans = 0;
    rep(i, m-1) {
        ans += diff[i];
    }
    rep(i, n-1) {
        ans -= diff[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3976
#include <bits/stdc++.h>
using namespace std;
const int maxn=2005;

int main(){
    string s;
    cin>>s;
    int n=s.size();
    if(n!=6)
        cout<<"No"<<endl;
    else if(s[2]==s[3]&&s[4]==s[5])
        cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

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

using namespace std;

#define DBG cerr << '!' << endl;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)
#define INF 1000000000
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;
set<string> s;
ll ans;
ll dp[222222][3][4][4];

void zentan(string str){
	ans++;
	//cout << str << endl;
	s.insert(str);
	REP(i,str.size()-1){
		if(str[i] != str[i+1]){
			string tmp = str;
			REP(j,3){
				if(str[i] != (char)('a'+j) && str[i+1] != (char)('a'+j)){
					tmp[i] = (char)('a'+j);
					tmp[i+1] = (char)('a'+j);
					if(s.find(tmp) == s.end()){
						zentan(tmp);
					}
				}
			}
		}
	}
}
			

int main()
{
	string str;cin >> str;
	if(str.size() < 5){
		zentan(str);
		cout << ans << endl;
		return 0;
	}
	dp[1][0][0][0] = 1;
	dp[1][0][1][1] = 1;
	dp[1][0][2][2] = 1;
	ll difff = 0;
	ll md = 0;
	REP(i,str.size()){
		REP(j,3){
			REP(k,3){
				REP(l,3){
					if(j == k)dp[i+1][1][k][(k+l)%3] = (dp[i+1][1][k][(k+l)%3] + dp[i][0][j][l]) % MOD;
					else dp[i+1][0][k][(k+l)%3] = (dp[i+1][0][k][(k+l)%3] + dp[i][0][j][l]) % MOD;
					dp[i+1][1][k][(k+l)%3] = (dp[i+1][1][k][(k+l)%3] + dp[i][1][j][l]) % MOD;
				}
			}	
		}
		if(i != str.size() - 1 && str[i] != str[i+1])difff++;
		md = (md + (str[i] - 'a')) % 3;
	}
	REP(i,3)ans = (dp[str.size()][1][i][md] + ans) % MOD;
	if(difff == str.size()-1)ans = (ans + 1) % MOD;
	if(difff == 0)ans = 1;
			
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 76292
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <functional>
#include <iostream>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <stack>
#include <string>
#include <vector>
#include <iomanip>
 
using namespace std;
typedef long long ll;
using gra = vector<vector<ll>>;
using gram = vector<unordered_map<ll,ll>>;
 
typedef unsigned long long ull;
 
template <class T> inline bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
template <class T> inline bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
 
template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <class T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template <class T> T dup(T a, T b) { return (a + b - 1) / b; }
template <class T> T modpow(T x, T p, T m) { T a=1; while(p){ if(p%2)a =a*x%m; x = x+x%m; p/=2; } return a; }
// template <class T> void prim(T a) { for(ll i=0;i<a.size();++i) { cout << a[i]; } cout << "\n"; }
//template< typename T >
//T mod_pow(T x, T n, const T &p) {
//  T ret = 1;
//  while(n > 0) {
//    if(n & 1) (ret *= x) %= p;
//    (x *= x) %= p;
//    n >>= 1;
//  }
//  return ret;
//}
 
#define mod 1000000007LL
#define INF 10000000000000000LL
 
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep1(i, n) for (ll i = 1; i <= n; ++i)
#define rrep(i, n) for (int i = (n - 1); i >= 0; --i)
#define rrep1(i, n) for (int i = n; i > 0; --i)
 
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
//#define modpow(x, p, m) { ll a=1; while(p){ if(p%2)a =a*x%m; x = x+x%m; p/=2; } return a; }
 
#define m0(h) memset(h, 0, sizeof(h))
#define m1(h) memset(h, 1, sizeof(h))
#define m(h, n) memset(h, (n), sizeof(h))
#define all(n) (n).begin(),(n).end()
#define bit(n) (1LL << (n))
#define pb push_back
#define mp make_pair
 
//#ifdef LOCAL
//
//#define dpri(...) fprintf(stderr, __VA_ARGS__)
//#define pria(g) rep(i,g.size()){ cout << i << "{"; rep(j,g[i].size()) cout << g[i][j] << " "; cout << "}" << "\n"; }
//#else
//#define dpri(...) 42
//#define pria(g) 42
//#endif
//
//
//
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  // ---------------------
  // コーディング開始
  // ---------------------
  ll n,x;
  cin >> n;
  vector<ll> ls;
  rep(i,n){
    cin >> x;
    ls.pb(x);
  }
  ll ans=INF;
  ll lp;
  rep1(i,100){
    lp=0;
    rep(j,n){
      lp += (ls[j]-i)*(ls[j]-i);
    }
    chmin(ans,lp);
  }
  pri(ans);
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define all(c) c.begin(),c.end()
#define init(c) memset(c,0,sizeof c)
typedef long long ll;
const int N=20000005;
int n,k,x,t,a,b;
string s;
vector<int>v;
int main(){

	cin >> n>>a>>b;
	int dist[10005];
	init(dist);
	int shrt= b-a-1;
	for(int i =1;i<=n;i++){
		for(int j=i+1;j<=n;j++){

			dist[min(j-i,abs(i-a)+1+abs(b-j))]++;
		
		}
	}
	for(int i =1;i<=n-1;i++){
		cout << dist[i]<<endl;
	}
	return 0;
}

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

#define COUNTOF(array) (sizeof(array) / sizeof(array[0]))    
#define OUT(P) cout << (P) << endl    
#define OUT2(P1, P2) cout << (P1) << " " << (P2) << endl    
#define PRINT_ARRAY(P) for(int i=0; i<P.size(); i++) cout << P[i] << endl;    
#define PRINT_ARRAY_INLINE(P) do { for(int i=0; i<P.size(); i++) cout << P[i] << " "; cout << endl; } while(0)    
#define PRINT_ARRAY_WITH_LABEL(L, P) do { cout << L << ": "; PRINT_ARRAY_INLINE(P); cout << endl; } while(0)    
typedef long long ll;    
const long DIVIDE = 1e9+7;

int sum_digits(int num);    
template <class T>    
vector<T> copy_vector(vector<T> vec);    
long gcd(long a, long b);    
long lcm(long a, long b);
vector<vector<long>> comb(long n, long r);
// ****** print functions ****** //
template <class T, class U>
void print_pairs(const vector<pair<T, U>> pairs);
template <class K, class V>
void print_map(const map<K, V> m);


int main() {    
    int n, a, b;
    cin >> n >> a >> b;
    int train = n * a;
    
    cout << min(train, b) << endl;
    return 0;    
}    

/******************************/    
/***** DECRARED FUNCTIONS *****/    
/******************************/    

int sum_digits(int num) {    
    int rtn = 0;    
    while(num != 0) {    
        int tmp = num % 10;    
        rtn += tmp;    
        num /= 10;    
    }    
    return rtn;    
}    

// vectorのコピー    
template <class T>    
vector<T> copy_vector(vector<T> vec) {    
    vector<T> rtn;    
    rtn.reserve(vec.size());    
    copy(vec.begin(), vec.end(), back_inserter(rtn));    
    return rtn;    
}    

long gcd(long a, long b) {    
    if(b==0) return a;    
    else return gcd(b, a % b);    
}

long lcm(long a, long b) {
    long gcd_ = gcd(a, b);
    return (a * b) / gcd_;
}

vector<vector<long>> comb(long n, long r) {                                                                             
    vector<vector<long>> v(n+1, vector<long>(n+1, 0));    
    for(int i=0; i<v.size(); i++) {    
        v[i][0] = 1;    
        v[i][i] = 1;    
    }    
    for(int i=1; i<v.size(); i++) {    
        for(int j=1; j < i; j++) {    
            v[i][j] = (v[i-1][j-1] + v[i-1][j]) % DIVIDE;    
        }    
    }    
    return v;    
} 

template <class T, class U>
void print_pairs(const vector<pair<T, U>> &pairs) {
    for(int i=0; i<pairs.size(); i++) { 
        cout << "(" << pairs[i].first << ", " << pairs[i].second << ")" << " "; 
    } 
    cout << endl;
}

template <class K, class V>
void print_map(const map<K, V> &m) {
    for(auto it=m.cbegin(); it!=m.cend(); it++) {
        cout << it->first << ": " << it->second << endl;
    }
}


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

  
int main(){
 int n,k;
  cin >> n >> k;
  if(n%k==0)cout << 0 <<endl;
  else cout << 1 << endl;
   
 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long
using namespace std;
ll i,j,k,n,m,a[200007],dp[200007];


int main()
{

    cin>>n>>k;
    for(ll i=1;i<=n;i++)
        cin>>a[i];
    for(i=1;i<=n;i++)
    {
        dp[i] = 1e9;
        for(j=1;j<=k&&i-j>0;j++)
        {
            dp[i] = min(dp[i],dp[i-j]+abs(a[i]-a[i-j]));
        }
        if(i==1) dp[i] = 0;
    }
    cout<<dp[n]<<endl;
    return 0;
}


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

int main() {
	cin.tie(0); cout.tie(0); ios_base::sync_with_stdio(0);
	int n,r; cin>>n>>r;
	int x;
	if (n<10) cout<<r+100*(10-n);
	else cout<<r;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <cmath>
using namespace std;
int main(void)
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        double x1, y1, x2, y2, x3, y3;
        cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
        double a, b, c, A, B, C, s;
        a = sqrt(((x2 - x1) * (x2 - x1)) + ((y2 - y1) * (y2 - y1)));
        b = sqrt(((x3 - x2) * (x3 - x2)) + ((y3 - y2) * (y3 - y2)));
        c = sqrt(((x1 - x3) * (x1 - x3)) + ((y1 - y3) * (y1 - y3)));
        A = a * a;
        B = b * b;
        C = c * c;
        s = (2 * ((A * B) + (B * C) + (C * A))) - ((A * A) + (B * B) + (C * C));
        double px, py, r;
        px = ((x3 * (A * (B + C - A))) / s) + ((x1 * (B * (C + A - B))) / s) + ((x2 * (C * (A + B - C))) / s);
        py = ((y3 * (A * (B + C - A))) / s) + ((y1 * (B * (C + A - B))) / s) + ((y2 * (C * (A + B - C))) / s);
        r = (a * b * c) / sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c));
        printf("%.3f %.3f %.3f\n", px, py, r);
    }
}



Measured memory_bytes: 3212
/*
 * Author: .-O_O-.
 */
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long
#define pb push_back
#define vi vector<int>
#define rep0(a,b) for(int a=0;a<b;a++)
#define rep1(a,b) for(int a=1;a<=b;a++)
#define repp(a,b,c) for(int a=b;a<c;a++)
#define in insert
#define len length()
#define si size()
#define lb lower_bound
#define ub upper_bound
#define beg begin()
#define en end()
#define f first
#define s second
#define pr(a) cout<<a
#define pr2(a,b) cout<<a<<" "<<b<<"\n"
#define nx cout<<"\n"
#define int long long
//void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
													 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]"<<endl;}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define deb(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define deb(x...)
#endif
const ll mod = 1000000007;
const ll maxn = 2005;
const ll mm = 1e+18;
void solve()
{
    string s;
	cin>>s;
	int n=s.len;
	rep0(i,n){
		if(s[i]=='?') s[i]='D';
	}
	pr(s);
}
signed main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
        //nx;
    }
    return 0;
}


Measured memory_bytes: 3744
#include <bits/stdc++.h>
#define pb push_back
#define int long long
#define mp make_pair
#define inf 1000000007
#define LINF 10000000000000007LL
#define ll long long
using namespace std;
ll par[114514];
ll rankk[114514];
void init(int n){
	for(int i=0;i<n;i++){
		par[i] = i;
		rankk[i]=0;
	}
}
ll find(ll x){
	if(par[x] == x){
		return x;
	}else{
		return par[x] = find(par[x]);
	}
}
void unite(ll x, ll y){
	x = find(x);
	y = find(y);
	if(x==y)return;
	if(rankk[x]<rankk[y]){
		par[x]=y;
	}else{
		par[y]=x;
		if(rankk[x]==rankk[y])rankk[x]++;
	}
}
signed main(){
	int n;
	cin>>n;
	vector< pair<int,int> > x,y;
	vector< pair<int, pair<int,int> > > eg;
	for(int i=1;i<=n;i++){
		int tx,ty;
		cin>>tx>>ty;
		x.pb( mp( tx,i) );
		y.pb( mp( ty,i) );
	}
	sort( x.begin() , x.end() );
	sort( y.begin() , y.end() );
	for(int i=0;i<n-1;i++){
		eg.pb( mp ( x[i+1].first-x[i].first, mp( x[i].second, x[i+1].second ) ) );
		eg.pb( mp ( y[i+1].first-y[i].first, mp( y[i].second, y[i+1].second ) ) );
	}
	sort( eg.begin(), eg.end() );
	init(110000);
	int ans = 0;
	for( int i=0;i<eg.size();i++ ){
		int ccos = eg[i].first;
		int d1 = eg[i].second.first;
		int d2 = eg[i].second.second;
		if( find(d1) != find(d2) ){
			ans += ccos;
			unite(d1,d2);
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

namespace ITP1_7
{
    class Program
    {
        static char Check(int m, int f, int r)
        {
            return m < 0 || f < 0 ? 'F' :
                   m + f >= 80 ? 'A' :
                   m + f >= 65 ? 'B' :
                   m + f >= 50 || m + f >= 30 && r >= 50 ? 'C' :
                   m + f >= 30 ? 'D' : 'F';
        }

        static void Main(string[] args)
        {
            while(true)
            {
                string _s = Console.ReadLine().Trim('\n');
                if(_s == "-1 -1 -1") break;
                int[] _i = _s.Split(' ').Select(e => int.Parse(e)).ToArray();
                Console.WriteLine(Check(_i[0], _i[1], _i[2]));
            }
        }
    }
}

Measured memory_bytes: 9236
#include <iostream>
#include <string>
#include <cctype>

int
main
(
  int argc,
  char ** argv
)
{
  std::string input;
  std::cin >> input;

  if (input[0] != 'A' || !std::islower(input[1]) || !std::islower(input[input.length() - 1]))
  {
    std::cout << "WA" << std::endl;
    return 0;
  }

  bool capC { false };
  for
  (
    std::size_t i { 2 };
    i <= input.length() - 2;
    ++i
  )
  {
    if (!capC && input[i] == 'C')
    {
      capC = true;
      continue;
    }
    if (!std::islower(input[i]))
    {
      std::cout << "WA" << std::endl;
      return 0;
    }
  }

  if (capC)
  {
    std::cout << "AC" << std::endl;
  }
  else
  {
    std::cout << "WA" << std::endl;
  }

  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 int ll;
typedef pair<int, int> P;
#define INF 1e9 + 7

//first, secondで昇順ソート
bool compare(P a, P b){
    if(a.first == b.first){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

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

    int n;
    cin >> n;
    int p[n];
    rep(i,n) cin >> p[i];
    
    int count = 0;
    for(int i=1; i<n-1; i++){
        int a[3];
        rep(j,3){
            a[j] = p[j + i - 1];
        }
        sort(a, a+3);
        
        if(p[i] == a[1]) count++;
    }
    
    cout << count << endl;

    return 0;
}

Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <random>
#include <iterator>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(v) reverse((v).begin(),(v).end())
#define ANS(ans) cout<<(ans)<<endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  for (int i = 0; i < (n); ++i)


int main() {
	int r, g, b;
	cin >> r >> g >> b;

	int n = g * 10 + b;
	if (n % 4 == 0) {
		ANS("YES")
	}
	else {
		ANS("NO")
	}

	return 0;
}


Measured memory_bytes: 256
N,W = map(int,input().split())

L = 100001
dp = [float('inf')]*100001
dp[0] = 0

for _ in range(N):
    w,v = map(int,input().split())
    for k in reversed(range(v,L)):
        dp[k] = min(dp[k], dp[k-v]+w)

print(next(v for v,w in zip(reversed(range(L)), reversed(dp)) if w <= W))

Measured memory_bytes: 114892
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>

#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順
//cout << fixed << setprecision(10) << ans << endl;
//int gcd(int a,int b){return b?gcd(b,a%b):a;}

int h[200000];
int ans[200000];

signed main(){
    int n,m;
    cin >> n >> m;
    REP(i,n){
        cin >> h[i]; 
    }
    REP(i,m){
        int a1,b1;
        cin >> a1 >> b1;
        a1 --;
        b1 --;
        if(h[a1] < h[b1]){
            ans[a1] ++;
        }
        else if(h[a1]> h[b1]){
            ans[b1] ++;
        }
        else if(h[a1] ==  h[b1]){
            ans[a1] ++;
            ans[b1] ++;
        }
        

    }


    int ans2 = 0;
    REP(i,n){
        if(ans[i]==0){
            ans2 ++;
        }
    }
    cout << ans2 << endl;
    

    return 0;
}

Measured memory_bytes: 5204