akhauriyash/Code-Regression huggingface dataset:
/*Read the problem carefully before starting to work on it*/
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

//ll ncr(ll n,ll r){ll ans=1;r=min(r,n-r);for (int i=1;i<=r;i++){ans*=(n-r+i);ans/=i;}return ans;}

#define pb push_back
#define eb emplace_back
#define mp(x,y) make_pair(x,y)
#define mod 1000000007

double PI=3.1415926535897932384626;

//template<typename T> T power(T x,T y,ll m=mod){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}

#define bip(n) __builtin_popcount(n)//no of ones bit in binary!!
#define bictz(n) __builtin_ctz(n)//no of trailing zeroes in binary!!
#define biclz(n) __builtin_clz(n)//no of leading zeroes in binary!!
#define bffs(n) __builtin_ffs(n)//index of first one bit!!

typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;

typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ld> vd;
typedef vector<ll> vl;

//#define fi1 ifstream fin("input.txt")
//#define of1 ofstream fout("output.txt")
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;

#define fi first
#define se second

bool cmp(pair<ll,ll>&a,pair<ll,ll>&b)
{
	return a.fi>b.fi;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll n,m;
	cin>>n>>m;
	vector<ll>A(n+1);
	vector< pair<ll,ll> >D(m+1);
	for(ll i=1;i<=n;i++)
	{
		cin>>A[i];
	}
	sort(A.begin()+1,A.begin()+1+n);
	for(int i=1;i<=m;i++)
	{
		ll b,c;
		cin>>b>>c;
		D[i]=mp(c,b);
	}
	sort(D.begin()+1,D.begin()+1+m,cmp);
	ll ans=0;
	int po=1;
	for(ll i=1;i<=n;i++)
	{
		if(po>m)
			ans+=A[i];
		else
		{
			if(D[po].se==0)
				po++;
			ans+=max(A[i],D[po].fi);
			if(D[po].fi>A[i])
			    D[po].se--;
			if(D[po].se==0)
				po++;
		}
	}
	cout<<ans;
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
//#include <ext/numeric>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define oo 0x3f3f3f3f
#define OO 0x3f3f3f3f3f3f3f3f
#define popcount(n) __builtin_popcount(n)
#define popcountll(n) __builtin_popcountll(n)

//bool flag = __builtin_add_overflow(a , b , &tmp);
//bool flag = __builtin_mul_overflow(a , b , &tmp);
//bool flag3= __builtin_sub_overflow(a , b , &tmp);

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

const double PI = acos(-1.0), EPS = 1e-12;
const long long inf = 2e12 + 12;
const int MAXN = 250005, MAXM = 102, Mod = 1000000007 , MAXLog = 20;


int main() {
#ifndef ONLINE_JUDGE
//    freopen("input.txt", "rt", stdin);
//    freopen("output.txt", "w", stdout);
#endif
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0), cout.precision(9), cout << fixed;

    int n;
    cin >> n;
    vector<int> arr(n);
    for (int i = 0; i < n; ++i) {
        cin >> arr[i];
    }
    for (int i = 0; i < n; ++i) {
        for (int j = i; j < n; ++j) {
            swap(arr[i], arr[j]);
            bool f = true;
            for (int k = 1; k < n; ++k) {
                if (arr[k] <= arr[k - 1]) {
                    f = false;
                }
            }
            if (f) {
                cout << "YES\n";
                return 0;
            }
            swap(arr[i], arr[j]);
        }
    }

    cout << "NO\n";
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define uint unsigned
#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a));
#define CPY(a,b) memcpy(a,b,sizeof(a));
using namespace std;
const int N=6005;
int A[N],B[N];
char s[N];
string ans;
int n,vis[N];
void work(int x,int y){
	//printf("%d %d\n",x,y);
	string tmp="";
	if (A[x]<B[x]){
		int p=2*x-2;
		for (;;){
			int np=-1;
			For(j,x,y)
				if (p<A[j]&&(np==-1||B[j]<B[np])) np=j;
			if (np==-1) break;
			tmp=tmp+"ab";
			p=B[np];
		}
	}
	else{
		Rep(i,y,x){
			string tmpp="";
			vis[A[i]]=vis[B[i]]=1;
			For(j,2*x-1,2*y) if (vis[j]) tmpp.PB(s[j]);
			if (tmpp>tmp) tmp=tmpp;
			//cout<<tmp<<' '<<tmpp<<endl;
		}
	}
	//cout<<tmp<<endl;
	if (tmp+ans>ans)
		ans=tmp+ans;
}
int main(){
	scanf("%d%s",&n,s+1);
	For(i,1,2*n)
		if (s[i]=='a')
			A[++*A]=i;
		else B[++*B]=i;
	int p=2*n,S=0;
	Rep(i,2*n,1){
		S+=(s[i]=='a'?1:-1);
		if (!S) work((i+1)/2,p/2),p=i;
	}
	cout<<ans;
}

Measured memory_bytes: 384
#!/usr/bin/env python3
from collections import deque, Counter
from heapq import heappop, heappush
from bisect import bisect_right

def main():
    N = int(input())
    D = list(map(int, input().split()))
    p = 998244353
    if D[0] > 0:
        exit(print(0))
    l = Counter(D)
    if l[0] > 1:
        exit(print(0))
    ans = 1
    for i in range(1,max(l)+1):
        if l[i] == 0:
            exit(print(0))
        ans *= pow(l[i-1],l[i],p)
        ans %= p
    print(ans)

if __name__ == "__main__":
    main()


Measured memory_bytes: 19936
#include <iostream>
#include <algorithm>
using namespace std;
int main()
{
    int N;
    cin >> N;
    int V[100] = {};
    
    for(int i=0;i<N;i++){
        cin >> V[i];
    }
    
     int C[100] = {};
    int i = 0;
    for(i=0;i<=N;i++){
        cin >> C[i];
    }
    
    int cp[50];
    
    for(int i=0;i<=N;i++){
        cp[i] = V[i] - C[i];
        
    }
    
    int ans = 0;
    for(int i=0;i<=N;i++){
        if(cp[i]>=0){
            ans = ans+cp[i];
        }
    }
        cout << ans << endl;
           return 0;
}


Measured memory_bytes: 256
from math import ceil
n, h = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
a, b =[], []
for A, B in ab:
    a.append(A)
    b.append(B)
a=sorted(a,reverse=True)
b=sorted(b,reverse=True)
ans = 0
c = 0
i = 0
while c < h:
    if i == n:
        break
    ans += 1
    if a[0] < b[i]:
        c += b[i]
    else:
        c += a[0]
        break
    i += 1
if c < h:
    ans += ceil((h - c)/ a[0]) 
print(ans)

Measured memory_bytes: 30116
#include<iostream>
#include<cstdio>
#include<string>
using namespace std;

int main()
{
	int r,c,rc[202][202],rsum[101][101],csum[101],rcsum;
	
	rcsum=0;
	
	for(int i=0;i<101;i++)
	{
		for(int j=0;j<101;j++)
		{
			rsum[i][j]=0;
		}
	}
	
	for(int i=0;i<c;i++)
	{
		csum[i]=0;
	
	}
	
	cin >> r >> c;
	
	for(int i=0;i<r;i++)
	{
		for(int j=0;j<c;j++)
		{
			cin >> rc[i][j];
		}
	}
	
	for(int i=0;i<r;i++)
	{
		for(int j=0;j<c;j++)
		{
			rsum[i][c+1]+=rc[i][j];
			rcsum+=rc[i][j];
		}
	}
	
	for(int i=0;i<c;i++)
	{
		for(int j=0;j<r;j++)
		{
			csum[i]+=rc[j][i];


		}
		
	}
	
	for(int i=0;i<r;i++)
	{
		for(int j=0;j<c;j++)
		{
			cout << rc[i][j] << " ";
		}
			cout << rsum[i][c+1];
		cout << "\n";
		
	}
	

	
		for(int i=0;i<c;i++)
		{
			cout << csum[i] << " ";
		}	
	cout << rcsum << "\n";
	
return 0;
}

Measured memory_bytes: 3196
#pragma region Macros
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define REP2(i, n) for (int i = 0, i##_len = (int)(n); i < i##_len; ++i)
#define REP3(i, l, r) for (int i = (l), i##_len = (int)(r); i < i##_len; ++i)
#define GET_MACRO_REP(_1, _2, _3, NAME, ...) NAME
#define REP(...) GET_MACRO_REP(__VA_ARGS__, REP3, REP2) (__VA_ARGS__)
#define RREP2(i, n) for (int i = (n - 1); i >= 0; --i)
#define RREP3(i, l, r) for (int i = (r - 1), i##_len = (l); i >= i##_len; --i)
#define GET_MACRO_RREP(_1, _2, _3, NAME, ...) NAME
#define RREP(...) GET_MACRO_REP(__VA_ARGS__, RREP3, RREP2) (__VA_ARGS__)
#define IN(type, n) type n; cin >> n
#define INALL(type, v) REP(i, v.size()) { IN(type, _tmp); v.at(i) = _tmp; }
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())

#ifdef _DEBUG
#define DEBUG(x) cout << #x << ": " << x << endl
#else
#define DEBUG(x)
#endif

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; }
#pragma endregion

