akhauriyash/Code-Regression huggingface dataset:
import java.io.*;
import java.util.*;
public class Main {
	public static void main(String[] args) throws Exception {
		MScanner sc=new MScanner(System.in);
		PrintWriter pw=new PrintWriter(System.out);
		int n=sc.nextInt();
		int[]in=sc.takearr(n);
		int ans=0;
		TreeSet<Integer>t=new TreeSet<Integer>();
		for(int i=0;i<n;i++) {
			if(t.floor(in[i])==null) {
				ans++;
			}
			t.add(in[i]);
		}
		pw.println(ans);
		pw.flush();
	}
	static class MScanner {
		StringTokenizer st;
		BufferedReader br;
		public MScanner(InputStream system) {
			br = new BufferedReader(new InputStreamReader(system));
		}
 
		public MScanner(String file) throws Exception {
			br = new BufferedReader(new FileReader(file));
		}
 
		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}
		public int[] takearr(int n) throws IOException {
	        int[]in=new int[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public long[] takearrl(int n) throws IOException {
	        long[]in=new long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public Integer[] takearrobj(int n) throws IOException {
	        Integer[]in=new Integer[n];for(int i=0;i<n;i++)in[i]=nextInt();
	        return in;
		}
		public Long[] takearrlobj(int n) throws IOException {
	        Long[]in=new Long[n];for(int i=0;i<n;i++)in[i]=nextLong();
	        return in;
		}
		public String nextLine() throws IOException {
			return br.readLine();
		}
 
		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}
 
		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}
 
		public char nextChar() throws IOException {
			return next().charAt(0);
		}
 
		public Long nextLong() throws IOException {
			return Long.parseLong(next());
		}
 
		public boolean ready() throws IOException {
			return br.ready();
		}
 
		public void waitForInput() throws InterruptedException {
			Thread.sleep(3000);
		}
	}
}


Measured memory_bytes: 55652
#include<cstdio>
#include<cctype>
using namespace std;
int main(){
    char ch;
    while(1){
        scanf("%c", &ch);
        if (isalpha(ch)){
            if (islower(ch)) {
                printf("%c", toupper(ch));
            } else printf("%c", tolower(ch));
        } else printf("%c", ch);
        if (ch == '\n') break;
    }
    return 0;
}


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

#define FOR(i, a, b) for(int i=(a); i<(b); i++)
#define RFOR(i, a, b) for(int i=(a); i>=(b); i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define CEIL(n, m) ceil(n/pow(10.0, m))*pow(10.0, m)
#define FLOOR(n, m) floor(n/pow(10.0, m))*pow(10.0, m)
#define ROUND(n, m) round(n/pow(10.0, m))*pow(10.0, m)
#define ALL(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define RSORT(x) sort((x).begin(),(x).end(),greater<int>())
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define llong long long
#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) " (L" << __LINE__ << ") " << __FILE__ << endl;

void solve()
{
  char a;
  int n;
  cin >> n;
  string s;
  cin >> s;
  int k;
  cin >> k;

  REP(i, n) {
    if((k-1)==i) {
      a = s[i];
    }
  }
  REP(i, n) {
    if(s[i]!=a) {
      s[i]='*';
    }
  }

  cout << s << endl;
}

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int maxn = 110;
int dp[maxn][4][2];
char N[maxn];
string s;
int k, len;

inline int dfs (int idx, int c0, int flag) {
  if (c0 > k) return 0; // hit max number of 0s
  if (idx > len) return c0 == k; // out of bounds, return 1 if capacity is met
  int& ans = dp[idx][c0][flag];
  if (ans != -1) return ans;
  ans = 0;
  int bound = (flag == 1) ? N[idx] - '0' : 9;
  for (int i = 0; i <= bound; i++) {
    ans += dfs(idx + 1, c0 + (i != 0), flag && (i == bound));
  }
  return ans;
}

signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  memset(dp, 255, sizeof(dp));

  // index the number N (string) from 1
  cin >> s;
  len = s.size();
  for (int i = 0; i < len; i++) N[i + 1] = s[i];
  len = strlen(N + 1);
  cin >> k;

  // start at 1st char, count of 0s is 0, flag set (bounded)
  cout << dfs(1, 0, 1) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	int N;
    cin >> N;
    
    switch(N%10){
      case 2:
      case 4:
      case 5:
      case 7:
      case 9:
        cout << "hon" << endl;
        break;
      case 0:
      case 1:
      case 6:
      case 8:
        cout << "pon" << endl;
        break;
      case 3:
        cout << "bon" << endl;
        break;
     }   
}


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

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

using namespace std;

// data
const int MAX_N = 100;
int A[MAX_N][2]; // 0-col, 1-row
enum
{
    row, col
};

// dp
int dp[MAX_N+1][MAX_N]; // k number from A_i;
const int INF = 1 << 29;

int main(){
    int n; cin >> n;
    rep(i, n){
        cin >> A[i][row] >> A[i][col];
    }

    rep(k, n+1){
        rep(i, n){
            if (k <= 1)
                dp[k][i] = 0;
            else    
                dp[k][i] = INF;
        }
    }

    rep(k, n+1){
        rep(i, n){
            rep(j, k)
                dp[k][i] = min(dp[k][i], 
                    dp[j][i] + dp[k-j][i+j] + A[i][row]*A[i+j][row]*A[i+k-1][col]);
        }
    }

    cout << dp[n][0] << endl;

}


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

