akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
 
using namespace std;
 
int main()
{
	int n;
 
	std::cin >> n;
 
	vector<int> a(n);
 
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
 
	int bairitu;
	for (int i = n - 1; i >= 0; i--) {
		bairitu = 2;
		for (int j = (i + 1) * bairitu; j <= n; j = (i + 1) * ++bairitu) {
			a[i] ^= a[j - 1];
		}
	}
 
	int count = 0;
	vector<int> ball(n);
	for (int i = 0; i < n; i++) {
		count += a[i];
	}
 
	cout << count << endl;
 
	for (int i = 0; i < n; i++) {
		if (a[i] == 1)
			cout << i + 1 << " ";
	}
	cout << endl;
 
	return 0;
}

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

using namespace std;

#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define pii pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< pii >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; cin >> x;
#define int2(x, y) Int(x); Int(y);
#define int3(x, y, z) Int(x); int2(y, z);
#define in(x, a, b) ((a) <= (x) && (x) < (b))
#define fir first
#define sec second
#define ffir first.first
#define fsec first.second
#define sfir second.first
#define ssec second.second
#define Decimal fixed << setprecision(10)

//int dxy[5] = {0, 1, 0, -1, 0};
// cmd

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

    string st1, st2;
    cin >> st1 >> st2;

    map<char, char> yui;
    rep(i, st1.size()) {
        if (!yui[st1[i]]) {
            yui[st1[i]] = st2[i];
        } else if (yui[st1[i]] != st2[i]) {
            cout << "No" << endl;
            return 0;
        }
    }
    map<char, char> kyoko;
    rep(i, st2.size()) {
        if (!kyoko[st2[i]]) {
            kyoko[st2[i]] = st1[i];
        } else if (kyoko[st2[i]] != st1[i]) {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;

    return 0;
}


Measured memory_bytes: 916
//package solution;

import java.io.*;
import java.util.*;
import java.math.*;
import java.awt.Point;

public final class Main {
    BufferedReader br;
    StringTokenizer stk;

    public static void main(String[] args) throws Exception {
        new Main().run();
    }
    
    {
        stk = null;
        br = new BufferedReader(new InputStreamReader(System.in));
    }
    
    void run() throws Exception {
        int n = ni();
        long[][] dp = new long[n][3];
        for(int i=0; i<n; i++)
            for(int j=0; j<3; j++)
                dp[i][j] = nl();
        if(n == 1) {
            pl(Math.max(dp[0][0], Math.max(dp[0][1], dp[0][2])));
            return;
        }
        for(int i=1; i<n; i++) {
            dp[i][0] += Math.max(dp[i-1][1], dp[i-1][2]);
            dp[i][1] += Math.max(dp[i-1][0], dp[i-1][2]);
            dp[i][2] += Math.max(dp[i-1][0], dp[i-1][1]);
        }
        pl(Math.max(dp[n-1][0], Math.max(dp[n-1][1], dp[n-1][2])));
    }
    
    //Reader & Writer
    String nextToken() throws Exception {
        if (stk == null || !stk.hasMoreTokens()) {
            stk = new StringTokenizer(br.readLine(), " ");
        }
        return stk.nextToken();
    }

    String nt() throws Exception {
        return nextToken();
    }

    String ns() throws Exception {
        return br.readLine();
    }

    int ni() throws Exception {
        return Integer.parseInt(nextToken());
    }

    long nl() throws Exception {
        return Long.parseLong(nextToken());
    }

    double nd() throws Exception {
        return Double.parseDouble(nextToken());
    }

    void p(Object o) {
        System.out.print(o);
    }

    void pl(Object o) {
        System.out.println(o);
    }
    
    void selector() {
        Random rd = new Random();
        String[] s = new String[] {"Strings", "Sorting", "Search"
                , "Graph theory", "Greedy", "Dynamic programming"
                , "Constructive algos", "Bit manipulation", "Recursion"};
        pl(s[rd.nextInt(s.length)] + " " + (rd.nextInt(5)+1));
    }
}

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

int main(){
        int a, b;
        char op;
        while(1){
        cin >> a >> op >> b;
        if (op == '?') break;

        if (op == '+') cout << a+b <<endl;
        else if ( op == '-') cout << a -b << endl;
        else if ( op == '*' ) cout << a * b << endl;
        else if ( op == '/' ) cout << a / b << endl;
        }
        return 0;
}

Measured memory_bytes: 1164
#pragma region head
    #include <bits/stdc++.h>
    using namespace std;
    using ll = long long;
    using vi = vector<int>;
    using vll = vector<ll>;
    using pi = pair<int, int>;
    using pll = pair<ll,ll>;
    template <class T> using vv = vector<vector<T>>;
    #define rep(i,n) for(int i = 0; i < (int)(n); i++)
    #define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
    #define rrep(i,n) for(int i = (int)(n)-1; i >= 0; i--)
    #define rrepi(i,a,b) for(int i = (int)(b)-1; i >= (int)(a); i--)
    const int INF = 1002003004;
    const ll LINF = 1002003004005006007ll;
    struct preprocess{preprocess()
    {cin.tie(nullptr);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}}____;
#pragma endregion head

#pragma region library
struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n=1):n(n), f(n+1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.emplace_back(i);
      f[i] = i;
      for (ll j = i*i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x;}
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.emplace_back(f[x]);
      x /= f[x];
    }
    return res;
  }
};

#pragma endregion library

int main(){
    const int MX = 100005;
    Sieve sv(MX);
    vi ac(MX/2);
    repi(i,1,MX/2){
        if(sv.isPrime(2*i-1)&&sv.isPrime(i)){
            ac[i]=ac[i-1]+1;
        } else ac[i]=ac[i-1];
    }
    int q; cin >> q;
    while(q--){
        int l,r; cin >> l >> r;
        cout << ac[(r+1)/2]-ac[(l-1)/2] << '\n';
        

    }
}

