akhauriyash/Code-Regression huggingface dataset:
/*
ID: rchalam1
LANG: C++14
TASK:
*/
// For train.usaco.org, fill the template above.

// Competitive Coding Template

// GCC OPTIMIAZTION FLAGS
#ifdef ONLINE_JUDGE
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#endif

#include <bits/stdc++.h>

/*
#include <fstream>
#include <iostream>
#include <string>
#include <vector>
*/
// All Includes for Competitive Coding Template

using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;

using vi = std::vector<int>;
using vll = std::vector<long long>;
using vull = std::vector<unsigned long long>;

#define FOR(i, a, b) for (auto i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i, 0, a)
#define ROF(i, a, b) for (auto i = (a); i >= (b); --i)
#define R0F(i, a) ROF(i, a, 0)
#define ITR(a, x) for (auto& a: x)

#define FSRT(set) sort((set).begin(),(set).end())
#define RSRT(set) sort((set).rbegin(),(set).rend())
#define CSRT(set, function) sort((set).begin(),(set).end(), (function))
#define TRS(set) sort((set).begin(),(set).end(), greater<>())
#define REV(set) reverse((set).begin(),(set).end());

#define ALL(set) (set).begin(), (set).end()

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define ff first
#define ss second

// For stdio, call setIO() or setIO("").
void setIO(std::ifstream &readFile, std::ofstream &writeFile, const std::string &name = "", bool stdIO = false)
{
	std::ios_base::sync_with_stdio(false);
	std::cin.tie(nullptr);
	std::cout.tie(nullptr);
	if(!name.empty() && !stdIO)
	{
		readFile.open(name + ".in");
		if(readFile.fail()) return;
		writeFile.open(name + ".out");
		std::cin.rdbuf(readFile.rdbuf());
		std::cout.rdbuf(writeFile.rdbuf());
	}
}

// To time program, create object Timer  to start timing, and call Timer.elapsed().
#include <chrono>

class Timer
{
	std::chrono::time_point<std::chrono::high_resolution_clock> m_beg;
public:
	Timer() : m_beg(std::chrono::high_resolution_clock::now())
	{}

	void reset()
	{ m_beg = std::chrono::high_resolution_clock::now(); }

	[[nodiscard]] long double elapsed() const
	{
		return std::chrono::duration_cast<std::chrono::duration<long double, std::ratio<1> >>(
				std::chrono::high_resolution_clock::now() - m_beg).count();
	}
};

// Defines datatype
using dt = int;
// Defines MAXN value
constexpr dt MAXN = 1e5 + 1;
// Defines Modulus
constexpr dt MOD = 1e9 + 7;
// Defines Floating Point Correction
constexpr long double EPS = 1e-9;

//*****
//START CODE BELOW
//*****

int main(int argc, char *argv[])
{
	static std::ifstream readFile;
	static std::ofstream writeFile;
	setIO(readFile, writeFile);
	int n, l;
	cin >> n >> l;
	vector<string> words(n);
	for(auto &word : words) cin >> word;
	FSRT(words);
	for(auto &word : words) cout << word;
	cout << '\n';
}

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

void _generateOrder(
	const vector<int>& numset,
	const vector<int>& order,
	vector<vector<int>>& result){

	if(numset.size()==0){
		result.push_back(order);
	}else{
		for(int i=0;i<numset.size();i++){
			vector<int> ns(numset);
			vector<int> ord(order);
			ns.erase(ns.begin()+i);
			ord.push_back(numset[i]);
			_generateOrder(ns,ord,result);
		}
	}
}

void generateOrder(int N,vector<vector<int>>& result){
	vector<int> numset;
	vector<int> order={};
	for(int i=1;i<=N;i++){
		numset.push_back(i);
	}
	_generateOrder(numset,order,result);
}

int main(){
	int N;
	vector<int> P,Q;
	vector<vector<int>> result;

	cin >> N;
	for(int i=0;i<N;i++){
		int p;
		cin >> p; 
		P.push_back(p);
	}
	for(int i=0;i<N;i++){
		int q;
		cin >> q;
		Q.push_back(q);
	}

	generateOrder(N,result);

	int id=1,Pid=0,Qid=0;
	for(const auto& order : result){
		if(Pid==0 && order==P){
			Pid=id;
		}
		if(Qid==0 && order==Q){
			Qid=id;
		}
		if(Pid*Qid != 0){
			break;
		}
		id++;
	}

	if(Pid>Qid){
		cout << Pid-Qid << endl;
	}else{
		cout << Qid-Pid << endl;
	}
	return 0;
}


Measured memory_bytes: 3384
#include <algorithm>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;

#define MOD 1000000007
#define REP(i, N) for (int i = 0; i < N; ++i)
#define REP1(i, N) for (int i = 1; i <= N; ++i)
#define RREP(i, N) for (int i = N - 1; i >= 0; --i)
#define ALL(a) a.begin(), a.end()

int main() {
  int n;
  cin >> n;
  int h[n];
  REP(i, n) cin >> h[i];
  int cnt[100001] = {};
  cnt[0] = 0;
  for (int i = 1; i < n; ++i) {
    cnt[i] = cnt[i - 1];
    if (h[i - 1] < h[i])
      cnt[i] = 0;
    else
      cnt[i] += 1;
  }
  int ans = 0;
  REP(i, n) ans = max(ans, cnt[i]);
  cout << ans << endl;
  return 0;
}

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

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

int H, W, K;
char C[10][10];

int count(int a, int b)
{
  int cnt = 0;
  REP(i, H) REP(j, W) {
    if (C[i][j] == '.') { continue; }
    if (((a >> i) & 1U) || ((b >> j) & 1U)) { continue; }
    cnt++;
  }
  return cnt;
}

int main()
{
  cin >> H >> W >> K;
  REP(i, H) REP(j, W) cin >> C[i][j];

  int ans = 0;
  REP(i, pow(2, H)) REP(j, pow(2, W)) {
    if (count(i, j) == K) { ans++; }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3996
import heapq
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))

AB = []
AC = []
BC = []
for a in A:
    for b in B:
        AB.append(a+b)
    for c in C:
        AC.append(a+c)