using namespace std;

const int middle = 2 * 100000;
string s;
string ans[1000000];
bool flip_flg;
int q, l, r;

int main(){
	cin >> s >> q;
	for(int i = 0; i < s.size(); ++i) ans[i+middle] = s[i];
	l = middle, r = middle+s.size()-1;
	for(int i = 0; i < q; ++i){
		int a, b; char c; cin >> a;
		if(a == 1) flip_flg = !flip_flg;
		else{
			cin >> b >> c;
			if(!flip_flg){
				if(b == 1) ans[--l] = c;
				else ans[++r] = c;
			}else{
				if(b == 1) ans[++r] = c;
				else ans[--l] = c;			
			}
		}
	}
	if(!flip_flg){
		for(int i = l; i <= r; ++i) cout << ans[i];
		cout << endl;
	}else{
		for(int i = r; i >= l; --i) cout << ans[i];
		cout << endl;
	}
}

Measured memory_bytes: 22528
#include <iostream>

using namespace std;

int main(void) {
    int a, b;
    int diff;
    int x;

    cin >> a >> b;

    diff = b - a;
    x = 0;
    for (int i = 1; i < diff; i++) {
        x += i;
    }
    x -= a;

    cout << x << endl;

    return 0;
}


Measured memory_bytes: 256
n = int(input())
d={}
for i in range(n):
    s=sorted(input())
    if str(s) in d:
        d[str(s)]+=1
    else:
        d[str(s)]=1
s=0
for c in d:
    if d[c]>1:
        s+=d[c]*(d[c]-1)//2
print(s)
        
    

Measured memory_bytes: 110612
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner sc = new Scanner(System.in)) {
            int n = sc.nextInt();
            String s = sc.next();

            int ans = 0;
            for (int i = 1; i < n; i++) {
                String str1 = s.substring(0, i);
                String str2 = s.substring(i);
                int counter = 0;
                for (char ch = 'a'; ch <= 'z'; ch++) {
                    if (str1.indexOf(ch) != -1 && str2.indexOf(ch) != -1) {
                        counter++;
                    }
                }
                if (counter > ans) {
                    ans = counter;
                }
            }
            System.out.println(ans);
        }
    }

}


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

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<endl

int main(){
    string s;
    cin >> s;
    ll count = 0,ans = 0;
    REP(i,s.size()){
        if(s[i]=='B'){
            count++;
        }
        else ans += count;
    }
    COUT(ans);
    return 0;
} 

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <random>
#include <unordered_map>
#include <unordered_set>
#define all(a) a.begin(),a.end()
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define pb push_back
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef complex<ld> com;
constexpr int inf = 1000000010;
constexpr ll INF = 1000000000000000010;
constexpr ld EPS = 1e-12;
constexpr ld PI = 3.141592653589793238;
template<class T, class U> inline bool chmax(T &a, const U &b) { if (a < b) { a = b; return true; } return false; }
template<class T, class U> inline bool chmin(T &a, const U &b) { if (a > b) { a = b; return true; } return false; }

template<class T> class segtree {
	int n;
	vector<T> data;
	T id;
	function<T(T, T)> operation;
	function<T(T, T)> update;
public:
	segtree(int _n, T _id, function<T(T, T)> _operation)
		:id(_id), operation(_operation) {
		n = 1;
		while (n < _n + 2) n <<= 1;
		data = vector<T>(2 * n, id);
	}
	void change(int i, T x) {
		i += n;
		data[i] = x;
		while (i > 1) {
			i >>= 1;
			data[i] = operation(data[i << 1], data[i << 1 | 1]);
		}
	}
	void add(int i, T x) { change(i, data[i + n] + x); }
	T get(int a, int b) {
		T left = id; T right = id;
		a += n; b += n;
		while (a < b) {
			if (a & 1) left = operation(left, data[a++]);
			if (b & 1) right = operation(data[--b], right);
			a >>= 1; b >>= 1;
		}
		return operation(left, right);
	}
	T get_all() { return data[1]; }
	T operator[](int i) { return data[i + n]; }
};

struct ch {
	int ver, idx, pre;
};

vector<int> a(200010);
vector<vector<int>> graph(200010);
segtree<int> seg(200010, 0, [](int a, int b) {return max(a, b); });
vector<int> ans(200010);
stack<ch> st;

void dfs(int n, int p) {
	int d = seg.get(0, a[n]);
	st.push({ n,a[n],seg[a[n]] });
	seg.change(a[n], d + 1);
	ans[n] = seg.get(0, 200010);
	for (int i : graph[n]) {
		if (i != p) {
			while (!st.empty() && st.top().ver != n) {
				ch c = st.top(); st.pop();
				seg.change(c.idx, c.pre);
			}
			dfs(i, n);
		}
	}
}


vector<int> shrink(vector<int> vec) {
	int vecsize = vec.size();
	vector<int> tmpvec = vec;
	sort(tmpvec.begin(), tmpvec.end());
	tmpvec.erase(unique(tmpvec.begin(), tmpvec.end()), tmpvec.end());
	vector<int> res(vecsize);
	for (int i = 0; i < vecsize; i++) res[i] = lower_bound(tmpvec.begin(), tmpvec.end(), vec[i]) - tmpvec.begin();
	return res;
}

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);

	int n;
	cin >> n;
	rep(i, n) cin >> a[i];
	a = shrink(a);
	rep(i, n - 1) {
		int u, v;
		cin >> u >> v;
		u--; v--;
		graph[u].pb(v);
		graph[v].pb(u);
	}
	dfs(0, -1);
	rep(i, n) cout << ans[i] << '\n';
}

