akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main(){
	int n;
	cin>>n;
	int array[n];
	int i;
	for(i=0;i<n;i++){
		cin>>array[i];
	}
	for(i=n-1;i>0;i--){
		cout<<array[i]<<" ";
	}
	cout<<array[0]<<endl;
	return 0;
}

Measured memory_bytes: 1160
//#include "pch.h"
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>

#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <queue>
#include <algorithm>
#include <functional>
#include <string>
#include <bitset>

#define ll long long
#define fri(n) for(i=0;i<(n);i++)
#define frj(n) for(j=0;j<(n);i++)
#define min(p,q) ((p)<(q)?(p):(q))
#define max(p,q) ((p)>(q)?(p):(q))
#define INF 1000000000000000000//10^18
#define INFINT 2000000001//2*10^9+1
#define MOD 1000000007
#define MODANOTHER 998244353
#define PI acos(-1)

using namespace std;




int main(void)
{
	//変数の宣言
	int n,q;
	char s[100010];
	static int l[100010];
	static int r[100010];
	static int dp[100010];

	//よく使う変数
	int i,j,k;
	int flag=0;
	int ans=0;
	int count=0;
	int temp=0;
	int temp1=0;
	int temp2=0;
	int max=0;
	int min=INFINT;
	int len=0;
	int sum=0;
	int ok=0;
	int ng=0;



	//データの読み込み


	scanf("%d %d",&n,&q);
//	scanf_s("%d %d",&n,&q);

	scanf("%s",&s);
//	scanf_s("%s",&s,100010);

	for(i=0;i<q;i++){
		scanf("%d %d",&l[i],&r[i]);
//		scanf_s("%d %d",&l[i],&r[i]);
	}

	//	printf("nは%dです\n", n);
	//	printf("データの読み込み終了\n");
	//実際の処理

	dp[0]=0;
	for(i=1;i<n;i++){
		if(s[i-1]=='A'&&s[i]=='C'){
			dp[i]=dp[i-1]+1;
		}else{
			dp[i]=dp[i-1];
		}
	}

	for(i=0;i<q;i++){
		ans=dp[r[i]-1];
		if(l[i]>1){
			ans=ans-dp[l[i]-2];
			if(s[l[i]-2]=='A'&&s[l[i]-1]=='C'){
				ans--;
			}
		}
		printf("%d\n",ans);
	}

	//	printf("計算部分終了\n");

	//出力

	//printf("%d",ans);

/*	printf("\n");
	for(i=1;i<=n;i++){
		for(j=i;j<=n;j++){
			printf("hanten[%d][%d]={%d,%d}\n",i,j,hanten[i][j][0],hanten[i][j][1]);
		}
	}*/
	
	//	printf("結果の出力終了\n");

	return 0;
}



Measured memory_bytes: 2048
#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
    int a ,b, d, r;
    double f;
    cin>>a>>b;
    d=a/b;
    r=a%b;
    f=1.00000*a/b;
    printf("%d %d %.5lf\n",d,r,f);
    return 0;
}


Measured memory_bytes: 3216
#include <iostream>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <deque>
#include <stack>
#include <iomanip>
#include <cmath>


using namespace std;


typedef long long ll;
typedef long double ld;


const int MAXNUM = 200002;
const ll MOD = 1000000007ll;


int H, W, A, B;
ll fac[MAXNUM];


void input() {
  cin >> H >> W >> A >> B;
}


void preprocess() {
  fac[0] = 1;
  for (int i = 1 ; i < MAXNUM ; i++) {
    fac[i] = (fac[i-1] * i) % MOD;
  }
}


ll factorial(int x) {
  return fac[x];
}


ll getPow(ll b, ll e) {
  //cerr << "B = " << b << ", E = " << e << "\n";
  if (e == 0) return 1;
  if (e == 1) return b;
  if (e % 2 == 0) {
    ll tmp = getPow(b, e / 2);
//  cerr << " Ret B = " << b << ", E = " << e << "\n";
    return (tmp * tmp) % MOD;
  } else {
//  cerr << " Ret B = " << b << ", E = " << e << "\n";
    return (b * getPow(b, e - 1)) % MOD;
  }
}


ll getInverse(int x) {
  if (x == 1) {
    return 1;
  }
  return getPow(x, MOD - 2);
}


ll NCR(int n, int k) {
  ll num = factorial(n);
  ll den = (factorial(k) * factorial(n-k)) % MOD;
  //cerr << "LUL\n";
  ll ret =  (num * getInverse(den)) % MOD;
  //cerr << "RET = " << ret << "\n";
  return ret;
}


ll getWays(int fr, int fc, int tr, int tc) {
  int dr = tr - fr;
  int dc = tc - fc;
  //cerr << "DR = " << dr << ", DC = " << dc << "\n";
  return NCR(dr + dc, dr);
}


void solve() {
  ll ans = 0;
  for (int r = 0 ; r < H-A ; r++) {
    //cerr << "R = " << r << "\n";
    ans = (ans + getWays(0, 0, r, B-1) * getWays(r, B, H-1, W-1)) % MOD;
  }
  cout << ans;
}






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

  int T;
//  cin >> T;
  T = 1;

  for (int i = 0 ; i < T ; i++) {
    input();
    preprocess();
    solve();
  }

  return 0;
}


Measured memory_bytes: 1792
void main(){
  import std.stdio, std.string, std.conv, std.algorithm;

  int m; rd(m);

  writeln(24+(24-m));
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  assert(l.length==x.length);
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}
void wr(T...)(T x){
  import std.stdio;
  foreach(e; x) write(e, " ");
  writeln();
}

Measured memory_bytes: 256
#include <stdio.h>

int A[112345];

int main(void){
  
  int N;
  scanf("%d", &N);
  
  int i;
  for( i = 0; i < 100001; i++ ){
    A[i] = 0;
  }
  
  int cnt = 0;
  int num;
  
  for( i = 0; i < N; i++ ){
    scanf("%d", &num);
    A[num]++;
    if( A[num] > 1 ) cnt++;
  }
  
  int ans;
  
  if( cnt % 2 ) ans = N-cnt-1;
  else{         ans = N-cnt;}
  
  printf("%d\n", ans);
  
  return 0;
}

Measured memory_bytes: 640
from collections import deque