for b in B:
    for c in C:
        BC.append(b+c)
AB.sort(reverse=True)
AC.sort(reverse=True)
BC.sort(reverse=True)

hq = []
heapq.heapify(hq)
for a in A:
    for bc in BC[:K]:
        heapq.heappush(hq,-a-bc)
for b in B:
    for ac in AC[:K]:
        heapq.heappush(hq,-b-ac)
for c in C:
    for ab in AB[:K]:
        heapq.heappush(hq,-c-ab)

ans = []
for _ in range(K):
    ans.append(-heapq.heappop(hq))
    heapq.heappop(hq)
    heapq.heappop(hq)

print(*ans, sep='\n')

Measured memory_bytes: 277356
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner cin = new Scanner(System.in);
        int n, i, j;
        n = cin.nextInt();
        int[] A = new int[n];
        for (i = 0; i < n; i++) {
            A[i] = cin.nextInt();
        }
        
        int count = shellSort(A, n);
        
        System.out.println(count);
        for (i = 0; i < n; i++) {
            System.out.println(A[i]);
        }
    }
    static int shellSort(int[] A, int n) {
        int cnt = 0, m = 0, i;
        int[] g;
        if (n > 1) {
            g = new int[n];
        } else {
            g = new int[10];
        }
        g[0] = 1;
        while (g[m] <= n) {
            m++;
            g[m] = (int) Math.pow(2, m) * (int) Math.pow(3, m);
        }
        System.out.println(m);
        for (i = m - 1; i >= 0; i--) {
            System.out.print(g[i]);
            if (n > 0) System.out.print(" ");
            cnt += insertionSort(A, n, g[i]);
        }
        System.out.println();
        return cnt;
    }
    static int insertionSort(int[] A, int n, int g) {
        int i, v, j, cnt = 0;
        for (i = g; i < n; i++) {
            v = A[i];
            for (j = i - g; j >= 0 && A[j] > v; j -= g) {
                A[j + g] = A[j];
                cnt++;
            }
            A[j + g] = v;
        }
        return cnt;
    }
}


Measured memory_bytes: 298324
# coding: utf-8

N,P = list(map(int, input().split()))
S = '0'+input()

#N=200000
#P=9893
#S= '0'+'1234567890' * 20000

if (P==2)|(P==5):
    sum=0
    for i in range(N, 0, -1):
        if int(S[i]) % P == 0:
            sum+= i
    print(sum)


else:
    dp1 = [0] * (N+1)
    dp2 = [0] * (N+1)
    dp3 = [0] * P
    dp1[N] = int(S[N]) % P
    dp3[int(dp1[N])] += 1
    k = 1
    for i in range(N - 1, 0, -1):
        dp1[i] = (dp1[i + 1] + (int(S[i]) * 10 * k)) % P
        dp3[int(dp1[i])] += 1
        k = (k * 10) % P

    sum = 0

    for i in range(P):
        if i == 0:
            sum += (dp3[i] * (dp3[i] - 1)) // 2 + dp3[i]
            continue
        if dp3[i] == 0: continue
        sum += (dp3[i] * (dp3[i] - 1)) // 2
    print(int(sum))


Measured memory_bytes: 12564
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
	static long MOD = 1000000007;

	static long add(long x, long y) {
		x += y;
		if (x >= MOD) return x - MOD;
		return x;
	}
	static long mult(long x, long y) {
		return (x * y) % MOD;
	}

	static long mult(long x, long y, long z) {
		return mult(x,  mult(y, z));
	}

	static long pow(long base, long exp) {
		if (exp == 0) return 1;
		if ((exp & 1) == 1) return mult(base, pow(base, exp - 1));
		return pow(mult(base, base), exp / 2);
	}

	static long inverse(long x) {
		return pow(x, MOD - 2);
	}

	static long[] getFacts(int max) {
		long[] ret = new long[max + 1];
		ret[0] = 1;
		for (int i = 1; i <= max; i++) {
			ret[i] = mult(ret[i-1], i);
		}
		return ret;
	}

	static long[] getInvFacts(int max) {
		long[] ret = new long[max + 1];
		ret[max] = 1;
		for (int i = 1; i <= max; i++) {
			ret[max] = mult(ret[max], i);
		}
		ret[max] = inverse(ret[max]);
		for (int i = max - 1; i >= 0; i--) {
			ret[i] = mult(ret[i+1], i+1);
		}
		return ret;
	}
	public static void main(String[] args) throws IOException {
		MyScanner sc = new MyScanner();
		PrintWriter out = new PrintWriter(System.out);
		int N = sc.nextInt();
		int M = sc.nextInt();
		long[] facts = getFacts(M);
		long[] invFacts = getInvFacts(M);
		long ans = 0;

		for (int i = 0; i <= N; i++) {
			long tmp = i % 2 == 0 ? 1 : MOD - 1;
			tmp = mult(tmp, facts[M - i]);
			tmp = mult(tmp, invFacts[i], invFacts[N-i]);
			ans = add(ans, tmp);
		}

		ans = mult(ans, facts[N], facts[M]);
		ans = mult(ans, invFacts[M - N], invFacts[M - N]);
		out.println(ans);
		
		out.flush();
	}
	
	static class MyScanner {
		private BufferedReader br;
		private StringTokenizer tokenizer;
		
		public MyScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}
		
		public String next() {
			while (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return tokenizer.nextToken();
		}
		
		public int nextInt() {
			return Integer.parseInt(next());
		}
		
		public long nextLong() {
			return Long.parseLong(next());
		}
	}
}


Measured memory_bytes: 40716
w = input()
len_w = len(w)
w = sorted(w)
moji = [chr(i) for i in range(97, 123)]
l = [0]*len_w
for i in range(len_w):
    if w.count(w[i]) % 2 != 0:
        print("No")
        quit()
print("Yes")


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