Measured memory_bytes: 1408
// AUTHOR : Kishan Srivastav
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007
#define in freopen("input.txt", "r", stdin)
#define out freopen("output.txt", "w", stdout)
#define ios ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);


int main() {
	ios
#ifndef ONLINE_JUDGE
	in;
	out;
#endif
	int n,k;
	cin>>n>>k;
	int count=0;
	int a[n];
	for (int i = 0; i < n; i++){
		cin>>a[i];
		if(a[i] >= k){
			count++;
		}
	}
	cout<<count<<endl;


}

Measured memory_bytes: 3932
#include <stdio.h>

int main()
{
  int a,b;
  char o;
  while(1){
  scanf("%d %c %d",&a,&o,&b);
  if(o=='+'){printf("%d\n",a+b); }
  else if(o=='-') {printf("%d\n",a-b); }
  else if(o=='*') {printf("%d\n",a*b); }
  else if(o=='/') {printf("%d\n",a/b); }
  else{break;}
  }
  return 0;
}

Measured memory_bytes: 600
package main

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

const max = 2000000000

// 反転数
func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Scan()
	n, _ := strconv.Atoi(sc.Text())
	A := make([]int, n)
	for i := 0; i < n; i++ {
		sc.Scan()
		A[i], _ = strconv.Atoi(sc.Text())
	}

	fmt.Println(mergeSort(A, n, 0, n))
}

func merge(A []int, n, left, mid, right int) int {
	n1 := mid - left
	n2 := right - mid
	L, R := make([]int, n1+1), make([]int, n2+1)
	for i := 0; i < n1; i++ {
		L[i] = A[left+i]
	}
	for i := 0; i < n2; i++ {
		R[i] = A[mid+i]
	}
	L[n1], R[n2] = max, max

	cnt := 0
	i, j := 0, 0
	for k := left; k < right; k++ {
		if L[i] <= R[j] {
			A[k] = L[i]
			i++
			continue
		}
		A[k] = R[j]
		j++
		cnt += n1 - i
	}
	return cnt
}

func mergeSort(A []int, n, left, right int) int {
	if left+1 < right {
		mid := (left + right) / 2
		v1 := mergeSort(A, n, left, mid)
		v2 := mergeSort(A, n, mid, right)
		v3 := merge(A, n, left, mid, right)
		return v1 + v2 + v3
	}
	return 0
}



Measured memory_bytes: 7916
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,k; cin>>n>>k;
    ll arr[n],dp[n+1]={};
    for(ll i=1;i<=n;i++)
    {
      cin>>arr[i];
    }
    dp[1]=0;
    for(ll i=2;i<=n;i++)
    { ll mini=LONG_LONG_MAX;
      for(int t=1;t<=k && i-t>=1;t++)
      {
       mini=min(mini,abs(arr[i]-arr[i-t])+dp[i-t]);
      }
    dp[i]=mini;
    }
     cout<<dp[n];
      return 0;
}


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