int main() {
  IN(int, N);
  REP(i, 1, 10) {
    if ((N % i) == 0) {
      if ((N / i) <= 9) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 3608
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;

ll BASE_NUM = 1000000007;
ll factor(ll a, ll b)
{
  return a * a * a * a + b * a * a * a + b * b * a * a + b * b * b * a + b * b * b * b;
}

ll solve(ll X, ll diff)
{
  ll min_a = (diff + 1) / 2;
  ll min_b = -diff / 2;
  while (factor(min_a,min_b) < X / diff)
  {
    min_a++;
    min_b++;
  }
  return min_b;
}
int main()
{
  // 整数の入力
  ll X;
  cin >> X;
  vector<ll> factors;
  for (int i = 1; i * i <= X; i++)
  {
    if (X % i == 0)
    {
      factors.push_back(i);
      factors.push_back(X / i);
    }
  }
  ll A = 0;
  ll B = 0;
  for (auto diff : factors)
  {
    ll min_upper_b = solve(X, diff);
    if (factor(min_upper_b + diff,min_upper_b) == X / diff)
    {
      A = min_upper_b + diff;
      B = min_upper_b;
    }
  }
  cout << A << " " << B << endl;
  return 0;
}

Measured memory_bytes: 3624
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>

using namespace std;

int main(){
  int N, M;
  cin >> N >> M;
  
  int ans;
  ans = N*(N-1)/2 + M*(M-1)/2;
  
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <float.h>
#include <stdio.h>
#include <math.h>
#define REP(i,n) for (int i = 0; i < n; i++)
using namespace std;

int main() {
    int W, H, R[1000][1000], count = 0;
    while (true) { 
        cin >> H >> W;
        if (H == 0 && W == 0) break;
        R[count][0] = W;
        R[count][1] = H;
        count++;
    }
    
    REP(i,count) {
        for (int j = 0; j < R[i][1]; j++) {
            for ( int k = 0; k < R[i][0]; k++) {
                if (j == 0 || k == 0 || j == R[i][1] - 1|| k == R[i][0] - 1) cout << '#';
                else cout << '.';
            }
            cout <<endl;
        }
        cout << endl;
    }
}


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

typedef long long ll;

#define REP(i, N) for (int i = 0; i < (int)(N); i++)

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

int main() {
    ll X,K,D;
    cin >> X >> K >> D;
    
    ll ans = 0;
    
    if ( X < 0 ) X *= -1;
    
    if ( X / K  >=  D ) {
        ans = X - K * D;
    } else {
        ll quo = X / D, rem = X % D;
        ll time = K - quo;
        if ( time % 2 == 0 ) {
            ans = rem;
        } else {
            ans = D - rem;
        }
    }
    
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 3596
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.math.*;

public class Main {

    private static Scanner sc;

    public static void main(final String[] args) {
        final Main instance = new Main();
        sc = instance.new Scanner();
        instance.solve();
    }

    private class Scanner {
        String[] s;
        int i;
        BufferedReader br;
        String regex = " ";

        public Scanner() {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        @Override
        protected void finalize() throws Throwable {
            try {
                super.finalize();
            } finally {
                destruction();
            }
        }

        private void destruction() throws IOException {
            if (br != null)
                br.close();
        }

        public String next() throws IOException {
            if (i < s.length)
                return s[i++];
            String st = br.readLine();
            while (st == "")
                st = br.readLine();
            s = st.split(regex, 0);
            i = 0;
            return s[i++];
        }

        public int nextInt() throws NumberFormatException, IOException {
            return Integer.parseInt(next());
        }

        public Long nextLong() throws NumberFormatException, IOException {
            return Long.parseLong(next());
        }

        public Double nextDouble() throws NumberFormatException, IOException {
            return Double.parseDouble(next());
        }
    }

    private void solve() {
        try {
            int n = sc.nextInt();
            long[] a = new long[n];
            for (int i = 0; i < n; i++) {
                    a[i]=sc.nextLong();
                if (a[i] == 0) {
                    System.out.println(0);
                    return;
                }
            }
            long ans = 1;
            for (int i = 0; i < n; i++) {
                if (ans > (long)1e18 / a[i]) {
                    System.out.println(-1);
                    return;
                }
                ans *= a[i];
                if (ans > (long)1e18) {
                    System.out.println(-1);
                    return;
                }
            }
            System.out.println(ans);

        } catch (Exception e) {
            e.printStackTrace();
        }
    }

}


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

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n, k, x;
  cin>>n>>k;
  double d=1, sum=0;
  
  for(int i=1; i<n+1; i++){
    d = 1;
    x = i;
    while(x<k){
      d*=0.5;
      x*=2;
    }
    sum+=d;
  }
  double ans = sum/n;
  printf("%.10lf",ans);
}

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

using namespace std;
typedef long long ll;
const int MAXN = 400100;
const int P = (1 << 19);
const int MAXP = 2 * P + 100;
const ll MOD = 998244353;

int N;
ll pow2[MAXN];
pair <int, int> p[MAXN];
int xv[MAXN], yv[MAXN];

int seg[MAXP];

void cadd (int x)
{
    x += P;
    while (x >= 1)
    {
        seg[x]++;
        x /= 2;
    }
}

int csum (int x)
{
    int ans = 0;
    x += P;
    while (x > 1)
    {
        if (x % 2 == 1)
            ans += seg[x-1];
        x /= 2;
    }
    return ans;
}

int main()
{
    ios_base::sync_with_stdio(0);

    pow2[0] = 1;
    for (int i = 1; i < MAXN; i++)
        pow2[i] = (2 * pow2[i-1]) % MOD;
    
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        cin >> p[i].first >> p[i].second;
        xv[i] = p[i].first;
        yv[i] = p[i].second;
    }
    sort (xv, xv + N);
    sort (yv, yv + N);

    for (int i = 0; i < N; i++)
    {
        p[i].first = lower_bound (xv, xv + N, p[i].first) - xv;
        p[i].second = lower_bound (yv, yv + N, p[i].second) - yv;
    }

    sort (p, p + N);

    ll ans = 0;
    for (int i = 0; i < N; i++)
    {
        int cc = csum (p[i].second);
        int cd = (p[i].first - cc);
        int dc = (p[i].second - cc);
        int dd = (N - 1) - (cc + cd + dc);

        cadd (p[i].second);

        ans += pow2[N] - pow2[cc + cd] - pow2[cc + dc] - pow2[cd + dd] - pow2[dc + dd] 
               + pow2[cc] + pow2[cd] + pow2[dc] + pow2[dd] - 1;
        ans %= MOD;
    }
    ans = (ans % MOD + MOD) % MOD;
    cout << ans << "\n";
}

Measured memory_bytes: 12544
#include "bits/stdc++.h"
using namespace std;
#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define PI 3.1415926535
typedef long long ll;
typedef pair<int, int> Pi;
typedef pair<ll, ll> Pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<Pll> vPll;
typedef vector<vector<int>> vvi;
typedef vector<vector<bool>> vvb;
typedef vector<vector<ll>> vvll;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
typedef vector<vector<double>> vvd;
typedef vector<vector<Pi>> vvPi;
typedef priority_queue<int, vector<int>, greater<int>> pqli;
typedef priority_queue<ll, vector<ll>, greater<ll>> pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi>> pqlP;
string YN(bool y) { return (y?"YES":"NO"); }
string yn(bool y) { return (y?"Yes":"No"); }
string ON(bool y) { return (y?"OK":"NG"); }
int main(void)
{
	int n, ans2=0;

	cin>>n;

	vi a(n);

	vvi b(29, vi(n));

	rep(i, n) cin>>a[i];

	rep(i, n){
		int tempb;
		cin>>tempb;
		rep(j, 29) b[j][i]=tempb%(2<<j);
	}

	vi::iterator r1, r2, r3, r4;
	rep(j, 29){
		sort(all(b[j]));
		int ans=0;
		rep(i, n){
			int tempa=a[i]%(2<<j);
			r1=lower_bound(all(b[j]), (1<<j)-tempa);
			r2=upper_bound(all(b[j]), (2<<j)-tempa-1);
			r3=lower_bound(all(b[j]), (3<<j)-tempa);
			r4=upper_bound(all(b[j]), (4<<j)-tempa-1);
			ans+=(int)(r2-r1)+(int)(r4-r3);
		}
		if(ans%2) ans2+=(1<<j);
	}
	cout<<ans2<<endl;
}

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

#define M 1000000007
#define pb emplace_back
#define f first
#define s second
#define rep(i, st, ed) for(ll i=st; i<ed; ++i)
#define repn(i, st, ed) for(ll i=st; i<=ed; ++i)
#define repb(i, ed, st) for(ll i=ed; i>=st; --i)
#define all(v) v.begin(),v.end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define PI acosl(-1.0)

typedef long long ll;
typedef unsigned long long int llt;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ll> vec;
typedef vector<pll> vecp;
typedef map<ll, ll> mpll;


const int N = 1e5 + 10;
const ll INF = 1LL << 60;

template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}

template <typename A, typename B>
string to_string(pair<A, B> p);
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
 
string to_string(const string& s) {
  return '"' + s + '"';
}
 
string to_string(const char* s) {
  return to_string((string) s);
}
 
string to_string(bool b) {
  return (b ? "true" : "false");
}
 
string to_string(vector<bool> v) {
  bool first = true;
  string res = "{";
  for (int i = 0; i < static_cast<int>(v.size()); i++) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(v[i]);
  }
  res += "}";
  return res;
}
 
template <size_t N>
string to_string(bitset<N> v) {
  string res = "";
  for (size_t i = 0; i < N; i++) {
    res += static_cast<char>('0' + v[i]);
  }
  return res;
}
 
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
 
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
 
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}
 
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
  return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
 
void debug_out() { cerr << endl; }
 
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << to_string(H) << endl;
  debug_out(T...);
}
#define LOCAL 3
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:" << endl, debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif


