akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication29
{
    class Program
    {
        static void Main(string[] args)
        {
            string a = Console.ReadLine();
            Console.WriteLine("A{0}C", a[8]);
        }
    }
}


Measured memory_bytes: 2648
import java.util.Scanner;

//Total Time
public class Main{

	void run(){
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt()+sc.nextInt()+sc.nextInt()+sc.nextInt();
		System.out.println(s/60+"\n"+s%60);
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 12000
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <math.h>
using namespace std;
 
int main() {
    int A,B;
    char op;
    cin >> A >> op >> B;
    if(op == '+')
        cout << A+B << endl;
    else if(op == '-')
        cout << A-B << endl;
    else 
         cout << "error" << endl;
}

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

int main() {
	char S[100];
	scanf("%s", S);
	int n = strlen(S);
	for (int i = 0; i < n / 2; i++) 
		if (S[i] != S[n - 1 - i]) {
			printf("No");
			return 0;
		}
	for (int i = 0; i < (n - 1) / 4; i++) 
		if (S[i] != S[(n - 1)/2 - i - 1]) {
			printf("No");
			return 0;
		}
	for (int i = 0; i < (n - 1) / 4; i++) 
		if (S[(n + 3)/2 + i - 1] != S[n - 1 - i]) {
			printf("No");
			return 0;
		}
	printf("Yes");
	return 0;
}

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

int main()
{
  int n,d,x,p[11][11],T[11][100002];

  cin>>n>>d>>x;
  for(int i=0;i<d;i++){
    for(int j=0;j<n;j++)cin>>p[i][j];
  }
  
  for(int k=1;k<d;k++){
    for(int i=0;i<=x;i++)T[0][i]=0;
    for(int i=0;i<n;i++)T[i][0]=0;

    for(int i=0;i<n;i++){
      for(int j=0;j<=x;j++){
        if(j<p[k-1][i]){
	  T[i+1][j]=T[i][j];
	}
	else {
	  T[i+1][j]=max(T[i][j],T[i+1][j-p[k-1][i]]+p[k][i]-p[k-1][i]);
	}
      }
    }
    x=max(T[n][x]+x,x);
  }
  cout<<x<<endl;
  return 0;
}

Measured memory_bytes: 5284
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int> >;
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(int i = m; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
typedef long long ll;
const int INF = 2000000000;
const ll INF64 = 1000000000000000ll;
const ll MOD = 1000000007LL;
//ノート　isupperで大文字の判定　islowerで小文字の判定
int main(){
   int n,k;
   std::cin >> n>>k;
   VEC(double,a,n);
   //sort(all(a),greater<double>());
   rep(i,n){
       a[i]++;
       a[i]/=2.0;
   }
   //rep(i,n)std::cout << a[i] << std::endl;
   double dum=0.0,ans=0.0;
   rep(i,k)dum+=a[i];
   ans=dum;
   
   rep(i,n-k+1){
     //  std::cout << i<<i+k-1 << std::endl;
      //std::cout << dum << std::endl;
       dum-=a[i];
       dum+=a[i+k];
       ans=max(ans,dum);
   }
   std::cout <<keta(10)<< ans << std::endl;
}

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

int main() {
  int N;
  long long a=2, b=1;
  long long ans = 2;
  
  cin >> N;
  if (N==0) cout << 2 << endl;
  else if (N==1) cout << 1 << endl;
  else{
  for (int i = 0;i < N-1; i++){
    ans = a + b;
    a = b;
    b = ans;
    }
  cout << ans << endl;
  }
}


Measured memory_bytes: 3508
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1e9;
const ll MOD = 1000000007;
ll dp[20000][7][2];
int main() {
  string N;
  ll K;
  cin >> N >> K;
  dp[0][0][0] = 1, dp[0][0][1] = 1;
  REP(i, N.size()) {
    if (i != 0) {
      REP(j, 5) {
        dp[i + 1][j + 1][0] += 9 * dp[i][j][0];
        dp[i + 1][j][0] += dp[i][j][0];
      }
    }
    REP(j, 5) {
      if (N[i] == '0') {
        dp[i + 1][j][1] += dp[i][j][1];
      } else {
        dp[i + 1][j][0] += dp[i][j][1];
        dp[i + 1][j + 1][0] += (N[i] - '0' - 1) * dp[i][j][1];
        dp[i + 1][j + 1][1] += dp[i][j][1];
      }
    }
  }
  cout << (dp[N.size()][K][0] + dp[N.size()][K][1]) << endl;
}

Measured memory_bytes: 3640
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#pragma region defins
#define ll long long
#define loop(i,n) for (int i = 0; i < n; i++)
#define loops(i,f,n) for (int i = (f); i < n; i++)
#define INF 100000000000000
#define sort(a) sort(a.begin(),a.end())
#define rsort(a) sort(a.rbegin(),a.rend())
using namespace std;
#pragma endregion
int main()
{
	string s;
	cin >> s;
	if (s.length() == 2)
	{
		if (s[0] == s[1])cout << "1 2" << endl;
		else cout << "-1 -1" << endl;
	}
	else 
	{
	bool ans = false;
	loop(i, s.length() - 2)
	{
		if ((s[i] == s[i + 1] && s[i] != s[i + 2]) || (s[i] == s[i + 2] && s[i] != s[i + 1]) || (s[i + 1] == s[i + 2] && s[i] != s[i + 1]))
		{
			cout << i+1 << " " << i + 3 << endl;
			ans = true;
		}
		if (ans)break;
	}
	if (!ans)cout << "-1 -1" << endl;
	}
}

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

using namespace std;

typedef long long ll;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main()
{
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
    string str;
    cin>>str;
    if(str=="Sunny")
        cout<<"Cloudy"<<endl;
    else if(str=="Cloudy")
        cout<<"Rainy"<<endl;
    else
        cout<<"Sunny"<<endl;
    return 0;
}


Measured memory_bytes: 256
import fractions
from functools import reduce
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N,X = map(int, input().split())
x = list(map(int, input().split()))
for i in range(N):
  x[i] = abs(x[i] - X)

print(gcd_list(x))

Measured memory_bytes: 16280
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <bitset>
#include <climits>
#define REP(i,n) for (int i=0;i<(n);i++)
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RFOR(i,a,b) for (int i=(a)-1;i>=(b);i--)
#define ll long long
#define ull unsigned long long
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
const int INF = 1e9;
const int MOD = 1e9 + 7;

using namespace std;
const int MAX = (1LL << 31) - 1LL;
const int MAX_N = (1 << 17)+1;
struct RUQ{
	int n;
	int datx[MAX_N*2 - 1];
	int datc[MAX_N*2 - 1];
	//n?????????????????¨?????¨????????????
	void init(int n_){
		n = 1;
		while(n<n_)n*=2;//n????????????????????§????????¨update????????°???
		REP(i,2*n-1)datx[i] = MAX;
		REP(i,2*n-1)datc[i] = -1;
	}
	//[a,b)?????????x????????´(c)
	void update(int a,int b,int x,int c,int k,int l,int r){
		if(r <= a || b <= l)return;
		if(a <= l && b >= r){
			datx[k] = x;
			datc[k] = c;
		}else{
			update(a,b,x,c,k*2+1,l,(l+r)/2);
			update(a,b,x,c,k*2+2,(l+r)/2,r);
		}
	}
	//a[i]?????????
	int query(int i){
		i += n-1;
		int c = -1;
		int x = MAX;
		while(true){
			if(datc[i] > c){
				x = datx[i];
				c = datc[i];
			}
			if(i == 0)break;//?????????i??¨i==0????§???????????????????
			i = (i-1)/2;
		}
		return x;
	}
};


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
	int n,q;
	cin >> n >> q;
	RUQ ruq;ruq.init(n);
	REP(i,q){
		int q;
		cin >> q;
		if(q){
			int j;cin >>j;
			cout << ruq.query(j) << endl;
		}else{
			int a,b,x;
			cin >> a>>b>>x;
			b++;
			ruq.update(a,b,x,i,0,0,ruq.n);
		}
	}
  return 0;
}

Measured memory_bytes: 5220
#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
#include <queue>
#include <cassert>
using namespace std;

int arr[15][15];
int t[15][15];

int main() {
	int n, m;
	cin >> n >> m;
	for (int i=0; i<n; ++i) {
		for (int j=0; j<n; ++j) {
			assert(i < 15 && j < 15);
			cin >> arr[i][j];
		}
	}
	int o;
	for (int i=0; i<m; ++i) {
		cin >> o;
		int r, c, size, angle;
		if (o == 0) {
			cin >> r >> c >> size >> angle;
			--r, --c;
			if (angle == 0 || angle == 360) {
				// pass
			} else if (angle == 90) {
				memcpy(t, arr, sizeof t);
				for (int j=0; j<size; ++j) {
					for (int k=0; k<size; ++k) {
						assert(r+j < 15 && c+k < 15);
						assert(0 <= r+j && 0 <= c+k);
						assert(r+size-1-k < 15 && c+j < 15);
						assert(0 <= r+size-1-k && 0 <= c+j);
						arr[r+j][c+k] = t[r+size-1-k][c+j];
					}
				}
			} else if (angle == 180) {
				memcpy(t, arr, sizeof t);
				for (int j=0; j<size; ++j) {
					for (int k=0; k<size; ++k) {
						assert(r+j < 15 && c+k < 15);
						assert(r+size-1-j < 15 && c+size-1-k < 15);
						arr[r+j][c+k] = t[r+size-1-j][c+size-1-k];
					}
				}
			} else if (angle == 270) {
				memcpy(t, arr, sizeof t);
				for (int j=0; j<size; ++j) {
					for (int k=0; k<size; ++k) {
						assert(r+j < 15 && c+k < 15);
						assert(r+k < 15 && c+size-1-j < 15);
						arr[r+j][c+k] = t[r+k][c+size-1-j];
					}
				}
			}
		} else if (o == 1) {
			cin >> r >> c >> size;
			--r, --c;
			for (int j=r; j<r+size; ++j) {
				for (int k=c; k<c+size; ++k) {
					arr[j][k] = 1 - arr[j][k];
				}
			}
		} else if (o == 2) {
			cin >> r;
			--r;
			rotate(arr[r], arr[r]+1, arr[r]+n);
		} else if (o == 3) {
			cin >> r;
			--r;
			rotate(arr[r], arr[r]+n-1, arr[r]+n);
		} else {
			cin >> r >> c;
			--r, --c;
			queue<pair<int,int> > q;
			q.push(make_pair(r, c));
			int v = 1 - arr[r][c];
			while ( ! q.empty()) {
				int nr = q.front().first;
				int nc = q.front().second;
				q.pop();
				if (arr[nr][nc] == v) continue;
				arr[nr][nc] = v;
				if (nr+1 < n) q.push(make_pair(nr+1, nc));
				if (0 <= nr-1) q.push(make_pair(nr-1, nc));
				if (nc+1 < n) q.push(make_pair(nr, nc+1));
				if (0 <= nc-1) q.push(make_pair(nr, nc-1));
			}
		}
	}
	for (int i=0; i<n; ++i) {
		for (int j=0; j<n; ++j) {
			cout << (j == 0 ? "" : " ") << arr[i][j];
		}
		cout << endl;
	}
	return 0;
}

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

#define rep(i, N) for (ll i = 0; i < N; i++)
#define rep1(i, N) for (ll i = 1; i <= N; i++)
#define repr(i, N) for (ll i = N-1; i >= 0; i--)
#define repr1(i, N) for (ll i = N; i > 0; i--)

#define MOD 1000000007

using ll = long long;
using namespace std;

typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<P> vpi;
typedef pair<ll,ll> Pl;
typedef vector<ll> vl;
typedef vector<Pl> vpl;

ll gcd(ll a, ll b){
    if(a < b) swap(a, b);
    if(b <= 0) return -1;
    ll r = a % b;
    while(r != 0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

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


int main() {
    ll a,b,c;
    cin >> a>>b>>c;

    if(4*a*b < (c-a-b)*(c-a-b) && c-a-b > 0) cout << "Yes";
    else cout << "No";
    
    //std::cout << ans;
    //printf("%.8lf", ans);
    cout << "\n";
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long double PI = acos(-1);
typedef long long ll;
typedef pair<int64_t,int64_t> pll;
int dx[]={1,-1,0,0,1,-1,1,-1};
int dy[]={0,0,1,-1,1,-1,-1,1};
#define INF (2147483647)
#define mod (1000000007)
#define limit (7368791)
#define rep(i,a,b) for (int64_t i = (a); i < (b); i++)
#define REP(i,n) rep(i,0,n)
#define ALL(a) begin(a),end(a)
#define sz(s) (s).size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second

bool IsPrime(ll num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; 

    double sqrtNum = sqrt(num);
    for (ll i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }

    return true;
}

void solve(){
    ll n;cin>>n;ll nn; 
    ll ans=1;
    for(int i=2;i<1001;i++){
        if(!IsPrime(i))continue;
        nn=n;
        int count=1;
        while(nn){
            count+=nn/i;
            nn/=i;
        }
        ans*=count;
        ans%=mod;
    }
    cout<<ans<<endl;
}
int main()
{
    cin.tie(0);
	ios::sync_with_stdio(false);
    solve();
    return 0;
}


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

int main() {
    int N, M;
    cin >> N >> M;
    map<int, int> mp;
    rep(i, M) {
        int a, b;
        cin >> a >> b;

        if (mp.count(a)) mp[a]++;
        else mp[a] = 1;

        if (mp.count(b)) mp[b]++;
        else mp[b] = 1;
    }

    bool f=true;
    for (auto & m : mp) {
        if (m.second%2) {
            f=false;
            break;
        }
    }

    cout << (f ? "YES" : "NO") << endl;
}


Measured memory_bytes: 4352
#include<stdio.h>
int main(){
int a,b,c,H,W;
while(1){
scanf("%d %d",&H,&W);
if(H==0&&W==0)
break;
for(a=0;a<H;a++){
for(b=0;b<W;b++){
printf("#");
}
printf("\n");
}
printf("\n");
}
return 0;
}

Measured memory_bytes: 572
#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD 1000000007
#define MOD2 998244353
#define MOD3 1000000009
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
ifstream cinn("ride.in");ofstream coutt("ride.out");
int poww(const int &a,int b,const int &m=MOD){if(b==0)return 1;int x=poww(a,b/2,m);x=x*x%m;if(b&1)x=x*a%m;return x;}
int ceil(const int &a,const int &b){return (a+b-1)/b;}
////Read:
//Check corner cases, n==1;
//
////Some function:
//__builtin_popcountll(), 


signed main(){
    FASTER;
    int n;cin>>n;
    map<string,int> mp;
    while(n--){
        string s;cin>>s;
        mp[s]++;
    }
    cout<<"AC x "<<mp["AC"]<<"\n";
    cout<<"WA x "<<mp["WA"]<<"\n";
    cout<<"TLE x "<<mp["TLE"]<<"\n";
    cout<<"RE x "<<mp["RE"]<<"\n";
}

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

int main(){
  string s;
  cin >> s;
  int ans = 700;
  rep(i,3){
    if(s[i] == 'o') ans += 100;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <complex>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <iomanip>
#include <assert.h>
#include <array>
#include <cstdio>
#include <cstring>
#include <random>
#include <functional>
#include <numeric>
#include <bitset>
#include <fstream>

using namespace std;

struct before_main{before_main(){cin.tie(0); ios::sync_with_stdio(false);}} before_main;

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

typedef long long ll;
int const inf = 1<<29;

int N;
map<string, int> id;
bool adjacent[41][41];
int weight[41], wes[41];
int ans;

void dfs(ll S, int wsum, int curr) {
  ans = max(ans, wsum);
  if(wsum + wes[N-1] - (curr ? wes[curr-1] : 0) <= ans) return;
  if(curr == N-1) return;
  const int next = curr + 1;
  dfs(S, wsum, next);
  rep(k, next) if(adjacent[next][k] && (S >> k & 1)) return;
  dfs(S|(1LL<<next), wsum + weight[next], next);
}

int main() {

  while(cin >> N && N) {
    rep(i, 41) weight[i] = 0;
    rep(i, 41) rep(j, 41) adjacent[i][j] = 0;
    id.clear();
    int v = 0;

    rep(i, N) {
      string s; cin >> s;
      if(id.find(s) == id.end()) id[s] = v++;
      cin >> weight[id[s]];
      int n; cin >> n;
      rep(_, n) {
        string t; cin >> t;
        if(id.find(t) == id.end()) id[t] = v++;
        adjacent[id[s]][id[t]] = 1;
      }
    }

    rep(i, N) wes[i] = weight[i] + (i ? wes[i-1] : 0);

    ans = 0;
    dfs(1LL<<0, weight[0], 0);

    cout << ans << endl;

  }
  
  return 0;
}

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

#define rep(i, a, b) for (int i = a; i < (int)(b); ++i)
#define rrep(i, a, b) for (int i = b - 1; i >= (int)(a); --i)

using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;

constexpr int MOD = 1000000007;

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

    int n;
    cin >> n;

    vector<double> p(n);
    rep(i, 0, n) { cin >> p[i]; }

    vector<vector<double>> dp(n, vector<double>(n + 1, 0));
    dp[0][1] = p[0];
    dp[0][0] = 1 - p[0];

    rep(i, 1, n) {
        rep(j, 0, i + 2) {
            if (j == 0) {
                dp[i][j] = dp[i - 1][j] * (1 - p[i]);
            } else {
                dp[i][j] = p[i] * dp[i - 1][j - 1] + (1 - p[i]) * dp[i - 1][j];
            }
        }
    }

    double ans = 0;
    rep(i, (n + 1) / 2, n + 1) { ans += dp[n - 1][i]; }
    printf("%.10f\n", ans);
    return 0;
}

Measured memory_bytes: 70784
#include<cstdio>
#include<cmath>
#include<string>
#include<iostream>
#include<algorithm>
#include<utility>
#include<vector>
#include<map>
#include<set>
#include<limits>
#include<bitset>
#include<array>
#include<numeric>
#include<iomanip>
#include<functional>

using namespace std;
typedef long long int ll;

#define C(I) cout<<(I)<<endl

ll n,m,a,b,c,x,y,z,aa[100010],ba[100010];
bool r,ra,rb,rc;
string s,sa,sb,sc;
char ca,cb,cc;
vector<ll> va,vb,vc;
set<int> sta;

int dsm(int target){
    int sum=0;
    while(target){
        sum+=target%10;
        target/=10;
    }
    return sum;
}

int main(){
    cin>>n>>a>>b;
    m=0;
    
    for(int i=1;i<=n;i++){
        z=dsm(i);
        if(a<=z and z<=b)m+=i;
    }
    C(m);
    
}

Measured memory_bytes: 256
import qualified Data.List as List
import Data.Ord

main :: IO ()
main = do
  n <- readLn
  xs <- map read . words <$> getLine
  print $ solve n xs

solve :: Int -> [Int] -> Int
solve n xs =
  let
    xs' = List.sortBy (flip compare) xs
    makePair [] = []
    makePair (x:y:ys) = y : makePair ys
  in
    sum . take n $ makePair xs'

Measured memory_bytes: 119164
/**
 *    author:  FromDihPout
 *    created: 2020-09-13
**/

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

const int MOD = 1e9 + 7;

long long expo(int b, int e) {
	if (e == 0) return 1;
	long long power = expo(b, e / 2);
	if (e % 2 == 0) {
		return (power * power) % MOD;
	}
	else {
		return (((power * power) % MOD) * b) % MOD;
	}
}

int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	
	long long n;
	cin >> n;
	if (n == 1) {
		cout << 0 << '\n';
		return 0;
	}

	long long ans = (expo(10, n) - 2 * expo(9, n) + expo(8, n));
	ans = ((ans % MOD) + MOD) % MOD;
	cout << ans << '\n';
	return 0;	
}


Measured memory_bytes: 3648
import bisect
n = int(input())
l = list(map(int, input().split()))
count = 0
l.sort(reverse = False)
for i in range(len(l)-1, 1, -1):
  for j in range(i-1, 0, -1):
    pt = bisect.bisect_right(l, l[i] - l[j])
    count += max(j - pt, 0)
print(count)



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

#define REP(i, n) for(int i=0; i<n;i++)
#define REPR(i, n) for(int i=n-1 ; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)

#define INF 2e9
#define ll long long

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

    int d[n];
    REP(i, n){
        cin>>d[i];
    }
    sort(d, d+n);
    int k, ans = 0;
    int i, j;
    int mae = d[(n-2)/2];
    int ato = d[n/2];

    cout<<ato-mae<<endl;
    return 0;
}

Measured memory_bytes: 640
import std.stdio, std.algorithm;

void main() {
  for(int t; readf("%d\n", &t), t != 0;) {
    int[] dp = new int[](t);
    int ans = int.min;
    for(int n, i = 0; i < t; i++) {
      readf("%d\n", &n);
      if (i == 0) dp[i] = n;
      else dp[i] = max(n + dp[i - 1], n);
      ans = max(ans, dp[i]);
    }
    writeln(ans);
  }
}

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

using namespace std;

int main(int argc, char* argv[]) {
  int N;
  cin >> N;
  int div = int(log2(N));

  int res = 1;
  for (int i = 0; i < div; ++i)
    res *= 2;

  cout << res << endl;

  return 0;
}

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

typedef long long ll;
typedef long double ld;

#define imx INT_MAX
#define imn INT_MIN
#define llmx LLONG_MAX
#define llmn LLONG_MIN

#define fi first
#define se second
#define pb push_back


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	string s;
	cin>>s;
	vector<int> r, g, b;
	for(int i = 0; i < n; i++)
	{
		if(s[i]=='R')
		{
			r.pb(i);
		}
		if(s[i]=='G')
			g.pb(i);
		if(s[i]=='B') b.pb(i);
	}
	ll sum=0;
	int ct=0;
	int s1=r.size(), s2=g.size(), s3=b.size();
	// cout<<"s3 "<<s3<<endl;
	for(int i = 0; i < s1; i++)
	{

		for(int j = 0; j < s2; j++)
		{
			ct=0;
			int ind1 = 2*g[j]-r[i];
			int ind2 = (g[j]+r[i])/2;
			int ind3 = 2*r[i]-g[j];

			// cout<<"ind1 "<<ind1<<" ind2 "<<ind2<<" ind3 "<<ind3<<endl;
			if(binary_search(b.begin(), b.end(), ind1)) ct++;
			if((g[j]+r[i])%2==0)
				if(binary_search(b.begin(), b.end(), ind2)) ct++;
			if(binary_search(b.begin(), b.end(), ind3)) ct++;
			// cout<<"ct "<<ct<<endl;
			sum+=ll(max(s3-ct, 0));
			// sum
			// cout<<"sum "<<sum<<endl;
		}
	}
	cout<<sum<<endl;
	// int n;
	// cin>>n;
}

Measured memory_bytes: 3688
#include <bits/stdc++.h>
using namespace std;
const int INF = 1001001001;


int main() {
int64_t N;
cin >> N;
int a = N;
int64_t ans = 0;
while(a > 0) {
    ans += a %10;
    a /= 10;
}
if (N % ans == 0) cout << "Yes" << endl;
else cout << "No" << endl;


return 0;
}


Measured memory_bytes: 256
//om nama sivaya
#include<bits/stdc++.h>
#define M 1000000007
#define ll long long
using namespace std;
void solve(){
    int n;
    cin>>n;
    if(n>=400 && n<=599){
        cout<<"8";
    }
    else if(n<=799){
        cout<<"7";
    }
    else if(n<=999){
        cout<<"6";
    }
    else if(n<=1199){
        cout<<"5";
    }
    else if(n<=1399){
        cout<<"4";
    }
    else if(n<=1599){
        cout<<"3";
    }else if(n<=1799){
        cout<<"2";
    }else if(n<=1999){
       cout<<"1"; 
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int t=1;
    //cin>>t;
    while(t--){
        solve();
    }
}

Measured memory_bytes: 3684
#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
	int x;
	cin >> x;
	int ans = 8;
	for (int i = 400; i < 2000; i += 200) {
		if (i <= x && i + 200 > x) {
			cout << ans << endl;
			return 0;
		}
		ans--;
	}
	return 0;
}

Measured memory_bytes: 3632
// Problem : C - XYZ Triplets
// Contest : AtCoder - AIsing Programming Contest 2020
// URL : https://atcoder.jp/contests/aising2020/tasks/aising2020_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pb push_back
#define all(x) begin(x),end(x)

int mod = 1e9+7;
int inf = 4e18;
const int N = 5e5+5;

int give(int x,int y,int z)
{
	return (x*x+y*y+z*z+x*y+y*z+z*x);
}		
signed main()
{
    io
    int tt = 1;
    //cin>>tt;
    while(tt--)
    {
		int n;
		cin>>n;
		vector<int> v;
		for(int i=1;i<=100;++i)
		{
			for(int j=1;j<=100;++j)
			{
				for(int k=1;k<=100;++k)
				{
					v.pb(give(i,j,k));
				}
			}
		}
		map<int,int> mp;
		for(int i:v)
		mp[i]++;
		for(int i=1;i<=n;++i)
		cout<<mp[i]<<"\n";		
    }
    return 0;
}


Measured memory_bytes: 13288
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();

        int digit_100 = N / 100;
        int digit_10 = (N / 10) % 10;
        int digit_1 = N % 10;

        int ans = 0;
        if (digit_100 >= digit_10 && digit_100 >= digit_1) {
            ans = 111*digit_100;
        } else  {
            ans = 111*(digit_100+1);
        }

        System.out.println(ans);

    }
}

Measured memory_bytes: 22996
// ARC087C.cpp
#include <bits/stdc++.h>

using namespace std;

const int MAX_N = 1e5 + 200;

int n;
map<int, int> mp;

int main()
{
    scanf("%d", &n);
    for (int i = 1, x; i <= n; i++)
        scanf("%d", &x), mp[x]++;
    long long ans = 0;
    for (auto x : mp)
        if (x.first > x.second)
            ans += x.second;
        else if (x.first < x.second)
            ans += x.second - x.first;
    printf("%d\n", ans);
    return 0;
}

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

int main() {
    string s;
    cin >> s;

    int a, z;
    for (int i = 0; i < s.size(); ++i) {
        if (s[i] == 'A') {
            a = i;
            break;
        }
    }
    for (int i = s.size() - 1; i >= 0; --i) {
        if (s[i] == 'Z') {
            z = i;
            break;
        }
    }

    cout << z - a + 1 << endl;
}

Measured memory_bytes: 640
package main

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

func main() {
	sc := NewScanner()
	N := sc.NextInt()
	if N < 1000 {
		fmt.Printf("ABC\n")
	} else {
		fmt.Printf("ABD\n")
	}
}

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

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

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

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

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

