akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
using namespace std;typedef long long int mint_type;
const mint_type MOD = 1000000007;
const mint_type MAX = 1000000;
class mint{
    public:
        static mint_type fac[MAX];
        static mint_type finv[MAX];
        static inline mint_type mod(mint_type a, mint_type mod = MOD){ return (a % mod + mod) % mod;}
        static mint_type mpow(mint_type a, mint_type n, mint_type mod = MOD);
        static mint_type extGCD(mint_type a, mint_type b, mint_type& x, mint_type& y);
        static mint_type minv(mint_type a, mint_type mod = MOD);
        static void mcinit(mint_type max = MAX, mint_type mod = MOD);
        static mint_type mchoose(mint_type n, mint_type r, mint_type mod = MOD);
};
mint_type mint::fac[MAX];
mint_type mint::finv[MAX];

mint_type mint::mpow(mint_type a, mint_type n, mint_type mod){
    mint_type result = 1;
    while(n > 0){
        if(n & 1){
            result = result * a % mod;
        }
        a = a * a % mod;
        n >>= 1;
    }
    
    return result;
}

mint_type mint::extGCD(mint_type a, mint_type b, mint_type& x, mint_type& y){
    if(a % b == 0){
        x = 0;
        y = 1;
        return b;
    }
    
    mint_type d = extGCD(b, a % b, x, y);
    mint_type tmp = -y * (a / b) + x;//
    x = y;
    y = tmp;
    return d;
}

mint_type mint::minv(mint_type a, mint_type mod){
    mint_type x, y;
    mint::extGCD(a, mod, x, y);
    //while(x < 0) x += mod;
    return mint::mod(x);
}

void mint::mcinit(mint_type max, mint_type mod){
    mint::fac[0] = 1;
    for(mint_type i = 1; i < max; i++){
        mint::fac[i] = mint::fac[i-1] * i % mod;
    }
    mint::finv[max-1] = mint::minv(fac[max-1]);
    for(mint_type i = max-1; i > 0; i--){
        mint::finv[i-1] = mint::mod(mint::finv[i] * i);
    }
}

mint_type mint::mchoose(mint_type n, mint_type r, mint_type mod){
    return mint::mod(mint::fac[n] * mint::mod(mint::finv[r] * mint::finv[n-r]));
}

int main(){
    int x, y;
    cin >> x >> y;
    long long int ans = 0;
    if((x+y)%3 == 0){
        int k = (x+y)/3;
        if(k <= x && x <= 2*k && k <= y && y <= 2*k){
            mint::mcinit();
            ans = mint::mchoose((long long int)k, (long long int)(x-k));
        }
    }
    cout << ans << endl;
}

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

#define pb push_back
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define debug(x) cerr << #x << " : " << x << '\n'

using namespace std;

typedef long long ll;
typedef long double ld;
typedef string str;
typedef pair<ll, ll> pll;

const ll Mod = 1000000007LL;
const int N = 2e5 + 10;
const ll Inf = 2242545357980376863LL;
const ll Log = 30;

int L;
str al = "bcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890a";
//str al = "abc";
map<char, int> mp, cnt;

int cntq = 0;
ll ask(str x){
	cout << "? " << x << endl;
	ll res;
	cin >> res;
	return res;
}

bool CMP(str& a, str& b){
	return a.size() < b.size();
}

vector<str> V;
str ins[200];
str Merge(str a, str b){
	//swap(a, b);
	int n = a.size(), m = b.size();
	for(int i = 0; i <= n; i++) ins[i] = "";
	int p = 0;
	for(int i = 0; i < m; i++){
		
		while(true){
			ins[p] += b[i];
			str Q = ins[0];
			for(int j = 1; j <= n; j++){
				Q += a[j - 1];
				Q += ins[j];
			}
			if(p == n) break;
			if((p == n) || (ask(Q) == L - Q.size())) break;
			else {
				ins[p].pop_back();
				p ++;
			}
		}
	}
	str re = ins[0];
	for(int j = 1; j <= n; j++){
		re += a[j - 1];
		re += ins[j];
	}
	return re;
}

int main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	//assert(false);
	str Q="";
	int rc;//, L=-1;
	L = 0;
	for(auto c : al){
		Q = "";
		for(int i = 0; i < 128; i++) Q += c;
		rc = ask(Q);
		cnt[c] = 128 - rc;
		L += cnt[c];
	}
	for(auto c : al){
		if(cnt[c] == 0) continue;
		Q = "";
		for(int i = 0; i < cnt[c]; i++) Q += c;
		V.pb(Q);
	}
	while(V.size() > 1){
		sort(all(V), CMP);
		V[1] = Merge(V[0], V[1]);
		V.erase(V.begin());
	}
	cout << "! " << V[0] << endl;
	return 0;
}


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

const long long inf = 1000000000000000037;
const int maxn = 100005;

int n, mx;
int a[3 * maxn];
multiset < int > b, c, others;
long long sb, sc, ans;

signed main () {
	scanf("%d", &n);
	for (int i = 1; i <= 3 * n; ++i) {
		scanf("%d", &a[i]);
		if (i <= n) {
			b.insert(a[i]);
			sb += a[i];
		}
		else {
			if (int(c.size()) == n && *prev(c.end()) > a[i]) {
				sc -= *prev(c.end());
				others.insert(*prev(c.end()));
				c.erase(prev(c.end()));
				sc += a[i];
				c.insert(a[i]);
			}
			else if (int(c.size()) == n)
				others.insert(a[i]);
			else {
				c.insert(a[i]);
				sc += a[i];
			}
		}
	}
	ans = sb - sc;
	for (int i = n + 1; i <= 2 * n; ++i) {
		if (a[i] > *b.begin()) {
			sb -= *b.begin();
			b.erase(b.begin());
			sb += a[i];
			b.insert(a[i]);
		}
		if (others.find(a[i]) != others.end()) 
			others.erase(others.find(a[i]));
		else {
			sc -= a[i];
			c.erase(c.find(a[i]));
			sc += *others.begin();
			c.insert(*others.begin());
			others.erase(others.begin());
		}
		ans = max(ans, sb - sc);
	}
	printf("%lld\n", ans);
}


