akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rep2(i, l, r) for (int i = (l); i < (r); i++)
#define ALL(x) (x).begin(), (x).end()     //昇順
#define RALL(x) (x).rbegin(), (x).rend()  // 降順
#define FOR(i, c) \
  \ for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
const long long mod = 1e9 + 7;
typedef long long ll;  // ll とdoubleは違う
typedef priority_queue<int> PQ;
typedef vector<long long> VL;
typedef vector<bool> VB;
typedef vector<int> VI;  // VI a(n);
typedef vector<double> VD;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<VS> VSS;
typedef vector<VC> VCC;
typedef vector<VI> VII;  // VII a(n,vector<int>(m)) n * m
typedef vector<VL> VLL;
typedef vector<VB> VBB;
typedef pair<int, int> PII;
typedef map<int, int> MP;  // MP a;
typedef vector<pair<ll, ll>> PS;

template <class T, class U>  // chmax(max, a);
bool chmax(T &a, U b) {
  if (a <= b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T, class U>  // chmin(min,a)
bool chmin(T &a, U b) {
  if (a > b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T>  // operator << (cout,a);
ostream &operator<<(ostream &os, vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) { os << v[i] << (i < v.size() - 1 ? ", " : ""); }
  os << "}";
  return os;
}


// g++ -std=c++11 prac.cpp

bool func(string s){
  string t(s.rbegin(), s.rend());
  return s==t;
}

int main() {
  ll z=0,k,n,m,h,w,ans=0,sum=0,Max=1,Min=1e9+1;
  double l;
  bool ok = false;
  string s,t,r;
  cin >> l;
  //cout << setprecision(15) << (double)l*l*l/27 << endl;
  double aa = l/3;
  //out << setprecision(15) << (double)aa*aa*aa << endl;
  cout << setprecision(15) << pow(aa,3) << endl;
  return 0;
}

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

using namespace std;
int main(void){
    
   int a, b, d, r;
    double f;
    
    cin >> a >> b;
    
    d = a / b;
    r = a % b;
    f = (double)a / b;
    
    cout << d << " " << r << " ";
    cout << fixed << setprecision(6) << f << endl;
    
    return 0;
}



Measured memory_bytes: 3288
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
const int MAX_N=405;
const LL INF=0x3f3f3f3f3f3f3f3f;
int n;
int a[MAX_N];
LL dp[MAX_N][MAX_N];
LL sum[MAX_N];
int main()
{
	memset(dp,0x3f,sizeof(dp));
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		sum[i]=sum[i-1]+a[i];
		dp[i][i]=0;
	}
	for(int l=2;l<=n;l++)
	{
		for(int i=1;i<=n;i++)
		{
			int j=i+l-1;
			if(j>n)continue;
			for(int m=i;m<j;m++)
			{
				dp[i][j]=min(dp[i][j],dp[i][m]+dp[m+1][j]+sum[j]-sum[i-1]);
			}
		}
	/*	for(int i=1;i<=n;i++)
		{
			for(int j=1;j<=n;j++)
			{
				cout<<(dp[i][j]==INF?-1:dp[i][j])<<" \n"[j==n];
			}
		}*/
	}
	cout<<dp[1][n]<<endl;
	return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pi = pair<int, int>;
using Pld = pair<ld, ld>;
using Vec = vector<ll>;
using VecP = vector<pi>;
using VecB = vector<bool>;
using VecC = vector<char>;
using VecD = vector<ld>;
using VecS = vector<string>;
using Graph = vector<VecP>;
#define REP(i, m, n) for(ll (i) = (m); (i) < (n); ++(i))
#define REPR(i, m, n) for(ll (i) = (m); (i) > (n); --(i))
#define rep(i, n) REP(i, 0, n)
#define R cin>>
#define repr(i, n) REPR(i, n, 0)
#define all(s) (s).begin(), (s).end()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define in(a) insert(a)
#define P(p) cout<<(p)<<endl;
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SORT(a) sort((a).begin(), (a).end())
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<long long int> vll;
typedef vector<string> vs;
void sonic(){ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);}
void setp(const ll n){cout << fixed << setprecision(n);}
const ll INF = 1e9+1;
const ll LINF = 1e18+1;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const ld PI = acos(-1);
const ld EPS = 1e-11;
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;}
template<typename T> void co(T e){cout << e << "\n";}
template<typename T> void co(const vector<T>& v){for(const auto& e : v)
    { cout << e << " "; } cout << "\n";}
ll gcd(ll a, ll b) {
    if (a < b)swap(a, b);
    if (b == 0) return a;
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}
ll lcm(ll a, ll b) {
    ll g = gcd(a, b);
    return a * b / g;
}
bool prime(ll n) {
    for (ll i = 2; i <= sqrt(n); i++) {
        if (n%i == 0)return false;
    }
    return n != 1;
}

Vec fac, finv;

ll PowMod(ll a, ll n){
    if(n == 1) return a;
    if(n%2 == 0) return PowMod(a*a%MOD, n/2);
    return a*PowMod(a*a%MOD, n/2)%MOD;
}

ll combi(ll n, ll k){
    if(k>n) return 0;
    return fac[n]*finv[k]%MOD*finv[n-k]%MOD;
}

int n;
double memo[301][301][301];
double f(int i, int j, int k) {
    if(i + j + k == 0) return 0;
    if(memo[i][j][k] != 0) return memo[i][j][k];
    int s = i + j + k;
    double ret = n;
    if(i) ret += f(i - 1, j, k) * i;
    if(j) ret += f(i + 1, j - 1, k) * j;
    if(k) ret += f(i, j + 1, k - 1) * k;
    memo[i][j][k] = ret/s;
    return ret/s;
}


ll D[50][25];

int main(){
    ll n, ans = 0;
    cin >> n;
    rep(i, n){
        double a;
        cin >> a;
        int cnt1 = 0, cnt2 = 0;
        ll ai = llround(a * 1e9);
        while(ai % 2 == 0){
            ai /= 2;
            cnt1 ++;
        }
        while(ai % 5 == 0){
            ai /= 5;
            cnt2 ++;
        }
        D[cnt1][cnt2]+=1;
    }
    rep(i, 50) rep(j, 25) rep(k, 50) rep(l, 25){
        if(min(i + k, j + l) >= 18){
            if ((i == k) && (j == l)) {
                ans += D[i][j] * (D[k][l] - 1);
            } else {
                ans += D[i][j] * D[k][l];
            }
        }
    }
    co(ans / 2);
}



Measured memory_bytes: 3764
#include <iostream>
#include <vector>
#include <queue>
#include <algorithm>
#include <cmath>
#include <bitset>
#include <iomanip>
#include <stack>
#include <list>
#include <map>
#include <unordered_map>
#include <chrono>
#include <numeric>
using namespace std;
using ll = long long;
const long long INF = (long long)1e18+1;
#define DIV 1000000007
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
#ifdef TEST
    chrono::system_clock::time_point start, end;
    start = chrono::system_clock::now();
#endif
    long idx=0;
    string S;
    cin >> S;
    bool kisuu = true, guusuu = true;
    for(size_t i=1;i<=S.size(); i++)
    {
        if(i % 2 == 0 && S[i-1] == 'R') guusuu = false;
        if(i % 2 == 1 && S[i-1] == 'L') kisuu = false;
    }
    if(kisuu && guusuu) cout << "Yes" << endl;
    else cout << "No" << endl;
#ifdef TEST
    end = chrono::system_clock::now();
    cerr << static_cast<double>(chrono::duration_cast<chrono::microseconds>(end - start).count() / 1000.0) << "[ms]" << endl;
#endif
    return 0;
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

const pid_t pid = getpid();
// Problem Specific Parameter:

int main(void){
	ll n,x;
	cin >> n >> x;
	vector<ll> a(n);
	rep(i,n) cin >> a[i];
	sort(begin(a),end(a));

	rep(i,n){
		if(x < a[i]){
			cout << i << endl;
			return 0;
		}
		x -= a[i];
	}

	cout << ((x == 0) ? n : n-1) << endl;

	return 0;
}

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

using namespace std;

int main()
{
    int n;
    cin >> n;
    for (int i = n; i > 0; --i) {
        double tmp = sqrt((double)i);
        double tmp2;
        double tmp1 = modf(tmp, &tmp2);
        if (tmp1 == 0.0) {
            cout << (int)(tmp2 * tmp2) << endl;
            break;
        }
    }

    return 0;
}

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

typedef int_fast32_t int32;
typedef int_fast64_t int64;

const int32 inf = 1e9+7;
const int32 MOD = 1000000007;
const int64 llinf = 1e18;

#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE\n" : "IMPOSSIBLE\n"  )
#define ANS(n) cout << (n) << "\n"
#define REP(i,n) for(int64 i=0;i<(n);++i)
#define FOR(i,a,b) for(int64 i=(a);i<(b);i++)
#define FORR(i,a,b) for(int64 i=(a);i>=(b);i--)
#define all(obj) (obj).begin(),(obj).end()
#define rall(obj) (obj).rbegin(),(obj).rend()
#define fi first
#define se second
#define pb(a) push_back(a)
typedef pair<int32,int32> pii;
typedef pair<int64,int64> pll;

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  string s;
  cin >> s;
  if((s.size() % 2 == 1 && s.front() == s.back()) || 
      s.size() % 2 == 0 && s.front() != s.back()){
    ANS("Second");
  }else{
    ANS("First");
  }
  return 0;
}