int main() {
  int n; cin>>n;
  string S; cin>>S;
  vector<set<int>> B(26);
  rep(i, n) B[S[i]-'a'].insert(i);
  int Q; cin>>Q;
  vector<int> ans;
  rep(query, Q) {
    int type; cin>>type;
    if (type==1) {
      int i; cin>>i;
      char c; cin>>c;
      i--;
      B[S[i]-'a'].erase(i);
      S[i]=c;
      B[S[i]-'a'].insert(i);
    }
    else {
      int l,r; cin>>l>>r;
      l--; r--;
      int res=0;
      rep(i, 26) {
        auto itr=B[i].lower_bound(l);
        if (itr!=B[i].end()&&*itr<=r) res++;
      }
      ans.push_back(res);
    }
  }
  rep(i, (int)(ans.size())) cout<<ans[i]<<endl;
}


Measured memory_bytes: 24452
#include "bits/stdc++.h"

using namespace std;

#define ll long long
#define vi  vector<int>
#define vvi vector<vi>
#define pi  pair<int,int>
#define mp  make_pair
#define pb  push_back
#define MOD 1e9 + 7
#define PAI  3.1415
#define all(x) (x).begin(),(x).end()
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
#define pr(x) cout << x << endl
#define Endl endl
#define rep(i,n) for(int i = 0 ; i < n; i++)

const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
const int ddx[8] = {-1,0,1,-1,1,-1,0,1};
const int ddy[8] = {-1,-1,-1,0,0,1,1,1};
const int inf = 99999999;
const ll linf = 1LL << 62;

ll gcd(ll a,ll b){
  if(a < b)swap(a , b);
  if(a % b == 0) return b;
  else gcd(b, a%b);
}

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

struct UnionFind {
  vi par; //par[i] : iの親番号（例）par[3] = 2 : 3の親は2

  UnionFind(int N) : par(N) { //最初は全てが根として初期化
    rep(i,N) par[i] = i;
  }

  int root(int x){ //データxが属する木の根を再帰で得る : root(x) = {xの木の根}
    if(par[x] == x)return x;
    return par[x] = root(par[x]);
  }

  void unite(int x, int y){ //xとyの木を併合
    int rx = root(x); //xの根をrx
    int ry = root(y); //yの根をry
    if(rx == ry)return; //xとyの根が同じ
    par[rx] = ry; //xとyの根が同じでない時、xの根rxをyの根にryにつける。
  }

  bool same(int x, int y){//2つのデータx，yが属する木が同じならtrueを返す
    int rx = root(x);
    int ry = root(y);
    return rx == ry;
  }
};


int main(){

  int A,B,C; cin >> A >> B >> C;

  int ans = B / A;
  pr(min(ans, C));

 return 0;

}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
#include<cstring>
#include<cctype>
using namespace std;

class dice {
public:
	int face[7];
	int get;

	dice(int x[]) {
		for (int i = 1; i <= 6; i++)
			face[i] = x[i];
	}

	int makesure(int above, int front,dice c) {
		for (int i = 1; i <= 6; i++) {
			for (int j = 1; j <= 4; j++) {
				if (c.face[1] == above && c.face[2] == front) {
					return c.face[3];
				}

				c.roll();
			}
			if(i%2)c.round('W');
			else c.round('N');
		}
		return -1;
	}

	void roll() {
		get = face[2];
		face[2] = face[3];
		face[3] = face[5];
		face[5] = face[4];
		face[4] = get;
	}

	void round(char x) {
			switch (x) {
			case 'E':
				get = face[1];
				face[1] = face[4];
				face[4] = face[6];
				face[6] = face[3];
				face[3] = get;
				break;
			case 'W':
				get = face[1];
				face[1] = face[3];
				face[3] = face[6];
				face[6] = face[4];
				face[4] = get;
				break;
			case 'N':
				get = face[1];
				face[1] = face[2];
				face[2] = face[6];
				face[6] = face[5];
				face[5] = get;
				break;
			case 'S':
				get = face[1];
				face[1] = face[5];
				face[5] = face[6];
				face[6] = face[2];
				face[2] = get;
				break;
			}
		}
};

int main() {
	int facef[7];
	int q;

	for (int i = 1; i <= 6; i++) {
		cin >> facef[i];
	}

	dice dice1(facef);

	cin >> q;

	int above, front;

	for (int i = 0; i < q; i++) {
		cin >> above >> front;

		cout << dice1.makesure(above, front, dice1) << endl;
	}

	return 0;
}

Measured memory_bytes: 1160
n,x = gets.split.map(&:to_i)
a = gets.split.map(&:to_i).sort
count = 0
(0...n-1).each do |i|
  if x >= a[i]
    x -= a[i]
    count += 1
  end
end
if a[-1] == x
  count += 1
end
puts count

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

int main() {
   char s1[] = "JPY"; 
   int N;
   double sum = 0;
   scanf("%d", &N);
   double x;
   char u[10];
   
   for(int i = 0; i < N; i++) {
      scanf("%lf %s", &x,u);
      if(strcmp(u,s1) == 0) {
         sum = sum + x;
      } else {
         sum = sum + 380000*x;
      }
   }
   printf("%lf", sum);
}


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

#define N 100 //頂点の最大個数

int main(void) {
	double x[N], y[N];
	int n; //頂点の個数
	double S; //面積
	
	n = 0;
	while(scanf("%lf,%lf", &x[n], &y[n]) != EOF) ++n;
	
	//座標(x[0],y[0])を含む三角形の面積を求める。
	S = 0;
	for(int i = 2; i < n; ++i) {
		int p1 = i - 1;
		int p2 = i;
		double a, b, c, z;
		a = sqrt((x[p1]-x[0])*(x[p1]-x[0]) + (y[p1]-y[0])*(y[p1]-y[0]));
		b = sqrt((x[p2]-x[0])*(x[p2]-x[0]) + (y[p2]-y[0])*(y[p2]-y[0]));
		c = sqrt((x[p1]-x[p2])*(x[p1]-x[p2]) + (y[p1]-y[p2])*(y[p1]-y[p2]));
		z = (a + b + c) / 2;
		S += sqrt(z * (z-a) * (z-b) * (z-c));
	}
	
	printf("%.6lf\n", S);
	
	return 0;
}