S=list(input())
Q=int(input())
Sq=deque(S)

flag=1
for _ in range(Q):
    q=input().split()
    if q[0]=='1':
        flag*=-1
        continue
    if (q[1]=='1' and flag==-1) or (q[1]=='2' and flag==1):
        Sq.append(q[2])
    else:
        Sq.appendleft(q[2])
if flag==1:
    print(''.join(Sq))
else:
    Sq.reverse()
    print(''.join(Sq))


Measured memory_bytes: 9588
#include <bits/stdc++.h>
#define INF 100000000
using namespace std;

typedef long long ll;
typedef pair<int,int> P;
int n;
int p[101];
P dp[101][50001];

P max_get(P a,P b){
	if(a.first>b.first){
		return a;
	}
	if(a.first<b.first){
		return b;
	}
	return (a.second<=b.second)?a:b;
}

int main(void){
	while(1){
		scanf("%d",&n);
		if(n==0)break;
		for(int i=0;i<n;i++){
			scanf("%d",&p[i]);
		}
		for(int i=0;i<=n;i++){
			for(int j=0;j<=50000;j++){
				dp[i][j]=P(0,INF);
			}
		}
		dp[0][0]=P(0,0);
		for(int i=0;i<n;i++){
			int need=(p[i]%1000)-500;
			if(need<0)need+=1000;
			int oturi=1000-(p[i]%1000);
			if(oturi==1000)oturi=0;
			for(int j=0;j<=50000;j++){
				if(dp[i][j].second!=INF){
					dp[i+1][j]=max_get(dp[i+1][j],dp[i][j]);
					if(p[i]%1000<500 && ((p[i]%1000)!=0)){
						P np=dp[i][j];
						np.first++;
						np.second+=p[i];
						dp[i+1][j+oturi-500]=max_get(dp[i+1][j+oturi-500],np);
					}else{
						if(j>=need){
							P np=dp[i][j];
							np.first++;
							np.second+=p[i];
							dp[i+1][j-need]=max_get(dp[i+1][j-need],np);
						}else{
							P np=dp[i][j];
							np.second+=p[i];
							dp[i+1][j+oturi]=max_get(dp[i+1][j+oturi],np);
						}
					}
				}
			}
		}
		int r1=0,r2=0;
		for(int i=0;i<=50000;i++){
			if(dp[n][i].second!=INF){
				if(r1==dp[n][i].first && r2>dp[n][i].second){
					r1=dp[n][i].first;
					r2=dp[n][i].second;
				}
				if(r1<dp[n][i].first){
					r1=dp[n][i].first;
					r2=dp[n][i].second;
				}
			}
		}
		printf("%d %d\n",r1,r2);
	}
	return 0;
}

Measured memory_bytes: 42560
#include <bits/stdc++.h>
using namespace std;
const int N = 102;

int n;
int a[N];

int main()
{
    cin >> n;
    for (int i = 1; i <= n; ++i)
        cin >> a[i];
    vector<int> ans;
    for (int m = n; m >= 1; --m)
    {
        bool z = false;
        for (int i = m; i >= 1; --i)
        {
            if (a[i] == i)
            {
                z = true;
                ans.push_back(i);
                for (i = i + 1; i <= m; ++i)
                {
                    a[i - 1] = a[i];
                }
                break;
            }
        }
        if (!z)
        {
            cout << -1 << endl;
            return 0;
        }
    }
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < n; ++i)
        cout << ans[i] << endl;
    return 0;
}


Measured memory_bytes: 256
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int mod=1e9+7;
const int maxn=2000;
int n,k;
int f[maxn+8][maxn+8],g[maxn+8][maxn+8];

int read()
{
    int x=0,f=1;char ch=getchar();
    for (;ch<'0'||ch>'9';ch=getchar()) if (ch=='-') f=-1;
    for (;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';
    return x*f;
}

int power(int a,int k)
{
    if (k<0) return 1;
    int sum=1;
    for (;k;k>>=1,a=1ll*a*a%mod)
	if (k&1)
	    sum=1ll*sum*a%mod;
    return sum;
}

int main()
{
    n=read(),k=read();
    for (int i=1;i<=n;i++) g[0][i]=1;
    for (int i=1;i<k;i++)
	    for (int j=n-i;j;j--)
	        g[i][j]=(g[i-1][j]+g[i][j+1])%mod;
    printf("%lld\n",1ll*g[k-1][1]*power(2,n-k-1)%mod);
    return 0;
}


Measured memory_bytes: 16640
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);

    int N = Integer.parseInt(sc.next());
    int M = Integer.parseInt(sc.next());

    int p[] = new int[N];

    for (int i = 0; i < N; i++) {
      p[i] = Integer.parseInt(sc.next()) - 1;
    }

    UnionFind uf = new UnionFind(N);
    for (int i = 0; i < M; i++) {
      uf.union(Integer.parseInt(sc.next()) - 1, Integer.parseInt(sc.next()) - 1);
    }
    int ans = 0;
    for (int i = 0; i < N; i++) {
      if (uf.same(i, p[i])) {
        ans++;
      }
    }

    System.out.println(ans);
  }

  static class UnionFind {
    public int parent[];
    public int rank[];

    public UnionFind(int size) {
      parent = new int[size];
      rank = new int[size];
      for (int i = 0; i < size; i++) {
        parent[i] = i;
        rank[i] = 0;
      }
    }

    public int find(int i) {
      if (i != parent[i]) {
        parent[i] = find(parent[i]);
      }
      return parent[i];
    }

    public void union(int x, int y) {
      int xRoot = find(x);
      int yRoot = find(y);
      if (rank[xRoot] > rank[yRoot]) {
        parent[yRoot] = xRoot;
      } else if (rank[yRoot] > rank[xRoot]) {
        parent[xRoot] = yRoot;
      } else if (xRoot != yRoot) {
        parent[yRoot] = xRoot;
        rank[xRoot]++;
      }
    }

    public boolean same(int x, int y) {
      return find(x) == find(y);
    }
  }
}