Measured memory_bytes: 3788
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
int main()
{
    long double a, b, c;
    scanf("%Lf %Lf %Lf", &a, &b, &c);
    if((a + b + 2 * (long double)sqrt(b * a)) < c)
            puts("Yes");
    else
        puts("No");
    return 0;
}


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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(int i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 100010

signed main()
{
    string N;
    cin >> N;
    int ans = 0;
    REP(i, N.length()) {
        if(N[i] == '2') { ans++; }
    }
    printf("%lld\n", ans);
    return 0;
}


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

using namespace std;

#define rep(i,n) for(long long i=0; i<(long long)(n);i++)
//rep…「0からn-1まで」の繰り返し
#define rep2(i,s,n) for(long long i=s; i<=(long long)(n);i++)
//rep2…「sからnまで」の繰り返し
#define repr(i,s,n) for(long long i=s;i>=(long long)(n);i--)
//repr…「ｓからnまで」の降順の繰り返し

typedef long long ll;

const ll inf = 1e9+7;
const ll mod = 1e9+7;

int main() {
    vector<vector<int>>c(3,vector<int>(3));
    rep(i,3){
        rep(j,3){
            cin>>c[i][j];
        }
    }

    vector<int>w(2),h(2);
    rep(i,2){
        h[i]=c[i+1][0]-c[i][0];
        w[i]=c[0][i+1]-c[0][i];
    }

    bool jdg;

    rep2(i,1,2){
        rep2(j,0,1){
            if(c[j+1][i]-c[j][i]!=h[j]){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }

    rep2(i,1,2){
        rep2(j,0,1){
            if(c[i][j+1]-c[i][j]!=w[j]){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    cout<<"Yes"<<endl;
}

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

using namespace std;

const int MOD = 1e9 + 7;

int n,i,j,cnt[200005];
vector <int> edge[200005];
long long res;

struct dat{
	long long a, b, c;
};

deque <dat> dp[200005];

long long my_pow(int lv){
	if(lv == 0) return 1LL;
	long long tmp = my_pow(lv / 2);
	tmp = (tmp * tmp) % MOD;
	if(lv & 1)
	tmp = (tmp * 2LL) % MOD;
	return tmp;
}

void pre(int id, int lv){
	cnt[lv]++;
	for(int k = 0; k < edge[id].size(); k++){
		int to = edge[id][k];
		pre(to, lv + 1);
	}
}

void solve(int id, int lv){
	deque <dat> &now = dp[id];
	
	for(int k = 0; k < edge[id].size(); k++){
		int to = edge[id][k];
		solve(to, lv + 1);
		
		if(dp[to].size() > now.size())
		swap(dp[to], now);
	}
	
	int mx = 0;
	
	for(int k = 0; k < edge[id].size(); k++){
		int to = edge[id][k];
		mx = max(mx, (int)dp[to].size());
		for(int ii = 0; ii < dp[to].size(); ii++){
			long long tmpa = (now[ii].a * dp[to][ii].b + now[ii].b * dp[to][ii].a) % MOD;
			long long tmpb = (now[ii].b * dp[to][ii].b) % MOD;
			long long tmpc = (now[ii].a * dp[to][ii].a + now[ii].c * (dp[to][ii].a + dp[to][ii].b)) % MOD;
			now[ii].a = tmpa;
			now[ii].b = tmpb;
			now[ii].c = tmpc;
		}
	}
	
	for(int k = 0; k < mx; k++){
		now[k].b = (now[k].b + now[k].c) % MOD;
		now[k].c = 0LL;
	}
	
	now.push_front({1LL, 1LL, 0LL});
}

int main(){
	scanf("%d", &n);
	
	for(i = 1; i <= n; i++){
		int x;
		scanf("%d", &x);
		edge[x].push_back(i);
	}
	
	pre(0, 0);
	solve(0, 0);
	
	for(i = 0; i < dp[0].size(); i++){
		res = (res + (dp[0][i].a * my_pow(n + 1 - cnt[i])) % MOD) % MOD;
	}
	
	printf("%lld\n", res);
}


Measured memory_bytes: 237172
using System;
using System.Text; 
using System.Collections.Generic;
using System.Linq;

public class Remainder
{
    static char[,] cab;
    static string[] pic;
    static long H;
    static long W;

    static public void Main ()
    {
        var ABC = Console.ReadLine().Split(' ').Select(x => long.Parse(x)).ToArray();
        var A = ABC[0];
        var B = ABC[1];
        var C = ABC[2];
        
        var res =  B+C-A;
        
        if( res >= 0){
            Console.WriteLine(res);
        }else{
            Console.WriteLine(0);
        } 
        

    }
    
    

}


Measured memory_bytes: 13268
#include <stdio.h>

int main(void)
{
	char s1[10],s2[10];
	scanf("%s%s",s1,s2);

	if(s1[0] == s2[0])
		{printf("=\n");}
	if(s1[0] < s2[0])
		{printf("<\n");}
	if(s1[0] > s2[0])
		{printf(">\n");}
	return 0;
}



Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr ll MOD = 1000000007;
#define REP(i, n) for(ll i = 0; i < (n); i++)
#define REP2(i, x, n) for(ll i = x; i < (n); i++)
const long long INF = numeric_limits<long long>::max();
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;
}

ll maps[3][3];
vector<vector<ll>> calcFunc() {

    for(ll a1 = 0; a1 <= 100; ++a1) {
        ll b1 = maps[0][0] - a1;
        if(b1 < 0) continue;

        ll a2 = maps[1][0] - b1;
        if(a2 < 0) continue;
        ll b2 = maps[1][1] - a2;
        if(b2 < 0) continue;

        ll a3 = maps[2][0] - b1;
        if(a3 < 0) continue;
        ll b3 = maps[0][2] - a1;
        if(b3 < 0) continue;

        if(a1 + b2 != maps[0][1]) continue;

        if(a2 + b3 != maps[1][2]) continue;

        if(a3 + b2 != maps[2][1]) continue;
        if(a3 + b3 != maps[2][2]) continue;

        vector<vector<ll>> vec(2);
        vec[0].push_back(a1);
        vec[0].push_back(a2);
        vec[0].push_back(a3);

        vec[1].push_back(b1);
        vec[1].push_back(b2);
        vec[1].push_back(b3);
        return vec;
    }
    return {};
}
bool func() {

    auto vec = calcFunc();
#ifdef SOURCE_TEST

    for(ll i = 0; i < vec.size(); ++i) {
        for(ll j = 0; j < vec[i].size(); ++j) {
            cout << vec[i][j] << " ";
        }
        cout << endl;
    }
#endif
    return vec.size() != 0;
}
int main() {

    for(ll i = 0; i < 3; ++i) {
        for(ll j = 0; j < 3; ++j) {
            cin >> maps[i][j];
        }
    }

    cout << (func() ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define GO ios::sync_with_stdio(0), cin.tie(0), cout.tie(0)
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
const int N = 1e2 + 2;
const int M = 1e3 + 5;
const int Mod = 1e9 + 7;

int n, a[N], b[N];
int G[N][N];

int main()
{
	GO;
	int n, a, b;
	cin >> n >> a >> b;

	cout << (b / n != (a - 1) / n ? "OK" : "NG") << '\n';
	return 0;
}

Measured memory_bytes: 3612
#include <stdio.h>

#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <queue>
#include <map>
#include <set>
#include <string>
#include <vector>

using namespace std;

void __print(int x) { cerr << x; }
void __print(long x) { cerr << x; }
void __print(long long x) { cerr << x; }
void __print(unsigned x) { cerr << x; }
void __print(unsigned long x) { cerr << x; }
void __print(unsigned long long x) { cerr << x; }
void __print(float x) { cerr << x; }
void __print(double x) { cerr << x; }
void __print(long double x) { cerr << x; }
void __print(char x) { cerr << '\'' << x << '\''; }
void __print(const char *x) { cerr << '\"' << x << '\"'; }
void __print(const string &x) { cerr << '\"' << x << '\"'; }
void __print(bool x) { cerr << (x ? "true" : "false"); }

template <typename T, typename V>
void __print(const pair<T, V> &x) {
    cerr << '{';
    __print(x.first);
    cerr << ',';
    __print(x.second);
    cerr << '}';
}
template <typename T>
void __print(const T &x) {
    int f = 0;
    cerr << '{';
    for (auto &i : x) cerr << (f++ ? "," : ""), __print(i);
    cerr << "}";
}
void _print() { cerr << "]\n"; }
template <typename T, typename... V>
void _print(T t, V... v) {
    __print(t);
    if (sizeof...(v)) cerr << ", ";
    _print(v...);
}
#ifdef LOCAL
#define debug(x...)               \
    cerr << "[" << #x << "] = ["; \
    _print(x)
#else
#define debug(x...)
#endif

#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

typedef long long ll;

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

    int N;
    cin >> N;
    ll ans =0;
    for(int i=1; i<N; i++){
        ans+=i;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#pragma warning(disable: 4996)

#include <iostream>
#include <iomanip>
#include <random>
#include <unordered_map>
#include <functional>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <vector>
#include <bitset>
#include <numeric>
#include <string>
#include <set>
#include <tuple>
#include <utility>
#include <regex>
using namespace std;

int main(void) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	long long a, b, k;
	cin >> a >> b >> k;
	
	if (k >= a) {
		k -= a;
		a = 0;
	}
	else {
		a = a - k;
		k = 0;
	}
	if (k >= b) {
		k -= b;
		b = 0;
	}
	else {
		b = b - k;
		k = 0;
	}
	cout << a << " " << b;
	return 0;
}

Measured memory_bytes: 256
// Problem Link: 
// Tutorial Link: 

#include<bits/stdc++.h>
 
using namespace std;
 
#define LL long long
#define ll  long long
#define all(v) v.begin(), v.end()
#define pb push_back
#define pLL pair<LL,LL>
#define ff first
#define ss second
#define rep(i,a,b) for(LL i=a;i<b;++i)
#define repb(i,a,b) for(LL i=a;i>b;--i)
#define ld double
#define mp make_pair
#define vLL vector<LL>
#define vpLL vector<pLL>
#define vld vector<ld>
#define pld pair<ld,ld>
#define vpld vector<pld>
#define SLL set<LL>
#define SpLL set<pLL>
#define FIO ios::sync_with_stdio(false)
#define mod 1000000007

LL n, a[200005], b[200005];
map<LL, LL> m1, m2;

int main()
{
	FIO;
	cin >> n;
	rep(i,1,n+1) cin >> a[i];
	rep(i,1,n+1) cin >> b[i];
	rep(i,1,n+1) m1[a[i]]++;
	rep(i,1,n+1) m2[b[i]]++;

	for(auto& [x, y]: m1) {
		if(y+m2[x] > n) {
			cout << "No\n";
			return 0;
		}
	}
	cout << "Yes\n";
	LL chk = true;
	rep(i,1,n+1) if(a[i] == b[i]) chk = false;
	if(chk == true) {
		rep(i,1,n+1) cout << b[i] << " ";
		return 0;
	}
	reverse(b+1, b+n+1);
	LL idx = n+1;
	rep(i,1,n+1) if(a[i] == b[i]) {
		idx = i;
		break;
	}
	LL c1 = 1, c2 = n;
	if(idx != n+1) rep(i,idx,n+1) {
		if(a[i] != b[i]) continue;
		if(b[c1] != a[i] && a[c1] != b[i]) {
			swap(b[c1], b[i]);
			c1++;
		} 
		else {
			swap(b[c2], b[i]);
			c2--;
		} 
	}
	rep(i,1,n+1) cout << b[i] <<  " ";
}

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

int N;
int A[100000];

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

    cin >> N;

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

    sort(A, A + N);

    int ans = 0;
    int now = 0;
    bool plus = true;
    for(int i = 0; i < N; ++i){
        if(now == A[i]){
            if(plus){
                plus = false;
                ans++;
            }
            else {
                plus = true;
                ans--;
            }
        }
        else {
            now = A[i];
            plus = false;
            ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<climits>
#include<algorithm>
#include<vector>
#include<string>
#include<set>
#include<map>
#include<cassert>
using namespace std;

typedef long long lld;

#define min(x,y) (((x)<(y))?(x):(y))

const lld inf=0x3f3f3f3f3f3f3f3fLL;

int eu[21000], ev[21000], be[21000], nx[21000], num;
lld ec[21000], ef[21000];
int nbs[110], cur[110], dis[110], q[110];

int n, a[110];

void AddEdge(const int &u,const int &v,const lld &cc){
    nx[++num]=nbs[u];nbs[u]=num;be[num]=num+1;
    eu[num]=u;ev[num]=v;ec[num]=cc;ef[num]=0LL;
    nx[++num]=nbs[v];nbs[v]=num;be[num]=num-1;
    eu[num]=v;ev[num]=u;ec[num]=0LL;ef[num]=0LL;
}

int bfs(const int &s,const int &t){
    int head,tail,u,v,i;
    head=tail=0;q[tail++]=s;
    memset(dis,0,sizeof(dis));dis[s]=1;
    while(head<tail)
        for(u=q[head++],i=nbs[u];i;i=nx[i]){v=ev[i];
            if(ec[i]-ef[i]>0LL && !dis[v]){
                dis[v]=dis[u]+1;q[tail++]=v;
                if(v==t)return 1;
            }
        }
    return 0;
}

lld Dinic(const int &s,const int &t){
    lld flow=0LL, tmp;
    int i,u,tail;
    while(bfs(s,t)){
        u=s,tail=0;memcpy(cur,nbs,sizeof(nbs));
        while(cur[s]){
            if(u!=t && cur[u] && ec[cur[u]]-ef[cur[u]]>0LL
                    && dis[u] && dis[u]+1==dis[ev[cur[u]]]){
                q[tail++]=cur[u];u=ev[cur[u]];
            }else if(u==t){
                for(tmp=inf,i=tail-1;i>=0;i--)tmp=min(tmp,ec[q[i]]-ef[q[i]]);
                for(flow+=tmp,i=tail-1;i>=0;i--){
                    ef[q[i]]+=tmp;
                    ef[be[q[i]]]-=tmp;
                    if(!(ec[q[i]]-ef[q[i]]))tail=i;
                }
                u=eu[q[tail]];
            }else{
                while(tail>0 && u!=s && !cur[u])u=eu[q[--tail]];
                cur[u]=nx[cur[u]];
            }
        }
    }
    return flow;
}

void work(){
    /* HEAD_OF_DINIC_INIT */
    memset(nbs, 0, sizeof(nbs)); num=0;
    /* TAIL_OF_DINIC_INIT */
    lld sum=0LL, bad=0LL;
    for(int i=1; i<=n; i++){
        scanf("%d", &a[i]);
        sum+=a[i]*1LL;
    }
    for(int k=1; k<=n; k++){
        if(a[k]>=0)continue;
        bad-=a[k]*1LL;
        AddEdge(0, k, -a[k]*1LL);
        for(int i=k; i<=n; i+=k){
            if(a[i]<=0)continue;
            AddEdge(k, i, inf);
        }
    }
    for(int i=1; i<=n; i++){
        if(a[i]<=0)continue;
        AddEdge(i, n+1, a[i]*1LL);
    }
    assert(num<=20010);
    lld flow=Dinic(0, n+1);
    printf("%lld\n", sum+bad-flow);
    //fprintf(stderr, "sum=%lld dinic=%lld bad=%lld\n", sum, flow, bad);
}

int main(){
    while(scanf("%d", &n)!=EOF)
        work();
    return 0;
}


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

int main()
{
    int n, k, i, a, mx = 0, g = 0;
    cin >> n >> k;
    for(i = 0; i < n; i++)
    {
        cin >> a;
        mx = max(a, mx);
        g = __gcd(g, a);
    }

    if(k%g == 0 && mx >= k)
        cout << "POSSIBLE";
    else
        cout << "IMPOSSIBLE";
}


Measured memory_bytes: 3612
// BEGINNING WITH THE NAME OF ALMIGHTY GOD
// AUTHOR:: MOHAMMAD FAISAL
#include<bits/stdc++.h>
using namespace std;

int main()
{
  int n,m;
  cin >> n >> m;
  
  cout<< (n*(n-1)/2)+(m*(m-1)/2)<<endl;
  return 0;
}

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

using namespace std;

typedef long long ll;
int main() {
    ll n; cin >> n;
    int j = 0;
    stack<char> sk;
    while (n > 0) {
        if(n % 26 == 0) {
            // break;
            sk.push('z');
            n--;
            n /= 26;
            continue;
        }
        j = (n-1) % 26 ;
        // if(j == -1) j = 25;
        sk.push('a' + j);
        n /= 26;
    }
    while (!sk.empty())
    {
        cout << sk.top();
        sk.pop();
    }


}

Measured memory_bytes: 3608
#include <stdio.h>
#include <string.h>

int main (void){

	int number=0;
	int i=0;
	int j=0;
	int input_first[200]={0};
	int input_second[200]={0};
	int input_third[200]={0};
	int check_num=0;
	int result[200]={0};
	int count=0;


	scanf("%d", &number);
	while(i < number){
		
		scanf("%d",&input_first[i]);
		scanf("%d",&input_second[i]);
		scanf("%d",&input_third[i]);
		i++;

	}

	i=0;
	while(i < number){
		j=0;
			check_num = input_first[i];
			while(j < number){	
				if( i == j){
					j++;
					continue;
				}
				if(check_num == input_first[j]){
					input_first[j] = 0;
					input_first[i] = 0;
				}
				j++;
			}

			check_num = input_second[i];
			j=0;
			while(j < number){
				if( i == j){
					j++;
					continue;
				}
				if(check_num == input_second[j]){
					input_second[j] = 0;
					input_second[i] = 0;
				}
				j++;
			}

			check_num = input_third[i];
			j=0;
			while(j < number){
				if( i == j){
					j++;
					continue;
				}
				if(check_num == input_third[j]){
					input_third[j] = 0;
					input_third[i] = 0;
				}
				j++;
			}
	i++;
	}
	for ( i=0; i < number; i++){
		result[i] += input_first[i];
		result[i] += input_second[i];
		result[i] += input_third[i];
	}


	for ( i=0; i < number; i++){
		printf("%d\n",result[i] );
	}




	return 0;
}

Measured memory_bytes: 600
import numpy as np


def InputToInt():
    A = input().split()
    for i in range(len(A)):
        A[i] = int(A[i])
    return A
    
if __name__ == '__main__':
    N = int(input())
    A = InputToInt()

    B = np.argsort(A)+1
    for i in B:
        print(i, end=' ')
    print('')


Measured memory_bytes: 21288
#include<iostream>

#include <vector>
#include <list>
#include<stack>
#include<queue>
#include<array>

#include <set>
#include<map>

#include<string>
#include<stdlib.h>
#include<memory>

#include<algorithm>
#include <functional>
#include<math.h>

#include<fstream>
#include<iomanip>
#include<bitset>

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

#define FOR(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl

constexpr int INF = (1 << 30);
constexpr ll INFL = (1ll << 60);
constexpr ll MOD = 1000000007;// 10^9+7


//変数
ll N,K;
vector<ll> as;
vector<bitset<50>> bs;




//サブ関数
//入力
void input()
{
	cin>>N>>K;
	as.resize(N+1,0);
	REP(i,N)cin>>as[i+1];

	REP(i,N)as[i+1]+=as[i];
	vector<ll> tmps;
	REP(i,N+1)FOR(j,i+1,N+1)tmps.push_back(as[j]-as[i]);
	sort(tmps.begin(),tmps.end());
	for(auto& tmp:tmps)bs.push_back(bitset<50>(tmp));
}

int pos(int num)
{
	return 49-num;
}

vector<bitset<50>> mabiki(vector<bitset<50>> bs, int len)
{
	int cnt=0;
	for(const auto b:bs)if(b[len]==1)cnt++;
	if(cnt<K)return bs;

	vector<bitset<50>> cs;
	for(const auto b:bs)if(b[len]==1)cs.push_back(b);

	return cs;
}


//計算
void calc()
{
	int cnt = 0,len = 49;
	//while((bs.back())[len]==0)len--;

	while(len>-1)
	{
		auto cs = mabiki(bs,len);
		//if(cs.size()==K)break;
		len--;
		bs = cs;
	}
	reverse(bs.begin(),bs.end());
	auto res = bs.front();
	REP(i,K)res&=bs[i];
	cout<<res.to_ullong()<<endl;
}


//出力
void output()
{

}


//デバッグ
void debug()
{
    int N;
    cin>>N;
}


//メイン関数
int main()
{
    input();
    calc();
    output();
    debug();
    
    return 0;
}


Measured memory_bytes: 12144
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vp;
#define rep(i,n) for(ll i = 0; i < ll(n); i++)
#define all(v) v.begin() , v.end()
#define inputv(v,n) rep(i,n){\
    ll x;\
    cin>>x;\
    v.push_back(x);\
    }
const ll INF=99999999999999;
const ll MOD=1000000007;

ll n,q;
vl s,t,x,d;
set<ll> ss;
vector<pair<pair<ll,ll>,ll>> p;

void input(void){
   cin>>n>>q;
   ll a,b,c;
   rep(i,n){
       cin>>a>>b>>c;
       s.push_back(a);
       t.push_back(b);
       x.push_back(c);   
   }
   rep(i,q){
       cin>>a;
       d.push_back(a);
   }
}

void solve(void){
    rep(i,n){
        p.emplace_back(make_pair(s[i]-x[i],0),x[i]);
        p.emplace_back(make_pair(t[i]-x[i],-1),x[i]);
    }
    rep(i,q){
        p.emplace_back(make_pair(d[i],1),0);
    }

    sort(all(p));

    rep(i,n*2+q){
    	//cout<<p[i].first.first<<" "<<p[i].first.second<<" "<<p[i].second<<endl;
        if(p[i].first.second==0){
            ss.insert(p[i].second);
        }
        else if(p[i].first.second==-1){
            ss.erase(p[i].second);
        }
        else{
        	if(!ss.empty()){
            auto op=ss.begin();
            cout<<*op<<endl;
        	}
        	else{
        		cout<<-1<<endl;
        	}
        }
    }
}
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    solve();
}

Measured memory_bytes: 34504
import java.util.*;
import java.io.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        FastScanner sc = new FastScanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();
        System.out.println((b-a)%2 == 0 ? "Alice" : "Borys");
    }
}


class FastScanner {
    private BufferedReader reader = null;
    private StringTokenizer tokenizer = null;
    public FastScanner(InputStream in) {
        reader = new BufferedReader(new InputStreamReader(in));
        tokenizer = null;
    }

    public String next() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                tokenizer = new StringTokenizer(reader.readLine());
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken();
    }

    public String nextLine() {
        if (tokenizer == null || !tokenizer.hasMoreTokens()) {
            try {
                return reader.readLine();
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return tokenizer.nextToken("\n");
    }

    public long nextLong() {
        return Long.parseLong(next());
    }

    public int nextInt() {
        return Integer.parseInt(next());
    }

    public double nextDouble() {
         return Double.parseDouble(next());
    }

    public int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++)
            a[i] = nextInt();
        return a;
    }

    public long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++)
            a[i] = nextLong();
        return a;
    } 
}


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

const Int MAX = 2020;
const Int INF = 1e18;
Int dp[MAX][MAX];

vector<Int> identity(Int n){
  vector<Int> ord(n);
  iota(ord.begin(),ord.end(),0);
  return ord;
}


template<typename ...Ts>
decltype(auto) zip(vector<Ts>... args){
  vector<decltype(make_tuple(args[0]...))> res;
  Int n=min({args.size()...});
  res.reserve(n);
  for(Int i=0;i<n;i++) res.emplace_back(args[i]...);
  return res;
}

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);

  Int n;
  cin>>n;
  vector<Int> as(n);
  for(Int i=0;i<n;i++) cin>>as[i];

  auto ps=zip(as,identity(n));
  sort(ps.begin(),ps.end());

  for(Int i=0;i<MAX;i++)
    for(Int j=0;j<MAX;j++)
      dp[i][j]=-INF;

  for(Int i=0;i<MAX;i++) dp[i][i]=0;

  auto cost=[&](Int x, Int y){return abs(x-y);};
  for(Int w=0;w<n;w++){
    auto [a,k]=ps[w];
    for(Int i=0;i+w<=n;i++){
      if(i+w<n) chmax(dp[i][i+w+1],dp[i][i+w]+a*cost(k,i+w));
      if(i  >0) chmax(dp[i-1][i+w],dp[i][i+w]+a*cost(k,i-1));
    }
  }

  cout<<dp[0][n]<<newl;
  return 0;
}


