akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<utility>
#include<string>
#include<cmath>
#include<cstring>
#include<queue>
#include<map>
#include<climits>
#include<set>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
using namespace std;
typedef pair<int, int> pii;
typedef long long int ll;
typedef pair<ll, ll> pll;
//int dx[4] = { 1,0,0,-1 };
//int dy[4] = { 0,1,-1,0 };
#define MOD 1000000007
#define ARRAY_MAX 200005

const int INF = 1e9 + 7;

int dp[ARRAY_MAX];

int main() {


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

	int n;
	cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}

	int ans = 0;
	for (int i = 0; i < n; i++)
	{
		dp[a[i]] = dp[a[i] - 1] + 1;
		ans = max(dp[a[i]], ans);
	}

	cout << n - ans << endl;




	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const int INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
//const ll MOD = 1000000007;
const ll MOD = 998244353;
const double PI = acos(-1.0);
const double EPS = 1e-10;

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; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


void solve(){
    int N, K;
    cin >> N >> K;
    vector<int> A(N), B(N);
    REP(i,N) cin >> A[i] >> B[i];
    ll ans = 0;
    REP(i,N){
        bool ok = true;
        if((~K) & A[i]) continue;
        ans += B[i];
    }

    REP(i,30){
        if(K >> i & 1){
            ll c = K & ~(1LL << i);
            c |= (1LL << i) - 1;
            ll tmp = 0;
            REP(j,N){
                if((~c) & A[j]) continue;
                tmp += B[j];
            }
            chmax(ans, tmp);
        }
    }
    cout << ans << endl;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    // int T; cin >> T; REP(t,T) solve();
}

Measured memory_bytes: 1024
#include<stdio.h>
#include<math.h>

typedef struct{
  double x;
  double y;
}Point;

int koch(int , Point , Point);

int main(){

  int n;
  Point p1,p2;

  p1.x=0.0;
  p1.y=0.0;
  p2.x=100.0;
  p2.y=0.0;

  scanf("%d",&n);

  printf("%f %f\n",p1.x,p1.y);
  koch(n,p1,p2);
  printf("%f %f\n",p2.x,p2.y);

  return 0;
}


int koch(int n , Point p1 , Point p2){

  Point s,t,u;

  if(n==0) return 0;

 
  s.x=(p2.x+2*p1.x)/3.0;
  s.y=(p2.y+2*p1.y)/3.0;
     
  t.x=(p1.x+2*p2.x)/3.0;
  t.y=(p1.y+2*p2.y)/3.0;
  
  u.x=(t.x-s.x)/2-(t.y-s.y)*(sqrt(3)/2)+s.x;
  u.y=(t.x-s.x)*(sqrt(3)/2)+(t.y-s.y)/2+s.y;
 

 koch(n-1, p1, s);
  printf("%f %f\n",s.x,s.y);
  
  koch(n-1, s, u);
  printf("%f %f\n",u.x,u.y);
  
  koch(n-1, u, t);
  printf("%f %f\n",t.x,t.y);
  
  koch(n-1, t, p2);
}

Measured memory_bytes: 636
int main(void)
{
	int a[11];
	int n,i,j,t;

	for(i=0;i<10;i++){
		scanf("%d",a+i);
	}
	for(i=0;i<10;i++){
		for(j=i+1;j<10;j++){
			if(a[i]<a[j]){
				t=a[i];
				a[i]=a[j];
				a[j]=t;
			}
		}
	}

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

	return 0;
}

Measured memory_bytes: 600
#include<iostream>
using namespace std;
int N, K;