	return mp
}

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


Measured memory_bytes: 640
def slove():
    import sys
    input = sys.stdin.readline
    a, b, c, d, e, f = list(map(int, input().rstrip('\n').split()))
    abcd = 0
    cd = 0
    md = 0
    for ai in range(0, f + 1, a * 100):
        for bi in range(0, f + 1, b * 100):
            for ci in range(0, f + 1, c):
                for di in range(0, f + 1, d):
                    if 0 < ai + bi + ci + di <= f:
                        if ai + bi != 0:
                            if md < (ci + di) / (ai + bi + ci + di) <= e / (100 + e):
                                md = (ci + di) / (ai + bi + ci + di)
                                abcd = ai + bi + ci + di
                                cd = ci + di
                    else:
                        break
    print(abcd if abcd != 0 else a * 100, cd)


if __name__ == '__main__':
    slove()


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

int main()
{
    int q,h,s,d,n;
    scanf("%d%d%d%d%d",&q,&h,&s,&d,&n);
    if(q*2<h) h = q*2;
    if(h*2<s) s = h*2;
    if(s*2<d) d = s*2;
    long long ans = 1LL*(n/2)*d + (n&1)*s;
    printf("%lld\n",ans);

}


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

int main() {
	int x=0,g=0,p=0,r=0;
	string s;
	cin >> s;

	rep(i,s.size())
		if(s.at(i) == 'p')
			++x;
	
	rep(i,s.size()) {
		int t=s.size()-1-i;

		if(s.at(t) == 'p') {
			if(p < g)
				++p;
			else
				++g, --r;
			--x;
		} else {
			if(g-p > x)
				++p, ++r;
			else
				++g;
		}
	}

	cout << r << endl;
}

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