Measured memory_bytes: 19032
#include <vector>
#include <iostream>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <tuple>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#include <complex>
#include <iterator>
#include <array>
#include <memory>
#include <stack>
#define vi vector<int>
#define vvi vector<vector<int> >
#define ll long long int
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vb vector<bool>
#define vc vector<char>
#define vs vector<string>
#define ld long double
#define INF 1e9
#define EPS 0.0000000001
#define rep(i,n) for(int i=0;i<n;i++)
#define loop(i,s,n) for(int i=s;i<n;i++)
#define all(in) in.begin(), in.end()
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
#define MAX 9999999
using namespace std;
typedef pair<int, int> pii;
typedef pair<double,double>pdd;
typedef pair<ll,ll>pll;
ll LLINF= INF*INF;
vector<vector<ll>>dp(50,vl(5001,0));
signed main(){
    int n,p; cin>>n>>p;
    vi v(n); rep(i,n)cin>>v[i];
    dp[0][0]=1;
    dp[0][v[0]]=1;
    rep(i,n-1)rep(j,5001){
        if(dp[i][j]==0)continue;
        dp[i+1][j]+=dp[i][j];
        dp[i+1][j+v[i+1]]+=dp[i][j];
    }
    ll ans=0;
    rep(i,5001)if(dp[n-1][i]&&i%2==p){ans+=dp[n-1][i];}
    cout<<ans<<endl;
}

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

int main() {
  int K ;
  cin >> K;
 vector<int> a;
a = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
cout << a[K-1] << endl;

  return 0;
}


Measured memory_bytes: 3544
until (n=gets.to_i)==0
  l1=gets.split.map(&:to_i)
  l2=Array.new(n)
  count=0
  loop do
    l1.each.with_index do |num,id|
      l2[id]=l1.count{|item| item==num}
    end
    l1==l2 ? break : l1=l2.dup
    count+=1
  end
  puts "#{count}\n#{l1.join(" ")}"
end

Measured memory_bytes: 8764
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n)         for(int i=0; i<(n); i++)
#define P pair<int, int>
#define prtd(n, var)     cout << fixed << setprecision(n) << var << "\n"

//----------------------------------------------------