Measured memory_bytes: 61512
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)
	m := make(map[int]bool)
	for _, div := range Divisors(N - 1) {
		m[div] = true
	}
	for _, div := range Divisors(N) {
		if div == 1 {
			continue
		}
		if m[div] {
			continue
		}
		x := N
		for x%div == 0 {
			x /= div
		}
		x %= div
		if x == 1 {
			m[div] = true
		}
	}
	m[2] = true
	m[N] = true
	delete(m, 1)
	fmt.Println(len(m))
}

func Divisors(n int) []int {
	nums := []int{}
	for i := 1; i*i <= n; i++ {
		if n%i == 0 {
			nums = append(nums, i)
			if i*i != n {
				nums = append(nums, n/i)
			}
		}
	}
	return nums
}


Measured memory_bytes: 2104
<?php

error_reporting(E_ALL);

$n = (int) trim(fgets(STDIN));
$as = trim(fgets(STDIN));
$q = (int) trim(fgets(STDIN));

$as = explode(' ', $as);

$am = [];
foreach ($as as $a) {
    $am[$a] = ($am[$a] ?? 0) + 1;
}

$sum = 0;
foreach ($am as $a => $c) {
    $sum += $a * $c;
}

while (false !== $s = fgets(STDIN)) {
    $s = trim($s);
    if ($s === '') {
        break;
    }
    [$b, $c] = explode(' ', $s);
    $count = $am[$b] ?? 0;
    $sum = $sum + ($c * $count) - ($b * $count);
    $am[$b] = 0;
    $am[$c] = ($am[$c] ?? 0) + $count;
    printf("%s\n", $sum);
}


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

using namespace std;

#define fl(x,n) for(x=0;x<n;x++)
#define I(x) cin>>x
#define O(x) cout<<x<<endl
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define St(name) stack<string>name
#define lld long long int
const int INF = 1e9 + 7;


int main(){
    fast;
    int n,k;
    cin>>n>>k;
    vector<int> h, dp(n, INF);
    for(int i = 0; i<n; i++){
        int temp;
        cin>>temp;
    	h.push_back(temp);
    }
    dp[0] = 0;
    for(int i = 1; i<n; i++){
        for(int j = 1; j<=k && i-j>=0; j++){
            dp[i] = min(dp[i-j] + abs(h[i]- h[i-j]), dp[i]);
        }
    }
    cout<<dp[n-1];
    return 0;
}


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

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef pair<int, int> pii;
typedef pair<char, char> pcc;

#define FOR(i, begin, end) for(int i = (begin); i < (end); i++)
#define rep(i, n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define ZP(a, len) setfill('0') << setw(len) << right << a
const int INF = 1e9;
const int MOD = 1e9 + 7;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};