struct node
{long long v; struct node *next;};

struct node *z;

void visit(long long k,  struct node **adj, long long &time, long long d[], long long f[]){
    struct node *t;
    d[k] = ++time;
    for(t = adj[k]; t != z; t = t -> next){
        if(d[t -> v] == 0) visit(t -> v, adj, time, d, f);
    }
    f[k] = ++time;
}
void search(long long V, struct node **adj, long long &time, long long d[], long long f[]){
    long long k;
    for(k = 1; k <= V; k++) d[k] = 0;
    for(k = 1; k <= V; k++){
        if(d[k] == 0) visit(k, adj, time, d, f);
    }
}

int main(){

    //adjacency list representation
    long long V, E;
    cin >> V;
    struct node *adj[V + 1];
    long j, k, x, y[V + 1];
    struct node *t;
    z = new node;
    z -> next = z;
    for(j = 1; j <= V; j++) adj[j] = z;
    for(j = 1; j <= V; j++){
        cin >> x >> E;
        for(k = 1; k <= E; k++){
            cin >> y[k];
        }
        for(k = E; k >= 1; k--){
            t = new node;
            t -> v = y[k];
            t -> next = adj[x];
            adj[x] = t;
        }
    }

    //depth first search
    long long time = 0;
    long long d[V + 1];
    long long f[V + 1];
    search(V, adj, time, d, f);
    for(j = 1; j <= V; j++){
        cout << j << " " << d[j] << " " << f[j] << endl;
    }
    return 0;
}


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