Measured memory_bytes: 54496
def insertion_sort(array):
    for i in range(len(array)):
        v = array[i]
        j = i - 1

        while(j>=0 and array[j] > v):
            array[j+1] = array[j]
            j = j - 1

        array[j+1] = v

        print(' '.join(map(str, array)))

    return array

if __name__ == '__main__':
    element_number = int(input())
    input_array = list(map(int, input().split()))

    insertion_sort(input_array)

Measured memory_bytes: 7708
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREP1(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(c) begin(c), end(c)

int _ = (
#ifndef LOCAL
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
#endif
    std::cout.precision(10), std::cout.setf(std::ios::fixed));

using ll = long long;
using ull = unsigned long long;
using ld = long double;
template <typename T> using vec = std::vector<T>;
using namespace std;

int main() {
  ll N, K;
  cin >> N >> K;
  vec<ll> A(N);
  REP(i, N) cin >> A[i];

  ll res = 1, acc = K;
  for (ll acc = K; acc < N; acc += (K - 1), res++) {
  }
  cout << res << endl;
  return 0;
}


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

int main(int argc, char const *argv[])
{
    int n, tmax; cin >> n >> tmax;
    int c0 = 1001;
    int c, t;
    for(int i=0;i<n;++i) {
        cin >> c >> t;
        if (t<=tmax && c<c0) {
            c0=c;
        }
    }
    if(c0==1001) cout << "TLE" << endl;
    else cout << c0 << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;
LL A[200001];
vector<int>G[200001];
LL cnt[200001];
LL ans[200001];


LL calc(LL x){
	LL ans=x*(x-1)/2;
	ans+=x;
	return max((LL)0,ans);
}

int dfs2(int x,int p){
	int size=1;
	LL t=0;
	REP(i,G[x].size()){
		if(G[x][i]!=p){
			LL now=cnt[A[x]];//開始時の数
			int s=dfs2(G[x][i],x);
			LL now2=cnt[A[x]];//終了時の値
			LL res=s-(now2-now);
			ans[A[x]]+=max(LL(0),calc(res));
			t+=res;
			size+=s;
		}
	}
	cnt[A[x]]+=(t+1);
	return size;
}

int main(){
	cin>>N;
	REP(i,N){
		cin>>A[i];
		A[i]--;
	}
	REP(i,N-1){
		int a,b;
		cin>>a>>b;
		a--;b--;
		G[a].push_back(b);
		G[b].push_back(a);
	}
	REP(i,N){
		cnt[i]=0;
		ans[i]=0;
	}
	dfs2(0,-1);
	REP(i,N){
		//cout<<"i"<<i<<" "<<ans[i]<<endl;
		cout<<calc(N)-ans[i]-calc(N-cnt[i])<<endl;
	}
	return 0;
}

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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}

const int MAX_N = 1024;
int dp[11][MAX_N];
int p[11];
int c[11];

int main2() {
  CLR(dp, 0);
  int D = nextInt();
  int G = nextInt();
  REP(i, D) {
    p[i] = nextInt();
    c[i] = nextInt();
  }

  for (int d = 0; d < D; d++) {
    for (int n = 0; n <= p[d]; n++) {
      int gain = (d+1) * n * 100;
      if (n == p[d]) gain += c[d];
      for (int s = 0; s + n < MAX_N; s++) {
        chmax(dp[d+1][s+n], dp[d][s] + gain);
      }
    }
  }

  ll ans = 0;
  for (int n = 0; n < MAX_N; n++) {
    if (dp[D][n] >= G) {
      ans = n;
      break;
    }
  }

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

int main() {  
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 892
import sys
sys.setrecursionlimit(10**7)
def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def II(): return int(sys.stdin.readline())
def SI(): return sys.stdin.readline().strip()
INF = 10 ** 18
MOD = 10 ** 9 + 7

# debug = True
debug = False

def dprint(*objects):
    if debug == True:
        print(*objects)

def solve():
    A, B = LI()
    if A > 9:
        print(-1)
        return
    if B > 9:
        print(-1)
        return
    print(A*B)

solve()

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define print(x) cout<<x<<endl;

int main() {
	long long x;
	cin >> x;
	rep(i,1,x){
		if (i * (i + 1) / 2 >= x) {
			print(i);
			break;
		}
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
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; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };

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

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

// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */

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

    ll n, m; cin >> n >> m;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    sort(a.begin(), a.end());
    vector<ll> sum(n+1, 0);
    rep(i, n) sum[i+1] = sum[i] + a[i];

    ll ok=0; ll ng=1e16;
    auto check = [&](ll mid) {
        ll cnt = 0;
        rep(i, n) cnt += a.end() - lower_bound(a.begin(), a.end(), mid-a[i]);
        return cnt>=m;
    };
    while(ng-ok > 1) {
        ll mid = (ok+ng)/2;
        (check(mid)? ok:ng) = mid;
    }

    ll cnt = 0; ll ans = 0;
    rep(i, n) {
        auto pos = lower_bound(a.begin(), a.end(), ng-a[i]) - a.begin();
        cnt += n-pos; ans += sum[n]-sum[pos] + a[i]*(n-pos);
    }
    ans += ok*(m-cnt);
    cout << ans << endl;
    
    
    return 0;
}


Measured memory_bytes: 1792
#include <string>
#include <vector>
#include <iostream>
using namespace std;
int main(){
    int i,e,n,min=100000,c,max=0;
    cin>>n;
    bool t = false;
    char m[n][n];
    for(i=0;i<n;i++){
        for(e=0;e<n;e++){
            cin>>m[i][e];
        }
    }
    for(i=0;i<n;i++){
        for(e=0;e<n;e++){
            if(m[i][e]=='#'){
                t=true;
            };
        }
    }
    if(t==false){
        cout<<-1;
        return 0;
    }
    for(i=0;i<n;i++){
        c=0;
        for(e=0;e<n;e++){
            if(m[i][e]=='#'){
                c++;
            }
        }
        if(c>=max){
            max=c;
        }
        t=false;
        for(e=0;e<n;e++){
            if(m[e][i]=='#'){
                t=true;
            }
        }
        if(t==true){
            c=n-c;
        }
        else{
            c=n-(c)+1;
        }
        if(c<min){
            min=c;
        }
    }
    min=min+n;
    for(i=0;i<n;i++){
        c=0;
        for(e=0;e<n;e++){
            if(m[e][i]=='#'){
                c++;
            }
        }
        if(c==n){
            min--;
        }
    }
    cout<<min;
}

Measured memory_bytes: 512
#include <cstdio>
#include <cstring>
#include <algorithm>

using namespace std;

typedef long long lint;

int main()
{
	int n, l;
	static pair<lint, lint> ice[100001];
	static lint time[100001];
	
	scanf("%lld %lld", &n, &l);
	
	for (int i = 0; i < n; i++){
		scanf("%lld", &ice[i].first);
		ice[i].second = i;
	}
	
	sort(ice, ice + n);
	reverse(ice, ice + n);
	
	memset(time, 0, sizeof(time));
	
	lint ret = 0;
	for (int i = 0; i < n; i++){
		int idx = ice[i].second;
		time[idx] = l - ice[i].first + max(idx - 1 >= 0 ? time[idx - 1] : 0, time[idx + 1]);
		ret = max(ret, time[idx]);
	}
	
	printf("%lld\n", ret);
	
	return (0);
}

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

int main() {
char X,Y;
  cin>>X>>Y;
  if(X<Y){
    cout << "<";
  }
  else if(X==Y){
    cout << "=";
  }
  else if(X>Y){
    cout << ">" ;
  }

}


Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int n,i,j,t;
  int data[4][13];
  char c;
  char gara[4]={'S','H','C','D'};
  scanf("%d",&n);
 
  for (i=0;i<4;i++){
    for (j=0;j<13;j++){
      data[i][j]=0;
    }
  }
  scanf("%d",&n);
 
  for (i=0;i<n;i++){
    scanf(" %c",&c);
    scanf("%d",&t);
    if (c=='S'){
      data[0][t-1]=1;
    }else if (c=='H'){
      data[1][t-1]=1;
    }else if (c=='C'){
      data[2][t-1]=1;
    }else if (c=='D'){
      data[3][t-1]=1;
    }
  }
 
  for (i=0;i<4;i++){
    for (j=0;j<13;j++){
      if (data[i][j]==0){
          printf("%c %d\n",gara[i],j+1);
      }
    }
  }
 
  return 0;
}

Measured memory_bytes: 1836
#include <iostream>
#include<math.h>
#include <limits>
#include <iomanip>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i =0; i < (int)(n); i++)

string S[200010];
int main() {
    int N;
    cin >>N ;
    
    rep(i, N)cin >> S[i];
    
    sort(S, S + N);
    int c = 1;
    int cmax = 0;
    rep(i, N-1) {
        if (S[i] != S[i + 1]) {
            c++;
        }


    }
    cout << c << endl;
    return 0;
}

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

int main() {
	int a, b, c; cin >> a >> b >> c;
	int maxN = 3 * max({ a,b,c });
	int rest = maxN - a - b - c;
	cout << (rest % 2 == 0 ? rest / 2 : (rest + 3) / 2) << endl;

	return 0;
}

Measured memory_bytes: 256
N, K = gets.split.map(&:to_i)

data = N.times.map{ gets.split.map(&:to_i) }.sort_by(&:first)

count = 0
data.each do |(a, b)|
  count += b
  if K <= count
    puts a
    break
  end
end

# data = []
# N.times do
#   # a, b = gets.split.map(&:to_i)
#   # data.concat([a] * (b <= K ? b : K))
#   # data.sort!
#   # data.pop(data.size - K) if 0 <= data.size - K
# end

# puts data[K-1]


Measured memory_bytes: 12664
#include <iostream>
#include <stdio.h>

int main() {
    int a, b, c;
    int result[3];

    scanf("%d %d %d", &a, &b, &c);
    if (a > b) {
        result[0] = b;
        result[1] = a;
    } else {
        result[0] = a;
        result[1] = b;
    }

    if (c > result[1]) {
        result[2] = c;
    } else if (c > result[0]) {
        result[2] = result[1];
        result[1] = c;
    } else {
        result[2] = result[1];
        result[1] = result[0];
        result[0] = c;
    }

    printf("%d %d %d\n", result[0], result[1], result[2]);

    return 0;
}

Measured memory_bytes: 1188
#define _USE_MATH_DEFINES
#define INF 100000000

#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>

using namespace std;

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

static const double EPS = 1e-8;

int tx[] = {0,1,0,-1};
int ty[] = {-1,0,1,0};

int dp[1000000];
int dp_odd[1000000];

int main(){

	memset(dp,0x3f,sizeof(dp));
	memset(dp_odd,0x3f,sizeof(dp_odd));

	dp[0] = 0;
	dp[1] = 1;
	dp_odd[0] = 0;
	dp_odd[1] = 1;

	for(int i=0;i<=1000000;i++){
		for(int j=1;j<=1000000;j++){
			int b = (j)*(j+1)*(j+2)/6;
			if(i+b >= 1000000) break;
			dp[i+b] = min(dp[i+b],dp[i] + 1);
			if(b % 2){
				dp_odd[i+b] = min(dp_odd[i+b],dp_odd[i] + 1);
			}
		}
	}


	int n;
	while(~scanf("%d",&n)){
		if(n==0) break;
		printf("%d %d\n",dp[n],dp_odd[n]);
	}
}

Measured memory_bytes: 8564
n = int(input())
aaa = sorted(list(map(int, input().split(' '))))  # 多分一番大きいのが /2 される回数が少ないにすると良い？
hoge = aaa[0]
for i in range(1, n):
    hoge = (hoge + aaa[i]) / 2
print(hoge)

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


vector<int> seg[100010];

int add1(int x,int v){
	while( x < 100010){
		seg[x].push_back(v);
		x += x & -x;
	}
	return 0;
}
int get1(int x,int l,int r){
	int ans = 0;
	while(x){
		int cnt = upper_bound(seg[x].begin(),seg[x].end(),r) - lower_bound(seg[x].begin(),seg[x].end(),l);
		x -= x & -x;
		ans += cnt;
	}
	return ans;

}

int a[100010];
int main(){
	int n;
	cin >> n;
	for(int i = 1 ; i <= n ; i++){
		cin >> a[i];
		add1(i,a[i]);
	}
	for(int i = 0 ; i < 100010 ; i++)
		sort(seg[i].begin(),seg[i].end());
	int q;
	cin >> q;
	for(int i = 0 ; i < q ; i++){
		int l,r,e;
		cin >> l >> r >> e;
		int L = min(a[l],a[r]) - e;
		int R = max(a[l],a[r]) + e;
		int S = r - l + 1 - ( get1(r,L,R) - get1(l-1,L,R) );
		cout << S << endl;
	}
}

Measured memory_bytes: 9584
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>
#include<bitset>
#include<cassert>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;



void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(vector<long long int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

//最長増加部分列の長さを返す.
int LIS(vector<int> a){
	deque<int> dp;
	rep(i,a.size()){
		int p = lower_bound(all(dp), a[i]) - dp.begin();
		if(p==0){
			dp.push_front(a[i]);
		} else {
			dp[p - 1] = a[i];
		}
	}
	return dp.size();
}


int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	cout << LIS(a) << endl;

	return 0;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
//typedef vector<vector<ll>> Graph;

const ll mod = 1e9 + 7;
//const ll mod = 998244353;

#define REP(i,n) for(ll i=0;i<(ll)n;i++)
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define spa << " " <<
#define fi first
#define se second

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 (a>b) { a=b; return 1; } return 0; }

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
for(int i = 0; i < (int)v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

template<typename T> void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cerr<<v[i][0];for(ll j=1;j<w;j++)cerr spa v[i][j];cerr<<endl;}};
template<typename T> void debug(vector<T>&v,ll n){if(n!=0)cerr<<v[0];
for(ll i=1;i<n;i++)cerr spa v[i];
cerr<<endl;};

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

    ll N, K;
    cin >> N >> K;
    vector<ll> A(N);
    REP(i, N) cin >> A[i];

    // double lb = 0;
    // double ub = 1e10;

    double ng = 0.000001;
    double ok = 1000000000;

    double eps = 1e-3;
    while(ok-ng>eps){
        double md = (ok+ng)/2;
        //dump(md)
        ll cnt = 0;
        REP(i, N){
            cnt += (ll)floor(A[i]/md);
        }
        if(cnt<=K) ok = md;
        else ng = md;
    }
    ll cand = ceil(ok);

    if(cand != 1){
        ll cnt = 0;
        ll m = cand-1;
        REP(i, N){
            cnt += ((A[i]+m-1)/m - 1);
        }
        if(cnt<=K) cand--;
    }
    
    cout << cand << endl;

    return 0;
}