int main() {
    ll N;
    cin >> N;
    if (N % 2 == 1) {
        cout << 0 << endl;
        return 0;
    }
    ll ans = N / 10;
    N /= 10;
    while (N > 0) {
        ans += N / 5;
        N /= 5;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<queue>
#include<vector>
using namespace std;
vector<priority_queue<long long>>v;
int main()
{
    long long n,T,flag,t,x;
    cin>>n>>T;
    v.resize(n);
    while(T--)
    {
        cin>>flag>>t;
        switch(flag)
        {
        case 0:
            cin>>x;
            v[t].push(x);
            break;
        case 1:
            if(v[t].empty()!=true)
            {
                cout<<v[t].top()<<endl;
            }
            break;
        case 2:
             if(v[t].empty()!=true)
            {
                v[t].pop();
            }
            break;
        }

    }
    return 0;
}



Measured memory_bytes: 5148
#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;


static const double EPS = 1e-8;

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

char stage[101][101];
int W,H;

string larger(const string& str1,const string& str2){
	if(str1.size() > str2.size()) return str1;
	if(str1.size() < str2.size()) return str2;

	for(int i=0;i<str1.size();i++){
		if(str1[i] > str2[i] ) return str1;
		if(str1[i] < str2[i] ) return str2;
	}

	return str1;
}

int main()
{
	while(~scanf("%d %d",&W,&H)){
		if(W==H && H==0) break;
		for(int y=0;y<H;y++){
			char buf[128];
			scanf("%s",buf);
			for(int x=0;x<W;x++){
				stage[y][x] = buf[x];
			}
		}

		string dp[101][101];

		for(int y=0;y<H;y++){
			for(int x=0;x<W;x++){
				string left="";
				if(isdigit(stage[y][x])){
					if(!(dp[y+1][x].size() == 0 && stage[y][x]=='0')){
						left = dp[y+1][x] + stage[y][x];
					}
				}

				string up="";
				if(isdigit(stage[y][x])){
					if(!(dp[y][x+1].size() == 0 && stage[y][x]=='0')){
						up = dp[y][x+1] + stage[y][x];
					}
				}

				dp[y+1][x+1] = larger(left,up);
			}
		}

		string res="0";
		for(int y=0;y<=H;y++){
			for(int x=0;x<=W;x++){	
				res = larger(res,dp[y][x]);
			}
		}
		cout << res << endl;
	}

}

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

using ll = long long int;

const int MAX = (int)(1e5 + 5);
const ll INF = (ll)(1e10 + 5);

const int MAX_N = (int)(1e5 + 5);

int n;
ll a[MAX_N];

unordered_map<ll, int> amp;
ll arr[MAX_N];

int main(void) {
  // Here your code !
  scanf("%d", &n);

  for (int i = 0; i < n; ++i) {
    scanf("%lld", &(a[i]));
  }
  
  for (int i = 1; i < n; ++i) {
    amp[a[i]] += 1;
  }

  arr[0] = a[0];

  bool not_found = true;

  for (int i = 1; i < n; ++i) {
    amp[a[i]] -= 1;
    ll tmp = arr[0] ^ a[i];

    if (amp[tmp] > 0) {
      arr[1] = a[i];
      not_found = false;
      break;
    }

    amp[a[i]] += 1;
  }

  if (not_found) {
    printf("No\n");
    return 0;
  }

  for (int i = 2; i < n; ++i) {
    ll tmp = arr[i - 2] ^ arr[i - 1];

    if (amp[tmp] <= 0) {
      printf("No\n");
      return 0;
    }

    amp[tmp] -= 1;
    arr[i] = tmp;
  }

  if (arr[n - 2] ^ arr[0] == arr[n - 1]) {
    printf("Yes\n");
  }
  else {
    printf("No\n");
  }

  return 0;
}


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

int main(){
	int a,b,t;
	cin >> a >> b >> t;
	int cnt=0;
	for(int i=1;i<t+1;i++){
		if(i%a==0) cnt+=b;
	}
	cout << cnt << endl;
	return 0;
}


Measured memory_bytes: 256
def solve(s):
	res = set([s])
	for split_at in range(1, len(s)):
		a = s[:split_at]
		b = s[split_at:]
		res.add(a[::-1] + b)
		res.add(a + b[::-1])
		res.add(a[::-1] + b[::-1])
		res.add(b + a)
		res.add(b[::-1] + a)
		res.add(b + a[::-1])
		res.add(b[::-1] + a[::-1])
	return len(res)

N = int(input())
for _ in range(N):
	print(solve(input()))



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

void fnInput(int& rnMaxNum)
{
  cin >> rnMaxNum;
}

int64_t fnToInt(const vector<char>& cnrvcNum)
{
  const vector<int> cnvnDgt = {0, 3, 5, 7};
  int64_t nRtn = 0;
  int nNumPos = 0;

  for (int i = cnrvcNum.size() - 1; i >= 0; i--)
  {
    if (cnrvcNum[i] == '0') break;
    nRtn += cnvnDgt[ cnrvcNum[i] - '0' ] * pow(10.0, nNumPos++);
  }

  return nRtn;
}

int fnDgt753_Check(const vector<char>& cnrvcNum)
{
  int nDgt3 = 0, nDgt5 = 0, nDgt7 = 0;

  for (int i = 0; i < cnrvcNum.size(); i++)
    if      (cnrvcNum[i] == '1') nDgt3++;
    else if (cnrvcNum[i] == '2') nDgt5++;
    else if (cnrvcNum[i] == '3') nDgt7++;

  if (nDgt3 && nDgt5 && nDgt7)
    return 1;
  else
    return 0;
}

int fnDgt753_Count(int nMaxNum)
{
  int nDgt753Cnt = 0;
  int nDgtSiz = to_string(nMaxNum).size();
  vector<char> vcNum(nDgtSiz + 1, '0');

  while (fnToInt(vcNum) <= nMaxNum) 
  {
    if (fnDgt753_Check(vcNum)) nDgt753Cnt++;

    vcNum[vcNum.size() - 1]++;
    for (int i = vcNum.size() - 1; i > 0; i--)
      if (vcNum[i] > '3')
      {  
        vcNum[i - 1]++;
        vcNum[i] = '1';
      }
      else
        break;
  }

  return nDgt753Cnt;
}

int main()
{
  int nMaxNum;

  fnInput(nMaxNum);
  cout << fnDgt753_Count(nMaxNum) << endl;

  return 0;
}

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

int main(){
  int n;
  cin >> n;
  int p[n];
  for(int i=0;i<n;i++){
    cin >> p[i];
  }
  int ans=0;
  for(int i=1;i<n-1;i++){
    if(p[i-1]>p[i]&&p[i]>p[i+1])ans++;
    if(p[i-1]<p[i]&&p[i]<p[i+1])ans++;
  }

  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<math.h>
#include<iomanip>
#include<algorithm>
#include<set>
#include<map>
#include<cmath>
#include<string>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
typedef long long int llint;
typedef pair<ll, ll> pa;
#define MM 1000000000
#define MOD MM+7
#define MAX 101000
#define MAP 110
#define initial_value -1
#define MAX_T 1001
#define Pair pair<int,int>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define INF (1 << 29) //536870912
const long double PI = acos(-1);
const ll DEP = 1e18;
int dx[4] = {-1,0,1,0};
int dy[4] = {0,-1,0,1};
ll N;
ll a[200002];
vector<ll> sum(0);
int main(){
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> a[i];
        sum.push_back(a[i] - i - 1);
    }
    ll ans = 0;
    ll tmp = 0;
    sort(sum.begin(),sum.end());
    ll bi = sum[N/2 - 1];
    for(int i = 0; i < N; i++){
        ans += abs(sum[i] - bi);
    }
    ll bz = sum[N/2];
    for(int i = 0; i < N; i++){
        tmp += abs(sum[i] - bz);
    }
    cout << min(tmp,ans) << endl;
}



Measured memory_bytes: 3444
#include <bits/stdc++.h>
#define ALL(obj) begin(obj), end(obj)
#define debug(x) cerr << #x << ": " << x << '\n'
using namespace std;
template <class T>
vector<T> make_vec(size_t a) {
    return vector<T>(a);
}
template <class T, class... Ts>
auto make_vec(size_t a, Ts... ts) {
    return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}
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;
}

using ll = long long;
using ull = unsigned long long;
const int INF = 1e9;
// const int MOD = 1e9 + 7;

int main() {
    int N, K;
    cin >> N >> K;
    if (K <= (N - 1) * (N - 2) / 2) {
        int add = ((N - 1) * (N - 2) / 2 - K);
        int M = N - 1 + add;
        cout << M << endl;
        for (int i = 1; i < N; i++) {
            cout << 1 << " " << i + 1 << "\n";
        }
        int cnt = 0;
        for (int i = 1; i < N; i++) {
            for (int j = i + 1; j < N; j++) {
                if (cnt == add) return 0;
                cout << i + 1 << " " << j + 1 << "\n";
                cnt++;
            }
        }
        return 0;
    }
    cout << -1 << endl;
}


Measured memory_bytes: 3636
#include  <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <iostream>

using namespace std;

int n;
int l;
vector<string> s;
string stemp;
int i;

int main(){
	scanf("%d%d",&n,&l);
	for(i=0;i<n;i++){
		cin >> stemp;
		s.push_back(stemp);
	}
	sort(s.begin(),s.end());
	for(i=0;i<n;i++){
		cout << s[i];
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int main()
{
  io;
  ll t;
  cin>>t;
  if(t==0)
  cout<<"1\n";
  else if(t==1)
  cout<<"0\n";
  return 0;
}


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

struct LevenshteinDistance {
    vector<vector<int>> dp;
    int diff(string& S, string& T) {
        dp.resize(S.size() + 1);
        for (auto&& v : dp) v.assign(T.size() + 1, INT32_MAX / 2);
        for (int i = 0; i <= (int)S.size(); ++i) dp[i][0] = i;
        for (int j = 0; j <= (int)T.size(); ++j) dp[0][j] = j;
        for (int i = 0; i < (int)S.size(); ++i) {
            for (int j = 0; j < (int)T.size(); ++j) {
                dp[i + 1][j + 1] = dp[i][j] + (S[i] != T[j]);
                dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i + 1][j] + 1);
                dp[i + 1][j + 1] = min(dp[i + 1][j + 1], dp[i][j + 1] + 1);
            }
        }
        return dp[S.size()][T.size()];
    }
};

int main() {
    string s1, s2;
    cin >> s1 >> s2;
    LevenshteinDistance ld;
    cout << ld.diff(s1, s2) << endl;
}


Measured memory_bytes: 6860
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned int u32;
typedef pair<int, int> p;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int Inf = (1<<30);
ll inf = (1LL<<60);
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
int main() {
	ll n, a, b;
	cin >> n >> a >> b;
	if ((b - a) % 2 == 0) {
		cout << (b - a) / 2;
		return 0;
	}
	else {
		ll dist = (b - a + 1) / 2;
		ll D = min(a - 1, n - b);
		cout << D + dist;
		return 0;
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;
struct da
{
	int i,s;
}a[100010];
bool operator<(da p1,da p2)
{
	if(p1.s<p2.s)return 1;
	else return 0;
}
int main(void)
{
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
	a[i].i=i;
	for(int i=1;i<=n;i++)
	cin>>a[i].s;
	sort(&a[1],&a[1+n]);
	cout<<a[1].i;
	for(int i=2;i<=n;i++)
	cout<<' '<<a[i].i;
	return 0;
}

Measured memory_bytes: 1536
using System;
using System.Collections.Generic;
using System.Linq;
using static Scanner;

class Program
{
    static void Main() => new Program().Solve();

    public void Solve()
    {
        int n = ReadInt();
        int x = -n % 1000;
        if (x < 0) x += 1000;
        Console.WriteLine(x);
    }
}

static class Scanner
{
    static Queue<string> que = new Queue<string>();
    public static string Read() { if (!que.Any()) foreach (var s in Console.ReadLine().Split()) que.Enqueue(s); return que.Dequeue(); }
    public static int ReadInt() => int.Parse(Read());
    public static long ReadLong() => long.Parse(Read());
    public static double ReadDouble() => double.Parse(Read());
    public static decimal ReadDecimal() => decimal.Parse(Read());
    public static IEnumerable<string> Read(long n) { for (long i = 0; i < n; i++) yield return Read(); }
    public static IEnumerable<int> ReadInt(long n) => Read(n).Select(int.Parse);
    public static IEnumerable<long> ReadLong(long n) => Read(n).Select(long.Parse);
    public static IEnumerable<double> ReadDouble(long n) => Read(n).Select(double.Parse);
    public static IEnumerable<decimal> ReadDecimal(long n) => Read(n).Select(decimal.Parse);
}


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

using namespace std;

template <typename A, typename B>
string to_string(pair<A, B> p);
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p);
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p);
string to_string(const string& s) {
    return '"' + s + '"';
}
string to_string(const char* s) {
    return to_string((string) s);
}
string to_string(bool b) {
    return (b ? "true" : "false");
}
string to_string(vector<bool> v) {
    bool first = true;
    string res = "{";
    for (int i = 0; i < static_cast<int>(v.size()); i++) {
        if (!first) {
            res += ", ";
        }
        first = false;
        res += to_string(v[i]);
    }
    res += "}";
    return res;
}
template <size_t N>
string to_string(bitset<N> v) {
    string res = "";
    for (size_t i = 0; i < N; i++) {
        res += static_cast<char>('0' + v[i]);
    }
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for (const auto &x : v) {
        if (!first) {
            res += ", ";
        }
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p) {
    return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A, typename B, typename C>
string to_string(tuple<A, B, C> p) {
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ")";
}
template <typename A, typename B, typename C, typename D>
string to_string(tuple<A, B, C, D> p) {
    return "(" + to_string(get<0>(p)) + ", " + to_string(get<1>(p)) + ", " + to_string(get<2>(p)) + ", " + to_string(get<3>(p)) + ")";
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}
#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif
//Auther: Arin Roday
#define vec vector
#define i64 long long
#define endl '\n'
#define sz(x) (x).size()
#define times(n) for(int i = 0; i < (n); ++i)

void solve(){
    int n; cin >> n;
    int r = 7 % n;
    int pos = 1;
    set<int> s;
    while(s.count(r) != 1){
        // cout << "in" << endl;
        if(r == 0){
            cout << pos << endl;
            return;
        }
        pos ++;
        s.insert(r);
        r = ((r * 10) + 7) % n;
    }
    cout << -1 << endl;
}

int main(){
    // cout << "start" << endl;
    solve();
}


Measured memory_bytes: 50480
from sys import stdin
n, m = map(int, stdin.readline().split())
G = [-1] * n
def root(x):
    if G[x] < 0: return x
    G[x] = root(G[x])
    return G[x]
def uniteSet(x, y):
    x = root(x)
    y = root(y)
    if x == y : return
    if G[x] > G[y] : x, y = y, x
    G[y] = x
for i in range(0, m):
    s, t = map(int, stdin.readline().split())
    uniteSet(s, t)
q = int(stdin.readline())
for i in range(0, q):
    s, t = map(int, stdin.readline().split())
    print("yes" if root(s) == root(t) else "no")

Measured memory_bytes: 10008
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <bitset>
#include <cmath>
#include <string>
#include <fstream>
#define FI first
#define SE second
#define VE vector<int>
#define PB push_back
#define PA pair<int,int>
#define MA make_pair
#define LL long long
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ROF(i,a,b) for(int i=b-1;i>=a;i--)
#define YES(i) cout<<(i?"YES":"NO")<<endl
#define Yes(i) cout<<(i?"Yes":"No")<<endl
#define POS(i) cout<<(i?"POSSIBLE":"IMPOSSIBLE")<<endl
using namespace std;
//
const int INF=1e9+7;
const int MOD=1e9+7;
//
 
int main(){
    int n; cin>>n;
    int a[100001]={0};
    int now;
    FOR(i,0,n){
        cin>>now;
        if(now==i+1){
            a[i]++;
        }
    }
    int t=0, ans=0;
    while(t<n){
        if(a[t]==1){
            ans++;
            t+=2;
        }else{
            t++;
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

int main(void)
{
    IOS
    int a, b;
    cin >> a >> b;
    if (a <= 8 && b <= 8) OUT("Yay!")
    else OUT(":(")

    return 0;
}

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

int main(int argc, char const* argv[])
{
    int n, m, c;

    std::cin >> n >> m >> c;

    auto b_vec = std::vector<int>(m);
    for(auto &b: b_vec)
    {
        std::cin >> b;
    }

    int result = 0;
    for(int i=0; i < n; ++i)
    {
        int tmp = 0;
        for(auto v: b_vec)
        {
            int ai;
            std::cin >> ai;
            tmp += v * ai;
        }
        tmp += c;
        if(tmp > 0)
        {
            result++;
        }
        /* std::cout << "tmp: " << tmp << std::endl; */
    }
    std::cout << result << std::endl;

    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using ulli = unsigned long long int;
#define debug(x) cerr << #x << " : " << x << endl
#define debugv(x) cerr << #x << " : {";for(auto value_of_x:x){ cerr << value_of_x << ", ";}cerr << endl


namespace atcoder {
	template<typename T>
	T ncr(T left, T right) {
		right = min(left - right, right);
		T ans = 1;
		for (T i = 1; i <= right; i++) {
			ans = ans * (left - right + i) / i;
		}
		return ans;
	}

	const int MOD = 1000000007;
	const lli LIMIT = 1'0'000'000'000'000'000 * 5;
	const int tenfive = 100000;
}

using namespace atcoder;


int main() {
	int N;
	lli M;
	cin >> N >> M;
	vector<pair<lli, lli>> D(N);
	for (int i = 0; i < N; i++) {
		cin >> D[i].first >> D[i].second;
	}
	sort(D.begin(), D.end());
	lli ans = 0;
	for (int i = 0; i < N; i++) {
		if (D[i].second >= M) {
			ans += D[i].first * M;
			break;
		}
		else {
			ans += D[i].first * D[i].second;
			M -= D[i].second;
		}
	}
	cout << ans << endl;
	return 0;
}


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

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

using namespace std;

int main() {
  ll ans = 0;
  ll n;
  cin >> n;

  REP(i,int(sqrt(n)) + 1) {
    if(n%(i+1) == 0) {
      ll m = n/(i+1);
      ll l = i+1;
      if(m != 1) {
        if(n%(m-1) == n/(m-1)) {
          ans += m-1;
        }
      }

      if(l != 1) {
        if(n%(l-1) == n/(l-1)) {
          ans += l-1;
        }
      }
    }
  }

  cout << ans << endl;


}


Measured memory_bytes: 384
import itertools
 
n=int(input())
H,L=[[] for _ in range(n)],[[] for _ in range(n)]
 
for i in range(n):
  m=int(input())
  for j in range(m):
    x,y=map(int,input().split())
    if y==1:
      H[i].append(x-1)
    else:
      L[i].append(x-1)
      
N=set(range(n))
ans=0
for num in range(1,n+1):
  pat=set(itertools.combinations(range(n),num))
  for h in pat:
      h=set(h)
      num=len(h)
      nh=N-h
      t=sum([H[i] for i in h],[])
      l=sum([L[i] for i in h],[])
      if set(t)<=h and set(l)<=nh:
        ans=max(ans,num)
print(ans)

Measured memory_bytes: 6892
#include<bits/stdc++.h>
#define ll long long
#define N 200002
#define inf 2147483647
using namespace std;
inline int read(){
    int x=0; bool f=1; char c=getchar();
    for(;!isdigit(c); c=getchar()) if(c=='-') f=0;
    for(; isdigit(c); c=getchar()) x=(x<<3)+(x<<1)+(c^'0');
    if(f) return x;
    return 0-x;
}
int n; ll ans;
struct num{int x,y,id;}s[N<<1];
inline bool cmp(num a, num b){return a.x<b.x;}
int main(){
    n=read();
    int a,b, lmin=inf, lmax=0, rmin=inf, rmax=0, minx, maxx;
    for(int i=1; i<=n; ++i){
        a=read(), b=read(); if(a>b) swap(a,b);
        s[i]=(num){a,b,i};
        if(a<lmin) lmin=a, minx=i; lmax=max(lmax,a);
        rmin=min(rmin,b); if(b>rmax) rmax=b, maxx=i;
    }
    ans = (ll)(lmax-lmin) * (rmax-rmin);
     
    if(minx!=maxx){
        sort(s+1,s+n+1,cmp);
        int mx=s[1].y, mn=mx, tmp=s[n].x-s[1].x;
        for(int i=1; i<=n; ++i){
            mx=max(mx,s[i].y), mn=min(mn,s[i].y);
            tmp = min(tmp, max(mx,s[n].x)-min(mn,s[i+1].x));
        }
        ans = min(ans, (ll)tmp*(rmax-lmin));
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 4352
n = int(input())
s = input()

r = []
g = []
b = []
for i in range(n):
    if s[i]=="R":
        r.append(i)
    elif s[i]=="G":
        g.append(i)
    elif s[i]=="B":
        b.append(i)
    else:
        pass
# print(r,g,b)
count = 0
for i in range(n):
    x = s[i]
    for sa in range(n):
        j = i + sa
        k = j + sa
        if j<n:
            y = s[j]
        else:
            break
        if k<n:
            z = s[k]
        else:
            break
        if x!=y and y!=z and z!=x:
            count += 1
# print(count)
ans = len(r) * len(g) * len(b) - count
print(ans)

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


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

  bool bus = false;
  if (s.at(0)!=s.at(1)) {
    bus = true;
  }
  if (s.at(0)!=s.at(2)) {
    bus = true;
  }
  if (s.at(2)!=s.at(1)) {
    bus = true;
  }

  if (bus) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In, ' '));

            return;
        }

        public void Solve(ConsoleInput cin)
        {

            var N = cin.ReadInt;
            var d = cin.ReadIntArray(N);

            Array.Sort(d);
            var Left = d[N / 2 - 1];
            var Right = d[N / 2];
            if (Left == Right){
                Console.WriteLine("0");
                return;
            } else {
                Console.WriteLine(Right - Left);
                return;
            }

        }
    }

    public static class Extensions
    {
        public static string Reverse(this string sourse)
        {
            char[] chrAry = sourse.ToCharArray();
            Array.Reverse(chrAry);
            return new string(chrAry);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
    }
}


Measured memory_bytes: 22752
#include <bits/stdc++.h>
#define repr(i,from,to) for(int (i)=(from);(i)<(to);(i)++)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
// const bool debug=true;
const bool debug=false;
#define DEBUG if(debug==true)
#define all(x) begin((x)), end((x))
#define vprint(x) for(auto a:(x)) cout << x << endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) { a = b; return true;}
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) { a = b; return true;}
    return false;
}
int main(void) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;cin>>n;
    vector<ll> a(n);
    rep(i,n) cin>>a[i];
    vector<ll> count(100010,0);
    ll res = 1;
    count[0] = 3;
    rep(i,n) {
        res *= count[a[i]]; 
        res %= MOD;
        count[a[i]]--;
        count[a[i]+1]++;
    }
    cout << res << endl;
    return 0;
}


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

int c[33], s[444][33];
int main() {
    int d;
    cin >> d;
    for(int i = 0; i < 26; i++)
        cin >> c[i];
    for(int i = 0; i < d; i++)
        for(int j = 0; j < 26; j++)
            cin >> s[i][j];
    stringstream ss[36];
    int M = -1e9, tt;
    for(int a = 0; a < 6; a++) {
        for(int b = 0; b < 6; b++) {
            int r = 0, l[33] = {};
            for(int i = 0; i < d; i++) {
                auto m = 0.;
                int t = 0;
                for(int j = 0; j < 26; j++) {
                    double p = s[i][j];
                    p += c[j] * (i + 1 - l[j]) * .2 * a;
                    for(int k = 1; k < 10; k++)
                        if(i + k < d)
                            p -= s[i + k][j] * (10 - k) * .05 * b;
                    if(p > m)
                        m = p, t = j;
                }
                ss[a * 6 + b] << t + 1 << '\n';
                l[t] = i + 1;
                r += s[i][t];
                for(int j = 0; j < 26; j++)
                    r -= c[j] * (i + 1 - l[j]);
            }
            if(r > M)
                M = r, tt = a * 6 + b;
        }
    }
    cout << ss[tt].str();
    cerr << M << endl;
    return 0;
}


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



int main(){
   int a,b,c;
   cin >> a >> b >> c ;
   cout << min(a+b,min(a+c,b+c)) << endl;
    return 0;
}

Measured memory_bytes: 256
# input()
# int(input())
# map(int, input().split())
# list(map(int, input().split()))
# list(map(int, list(input()))) # スペースがない数字リストを読み込み
import math
import fractions
import sys
import bisect
import heapq  # 優先度付きキュー(最小値取り出し)
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr


# a^n
def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod


# n*(n-1)*...*(l+1)*l
def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a

# Union Find
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

# 約数生成
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors

inf = 10 ** 18
mod = 10 ** 9 + 7

x,k,d = lr()
dis = abs(x)
if k*d < dis:
    print(dis-k*d)
else:
    tmp = dis//d
    ret = k-tmp
    if ret%2 == 0:
        print(dis-tmp*d)
    else:
        print(abs(dis-(tmp+1)*d))


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

int main()
{
    long long N;
    cin >> N;
    long long ans = 0;
    if (N % 2 == 0)
    {
        long long num = 1;
        ans += N / 10;
        num = 5;
        rep(i, 26)
        {
            ans += N / (10 * num);
            num *= 5;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define MO 1000000007
#define mem(a,s) memset(a,s,sizeof(a))
#define IOS ios_base::sync_with_stdio(0); cin.tie(NULL);
#define lop(i,s,e) for(int i=s;i<e;i++)
#define lopi(i,s,e) for(int i=s;i>=e;i--)
#define prina(a,n) for(int i=0;i<=n;i++)cout<<a[i]<<" ";cout<<endl; 
#define prin2da(a,n,m) lop(i,1,n){lop(j,1,m)cout<<a[i][j]<<" ";cout<<endl;}
#define atout(v) for(auto x:v) cout<<x<<" ";cout<<endl;
#define atin(v) for(auto &x:v) cin>>x;
#define vl vector<ll >
#define vi vector<int >
#define lb lower_bound
#define ub upper_bound
#define sort(a) sort(a.begin(),a.end())  
#define mp make_pair
#define all(v) v.begin(),v.end() 
#define pll pair<ll,ll>
using namespace std;

void solve() {
    ll n;
    cin>>n;
    string ans;
    lop(i,0,n) ans+="ACL";
    cout<<ans<<endl;
    return;
}

int main() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

    ll t=1;
    while(t--) {
        solve();
    }

    return 0;
}

Measured memory_bytes: 3600
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double EPS = 1e-9;
typedef pair<int, int> P;
typedef unsigned int ui;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
int main() {
	int n, m, k;
	while (cin >> n >> m >> k, n) {
		if (n > 1) {
			double r = 1; double out = 0;
			rep(i, n) {
				r *= m;
			}
			ll cnt = 0; int dp[1000] = {};
			dp[0] = 1;
			rep(i, n) {
				for (int j = 999; j >= 0; j--) {
					rep1(k, m) {
						if (j + k < 1000) {
							dp[j + k] += dp[j];
						}
					}
					dp[j] = 0;
				}
			}
			rep(i, 1000) {
				int x = i - k;
				if (x <= 0)x = 1;
				out += ((ll)dp[i] * (ll)x)/r;
			}
			cout << fixed << setprecision(8) << out << endl;
		}
		else {
			double out = 0;
			rep1(i, m) {
				int x = i - k;
				if (x <= 0)x = 1;
				out += x/(double)m;
			}
			cout << fixed << setprecision(8) << out << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 3200
#pragma GCC optimize("O3")

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

#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i,n) for(ll i=0;i<(n);++i)
#define rep2(i,a,n) for(ll i=a;i<(n);++i)
#define repr(i,n) for(ll i=n;i>=0; --i)
#define repr2(i,a,n) for(ll i=n;i>=a; --i)
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define vi vector<int>
#define vb vector<bool>
#define vll vector<ll>
#define vpi vector<pii>
#define vpll vector<pll>

#define INT(...) int __VA_ARGS__;IN(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;IN(__VA_ARGS__)
#define ULL(...) ull __VA_ARGS__;IN(__VA_ARGS__)
#define STR(...) string __VA_ARGS__;IN(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__;IN(__VA_ARGS__)
#define DBL(...) double __VA_ARGS__;IN(__VA_ARGS__)
#define LD(...) ld __VA_ARGS__;IN(__VA_ARGS__)

int scan(){ return getchar(); }
void scan(int& a){ cin>>a; }
void scan(long long& a){ cin>>a; }
void scan(char &a){cin>>a;}
void scan(double &a){ cin>>a; }
void scan(long double& a){ cin>>a; }
void scan(char a[]){ scanf("%s", a); }
void scan(string& a){ cin >> a; }
template<class T> void scan(vector<T>&);
template<class T, size_t size> void scan(array<T, size>&);
template<class T, class L> void scan(pair<T, L>&);
template<class T, size_t size> void scan(T(&)[size]);
template<class T> void scan(vector<T>& a){ for(auto& i : a) scan(i); }
template<class T> void scan(deque<T>& a){ for(auto& i : a) scan(i); }
template<class T, size_t size> void scan(array<T, size>& a){ for(auto& i : a) scan(i); }
template<class T, class L> void scan(pair<T, L>& p){ scan(p.first); scan(p.second); }
template<class T, size_t size> void scan(T (&a)[size]){ for(auto& i : a) scan(i); }
template<class T> void scan(T& a){ cin >> a; }

void IN(){}
template <class Head, class... Tail> void IN(Head& head, Tail&... tail){ scan(head); IN(tail...); }

#define ios cin.tie(NULL), ios_base::sync_with_stdio(false)
#define cfs(n) cout<<fixed<<setprecision((n))
#define endl '\n'
#define ret return 0

constexpr ll mod=998244353;
constexpr ll mod2=10e9+7;
const double PI = 3.1415926535897932384626433832795028841971; //acos(-1)

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

int main(){
  ios; cfs(15);
  STR(s);
  STR(t); 
  string ans="Yes";
  rep(i, s.size()) {
    if(s[i]!=t[i]) {
      ans = "No";
      break;
    }
  }
  cout<<ans<<endl;
  ret;
}

Measured memory_bytes: 3624
n, y = map(int, input().split())

for a in range(n+1):
    for b in range(n-a+1):
        c = n-a-b
            
        if(10000*a + 5000*b + 1000*c == y):
            print(a, b, c)
            quit()

print("-1 -1 -1")

Measured memory_bytes: 3060
A,B,C,K = map(int,input().split())
result = 0
if K <= A:
  result += 1 * K
else:
  result += 1 * A
  K = K - A
  if K <= B:
    result += 0 * K
  else:
    result += 0 * K
    K = K -B
    if K <= C:
      result += (-1) * K
    else:
      result += (-1) * K
print(result)

Measured memory_bytes: 9192
#include<iostream>
using namespace std;
int main()
{
   string S;
   int i;
   cin>>S;
   for(i=0;i<6;i++)
   {
       if(S[i]>='A'&&S[i]<='Z')
        S[i]=S[i]+32;
   }
   if(S[2]==S[3]&&S[4]==S[5])
    cout<<"Yes"<<endl;
   else
    cout<<"No"<<endl;
}


Measured memory_bytes: 256
#include <cstdio>

int main()
{
	int A, B, C, D, E, F;
	double ans = 0.0;
	int X = 1, Y = 0, Z = 0, W = 0;
	scanf("%d %d %d %d %d %d", &A, &B, &C, &D, &E, &F);
	for (int x = 0; A * x <= 30; x++) {
		for (int y = 0; A * x + B * y <= 30; y++) {
			int t = A * x + B * y;
			if (t == 0)
				continue;
			for (int z = 0; C * z <=  E * t; z++) {
				for (int w = 0; C * z + D * w <= E * t; w++) {
					if (100 * t + C * z + D * w > F)
						continue;
					double cand = (C * z + D * w) * 1.0 / (A * x + B * y);
					if (cand > ans) {
						ans = cand;
						X = x;	Y = y;	Z = z;	W = w;
					}
				}
			}
		}
	}
	printf("%d %d\n", 100 * A * X + 100 * B * Y + C * Z + D * W, C * Z + D * W);
}

Measured memory_bytes: 128
def counting_sort(data):
    count_list=[0]*(max(data)+1)
    sorted_data=[0]*len(data)
    
    for i in data:
        count_list[i]+=1
    
    for loop in range(len(count_list) -1 ):
        count_list[loop+1]+=count_list[loop]
    
    for i in data:
        sorted_data[count_list[i] -1 ] =i
        count_list[i]-=1
    
    return sorted_data


n=int(input())
data=list(map(int,input().split()))
result=counting_sort(data)

print(" ".join(list(map(str,result))))


Measured memory_bytes: 240328
#include<bits/stdc++.h>
using namespace std;
int main(){
int n;
  cin>>n;
  map<string,int>m;
  m["AC"]=0;
  m["WA"]=0;
  m["TLE"]=0;
  m["RE"]=0;
  string s;
  while(n){
    cin>>s;
    m[s]++;
  n--;
 }
  
 cout<<"AC x "<<m["AC"]<<endl;
 cout<<"WA x "<<m["WA"]<<endl;
 cout<<"TLE x "<<m["TLE"]<<endl;
 cout<<"RE x "<<m["RE"]<<endl;
  
  
}


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

using namespace std;
typedef long long ll;
const ll mx = 10000007;
const ll mod = 1e9 + 7;
const double pi = acos(-1);
#define    ss   second
#define    ff   first
#define    pb   push_back
#define gcd(a, b) __gcd((a), (b))
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
#define FIO ios_base::sync_with_stdio(false);  cin.tie(NULL);


int main() {
    FIO;
    ll n;
    cin >> n;
    for (ll i = 1; i < 15; i++) {
        ll g = 1000 * i;
        if(g >= n) {
            cout << (g  - n) << endl;
            return 0;
        }
    }
    return 0;

}



Measured memory_bytes: 3656
//Single Source Shortest Path (Negative Edges)
#include <iostream>
#include <climits>
#include <vector>

using namespace std;

class Edge {
public:
    int s, t;
    long long d;
    Edge(int s, int t, long long d): s(s), t(t), d(d) {}
    bool operator < (const Edge e) const {return d < e.d;}
};

void bellmanFord(int r, int n, int m, vector<Edge> &E) {
    vector<long long> D(n, LONG_LONG_MAX);
    D[r] = 0;
    for(int i=0; i<n-1; i++) {
        for(int j=0; j<m; j++) {
            Edge e = E[j];
            if(D[e.s] == LONG_LONG_MAX) continue;
            D[e.t] = min(D[e.t], D[e.s] + e.d);
        }
    }

    bool flg = false;
    for(int j=0; j<m; j++) {
        Edge e = E[j];
        if(D[e.s] == LONG_LONG_MAX) continue;
        if(D[e.t] > D[e.s] + e.d) flg = true;
    }

    if(flg) cout << "NEGATIVE CYCLE" << endl;
    else {
        for(int i=0; i<n; i++)  {
            if(D[i] == LONG_LONG_MAX) cout << "INF" << endl;
            else cout << D[i] << endl;
        }
    }
}

int main() {
    int n, m, r, s, t;
    long long d;
    vector<Edge> E;
    cin >> n >> m >> r;
    for(int i = 0; i < m; i++) {
        cin >> s >> t >> d;
        E.push_back(Edge(s, t, d));
    }

    bellmanFord(r, n, m,E);

    return 0;
}



Measured memory_bytes: 3112