int main() {
	ios::sync_with_stdio(0);cin.tie(0);
	int n;
	cin >> n;
	double sum = 0;
	for(int i=0; i<n; i++) {
		int t;
		cin >> t;
		sum += 1.0/t;
	}
	cout << fixed << setprecision(10) << 1/sum;
}

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

  if (x < 100) printf ("0");
  else if (x >= 2000) printf ("1");
  else {
    a = x / 100;
    b = a * 100;
    a = a * 5;

    if (x <= b + a) printf ("1");
    else printf ("0");
  }

  return 0;
}


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

using namespace std;

typedef long long          ll;
typedef unsigned long long ull;
typedef vector<int>         vi;
typedef vector<bool>       vb;
typedef map<int, int>      mii;
typedef pair<int, int>     ii;

#define INF                0x3f3f3f3f
#define INFLL              0x3f3f3f3f3f3f3f3f
#define each(x, s)         for(auto& x : s)
#define loop(x)            for(int i = 0;i < x;i++)
#define vloop(v, x)        for(int v = 0;v < x;v++)
#define avg(l, r)          l + (r - l) / 2
#define iter(a)            a.begin(), a.end()
#define riter(a)           a.rbegin(), a.rend()
#define endl               "\n"

const ll mod = 1000000007;

vi id, sz;
void init(int n) {
  id.resize(n);
  sz.resize(n, 1);
  loop(n) id[i] = i;
}