Measured memory_bytes: 3208
#include <bits/stdc++.h>
using namespace std;
#define vsort(vec) sort(vec.begin(), vec.end())
#define vreverse(vec) reverse(vec.begin(), vec.end())
using ll =long long;
const ll INF =1001001001;

//最大公約数
ll gcd(ll a, ll b){
   if (a%b==0){
       return(b);
   }else{
       return(gcd(b,a%b));
   }
}
//最小公倍数
ll lcm(ll a, ll b){
   return a*b/gcd(a,b);
}

//素数判定
ll isprime(ll n){
  bool prime=true;
  for(int i=2;i<n;i++){
    if(n%i==0){
      prime=false; break;
    }
  }
if(prime){cout<<n<<" is prime"<<endl;
         }else{cout<<n<<" is not prime"<<endl;}

}
//階乗　20くらいが限界
ll factorial(ll n){
  ll a=1;ll b=n;
  for(int i=0;i<n;i++){
    a*=b;
    b--;
  }
  return a;
}

//組み合わせ　nCr
ll comb(ll a,ll b){
  ll c;
  c=factorial(a)/(factorial(a-b)*factorial(b));
  return c; 
}




/*10億7。　　　100000007
2*2行列 H*W
vector<vector<int>> vec(H,vector<int>(W));
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
cin>>vec[i][j];
  }
}

文字列→数列
string S;int A=atoi(S.c_str());
数列→文字列
int A;string S=to_string(A);
数字判定　isdigit(a)
pair宣言　pair<int,int> p(5,7);
ソート　sort(vec.begin(),vec.end());
*/

int main(){
cout<<fixed<<setprecision(10);
  
  vector<vector<int>> vec(3,vector<int>(3));
for(int i=0;i<3;i++){
  for(int j=0;j<3;j++){
    cin>>vec[i][j];
  }
}
  int N;cin>>N;
  
  vector<int> vecb(N);
  for(int i=0;i<N;i++){
   cin>> vecb[i];
  }
  
  
  
  bool bingo=false;

  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      for(int k=0;k<N;k++){
        if(vec[i][j]==vecb[k]){
          vec[i][j]=101;break;
        }
      }
    }
  }
      
 /* for(int i=0;i<3;i++){
  for(int j=0;j<3;j++){
    cout<<vec[i][j]<<" " ;
  }
  }*/
  
  int A=101*101*101;
  int mul=1;
  for(int i=0;i<3;i++){
  for(int j=0;j<3;j++){

    mul*=vec[i][j];
    if(mul==A){
      bingo=true;
      break;
    }
  }
    mul=1;
  }
 mul=1;
      for(int i=0;i<3;i++){
  for(int j=0;j<3;j++){

    mul*=vec[j][i];
    if(mul==A){
      bingo=true;
      break;
    }
  }
    mul=1;
      }
  if(vec[0][0]*vec[1][1]*vec[2][2]==A){
    bingo=true;
  }
  if(vec[0][2]*vec[1][1]*vec[2][0]==A){
    bingo=true;
  }
  
  if(bingo){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  
}


Measured memory_bytes: 256
data =[[[0 for r in range(10)] for f in range(3)] for b in range(4)]
result = ""
n = input()
for i in range(0, n):
    b, f, r, v = map(int, raw_input().split(" "))
    data[b-1][f-1][r-1] += v
    
for b in range(4):
    for f in range(3):
         for r in range(10):
                result += " " + str(data[b][f][r])
         if(b != 3 or f != 2 or r !=9):
            result += "\n"
    if(b != 3):
        result += "#"*20 + "\n"
        
print result

Measured memory_bytes: 6400
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int (i)=0;(i)<(n);i++)
#define INF 1001001001
#define LLINF 1001001001001001001
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define ALL(v) v.begin(), v.end()
typedef long long ll;


int main(){

int n;
cin >> n;

cout << 800*n-n/15*200 << endl;

return 0;

}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#define LL long long
#define pb push_back
#define mp make_pair
#define INF 0x3f3f3f3f
#define Inf 1000000000000000000LL
#define F first
#define S second
using namespace std;
typedef pair<int,int>pii;
string s;
int main(){
	cin>>s;
	cout<<s[0]<<s[1]<<s[2]<<endl;
	return 0;
}


Measured memory_bytes: 3612
// finish date: 2018/03/10

#include <iostream>
#include <cmath>
#include <vector>
#include <bitset>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <climits>

using namespace std;

#define FOR(i, a, b) for(int (i)=a;(i)<(b);(i)++)
#define rep(i, n)  FOR(i,0,n)
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
#define vvvi vector<vector<vector<int>>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vvd vector<vector<double>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vs vector<string>
#define vc vector<char>
#define vvc vector<vector<char>>
#define bigmod 1000000007
#define INF 1050000000
#define pii pair<int,int>