Measured memory_bytes: 4724
#include <stdio.h>
int main(){
  int i, count;
  char S[4];
  count = 1;
  scanf("%s", S);
  
  for(i = 1; i < 4; ++i){
    if(S[i-1] == S[i]){
      printf("Bad");
      break;
    } else {
      ++count;
    }
  }
  if(count == 4){
    printf("Good");
  }
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <functional>
#include <map>
#include <climits>
#include <stack>
#include <string>
#include <random>
enum class Char: char {
	D, M, C
};
struct Char_with_index {
	Char charactor;
	int index;
};
long long int search(const std::vector<Char_with_index> &vec, const int k) {
	int left = 0, current = 0, d = 0, m = 0;
	long long int memo = 0, result = 0;
	while (current < vec.size()) {
		while (vec[left].index + k <= vec[current].index) {
			switch (vec[left].charactor) {
			case Char::D:
				--d;
				memo -= m;
				break;
			case Char::M:
				--m;
				break;
			case Char::C: break;
			}
			++left;
		}

		switch (vec[current].charactor) {
		case Char::D:
			++d;
			break;
		case Char::M:
			++m;
			memo += d;
			break;
		case Char::C:
			result += memo;
			break;
		}
		++current;
	}
	return result;
}
int main() {
	int n;
	std::cin >> n;
	std::string str;
	std::cin >> str;
	std::vector<Char_with_index> vec;
	for (auto i = 0; i < str.size(); ++i) {
		switch (str[i]) {
		case 'D': vec.push_back({ Char::D, i }); break;
		case 'M': vec.push_back({ Char::M, i }); break;
		case 'C': vec.push_back({ Char::C, i }); break;
		default: break;
		}
	}
	int q;
	std::cin >> q;
	int k;
	for (auto i = 0; i < q; ++i) {
		std::cin >> k;
		std::cout << search(vec, k) << std::endl;
	}
}
/*
*/

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

typedef long long ll;

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

    int k,x;
    cin >> k >> x;
    for(int i=x-k+1;i<=x+k-1;i++) cout << i << ' ';
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
/*||>>>> Praveen Ojha <<<<>>>> 27 July 2019 <<<<>>>> 17:48:48 <<<<||*/
// #pragma GCC optimize("Ofast")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
// #pragma GCC optimize("unroll-loops")
// #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define F first
#define S second
#define md 1000000007
#define inf (int)1e18+5
#define sz(x) (int)x.size()
#define PI 3.141592653589793238510
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define __ ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define vi vector<int>
#define vpii vector<pair<int,int> > 
#define vvi vector<vector<int> >
#define PRINT_TIME cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s." <<endl;
#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__) << "] "
typedef long double ld;
typedef pair<int,int> pii;
//Read Problems Carefully & Check for corner cases N=0,1 ?
///////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////
const int N=100005;
int dp[N][13];
string s;
int nn;
inline int powermod(int a,int n,int mod){
    int result=1;
    a=a%mod;
    while(n>0){
        if(n & 1)
            result=(a*result)%mod;
        a=(a*a)%mod;
        n/=2;
    }
    return result;
}
int solve(int ind,int sumi){
    if(ind==nn){
        if(sumi==5)
            return 1;
        else
            return 0;
    }
    int &res=dp[ind][sumi];
    if(res!=-1)
        return res;
    int ans=0;
    if(s[ind]=='?'){
        int val2=powermod(10,ind,13);
        for(int i=0;i<10;i++){
        int fin=(i*val2)%13;
        ans=(ans+solve(ind+1,(sumi+fin)%13))%md;
        }
    }
    else{
        int val=s[ind]-'0',val2=powermod(10,ind,13);
        int fin=(val*val2)%13;
        ans=(ans+solve(ind+1,(sumi+fin)%13))%md;
    }
    return res=ans;
}
int32_t main(){__
    memset(dp,-1,sizeof dp);
    cin>>s;
    nn=sz(s);
    reverse(all(s));
    cout<<solve(0,0)<<"\n";
return 0;
}

Measured memory_bytes: 18512
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#include <bitset>
#include <complex>
#include <cmath>
#include <array>
#include <numeric>
using namespace std;
#define INF 0x3f3f3f3f
#define INFLL 0x3f3f3f3f3f3f3f3fLL
//#define MOD 998244353
#define MOD 1000000007
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int, int> pint;
typedef pair<ll,ll> pll;
typedef tuple<int,int,int> tint;
typedef vector<int> vint;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pint> vpint;
typedef vector<tint> vtint;
typedef vector<vint> vvint;
int dx[8]={0,0,-1,1,1,1,-1,-1};
int dy[8]={-1,1,0,0,1,-1,1,-1};
const int SIZE=200050;
//↑templete
int bitcount32(int dw32){
	dw32 = ((dw32 & 0xAAAAAAAA) >>  1) + (dw32 & 0x55555555);
	dw32 = ((dw32 & 0xCCCCCCCC) >>  2) + (dw32 & 0x33333333);
	dw32 = ((dw32 & 0xF0F0F0F0) >>  4) + (dw32 & 0x0F0F0F0F);
	dw32 = ((dw32 & 0xFF00FF00) >>  8) + (dw32 & 0x00FF00FF);
	dw32 = ((dw32 & 0xFFFF0000) >> 16) + (dw32 & 0x0000FFFF);
	return dw32;
}
int H, W, K;
int func(vvint& A){
    int h=A.size();
    int ret=0;
    int cnt[15]={}, wid=1;
    for(int i=0;i<W;i++){
        bool flag=0;
        for(int j=0;j<h;j++){
            cnt[j]+=A[j][i];
            if(cnt[j]>K){
                flag=1;
            }
        }
        if(flag){
            if(wid==1)
                return INF;
            ret++;
            for(int j=0;j<h;j++)
                cnt[j]=0;
            i--;
            wid=0;
        }
        wid++;
    }
    //cout<<"!"<<ret<<" "<<h<<endl;
    return ret+h-1;
}
signed main(){

    cin>>H>>W>>K;
    string S[15];
    for(int i=0;i<H;i++)
        cin>>S[i];

    int ans=INF;

    for(int state=0;state<(1<<H);state++){
        vvint A;
        for(int i=0;i<H;i++){
            vint temp;
            for(int j=0;j<W;j++)
                temp.pb(S[i][j]-'0');
            while(i<H-1 && !!((state>>i)&1)==!!((state>>(i+1))&1)){
                i++;
                for(int j=0;j<W;j++)
                    temp[j]+=S[i][j]-'0';
            }
            A.pb(temp);
        }
        ans=min(ans, func(A));
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
A = int(input())
B = int(input())
C = int(input())
X = int(input())
num = 0
for a in range(A + 1):
    for b in range(B + 1):
        for c in range(C + 1):
            x = 500 * a + 100 * b + 50 * c
            if x == X:
                num += 1
print(num)

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

int main()
{
    int n;
    cin>>n;
    int a[n],dp[n]={0};
    for(int i=0; i<n; i++)
        cin>>a[i];
    for(int i=1; i<n; i++)
    {
        if(i-2>=0) dp[i]=min(dp[i-1]+abs(a[i-1]-a[i]),dp[i-2]+abs(a[i-2]-a[i]));
        else dp[i]=dp[i-1]+abs(a[i-1]-a[i]);
    }
    cout<<dp[n-1]<<endl;
    return 0;
}


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

using namespace std;

#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define sz(w) (int) w.size()
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<pii, int> para;
const ll inf = 1e18 + 7;
const int maxN = 1e6 + 5;
const int MAX = 2e3 + 7;

int n, x;
bool used[maxN];
int arr[maxN];

int main() {
	cin>>n>>x;
	n = 2 * n - 1;
	if (x == 1 || x == n) {
		cout<<"No\n";
		return 0;
	}
	
	if (n == 3) {
		cout<<"Yes\n1\n2\n3\n";
	} else {
		int left = (n - 4 + 1) / 2;
		int right = (n - 4) / 2;
		if (x == 2) {
			arr[left] = x + 1;
			arr[left + 1] = x;
			arr[left + 2] = x - 1;
			arr[left + 3] = x + 2;
			used[x + 2] = true;
		} else {
			arr[left] = x - 1;
			arr[left + 1] = x;
			arr[left + 2] = x + 1;
			arr[left + 3] = x - 2;
			used[x - 2] = true;
		}
		used[x] = true;
	    used[x - 1] = true;
		used[x + 1] = true;
		int cnt = 1;
		cout<<"Yes\n";
		REP(i, left) {
			while (used[cnt]) {
				cnt++;
			}
			cout<<cnt<<"\n";
			cnt++;
		}
		REP(i, 4)
			cout<<arr[left + i]<<"\n";
		REP(i, right) {
			while (used[cnt]) {
				cnt++;
			}
			cout<<cnt<<"\n";
			cnt++;
		}
	}
	return 0;
}


Measured memory_bytes: 1536
# ABC 100, c
def prime2(x):
    count = 0
    while (x/2).is_integer():
        count += 1
        x = x/2
        if x == 1:
            break
    return(count)


n = int(input())
A = [int(el) for el in input().split(' ')]
count2 = 0
for a in A:
    count2 += prime2(a)
print(count2)


Measured memory_bytes: 4148
def Get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def Get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def Get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def Get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end

n=gets.to_i
a=Get_i().sort!.reverse!
ans=0
a.each_with_index do|num,i|
  ans+=((i+1)%2).zero? ? -num : num
end
puts ans

Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
inline int read(){
	register int x=0;
	register bool f=0;
	register char c=getchar();
	while(c<'0'||c>'9'){
		if(c=='-') f=1;
		c=getchar();
	}
	while(c>='0'&&c<='9'){
		x=(x<<3)+(x<<1)+c-48;
		c=getchar();
	}
	return f?-x:x;
}
char cr[200];int tt;
inline void print(register int x,register char k='\n') {
    if(!x) putchar('0');
    if(x < 0) putchar('-'),x=-x;
    while(x) cr[++tt]=x%10+'0',x/=10;
    while(tt) putchar(cr[tt--]);
    putchar(k);
}
int main(){
	int a=read(),b=read(),c=read();
	swap(a,b);
	swap(a,c);
	print(a,' ');print(b,' ');print(c); 
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <map>
#include <utility>
#include <vector>
#include <cstdio>
#include <iomanip>
#include <cmath>  
#include <cstdlib>
#include <limits>
#include <numeric>
#include <type_traits>
using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i <= n; i++) 

int main() {
    int N, L;
    cin >> N >> L;
    int sum = 0;
    rep1(i,N) {
        sum+=(L+i-1);
    }
    int min = 200000;
    int ans = 0;
    int mini;
    rep1(i,N) {
        ans = abs(L+i-1);

        if (ans < min) {
            min = ans;
            mini = i;
        } 
    }
    int answer = sum - (L+mini-1);
    cout << answer << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define ld long double
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define pb(x) push_back(x)
#define mp(a,b) make_pair(a,b)
#define ms(v,x) memset(v,x,sizeof(v))
#define all(v) v.begin(),v.end()
#define ff first
#define ss second
#define rep(i,l,r) for(int i = (int)l;i<(int)r;i++)
#define td(v) v.begin(),v.end()
#define sz(v) (int)v.size()
//#define M   1000000007 // 1e9 + 7
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
inline int mod(int n, int m){ int ret = n%m; if(ret < 0) ret += m; return ret; }
int gcd(int a, int b){return (b == 0 ? a : gcd(b, a%b));}
int exp(int a,int b,int m){
    
    if(b==0) return 1;
    if(b==1) return mod(a,m);
    int k = mod(exp(a,b/2,m),m);
    if(b&1){
        return mod(a*mod(k*k,m),m);
    }
    else return mod(k*k,m);
}

const int M = 1e9 +7;

int32_t main(){
	fastio;
  int n,k;
  cin>>n>>k;
  int val = n;
  int res=0;
  int mn = 0;
  for(int i=1;i<=n+1;i++){
   
    if(k<=i)res = (res + (val - mn+1))%M;
    val=(val + n-i);
    mn+=i;
  }
  res = mod(res,M);
  cout<<res<<endl;
}

Measured memory_bytes: 3652
N = int(input())
XY = [tuple(map(int,input().split())) for i in range(N)]

class UnionFind:
    def __init__(self,N):
        self.parent = [i for i in range(N)]
        self._size = [1] * N
        self.count = 0
    def root(self,a):
        if self.parent[a] == a:
            return a
        else:
            self.parent[a] = self.root(self.parent[a])
            return self.parent[a]
    def is_same(self,a,b):
        return self.root(a) == self.root(b)
    def unite(self,a,b):
        ra = self.root(a)
        rb = self.root(b)
        if ra == rb: return
        if self._size[ra] < self._size[rb]: ra,rb = rb,ra
        self._size[ra] += self._size[rb]
        self.parent[rb] = ra
        self.count += 1
    def size(self,a):
        return self._size[self.root(a)]

M = 10**5
uf = UnionFind(2*M)
for x,y in XY:
    a,b = x-1,y-1+M
    if uf.is_same(a,b): continue
    uf.unite(a,b)
for i in range(2*M):
    uf.root(i)

rt = []
for i in range(2*M):
    rt.append(uf.root(i))
from collections import Counter
xr = Counter(rt[:M])
yr = Counter(rt[M:])

ans = 0
for k,v in xr.items():
    ans += yr[k] * v
ans -= N
print(ans)

Measured memory_bytes: 55724
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	int a,b,s=0;
	cin>>n;
	for(int i=1;i<n;i++){
		a=i;
		b=n-i;
		for(int j=1;j<=sqrt(a);j++){
			if(a%j==0){
				if(a/j==j)s++;
				else s+=2;
			}
		}
	}
	cout<<s;
}

Measured memory_bytes: 3680
#include<iostream>
#define INF 10000000000000000
using namespace std;
typedef long long ll;

ll N, a[5];
ll m,ans;

int main() {
	m = INF;
	cin >> N;
	for (int i = 0; i < 5; i++) {
		cin >> a[i];
		if (a[i] < m) {
			m = a[i];
		}
	}
	
	ans = (N - 1) / m + 5;

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

Measured memory_bytes: 256
D,G = map(int, input().split())
pc = [list(map(int,input().split())) for _ in range(D)]

ans = 1 << 29
t = []
for bit in range(1<<D):
    score = 0
    f = 0
    # フラグが立ってる問題を全完
    for i in range(D):
        if bit & (1<<i):
            score += pc[i][0]*100*(i+1) + pc[i][1]
            f += pc[i][0]
            if score >= G: break
    # 全完した問題以外の中から点数の高い順に解いていく
    nokori = []
    for j in range(D):
        if not (bit & (1<<j)):
            nokori.append(pc[j] + [j+1])
    nokori = list(reversed(nokori))
    for d in nokori:
        for x in range(d[0]):
            if score >= G: break
            score += 100*(d[2])
            f += 1
        if score >= G: break
    ans = min(ans,f)
print(ans)


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

vector<int> bfs(vector<vector<int>> graph, int sv)
{
    int n = graph.size();
    vector<int> ans(n);
    vector<int> dist(n, -1);
    queue<int> que;
    dist[sv] = 0;
    que.push(sv);
    while (!que.empty())
    {
        int v = que.front();
        que.pop();
        for (int nv : graph[v])
        {
            if (dist[nv] != -1)
                continue;
            dist[nv] = dist[v] + 1;
            que.push(nv);
            ans[nv] = v;
        }
    }
    return ans;
}

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

    vector<vector<int>> g(n);
    rep (i, m)
    {
        int a, b;
        cin >> a >> b;
        g[a - 1].push_back(b - 1);
        g[b - 1].push_back(a - 1);
    }

    vector<int> ans = bfs(g, 0);
    cout << "Yes" << endl;
    rep (i, n - 1)
        cout << ans[i + 1] + 1 << endl;
    return 0;
}

Measured memory_bytes: 16284
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
const long long int sMod = 998244353;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    ll n;
    cin >> n;
    ll sum=0;
    repi(i,1,n){
        sum += (n-1)/i;
    }
    print(sum);
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

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


int main(void){
    // Your code here!
    int n,y;
    cin >> n  >> y;
    
    //どうやら全探索らしい。三重のループを回す
    for(int i=0;i<=n;i++){
        
        for(int j=0;i+j<=n;j++){
            int k = n-i-j;
             
            if(y == 10000*i+5000*j+1000*k) {
               cout << i <<" "<< j << " "<< k << endl;
                return 0;
            }
        
            
        }
        
        
        
    }
    //そんざいしないとき
    cout << -1 << " "<< -1 <<" " << -1;
    
  
}


Measured memory_bytes: 256