Measured memory_bytes: 35620
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using Graph= vector<vector<ll>>;
struct edge{ll to ; ll cost ;} ;
using graph =vector<vector<edge>> ;
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
#define fi first
#define se second 
#define set20 cout<<fixed<<setprecision(20) ;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
double pi=acos(-1) ;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
 
 int main(){
  string s ;
  cin>>s ;
  ll k= s.size() ;
  ll ans=0 ;
  rep(i,k){
    ll a= s[i]-'0' ;
    ans+= a ;
  }
  if(ans%9==0)  cout<<"Yes"<<endl ;
  else cout<< "No"<<endl ;
   return 0 ;
 }



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

int main(){
	int a,b,c;
	int ans;
	int cnt=-1;
	
	while(cin>>a>>b){
		cnt++;
		//-----test-----
		if(a<1100) break;
		
		//--------------
		c=a+b;
		ans=1;
		while(10<=c){
			c/=10;
			ans++;
		}
		cout<<ans<<endl;
	}
	
	return 0;
}

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

#define INF 1e9
using namespace std;

int main() {

    int N, K; cin >> N >> K;
    string S; cin >> S;

    string t_S;

    for (int i = 0; i < N; ++i) {
        if (i == K -1) {
            t_S += tolower(S[i]);
        } else {
            t_S += S[i];
        }
    }

    cout << t_S << endl;
}

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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
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;
}
int vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}
struct edge {
  ll to, cost;
};