int main() {
    ll K;
    cin >> K;

    int N = 50;
    vl a(N, (N - 1) + K / N);
    rep(i, K % N) {
        a[i] += 1;
    }
    FOR(i, K % N, N) {
        a[i] -= K % N;
    }
    cout << N << endl;
    rep(i, N) {
        cout << a[i] << " ";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include<algorithm>
#include<ctype.h>
using namespace std;
int main()
{
    long long a,n,m;
    scanf("%lld %lld",&n,&m);
    if(n==(m/2))
        printf("%lld",n);
    else if(n>(m/2))
        printf("%lld",m/2);
    else
    {
        a=m-2*n;
        a/=4;
        printf("%lld",n+a);
    }
        return 0;
}


Measured memory_bytes: 128
N, A, B = map(int, input().split())
v = list(map(int, input().split()))
v.sort(reverse=True)

C = [[1 for k in range(n + 1)] for n in range(N + 1)]
for n in range(2, N + 1):
    for k in range(1, n):
        C[n][k] = C[n - 1][k] + C[n - 1][k - 1]

x = v[A - 1]
l = 0
while v[l] != x:
    l += 1
r = l + 1
while r < N and v[r] == x:
    r += 1


count = 0
for i in range(A, min(B, r) + 1):
    if sum(v[:A]) * i == sum(v[:i]) * A:
        count += C[r - l][i - l]
print(sum(v[:A]) / A)
print(count)

Measured memory_bytes: 3064
# ABC 

s = input()

for bit in range(1<<(len(s)-1)):
    sum_ = int(s[0])
    ops_str = []
    for i in range(len(s)-1):
        if (bit & (1<<i)):
            sum_ += int(s[i+1])
            ops_str.append("+")
        else:
            sum_ -= int(s[i+1])
            ops_str.append("-")
    if sum_ == 7:
        ans_str = s[0]
        for k in range(len(ops_str)):
            ans_str += (ops_str[k] + s[k+1])
        print(ans_str+"=7")
        break

Measured memory_bytes: 3064
import sys
import math
import heapq
sys.setrecursionlimit(10**7)
INTMAX = 9223372036854775807
INTMIN = -9223372036854775808
DVSR = 1000000007
def POW(x, y): return pow(x, y, DVSR)
def INV(x, m=DVSR): return pow(x, m - 2, m)
def DIV(x, y, m=DVSR): return (x * INV(y, m)) % m
def LI(): return [int(x) for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()
def II(): return int(input())
def FLIST(n):
    res = [1]
    for i in range(1, n+1): res.append(res[i-1]*i%DVSR)
    return res
def gcd(x, y):
    if x < y: x, y = y, x
    div = x % y
    while div != 0:
        x, y = y, div
        div = x % y
    return y
S=input()
T=input()

print(int(S[0]==T[0])+int(S[1]==T[1])+int(S[2]==T[2]))


Measured memory_bytes: 3064
while True:
      n, m = map(int, raw_input().split())
      if n == 0 and m == 0:
            break
      p = [ 1 for i in range(n) ]
      pn = n; count = 0; flag = 1
      while flag == 1:
            for i in range(n):
                  if p[i] == 1:
                        count += 1
                        if count == m:
                              p[i] = 0
                              count = 0
                              pn -= 1
                              if pn == 1:
                                    flag = 0
                                    break

      print p.index(1)+1

Measured memory_bytes: 4260
import java.util.Scanner;

public class Main {
    public static void main(final String[] args) {
        final Scanner sc= new Scanner(System.in);
       final int a=sc.nextInt();
       final int b=sc.nextInt();
  if(a<b){
System.out.println("a < b");
  }else if(a>b){
    System.out.println("a > b");
  }else{
    System.out.println("a == b");
  }
  sc.close();
}


    }



Measured memory_bytes: 26088
N = int(input())
L = list(map(int, input().split()))

ans = 0
if N > 2:
    for i in range(N - 2):
        for j in range(i + 1, N - 1):
            for k in range(j + 1, N):
                tmp = [L[i], L[j], L[k]]
                if (len(tmp) == len(set(tmp))) and (L[i] + L[j] > L[k]) and (
                        L[j] + L[k] > L[i]) and (L[k] + L[i] > L[j]):
                    ans += 1
print(ans)

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

int main(int, char**) {
    ios_base::sync_with_stdio(0); cin.tie(NULL);
    int K, N;
    cin >> K >> N;
    
    vector<int> a(N);
    for (int s = 0; s < N; ++s) {
        cin >> a[s];
    }
    sort(a.begin(), a.end());
    
    int res = a[N-1] - a[0];
    for (int s = 1; s < N; ++s) {
        res = min(res, K + a[s-1] - a[s]);
    }
                  
    cout << res << endl;              
    
    return 0;
}

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

using namespace std;

long long int N, K;
long long int a[100001] = {};
long long int b[100001] = {};
long long int num=0;
long long int bnum[100001] = {};

int main() {
	cin >> N >> K;
	for (int i = 1; i <= N; i++) {
		cin >> a[i] >> b[i];
		bnum[a[i]] += b[i];
	}
	stable_sort(a, a + N+1);
	for (int i = 1; i <= N; i++) {
		if (a[i] != a[i - 1]) {
			num += bnum[a[i]];
			if (num >= K) {
				cout << a[i] << endl;
				break;
			}
		}
	}
}

Measured memory_bytes: 2944
#include "bits/stdc++.h"

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; i++)
#define out(ans) cout << ans << endl;
const long long mod = 1e9 + 7;

int main()
{
  int n;
  cin >> n;
  ll h[n + 10];
  ll count=0;
  bool t = true;
  rep(i, n) {
    cin >> h[i];
  }


  rep(i,n-1){
    if(h[i+1]==h[i]){
      //count = 0;
      continue;
    }
    else if(h[i+1]-h[i]==-1){
      count++;
    }
    else if (h[i + 1] - h[i]<=-2){
      t = false;
      break;
    }
    else {
      count = 0;
    }

    if (count == 2)
    {
      t = false;
      break;
      }
  }
  if (t)
  {
    out("Yes");
  }
  else out("No");

  return 0;
}


Measured memory_bytes: 1024
import sys
def main():

    cnt = {}
    for i in range(97,123):
        cnt[chr(i)] = 0
    # print(cnt)

    for passages in sys.stdin:
        for psg in passages:
            psglower = psg.lower()
            for s in psglower:
                if s.isalpha():
                    cnt[s] += 1

    for i in range(97,123):
        s = chr(i)
        print(s, ':', cnt[s])

if __name__ == '__main__':
    main()


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

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

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

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int gcd(int a, int b){
   int tmp;
   while(a%b==0){
      tmp=a%b;
      a=b;
      b=tmp;
   }
}

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

bool prime_number(int n){
   vector<bool> i;
   if(n < 2){
      return false;
   }
   else if(n == 2){
      return true;
   }
   if(n % 2 == 0){
      return false;
   }
   for(int i=3;i<=n/i;i+=2){
      if(n % i == 0) return false;
      return true;
   }
}

int main(){
   int i,j;
   
   while(cin>>i>>j,i+j){
      if(i>1) j+=31;
      if(i>2) j+=29;
      if(i>3) j+=31;
      if(i>4) j+=30;
      if(i>5) j+=31;
      if(i>6) j+=30;
      if(i>7) j+=31;
      if(i>8) j+=31;
      if(i>9) j+=30;
      if(i>10) j+=31;
      if(i>11) j+=30;
      if(j%7==1) cout << "Thursday" << endl; 
      if(j%7==2) cout << "Friday" << endl; 
      if(j%7==3) cout << "Saturday" << endl; 
      if(j%7==4) cout << "Sunday" << endl; 
      if(j%7==5) cout << "Monday" << endl; 
      if(j%7==6) cout << "Tuesday" << endl; 
      if(j%7==0) cout << "Wednesday" << endl; 
   }
}

Measured memory_bytes: 1156
#include<iostream>
#include<string>
using namespace std;
int main(){
	int l,a,b,c,d;
	cin>>l>>a>>b>>c>>d;
	int f,g;
	if(a%c==0)
		f=a/c;
	else
		f=a/c+1;
	if(b%d==0)
		g=b/d;
	else
		g=b/d+1;
	if(f>=g)
		cout<<l-f<<endl;
	else
		cout<<l-g<<endl;
	return 0;
}

Measured memory_bytes: 1160
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <cstring>
#include <iomanip>
#include <cassert>

using namespace std;
typedef long long ll;

int main(){
   int N;
   cin >> N;
   vector<int> p(N);
   vector<int> q(N);
   vector<int> a(N);
   vector<int> b(N);
   for (int i = 0; i < N; i++)
   {
      cin >> p[i];
      q[p[i]-1]=i;
   }
   a[0]=1;
   b[0]=q[0]-a[0];
   for(int i = 1 ; i < N; i++){
      a[i]=a[i-1]+1;
      b[i]=q[i]-a[i];
      if(b[i]>=b[i-1]){
         int diff = b[i]-b[i-1]+1;
         b[i]-=diff;
         a[i]+=diff;
      }
   }
   int offset = max(0, 1-b[N-1]);

   for(int i = 0 ; i < N;i++){
      cout << a[i] << " ";
   }
   cout << endl;
   for(int i = 0 ; i < N;i++){
      cout << offset + b[i] << " ";
   }
   cout << endl;
   return 0;
}


Measured memory_bytes: 3936
import java.math.BigInteger;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		BigInteger count = new BigInteger("1");
		int n = kb.nextInt();
		boolean t = true;
		for (int i = 0; i < n; i++) {
			long j = kb.nextLong();
			if (j != 0) {
				if (t == true) {
					count = count.multiply(BigInteger.valueOf(j));
					if (count.compareTo(new BigInteger("1000000000000000000")) == 1) {
						// System.out.println("k");
						t = false;
//				break;
					}
				}
			} else {
				count = new BigInteger("0");
				break;
			}
		}
		int res = count.compareTo(new BigInteger("1000000000000000000"));
		if (res == 1) {
			// System.out.println(res);
			System.out.println(-1);
		} else {
			System.out.println(count);
		}

		kb.close();
	}

}