int main(){
    int n; cin >> n;
    if(n == 1){
        cout << "Hello World" << endl;
    }else{
        int a, b;
        cin >> a >> b;
        cout << a + b << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
using namespace std;
int n;
char ch[4001];
long long sum1,sum2,sum3,ans;
int main()
{
	scanf("%d\n",&n);
	for(int i=1;i<=n;i++){
		scanf("%c",&ch[i]);
		if(ch[i]=='R') sum1++;
		if(ch[i]=='G') sum2++;
		if(ch[i]=='B') sum3++;
		for(int j=1;j*2+1<=i;j++)
			if(ch[i]!=ch[i-j]&&ch[i]!=ch[i-2*j]&&ch[i-j]!=ch[i-2*j]) ans--;
	}
	ans+=sum1*sum2*sum3;
	printf("%lld",ans);
}

Measured memory_bytes: 3820
def main():

    N, M = map(int, input().split())
    mod = pow(10, 9) + 7

    g1 = [1, 1]
    g2 = [1, 1]
    inv = [0, 1]

    for i in range(2, max(M, N)+1):
        g1.append((g1[-1] * i) % mod)
        inv.append( ( -inv[mod % i] * (mod//i)) % mod )
        g2.append((g2[-1] * inv[-1]) % mod)

    def combi(n, r):
      r = min(r, n-r)
      return g1[n]*g2[r]*g2[n-r]%mod

    def p(n, r):
      return g1[n]*g2[n-r]%mod

    if M < N: return 0

    ans = 0
    sgn = 1
    for i in range(N+1):
        v = sgn * combi(N, i) * p(M, i)
        v %= mod
        v *= p(M-i, N-i) * p(M-i, N-i)
        v %= mod
        ans += v
        ans %= mod
        sgn *= -1
    return ans



if __name__ == '__main__':
    print(main())

Measured memory_bytes: 185148
#include "bits/stdc++.h"
using namespace std;
typedef long long int lint;
typedef pair<lint, lint> plint;
typedef pair<double long, double long> pld;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for(lint i=(begin),i##_end_=(end);i<i##_end_;i++)
#define IFOR(i, begin, end) for(lint i=(end)-1,i##_begin_=(begin);i>=i##_begin_;i--)
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
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; }
template<typename T1, typename T2> pair<T1, T2> operator+(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first + r.first, l.second + r.second); }
template<typename T1, typename T2> pair<T1, T2> operator-(const pair<T1, T2>& l, const pair<T1, T2>& r) { return make_pair(l.first - r.first, l.second - r.second); }
const lint MOD = 1e9 + 7, INF = 1e18;


lint D;
lint decrease[26];
lint satis[365][26];
lint last[26];

lint downscore(lint passed) {
	lint sum = 0;
	REP(i, 26) {
		sum += decrease[i] * (passed - last[i]);
	}
	return -sum;
}

int main() {
	cin >> D;
	REP(i, 26) {
		cin >> decrease[i];
	}
	REP(i, D) {
		REP(j, 26) {
			cin >> satis[i][j];
		}
	}

	lint score = 0;
	REP(i, D) {
		lint maxv = -INF, max_idx = -1;
		REP(s, 26) {
			lint inst = 0;
			inst += satis[i][s];
			inst += downscore(i + 1);
			chmax(inst, 0ll);
			if (maxv < inst) {
				maxv = inst;
				max_idx = s;
			}
		}
		last[max_idx] = i + 1;
		cout << max_idx + 1 << endl;
	}
}


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

#define DEBUG (0)

bool judge(string str, long long length);

int main(void)
{
  string S,S1,S2;
  long long N,N_S1,N_S2 = 0;
  bool flg_S,flg_S1,flg_S2 = false;
  
  cin >> S;
  N = (long long)S.length();

  S1 = S.substr(0,(N-1)/2);
  S2 = S.substr((N+3)/2 -1,(N-1)/2);
  
  N_S1 = S1.length();
  N_S2 = S2.length();
  
  flg_S = judge(S,N);
  flg_S1 = judge(S1,N_S1);
  flg_S2 = judge(S2,N_S2);
  
  if(flg_S & flg_S1 & flg_S2){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
#if DEBUG
  cout << "S: " << S <<  " S1: " << S1 <<  " S2: " << S2 << endl;
  cout << "N: " << N << " N_S1: " << N_S1 << " N_S2: " << N_S2 << endl;
  cout << "flg_S: " << flg_S << " flg_S1: " << flg_S1 << " flg_S2: " << flg_S2 << endl;
//  cout << "S[1]: " << S[1] << endl;
#endif
}

bool judge(string str, long long length)
{
  bool bRet = true;
  
  for(int i = 0; i < length/2; i++){
    if(str[i] == str[length - 1 -i]){
      /* 継続 */
    }else{
      bRet = false;
      break;
    }
  }
  return bRet;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main(void){
    string A,B;
    cin >> A >> B;
    if(A.size() != B.size()){
        if(A.size() > B.size()){
            cout << "GREATER" << endl;
        }
        else{
            cout << "LESS" << endl;
        }
        return 0;
    }
    for(int i=0;i<A.size();i++){
        if(A[i] > B[i]){
            cout << "GREATER" << endl;
            return 0;
        }
        if(A[i] < B[i]){
            cout << "LESS" << endl;
            return 0;
        }
    }
    cout << "EQUAL" << endl;
}


Measured memory_bytes: 3164
#include <stdio.h>

int main(void){
  long N;
  scanf("%ld",&N);

  long long a;
  long count[3] = {0,0,0};

  for(int i = 0;i < N;i++){
    scanf("%lld",&a);
    if(a%4 == 0) count[0]++;
    else if(a%2 == 0) count[1]++;
    else count[2]++;
  }

  if(count[1] > 0){
    if(count[0] >= count[2]) printf("Yes\n");
    else printf("No\n");
  }else{
    if(count[0]+1 >= count[2]) printf("Yes\n");
    else printf("No\n");
  }

  return 0;
}

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

using namespace std;

int main() {
    string S; cin >> S;
    bool n = false, w = false, s = false, e = false;
    for(auto hoge : S) {
        switch(hoge) {
            case 'N':
                n = true;
                break;
            case 'W':
                w = true;
                break;
            case 'S':
                s = true;
                break;
            case 'E':
                e = true;
                break;
        }
    }
    if(n == s && w == e) cout << "Yes\n";
    else cout << "No\n";

    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	vector<int>v(100010, 0);
	int N; cin >> N;
	rep(i, 0, N) {
		int l, r; cin >> l >> r;
		v[l]++; v[r + 1]--;
	}
	rep(i, 1, v.size())v[i] += v[i - 1];
	int ans(0);
	rep(i, 0, v.size())if (v[i] > 0)ans++;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 640
#define _USE_MATH_DEFINES
#include<iostream>
#include<cmath>
using namespace std;

int main(void){
	double x=0.0, y=0.0;
	double rad=M_PI/2.0;
	int r,a; char c;
	
	while(cin>>r>>c>>a){
		if( r==0 && a==0 ) break;
		double dx = r*cos(rad);
		double dy = r*sin(rad);
		rad -= a*M_PI/180.0;
		x+=dx; y+=dy;
	}

	cout << (int)x << endl << (int)y << endl;
	return 0;
}

Measured memory_bytes: 0
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
const int dy8[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx8[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

int main() {
  int n; cin >> n;
  vector<int> a(n * 3); REP(i, n * 3) cin >> a[i], --a[i];
  vector dp(n, vector(n, -INF));
  vector mx(n, -INF);
  dp[a[0]][a[1]] = dp[a[1]][a[0]] = 0;
  mx[a[0]] = mx[a[1]] = 0;
  int tmp = 0;
  for (int i = 2; i + 1 < n * 3; i += 3) {
    if (a[i] == a[i + 1] && a[i + 1] == a[i + 2]) {
      ++tmp;
      continue;
    }
    vector<pair<pair<int, int>, int>> nx;
    function<void(int, int, int)> emp = [&](int k1, int k2, int val) {
      nx.emplace_back(make_pair(k1, k2), val);
    };
    int max = *max_element(ALL(mx));
    emp(a[i], a[i + 1], max);
    emp(a[i + 1], a[i + 2], max);
    emp(a[i + 2], a[i], max);
    REP(j, n) {
      emp(a[i], a[i + 1], dp[a[i + 2]][a[i + 2]] + 1);
      emp(a[i + 1], a[i + 2], dp[a[i]][a[i]] + 1);
      emp(a[i + 2], a[i], dp[a[i + 1]][a[i + 1]] + 1);
    }
    REP(j, n) {
      emp(a[i], j, mx[j]);
      emp(a[i], j, dp[j][a[i + 1]] + (a[i + 1] == a[i + 2]));
      emp(a[i + 1], j, mx[j]);
      emp(a[i + 1], j, dp[j][a[i + 2]] + (a[i + 2] == a[i]));
      emp(a[i + 2], j, mx[j]);
      emp(a[i + 2], j, dp[j][a[i]] + (a[i] == a[i + 1]));
    }
    for (auto [pr, val] : nx) {
      auto [x, y] = pr;
      chmax(dp[x][y], val);
      chmax(dp[y][x], val);
      chmax(mx[x], val);
      chmax(mx[y], val);
    }
  }
  int ans = 0;
  REP(i, n) {
    chmax(ans, dp[i][i] + (i == a[n * 3 - 1]));
    FOR(j, i + 1, n) chmax(ans, dp[i][j]);
  }
  cout << ans + tmp << '\n';
  return 0;
}


Measured memory_bytes: 19556
public class Main {


  private static void solve() {
    int n = ni();
    int m = ni();
    
    int ret = 0;
    for (int i = 1; i <= Math.sqrt(m) + 0.1; i ++) {
      if (m % i == 0) {
        if (i >= n) {
          ret = Math.max(ret, m / i);
        }
        if (m / i >= n) {
          ret = Math.max(ret, i);
        }
      }
    }
    System.out.println(ret);
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 23252
import math
x = 0.0
y = 0.0
theta = 90.0
while True:
    m, r = map(int, raw_input().split(","))
    if m == 0 and r == 0:
        break
    rad = theta/180*math.pi
    x += m*math.cos(rad)
    y += m*math.sin(rad)
    theta += -r
    
print int(x)
print int(y)

Measured memory_bytes: 4416
/*
	Author: Dinesh Verra
	College: ABV-IIITM
	Date: 10/07/2020
*/
#include <bits/stdc++.h>
// #include <boost/multiprecision/cpp_int.hpp> 
// using namespace boost::multiprecision; 
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
#define cu continue
#define br break
#define pb push_back
#define eb emplace_back
#define mod 1000000007
#define inf LLONG_MAX
#define pll pair <ll,ll>
#define min_pq priority_queue <pll> ,vector <pll>, greater <pll> > > 
#define F first
#define S second
#define vll vector <ll>
#define vpll vector <pll>
#define dbg(n) cout<<#n<<' '<<n<<endl;
#define all(v) v.begin(),v.end()
#define nl cout<<'\n'

template <typename A1>
void prn(A1&& arg)
{
	cout<<arg<<'\n';
}
template <typename A1, typename... A>
void prn(A1&& arg, A&&... args)
{
	cout<<arg<<' ';
	prn(args...);
}

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


	ll l,r,d;
	cin>>l>>r>>d;
	ll y=r/d;
	ll x=l/d;
	ll ans=y-x;
	if(l%d==0) ans++;
	prn(ans);
}

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

using namespace std;

#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int a[12][12],cost[12];

int main()
{
    FAST();
    int i,j,k,m,n,x,ans=INT_MAX,check,cnt[12];
    cin >> n >> m >> x;
    for(i=0;i<n;i++)
    {
        cin >> cost[i];
        for(j=0;j<m;j++)cin >> a[i][j];
    }
    for(i=1;i<(1 << n);i++)
    {
        check=0;
        for(j=0;j<m;j++)cnt[j]=0;
        for(j=0;j<n;j++)
        {
            if((1 << j) & i)
            {
                check+=cost[j];
                for(k=0;k<m;k++)cnt[k]+=a[j][k];
            }
        }
        for(j=0;j<m;j++)
        {
            if(cnt[j] < x)break;
        }
        if(j == m)ans=min(ans,check);
    }
    if(ans == INT_MAX)cout << "-1";
    else cout << ans;
    return 0;
}


Measured memory_bytes: 3656
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

		int N = scanner.nextInt();

		int[] A = new int[N];

		for (int i = 0; i < N; i++)
			A[i] = scanner.nextInt();

		Arrays.parallelSort(A);

		for (int i = 0; i < N - 1; i++) {
			if (A[i] == A[i + 1]) {
				System.out.println("NO");
				return;
			}
		}

		System.out.println("YES");

		scanner.close();
	}

}


Measured memory_bytes: 65956
#include <iostream>
#include <math.h>
#include <algorithm>
#include <string>
#include <vector>

#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <utility>

using namespace std;

typedef long long LL;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define dump(c) { for (auto it = c.begin(); it != c.end(); ++it) if (it == c.begin()) cout << *it; else cout << ' ' << *it; cout << endl; } 

const int MOD = 1000000007;

//! Conditions:
//! for each bits we have 3 combinations (x,y) = (0,0), (0,1), (1,1)
//! at msb, (x,y) = (1,1)
//! L <= x
//! y <= R
//
// dp[i][j][k][s]
//  i: bit index
//  j: 1: L <= x already guaranteed, 0: not sure yet
//  k: 1: y <= R already guaranteed, 0: not sure yet
//  s: 1: msb already taken care (the rest bits can be chosen from the three), not sure yet
LL dp[62][2][2][2];

int main()
{
    LL L, R;
    cin >> L >> R;

    dp[61][0][0][0] = 1;
    for (int i = 60; 0 <= i; --i) {
        int lb = (L >> i) & 1;
        int rb = (R >> i) & 1;
        rep(j, 2) rep(k, 2) rep (s, 2) {
            LL pre = dp[i+1][j][k][s];
            rep(x, 2) rep(y, 2) {
                if (x && !y) continue;
                if (!s && x != y) continue;
                int ns = (s || (x && y)) ? 1 : 0;
                if (!j && lb && !x) continue;
                int nj = (j || (!lb && x)) ? 1 : 0; 
                if (!k && !rb && y) continue;
                int nk = (k || (rb && !y)) ? 1 : 0;
                dp[i][nj][nk][ns] = (dp[i][nj][nk][ns] + pre) % MOD;
            }
        }
    }

    LL ans = 0;
    rep(j, 2) rep(k, 2) rep (s, 2) ans = (ans + dp[0][j][k][s]) % MOD;

    cout << ans << endl;

    return 0;
}


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

using namespace std;

int main() {
  int N, M;
  scanf("%d%d", &N, &M);
  char S[100000], T[100000];
  scanf("%s%s", S, T);
  
  // 最大公約数を計算
  int g = __gcd(N, M);
  int stepS = N / g;
  int stepT = M / g;
  for (int i = 0; i < g; ++i) {
    if (S[stepS * i] != T[stepT * i]) {
      puts("-1");
      return 0;
    }
  }
  printf("%lld", 1ll * N / g * M);
  return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
	int A, B;
	cin >> A >> B;
	if (A == B) {
		cout << A + B;
	}
	else {
		cout << max(A, B) * 2 - 1;
	}
}

Measured memory_bytes: 256
def LI():return list(map(int,input().split()))
def II():return int(input())
def yes():return print("Yes")
def no():return print("No")
INF=float("inf")
from collections import deque, defaultdict, Counter
from heapq import heappop, heappush
from itertools import product, combinations
from functools import reduce, lru_cache
from math import pi, gcd
from decimal import Decimal

class Combination:
    """
    O(n)の前計算を1回行うことで，O(1)でnCr mod mを求められる
    n_max = 10**6のとき前処理は約950ms (PyPyなら約340ms, 10**7で約1800ms)
    使用例：
    comb = Combination(1000000)
    print(comb(5, 3))  # 10
    """
    def __init__(self, n_max, mod=10**9+7):
        self.mod = mod
        self.modinv = self.make_modinv_list(n_max)
        self.fac, self.facinv = self.make_factorial_list(n_max)

    def __call__(self, n, r):
        return self.fac[n] * self.facinv[r] % self.mod * self.facinv[n-r] % self.mod

    def make_factorial_list(self, n):
        # 階乗のリストと階乗のmod逆元のリストを返す O(n)
        # self.make_modinv_list()が先に実行されている必要がある
        fac = [1]
        facinv = [1]
        for i in range(1, n+1):
            fac.append(fac[i-1] * i % self.mod)
            facinv.append(facinv[i-1] * self.modinv[i] % self.mod)
        return fac, facinv

    def make_modinv_list(self, n):
        # 0からnまでのmod逆元のリストを返す O(n)
        modinv = [0] * (n+1)
        modinv[1] = 1
        for i in range(2, n+1):
            modinv[i] = self.mod - self.mod//i * modinv[self.mod%i] % self.mod
        return modinv

class Unionfind:
    def __init__(self, N):
        self.p = list(range(N))
        self.rank = [0] * N
        self.size = [1] * N

    def root(self, x):
        if self.p[x] != x:
            self.p[x] = self.root(self.p[x])

        return self.p[x]

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def unite(self, x, y):
        u = self.root(x)
        v = self.root(y)

        if u == v: return

        if self.rank[u] < self.rank[v]:
            self.p[u] = v
            self.size[v] += self.size[u]
            self.size[u] = 0
        else:
            self.p[v] = u
            self.size[u] += self.size[v]
            self.size[v] = 0

            if self.rank[u] == self.rank[v]:
                self.rank[u] += 1

    def count(self, x):
        return self.size[self.root(x)]


a,b,c,d=LI()

print(max(a*c,b*c,a*d,b*d))

Measured memory_bytes: 77336
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a>b?a:b
#define REP(i,x,n) for(int i=x;i<n;i++)
#define REPR(i,x,n) for(int i=n-1;i>=x;i--)
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define endl "\n"
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;

class Combination
{
    vector<long long> fact;
    vector<long long> factinv;
    long long MOD = 1e9 + 7;
    long long modpow(long long a, long long n)
    {
        if (n == 0)
            return 1;
        if (n % 2 == 0)
        {
            long long t = modpow(a, n / 2);
            return t * t % MOD;
        }
        return a * modpow(a, n - 1) % MOD;
    }

    long long modinv(long long a)
    {
        // mod is prime
        return modpow(a, MOD - 2);
    }

public:
    Combination(int n) : fact(n), factinv(n)
    {
        fact[0] = 1;
        for (int i = 1; i < n; i++)
        {
            fact[i] = fact[i - 1] * i % MOD;
        }
        factinv[n - 1] = modinv(fact[n - 1]);
        for (int i = n - 2; i >= 0; i--)
        {
            factinv[i] = factinv[i + 1] * (i + 1) % MOD;
        }
    }

    long long ncr(long long n, long long r)
    {
        if (r < 0 || r > n)
            return 0;
        return fact[n] * factinv[r] % MOD * factinv[n - r] % MOD;
    }

    long long npr(long long n, long long r)
    {
        if (r < 0 || r > n)
            return 0;
        return fact[n] * factinv[n - r] % MOD;
    }

    long long nhr(long long n, long long r)
    {
        if (n == 0 && r == 0)
            return 1;
        return ncr(n + r - 1, r);
    }
};

int main(){
	
	int n,k;
	cin>>n>>k;
	Combination comb(n+3);
	vector<ll>a;
	rep(i,n){
		ll b;
		cin>>b;
		a.pb(b);
	}
	ll ans=0;ll ma=0,mi=0;
	sort(ALL(a));
	repr(i,n){
		ma+=((a[i])*(comb.ncr(i,k-1)-comb.ncr(n-i-1,k-1)))%MOD;
		ma%=MOD;	
	}
  
	cout<<(ma-mi)%MOD<<endl;
	
}


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

int main(){
  int a, b;
  cin >> a >> b;
  int c;
  if(a+b==3) c = 3;
  else if(a+b==4) c = 2;
  else c = 1;
  
  cout << c << endl;
  
  return 0;
}


Measured memory_bytes: 256
import math

d = int(input())

class point:
    def __init__(self, arg_x, arg_y):
        self.x = arg_x
        self.y = arg_y

p1 = point(0, 0)
p2 = point(100, 0)

def koch(d, p1, p2):
    pi = math.pi
    cos60 = math.cos(pi/3)
    sin60 = math.sin(pi/3)
    if d == 0:
        return
    else:
        s = point((2*p1.x + 1*p2.x)/3, (2*p1.y + 1*p2.y)/3)
        t = point((1*p1.x + 2*p2.x)/3, (1*p1.y + 2*p2.y)/3)
        u = point(s.x + cos60*(t.x-s.x) - sin60*(t.y-s.y), s.y + sin60*(t.x-s.x) + cos60*(t.y-s.y))
        koch(d-1, p1, s)
        print(s.x, s.y)
        koch(d-1, s, u)
        print(u.x, u.y)
        koch(d-1, u, t)
        print(t.x, t.y)
        koch(d-1, t, p2)

print(p1.x, p1.y)
koch(d, p1, p2)
print(p2.x, p2.y)


Measured memory_bytes: 5800
x = int(input())
for a in range(1001):
    for b in range(1001):
        if (a**5)-(b**5)==x:
            print(a,b)
            exit()
        if (a**5)+(b**5)==x:
            print(a,-1*b)
            exit()
        if (b**5)-(a**5)==x:
            print(-1*a,-1*b)
            exit()


Measured memory_bytes: 9100
#include <iostream>

using namespace std;

int main() {
	int A, B, C;
	cin >> A >> B >> C;

	if ((A == B && A != C) || (B == C && B != A) || (A == C && C != B)) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <cstdio>
#define abs(x) (x>0?x:-x)

int main(){
	int a,b,c,d,e,f;
	double g,x,y;

	while(scanf("%d %d %d %d %d %d",&a,&b,&c,&d,&e,&f)!=EOF){
		g=a*e-b*d;
		x=e*c+(-b)*f;
		y=(-d)*c+a*f;
		x=(x==0?0.000:x/g);
		y=(y==0?0.000:y/g);
		printf("%.3lf %.3lf\n",x,y);
	}
	return 0;
}

Measured memory_bytes: 1064
#include <iostream>

#define MAX 100

class Bubble{
public:
	void trace(int *A, int N){
		for(int i = 0; i < N; i++){
			if(i > 0) std::cout << " ";
			std::cout << A[i];
		}
		std::cout << std::endl;
	}

	void bubble_sort(int *A, int N){
		int flag = 1;
		int count = 0;
		int i = 0;
		while(flag){
			flag = 0;
			for(int j = N-1; j >= i+1; --j){
				if(A[j] < A[j-1]){
					int tmp = A[j];
					A[j] = A[j-1];
					A[j-1] = tmp;
					flag = 1;
					++count;
				}
			}
			++i;
		}
		trace(A, N);
		std::cout << count << std::endl;
	}

};

int main(){
	Bubble bubble;
	int itr;
	int A[MAX];
	std::cin >> itr;
	for(int i = 0; i < itr; i++){
		std::cin >> A[i];
	}
	bubble.bubble_sort(A, itr);
	return 0;
}


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

using namespace std;

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

    int a = 0;
    a += x >= 400;
    a += x >= 600;
    a += x >= 800;
    a += x >= 1000;
    a += x >= 1200;
    a += x >= 1400;
    a += x >= 1600;
    a += x >= 1800;
    cout << 9 - a << endl;
    return 0;
}


Measured memory_bytes: 3620
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop
from itertools import permutations, accumulate
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right
from copy import deepcopy
from operator import itemgetter
from fractions import gcd
import sys
def I(): return int(input())  # '123' -> 123
def Is(): return map(int, input().split())  # '123 456' -> 123, 456
def LI(): return list(map(int, input().split()))  # '123 456' -> [123, 456]
def TI(): return tuple(map(int, input().split()))  # '123 456' -> (123, 456)
def IR(n): return [I() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def TIR(n): return [TI() for _ in range(n)]
def S(): return input()
def Ss(): return input().split()  # 'aa bb' -> 'aa','bb' or ['aa','bb']
def LS(): return list(input())  # 'abc123' -> ['a','b','c','1','2','3']
def SR(n): return [S() for _ in range(n)]
def SsR(n): return [Ss() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
sys.setrecursionlimit(1000000)
MOD = 1000000007
INF = float('inf')

n = I()
s = S()
ans = 0
for i in range(n-2):
    if s[i:i+3] == 'ABC':
        ans += 1

print(ans)

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

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


Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#define ll long long
#define PI 3.141592653589
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define EPS 1e-7
#define PII pair<int,int>
#define s second
#define f first
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,
             tree_order_statistics_node_update>
    ordered_set;
ll MOD = 1e9+7;
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int random_int(int l,int r){return uniform_int_distribution<int>(l,r)(rng);}
ll fast_power(ll x, ll p){
    ll res = 1;
    while(p > 0){
        if(p & 1){
            res = (res * x)%MOD;
        }
        p = p >> 1;
        x = (x*x)%MOD;
    }
    return res;
}
vector<int> arr;
int n, K;
int dp[100005];
int solve(int k){
    if(k == 0){
        return 1;
    }
    if(dp[k] != -1){
        return dp[k];
    }
    int i = 0;
    int ans = 0;
    for(i = 0; i < n && arr[i] <= k; i++){
        int temp = solve(k-arr[i]);
        if(temp){
            ans = 1;
        }
    }
    return dp[k] =!ans;
}
int main() {
    IO;
    cin >> n >> K;
    memset(dp, -1, sizeof dp);
    arr.resize(n);
    for(int i = 0; i < n; i++){
        cin >> arr[i];
    }
    dp[0] = 0;
    for(int i = 1; i <= K; i++){
        dp[i] = 0;
        for(int j = 0; j < n && arr[j] <= i; j++){
            dp[i] = dp[i] | !dp[i-arr[j]];
        }
    }
    cout << ((dp[K]) ? "First" : "Second");

    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[5][5],i,j;
    for(i=1;i<=3;i++)
        for(j=1;j<=3;j++)
            scanf("%d",&a[i][j]);
    if(a[1][1]+a[2][2]==a[1][2]+a[2][1]&&a[1][2]+a[2][3]==a[2][2]+a[1][3]&&a[2][1]+a[3][2]==a[3][1]+a[2][2]&&a[2][2]+a[3][3]==a[3][2]+a[2][3])
        printf("Yes\n");
    else
        printf("No\n");
}

Measured memory_bytes: 384
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <map>

#define ST_ARR_LEN(array) (sizeof(array)/sizeof(*array))

using namespace std;

using ll = long long;

typedef stack<int> IntStack;
typedef queue<int> IntQueue;
typedef vector<int> IntVector;
typedef list<int> IntList;

typedef struct S{
  int a;
  int b;
} Object;

int main(){
  int N, M;
  cin >> N >> M;
  
  string ans;
  if(N == M){
  	ans = "Yes";
  }else{
    ans = "No";
  }
  
  cout << ans << endl;
}

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

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

  vector<string> s(N);
  for(int i = 0; i < N; i++){
    cin >> s[i];
  }

  int a_end = 0, b_start = 0, b_mid_a = 0;
  int ans = 0;
  for(int i = 0; i < N; i++){
    if(s[i][0] == 'B'){
      b_start++;
    }
    if(s[i][s[i].size() - 1] == 'A'){
      a_end++;
    }
    if((s[i][0] == 'B') && (s[i][s[i].size() - 1] == 'A')){
      b_mid_a++;
    }
    for(int j = 0; j + 1 < s[i].size(); j++){
      if((s[i][j] == 'A') && (s[i][j + 1] == 'B')){
	ans++;
      }
    }
  }
  if(a_end == b_mid_a && b_start == b_mid_a){
    ans += max(0, b_mid_a - 1);
  }else{
    ans += min(a_end, b_start);
  }

  cout << ans << endl;
}



Measured memory_bytes: 512
#include<bits/stdc++.h>
#define all(x) x.begin(), x.end()
#define pb push_back
#define all(x) x.begin(), x.end()
using namespace std;
using ll = long long;
using vi = vector<ll>;
const ll mod = 998244353ll;
ll dp[1<<13];
const ll inf =1e9 + 555;
int main() {
	ios::sync_with_stdio(0);
	cout.tie(0);
	cin.tie(0);
	ll n, m;
	cin >> n >> m;
	for(int i = 0; i < 1<<13; i++)
		dp[i] = inf;
	for(ll a, b, t, msk, i = 0; i < m; i++) {
		cin >> a >> b;
		msk = 0;
		while(b--) {
			cin >> t, t--;
			msk |= 1<<t;
		}
		dp[msk] = min(dp[msk], a);
	}
	for(int msk = 0; msk < 1<<n; msk++) {
		for(int j = msk; j;) {
			j = (j-1)&msk;
			dp[j] = min(dp[msk], dp[j]);
		}
	}
	for(int msk = 0; msk < 1<<n; msk++) {
		for(int j = msk; j;) {
			j = (j-1)&msk;
			dp[msk] = min(dp[msk], dp[j] + dp[msk^j]);
		}
	}
	int msk =(1<<n)-1;
	if(dp[msk] == inf)
		dp[msk] = -1;
	cout << dp[msk];
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int a,b;
	cin>>a>>b;
	cout<<max(0,a-2*b);
	return 0;

}

Measured memory_bytes: 3620
#include<iostream>
#include<vector>
#include<string>
#include<stack>
#include<algorithm>
#include<cmath>
#include<map>
#include<utility>//swapでaとbの値を入れ替える
#define rep(i,a,n) for(int i=(a);i<(n);i++)
#define ll long long
#define sort(s) sort(s.begin(),s.end())
#define Yes(a) if(a)cout<<"Yes"<<endl; else cout<<"No"<<endl;
using namespace std;
int aaa(int a, int b) {
	for (int i = 1;; i++) {
		if (i * a > b)return i - 1;
	}
}

int main() {
	string s;
	cin >> s;
	for (int i = 0; i < s.size(); i++) {
		cout << "x";
	}
	cout << endl;
	return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n,m,a,ba=0;
	cin>>n>>m;
	for(int t=1;t<=m;t++)
	{
		cin>>a;
		ba=ba+a;
	}
	if(ba>n)
	{
		cout<<"-1";
	}
	else
	{
		cout<<n-ba;
	}
	return 0;
}

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

using namespace std;

#define REP(i,a,b) for(int i=a;i<(int)b;i++)
#define rep(i,n) REP(i,0,n)
#define all(c) (c).begin(), (c).end()
#define zero(a) memset(a, 0, sizeof a)
#define minus(a) memset(a, -1, sizeof a)
#define watch(a) { std::cout << #a << " = " << a << "\n"; }
template<class T1, class T2> inline bool minimize(T1 &a, T2 b) { return b < a && (a = b, 1); }
template<class T1, class T2> inline bool maximize(T1 &a, T2 b) { return a < b && (a = b, 1); }
template<class T, class V> istream& operator>> (istream& ist, pair<T, V>& p) { return ist >> p.first >> p.second; }
template<class T> ostream& operator<< (ostream& ost, pair<T, T>& p) { return ost << p.first << ", " << p.second; }
template<class T> istream& operator>> (istream& ist, vector<T>& vs) { for(auto& e: vs) ist >> e; return ist; }

typedef long long ll;
int const inf = INT_MAX / 2;

int main() {
  int N; cin >> N;
  cout << pow(N, 3) << endl;
}


Measured memory_bytes: 384
#![allow(unused_imports)]

use text_io::*;
use proconio::*;
use std::collections::*;
use std::process::exit;
use std::cmp::*;
use itertools::Itertools;

fn main() {
    input! {
    a:usize,
    mut b:[usize;a],
    }
    b.sort();
    println!("{}",b[a/2]-b[(a/2)-1])
}

Measured memory_bytes: 3808
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,m,f=0,i,s,c;
	
	cin>>n>>m;
	int ar[n];
	for(i=0;i<n;i++) ar[i]=-1;
	for(i=0;i<m;i++)
	{
		cin>>s>>c;
		if(f) continue;
		if((n>1 && s==1 && c==0) || (ar[s-1]!=-1 && c!=ar[s-1])) f=1;
		else ar[s-1]=c;
	}
	if(f) cout<<"-1\n";
	else 
	{
		if(n>1 && ar[0]==-1) cout<<1; else cout<<max(ar[0],0);
		for(i=1;i<n;i++) cout<<max(ar[i],0);
	}
}

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

int main()
{
  string N;
  cin >> N;
  string ans = "Yes";
  if(N[0] != N[2])
    ans = "No";
  cout << ans << endl;
  return 0;
}

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

int main(void){
    string x;
    cin >> x;

    rep(i, x.size()){
        if(x[i] == '1'){
            cout << "9";
        }else if(x[i] == '9'){
            cout << "1";
        }else{
            cout << "x[i]";
        }
    }

    return 0;
}


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

int main()
{
    long long N, K;
    cin >> N >> K;
    long long ans = 0;
    for(long long i = 0; i < N; i++)
    {
        long long h;
        cin >> h;
        if(h >= K) ans++;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
int main()
{
	int n;
	cin >> n;

	vector<char> cs;
	vector<char> cd;
	cs.reserve(n);
	cd.reserve(n);

	for(int i = 0; i < n; ++i)
	{
		char c;
		int d;
		cin >> c >> d;
		cs.push_back(c);
		cd.push_back(d);
	}
	
	char t[] = {'S', 'H', 'C', 'D'};
	for(int i = 0; i < 4; ++i){
		for(int j = 1; j <= 13; ++j){
			bool isExist = false;
			for(int k = 0; k < n; ++k){
				if( cs[k] == t[i] && cd[k] == j ){
					isExist = true;
					break;
				}
			}
			
			if( !isExist )
				cout << t[i] << " " << j << "\n";
		}
	}	

	return 0;
}

Measured memory_bytes: 1196
import sys,queue,math,copy,itertools,bisect,collections,heapq

def main():
    sys.setrecursionlimit(10**7)
    INF = 10**18
    MOD = 10**9 + 7
    LI = lambda : [int(x) for x in sys.stdin.readline().split()]
    _LI = lambda : [int(x)-1 for x in sys.stdin.readline().split()]
    NI = lambda : int(sys.stdin.readline())
    SI = lambda : sys.stdin.readline().rstrip()

    s = SI()
    cnt = 0
    ans = 0
    for x in s:
        if x == 'R':
            cnt +=1
            ans = max(ans,cnt)
        else: cnt = 0
    print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 68840
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstring>
using namespace std;
unsigned long long n,k;
unsigned long long ans;
int main()
{
	scanf("%llu %llu",&n,&k);
	if(n==k)
	{
		printf("0\n");
		return 0;
	}
	else if(n<k) 
	{
		ans=min(n,k-n);	
		printf("%llu\n",ans);
	}
	else 
	{
		ans=min(n%k,(n/k+1)*k-n);
		printf("%llu\n",ans);
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
// please, read the question correctly (do you need set or multiset)???
const int N=200010; //check the limits, dummy
int a[N];
int n, m, cnt[44];
char s[1000010];
string c[N];
unordered_map<ll, ll> mp1;
ll mp2[5761537], mp3[5761543], mp4[5705543], mp5[5703199];
int main(){
	scanf("%d",&n);
	ll ans=0, mod1=5761455, mod2=5761537, mod3=5761543, mod4=5705543, mod5=5703199;
	for(int i=0; i<n; ++i){
		scanf("%s",s);
		int sz=strlen(s);
		c[i]=s;
		int hsh2=0, hsh1=0, hsh3=0, hsh4=0, hsh5=0;
		for(int j=sz-1; j>=0; --j){
			hsh1*=29;
			hsh1+=s[j]-'a'+1;
			hsh1%=mod1;
			hsh2*=31;
			hsh2+=s[j]-'a'+1;
			hsh2%=mod2;
			hsh3*=37;
			hsh3+=s[j]-'a'+1;
			hsh3%=mod3;
			hsh4*=41;
			hsh4+=s[j]-'a'+1;
			hsh4%=mod4;
			hsh5*=43;
			hsh5+=s[j]-'a'+1;
			hsh5%=mod5;
		}
		++mp1[hsh1];
		++mp2[hsh2];
		++mp3[hsh3];
		++mp4[hsh4];
		++mp5[hsh5];
	}
	for(int i=0; i<n; ++i){
		int sz=c[i].size();
		for(int j=0; j<26; ++j)
			cnt[j]=0;
		for(int j=0; j<sz; ++j){
			++cnt[c[i][j]-'a'];
		}
		ll hsh3=0, hsh4=0, hsh1=0, hsh2=0, tmp1, tmp2, tmp3, tmp4, hsh5=0, tmp5;
		for(int j=sz-1; j>=0; --j){
			for(int k=0; k<26; ++k){
				if(cnt[k]){
					tmp1=hsh1*29;
					tmp1+=k+1;
					tmp1%=mod1;
					tmp2=hsh2*31;
					tmp2+=k+1;
					tmp2%=mod2;
					tmp3=hsh3*37;
					tmp3+=k+1;
					tmp3%=mod3;
					tmp4=hsh4*41;
					tmp4+=k+1;
					tmp4%=mod4;
					tmp5=hsh5*43;
					tmp5+=k+1;
					tmp5%=mod5;
					ans+=min(min(min(mp3[tmp3], mp4[tmp4]),min(mp1[tmp1], mp2[tmp2])), mp5[tmp5]);
				}
			}
			hsh1*=29;
			hsh1+=c[i][j]-'a'+1;
			hsh1%=mod1;
			hsh2*=31;
			hsh2+=c[i][j]-'a'+1;
			hsh2%=mod2;
			hsh3*=37;
			hsh3+=c[i][j]-'a'+1;
			hsh3%=mod3;
			hsh4*=41;
			hsh4+=c[i][j]-'a'+1;
			hsh4%=mod4;
			hsh5*=43;
			hsh5+=c[i][j]-'a'+1;
			hsh5%=mod5;
			--cnt[c[i][j]-'a'];
		}
	}
	ans-=n;
	cout<<ans<<endl;
}


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

int main(){
  long long N;
  cin >> N;
  long long A[N];
  for(long i=0;i<N;i++){
    cin >> A[i];
  }
  sort(A,A+N);
  int j;
  j=0;
  for(long i=0;i<N;i++){
    if(A[i]==A[i+1]){
      j = j+1;
    }
  }
  if(j>0){
    cout << "NO" << endl;
  }else{
    cout << "YES" << endl;
  }
  return 0;
}


Measured memory_bytes: 1792
package main

import (
	"bufio"
	"fmt"
	"os"
)

const Mod = 2019

func main() {
	S := ReadString()
	s := make([]int, len(S)+1)
	base := 1
	c := make([]int, Mod)
	c[0]++
	for i := 0; i < len(S); i++ {
		s[i+1] = s[i] + int(S[len(S)-1-i]-'0')*base
		s[i+1] %= Mod
		c[s[i+1]]++

		base = 10 * base % Mod
	}
	ans := 0
	for i := 0; i < Mod; i++ {
		ans += (c[i] * (c[i] - 1)) / 2
	}
	fmt.Println(ans)
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) []int {
	v := make([]int, n)
	for i := 0; i < n; i++ {
		Scan(&v[i])
	}
	return v
}


Measured memory_bytes: 4884
#include <stdio.h>
int main(void){
  int a,b,c,d;
  scanf("%d %d %d %d",&a,&b,&c,&d);
  int s1 = a * b;
  int s2 = c * d;
  if(s1 > s2){
    s2 = s1;
  }
  printf("%d",s2);
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
using namespace std;
int dp[2][100] = {};
int func(int i, int  j);
int N;
int A[2][100];
int main()
{
  
  cin>>N;

  for(int i = 0;i<2;i++)
  {
    for(int j = 0;j<N;j++)
    {
      cin>>A[i][j];
    }
  }
  
  cout<<func(1,N-1)<<endl;
}

int func(int i, int j)
{
  if(dp[i][j] > 0) return dp[i][j];
  if(i == 0 && j == 0) return A[0][0];
  if(i == 1 & j == 0) return dp[i][j] = A[i][j] + func(i -1, j);
  if(i == 1 && j > 0)
  {
    return dp[i][j] = A[i][j] + max(func(i-1,j), func(i, j -1));
  }
  
  if(i == 0 && j> 0)
  {
    return dp[i][j] = A[i][j] + func(i, j -1);
  }
  
  
}



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

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

#define sz(v) ((int) v.size())
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())

using namespace std;

const int maxn = 1e5 + 10;

int n, m, timer;
int dp[maxn];
vector <int> adj[maxn];

void dfs(int u) {
    for (int v : adj[u]) {
        if (!dp[v]) dfs(v);
        dp[u] = max(dp[u], dp[v] + 1);
    }
}

int main() {
    ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
    cin >> n >> m;
    REP(i, m) {
        int u, v; cin >> u >> v;
        adj[u].push_back(v);
    }
    int answer = 0;
    FOR(i, 1, n) {
        dfs(i);
        answer = max(answer, dp[i]);
    } 
    cout << answer << "\n";
    return 0;
}


Measured memory_bytes: 8192