void solve()
{
	ll r;
	cin>>r;
	cout<<r*r<<endl;
}


int main()
{
	ll Tests = 1;
    //cin>>Tests;
    while(Tests--)
    {
    	solve();
    }
    return 0;
}

Measured memory_bytes: 256
macro_rules! get {
      ($t:ty) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.trim().parse::<$t>().unwrap()
          }
      };
      ($($t:ty),*) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              let mut iter = line.split_whitespace();
              (
                  $(iter.next().unwrap().parse::<$t>().unwrap(),)*
              )
          }
      };
      ($t:ty; $n:expr) => {
          (0..$n).map(|_|
              get!($t)
          ).collect::<Vec<_>>()
      };
      ($($t:ty),*; $n:expr) => {
          (0..$n).map(|_|
              get!($($t),*)
          ).collect::<Vec<_>>()
      };
      ($t:ty ;;) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.split_whitespace()
                  .map(|t| t.parse::<$t>().unwrap())
                  .collect::<Vec<_>>()
          }
      };
      ($t:ty ;; $n:expr) => {
          (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
      };
}

fn main() {
    // 入力
    let N = get!(i64);

    let mut ans = "No";

    for i in 0..100 {
        if N >= 4 * i && (N - 4 * i) % 7 == 0 {
            ans = "Yes";
        }
    }

    // 出力
    println!("{}", ans);
}

Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define max(a,b) a>b? a:b
using namespace std;

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

    int n,maxm=0,smaxm=0,mi,si;
    cin>>n;
    int a[n+1];
    int i=0;
    while(i<n)
    {
        cin>>a[i];
        if(maxm<a[i])
        {
            maxm=a[i];
            mi=i;
        }
        i++;
    }
    a[mi]=-1;
    i=0;
     while(i<n)
    {
        if(smaxm<a[i])
        {
            smaxm=a[i];
            si=i;
        }
        i++;
    }
    a[mi]=maxm;
    i=0;
     while(i<n)
    {
        if(i==mi)
            cout<<smaxm<<endl;
        else
            cout<<maxm<<endl;

        i++;
    }