int main() {
	cin >> N >> K;
	int ans = 0;
	for (int i = 0; i < N; ++i) {
		if (i == 0) ans += K;
		else ans *= K - 1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <queue>
#include <string>
#include <algorithm>
#include <cmath>
#include <climits>
#define REP(i, n) for(int i=0; i<(n); i++)
#define FOR(i, a, n) for(int i=(a); i<(n); i++)
using namespace std;

int main(){
    int n;
    cin >> n;
    int ans;
    ans = n/3;
    cout << ans << endl;
    return 0;
}

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

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

  long long K;
  cin >> K;

  int n;
  for (char c : S) {
    n = c - '0';
    long long n_length = pow(n, 5e16 - 1);
    K -= n_length;

    if (K <= 0) {
      break;
    }
  }

  cout << n << endl;
}

Measured memory_bytes: 512
use std::io;
use std::io::BufRead;

fn main() {
    let mut arr = vec![[[0; 10]; 3]; 4];
    let stdin = io::stdin();
    for line in stdin.lock().lines().skip(1) {
        let v: Vec<i32> = line.unwrap()
            .split_whitespace()
            .map(|s| s.parse().unwrap())
            .collect();
        let (b, f, r, v) = (v[0] - 1, v[1] - 1, v[2] - 1, v[3]);
        arr[b as usize][f as usize][r as usize] += v;
    }
    for (i, b) in arr.iter().enumerate() {
        for f in b.iter() {
            for r in f.iter() {
                print!(" {}", *r);
            }
            println!("");
        }
        if i < 3 {
            println!("####################");
        }
    }
}



Measured memory_bytes: 5032
// D.

#include <iostream>
#include <sstream>
#include <algorithm>
#include <vector>

using namespace std;

typedef long long LL;
typedef pair<LL, LL> LLLL;

int main(int argc, char *argv[]) {
	int h, w;
	cin >> h >> w;
	vector<string> s(h);
	vector<vector<int>> v(h, vector<int>(w));
	int ans = 0;
	for (int i = 0; i < h; ++i) {
		cin >> s[i];
		for (int j = 0; j < w; ++j) {
			if (s[i][j] == '.') {
				int k;
				for (k = j + 1; k < w; ++k) {
					if (s[i][k] != '.') {
						break;
					}
				}
				int cnt = k - j;
				for (; j < k; ++j) {
					v[i][j] = cnt;
				}
				--j;	// unnecessary
			}
		}
	}
	for (int j = 0; j < w; ++j) {
		for (int i = 0; i < h; ++i) {
			if (s[i][j] == '.') {
				int k;
				for (k = i + 1; k < h; ++k) {
					if (s[k][j] != '.') {
						break;
					}
				}
				int cnt = k - i;
				for (; i < k; ++i) {
					ans = max(ans, v[i][j] + cnt - 1);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 20096
// 2_abc127_b
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i <= (int)(n); i++)
#define SZ(x) ((int)(x).size())
#define INF (1e16)
#define MOD (1000000007)
typedef long long ll;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int r, d, x;
    cin >> r >> d >> x;
    rep(i, 10){
        x = r * x - d;
        cout << x << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define FAST ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
 
#define MAXX 100005
 
#define PI 3.14159265358979323846264338327950
 
#define F first
#define S second
 
#define ll 	 long long int
 
#define mod  1000000007

map<string, int> m;




int main()
{
	FAST;
	ll n, m;
	cin >> n >> m;
	char a[n+4][m+5];
	bool v[n + 5];
	memset(v, false, sizeof(v));
	bool f[m + 4];
	memset(f, false, sizeof(f));
	for(ll i = 1; i <= n; i++){
		for(ll j = 1; j <=m; j ++){
			cin >> a[i][j];
		}
	}
	for(ll i = 1; i <= n; i ++){
		bool x = false;
		for(ll j = 1; j <=m; j ++){
			if(a[i][j] == '#'){
				x = true;
				break;
			}
		}
		v[i] = x;
	}
	for(ll i = 1; i <= m; i ++){
		bool x = false;
		for(ll j = 1; j <= n; j ++){
			if(a[j][i] == '#'){
				x = true;
				break;
			}
		}
		f[i] = x;
	}
	for(ll i = 1; i <= n; i++){
		if(v[i]){
			for(ll j = 1; j <= m; j ++){
				if(f[j]){
					cout << a[i][j] ;
				}
			}
			cout << endl;
		}
		
	}
	return 0;
}

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

	int a[100000];

int main(){
	int n,i,p,max=0,sum=0;
	cin >> n;
	for(i=0;i<n;i++){
		cin >> a[i];
		sum = sum + a[i];
		if(a[i]>max)
			max = a[i];
	}
		
	sum = sum - max;
	sum = sum + max/2;
	cout << sum;
}


Measured memory_bytes: 256
//#define LOCAL
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<string>
#include<math.h>
#include<map>
#include<random>
#include<stack>
using namespace std;
using lld = long long int;
using llu = unsigned long long int;
using pii = pair<int, int>;
using pli = pair<lld, int>;
using pil = pair<int, lld>;
using pll = pair<lld, lld>;
using piii = pair<pii, pii>;
using pdii = pair<int, pii>;
int n, m;
int mark[109];
int main() {
	int i, j, k, l;
	int t = 1, tv = 0;
	while (t--) {
		scanf("%d %d", &n, &m);
		while (m--) {
			scanf("%d", &k);
			while (k--) {
				scanf("%d", &i);
				mark[i] = 1;
			}
		}
		int res = 0;
		for (i = 1; i <= n; i++) {
			if (mark[i] == 0) {
				res++;
			}
		}
		printf("%d\n", res);
	}
}

Measured memory_bytes: 1732
#include <cstdio>
#include <iostream>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>


using namespace std;


#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 100011

int n, i;
int v[maxN], cnt[maxN];

int abss(int x) {
    if (x < 0) return -x;
    return x;
}

int main() {
    
    scanf("%d", &n);
    for (i = 1; i <= n; i++) {
        cnt[abss(i - 1 - (n - i))]++;
        scanf("%d", &v[i]);
        cnt[v[i]]--;
    }
    
    for (i = 0; i <= n; i++) {
        if (cnt[i] != 0) {
            printf("0");
            return 0;
        }
    }
    
    ll ans = 1;
    for (i = 1; 2 * i <= n; i++)
        ans = (ans * 2) % 1000000007;
        
    printf("%lld", ans);
    
    
    return 0;
}

Measured memory_bytes: 1024
#define __USE_MINGW_ANSI_STDIO 0
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define int ll
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define PB push_back

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const int MOD = 1000000007;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<typename T> T ceil(T a, T b) { return a/b + !!(a%b); }
template<class S,class T>
ostream &operator <<(ostream& out,const pair<S,T>& a){
  out<<'('<<a.first<<','<<a.second<<')';
  return out;
}

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

int a[2][100];
signed main(void)
{
  int n;
  cin >> n;
  REP(i, n) cin >> a[0][i];
  REP(i, n) cin >> a[1][i];

  int ret = 0;
  REP(i, n) {
    int tmp = 0;
    REP(j, i+1) tmp += a[0][j];
    FOR(j, i, n) tmp += a[1][j];
    chmax(ret, tmp);
  }
  cout << ret << endl;

  return 0;
}


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

#define LL long long int
using namespace std;

int main(void)
{
	LL n;
	int i = 1;
	cin >> n;
	LL temp = 0;

	while (1) {
		temp = pow(i, 2);
		if (temp > n) {
			break;
		}
		i++;
	}

	cout << (LL)pow(i - 1, 2) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i= 0;i<(n);++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const long long INF = 1LL << 60;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main(){
    int n,m;
    cin >> n>>m;
    vector<int> a(n);
    rep(i, n)cin >> a[i];
    ll sum = 0;
    rep(i,n)sum+=a[i];
    double x =1.0/(m*4.0);
    double y = sum*x;
    int ans = 0;
    rep(i,n){
        if((int)ceil(y)<=a[i]){
            ans++;
        }
    }
    if(ans>=m){
        cout<<"Yes"<<endl;
        return 0;
    }
    cout<<"No"<<endl;
    return 0;

}

Measured memory_bytes: 3596
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define ull unsigned long long
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
using namespace std;

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

	int N, C;
	cin >> N >> C;
	int sum = 0;
	REP(i, C) {
		int tmp;
		cin >> tmp;
		sum += tmp;
	}
	cout << ceil(sum / (double)(N+1)) << endl;
}


Measured memory_bytes: 3300
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
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 print(x) cout << (x) << endl;
#define pb push_back
#define mp make_pair
#define sz(x) int(x.size())
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const int INF = 1e9;
const ll LLINF = 1e16;

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, -1, 1, -1};



int main(void){
    cout.tie(0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int n;
    cin >> n;
    vector<int> d(n);
    rep(i,n) cin >> d[i];
    int ans = 0;
    rep(i,n-1){
      REP(j,i+1,n){
        ans += d[i] * d[j];
      }
    }
    print(ans);
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
	int n, max, min;	
    scanf("%d", &n);
    int a[n];
    for(int i = 0;i < n;i++){
        scanf("%d", &a[i]);
    }
    max = a[0];
    min = a[1];
    for(int i= 0;i < n; i++){
        if(a[i] > max) max = a[i];
        if(a[i] < min) min = a[i];
    }
    printf("%d", max - min);
	return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

int main()
{
    long long i, n, sum=0;
    long long arr[5000];
    scanf("%lld", &n);
    for(i=0;i<n;i++)
    {
        scanf("%lld", &arr[i]);
        sum+=arr[i];
    }
    sum-=n;
    printf("%lld\n", sum);
}


Measured memory_bytes: 256
package main

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

func solve(io *io) {
	n := io.NextInt()
	ws := []string{}
	for i := 0; i < n; i++ {
		ws = append(ws, io.NextLine())
	}
	used := map[string]bool{}
	answer := true
	for i := 0; i+1 < n; i++ {
		l1 := len(ws[i])
		if ws[i][l1-1] != ws[i+1][0] {
			answer = false
		}
	}
	for _, w := range ws {
		if used[w] {
			answer = false
		}
		used[w] = true
	}
	if answer {
		io.Println("Yes")
	} else {
		io.Println("No")
	}
}

func main() {
	io := newIo()
	defer io.Flush()
	solve(io)
}

type io struct {
	reader    *bufio.Reader
	writer    *bufio.Writer
	tokens    []string
	nextToken int
}

func newIo() *io {
	return &io{
		reader: bufio.NewReader(os.Stdin),
		writer: bufio.NewWriter(os.Stdout),
	}
}

func (io *io) Flush() {
	err := io.writer.Flush()
	if err != nil {
		panic(err)
	}
}

func (io *io) NextLine() string {
	var buffer []byte
	for {
		line, isPrefix, err := io.reader.ReadLine()
		if err != nil {
			panic(err)
		}
		buffer = append(buffer, line...)
		if !isPrefix {
			break
		}
	}
	return string(buffer)
}

func (io *io) Next() string {
	for io.nextToken >= len(io.tokens) {
		line := io.NextLine()
		io.tokens = strings.Fields(line)
		io.nextToken = 0
	}
	r := io.tokens[io.nextToken]
	io.nextToken++
	return r
}

func (io *io) NextInt() int {
	i, err := strconv.Atoi(io.Next())
	if err != nil {
		panic(err)
	}
	return i
}

func (io *io) NextFloat() float64 {
	i, err := strconv.ParseFloat(io.Next(), 64)
	if err != nil {
		panic(err)
	}
	return i
}

func (io *io) Println(a ...interface{}) {
	fmt.Fprintln(io.writer, a...)
}

func (io *io) Printf(format string, a ...interface{}) {
	fmt.Fprintf(io.writer, format, a...)
}

func (io *io) PrintIntLn(a []int) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func (io *io) PrintStringLn(a []string) {
	b := []interface{}{}
	for _, x := range a {
		b = append(b, x)
	}
	io.Println(b...)
}

func log(name string, value interface{}) {
	fmt.Fprintf(os.Stderr, "%s=%+v\n", name, value)
}

func intMin(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func intMax(a, b int) int {
	if a > b {
		return a
	}
	return b
}


Measured memory_bytes: 640
n = int(input())
ac = 0
wa = 0
tle = 0
re = 0
for i in range(n):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    else:
        re += 1
print(f"AC x {ac}")
print(f"WA x {wa}")
print(f"TLE x {tle}")
print(f"RE x {re}")

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

int t[210000];
int main(){
	int n,a,l=1,c=1;
	cin>>n;
	for(int i=0;i<n;i++){
		scanf("%d",&a);
		t[a]=i;
	}
	for(int i=1;i<n;i++){
		if(t[i]<t[i+1])c++;
		else c=1;
		l=max(l,c);
	}
	cout<<n-l;
	return 0;
}


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

int main() {
    int a,b;
    cin >> a >> b;
    cout << max({a+b, a-b, a*b}) << endl;

    return 0;
}

Measured memory_bytes: 256
N = int(input())
L = list(map(int,input().split()))
L = [0]+L+[0]
All = 0
for i in range(N+1) :
    All += abs(L[i]-L[i+1])
for i in range(1,N+1) :
    ans = All + abs(L[i-1]-L[i+1]) - (abs(L[i-1]-L[i]) + abs(L[i]-L[i+1]))
    print(ans)


Measured memory_bytes: 13920
#include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) reverse((a).begin(), (a).end())
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
const long long INF = 1LL << 60;

int main() {
  ll n, m;
  cin >> n >> m;
  cout << abs(n - 2) * abs(m - 2) << endl;
}

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

int main() {
  int N;
  
  cin >> N;
  
  int H[N],A[N];
  
  int top=0;
  
  int count=0;
  
  for (int i=0;i < N;i++){
    cin >> H[i];
    if (top <= H[i]){
      top=H[i];
      count++;
    }
  }
  cout << count;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
using namespace std;
using ll=long long;
using vec=vector<ll>;
using Graph = vector<vector<ll>>;
#define loop(i,n) for(ll i=0;i<n;i++)
#define Loop(i, m, n) for(ll i = m;i < n;i++)
#define pool(i,n) for(ll i=n-1;i>=0;i--)
#define Pool(i, m, n) for(ll i=n-1;i>=m;i--)
#define MAX 99999999999ll
#define MIN -99999999999ll
#define setbit bitset<8>
#define flagcount __builtin_popcount
#define flag(x) (1<<x)
#define flagadd(bit,x) bit|=flag(x)
#define flagpop(bit,x) bit&=~flag(x) 
#define flagon(bit,i) bit&flag(i)
#define flagoff(bit,i) !(bit & (1<<i))
#define all(v) v.begin(),v.end()
#define low2way(v,x) lower_bound(all(v),x)
#define high2way(v,x) upper_bound(all(v),x)
#define count2way(v,x) high2way(v,x)-low2way(v,x)
#define lower(v,x) low2way(v,x)-v.begin() //1番左が0、もし見つから無いならｎを出力
#define higher(v,x) high2way(v,x)-v.begin()-1 //1番左が0、もし見つからないならn-1を出力（注意）
#define putout(a) cout<<a<<endl
#define putout2(a,b) putout(a);putout(b)
#define putout3(a,b,c) putout(a);putout(b);putout(c)
#define putout4(a,b,c,d) putout(a);putout(b);putout(c);putout(d)
#define putout5(a,b,c,d,e) putout(a);putout(b);putout(c);putout(d);putout(e)
#define Gput(a,b) G[a].push_back(b)
#define cin1(a) cin>>a
#define cin2(a,b) cin>>a>>b
#define cin3(a,b,c) cin>>a>>b>>c
#define cin4(a,b,c,d) cin>>a>>b>>c>>d
#define cin5(a,b,c,d,e) cin>>a>>b>>c>>d>>e
#define sum(v) accumulate(all(v), 0ll)
ll ctoi(char c){
	if(c>='0'&&c<='9'){
		return c-'0';
	}
	return 0;
}
int main() {
  ll n;
  cin>>n;
  vec a(n);
  loop(i,n)cin>>a[i];
  vec d(n+1);
  d[0]=abs(a[0]);
  loop(i,n-1){
    d[i+1]=abs(a[i+1]-a[i]);
  }
  d[n]=abs(a[n-1]);
  ll full=sum(d);
  if(n==2){
    putout(2*abs(a[1]));
    putout(2*abs(a[0]));
  }
  else{
  loop(i,n){
    ll ans=full;
    ans-=d[i]+d[i+1];
    if(i==0){
      ans+=abs(a[1]);
      putout(ans);
      continue;
    }
    if(i==n-1){
      ans+=abs(a[n-2]);
      putout(ans);
      continue;
    }
    ans+=abs(a[i+1]-a[i-1]);
    putout(ans);
  }
  }
}

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

int a[20][20];

int dp[1<<20]; int memo[1<<20];
int same[1<<20];

int N;

int dfs(int bit){ 
  //１つだけビットが立っているときがベースケースなので注意
  if(memo[bit] != -1 ){ return memo[bit];}
 
  int flag = 0;
  
  for(int check = 0; check < N; check++){ 
    if( bit >> check & 1 ){ flag++;}
  }
  
  if( flag <= 1){ return memo[bit] = 0;}
 
  int res = 0;
  
  for(int i = bit; i > 0; i = (i-1)&bit){ // 3^Nで間に合わせる
    if( i == bit ){ continue;}
    
    int sub = i^bit;
    
    res = max(res, dfs(i)+same[sub]);
    
  }
  
  res = max(res, same[bit]);
  
  return memo[bit] = res;
  
}
    

signed main(void){
  
 
  cin >> N;
  
  for(int i = 0; i < N; i++){  
    for(int j = 0; j < N; j++){ cin >> a[i][j];
                              }
  }
  
  
  for(int i = 0;  i< (1<<20); i++){ memo[i] = -1;} 
  
  for(int i = 0; i < N; i++){ same[(1<<i)] = 0;} 
  //一つだけの時は当然0
  
  //次にsameを組み上げていく
  for(int bit = 0; bit < (1<<N); bit++){  //ここの計算量相当怪しい
    
    vector<int> vec; int sum = 0;
      
    for(int i = 0; i < N; i++){ 
      if( bit >> i & 1 ){ vec.push_back(i);}
    }
    

    int m = vec.size();
    
    for(int i = 0; i < m-1; i++){
      for(int j = i+1; j < m; j++){ 
        
        sum += a[vec[i]][vec[j]];
       
      }
    }

    same[bit] = sum;
  }
  
  
  if(true){cout << dfs((1<<N)-1) << endl;}
  
  return 0;
}

Measured memory_bytes: 11008
/*
	Created by : imay_10
	" It won't be EASY, but I'll make it "
*/

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

typedef long long int ll;
const int mod = 1e9+7;
const ll inf = 1e18;
const double pi = 3.1415926535897932384626;

// Utility for fast exponentiation
ll mpow(ll a,ll b,ll m){
    ll res=1;
    //a%=m;
    while(b){
    	if(b%2) res=res*a%m;
		a=a*a%m;
		b/=2;
	}
	return res;
}

// Utility for modular inverse
ll inv(ll a,ll m){
	return mpow(a,m-2,m);
}

// Utility for GCD Calculation
ll gcd(ll a,ll b){
	if(b==0) return a;
	return gcd(b,a%b);
}

// Utility for binomial coefficient
ll ncr(ll n,ll k)
{
    if(n<k)
        return 0;
    ll C[n + 1][k + 1];
    ll i,j;
    for(i=0;i<=n;i++){
        for(j=0;j<=min(i,k);j++){
            if (j==0 || j==i)
                C[i][j]=1;
            else
                C[i][j]=(C[i-1][j-1]+C[i-1][j])%mod;
        }
    }
    return C[n][k];
}

void solve(){
	//code
	int n;
	cin>>n;
	while(n--){
		cout<<"ACL";
	}
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	solve();
 	return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> oset;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
using ll = long long;

void test_case(){
	string s; cin >> s;
	int n = s.size();
	ll ans = 0;
	for(int i = 0 ; i < 1<<n ; i++){
		ll st = 0;
		for(int j = 0 ; j < n ; j++){
			if((i>>j)&1){
				st = st*10 + (s[j]-'0');
			}
			else{
				ans+=st;
				st = 0;
			}
		}
		ans+=st;
	}
	cout<<ans<<"\n";
	
}
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int T=1;
	//~ cin >> T;
	while(T--){
		test_case();
	}
	return 0;
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;
using ll = long long;
using P = pair <int, int>;
const double PI = acos(-1);
const ll MOD = 1000000007;

int main() {
  int N;
  cin >> N;
  ll max = 0;
  ll ans = 0;
  rep(i,N){
    ll x;
    cin >> x;
    if(x>=max){
      max = x;
    }
    else{
      ans += (max - x);
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 3632
/*g++ main.cpp -o main.out*/
/*./main.out*/

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

#define LL long long
#define LD long double
#define Mod 1000000007
#define L_Mod 17100000013

const double eps = 1e-9;
const int INF = 0x3f3f3f3f;
const double PI = 3.1415926535;

#define NO_TLE std::ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

#define ree(a,n) memset(a,n,sizeof(a));

#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define red(i,l,u) for(int (i)=(int)(l);(i)>=(int)(u);--(i))

string s;

int main()
{
    cin>>s;
    if(s=="Sunny")cout<<"Cloudy"<<endl;
    else if(s=="Cloudy")cout<<"Rainy"<<endl;
    else if(s=="Rainy")cout<<"Sunny"<<endl;
    return 0;
}

Measured memory_bytes: 256
object Main {

  class UnionFind(par: Array[Int]) {

    def union(x: Int, y: Int): Boolean = {
      val rx = root(x)
      val ry = root(y)
      if (rx != ry) {
        if (size(rx) < size(ry)) {
          par(ry) += par(rx)
          par(rx) = ry
        } else {
          par(rx) += par(ry)
          par(ry) = rx
        }
        true
      } else false
    }

    def root(x: Int): Int =
      if (par(x) < 0) x
      else {
        par(x) = root(par(x))
        par(x)
      }

    def size(x: Int): Int =
      -par(root(x))

  }

  object UnionFind {

    def apply(n: Int): UnionFind =
      new UnionFind(Array.fill(n)(-1))

  }

  def main(args: Array[String]): Unit = {
    val sc = new java.util.Scanner(System.in)

    val N, M = sc.nextInt()
    // 辺をつなぐ処理は簡単、しかし切り離す行為は簡単ではない

    case class Bridge(from: Int, to: Int)

    val Bridges = new Array[Bridge](M)
    (0 until M) foreach { i =>
      val a, b = sc.nextInt()
      Bridges(i) = Bridge(a-1, b-1)
    }

    // 全ての橋が壊れている状態
    // この時の不便さは？
    // 連結!
    // 繋いだ時, 始点から繋がっている数 * 終点から繋がっている数
    // BとCがもともと繋がっていた場合には（同じグループの場合には不便さは変わらない
    // BとCがもともと繋がっていない場合には、快適さが上がる。
    // この橋が落ちた時には, 片方のグループの島と, 片方のグループの島の組み合わせが断絶されることになるので
    // この組み合わせの数だけ不便になることになる。
    // つまり, 始点から繋がっている数 * 終点から繋がっている数
    val unionFind = UnionFind.apply(N)
    val res = new Array[Long](M)
    res(M-1) = N.toLong*(N.toLong-1L)/2L

    var i = M - 1
    while (i > 0) {
      val Bridge(a, b) = Bridges(i)
      if (unionFind.root(a) != unionFind.root(b)) {
        res(i-1) = res(i) - unionFind.size(a).toLong * unionFind.size(b).toLong
        unionFind.union(a, b)
      } else {
        res(i-1) = res(i)
      }
      i -= 1
    }

    println(res.mkString("\n"))
  }

}


Measured memory_bytes: 75668
#include <bits/stdc++.h>
#define rep(i,n)for(long long i=0;i<(n);i++)
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const int MAX = 510000;
const double pi=acos(-1);

int main(){
  string s;
  cin >> s;
  int n;
  cin >> n;
  rep(i,n){
    string t;
    cin >> t;
    if(t=="replace"){
      int a,b;
      string u;
      cin >> a >> b >> u;
      rep(j,u.size()){
        s[j+a]=u[j];
      }
    }
    if(t=="reverse"){
      int a,b;
      string u;
      cin >> a >> b;
      u=s.substr(a,b-a+1);
      reverse(u.begin(),u.end());
      rep(j,u.size()){
        s[j+a]=u[j];
      }
    }
    if(t=="print"){
      int a,b;
      string u;
      cin >> a >> b;
      u=s.substr(a,b-a+1);
      cout << u << endl;
    }
    
  }
}



Measured memory_bytes: 3220
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef pair<int, int> pii;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i))
#define mat(type, c, m, n) vector<vector<type>> c(m, vector<type>(n));for(auto& r:c)for(auto& i:r)cin>>i;
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define each(x,y) for(auto &(x):(y))
#define var(type, ...)type __VA_ARGS__;Scan(__VA_ARGS__);
template<typename T> void Scan(T& t) { cin >> t; }
template<typename First, typename...Rest>void Scan(First& first, Rest&...rest) { cin >> first; Scan(rest...); }
#define vec(type, c, n) vector<type> c(n);for(auto& i:c) cin>>i;
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
#define em emplace
#define pb pop_back
#define fi first
#define se second
#define get(a, i) get<i>(a)
#define bit_count __builtin_popcount
#define mt make_tuple
inline string zero(int a,string s,char c='0'){return string(a-len(s),c)+s;}
inline string zero(int a,int t,char c='0'){return zero(a, to_string(t), c);}
inline string zero(int a,ll t,char c='0'){return zero(a, to_string(t), c);}
#define mini min_element
#define maxi max_element
#define sum accumulate
#define chmax(a,b) if(a<b)a=b
#define chmin(a,b) if(a>b)a=b
template <class T> inline void print(T t){cout << t << '\n';}
template <class H, class... T> inline void print(H h, T... t){cout << h << " ";print(t...);}
ll solve() {
	var(string, s);
	int len_s = len(s);
	int left = 0;
	rep(i, 0, len_s) {
		if (s[i] == 'B')
			break;
		++left;
	}
	ll ans = 0;
	rep(i, left + 1, len_s) {
		if (s[i] == 'W') {
			ans += i - left;
			++left;
		}
	}
	return ans;
}
int main() {
	print(solve());
	return 0;
}


Measured memory_bytes: 720
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>

#define rep(i, n) for (int i = 0; i < (n); ++i)

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

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

  int r = 0;
  for (const auto &c : S)
  {
    if (c == '0')
      r++;
  }

  cout << std::min(r, (int)S.size() - r) * 2 << endl;

  return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n; cin >> n;
    vector<int> v(n); // Will have the locations.
    for(int i = 0; i < n; i++){
        cin >> v[i];
    }
    // we need to find a point P, which is closest to all points.
    // so, for minimum cost, we find the arithmetic mean.
    int sum = accumulate(v.begin(), v.end(), 0);
    int mean1 = sum / n; // Gives the mean position.
    int mean2 = mean1+1; // maybe this is the position.
    int tot1 = 0, tot2 = 0;
    for (int i =0; i < n; i++){
        tot1 += pow(v[i] - mean1, 2);
        tot2 += pow(v[i] - mean2, 2);
    }
    cout << min(tot1, tot2) << endl;
    return 0;

}


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

int main() {

    int a, b, c;

    scanf("%d%d%d", &a, &b, &c);

    if (b / a >= c) {
        printf("%d", c);
    } else {
        printf("%d", b / a);
    }


    return 0;

}


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

int main(){
  int N;
  cin>>N;
  vector<int>a(N);
  for(int i=0; i<N; i++){cin>>a[i];}
 
  int x=0;
  int count=0;
  for(int i=0; i<N; i++){
  x=a[x]-1; //数値は0から始まるため、例えば3番目のボタンを指定するには－1引く。
    count++;
    if(x==1){break;}
  }
  if(count==N){cout<<-1<<endl; return 0;}
  else{cout<<count<<endl;}
 
}

Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
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; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}
const ll INF = 1e16;
const ll MOD = 1000000007;
typedef pair<ll,ll> P;
const ll MAX = 400010;
constexpr ll nx[8] = {1,0,-1,0,-1,-1,1,1};
constexpr ll ny[8] = {0,1,0,-1,-1,1,-1,1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a[3];
    rep(i,3) cin >> a[i];
    sort(a,a+3);
    int c = a[2]-a[1];
    a[0] += c;
    if ((a[2]-a[0])%2) PRINT(c+(a[2]-a[0])/2+2);
    else PRINT(c+(a[2]-a[0])/2);
}


Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <string>
typedef long long ll;
using namespace std;

int main(void) {
  int n;
  cin >> n;
  string s[n];
  int t[n];
  int ans = 0;
  for(int i = 0; i < n; i++) {
    cin >> s[i] >> t[i];
    ans += t[i];
  }
  string x;
  cin >> x;
  for(int i = 0; i < n; i++) {
    ans -= t[i];
    if(s[i] == x)
      break;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3608
n=int(input())
k=[0,0,0]
a,s,d=0,0,0
for i in input().split():
  if i=="1":a+=1
  elif i=="2":s+=1
  else:d+=1
dp=[[ [0]*(n+1) for j in range(n+1)] for i in range(n+1)]
for i in range(d+1):
  for j in range(d+s+1):
    for k in range(n+1-i-j):
      su=i+j+k
      ret=0
      if su:
        ret+=n/su
        if i>=1:
          ret+=dp[i-1][j+1][k]*i/su
        if j>=1 :
          ret+=dp[i][j-1][k+1]*j/su
        if k>=1:
          ret+=dp[i][j][k-1]*k/su
      dp[i][j][k]=ret
print(dp[d][s][a])

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

int main() {
    string s, p;
    cin >>s >>p;
    int ss=s.size();
    for (int i=0; i<ss; i++) {
        if (p.at(0)==s.at(i)) {
            int j=0;
            while(p.at(j)==s.at((i+j)%ss)) {
                j++;
                if (j==p.size()) {
                    cout <<"Yes" <<endl;
                    return 0;
                }
            }
        }
    }
    cout <<"No" <<endl;
    return 0;
}


Measured memory_bytes: 3180
#include<iostream>
#include<vector>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int i, res, n;
    cin >> n;
    res = 0;
    for(i=1;i<=n;i++){
        res += (int)( log10((double)i) ) %2 ==0 ? 1:0;
    }
    cout << res << endl;
}

Measured memory_bytes: 888
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 10e8;
const int MAX_V = 201;
int a[4];
int c[10];
bool use[10];
int t[200010];
void NotsoDiverse() {
	int n, k;
	cin >> n >> k;
	int e = 0;
	for (size_t i = 0; i < n; i++)
	{
		int v;
		cin >> v;
		t[v]++;
		if (t[v] == 1) e++;
	}

	if (e <= k) {
		cout << 0 << endl;
		return;
	}
	sort(t, t + n + 1);
	int s = 0;
	for (size_t i = 0; i < n; i++)
	{
		if (t[i] == 0) continue;
		s += t[i];
		e--;
		if (e <= k) {
			cout << s << endl;
			return;
		}
	}
	cout << s << endl;
}

int main() {
	NotsoDiverse();
	return 0;
}



Measured memory_bytes: 1024
#include<iostream>
#include<stdio.h>
using namespace std;
int main() {
	int d,r,x,y;
	double f,a,b;
	cin >> x >> y;
	d = x / y;
	a = x;
	b = y;
	r = x%y;
	f = a / b;
	cout << d << " " << r << " ";
		printf("%.8f\n",f);
	return 0;
}

Measured memory_bytes: 3200
#include <algorithm>
#include <cmath>
#include <iostream>

using namespace std;

int64_t a[100'000];

int main()
{
    int n;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    sort(a, a + n, [](const auto &lh, const auto &rh) {
        return lh > rh;
    });
    int64_t amax = a[0];

    int yIdx = 0;
    for (int i = 1; i < n; i++)
    {
        if (abs(amax - 2 * a[yIdx]) >= abs(amax - 2 * a[i]))
        {
            yIdx = i;
        }
    }

    cout << amax << " " << a[yIdx] << endl;
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=1e6+10;
int pd[maxn],bj[maxn];
void init()
{
    for(ll i=2;i<=1e5;i++){
        if(!pd[i]){
            for(ll j=i*i;j<=1e5;j+=i)pd[j]=1;
        }
    }
    pd[1]=1;
    for(int i=1;i<=1e5;i+=2){
        if(pd[i]==0&&pd[(i+1)/2]==0)bj[i]=1;
    }
    for(int i=1;i<=1e5;i++)bj[i]+=bj[i-1];
}
int q;
int main()
{
    scanf("%d",&q);
    init();
    while(q--){
        int l,r;
        scanf("%d%d",&l,&r);
        printf("%d\n",bj[r]-bj[l-1]);
    }
}


Measured memory_bytes: 5120
n = int(input())
r = [int(input()) for i in range(n)]
maxv = -(10**9)
minv = 10**9
for i in range(1,n):
    if minv > r[i-1]:
        minv = r[i-1]
    if r[i] - minv > maxv:
        maxv = r[i] - minv
print(maxv)



Measured memory_bytes: 13596
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        var N = int.Parse(ReadLine());

        var ans = Enumerable.Range(0, N).Select(i =>
        {
            var SP = ReadLine().Split(' ');
            return (i, s: SP[0], p: int.Parse(SP[1]));
        }).OrderBy(x => x.s).ThenByDescending(x => x.p).Select(x => x.i);

        foreach (var i in ans)
            WriteLine(i + 1);
    }
}


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

int main() {
  
  int N,K;
  cin >> N >> K;
  string S;
  cin >> S;
  if(S.at(K-1)=='A'){
    S.at(K-1)='a';
  }
  if(S.at(K-1)=='B'){
    S.at(K-1)='b';
  }
  if(S.at(K-1)=='C'){
    S.at(K-1)='c';
  }
  cout << S << endl;
  
  
  
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int MOD = 1000000007;
const ll INF = 1LL << 60;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    vector<ll> vc;
    ll cnt = 0;
    ll num = 0;
    for (int i = 1; i <= n; i++)
    {
        cnt += i;
        vc.pb(i);
        if (cnt >= n)
        {
            num = cnt - n;
            for (int i = 0; i < vc.size(); i++)
            {
                if (vc[i] != num)
                {
                    cout << vc[i] << endl;
                }
            }
            return 0;
        }
    }
}

Measured memory_bytes: 384
/*
*/

#define _CRT_SECURE_NO_WARNINGS
#include <fstream>
#include <iostream>
#include <string>
#include <complex>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>
#include <list>
#include <ctime>

#include <memory.h>
#include <assert.h>

#define y0 sdkfaslhagaklsldk

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define j1 assdgsdgasghsf
#define tm sdfjahlfasfh
#define lr asgasgash
#define norm asdfasdgasdgsd
#define have adsgagshdshfhds

#define eps 1e-11
#define M_PI 3.141592653589793
#define bs 1000000007
#define bsize 337

using namespace std;

const int INF = 1e9;
const int N = 500031;

int n, k, l;
int w[N][2];
int sz[N][2];

int used[N];
int ans[N];
vector<int> order;
int cnt[N];
vector<int> g[N];

void dfs(int v)
{
	used[v] = 1;
	order.push_back(v);
	for (int i = 0; i < g[v].size(); i++)
	{
		int to = g[v][i];
		if (used[to])
			continue;
		dfs(to);
	}
}

int get(int a, int b)
{
	if (w[a][b] == a)
		return w[a][b];
	return w[a][b] = get(w[a][b],b);
}

void merge(int a, int b, int id)
{
	a = get(a, id);
	b = get(b, id);
	if (a == b)
		return;
	w[a][id] = b;
	sz[b][id] += sz[a][id];
}

int main(){
	//freopen("tree.in","r",stdin);
	//freopen("tree.out","w",stdout);
	//	freopen("F:/input.txt", "r", stdin);
	//	freopen("F:/output.txt", "w", stdout);
	ios_base::sync_with_stdio(0);
	//cin.tie(0);
	
	cin >> n >> k >> l;
	for (int i = 1; i <= n; i++)
	{
		w[i][0] = w[i][1] = i;
		sz[i][0] = sz[i][1] = 1;
	}

	for (int i = 1; i <= k; i++)
	{
		int a, b;
		cin >> a >> b;
		g[a].push_back(b);
		g[b].push_back(a);
		merge(a, b, 0);
	}
	for (int i = 1; i <= l; i++)
	{
		int a, b;
		cin >> a >> b;
		merge(a, b, 1);
	}

	for (int i = 1; i <= n; i++)
	{
		if (used[i])
			continue;
		order.clear();
		dfs(i);
		for (int j = 0; j < order.size(); j++)
		{
			int id = order[j];
			int to = get(id, 1);
			cnt[to]++;
		}
		for (int j = 0; j < order.size(); j++)
		{
			int id = order[j];
			int to = get(id, 1);
			ans[id] = cnt[to];
		}
		for (int j = 0; j < order.size(); j++)
		{
			int id = order[j];
			int to = get(id, 1);
			cnt[to]--;
		}
	}

	for (int i = 1; i <= n; i++)
	{
		if (i>1)
			cout << " ";
		cout << ans[i];
	}
	cout << endl;

	cin.get(); cin.get();
	return 0;
}

Measured memory_bytes: 21240
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        
        if(s.charAt(2) == s.charAt(3) && s.charAt(4) == s.charAt(5)){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 23508
// {{{ Headers
// vim:filetype=cpp:foldmethod=marker:foldmarker={{{,}}}

#include <cassert>
#include <cctype>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <deque>
#include <functional>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

#include <fstream>
#include <iostream>
#include <sstream>

using namespace std;
// }}}

typedef long long int64;
const int INF = 0x3f3f3f3f;
template <class T> inline int len (const T &a) { return a.size (); }
#define ALL(x) (x).begin(), (x).end()

const int MX = 3005;
char s [MX], t [MX];
int N, M;
int dp [MX][MX];

int
main () {
    scanf ("%s %s", s, t);
    N = strlen (s);
    M = strlen (t);
    for (int i = 1; i <= N; i++)
        for (int j = 1; j <= M; j++)
            if (s [i - 1] == t [j - 1])
                dp [i][j] = max (dp [i][j], 1 + dp [i - 1][j - 1]);
            else
                dp [i][j] = max (dp [i][j], max (dp [i - 1][j], dp [i][j - 1]));

    int x = N, y = M;
    string ret;
    while (x > 0 && y > 0) {
        if (dp [x][y] == dp [x - 1][y]) {
            x--;
        } else if (dp [x][y] == dp [x][y - 1]) {
            y--;
        } else {
            ret += s [x - 1];
            x--;
            y--;
        }
    }

    reverse(ret.begin(), ret.end());
    printf ("%s\n", ret.c_str ());


#ifdef LOCALHOST
	cerr << "time: " << (int64) clock () * 1000 / CLOCKS_PER_SEC << " ms" << endl;
#endif
    return 0;
}

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

using namespace std;

int main()
{
    string s;
    cin>>s;
    if(s=="Sunny")
        cout<<"Cloudy"<<'\n';

    else if(s=="Cloudy")
        cout<<"Rainy"<<'\n';

    else
        cout<<"Sunny"<<'\n';

    return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int s = sc.nextInt();
    int answer = 1;
    boolean isFour = false;
    if(s==1){
      System.out.println(4);
    }else if(s==2){
      System.out.println(4);
    }else if(s==4){
      System.out.println(4);
    }else{
      while(1==1){
        if(s%2==0){
          s=s/2;
        }else{
          s=3*s+1;
        }
        answer = answer +1;
        if(s==4){
          if(!isFour){
            isFour=true;
          }else{
            break;
          }
        }
      }
      System.out.println(answer);
    }
        
        
      
      
  }
  

  
}

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

using namespace std;

int main() 
{
    int n, m, i;
    scanf("%d", &n);
    
    vector<int> v;
    
    for(i = 0; i < n; i++)
    {
        scanf("%d", &m);
        v.emplace_back(m);
    }
    
    scanf("%d", &m);
    
    for(i = 0; i < m; i++)
    {
        scanf("%d", &n);
        printf("%d\n", lower_bound(v.begin(), v.end(), n) - v.begin());
    }
    
    return 0;
}


Measured memory_bytes: 3536
#include <iostream>
#include <string>

using namespace std;

int main() {
	string s;

	cin >> s;

	bool y0 = false, y1 = false, x0 = false, x1 = false;

	for (char c : s) {
		if (c == 'N') {
			y0 = true;

		} else if (c == 'S') {
			y1 = true;
		} else if (c == 'W') {
			x0 = true;
		} else if (c == 'E') {
			x1 = true;
		}
	}

	if (x0 == x1 && y0 == y1) {
		cout << "Yes";
	} else {
		cout << "No";
	}

	cout << endl;
	return 0;
}


Measured memory_bytes: 760