int find(int x) { return x == id[x] ? x : id[x] = find(id[x]); }

bool join(int a, int b) {
  a = find(a);
  b = find(b);
  if (a == b) return false;
  if (sz[a] > sz[b]) swap(a, b);
  id[a] = id[b];
  sz[b] += sz[a];
  return true;
}

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

  int n, m;
  cin >> n >> m;
  int a, b, ans = n - 1;
  init(n);
  loop(m) {
    cin >> a >> b;
    a--, b--;
    if (join(a, b)) ans--;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 3904
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.format;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;

alias sread = () => readln.chomp();
alias Point2 = Tuple!(long, "y", long, "x");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void minAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) min(dst, src);
}

void maxAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) max(dst, src);
}

enum MOD = (10 ^^ 9) + 7;

void main()
{
    long N = lread();
    auto A = aryread();
    long[long] D;
    long[] list;
    foreach (a; A)
    {
        if (a !in D)
        {
            D[a] = 1;
        }
        else if (D[a] == 1)
        {
            list ~= a;
            D[a]++;
        }
        else
        {
            D[a]++;
        }
    }
    list.sort!"b<a"();
    // writeln(list);
    // writeln(D);
    if (0 < list.length && 4 <= D[list[0]])
    {
        writeln(list[0] ^^ 2);
    }
    else if (list.length < 2)
    {
        writeln(0);
    }
    else
    {
        writeln(list[0] * list[1]);

    }
}