return 0;
}


Measured memory_bytes: 2432
x,y,xx,yy=map(int,input().split())
x=xx-x
y=yy-y
print(("R"*x)+("U"*y)+("L"*x)+("D"*(y+1))+("R"*(x+1))+("U"*(y+1))+"LU"+("L"*(x+1))+("D"*(y+1))+"R")

Measured memory_bytes: 3060
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define ll long long
#define imfor(i, n) for(int i = 0; i < n; i++)
using namespace std;
ll MOD = 1000000007;

int main() {
    int k, s;
    cin >> k >> s;
    int ans = 0;
    imfor(i, k + 1) {
        imfor(j, k + 1) {
            if ((s - i - j) >= 0 && (s - i - j) <= k) {
                ans++;
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>

using namespace std;


int main(){
  int a, b, k;
  int count = 0;
  cin >> a >> b >> k;

  for(int i = min(a, b); i > 0; --i){
    if(a % i == 0 && b % i == 0){
      count++;
      if(count == k){
        cout << i << endl;
      }
    }
  }
}


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

int main()
{
	int a[3];
	vector<int>vect;
	cin >> a[0]>>a[1]>>a[2];
	for (int i = 0; i < 3; i++) {
		if(a[i]<1 || a[i]>10000)return 0;
	}
	for (int i = 0; i < 3; i++ )vect.push_back(a[i]);
	sort(vect.begin(), vect.end());
	for (int i = 0; i < 2; i++)cout << vect[i] << " "; 
	cout << vect[2] << endl;
	return 0;

}

Measured memory_bytes: 3116
#include<bits/stdc++.h>
#include<string>
using namespace std;
#define ll long long
typedef pair<ll , ll > pii;
ll mod=998244353;
ll p=1e9+7;

int  main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll x; cin>>x;
    for(ll  i=-1000; i<=1000; i++){
        ll  y=x+i*i*i*i*i;
        ll  j=i+1;
        bool found=false;
        for( ; j<=1000; j++){
            if(j*j*j*j*j == y ){
                found=true;
                break;
            }
        }
        if(found){
            cout<<j<<" "<<i<<endl;
            break;
        }
    }
    
    return 0;
}



Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define INCANT cin.tie(0), cout.tie(0), ios::sync_with_stdio(false), cout << fixed << setprecision(20);
#define int long long
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define _overload(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(...) _overload(__VA_ARGS__, repi, _rep)(__VA_ARGS__)
#define _rev(i, n) revi(i, n, 0)
#define revi(i, a, b) for(int i = (int)(a - 1); i >= (int)(b); i--)
#define rev(...) _overload(__VA_ARGS__, revi, _rev)(__VA_ARGS__)
#define each(i, n) for(auto&& i: n)
void in(){}
template<typename F, typename... R>
bool in(F& f, R&... r){
    if(cin >> f){in(r...);return true;}
    else return false;
}
#define out(x) cout << (x)
#define space() cout << " "
#define indent() cout << '\n'
void print(){}
template<typename F, typename... R>
void print(F f, R... r){out(f), indent(), print(r...);}
#define debughead(x) cerr << "Line " << __LINE__ << ": " << #x << ": "
#define debugout(x) cerr << (x) << " "
#define debugindent() cerr << '\n'
#define debug(x) debughead(x), debugout(x), debugindent()
const int INF = 1e18, MOD = 1e9 + 7;
template<typename T>
bool chmax(T& a, T b){return (a = max(a, b)) == b;}
template<typename T>
bool chmin(T& a, T b){return (a = min(a, b)) == b;}

main(){
    INCANT;
    int n, m, res = 0;
    string s;
    in(n, m);
    int a[m], b[m], c[m];
    int dist[n][n];
    rep(i, n){
        rep(j, n){
            if(i == j){
                dist[i][j] = 0;
            }else{
                dist[i][j] = INF;
            }
        }
    }
    rep(i, m){
        in(a[i], b[i], c[i]);
        a[i]--, b[i]--;
        dist[a[i]][b[i]] = c[i];
        dist[b[i]][a[i]] = c[i];
    }
    rep(i, n){
        rep(j, n){
            rep(k, n){
                chmin(dist[j][k], dist[j][i] + dist[i][k]);
            }
        }
    }
    res = m;
    rep(i, m){
        rep(j, n){
            if(dist[j][a[i]] + c[i] == dist[j][b[i]]){
                res--;
                break;
            }
        }
    }
    print(res);
}


Measured memory_bytes: 384
package main

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

func main() {
	sc := NewScanner()

	s := sc.NextLine()
	for i := 0; i < len(s); i++ {
		fmt.Printf("x") // output for debug
	}
	fmt.Printf("\n")

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			result = append(result, v)
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	result = append(result, v)

	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


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

typedef long long ll;

const int MAXN = 105, MAXV = 100005;
const ll inf = 0x3f3f3f3f3f3f3f3f;

ll dp[MAXV];
ll weight[MAXN];
ll value[MAXN];
int object_count, max_weight;

void solve() {
    for (int v = 1; v < MAXV; ++v) dp[v] = inf;
    for (int i = 1; i <= object_count; ++i) {
        for (int v = MAXV - 1; v >= value[i]; --v) {
            dp[v] = min(dp[v], dp[v - value[i]] + weight[i]);
        }
    }
}

int main() {
    scanf("%d%d", &object_count, &max_weight);
    for (int i = 1; i <= object_count; ++i) {
        scanf("%lld%lld", weight + i, value + i);
    }
    solve();
    for (int v = MAXV - 1; ~v; --v) {
        if (dp[v] && dp[v] <= max_weight) {
            printf("%d\n", v);
            return 0;
        }
    }
}


Measured memory_bytes: 896
#include <stdio.h>
#include <string.h>
#define MAX 200
int main(void){
    char S[MAX];
    int ans=0;
    scanf("%s", S);
    int len = strlen(S);
    for (int i = 0; i <len ; ++i) {
        if(S[i]!=S[len-1-i]){
            ans++;
        }
    }
    printf("%d", ans/2);
}

Measured memory_bytes: 128
#include <stdio.h>

typedef struct { char suit, value; } Card;

void bubble(Card A[], int N) {
  int i,j;
  Card t;
  for(i = 0; i<N; i++) {
    for(j = N-1; j >= i + 1; j--) {
      if(A[j].value < A[j-1].value) {
        t = A[j]; A[j] = A[j-1]; A[j-1] = t;
      }
    }
  }
}

void selection(Card A[], int N) {
  int i,j,minj;
  Card t;
  for(i=0;i<N;i++) {
    minj = i;
    for(j=i; j<N; j++) {
      if(A[j].value < A[minj].value) minj = j;
    }
    t = A[i]; A[i] = A[minj]; A[minj] = t;
  }
}

void print(Card A[], int N) {
  int i;
  for(i=0; i<N; i++) {
    if(i>0) printf(" ");
      printf("%c%d",A[i].suit,A[i].value);
  }
  printf("\n");
}

int isStable(Card C1[], Card C2[], int N) {
  int i;
  for(i=0; i<N; i++) {
    if(C1[i].suit != C2[i].suit) return 0;
  }
  return 1;
}

/* オリジナル関数を追加 */
void str2Card(Card *t,char str[]) {
    t->suit  = str[0];
    t->value = str[1] - '0';
}

int main(void) {
  Card C1[100], C2[100];
  int N,i;
  char str[3];

  scanf("%d",&N);
  for(i=0;i<N; i++) {
    scanf("%s",str);
    str2Card(&C1[i],str);
  }

  for(i=0; i<N; i++) C2[i] = C1[i];

  bubble(C1,N);
  selection(C2,N);

  print(C1,N);
  printf("Stable\n");
  print(C2,N);
  if(isStable(C1,C2,N)) {
    printf("Stable\n");
  } else {
    printf("Not stable\n");
  }

  return 0;
}



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





int main() {
	ll N;
	cin >> N;
	for (ll h = 1; h <= 3500; h++) {
		for (ll n = 1; n <= 3500; n++) {
			if ((N * n + N * h - 4 * h * n)<0&&(N * h * n) % (N * n + N * h - 4 * h * n) == 0) {
				cout << h << " " << n << " " << -(N * h * n) / (N * n + N * h - 4 * h * n)
					;
				return 0;
			}
		}
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using namespace std;
int main(){
  int n,m;cin>>n>>m;
  int a,sum=0;
  rep(i,m){cin>>a;sum+=a;}
  cout<<(sum>n?-1:n-sum);
}

Measured memory_bytes: 3624
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
int main (){
    char a[4],anc =0;
    scanf("%s",&a);

    for(int i=0; i<4; i++){
        if(a[i] == '+') anc++;
        else anc--;
    }
    printf("%d",anc);
    

    
}
 //chcp 65001 cd contest



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

int main()
{
  int a, b;
  cin >> a >> b;
  if(a > b+1) cout << 2*a - 1;
  else if(b > a + 1) cout << 2*b - 1;
  else cout << a + b;
  
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define mod 1e9+7
typedef long long ll; 
 int main(){
 ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
  ll n,d,a,b,c=0;double x;
   cin>>n>>d;
   while(n--){
     cin>>a>>b;
     x=sqrt((a*a)+(b*b));
     if(x<=d) c++;
   }
   cout<<c;
    return 0;
}

Measured memory_bytes: 3716
import sys
input = sys.stdin.readline
N, M = map(int, input().split())
xs = list(map(int, input().split()))
G = [set() for _ in range(N+1)]
for i in range(M):
    u, v = sorted(map(int, input().split()),key=lambda x:[xs[x-1],-x])
    G[v].add((u,i))
xs,d,cc = sorted([(x,i+1) for i, x in enumerate(xs)]),[0]*M,{}
for x, u in xs:
    if u in cc:
        continue
    if not G[u]:
        break
    cc[u] = 1
    for c, _ in G[u]:
        if c in cc:
            cc[u] = 1-cc[c]
    S = [u]
    while S:
        q = S.pop()
        for c, i in G[q]:
            d[i] = str(x)
            if c not in cc:
                S.append(c)
                cc[c] = 1-cc[q]
print("".join("BW"[cc[i]] for i in range(1,N+1))+"\n"+"\n".join(d) if len(cc)==N else -1)

Measured memory_bytes: 145948
#include<iostream>
#include<string.h>
#include<vector>
#include<list>
#include<stdio.h>
#include<math.h>
#include<iomanip>
#include<map>
#include<stack>
#include<queue>
#include<algorithm>
#define range(i,a,b) for(int i = (a); i < (b); i++)
#define rep(i,b) range(i,0,b)
#define debug(x) cout << "debug " << x << endl;
using namespace std;

int main(){
    int n, x, ord[35];
    bool prime[1000000] = {1,1,0};

    rep(i,1000000){
        if(!prime[i]){
            for(int j = i + i; j < 1000000; j+=i){
                prime[j] = 1;
            }
        }
    }

    while(cin >> n >> x, n||x){
        bool total[1000000] = {1};
        rep(i,n){
            cin >> ord[i];
        }
        rep(i,x){
            if(total[i]){
                rep(j,n){
                    if(i + ord[j] > x) continue;
                    total[i + ord[j]] = 1;
                }
            }
        }
        bool c = true;
        for(int i = x; i >= 0; i--){
            if(prime[i] == 0 && total[i] == 1){
                cout << i << endl;
                c = false;
                break;
            }
        }
        if(c) cout << "NA" << endl;
    }
}

Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}

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; }

vector< vector<int> > Graph;
vector< int > value;









int main(int argc, const char * argv[]) {
    
   
    
    int n; cin >> n;
    vector<int> A(n);
    vector<int> B(n);
    vector<int> C(n-1);
    
    rep(i,n) cin >> A[i];
    rep(i,n) cin >> B[i];
    rep(i,n-1) cin >> C[i];
    
    int ans = 0;
    
    for (int i = 0; i < n; i++) {
        ans += B[i];
    }
    
    
    for (int i = 0; i < n-1; i++) {
        if(A[i] == A[i+1] - 1) ans += C[A[i] - 1];
    }
    cout << ans << endl;
    


    
    

    
}


Measured memory_bytes: 256
// AirConditioner.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

#include <iostream>
#include <string>
using namespace std;
int main()
{
    int x;
    string out;
    cin >> x;
    if (x >= 30) {
        out = "Yes";
    }
    else {
        out = "No";
    }
    std::cout << out;
    return 0;
}


Measured memory_bytes: 3624
/*|In The Name Of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 25;

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

int n;
int m;
char grid[N][N];
int vis[N][N];

int get(int a , int b , int c , int d){
    if(grid[a][b] == '#' || grid[c][d] == '#')
        return 0;
    queue < pair < pair < int , int > , int > > q;
    q.push({{a , b} , 0});
    memset(vis , 0 , sizeof vis);
    while(!q.empty()){
        int x = q.front().first.first;
        int y = q.front().first.second;
        int dist = q.front().second;
        q.pop();
        if(vis[x][y])
            continue;
        if(x == c && y == d)
            return dist;
        vis[x][y] = 1;
        for(int i = 0; i < 4; i++){
            int nwx = x + dx[i];
            int nwy = y + dy[i];
            if(nwx >= 1 && nwy >= 1 && nwx <= n && nwy <= m && grid[nwx][nwy] != '#'){
                q.push({{nwx , nwy} , dist + 1});
            }
        }

    }
    return 0;
}

int main(){
    cin >> n >> m;
    for(int i = 1; i <= n; i++){
        for(int j = 1; j <= m; j++){
            cin >> grid[i][j];
        }
    }
    int mx = 0;
    for(int a = 1; a <= n; a++){
        for(int b = 1; b <= m; b++){
            for(int c = 1; c <= n; c++){
                for(int d = 1; d <= m; d++){
                    mx = max(mx , get(a , b , c , d));
                }
            }
        }
    }
    cout << mx << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#define int64 long long
using namespace std;

int main()
{
  int64 nn, tmp, sum = 0;
  cin >> nn;
  vector<int64> ll(nn);
  for(int64 ii = 0;ii < nn;ii++)
  {
    cin >> tmp;
    ll[ii] = tmp;
    sum += tmp;
  }
  sort(ll.begin(), ll.end());
  sum -= ll[nn - 1];
  if(sum > ll[nn - 1])
  {
    puts("Yes");
  }
  else
  {
    puts("No");
  }
  return 0;
}

Measured memory_bytes: 3628
def main():
    N = int(input())
    T, A = map(int, input().split())
    H = list(map(int, input().split()))

    ans = float('inf')
    cnt = 0
    for i, h in enumerate(H):
        tmp = abs(A - (T - h * 0.006))
        if ans > tmp:
            ans = tmp
            cnt = i + 1

    print(cnt)


main()

Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define irep(i, n) for (int i = (n); i >= 0; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const int INF = 1 << 30;
 
int main() {
  int n, m,k;
  cin >>n>>m>>k;
  bool can = false;
  if (k%n==0 || k%m==0) can = true;
  rep(a,n+1) rep(b,m+1) {
    int num = a*m+b*n-2*a*b;
    if (num == k) can = true;
  }
  if (can) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}

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

int main(){
    string s;
    cin >> s;
    int n= s.length();
    reverse(s.begin(), s.end());

    vector<int> mod(n+1);
    int pow10 = 1;
    for(int i=0; i<n; i++){
        mod[i+1] = mod[i] + (s[i] - '0') * pow10;
        mod[i+1] %= 2019;

        pow10 *= 10;
        pow10 %= 2019;
    }

    map<int, int> pool;
    for(int i=0; i<=n; i++){
        if(pool.find(mod[i]) == pool.end()) pool[mod[i]] = 1;
        else pool[mod[i]] += 1;
    }

    long long int ans = 0;
    for(auto p : pool){
        ans += p.second * (p.second - 1) / 2;
    }
    cout << ans << endl;
    return 0;
}

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

int main()
{
    int n, m;

    cin >> n;
    map<string, int>mp;

    while(n--)
    {
        string s;
        cin >> s;

        mp[s]++;

    }

    cin >> m;

    while(m--)
    {
        string s;

        cin >> s;

        if(mp[s] > 0) mp[s]--;
    }
    int mx = INT_MIN;
    for(auto x:mp)
    {
        mx = max(mx, x.second);
    }

    cout << mx << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 整数の入力
		int n = sc.nextInt();
		int k = sc.nextInt();
        int ans = 1;
        for(int i = 0; i < n; i++) {
          ans = Math.min(ans + k, ans * 2);
        }
    
		// 出力
		System.out.println(ans);
	}
}

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

int main(){
  int x = 0;
  cin >> x;
  if(x == 1){
    cout << "Hello World" << endl;
  }else if(x == 2){
    int y,z = 0;
    cin >> y >> z;
    cout << y+z << endl;
  }
}

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

int main() {
  int A, N;
  cin >> N  >> A;
  int b = N%500;
  if (b == 0) {
    cout << "Yes";
  }else{
    if(b <= A){
      cout << "Yes";
    }else{
      cout << "No";
    }
  }
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
using namespace std;
int dp[100100];
int v[100100];
int n;

int run(int i) {
	if(i >= n - 1) return 0;
	if(dp[i] != -1) return dp[i];
	if(i == n - 2) return dp[i] = abs(v[i] - v[i + 1]);

	dp[i + 2] = run(i + 2);
	dp[i + 1] = run(i + 1);
	
	return dp[i] = min(
		dp[i + 2] + abs(v[i] - v[i + 2]),
		dp[i + 1] + abs(v[i] - v[i + 1])
	);
}

int main() {
	cin>>n;
	for(int i=0; i<n; ++i) {
		cin>>v[i];
	}
	memset(dp, -1, sizeof dp);
	
	cout<< run(0) <<endl;
	/*for(int i=0; i<n; ++i) {
		cout<<dp[i]<<" ";
	} cout<<endl;*/
	
	return 0;
}

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

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};
static const double pi = 3.141592653589793;
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,h,m;
    cin >> a >> b >> h >> m;
    double al = abs((double)h/6.0+(double)m/360.0-(double)m/30.0);
    if(al==0.0){
        printf("%.10f\n", (double)abs(a-b));
        return 0;
    }
    if(al==1.0){
        printf("%.10f\n", (double)abs(a+b));
        return 0;
    }
    al = min(al, 2.0-al);
    double ans = (double)a*a + (double)b*b - 2.0*a * b* cos(al*pi);
    ans = sqrt(ans);
    printf("%.10f\n", ans);
    return 0;
}

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

// #undef DEBUG  // Uncomment this line to forcefully disable debug print.
#if DEBUG
template <typename T>
void debug(T value) {
  std::cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  std::cerr << value << ", ";
  debug(args...);
}
#define dbg(...)                              \
  do {                                        \
    cerr << #__VA_ARGS__ << ": ";             \
    debug(__VA_ARGS__);                       \
    cerr << " (L" << __LINE__ << ")" << endl; \
  } while (0)
#else
#define dbg(...)
#endif

void read_from_cin() {}
template <typename T, typename... Ts>
void read_from_cin(T& value, Ts&... args) {
  std::cin >> value;
  read_from_cin(args...);
}
#define in(type, ...) \
  type __VA_ARGS__;   \
  read_from_cin(__VA_ARGS__);

template <typename T>
void write_to_cout(const T& value) {
  std::cout << value << std::endl;
}
template <typename T, typename... Ts>
void write_to_cout(const T& value, const Ts&... args) {
  std::cout << value << ' ';
  write_to_cout(args...);
}
#define out(...) write_to_cout(__VA_ARGS__);

#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)

using ll = long long;

using namespace std;

int main() {
  in(int, a, b);
  for (int i = 1; i <= 3; ++i) {
    if (i != a && i != b) {
      cout << i << endl;
    }
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std;
///////////////////////////////////////////
const long long int INF = 100000000000;
const long long int Mod = 1000000007;
using ll = long long int; //long long int は64bit
using vi = vector<int>; using Vi = vector<long long int>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define mt make_tuple
#define all(x) (x).begin(),(x).end()
#define rep(i,N) for(long long int i=0;i<N;i++)
#define np nullptr
template<class T>bool chmax(T &former, const T &b) { if (former<=b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define fill(x,num) memset(x,num,sizeof(x));
typedef vector<vector<ll> > matrix;
typedef pair<ll,ll> Pair;
bool p_compare(const Pair& firstP, const Pair& secondP){ 
    return firstP.second < secondP.second; 
}//sort(all(v),p_compare)で昇順ソート
//////////////////////////^^ *Emile ^^^//////////////////////////////////////////////////////
//Snipet -> Caps Lock

ll d,g;
Vi p,c;

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    cin>>d>>g;ll pp,cc;
    rep(i,d){
        cin>>pp>>cc;
        p.pb(pp);
        c.pb(cc);
    }//input
    ll ans = INF;
    ll tmp = 0;ll sum = 0;
    for(ll mk=0;mk<(1<<(d));mk++){
        tmp  = 0;sum = 0;
        rep(i,d){
            if(mk&(1<<i)){
                tmp+=p[i];
                sum+=c[i]+(i+1)*100*p[i];
            }
        }
        if(sum>=g)chmin(ans,tmp);
        else{
            for(int i = d-1;i>=0;i--){
                if(mk & (1<<i))continue;
                rep(j,p[i]){
                    sum += (i+1)*100;
                    tmp += 1;
                    if(sum>=g){chmin(ans,tmp);break;}
                }
                sum += c[i];
                if(sum>=g)chmin(ans,tmp);
                break;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <cmath>
#include <string>
#include <iostream>
#include <stack>

using namespace std;
typedef long long ll;

int main(){
    ll w, h, x, y;
    cin >> w >> h >> x >> y;
    double ans_area = (double)(w)/ 2.0 * (double)(h);
    bool multi = (w == x * 2) && (h == y * 2);
    cout << ans_area << ' ' << (int)(multi) << 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 ll;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    vector<int> b(n);
    vector<int> c(n-1);
    rep(i, n) cin >> a[i];
    rep(i, n) a[i]--;
    rep(i, n) cin >> b[i];
    rep(i, n-1) cin >> c[i];
    int sum = 0;
    rep(i, n-1) {
        sum += b.at(a.at(i));
        if (a[i] + 1 == a[i+1]) {
            sum += c.at(a.at(i));
        }
    }
    sum += b.at(a.at(n-1));
    cout << sum << endl;
}

Measured memory_bytes: 3616