Measured memory_bytes: 49872
#include <bits/stdc++.h>
#define FOR(I,X,Y) for(int (I)=(X);(I)<(Y);(I)++)
#define REP(I,X,Y) for(int (I)=(Y)-1;(I)>=(X);(I)--)
#define ALL(X) (X).begin(),(X).end()
#define INF 1000000007
#define LINF 1000000000000000007
typedef long long ll;
using namespace std;

int a[100];
int Min[100];

int main(){
  int n;
  cin >> n;
  FOR(i,0,100)Min[i] = INF;
  string S;
  FOR(i,0,n){
    cin >> S;
    FOR(i,0,100)a[i] = 0;
    FOR(i,0,S.size())a[S[i] - 'a']++;
    FOR(i,0,100)Min[i] = min(a[i],Min[i]);
  }
  for(char c = 'a';c <= 'z';c++){
    FOR(i,0,Min[c - 'a'])cout << c;
  }
  cout << endl;
}


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

int main(){
	int n;
	cin >> n;
	vector<long long> a(n+1),b(n);
	for(int i =0;i<=n;i++) cin >> a[i];
	for(int i =0;i<n;i++) cin >> b[i];
	long long count=0;
	if (a[n]>=b[n-1]) {count+=b[n-1];a[n]-=b[n-1]; b[n-1]=0;}
	else {count+=a[n];b[n-1]-=a[n];a[n]-=a[n]; }
	for(int i =n-1;i>=1;i--){
		if (a[i]>=b[i]) {count+=b[i];a[i]-=b[i]; b[i]=0;}
		else {count+=a[i];b[i]-=a[i];a[i]-=a[i]; }
		
		if (a[i]>=b[i-1]) {count+=b[i-1];a[i]-=b[i-1]; b[i-1]=0;}
		else {count+=a[i];b[i-1]-=a[i];a[i]-=a[i]; }
	}
	if (a[0]>=b[0]) {count+=b[0];a[0]-=b[0]; b[0]=0;}
	else {count+=a[0];b[0]-=a[0];a[0]-=a[0]; }
	cout << count;
	
		
 }


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

int cnt2, cnt1, cnt4;
int main(){
	int n;
	cin >> n;
	for(int i = 0 ;i < n; i ++) {
		int x;
		cin >> x;
		if(x % 4 == 0) cnt4 ++;
		else if(x % 2 == 0) cnt2 ++;
		else cnt1 ++;
	}
	if(cnt1 > cnt4 + 1){
		cout << "No" << '\n';
	}
	else if(cnt1 == cnt4 + 1){
		if(cnt2 == 0) cout << "Yes" << '\n';
		else cout << "No" << '\n';
	}
	else {
		cout << "Yes" << '\n';
	}
}


Measured memory_bytes: 256
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int n = sc.nextInt();
    int m = sc.nextInt();
    int max = 0, min = 100000;
    for(int i = 0; i < m; i++){
      max = Math.max(max , sc.nextInt());
      min = Math.min(min , sc.nextInt());
    }
    if(min < max) System.out.println(0);
    else System.out.println(min - max + 1);
  } 
}


Measured memory_bytes: 62888
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <iterator>
#include <cmath>
#include <set>
#include <deque> 
#include <string>


using namespace std;

char ch;

int main()
{
	scanf("%c", &ch);
	
	if (('a' <= ch) && (ch <= 'z')) {
		printf("a\n");
	} else {
		printf("A\n");
	}
		
	return 0;
}