Measured memory_bytes: 9780
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder.Abc
{
    //https://atcoder.jp/contests/abc141/tasks/abc141_a
    public class QuestionA
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            // 整数の入力
            int n = int.Parse(Console.ReadLine());

            int result = n + n*n + n*n*n;

            Console.WriteLine(result);

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 27348
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>
#define endl '\n'
#define ll long long
#define mod 1000000007
#define NCONS 1000000000
//#define NCONS 100001
//#define NCONS 1001
//#define NCONS 101
#define MCONS 2001
#define LIMIT 1000000000
#define TRUE 1
#define FALSE 0
#define toRadian(degree) ((degree) * (M_PI / 180.))
#define toDegree(radian) ((radian) * (180. / M_PI))
using namespace std;

ll N;

bool prime(ll n)
{
    if(n <= 1) return false;
    if(n == 2) return true;
    for(ll i = 2; i * i <= n; i++)
        if(n % i == 0) return false;
    return true;
}

ll factor(ll n, ll p)
{
    ll ret = 0;
    while(n % p == 0)
    {
        ret += 1;
        n /= p;
    }
    
    
    return ret;
}

vector<ll>p;

int main(void)
{
    cin.tie(NULL); ios_base::sync_with_stdio(false);
    ll N; cin >> N;
    for(ll i = 1; i <= N; i++)
        if(prime(i))
            p.push_back(i);
    
    auto k = new ll[p.size()]();
    
    for(ll n = 1; n <= N; n++)
    {
        for(int i = 0; i < p.size(); i++)
        {
            k[i] += factor(n, p[i]);
        }
    }
    
    
    ll ret = 1;
    for(int i = 0; i < p.size(); i++)
    {
        ret *= (k[i] + 1);
        ret %= mod;
    }
    
    cout << ret << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
            using namespace std;
            #define rep(i,b) for(i=0;i<b;++i)
            #define repp(i,a,b) for(i=a;i<b;++i)
            #define endl "\n"
            //#define LLONG_MAX 99999999999999
            typedef long long int lli;
            int main(){
                ios_base::sync_with_stdio(false);
                cin.tie(NULL);
                lli t,n,i,j,b,a,k,q,m;
                cin>>n;
                long double d=(double(n))/3.0;
                d=d*d*d;


                cout<<fixed<<setprecision(12)<<d<<endl;



            }



Measured memory_bytes: 256
package main

import (
	"fmt"
	"os"
)

var A [3][3]int
var N int
var B [100]int

func check(a1, a2, a3 int) int {
	match := 0
	for i := 0; i < N; i++ {
		if B[i] == a1 || B[i] == a2 || B[i] == a3 {
			match++
		}
	}
	if match == 3 {
		fmt.Printf("Yes\n")
		os.Exit(0)
	}
	return match
}

func main() {
	fmt.Scan(&A[0][0], &A[0][1], &A[0][2])
	fmt.Scan(&A[1][0], &A[1][1], &A[1][2])
	fmt.Scan(&A[2][0], &A[2][1], &A[2][2])
	fmt.Scan(&N)
	for i := 0; i < N; i++ {
		fmt.Scan(&B[i])
	}
	// fmt.Printf("%v\n", A)
	// fmt.Printf("%v\n", N)
	// fmt.Printf("%v\n", B)

	// row
	check(A[0][0], A[0][1], A[0][2])
	check(A[1][0], A[1][1], A[1][2])
	check(A[2][0], A[2][1], A[2][2])
	// column
	check(A[0][0], A[1][0], A[2][0])
	check(A[0][1], A[1][1], A[2][1])
	check(A[0][2], A[1][2], A[2][2])
	// diagonal
	check(A[0][0], A[1][1], A[2][2])
	check(A[0][2], A[1][1], A[2][0])
	fmt.Printf("No\n")
}


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

static const int M = 1000000007;

void compute(int N, int H, vector<int> v){
  vector<pair<int, int> > R; // 
  int s, t;
  for ( int i = 0; i < H; i++ ){
    cin >> s >> t;
    swap(v[s], v[t]);
  }

  for ( int i = 1; i <= N; i++ ){
    if ( v[i] != i ) R.push_back(make_pair(v[i], i));
  }

  long long cnt = 0;
  long long a = 1, f = 1;
  for ( int p = N; p > 0; p-- ){
    long long L = max(v[p]-1, p-1);
    long long W = max(L-p, 0LL);
    for ( int i = 0; i < R.size(); i++ ){
      if ( R[i].second <= p ) continue;
      if ( R[i].second <= L) W--;
      if ( R[i].first < v[p] ) W++;
    }
    cnt = (cnt + (W*a)%M)%M;
    a = (a*f)%M;
    f = (f+1)%M;
  }
  cout << cnt << endl;
}

main(){
  int N, H;
  while(1){
    cin >> N;
    if ( N == 0 ) break;
    cin >> H;
    vector<int> v;
    v.push_back(0);
    for ( int i = 0; i < N; i++ ) v.push_back(i+1);
    compute(N, H, v);
  }
}

Measured memory_bytes: 2068
#include <iostream>
using namespace std;
int main() {
    int x, y, z;
    int tmp;
    cin >> x >> y >> z;
    tmp = x;
    x = y;
    y = tmp;
    tmp = x;
    x = z;
    z = tmp;
    cout << x << " " << y << " " << z << endl;
    return 0;
}

Measured memory_bytes: 3568
#include<cstdio>
#include<algorithm>
using std::min;

int main()
{
	long long a,b,c;
	scanf("%lld %lld %lld",&a,&b,&c);
	if( !(a&1 && b&1 && c&1) )
		puts("0");
	else
		printf("%lld\n",min(a*b,min(a*c,b*c)));
	return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);

	public static void main(String[] args){
		int w = scan.nextInt();
		int n = scan.nextInt();
		int[] dl = new int[w];
		for(int i = 0; i < w; i++){
			dl[i] = i + 1;
		}
		for(int i = 0; i < n; i++){
			String input = scan.next();
			String[] nums = input.split(",");
			int a = Integer.parseInt(nums[0]) - 1;
			int b = Integer.parseInt(nums[1]) - 1;
			int tmp = dl[a];
			dl[a] = dl[b];
			dl[b] = tmp;
		}
		for(int i = 0; i < w; i++){
			System.out.printf("%d\n", dl[i]);
		}
	}
}

Measured memory_bytes: 26128
///*****************************************************///
///*.......................Faiyaj Bin Amin............................*///
///*...................................................................*///
///*.........................KUET CSE 2K17......................*///
///*...................................................*///
///*****************************************************///

#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#define fastio      ios_base::sync_with_stdio(0);cin.tie(0),cout.tie(0)
#define ret return
#define rep(q, i, n) for(int q=i; q<n; q++)
#define forn(i, n) for(int i=0; i<n; i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define ll long long
#define pb push_back
#define em emplace_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define ff first
#define ss second
#define pii pair<int,int>
#define pdd pair<double, double>

#define see(x)        cerr<< __LINE__ << ": " << (#x) << " is "<< (x) <<'\n';
#define seecontent(v) for(auto x : v) { cout << x << " ";} cout << "\n\n";

#define PI 2*acos(0.0)
#define lcm(a, b)  ((a / __gcd(a, b) ) * b)

#define filein freopen ("input.txt", "r", stdin)
#define fileout freopen ("output.txt", "w", stdout)

#define mx 100005
#define INF 1e18
#define MOD 1000000007
#define MIN 0

//template <typename T>  using orderedSet =
//    tree<T, null_type, less_equal<T>,
//    rb_tree_tag, tree_order_statistics_node_update>; //find_by_order, order_of_key


/*------------------------------Graph Moves----------------------------*/
//const int fx[]={+1,-1,+0,+0}; // Directional
//const int fy[]={+0,+0,+1,-1};
//const int fx[]={+0,+0,+1,-1,-1,+1,-1,+1};   // Kings Move
//const int fy[]={-1,+1,+0,+0,+1,+1,-1,-1};  // Kings Move
//const int fx[]={-2, -2, -1, -1,  1,  1,  2,  2};  // Knights Move
//const int fy[]={-1,  1, -2,  2, -2,  2, -1,  1}; // Knights Move
/*---------------------------------------------------------------------*/

/**------------------------------------BITMASK------------------------------------------**/
//int Change(int N, int pos){return N= N^(1<<pos);}
//bool Check(int N, int pos){return (bool)(N &(1<<pos));}  /// check bit 0 or 1
/**-----------------------------------------------------------------------------------------------**/

//using namespace __gnu_pbds;
using namespace std;

int main()
{
    fastio;
    int n, cnt=0;
    cin>>n;

    string s;
    map<string, int> m;
    set<string> st;
    forn(i, n)
    {
        cin >>s;
        if(m[s]==0)
        {
            m[s]++;
            st.insert(s);
        }
        else
            m[s]++;

        cnt = max(m[s], cnt);
    }

    for(auto it=st.begin(); it!=st.end(); it++)
    {
        if(m[*it]==cnt)
        {
            cout << *it << "\n";
        }
    }

    return 0;
}







Measured memory_bytes: 34912
#include "bits/stdc++.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> Pll;
typedef pair<P,P> PP;
#define rep(i,a,n) for(ll i = a;i < n;i++)
#define repr(i,a,n) for(ll i = n-1;i >= a;i--)
#define LINF (ll)1e17
#define INF 1e9
#define MOD (ll)1e9+7
#define sMOD 1e5
#define fs first
#define sc second
#define setprecision(d) cout << fixed << setprecision(d);

ll gcd(ll a,ll b){
	if(!b) return a;
	return gcd(b,a%b);
	
}

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





signed main(){
	ll x;
	cin >> x;

	rep(i,x,200001){
		ll temp = 2;
		bool flag = true;
		while(temp*temp <= i){
			if(i % temp == 0){
				flag = false;
				break;
			}
			temp++;
		}

		if(flag){
			cout << i << endl;
			return 0;
		}
	}
    return 0;
}

Measured memory_bytes: 256
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
from itertools import permutations, accumulate, combinations, combinations_with_replacement
from math import sqrt, ceil, floor, factorial
from bisect import bisect_left, bisect_right, insort_left, insort_right
from copy import deepcopy
from operator import itemgetter
from functools import reduce
from fractions import gcd
import sys
def input(): return sys.stdin.readline().rstrip()
def I(): return int(input())
def Is(): return map(int, input().split())
def LI(): return list(map(int, input().split()))
def TI(): return tuple(map(int, input().split()))
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()
def LS(): return list(input())
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(10**6)
MOD = 10**9+7
INF = float('inf')
# ----------------------------------------------------------- #

n, m, c = Is()
B = LI()
A = LIR(n)
ans = 0
for i in range(n):
    tmp = c
    for j in range(m):
        tmp += A[i][j]*B[j]
    if tmp > 0:
        ans += 1
print(ans)


Measured memory_bytes: 64108
#include<cstdio>
#include<cstring>

char s[200000];
int main(void) {
    scanf("%s",s+2);
    int n = strlen(s+2);
    for(int i=2; i<n+2; i++) {
        if(s[i-2] == s[i]) {
            printf("%d %d\n", i-3, i-1);
            return 0;
        }
        if(s[i-1] == s[i]) {
            printf("%d %d\n", i-2, i-1);
            return 0;
        }
    }
    puts("-1 -1");
    return 0;
}

Measured memory_bytes: 256