signed main() {
    int N;
    cin >> N;
    vi a = vi(N);
    rep(i, N) cin >> a[i];

    ll ans = INF;
    for (int i = -100; i <= 100; ++i) {
        ll total = 0;
        for (int j = 0; j < N; ++j) {
            total += pow(a[j] - i, 2);
        }
        ans = min(ans, total);
    }

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

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<cstdio>
using namespace std;

int main(){
    int n;cin>>n;
    int d[n];
    for(int i=0;i<n;i++) cin>>d[i];
    sort(d,d+n);
    int left=d[n/2-1];
    int right=d[n/2];
    cout<<right-left<<endl;
}



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

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define PRINT(item) cout << (item) << endl;
#define PRINT_VEC(V) \
    for (auto v : (V)) cout << v << ' ';
#define PRINT_ENTER() cout << endl;
#define ll long long

int main() {
    /* code */
    string s;
    cin >> s;
    auto s_1 = s[0];
    REP(i, s.length()) {
        if (s_1 != s[i]) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}

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

int main() {

  while( true ) {

    long long int n;
    cin >> n;
    if ( n == 0 ) break;

    vector< long long int > v0, v1;

    for ( long long int i = 0; i < n+1; i++ ) {

      long long int m;
      cin >> m;

      long long int p0 = 0;
      long long int p1 = 0;

      for ( long long int j = 0; j < m; j++ ) {

	long long int in;
	cin >> in;
	if ( in < 50 ) {
	  p0 += ( 1LL << in );
	}else {
	  p1 += ( 1LL << ( in - 50 ) );
	}

      }

      v0.push_back( p0 );
      v1.push_back( p1 );

    }

    long long int ans = -1;

    for ( long long int j = 0; j < n; j++ ) {

      if ( ( v0[j] & v0[n] ) == v0[n] && ( v1[j] & v1[n] ) == v1[n] ) {

	if ( ans == -1 ) {
	  ans = j + 1;
	}else {
	  ans = -1;
	  break;
	}

      }

    }

    cout << ans << endl;

  }

  return 0;

}

Measured memory_bytes: 1220
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <unordered_map>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
#include <unordered_map>
#include <fstream>
#include <time.h>
#include <deque>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef pair<int,int> pii;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(int i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 2020000;
ll dy[8] = {1,-1,0,0,1,-1,1,-1};
ll dx[8] = {0,0,1,-1,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T> inline void print(T &a){
    rep(i,a.size()) cout << a[i] << " ";
    cout << "\n";
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
const int mod = 1e9 + 7;
//const int mod = 998244353;

int main(){
    ll n,m; cin >> n >> m;
    vvl G(n);
    rep(i,m){
        ll a,b; cin >> a >> b; a--; b--;
        G[a].push_back(b);
        G[b].push_back(a);
    }
    vl color(n,-1);
    color[0] = 0;
    vl cnt(2,0);
    cnt[0]++;
    queue<ll> q;
    q.push(0);
    ll ans = -m;
    while(!q.empty()){
        ll u = q.front(); q.pop();
        for(auto v : G[u]){
            if(color[v] != -1){
                if(color[u] == color[v]){
                    ans += n * (n-1) / 2;
                    cout << ans << "\n";
                    return 0;
                }
                continue;
            }
            color[v] = 1 - color[u];
            cnt[color[v]]++;
            q.push(v);
        }
    }
    ans += cnt[0] * cnt[1];
    cout << ans << "\n";
}

Measured memory_bytes: 10060
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define ADD(a, b) a = (a + b) % mod
#define MUL(a, b) a = (a * b) % mod
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef vector<int> vi;
const int inf = 1e9+7;
const int INF = 1e18+7;
const int mod = 1e9+7;
//26

signed main(){
	int h, w;
	scanf("%lld%lld", &h, &w);
	rep(i,h){
		string str;
		cin >> str;
		cout << str << endl << str << endl;
	}
	return 0;
}





Measured memory_bytes: 256
#include<iostream>
#include <string>
#include<vector>
typedef long long ll;

using namespace std;
int main()
{
	int a, b, c;
	cin >> a >> b >> c;
	string kotae = "NO";
	for (int i = 1; i <= b; i++) {
		if ((a*i) % b == c) kotae = "YES";
	}
	cout << kotae;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << setprecision(20) << fixed;

  int N;
  cin >> N;
  int count = 0;
  for(int i = 0; i < N; i++){
    int a;
    cin >> a;
    if(i%2 == 0){
      if(a % 2 == 1){
        count ++;
      }
    }
  }
  cout << count <<endl;
}


Measured memory_bytes: 3600
#include<stdio.h>

int main(){
  int i,n,a,r=0;
  scanf("%d",&n);
  for(i=1;i<=n;i++){
    scanf("%d",&a);
    if(i!=a){r++;}
  }
  if(r<=2){printf("YES\n");}
  else{printf("NO\n");}
  return 0;
}


Measured memory_bytes: 128
//by xxj
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
using namespace std;
const int inf=1e9+7;
const ll linf=1e18+7;
const ll hh=523;
const int mod=998244353;
int main(){
	string s;
	cin>>s;
	bool f=true;
	int cs=0;
	if (s[0]!='A'){
		f=false;
	}
	if (s.size()>=2 && s[1]>='A' && s[1]<='Z'){
		f=false;
	}
	if (s[s.size()-1]>='A' && s[s.size()-1]<='Z'){
		f=false;
	}
	for (int i=2;i<s.size()-1;i++){
		if (s[i]>='A' && s[i]<='Z'){
			if (s[i]=='C'){
				cs++;
			}
			else{
				f=false;
			}
		}
	}
	if (cs!=1){
		f=false;
	}
	if (f){
		cout<<"AC"<<endl;
	}
	else{
		cout<<"WA"<<endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;


int main(){
    int l,a,b,c,d;
    cin>>l>>a>>b>>c>>d;
    a=a%c?a/c+1:a/c;
    b=b%d?b/d+1:b/d;
    cout<<l-max(a,b)<<endl;
    return 0;
}

Measured memory_bytes: 3104
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using System.Text.RegularExpressions;
using System.Text;
using System.Diagnostics;
using static System.Math;
using static System.Array;

//var input = Console.ReadLine().Split().Select(int.Parse).ToArray();
namespace AtCoderSolve
{

    class Solve
    {
        const int mod = 1000000007;
        const int INF = 2147483647;
        const long SINF = 9223372036854775807;

        static int N;
        static int[] t, x, y;

        public static void Input()
        {
            var cin = new Scanner();
            N = int.Parse(Console.ReadLine());
            t = new int[N + 1];
            x = new int[N + 1];
            y = new int[N + 1];
            for(var i = 0; i <= N; i++)
            {
                if (i == 0)
                {
                    t[i] = 0;
                    x[i] = 0;
                    y[i] = 0;
                }
                else
                {
                    var input = cin.SplitReader();
                    t[i] = input[0];
                    x[i] = input[1];
                    y[i] = input[2];
                }
            }
          
        }

        static void Main(string[] args)
        {
            Input();

            //var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            //Console.SetOut(sw);

            bool ok = true;
            for(var i = 0; i < N; i++)
            {
                int dx = Abs(x[i + 1] - x[i]);
                int dy = Abs(y[i + 1] - y[i]);
                int dt = t[i + 1] - t[i];

                if (dx + dy > dt || (dx + dy) % 2 != dt % 2)
                {
                    ok = false;
                    break;
                }
            }

            Console.WriteLine(ok ? "Yes" : "No");

            //Console.Out.Flush();

        }

       
    }

    public class Scanner
    {
        public int[] SplitReader()
        {
            int[] array = Console.ReadLine().Split().Select(int.Parse).ToArray();
            return array;
        }
        public long[] SplitReaderL()
        {
            long[] array = Console.ReadLine().Split().Select(long.Parse).ToArray();
            return array;
        }

    }

    public class Graph
    {
        
    }
}

    



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

bool comp(int x, int y)
{
  return x >= y;
}

int main()
{
  int n; cin >> n;
  vector<int> a(n);
  rep(i, n)
    cin >> a[i];
  vector<int> last;
  last.push_back(a[0]);
  for (int i=1; i<n; i++)
  {
    auto itr = lower_bound(last.begin(), last.end(), a[i], comp);
    if (itr == last.end())
      last.push_back(a[i]);
    else
      *itr = a[i];
  }
  cout << last.size() << endl;
}


Measured memory_bytes: 1276
#include <cstdio>
#include <cstring>
#include <random>
#include <stack>
#include <vector>

using namespace std;

#define int long long
#define uint unsigned int
#define dotimes(i, n) for (int i = 0, i##max__ = (n); i < i##max__; i++)
#define whole(x, f, ...) ([&](decltype((x)) c) { return (f)(begin(c), end(c), ## __VA_ARGS__); })(x)

int rint() {
  int x;
  scanf("%lld", &x);
  return x;
}

void wint(int x) {
  printf("%lld\n", x);
}

template<typename T> int size(T const& c) { return static_cast<int>(c.size()); }
template <typename T> bool maxs(T& a, T const& b) { return a < b ? a = b, true : false; }
template <typename T> bool mins(T& a, T const& b) { return a > b ? a = b, true : false; }
inline int lg(int x) { return 63 - __builtin_clzll(static_cast<unsigned int>(x)); }

constexpr uint mask30 = (1ull << 30) - 1, mask31 = (1ull << 31) - 1, mask61 = (1ull << 61) - 1;

uint add61(uint x, uint y) {
  uint z = x + y, w = (z >> 61) + (z & mask61);
  return w < mask61 ? w : w - mask61;
}

uint sub61(uint x, uint y) {
  return x >= y ? x - y : mask61 - (y - x);
}

uint mul61(uint x, uint y) {
  uint a = x >> 31, b = x & mask31, c = y >> 31, d = y & mask31, z = a * d + b * c, e = z >> 30, f = z & mask30;
  return (2 * a * c + e + (f << 31) + b * d) % mask61;
}

uint pow61(uint x, int n) {
  uint r = 1;
  for (; n; n >>= 1, x = mul61(x, x))
    if (n & 1)
      r = mul61(r, x);
  return r;
}

signed main() {
  constexpr int s_max = 5e5;
  char s[s_max+1], t[s_max+1];
  scanf("%s\n%s\n", s, t);
  const int m = strlen(s), n = strlen(t);
  const uint b1 =
    []() {
      std::random_device rd;
      std::mt19937_64 prng((static_cast<uint>(rd()) << 32) | rd());
      std::uniform_int_distribution<uint> uid(256, mask61 - 2);
      return uid(prng);
    }();
  vector<bool> fs(m);
  {
    uint hs = 0, ht = 0, b = 1;
    for (int i = 0; ; i++, b = mul61(b1, b)) {
      ht = add61(ht, mul61(b, t[n-i-1]));
      hs = add61(hs, mul61(b, s[(n-i-1)%m]));
      if (i == n-1)
        break;
    }
    fs[0] = ht == hs;
    dotimes(i, m-1) {
      hs = add61(mul61(b1, sub61(hs, mul61(b, s[i]))), s[(i+n)%m]);
      fs[i+1] = ht == hs;
    }
  }
  vector<int> rs(m);
  int r = 0;
  dotimes(i, m) {
    stack<int> path;
    for (int j = i; ; j = (j+n)%m) {
      if (rs[j] || !fs[j]) {
        if (rs[j] == -1)
          r = -1;
        else {
          for (int c = rs[j]+1; !path.empty(); c++, path.pop())
            rs[path.top()] = c;
          maxs(r, rs[i]);
        }
        break;
      }
      rs[j] = -1;
      path.emplace(j);
    }
    if (r < 0)
      break;
  }
  wint(r);
  return 0;
}


Measured memory_bytes: 11760
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using vll = vector<ll> ;
#define all(v) v.begin(),v.end()
#define P pair<ll, ll>

set<pair<int, int>> bomb;

int main(){
  ll H,W,M;cin>>H>>W>>M;
  map<int, int> row,col;
  ll maxr=0,maxc=0;
  rep(i,M){
    ll h,w;cin>>h>>w;h--,w--;
    row[h]++;col[w]++;
    if(row[h]>maxr) maxr=row[h];
    if(col[w]>maxc) maxc=col[w];
    bomb.insert({h,w});
  }
  vll vr{},vc{};
  for(auto r : row){
    if(r.second==maxr) vr.push_back(r.first);
  }
  for(auto c : col){
    if(c.second==maxc) vc.push_back(c.first);
  }
  ll ans = maxr + maxc - 1;
  for(auto r : vr) {
    for(auto c : vc){
      bool flag = false;
      if(bomb.find({r,c})==bomb.end()){
        cout << ans+1 << endl;
        return 0;
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 53844
#include <iostream>
using namespace std;
 
int pref[102], a[102];
int main() {
  int n;
  cin>>n;
  int i;
  for(i=1;i<=n;i++) cin>>a[i], pref[i] = pref[i-1] + a[i];
  
  int mi = abs(pref[n] - 2*pref[i]);
  
  for(i=2; i<n; i++)
    mi = min(mi, abs(pref[n]-2*pref[i] ));
  cout<<mi;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>
#include<complex>

using namespace std;

#define ll long long
#define ld long double
#define EPS 1e-9
#define INF 1e9
#define LINF (ll)INF*INF
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,a,n) for(int i=a;i<(n);i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

#define int ll //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef pair<int,pii> pip;
typedef vector<pii> vp;
typedef vector<vi> vvi;

int gcd(int a, int b){if(b==0) return a;return gcd(b,a%b);}
int lcm(int a, int b){return a/gcd(a,b)*b;}


signed main(void) {
    int n;
    cin >> n;
    int v[15][15] = {};//1:正直者, -1:不親切
    rep(i,n){
        int a;
        cin >> a;
        rep(_,a){
            int p,q;
            cin >> p >> q;
            p--;
            if(q)v[i][p] = 1;
            else v[i][p] = -1;
        }
    }
    int ans = 0;
    rep(bit,1<<n){
        bool c = true;
        vi t(n,0);
        rep(i,n)if((1<<i)&bit)t[i] = 1;
        rep(i,n)if((1<<i)&bit){
            rep(j,n)if(v[i][j]){
                if(t[j] && t[j] != v[i][j]){
                    c = false;
                    //cout << bit << " " << i << " " << j << endl;
                }
                t[j] = v[i][j];
            }
        }
        rep(i,n)if(((1<<i)&bit) && t[i] != 1)c = false;
        rep(i,n)if(!((1<<i)&bit) && t[i] == 1)c = false;
        //rep(i,n)cout << " " << t[i];cout << endl;
        if(c){
            //cout << "!" << bit << endl;
            int cnt = 0;
            rep(i,n){
                if((1<<i)&bit)cnt++;
            }
            ans = max(ans, cnt);
        }
    }
    cout << ans << endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define Ll long long
using namespace std;
const int N=3e2+5;
int a[N][N],d[N];
bool ok[N];
int ans=1e9,n,m,x;
int find(){
	memset(d,0,sizeof d);
	int ma=0;
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			if(!ok[a[i][j]]){
				d[a[i][j]]++;
				break;
			}
	for(int i=1;i<=m;i++)ma=max(ma,d[i]);
	for(int i=1;i<=m;i++)if(d[i]==ma)ok[i]=1;
	return ma;
}
int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++)
		for(int j=1;j<=m;j++)
			scanf("%d",&a[i][j]);
	while(1){
		int sum=0;
		for(int i=1;i<=m;i++)if(!ok[i])sum++;
		if(sum==0)break;
		ans=min(find(),ans);
	}
	printf("%d",ans);
}

Measured memory_bytes: 640
import java.util.Scanner;

class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		Long N = Long.parseLong(sc.next());
		Long K = Long.parseLong(sc.next());
		Long J = 0L;

		while(true) {
			if(N/K > 10) {
				J = N;
				N -= (N/K)*K;
			} else {
				J = N;
				N -= K;
			}
			if(Math.abs(J) <= Math.abs(N)) {
				break;
			}
		}
		System.out.println(Math.min(Math.abs(J), Math.abs(N)));
	}
}


Measured memory_bytes: 26988
#!/usr/bin/env python3

N = int(input().split()[0])
S = str(N)
a_list = []
b_list = []
total = 0
if int(S[0]) == 1 and int(S[1:]) == 0:
    total = 10
else:
    for char in S:
        total += int(char)

ans = total

print(ans)


Measured memory_bytes: 3060
input = readlines
input.each{|num|
    num = num.chomp!
}

i = 0
last_min = 10
last = 0

while i < input.length
    digit = input[i].to_i % 10
    if digit != 0
        if last_min > digit
            last_min = digit
            last = i
        end
    end
    i = i + 1
end

i = 0
all = 0
while i < input.length
    if i != last
        n = (input[i].to_f / 10).ceil * 10
        all = all + n
    end
    i = i + 1
end

all = all + input[last].to_i

print all

Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef std::vector<vector<int> > vvi;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef vector<ll> vll;
typedef vector<pi> vpi;
typedef vector<pll> vpll;
typedef vector<vll> vvll;
typedef vector<vi> vvi;
typedef vector<vector<double>> vvd;
typedef vector<double> vd;

#define debugone(x) cerr << #x << " " << x << "\n"; cerr.flush();
#define debugtwo(x) cerr << #x << "-------------" << "\n";for(auto &it: x) cerr << it << " ";cerr << "\n"; cerr.flush();
#define debugthree(x_, i_, j_) cerr << #x_ << "------------" << "\n";cerr << "from " << i_ << " to " << j_ << "\n";for(ll k_=i_; k_<=j_; k_++) cerr << x_[k_] << " ";cerr << "\n"; cerr.flush();
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
#define trace6(a, b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;

const ll MOD = 1e9 + 7;
const int INF = 2e9;
const int MAX_LOG = 21;
const int MAX_N = 1000*1001;

#define forn(i, n) for(int i = 0; i < n; i++)
#define forsn(i, s, n) for(int i = s; i < n; i++)
#define all(x) x.begin(), x.end()

ll fight(ll h){
	ll ans = 0;
	if(h == 1) ans = 1;
	else{
		ll temp = fight(h / 2);
		ans = 1 + 2 * temp;
	}
	return ans;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	ll h;
	cin >> h;
	cout << fight(h) << endl;
}		


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll>
#define lque queue<ll>
#define lpque priority_queue<ll>
#define dlpque priority_queue<ll,lvector,greater<ll>>
#define P pair<ll,ll> 
#define ALL(a) (a).begin(),(a).end()
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,ans=0;cin>>n;
  bool isok=false;
  lvector A(n,0);rep(i,n) cin>>A[i];
  if(A[0]==0) {
    ll pos=0;
    while(pos<n-1) {
      ll prev=A[pos],next=A[pos+1];
      if(prev+1<next) break;
      else if(prev+1==next) ans++;
      else ans+=next;
      pos++;
    }
    if(pos==n-1) isok=true;
  }
  if(isok) print(ans);else print(-1);
  return 0;
}

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

struct my{
  pair<int,int> top;
  pair<int,int> sec;
};

int main() {
  int n; cin >>n;
  vector<int> a(100001),b(100001);
  my am = {make_pair(0,0),make_pair(0,0)};
  my bm = {make_pair(0,0),make_pair(0,0)};
  // 奇数番目、偶数番目の要素の多い数と頻度
  int buf;
  for (int i=0; i<n; i++){
    cin >>buf;
    if (i%2==0) a.at(buf)++;
    else b.at(buf)++;
  }
  for (int i=0; i<100001; i++){
    if (a.at(i) > am.top.second){
      am.sec = am.top;
      am.top.first = i; am.top.second = a.at(i);
    }else if (a.at(i) > am.sec.second){
      am.sec.first = i; am.sec.second = a.at(i);
    }
    if (b.at(i) > bm.top.second){
      bm.sec = bm.top;
      bm.top.first = i; bm.top.second = b.at(i);
    }else if (b.at(i) > bm.sec.second){
      bm.sec.first = i; bm.sec.second = b.at(i);
    }
  }
  // 1番多い頻度の数の衝突に備えて2番目に多い頻度の数も記録
  int ans;
  if (am.top.first!=bm.top.first){
    ans = n - am.top.second - bm.top.second;
  }else{
    ans = n - (max(am.top.second+bm.sec.second,am.sec.second+bm.top.second));
  }
  cout <<ans;
  cout <<endl;
}


Measured memory_bytes: 1024
#include<stdio.h>
#include<vector>
#include<climits>
#include<math.h>
using namespace std;

int min(const int& a, const int& b){
    return a < b? a : b;
}
int updateUtil(vector<int>& tree, const int& i, const int& v, const int& k, const int& l, const int& r){
    if(k > tree.size() || l > r) return INT_MAX;
    if(i < l || i > r) return tree[k];
    if(l == r && l == i){
        tree[k] = v;
    }
    else{
        int mid = l+(r-l)/2;
        tree[k] = min(updateUtil(tree, i, v, 2*k+1, l, mid), updateUtil(tree, i, v, 2*k+2, mid+1, r));
    }
    return tree[k];
}

void update(vector<int>& tree, const int& n, const int& i, const int& v){
    updateUtil(tree, i, v, 0, 0, n-1);
}

int findUtil(vector<int>& tree, const int& L, const int& R, const int& k, const int& l, const int& r){
    if(k > tree.size() || l > r || r < L || l > R) return INT_MAX;
    if(l >= L && r <= R) return tree[k];
    int mid = l+(r-l)/2;
    int lv = findUtil(tree, L, R, 2*k+1, l, mid);
    int rv = findUtil(tree, L, R, 2*k+2, mid+1, r);
    return min(lv, rv);
}

int find(vector<int>& tree, const int& n, const int& L, const int& R){
    return findUtil(tree, L, R, 0, 0, n-1);
}
int main(){
    int n, q, com, x, y;
    scanf("%d %d", &n, &q);
    int h = (int)ceil(log2(n));
    int max_size = 2*(int)pow(2, h)-1;
    vector<int> tree(max_size, INT_MAX);
    for(int i = 0; i < q; i++){
        scanf("%d %d %d", &com, &x, &y); 
        if(com == 0) update(tree, n, x, y);
        else if(com == 1) printf("%d\n", find(tree, n, x, y));
        else printf("undefined com\n");
    }
}



Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int a,b,n,minn=1000000;

inline int sum(int k)
{
	int m=0;
	while(k>0)
	{
		m+=k%10;
		k/=10;
	}
	return m;
}

int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n/2;i++)
		minn=min(minn,sum(i)+sum(n-i));
		printf("%d\n",minn);
		return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
#include <iomanip>
using namespace std;
typedef long long ll;
const ll MOD = 1e9+7;
vector<int> p;
bool hurui[200000];
void h()
{
	fill(hurui,hurui+200000,false);
	for(int i=2;i<200000;i++)
	{
		if(!hurui[i])
		{
			p.push_back(i);
			for(int j=i;j<200000;j+=i)
				hurui[j]=true;
		}
	}
	return;
}
int main()
{
	int x;
	ll ans=0;
	cin>>x;
	h();
	cout<<(*lower_bound(p.begin(),p.end(),x))<<endl;
	return 0;
}

Measured memory_bytes: 640
function main(input) {
  input=input.trim();
  const a = parseInt(input.split(" ")[0], 10);
  const b = parseInt(input.split(" ")[1], 10);
  const c = parseInt(input.split(" ")[2], 10);
  if(a<=c&&c<=b){
    console.log("Yes");
  }else{
    console.log("No");
  }

}


main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 7372
import collections

N, K, Q = list(map(int, input().split()))
li = []
for i in range(Q):
    li.append(int(input())-1)

c = collections.Counter(li) 

for i in range(N):
    if i in c.keys():
        if K-(Q-c[i]) < 1:
          print("No")
        else:
          print("Yes")
    else:
        if K-Q < 1:
          print("No")
        else:
          print("Yes")

Measured memory_bytes: 11900
<?php
class MyTest {

    private function getInput() {
               
        // # 文字列の入力
        fscanf(STDIN, "%s", $ret);
        return $ret;
    }

    private function main($input) {
        $a = intval(substr($input, 0, 2));
        $b = intval(substr($input, -2));
        $flg1 = ($a >= 1 && $a <= 12);
        $flg2 = ($b >= 1 && $b <= 12);
        if ($flg1 && $flg2) {
            echo 'AMBIGUOUS';
        } elseif($flg1 && !$flg2) {
            echo 'MMYY';
        } elseif(!$flg1 && $flg2) {
            echo 'YYMM';
        } else {
            echo 'NA';
        }
    }

    public function run() {
        $input = self::getInput();
        self::main($input);
    }
    
}

MyTest::run();

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

long long mod = 1000000007LL;

typedef pair<long long, long long> ii;
int main(){
	//freopen("i.txt","r",stdin);
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	string s; cin >> s;
	for(int x : s){
		cout << 'x';
	}
	
}


Measured memory_bytes: 256
<?php
# スペース区切りの整数の入力
fscanf(STDIN, "%d %d %d", $l, $r, $d);

function result($l, $r, $d) {
    $count = 0;
    for ($i = $l; $i <= $r; $i++) {
        if ($i % $d == 0) {
            $count ++;
        }
    }
    return $count;
}

# 出力
echo result($l, $r, $d);
?>

Measured memory_bytes: 16180
#include <stdio.h>
#include <algorithm>

using namespace std;

int n;
int a[110];
int b[110];

int main(void)
{
	scanf("%d", &n);
	
	for(int i = 0 ; i < n ; i++)
	{
		scanf("%d", &a[i]);
		b[i] = a[i];
	}
	
	sort(b, b + n);
	
	int check = 0;
	
	for(int i = 0 ; i < n ; i++)
	{
		if(a[i] != b[i])
			check = 1;
	}
	
	if(check == 0)
	{
		printf("YES");
		return 0;
	}
	int chch = 0;
	for(int i = 0 ; i < n ; i++)
	{
		for(int j = i + 1 ; j < n ; j++)
		{
			int tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
			int hello = 0;
			for(int k = 0 ; k < n ; k++)
			{
				if(a[k] != b[k])
				{
					hello = 1;
				}
			}
			
			if(hello == 0)
			{
				printf("YES");
				return 0;
			}
			
			tmp = a[i];
			a[i] = a[j];
			a[j] = tmp;
		}
	}
	
	printf("NO");
	return 0;
}

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

int main()
{
	int i, j;
	string s, st;
	map<char, string> toCode;
	map<string, char> toA;

	toCode[' '] = "101";
	toCode['\''] = "000000";
	toCode[','] = "000011";
	toCode['-'] = "10010001";
	toCode['.'] = "010001";
	toCode['?'] = "000001";
	toCode['A'] = "100101";
	toCode['B'] = "10011010";
	toCode['C'] = "0101";
	toCode['D'] = "0001";
	toCode['E'] = "110";
	toCode['F'] = "01001";
	toCode['G'] = "10011011";
	toCode['H'] = "010000";
	toCode['I'] = "0111";
	toCode['J'] = "10011000";
	toCode['K'] = "0110";
	toCode['L'] = "00100";
	toCode['M'] = "10011001";
	toCode['N'] = "10011110";
	toCode['O'] = "00101";
	toCode['P'] = "111";
	toCode['Q'] = "10011111";
	toCode['R'] = "1000";
	toCode['S'] = "00110";
	toCode['T'] = "00111";
	toCode['U'] = "10011100";
	toCode['V'] = "10011101";
	toCode['W'] = "000010";
	toCode['X'] = "10010010";
	toCode['Y'] = "10010011";
	toCode['Z'] = "10010000";
	toA["00000"] = 'A';
	toA["00001"] = 'B';
	toA["00010"] = 'C';
	toA["00011"] = 'D';
	toA["00100"] = 'E';
	toA["00101"] = 'F';
	toA["00110"] = 'G';
	toA["00111"] = 'H';
	toA["01000"] = 'I';
	toA["01001"] = 'J';
	toA["01010"] = 'K';
	toA["01011"] = 'L';
	toA["01100"] = 'M';
	toA["01101"] = 'N';
	toA["01110"] = 'O';
	toA["01111"] = 'P';
	toA["10000"] = 'Q';
	toA["10001"] = 'R';
	toA["10010"] = 'S';
	toA["10011"] = 'T';
	toA["10100"] = 'U';
	toA["10101"] = 'V';
	toA["10110"] = 'W';
	toA["10111"] = 'X';
	toA["11000"] = 'Y';
	toA["11001"] = 'Z';
	toA["11010"] = ' ';
	toA["11011"] = '.';
	toA["11100"] = ',';
	toA["11101"] = '-';
	toA["11110"] = '\'';
	toA["11111"] = '?';

	while (getline(cin, s)) {
		st = "";
		for (i = 0; i < s.size(); i++) st += toCode[s[i]];

		if ( st.size()%5 )
			for (i = 5 - st.size()%5; i > 0; i--)
				st += "0";

		for (i = 0; i < st.size()/5; i++) {
			s = st.substr( i*5, 5 );
			cout << toA[s];
		}
		cout<<endl;
	}

	return 0;
}

Measured memory_bytes: 0
#include <iostream>

using namespace std;

int main() {
    int n, k;   cin >> n >> k;
    int *a = new int[n];
    for (int i = 0; i < n; i++)
        cin >> a[i];

    int i = 0;
    int ans = 0;
    for (i = 0; i+1 < n; i += k-1) 
        ans++;

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

Measured memory_bytes: 640
#include <iostream>

using namespace std;

int main() {
	int N, H, W;
	int A[1001], B[1001];
	cin >> N >> H >> W;

	int ans = 0;
	for (int i = 0; i < N; i++) {
		cin >> A[i] >> B[i];
		if (A[i] >= H && B[i] >= W) {
			ans++;
		}
	}
	cout << ans << '\n';
	return 0;
}

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

int main() {
  int X, Y;
  cin >> X >> Y;
  
  for(int i = 0; i <= 50; i++)
  {
    if (4 * X - Y == 2 * i)
    {
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;
  return 0;
}

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

int main(){
    string s;cin>>s;
    int an=0,cur=0;
    for(char x:s){
        if(x=='R') cur++;
        else cur=0;
        an=max(an,cur);
    }cout<<an<<"\n";
}



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

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
#include <string>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cmath>
#include <climits>
#include <bitset>
#include <array>
#include <deque>
#include <queue>
#include <map>
#include <set>
#define all(x) (x).begin(),(x).end()

const int MOD = 1e9 + 7;
const int r = 110000;

void solve(){

}
int main(){
    int N;
    cin >> N;
    int dp[r] = {};
    for (int i = 0; i < r; ++i) {
        dp[i] = N;
    }
    dp[0] = 0;
    for (int i = 0; i < N; ++i) {
        for (int pow6 = 1; i + pow6 <= N; pow6 *= 6) {
            dp[i + pow6] = min(dp[i + pow6], dp[i] + 1);
        }
        for (int pow9 = 1; i + pow9 <= N; pow9 *= 9) {
            dp[i + pow9] = min(dp[i + pow9], dp[i] + 1) ;
        }
    }

    cout << dp[N] << endl;



    return 0;
}


Measured memory_bytes: 1272
n, m = map(int, input().split())
A = list(map(int, input().split()))
BC = [list(map(int, input().split())) for _ in range(m)]

A.sort()
BC.sort(key=lambda k: -k[1])

stack = []
cnt = 0
for b, c in BC:
  for _ in range(b):
    stack.append(c)
    cnt += 1
    if cnt > n:
      break

for i in range(min(n, len(stack))):
  if A[i] < stack[i]:
    A[i] = stack[i]
  else:
    break
    
print(sum(A))

Measured memory_bytes: 36088
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;


namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            String str = Console.ReadLine();
            int n = int.Parse(str);
            String[] Array = Console.ReadLine().Split(' ');

            int[] dateArray = new int[Array.Length];
            
            for (int i = 0; i < Array.Length; ++i)
            {
                dateArray[i] = int.Parse(Array[i]);
            }

            long sum = 0;
            int small = 0;           
            for (int j = 0; j < n; ++j )
            {
                sum += dateArray[j];

                if (dateArray[small] > dateArray[j])
                {
                    small = j;
                }
                

            }
            int big = 0;
            for (int b =0; b < n; ++b)
            {
                if (dateArray[big] < dateArray[b])
                {
                    big = b;
                }
            }
            Console.WriteLine("{0} {1} {2}",dateArray[small], dateArray[big], sum);
        }
    }
}

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

int main(){
  int A,B,C,D;
  cin >> A >> B >> C >> D;
  A = A + B;
  C = C + D;
  
  if (A > C){
    cout << "Left" << endl;
  }
  else if (A < C){
    cout << "Right" << endl;
  }
  else if (A == C){
    cout << "Balanced" << endl;
  }
}  

Measured memory_bytes: 3668
#include <iostream>

using namespace std;

int main()
{
  int n, x;
  cin >> n >> x;
  int sum = 0;
  int count = 1;
  for(int i = 0; i < n; i++)
  {
    int temp;
    cin >> temp;
    sum += temp;
    if(sum > x)
    {
      break;
    }
    count++;
  }
  cout << count;

  return 0;
}

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

using namespace std;

int N;
vector<int> d;


int main()
{
	cin >> N;


	d = vector<int>(N);
	for (int i = 0; i < N; i++) {
		cin >> d.at(i);
	}

	sort(d.begin(), d.end());

	int ans = d.at(N / 2) - d.at(N / 2 - 1);

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 640
#include<iostream>
using namespace std;
int main(void) {
    int x, y;
    while(cin >> x >> y){
        if(x == 0 && y == 0) break;
        if(x > y) cout << y << ' ' << x << endl;
        else cout << x << ' ' << y << endl;
    }
    return 0;
}

Measured memory_bytes: 3092
def prime(n):
    a = 2
    res = []
    while (a * a <= n):
        if (n % a != 0):
            a += 1
            continue
        ex = 0

        while (n % a == 0):
            ex += 1
            n //= a

        res.append([a, ex])

    if (n != 1):
        res.append([n, 1])
    return res

n = int(input())
p = prime(n)

ans = 0
for i in p:
    count = 0
    for j in range(i[1]):
        ans += 1
        count += 1
        i[1] -= count
        if count >= i[1]:
            break

print(ans)


Measured memory_bytes: 9212