Measured memory_bytes: 1592
// Daniel Grzegorzewski
// while (clock()<=69*CLOCKS_PER_SEC)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
// #pragma GCC target ("avx2")
// #pragma GCC optimization ("O3")
// #pragma GCC optimization ("unroll-loops")

#define MP make_pair
#define PB push_back
#define ST first
#define ND second
#define int long long

using namespace __gnu_pbds;
using namespace std;

template <typename T>
using ordered_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

//X.find_by_order(k); - zwraca iterator na k-ty element (numeracja od zerowego)
//X.order_of_key(k); - zwraca liczbę elementów ostro mniejszych niż k

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef long long LL;

void init_ios() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
}

const int N = 2*(int)1e5 + 3;
const int MOD = 2019;

int n, res, inv, pref[N], cnt[MOD];
string s;

signed main() {
  init_ios();
  for (int i = 1; i < MOD; ++i)
    if (10*i%MOD == 1) {
      inv = i;
      break;
    }
  cin >> s;
  n = s.size();
  int cur = 0;
  int po = 1;
  s = "!" + s;
  cnt[0] = 1;
  for (int i = 1; i <= n; ++i) {
    cur = (10*cur+s[i]-'0')%MOD;
    po = (po*inv)%MOD;
    int qwe = cur*po%MOD;
    res += cnt[qwe];
    cnt[qwe]++;
  }
  cout<<res<<"\n";
}

Measured memory_bytes: 3768
#include <bits/stdc++.h>
using namespace std;
#define hyperspeed ios::sync_with_stdio(false);cin.tie(NULL);
#define ll long long  
#define ull unsigned long long
#define ui unsigned int
#define li long int
#define uli unsigned long int
#define pb push_back
#define ld long double
#define vi vector<int>
#define vvi vector<vector<int>>
#define vli vector<li>
#define vll vector<ll>
#define all(v) v.begin(),v.end()
#define pi pair<int,int>
#define FOR(i,s,n) for(auto i=s;i<n;++i)
#define FORN(i,s,n) for(auto i=s;i<=n;++i)
#define FORR(i,s,n) for(auto i=s;i>=n;--i)
#define FORE(i,a) for(auto i : a)
#define mp make_pair
const int MOD = 1e9+7;

void solve() {
    ll l,r,d;
    cin >> l >> r >> d;
    ll cnt = 0;
    for(int i=l;i<=r;i++) {
        if(i%d==0) {
            cnt++;
        }
    }
    cout << cnt << endl;
}

int32_t main()
{
    hyperspeed
    int test=1;
    // cin >> test;
    while(test--) {
        solve();
    }
    return 0;
}

//--n1m5


Measured memory_bytes: 3632
//
// Created by Hideaki Imamura on 2020-03-19.
//
# include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef pair <ll, ll> l_l;
typedef pair<int, int> i_i;

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

# define EPS (1e-7)
# define INF (1e9)
# define PI (acos(-1))
//const ll mod = 1000000007;

ll N;