int D; ll G;
vector<ll> p; vector<ll> c;
ll ans = pow(10, 12);

int main() {
  cin >> D >> G;
  p.resize(D); c.resize(D);
  REP(i, D) cin >> p[i] >> c[i];
  for(int bit = 0; bit < (1 << D); bit++) {
    ll tmp = 0; int res = 0;
    for(int i = 0; i < D; ++i) {
      if(bit & (1 << i)) {
        res += p[i];
        tmp += ((100 * (i + 1)) * p[i] + c[i]);
      }
    }
    if(tmp >= G) {
      if(ans >= res) ans = res; // 答えの更新
      continue;
    }
    // 最も配点の高い問題を1問〜p_i-1問まで試す
    for(int i = D - 1; i >= 0; --i) {
      if(bit & (1 << i)) continue;
      else {
        for(int k = 0; k < p[i]; ++k) {
          tmp += (100 * (i + 1)); res++;
          if(tmp >= G) {
            if(ans >= res) ans = res; // 答えの更新
            break;
          }
        }
        break;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 3576
n = input()
cnt = 1
valid = False

for a, b in zip(n[1:], n):
    if a != b:
        if cnt >= 3:
            break
        else:
            cnt = 1
    else:
        cnt += 1
if cnt >= 3:
    valid = True
if valid is True:
    print("Yes")
else:
    print("No")



Measured memory_bytes: 2940
#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
char s[5];
int main()
{
	scanf("%s",s);
	if(s[0]=='S'&&s[1]=='U') {printf("7");return 0;}
	if(s[0]=='M'&&s[1]=='O') {printf("6");return 0;}
	if(s[0]=='T'&&s[1]=='U') {printf("5");return 0;}
	if(s[0]=='W'&&s[1]=='E') {printf("4");return 0;}
	if(s[0]=='T'&&s[1]=='H') {printf("3");return 0;}
	if(s[0]=='F'&&s[1]=='R') {printf("2");return 0;}
	if(s[0]=='S'&&s[1]=='A') {printf("1");return 0;}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iomanip>
#include <math.h>
#define rep(i,x) for(ll i = 0;i<x;i++)
#define all(a) (a).begin(),(a).end()
using ll = long long;
using ld = long double;
using namespace std;
const ll INF = 1001001001;
const ll mod = 1000000007;
ll gcd(ll a,ll b){
    if(a < b)swap(a,b);
    if(a % b == 0)return b;
    else return gcd(b,a%b);
}
bool isp(ll n){
    bool res = true;
    if(n == 1)return false;
    else{
        for(ll i = 2;i * i <= n;i++){
            if(n % i == 0){
                res = false;
                break;
            }
        }
        return res;
    }
}

int main() {
    ll N,M;
    cin >> N >> M;
    ll ans = 0;
    vector<ll> candy(N);
    rep(i,N)cin >> candy[i];
    if(candy[0] + candy[1] > M){
        if(M - candy[0] < 0){
            ans += candy[0] - M;
            candy[0] -= ans;
        }
    }
    rep(i,N - 1){
        if(candy[i] + candy[i+1]>M){
            ans += candy[i] + candy[i+1] - M;
            candy[i+1] = M - candy[i];
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
typedef long long ll;
int main(){
    ll n,a,b,c,d;
    cin>>n>>a>>b>>c>>d;
    b-=a;
    ll ld=0,lu=0,rd=b+c*(n-1),ru=b+d*(n-1);
    for(int i=0;i<n;i++){
        if(rd<=lu&&ld<=ru){
            cout<<"YES"<<endl;
            return 0;
        }
        ld+=c;
        lu+=d;
        rd-=c;
        ru-=d;
    }
    cout<<"NO"<<endl;
    return 0;
}

Measured memory_bytes: 3616
n,m = map(int,input().split())

Matrix_A = [[] for i in range(n)]
# print("{}".format(Matrix_A))
for i in range(n):
    Matrix_A[i] = list(map(int,input().split()))

Matrix_B = [0 for i in range(m)]
# print(Matrix_B)

for i in range(m):
    Matrix_B[i] = int(input())

result = [[0 for i in range(1)]for i in range(n)]

for i in range(n):
    tmp = 0
    for j in range(m):
        tmp += Matrix_A[i][j] * Matrix_B[j]
    result[i][0] = tmp
for i in range(n):
    print(result[i][0])



Measured memory_bytes: 6040
package main

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

var sc = bufio.NewScanner(os.Stdin)

type Score struct {
	score int
}

func main() {
	var s string
	var Ai int

	if sc.Scan() {
		s = sc.Text()
	}
	ss := strings.Fields(s)
	N, _ := strconv.Atoi(ss[0])
	K, _ := strconv.Atoi(ss[1])
	Q, _ := strconv.Atoi(ss[2])
	Scores := make([]Score, N)
	for i := 1; i <= Q; i++ {
		Ai = Scantext(sc)
		Scores[Ai-1].score++
	}

	for i := 0; i < N; i++ {
		if (Q - Scores[i].score) < K {
			fmt.Println("Yes")
		} else {
			fmt.Println("No")
		}
	}
}

func Scantext(sc *bufio.Scanner) (i int) {
	sc.Scan()
	var s string
	s = sc.Text()
	i, _ = strconv.Atoi(s)
	return i
}


Measured memory_bytes: 3968
#include<bits/stdc++.h>
using namespace std;
int n,arr[3001];
long long int dp[3001][3001][2];
long long int solve(int a,int b,int turn){
	if(a>b){
		return 0;
	}
	if(dp[a][b][turn]==-1){
		if(turn == 1){
			dp[a][b][turn]=max(solve(a+1,b,0)+arr[a],solve(a,b-1,0)+arr[b]);
		}
		else{
			dp[a][b][turn]=min(solve(a+1,b,1)-arr[a],solve(a,b-1,1)-arr[b]);
		}
	}
	return dp[a][b][turn];
}
int main(){
	//freopen("in.txt","r",stdin);
	//freopen("out.txt","w",stdout);
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>arr[i];
	}
	for(int i=0;i<3001;i++){
		for(int j=0;j<3001;j++){
			dp[i][j][0]=-1;
			dp[i][j][1]=-1;
		}
	}
	cout<<solve(0,n-1,1);
	return 0;
}

Measured memory_bytes: 141184
#include <cassert>
#include <algorithm>
#include <cctype>
#include <complex>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <ctime>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <sstream>
#include <tuple>
#include <typeinfo>
#include <unordered_set>
#include <unordered_map>
#include <vector>
using namespace std;

#define REP2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define REPD(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define REP(i, n) REP2(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
#define PB(e) push_back(e)
#define FOREACH(i, c) for(auto i = (c).begin(); i != (c).end(); ++i)
#define MP(a, b) make_pair(a, b)
#define BIT(n, m) (((n) >> (m)) & 1)

typedef long long ll;

template <typename S, typename T> ostream &operator<<(ostream &out, const pair<S, T> &p) {
  out << "(" << p.first << ", " << p.second << ")";
  return out;
}

template <typename T> ostream &operator<<(ostream &out, const vector<T> &v) {
  out << "[";
  REP(i, v.size()){
    if (i > 0) out << ", ";
    out << v[i];
  }
  out << "]";
  return out;
}

int main(int argc, char *argv[]) {
  int N;
  cin >> N;
  vector<ll> A(N);
  vector<ll> DP(N), PREV(N);
  REP(i, N) cin >> A[i];


  REP(i, N) {
    DP[i] = A[i];
    PREV[i] = -1;

    for (int j = i - 2; j >= 0; j -= 2) {
      if (A[i] + DP[j] > DP[i]) {
        DP[i] = A[i] + DP[j];
        PREV[i] = j;
      }
    }
  }
  
  int best_i = 0;
  REP(i, N) {
    if (DP[i] > DP[best_i]) {
      best_i = i;
    }
  }

  vector<int> operations;
  for (int i = N - 1; i > best_i; i--) {
    operations.push_back(i);
  }

  int curr_i = best_i;
  while (PREV[curr_i] >= 0) {
    int prev_i = PREV[curr_i];
    int mid_i = (curr_i + prev_i) / 2;
    int length = curr_i - prev_i;
    int operation_count = (length + 1) / 2;
    REP(i, operation_count) {
      operations.push_back(mid_i - i);
    }
    curr_i = prev_i;
  }
  REP(i, curr_i) {
    operations.push_back(0);
  }
  cout << DP[best_i] << endl;
  cout << operations.size() << endl;
  for (const int i: operations) {
    cout << i + 1 << endl;
  }
}


Measured memory_bytes: 256
import math
A, B, H, M = map(int, input().split(' '))
deg = abs(30 * H + 0.5 * M - 6 * M)
if deg > 180:
    deg = 360 - deg
deg = math.radians(deg)
print(math.sqrt((B - A * math.cos(deg)) ** 2 + (A * math.sin(deg)) ** 2))

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

using namespace std;
using ull = unsigned long long;
using ll = long long;
using lli = long long int;
using ld = long double;
using pa = pair<int, int>;
using ppa = pair<pa, int>;
#define SORT(v, n) sort(v, v + n);
#define ALL(v) v.begin(), v.end()
#define VSORT(v) sort(ALL(v))
#define GRESORT(v) sort(ALL(v), greater<ll>())
#define REVERSE(v) reverse(ALL(v))
#define overlap(v) v.erase(unique(ALL(v)), v.end())
#define debug(x) cout << #x << ": " << x << endl
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)
#define RFOR(i, a, b) for (int i = (b - 1); i >= a; i--)
#define rrep(i, n) RFOR(i, 0, n)
#define INF INT_MAX
#define SUP INT_MIN
#define mins(a, b) a = min(a, b)
#define maxs(a, b) a = max(a, b)

// 4近傍
int dy[]={0, 1, 0, -1};
int dx[]={1, 0, -1, 0};

// 8近傍
// int dy[]={0,0,1,-1,1,1,-1,-1};
// int dx[]={1,-1,0,0,1,-1,1,-1};

// const ll MOD = 1000000007;

ll pow_mod(ll a, ll b, ll mod) {
    ll tmp = 1;
    a %= mod;
    if (b > 0) {
        tmp = pow_mod(a, b / 2, mod);
        if (b % 2)
            tmp = (((tmp * tmp) % mod) * a) % mod;
        else
            tmp = (tmp * tmp) % mod;
    }
    return tmp;
}

void solve() {
    string s; cin >> s;
    int n = s.size();
    rep(i,n){
        if(i==4) cout << " ";
        cout << s[i];
    }
    cout << endl;
}

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

    solve();

    return 0;
}


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

int main()
{
	int n,k;
	cin >> n >> k;
	int ans = k;
	for(int i  =1;i<n;i++)
	{
		ans *= k-1;
	}
	cout<<ans<<endl;
	return 0;
}


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

int main() {
    
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    int a, b, t;
    cin>>a>>b>>t;
    
    cout<<b*(t/a)<<endl;
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin>>n;
    int ar[n];
    for(int x=0; x<n; x++)
    {
        cin>>ar[x];
    }
    int min=1000000000;
    for(int x=1; x<n; x++)
    {
        int s1=0, s2=0;
        for(int y=0; y<x; y++)
        {
            s1=s1+ar[y];
        }
        for(int y=x; y<n; y++)
        {
            s2=s2+ar[y];
        }
        auto nm=abs(s1 - s2);
        
        if(nm<min)
        {
            min=nm;
        }
    }
    cout<<min<<"\n";
    return 0;
}

Measured memory_bytes: 256
<?php

class PQ extends SplPriorityQueue
{
        public function compare($priority1, $priority2)
        {
                if ($priority1 === $priority2) return 0;
                return $priority1 > $priority2 ? -1 : 1;
        }
}

$n=trim(fgets(STDIN));
$m=trim(fgets(STDIN));
$cost=[];
for ($i=0; $i < $m; $i++) {
        list($a,$b,$c,$d)=explode(',',trim(fgets(STDIN)));
        $a--;$b--;
        $cost[$a][$b]=$c;
        $cost[$b][$a]=$d;
}
list($x1,$x2,$y1,$y2)=explode(',',trim(fgets(STDIN)));
$x1--;$x2--;

$y1-=$y2;

$que=new PQ();
$que->insert($x1,0);

$expense=array_fill(0,$n,PHP_INT_MAX/6);
$expense[$x1]=0;

while($que->count()){
        $now=$que->extract();
        if ($now===$x2) {
                break;
        }
        foreach ($cost[$now] as $next => $v) {
                if ($expense[$next]>$expense[$now]+$cost[$now][$next]) {
                        $expense[$next]=$expense[$now]+$cost[$now][$next];
                        $que->insert($next,$expense[$next]);
                }
        }
}

$y1-=$expense[$x2];

$que=new PQ();
$que->insert($x2,0);

$expense=array_fill(0,$n,PHP_INT_MAX/6);
$expense[$x2]=0;

while($que->count()){
        $now=$que->extract();
        if ($now===$x1) {
                break;
        }
        foreach ($cost[$now] as $next => $v) {
                if ($expense[$next]>$expense[$now]+$cost[$now][$next]) {
                        $expense[$next]=$expense[$now]+$cost[$now][$next];
                        $que->insert($next,$expense[$next]);
                }
        }
}

$y1-=$expense[$x1];

echo $y1.PHP_EOL;

Measured memory_bytes: 15328