int main() {
    cin >> N;

    ll ans = 0;
    if (N % 2 != 0) {
        ans = 0;
    } else {
        ll x = 1;
        while (x <= N) {
            x *= 5;
            ans += (N / x) / 2;
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cctype>
#include <cstdio>
#include <math.h>
using namespace std;

int main(){
	int l[10],v1,v2,s;
	double c;
	while(scanf("%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",&l[0],&l[1],&l[2],&l[3],&l[4],&l[5],&l[6],&l[7],&l[8],&l[9],&v1,&v2)!=EOF){
		s=0;
		for(int i=0;i<10;i++)s+=l[i];
		c=(double)s/(v1+v2)*v1;
		for(int i=0;i<10;i++){
			c-=l[i];
			if(c<=0){cout<<i+1<<endl;break;}
		}
	}
}

Measured memory_bytes: 0
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE BinaryLiterals #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE NumDecimals #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TupleSections #-}

import Control.Applicative
import Control.Arrow
import Control.Monad
import Control.Monad.ST

import Data.Char
import Data.List
import Data.Maybe

import qualified Data.ByteString.Char8 as B

import Data.Array.ST.Safe
import Data.STRef

import Debug.Trace
import Text.Printf

readInt = readLn :: IO Int
readInteger = readLn :: IO Integer
readInts = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine
readIntegers = map ( fst . fromJust . B.readInteger ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

modifyArray a i f = writeArray a i =<< f <$> readArray a i

main = do
	[ n, k ] <- readInts
	[ r, s, p ] <- readInts
	t <- getLine
	let
		f 'r' = p
		f 's' = r
		f 'p' = s
		ass = spread k t
	print $ sum $ map ( solve f 1 ) ass

spread k as = runST $ do
	let
		n = length as
	res <- newArray ( 0, k - 1 ) "" :: ST s ( STArray s Int String )
	forM_ ( zip as [ 0 .. ] ) $ \( c, i ) -> do
		modifyArray res ( i `mod` k ) ( c : )
	getElems res

solve f cont [c] = if odd cont then f c else 0
solve f cont (c1:c2:s) = r + solve f cont' (c2:s)
	where
		r = if odd cont then f c1 else 0
		cont' = if c1 == c2 then succ cont else 1

Measured memory_bytes: 10492
/**********************************************
*               COMMENT BOX                   *
**********************************************/

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

#define pi 3.1415926535
#define endl "\n"
#define yes cout<<"YES\n"
#define no cout<<"NO\n"
#define ll long long
#define llu unsigned long long
#define pb push_back
#define mp make_pair
#define tc int t; cin>>t; while(t--)
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define rf(i,n,a) for(int i=n-1 ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define get(a,n) f(i,0,n) cin >> a[i];
#define show(a,n) f(i,0,n) cout << a[i] << " "; cout << endl;
#define fast ios:: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;

const int inf = 1e9;
const long long int inf64 = 1e18;
const int mod = inf + 7;
const int N = 1000010;

int main()
{
    fast;
    int a,b;
    cin >>a >> b;
    cout << a*b;
}


Measured memory_bytes: 3640
import sys
input = sys.stdin.buffer.readline
import itertools

def main():
    N = int(input())
    A = tuple(map(int,input().split()))
    B = tuple(map(int,input().split()))
    l = [i+1 for i in range(N)]
    count = 0
    for i in itertools.permutations(l):
        if i == A:
            a = count
        if i == B:
            b = count
        count += 1
            
    print(abs(a-b))
    
    
if __name__ == "__main__":
    main()

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

int main() {
	// your code goes here
	double x1,y1,x2,y2;
	cin >> x1 >> y1 >> x2 >> y2;
	double X = (x1-x2)*(x1-x2);
	double Y = (y1-y2)*(y1-y2);
	printf("%.6lf\n",sqrt(X+Y));
	return 0;
}


Measured memory_bytes: 3276
#include <iostream>
#include <string>
#include <vector>
#include <bitset>
#include <algorithm>
using namespace std;

int main(){
  int N, score;
  cin >> N >> score;
  vector<int> mon(N);
  vector<int> bornus(N);
  for(int i = 0; i < N; i++){
    cin >> mon[i] >> bornus[i];
  }
  int result = 1e9;
  for(int bit = 0; bit < (1 << N); bit++){
    bitset<10> bs(bit);
    int sum = 0, cnt = 0, j = -1;
    for(int i = 0; i < N; i++){
      if(bit & 1 << i){
        // 完全に解く配点
        sum += mon[i] * 100*(i + 1) + bornus[i];
        cnt += mon[i]; 
      }else{
        // 中途半端に解く配点(完全に解く配点以外の配点の中で最も高い配点)
        j = i;
      }
    }
    if(sum < score){
      int s1 = 100 * (j + 1);
      int need = (score - sum + s1 - 1) / s1;
      // 中途半端に解く配点の問題を1問除きすべて解いても目標点に達しない場合は、
      // 完全に解く配点の選択が不適切であったとて無視します
      if(need >= mon[j]){
        continue;
      }
      cnt += need;
    }
    result = min(result, cnt);
  }

  cout << result << endl;

}

Measured memory_bytes: 256
fn read_lines() -> Vec<String> {
    use std::io::Read;

    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    return buf.lines().map(|e| e.to_string()).collect::<Vec<_>>();
}

fn read_lines_split() -> Vec<Vec<String>> {
    let lines = read_lines();
    lines.into_iter()
        .map(|line| {
            line.split_whitespace()
                .map(|s| s.to_string())
                .collect::<Vec<String>>()
        }).collect::<Vec<Vec<String>>>()
}

fn read_line() -> String {
    use std::io::Read;

    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    buf.pop(); // delete newline
    return buf;
}

fn read_line_split() -> Vec<String> {
    let line = read_line();
    line.split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
}

fn three<T>(cond: bool, left: T, right: T) -> T {
    if cond { left } else { right }
}

fn main() {
    let n = read_line().parse().unwrap();
    let s = read_line();
    let mut s = s.chars().collect::<Vec<char>>();

    let mut west = vec![0; n];
    west[1] = three(s[0] == 'W', 1, 0);
    for i in 2..n {
        west[i] = west[i-1] + three(s[i-1] == 'W', 1, 0);
    }

    s.reverse();
    let mut east = vec![0; n];
    east[1] = three(s[0] == 'E', 1, 0);
    for i in 2..n {
        east[i] = east[i-1] + three(s[i-1] == 'E', 1, 0);
    }
    east.reverse();

    let result = (0..n).into_iter().map(|i| west[i] + east[i]).min().unwrap();

    println!("{}", result);
}


Measured memory_bytes: 8444
#include <bits/stdc++.h>
#define INF (1<<30)
#define MOD 1000000007
#define l_ength size
using ll = long long;
using namespace std;

int main(){
	int n; cin >> n;
	map<int, int> mp;
	while( n-- ){
		int a; cin >> a;
		if( mp[a] == 1 ) mp[a] = 0;
		else mp[a] = 1;
	}
	int ans = 0;
	for( auto &k : mp ){
		if( k.second == 1 ) ++ans;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 4864
#python3

graph = [[-1 for _ in range(15)] for _ in range(15)]

def main():
    n = int(input())
    for i in range(n):
        a = int(input())
        for j in range(a):
            x, y = map(int, input().split())
            graph[i][x-1] = y
            
    ans = 0
    for i in range(1<<15):
        h = [0]*15
        for k in range(n):
            if (i >> k) & 1:
                h[k] = 1

        f = True
        for i in range(15):
            if h[i] == 1:
                for j in range(n):
                    if graph[i][j] == -1:
                        continue
                    if graph[i][j] != h[j]:
                        f = False

        if f:
            ans = max(ans, sum(h))

    print(ans)
main()

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

//find_by_order gives kth-largest element
//order_of_key gives the number of items in the set that are strictly smaller!!

// OT.find_by_order(k-1)
// 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define db4(x, y, z, w) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << "," << #w << "=" << w << endl
#define ll long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(), (x).end()
#define mp make_pair
#define X first
#define Y second
#define sz(x) (int)((x).size())
#define pii pair<int,int>
#define MOD (ll)(1e9 + 7)
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define trav(a, x) for(auto& a : x)
typedef vector<int> vi;
#define inf (ll)(1e18)
#define double long double
#define int long long

//////////////////////

int32_t main() {

    ios::sync_with_stdio(false);
    cin.tie(0); 
    cout.tie(0);

    int n;
    cin >> n;

    vector<int> a(n + 1), b(n);
    int total = 0;

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

    int left = 0;
    rep(i,n) {
        total += a[i];
        a[i] -= left;
        if(a[i] > 0) {
            // db3(i,a[i],left);
            left = max(0ll, b[i] - a[i]);
            a[i] = max(0ll, a[i] - b[i]);
            // db3(i,a[i],left);
        } else {
            a[i] = 0;
            left = b[i];
        }
        total -= a[i];
        // db(total);
    }

    if(left > a[n])
        total += a[n];
    else
        total += left;

    cout << total << '\n';  
}

Measured memory_bytes: 1792