akhauriyash/Code-Regression huggingface dataset:
def main():
    n = int(input())
    a = list(map(lambda x: int(x)-1, list(input())))
    b = [i % 2 for i in a]

    def all_a(x):
        ans = 0
        for j, i in enumerate(x):
            ans ^= (n-1 | j == n-1)*i
        return ans

    all_b = all_a(b)
    if all_b == 1:
        print(1)
        return
    if 1 in a:
        print(0)
        return
    b = [i//2 for i in a]
    print(all_a(b)*2)


main()

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

ll dp[110][100010];  // dp[i][j] iはどの品物、jは残り重量

int main() {
  ll n, W;
  cin >> n >> W;
  ll w[110], v[110];

  for (ll i = 0; i < n; i++) cin >> w[i] >> v[i];

  for (ll i = 0; i < n; i++)
    for (ll j = 0; j <= W; j++)
      if (j >= w[i] && 0 <= j - w[i])
        dp[i + 1][j] = max(dp[i][j], dp[i][j - w[i]] + v[i]);
      else
        dp[i + 1][j] = dp[i][j];

  cout << *max_element(dp[n], dp[n + 1]) << endl;
}


Measured memory_bytes: 79360
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
//#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
//#include<list>
#include<queue>
#include<deque>
#include<algorithm>
//#include<numeric>
#include<utility>
//#include<memory>
#include<functional>
#include<cassert>
#include<set>
#include<stack>
#include<random>

const int dx[] = {1, 0, -1, 0};
const int dy[] = {0, -1, 0, 1};
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<int, int> pii;

const int MAXN = 100100;
int N, L, Q;
int X[MAXN];

int nxt[30][MAXN];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N; 
    for (int i = 0; i < N; i++)
        cin >> X[i];
    cin >> L;
    memset(nxt, -1, sizeof(nxt));
    for (int i = 0; i < N; i++) {
        if (i == N-1) {
            nxt[0][i] = N-1;
            continue;
        }
        int low = i+1, high = N;
        while (high-low > 1) {
            int med = (high+low)/2;
            if (X[med] - X[i] <= L) low = med;
            else high = med;
        }
        nxt[0][i] = low;
    }
    for (int i = 0; i < 30-1; i++) {
        for (int j = 0; j < N; j++) {
            if (nxt[i][j] == -1) nxt[i+1][j] = -1;
            else nxt[i+1][j] = nxt[i][nxt[i][j]];
            assert(nxt[i][j] != -1);
        }
    }
    cin >> Q;
    for (int t = 0; t < Q; t++) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        if (a > b) swap(a, b);
        if (a < b) {
            int low = 0, high = N;
            while (high - low > 1) {
                int med = (low+high)/2;
                int now = a;
                for (int i = 30-1; i >= 0; i--) {
                    if ((med)&(1<<i)) {
                        now = nxt[i][now];
                    }
                }
                if (now >= b) high = med;
                else low = med;
            }
            cout << high << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 12928
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x = sc.nextInt();
		int t = sc.nextInt();

		if (x - t > 0) {
			System.out.println(x - t);
		} else {
			System.out.println(0);
		}
	}
}


Measured memory_bytes: 35808
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;
typedef long long int ll;
typedef pair<int,int> pi;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int n;
    cin>>n;
    int j = sqrt(1+8*n);
    if (j*j != (8*n+1)) cout<<"No\n";
    else {
        if (j%2==0) cout<<"No\n";
        else {
            int k = (1+j)/2;
            cout<<"Yes"<<"\n"<<k;
            vector<int> v[k];
            for (int i=0,ct=1;i<k;i++) {
                for (int j=0;j<i;j++,ct++) {
                    v[i].push_back(ct);
                    v[j].push_back(ct);
                }
            }
            for (int i=0;i<k;i++) {
                cout<<"\n"<<v[i].size();
                for (auto it:v[i]) {
                    cout<<" "<<it;
                }
            }
        }
    }
}


Measured memory_bytes: 2304
#include <cstdio>
#include <iostream>
#include <array>
#include <vector>
#include <deque>
#include <string>
#include <algorithm>
#include <functional>
#include <tuple>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <utility>
#include <memory>
#include <valarray>
#include <climits>

using namespace std;

using ll = long long int;

#define loop(i, N) for (int i = 0; i < N; ++i)
#define scanInt(x) int x; scanf("%d", &x); getchar();
#define scanLLInt(x) ll x; scanf("%lld", &x); getchar();
#define scanVecInt(A, N) vector<int> A(N); loop(i, N){scanf("%d", &(A[i])); getchar();}
#define scanVecLLInt(A, N) vector<ll> A(N); loop(i, N){scanf("%lld", &(A[i])); getchar();}

int main()
{
    scanInt(N);
    unordered_map<int, int> count;
    loop(i, N){
        scanInt(Di);
        ++count[Di];
    }
    scanInt(M);
    loop(i, M){
        scanInt(Ti);
        if (count.count(Ti) == 0 || count[Ti] <= 0){
            puts("NO");
            return 0;
        }
        --count[Ti];
    }
    puts("YES");
}


Measured memory_bytes: 8520
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for (int& it : a)
        cin >> it;
    int x = 0;
    for (int it : a)
        x ^= it;
    for (int it : a) {
        cout << (x ^ it) << " ";
    }
    cout << endl;
    return 0;
}

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

int main() {
    int n, d, x;
    cin >> n >> d >> x;

    int r = 0;
    for (int i = 0; i < n; i++) {
        int a;
        cin >> a;

        r += (d + a - 1) / a;
    }

    cout << r + x << endl;

    return 0;
}

Measured memory_bytes: 256
n,m,k = map(int,input().split())

def cmb(n, r, mod):
	if (r < 0) or (n < r):
		return 0
	r = min(r, n-r)
	return fact[n]*factinv[r]*factinv[n-r]%mod


mod = 998244353
N = 3 * 10**5  # N は必要分だけ用意する
fact = [1, 1]  # fact[n] = (n! mod p)
factinv = [1, 1]  # factinv[n] = ((n!)^(-1) mod p)
inv = [0, 1]  # factinv 計算用

for i in range(2, N+1):
	fact.append((fact[-1]*i)%mod)
	inv.append((-inv[mod%i]*(mod//i))%mod)
	factinv.append((factinv[-1]*inv[-1])%mod)

ans = 0
for i in range(min(n, k+1)):
	ans = (ans + cmb(n-1, i, mod) * m * pow(m-1, n-i-1, mod)) % mod
print(ans)

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

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

    vector<int> a(n), ac(n + 1);
    for( int i = 0; i < n; i++ ){
        cin >> a[i];
    }
    for( int i = 0; i < n; i++ ){
        ac[i + 1] = (a[i] + ac[i]) % m;
    }

    map<int, int> mp;
    long long ans = 0;
    for( int i = 0; i <= n; i++ ){
        ans += mp[ac[i]];
        mp[ac[i]]++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3968
l,r=map(int,input().split())
mod=2019
ans=2018
if r-l+1>=2019 or r%mod<l%mod:
    ans=0
else:
    for i in range(l%mod,r%mod):
        for j in range(i+1,r%mod+1):
            temp=(i*j)%mod
            ans=min(ans,temp)

print(ans)


Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

#define DEBUG(x) cout << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<pair<T, T> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

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

	int n, h, w;
	cin >> n >> h >> w;

	int a, b;
	int plates = 0;
	for (int i = 0; i < n; ++i) {
		cin >> a >> b;
		if (a >= h && b >= w) {
			++plates;
		}
	}

	cout << plates << "\n";

	return 0;

}

Measured memory_bytes: 256
s = input()
s_2 = s[2:-1]
s_3 = s[:2] + s_2.replace("C", "") + s[-1]
s_3 = s_3.replace("A", "", 1)
if s[0] == "A" and s_2.count("C") == 1 and s_3.islower():
  print("AC")
else:
  print("WA")


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
using ll = long long;
using namespace std;
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; }
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(){
  int N; cin >> N;
  vector<int> A(N+10,0);
  rep(i,N){
    int d,dd; cin >> d >> dd;
    if(d==dd)A[i]=1;
  }
  bool ok = false;
  rep(i,N){
    if(A[i]+A[i+1]+A[i+2]==3) ok = true;
  }
  if(ok) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;

}


Measured memory_bytes: 3628
#include <iostream>

using namespace std;

int conssum(int, int);

int conssum(int inf, int sup) {
    return (inf + sup) * (sup - inf + 1) / 2;
}

int main(int argc, char const *argv[])
{
    while(1) {
        int count = 0;
        int number;
        cin >> number;

        if (number == 0)
            break;

        if (number % 2 == 1) {
            for (int n = (number + 1) / 2; n > 1; n--) {
                for (int k = n - 1; k > 0; k--) {
                    if (conssum(k, n) == number) {
                        count++;
                        // cout << k << " " << n << "\n";
                    }
                }
            }
        } else {
            for (int n = number / 3 + 2; n > 2; n--) {
                for (int k = n - 2; k > 0; k--) {
                    if (conssum(k, n) == number) {
                        count++;
                        // cout << k << " " << n << "\n";
                    }
                }
            }
        }

        cout << count << endl;
    }

    return 0;
}

Measured memory_bytes: 1160
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author
 */

#include <iostream>
#include <fstream>

#include <iostream>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>

#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

using namespace std;

typedef long long ll;

class CDubiousDocument2 {
public:
	void solve(std::istream& cin, std::ostream& cout) {
		string s,t;cin >> s >> t;
		int n = s.size();
		int m = t.size();
		vector<string> v;
		for(int i = 0;i + m - 1 < n;i++){
			string u = s;
			bool ok = true;
			for(int j = 0;j < m;j++){
				if(s[i+j] == t[j] || s[i+j] == '?'){
					u[i+j] = t[j];
				}else{
					ok = false;
				}
			}
			if(ok) {
                for (int j = 0; j < n; j++) {
                    if (u[j] == '?')u[j] = 'a';
                }
                v.push_back(u);
			}
		}
		sort(v.begin(),v.end());
		if(v.size() == 0){
			cout << "UNRESTORABLE" << endl;
		}else{
			cout << v[0] << endl;
		}
	}
};


int main() {
	CDubiousDocument2 solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 384
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 99999999999999999
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;



int main(){

	double a,t,r;

	scanf("%lf %lf %lf",&a,&t,&r);

	printf("%.10lf\n",(r*t)/a);

	return 0;
}



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

#define ll long long
#define vvi vector< vector<int> >
#define vi vector<int>
#define All(X) X.begin(),X.end()
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define pi 3.14159265359
#define shosu(X) fixed << setprecision(X)
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(){
	bool res = true;
	string s;
	cin >> s;
	if(s.substr(0, 4) == "YAKI") cout << "Yes" << endl;
	else cout << "No" << endl;
}

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

using namespace std;

int main() {
  long int N, A, B;

  cin >> N >> A >> B; 

  if(A>B){
    cout << 0;    
  }else if(N==1){
    if(A==B){
      cout << 1;      
    }else{
      cout << 0;
    }
  }else if(N==2){
    cout << 1;
  }else{
    cout << (N-2)*(B-A)+1;
  }
  
  return 0; 
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cstring>
#include <climits>
#include <algorithm>
#include <map>
using namespace std;

vector<int> to[100];
bool used[100];

void addEdge(int a, int b) {
    to[a].push_back(b);
    to[b].push_back(a);
}

int dfs(int v) {
    int ret = 1;
    used[v] = true;
    for (int i=0; i<(int)to[v].size(); ++i) {
        if ( ! used[to[v][i]]) {
            ret = max(ret, 1 + dfs(to[v][i]));
        }
    }
    used[v] = false;
    return ret;
}

int main() {
    int n;
    while (cin >> n, n) {
        fill(to, to+100, vector<int>());
        int a, b;
        for (int i=0; i<n; ++i) {
            cin >> a >> b;
            --a, --b;
            addEdge(a, b);
        }
        int ret = 0;
        for (int i=0; i<100; ++i) {
            memset(used, false, sizeof used);
            ret = max(ret, dfs(i));
        }
        cout << ret << endl;
    }
    return 0;
}

Measured memory_bytes: 1220
#include "bits/stdc++.h"
using namespace std;

typedef long long ll;
#define check(x) cerr << "\n" << (#x) << " is " << (x) << endl;

void test_case(){
    
}

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

    int n, w; cin >> n >> w;
    int a[n+1][2];
    a[0][0] = a[0][1] = 0;
    for(int i = 0; i < n; i++){
        cin >> a[i+1][0] >> a[i+1][1];
    }

    ll dp[n+1][w+1];
    for(int i = 0; i <= n; i++){
        for(int j = 0; j <= w; j++){
            if(min(j, i) == 0){
                dp[i][j] = 0;
                continue;
            }

            if( a[i][0] <= j){
                dp[i][j] = max(dp[i-1][j], dp[i-1][j-a[i][0]] + a[i][1] );
            }
            else
                dp[i][j] = dp[i-1][j];
        }
    }
    cout<<dp[n][w]<<endl;
    
    return 0;
}


Measured memory_bytes: 82444
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

//昼間考えてしまって仕事どころではない

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


	int H, W, h, w;
	cin >> H >> W >> h >> w;

	if (H % h != 0) {
		co("Yes");
		int k = H / h;
		int amari = H % h;
		rep(i, W - 1) cosp(k + 1);
		co(k + 1);
		rep(j, k - 1) {
			rep(i, h - 2) {
				rep(j, W - 1) cosp(0);
				co(0);
			}
			rep(i, W - 1) cosp(-k - 2);
			co(-k - 2);
			rep(i, W - 1) cosp(k + 1);
			co(k + 1);
		}
		rep(i, h - 2) {
			rep(j, W - 1) cosp(0);
			co(0);
		}
		rep(i, W - 1) cosp(-k - 2);
		co(-k - 2);
		rep(i, amari - 1) {
			rep(j, W - 1) cosp(0);
			co(0);
		}
		rep(i, W - 1) cosp(k + 1);
		co(k + 1);
	}
	else if (W % w != 0) {
		co("Yes");
		int k = W / w;
		int amari = W % w;
		rep(i, H) {
			cosp(k + 1);
			rep(j, k - 1) {
				rep(j, w - 2) cosp(0);
				cosp(-k - 2);
				cosp(k + 1);
			}
			rep(j, w - 2) cosp(0);
			cosp(-k - 2);
			rep(i, amari - 1) cosp(0);
			co(k + 1);
		}
	}
	else {
		co("No");
	}

	Would you please return 0;
}

Measured memory_bytes: 1408
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <istream>

using namespace std;

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


int main(){
	int n;
	ll a,b;
	cin >> n >> a >> b;
	ll x[100000];
	for(int i=0;i<n;i++) cin >> x[i];

	ll ans = 0;
	for(int i=1;i<n;i++){
		ll t1 = (x[i]-x[i-1])*a;
		ans += min(t1,b);
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <list> 
#include<algorithm>
#include<cmath>
#include<map>
#include<vector>
#include<string>
#include<fstream>
#include<set>
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define forl(i,a,n) for(int i=a;i<n;i++)
#define rfor(i,n,a) for(int i=n;i>=a;i--)
#define ll long long
#define ull unsigned long long
#define ld long double
#define pb push_back
#define ld long double
#define vi vector<int>
#define vll vector<long long>
#define pi pair<int,int>
#define pll pair<long long,long long>
#define mp make_pair
#define B begin()
#define E end()
#define S size()
#define m9 1000000007
using namespace std;
 
 

 
ll gcd(ll x,ll y)
{
    if(x==0) return y;
    return gcd(y%x,x);
}
 
/*
ll gcdextended(ll a, ll b, ll *x, ll *y) 
{ 
    if (a == 0) 
    { 
        *x = 0, *y = 1; 
        return b; 
    } 
  
    ll x1, y1; 
    int gcd = gcdextended(b%a, a, &x1, &y1); 
   
    *x = y1 - (b/a) * x1; 
    *y = x1; 
  
    return gcd; 
}
 
 
///RELATIVE COPRIME
ll modinverse(ll a, ll m) 
{ 
    ll x, y; 
   ll g = gcdextended(a, m, &x, &y); 
    if (g != 1) 
return -1;
    else
    { 
        ll res = (x%m + m) % m; 
        return res;  
    } 
} 
  */
ll powmod(ll x, ll y, ll m) 
{ 
    if (y == 0) 
        return 1; 
    ll p = powmod(x, y/2, m) % m; 
    p = (p * p) % m; 
    return (y%2 == 0)? p : (x * p) % m; 
} 
///M IS PRIME
ll modif(ll x,ll m){
return(powmod(x,m-2,m));
 
}
 
 
 
#define p0(a) cout << a << " "
#define p1(a) cout << a << endl
#define p2(a, b) cout << a << " " << b << endl
#define p3(a, b, c) cout << a << " " << b << " " << c << endl
#define p4(a, b, c, d) cout << a << " " << b << " " << c << " " << d << endl
#define pin(a) for(auto x:a)cout<<x<<" ";cout<<endl
#define fck(a) cout<<a;exit(0)
#define vvll vector<vector<ll> >
#define A(b) b.begin(),b.end()
#define vpi std::vector<pll>
#include <array>
#include <stack>
//include<bits/stdc++.h>
 
 
bool fa(vll &x,vll &y){return x[0]<y[0];}
bool fa1(vll &x,vll &y){return x[1]<y[1];}
bool f1(pll &x,pll &y){return x.second>y.second;}
bool f2(pll &x,pll &y){
    return x.first>y.first;
}
 
 
bool f3(ll &x,ll &y){
    return x>y; 
    }








const ll maxn=2e5+2;


int main()
{ fastio;
//freopen("test_input (1).txt", "r", stdin); 
//freopen("output.txt", "w", stdout);
ll n,d;cin>>n>>d;
d*=d;
ll ans=0;
forl(i,0,n){
    ll x,y;cin>>x>>y;
    if(x*x+y*y<=d)ans++;
}
cout<<ans;






return 0;
}




  










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

int main()
{
    int A;
    int B;
    cin >> A;
    cin >> B;
    
    if(A >= 10){
        cout << -1 << endl;
    }
    else if(B >= 10){
        cout << -1 << endl;
    }
    else{
        cout << A*B << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int n;
  char nome[101];

  scanf("%d", &n);
  scanf("%s", nome);
  if(n%2 != 0){
    printf("No\n");
    return 0;
  }

  int k = (n/2);
  n = k;
  for(int i = 0; i < n; ++i){
    if(nome[i] != nome[k]){
      printf("No\n");
      return 0;
    }
    ++k;
  }

  printf("Yes\n");
  return 0;
}


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

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

    int sum = 0;
    string head = "";
    string tail = "";

    for(int i=0;i<N;++i)
    {
        if (S[i]=='(')
        {
            sum += 1;
        }
        if (S[i]==')')
        {
            sum -= 1;
        }
        if (sum < 0)
        {
            head += "(";
            sum++;
        }
    }
    while(sum>0)
    {
        tail += ")";
        sum--;
    }

    cout << head << S << tail << endl;

    return 0;
}


Measured memory_bytes: 256
<?php
fscanf(STDIN, "%d", $n);
$i = 1;
$res = "";
do {
 $x = $i;
 if ($x % 3 === 0) {
    $res .= " $i";
  } else {
    do {
      if ( $x % 10 === 3) {
        $res .= " $i";
        break;
      } else {
        $x /= 10;
      }
    } while ( $x );
  }
} while (++$i <= $n);
echo $res,PHP_EOL;

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

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(lol i=0;i<lol(n);i++)
#define REPD(i,n) for(lol i=n-1;i>=0;i--)
#define FOR(i,a,b) for(lol i=a;i<=lol(b);i++)
#define FORD(i,a,b) for(lol i=a;i>=lol(b);i--)
#define VL vector<lol>
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) lol(x.size()) //sizeをsize_tからllに直しておく
//定数
#define PI 3.1415926535897932385 //pi
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//最大値最小値
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; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main()
{
    lol result{0};
    lol a, b, c, d; cin >> a >> b >> c >> d;
    result = max(a*c, b*d);
    result = max(result, a*d);
    result = max(result, b*c);
    

    cout << result << endl;
    return 0;
}

Measured memory_bytes: 3648
#include<stdio.h>
#define MAX 100000
int partition(int A[],int p,int r){
  int x,i,j,tmp;
  x=A[r];
  i=p-1;
  for(j=p;j<r;j++){
    if(A[j]<=x){
      i=i+1;
      tmp=A[i];
      A[i]=A[j];
      A[j]=tmp;
    }
  }
  tmp=A[i+1];
  A[i+1]=A[r];
  A[r]=tmp;
  return i+1;
}
int main(){
  int A[MAX],n,i,p;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
  }
  p=partition(A,0,n-1);
  for(i=0;i<p;i++){
    printf("%d",A[i]);
    printf(" ");
  }
  printf("[%d] ",A[p]);
  for(i=p+1;i<n;i++){
    printf("%d",A[i]);
    if(i<n-1) printf(" ");
  }
  printf("\n");
  return 0;
}

Measured memory_bytes: 996
import sys

sys.setrecursionlimit(10**9)

N = int(input())

ab = []
graph = [[] for _ in range(N + 1)]
for _ in range(N - 1):
    a, b = map(int, input().split())
    ab.append((a, b))
    graph[a].append(b)

colors = [-1] * (N + 1)
K = 0


def bfs(p_node, p_color):
    global K
    children_node = graph[p_node]
    c_color = 1
    for child_node in children_node:
        if c_color == p_color:
            c_color += 1
        colors[child_node] = c_color
        bfs(child_node, c_color)
        c_color += 1
    K = max(K, c_color - 1)


bfs(1, -1)

print(K)
for a, b in ab:
    print(colors[b])


Measured memory_bytes: 69628
A = []
import sys
for i in range(3):
  A += [[int(c) for c in input().split()]]
N = int(input())
dic = [0]*101
for i in range(N):
  b = int(input())
  dic[b] = 1
for j in range(3):
  for i in range(3):
    if dic[A[j][i]]==0:
      break
  else:
    print('Yes')
    sys.exit()
for i in range(3):
  for j in range(3):
    if dic[A[j][i]]==0:
      break
  else:
    print('Yes')
    sys.exit()
for i in range(3):
  if dic[A[i][i]]==0:
    break
else:
  print('Yes')
  sys.exit()
for i in range(3):
  if dic[A[2-i][i]]==0:
    break
else:
  print('Yes')
  sys.exit()
print('No')


Measured memory_bytes: 3064
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<set>
#include<queue>
using namespace std;
int n;
int z;
int sum[1100000];
void dfs(int a,int b,int c,int num,int fl)
{
    if(num>1e9)
    {
        return ;
    }
    if(fl>9)
        return ;
    if(a&&b&&c)
    {
        sum[z++]=num;
        dfs(1,b,c,num*10+3,fl+1);
        dfs(a,1,c,num*10+5,fl+1);
        dfs(a,b,1,num*10+7,fl+1);
    }
    else
    {
           dfs(1,b,c,num*10+3,fl+1);
        dfs(a,1,c,num*10+5,fl+1);
        dfs(a,b,1,num*10+7,fl+1);
    }

}
int main()
{
    z=0;
    dfs(0,0,0,0,0);
    sort(sum,sum+z);
    int key;
    while(cin>>key)
    {

    int left = 0;
    int right =z-1;
    while (left <= right) {
        int mid = (left + right) / 2;
        if (sum[mid] > key) {
            right = mid - 1;
        }
        else {
            left = mid + 1;
        }
    }
    cout<<right+1<<endl;
    }

}



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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    ll A, B;
    cin >> A >> B;
    vector<ll> sumA(40, 0), sumB(40, 40);

    ll divNum = 1;
    REP(i, 40)
    {
        ll div = (A - 1) / (divNum * 2);
       sumA[i] += div * divNum;
       sumA[i] += max((A - 1) % (divNum *2) + 1 - divNum, 0ll);

       div = B / (divNum * 2);
       sumB[i] += div * divNum;
       sumB[i] += max(B % (divNum *2) + 1 - divNum, 0ll);
        divNum *= 2;
    }
    
    ll ans = 0;
    ll p = 1;
    REP(i, 40)
    {
        ans += ((sumB[i] - sumA[i]) % 2) * p;
        p *= 2;
     }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ADD(a, b) a = (a + (ll)b) % mod
#define MUL(a, b) a = (a * (ll)b) % mod
#define MAX(a, b) a = max(a, b)
#define MIN(a, b) a = min(a, b)
#define rep(i, a, b) for(int i = a; i < b; i++)
#define rer(i, a, b) for(int i = a - 1; i >= b; i--)
#define all(a) (a).begin(), (a).end()
#define sec second
#define fst first
#define debug(fmt, ...) Debug(__LINE__, ":", fmt, ##__VA_ARGS__)

using namespace std;

typedef long long ll;
typedef pair<int, int> pi;
typedef pair<pi, pi> ppi;
typedef vector<ll> vec;

const int MAX_N = 100010;
const double eps = 1e-6;
const ll mod = 1000000007;
const ll inf = 1LL << 60;

void Debug() {cout << '\n'; }

template<class FIRST, class... REST> 
void Debug(FIRST arg, REST... rest) { cout << arg << " "; Debug(rest...); }

template<class T>
ostream& operator<< (ostream& out, const vector<T>& v) {
	out << "[";
	if(!v.empty()) {
		rep(i, 0, (int)v.size() - 1) out << v[i] << ", ";
		out << v.back();
	}
	out << "]";
  return out;
}

template<class S, class T>
ostream& operator<< (ostream& out, const pair<S, T>& v) {
	out << "(" << v.first << ", " << v.second << ")";
	return out;
}

///g++ -g3 -std=c++0x -DLOCAL -Wall -ftrapv -D_GLIBCXX_DEBUG -Wl,-stack,268435456 -o
///g++ -O2 -std=c++0x -DLOCAL -Wall -Wl,-stack,268435456 -o

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

int N;

void solve() {
	cin >> N;
	deque<int> que;
	rep(i, 0, N) {
		int a; cin >> a;
		if(i % 2 == 0) que.push_front(a);
		else que.push_back(a);
	}
	if(N % 2 == 0) {
		rep(i, 0, N) {
			cout << que.back() << " ";
			que.pop_back();
		}
		cout << "\n";
	}
	else {
		rep(i, 0, N) {
			cout << que.front() << " ";
			que.pop_front();
		}
		cout << "\n";
	}
}

int main() {
	ios::sync_with_stdio(false);
    cin.tie(0);	
    cout << fixed;
	cout.precision(20);
#ifdef LOCAL
    freopen("in.txt", "rt", stdin);
#endif	
	solve();
#ifdef LOCAL
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}




Measured memory_bytes: 3072
#include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <queue>
#define MAXn 100002
#define MAXm 100011
using namespace std;

int main()
{
    int a[3];
    for(int i=0;i<3;i++)
        scanf("%d",&a[i]);
    sort(a,a+3);
    if(a[0]==5&&a[1]==5&&a[2]==7)
        printf("YES\n");
    else printf("NO\n");
    return 0;
}

Measured memory_bytes: 256
/**
  * @brief atcoder
  * @author yao
  */
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cstring>
#include <utility>
#include <algorithm>
#include <functional>
#include <climits>
#define ft first
#define sd second
#ifdef DBG
#   define dbg_pri(x...) fprintf(stderr,x)
#else
#   define dbg_pri(x...) 0
#   define NDEBUG
#endif //DBG
#include <cassert>

typedef unsigned int uint;
typedef long long int lli;
typedef unsigned long long int ulli;

#define N 524288
#define M 16

const int p3[M] = {1, 3, 9, 27, 81, 243, 729, 2187,
    6561, 19683, 59049, 177147, 531441, 1594323, 4782969, 14348907};
const int op_add[2][3] = {{1,2,0},{2,0,1}};
const int conv[2][3] = {{0,1,2},{0,2,1}};
int a[M][N];
int dir = 0;
char s[N];
int n,m;

void add(int x, int y)
{
    if(y==m) return;
    for(int i=0;i<3;++i)
    {
        int pos = x+p3[y]*i;
        a[y][pos] = op_add[dir][a[y][pos]];
        if(a[y][pos] == 0)
            add(pos,y+1);
    }
}

int main()
{
    scanf("%d%s", &m, s), n = p3[m];
    for(int i=0;i<m;++i)
        for(int j=0;j<p3[i+1];++j) a[i][j] = j/p3[i];
    for(int i=0;s[i];++i)
    {
        if(s[i] == 'S') dir^=1;
        if(s[i] == 'R') add(0,0);
    }
    for(int i=0;i<n;++i)
    {
        int res = 0;
        for(int j=0;j<m;++j)
            res += conv[dir][a[j][i%p3[j+1]]]*p3[j];
        printf("%d%c", res, i==n-1?'\n':' ');
    }
    return 0;
}


Measured memory_bytes: 7244
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <complex>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3fLL-1
double EPS=1e-9;
using namespace std;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef complex<double> P;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }

/*
cin >> n;
vi a(n);
rep(i,n)cin>>a[i];
*/
int main(){
	int N;
	cin>>N;
	//vi a(N);
	int a;
	int data[114514]={0};
	for(int i=0;i<N;i++){
		cin>>a;
		data[a]++;
	}
	int ans=0,res=0;
	for(int i=0;i<100000;i++){
		if(data[i]>=1){
			ans++;
			res=res+data[i]-1;
		}
	}
	if(res%2==1)ans--;
	cout<<ans<<endl;
}


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

int bubbleSort(int a[], int n) {
  int cnt = 0;
  bool flag = true;
  for (int i = 0; flag; i ++) {
    flag = false;
    for (int j = n - 1; j >= i + 1; j --) {
      if (a[j] < a[j - 1]) {
        swap(a[j], a[j-1]);
        flag = true;
        cnt ++;
      }
    }
  }
  return cnt;
}

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

  int cnt = bubbleSort(a, n);

  for (int i = 0; i < n; i ++) {
    if (i) cout << " ";
    cout << a[i];
  }
  cout << endl;
  cout << cnt << endl;
}



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

const int MOD = 1e9+7;
int n;
long long ans;
vector<int> prime;
bitset<1005> isPrime;

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

	cin >> n;

	for (int i = 2; i <= n; i++) {
		if (!isPrime[i]) {
			prime.push_back(i);
			for (int j = i*i; j <= n; j+=i) {
				isPrime[j] = 1;
			}
		}
	}

	ans = 1;
	for (int i = 0; i < prime.size(); i++) {
		long long p = prime[i], powers = 0;
		while (n / p) {
			powers = (powers + n/p) % MOD;
			p *= prime[i];
		}

		ans = (ans * (powers+1)) % MOD;
	}
	cout << ans << '\n';
	
	return 0;
}

Measured memory_bytes: 256
#include <map>
#include <set>
#include <cmath>
#include <cstdio>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#define endl '\n'
#define all(var) var.begin(), var.end()
#define input freopen("input", "r", stdin)
#define output freopen("output", "w", stdout)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int const MOD = 1e9+7;
typedef long long ll;
using namespace std;
 
int main(){
    int n, m;
    cin >> n >> m;
    int sum = 0;
    while(m--){
        int x; cin >> x;
        sum += x;
    }
    if( sum <= n ) cout << n-sum << endl;
    else cout << "-1" << endl;
}


Measured memory_bytes: 3592
object Main extends App {
  val in = new java.util.Scanner(System.in)
  val N = in.nextInt

  println(
    if (N < 105) 0 // 3 * 5 * 7
    else if (N < 135) 1 // 3 * 3 * 3 * 5
    else if (N < 165) 2 // 3 * 5 * 11
    else if (N < 189) 3 // 3 * 3 * 3 * 7
    else if (N < 195) 4 // 3 * 5 * 13
    else 5
  )
}

Measured memory_bytes: 55308
#include <algorithm>
#include <bitset>
#include <cmath>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>

// Acknowledgement: Special thanks to kyomukyomupurin, who developed this
// template.
template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::pair<T, U>& p) {
  return os << '(' << p.first << ", " << p.second << ')';
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::vector<T>& vec) {
  int n = 0;
  for (auto e : vec) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::ostream& operator<<(std::ostream& os, const std::set<T>& st) {
  int n = 0;
  for (auto e : st) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T, class U>
std::ostream& operator<<(std::ostream& os, const std::map<T, U>& mp) {
  int n = 0;
  for (auto e : mp) os << (n++ ? ", " : "{") << e;
  return os << (n ? "}" : "{}");
}

template <class T>
std::istream& operator>>(std::istream& is, std::vector<T>& vec) {
  for (T& e : vec) is >> e;
  return is;
}

#ifdef LOCAL
#define debug(...) \
  std::cerr << "[" << #__VA_ARGS__ << "]: ", debug_out(__VA_ARGS__)
#else
#define debug(...)
#endif

void debug_out() { std::cerr << '\n'; }

template <class Head, class... Tail>
void debug_out(Head&& head, Tail&&... tail) {
  std::cerr << head;
  if (sizeof...(Tail) != 0) std::cerr << ", ";
  debug_out(std::forward<Tail>(tail)...);
}
using namespace std;
using int64 = long long;

int main() {
  int N;
  cin >> N;
  vector<int64> A(N);
  cin >> A;
  vector<int64> minus_idx(N);
  vector<int64> plus_idx(N);
  for (int i = 0; i < N; i++) {
    minus_idx[i] = i - A[i];
  }
  for (int i = 0; i < N; i++) {
    plus_idx[i] = A[i] + i;
  }
  debug(minus_idx);
  debug(plus_idx);
  map<int64, int64> mp;
  int64 ans = 0;
  for (int i = 0; i < N; i++) {
    ans += mp[minus_idx[i]];
    mp[plus_idx[i]]++;
  }
  debug(mp);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 30500
import sys
from fractions import gcd
from functools import reduce
from itertools import combinations

import numpy as np

sys.setrecursionlimit(200000)


def input():
    return sys.stdin.readline()[:-1]


def ii(t: type = int):
    return t(input())


def il(t: type = int):
    return list(map(t, input().split()))


def imi(N: int, t: type = int):
    return [ii(t) for _ in range(N)]


def iml(N: int, t: type = int):
    return [il(t) for _ in range(N)]


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


def solve():
    N = ii()
    ans = 0
    divisors = make_divisors(N)
    sqrt_n = N ** 0.5
    for m in divisors:
        if m == 1 or m - 1 < sqrt_n:
            continue
        ans += m - 1
    return ans


if __name__ == "__main__":
    print(solve())


Measured memory_bytes: 13860
#pragma GCC optimize(2)
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#define LL long long
#define pb push_back
#define mp make_pair
#define INF 0x3f3f3f3f
#define Inf 1000000000000000000LL
#define rep(i,x) for(int (i)=1;(i)<=(x);(i)++)
#define repp(i,x,y) for(int (i)=(x);(i)<=(y);(i)++)
#define per(i,x,y) for(int (i)=(x);(i)>=(y);(i)--)
#define forn(i,x) for(int (i)=0;(i)<(x);(i)++)
#define foreach(i,x) for(auto i:x)
using namespace std;
typedef pair<int,int>pii;
int n,m,q;
vector<int>G[100010];
int v[100010],d[100010],c[100010],col[100010];
int now;
int used[100010];
inline void read(int &x){
    int f=1;x=0;char s=getchar();
    while(s<'0'||s>'9'){s=getchar();}
    while(s>='0'&&s<='9'){x=x*10+s-'0';s=getchar();}
}
inline void dfs(int x,int d){
	if(used[x]>=d)return;
	used[x]=d;
	if(!col[x])col[x]=now;
	foreach(to,G[x])if(d)dfs(to,d-1);
}
int main(){
	memset(used,-1,sizeof(used));
	read(n),read(m);
	for(int i=1,x,y;i<=m;i++){
		read(x),read(y);
		G[x].pb(y),G[y].pb(x);
	}
	read(q);
	rep(i,q)read(v[i]),read(d[i]),read(c[i]);
	reverse(v+1,v+q+1);
	reverse(d+1,d+q+1);
	reverse(c+1,c+q+1);
	for(int i=1;i<=q;i++){
		now=c[i];
		dfs(v[i],d[i]);
		// rep(i,n)cout<<col[i]<<' ';
		// puts("");
	}
	rep(i,n)cout<<col[i]<<endl;
	return 0;
}
/*
7 7
1 2
1 3
1 4
4 5
5 6
5 7
2 3
2
6 1 1
1 2 2
*/

Measured memory_bytes: 8440
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>

#define REP(i,a,n) for(int i=a;i<n;++i)
#define rep(i,n) REP(i,0,n)
#define REV(i,a,n) for(int i=n;i>=a;--i)
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define mod 1000000007
#define show(n) cerr<<#n<<" = "<<n<<endl
#define shows(n) for(auto z:n){cerr<<z<<", ";}cerr<<endl

//ここからAtCoder向けdefine
#define yes cout << "YES" << endl
#define no cout << "NO" << endl

using namespace std;

using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using pint = pair<int,int>;

const int INF = (1 << 30);

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

    int a,b,k;
    cin>>a>>b>>k;
    int n=k;
    REP(i,a,b+1){
        if(n>0){
            printf("%d\n",i);
        }else if(i>b-k){
            printf("%d\n",i);
        }

        n--;
    }

    return 0;
}

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

int main() {
	int a, b;
	cin >> a >> b;

	if (a == b)cout << "Draw" << endl;
	else if (a == 1)cout << "Alice" << endl;
	else if (b == 1)cout << "Bob" << endl;
	else if (a > b)cout << "Alice" << endl;
	else cout << "Bob" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin>>s;

    if(s[0]!=s[1]&&s[1]!=s[2]&&s[0]!=s[2]){
        cout<<"Yes"<<endl;
    }
    else {
        cout<<"No"<<endl;
    }
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
using namespace std;

char ary[10];
int main(){
	int a=0,b=0,o=0,ab=0;
	while(~scanf("%*d,%s",ary)){
		if(strcmp(ary,"A")==0) a++;
		else if(strcmp(ary,"B")==0) b++;
		else if(strcmp(ary,"O")==0) o++;
		else if(strcmp(ary,"AB")==0) ab++;
	}
	printf("%d\n%d\n%d\n%d\n",a,b,ab,o);
	return 0;
}

Measured memory_bytes: 2588
X,Y,Z,K = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
asort,bsort,csort = sorted(A,reverse=True),sorted(B,reverse=True),sorted(C,reverse=True)
print(asort[0] + bsort[0] + csort[0])
already = [[0,0,0]]
x,y,z = 0,0,0
place_sum = []
check = []
for k in range(K - 1):
    if [x + 1,y,z] not in already and x + 1 < X:
        already.append([x + 1,y,z])
        place_sum.append([x + 1,y,z])
        check.append(asort[x + 1] + bsort[y] + csort[z])
    if [x,y + 1,z] not in already and y + 1 < Y:
        already.append([x,y + 1,z])
        place_sum.append([x,y + 1,z])
        check.append(asort[x] + bsort[y + 1] + csort[z])
    if [x,y,z + 1] not in already and z + 1 < Z:
        already.append([x,y,z + 1])
        place_sum.append([x,y,z + 1])
        check.append(asort[x] + bsort[y] + csort[z + 1])
    print(max(check))
    x,y,z = place_sum[check.index(max(check))][0],place_sum[check.index(max(check))][1],place_sum[check.index(max(check))][2]
    place_sum.pop(check.index(max(check)))
    check.remove(max(check))

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

using namespace std;

typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldbl;
typedef pair<int, int> pii;
typedef pair<uint, uint> puu;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<uint> vu;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pii> vpii;
typedef vector<puu> vpuu;
typedef vector<pll> vpll;
typedef vector<pull> vpull;
typedef vector<string> vstr;
typedef vector<double> vdbl;
typedef vector<ldbl> vldbl;
#define pb push_back
#define ppb pop_back
#define pfr push_front
#define ppfr pop_front
#define emp emplace
#define empb emplace_back
#define be begin
#define rbe rbegin
#define all(x) (x).be(), (x).end()
#define rall(x) (x).rbe(), (x).rend()
#define fir first
#define sec second
#define mkp make_pair
#define brif(cond) if (cond) break
#define ctif(cond) if (cond) continue
#define retif(cond) if (cond) return
void canhazfast() {ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);}
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a%b) : a;}
template<typename T> T extgcd(T a, T b, T &x, T &y)
{
    T x0 = 1, y0 = 0, x1 = 0, y1 = 1;
    while (b) {
        T q = a/b; a %= b; swap(a, b);
        x0 -= q*x1; swap(x0, x1);
        y0 -= q*y1; swap(y0, y1);
    }
    x = x0; y = y0; return a;
}
int ctz(uint x) {return __builtin_ctz(x);}
int ctzll(ull x) {return __builtin_ctzll(x);}
int clz(uint x) {return __builtin_clz(x);}
int clzll(ull x) {return __builtin_clzll(x);}
int popcnt(uint x) {return __builtin_popcount(x);}
int popcntll(ull x) {return __builtin_popcountll(x);}
int bsr(uint x) {return 31^clz(x);}
int bsrll(ull x) {return 63^clzll(x);}

int main()
{
    canhazfast();

    int n, k;
    string s;

    cin >> n >> k >> s;
    s[k-1] = tolower(s[k-1]);
    cout << s << '\n';

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

class Program {
    static string ReadLine() { return Console.ReadLine(); }
    static int ReadInt() { return int.Parse(ReadLine()); }
    static int[] ReadInts() { return ReadLine().Split().Select(int.Parse).ToArray(); }
    static string[] ReadStrings() { return ReadLine().Split(); }

    static int MaxSumSequence(int[] xs) {
        var dp = new int[xs.Length];
        dp[0] = xs[0];
        int ans = dp[0];
        for (int i = 1; i < xs.Length; i++) {
            dp[i] = Math.Max(dp[i-1] + xs[i], xs[i]);
            ans = Math.Max(ans, dp[i]);
        }
        return ans;
    }

    static void Main() {
        int n;
        while ((n = ReadInt()) != 0) {
            var xs = new int[n];
            for (int i = 0; i < n; i++) {
                xs[i] = ReadInt();
            }
            Console.WriteLine(MaxSumSequence(xs));
        }
    }
}

Measured memory_bytes: 9204
#include <bits/stdc++.h>
#define pb push_back
#define Int long long
using namespace std;

const int MAXN=500005;
const int NAX=1005;
const long long  MOD=(long long)(1e9+7);

Int N,M,K;
Int X,Y,Z;
Int H,W;
Int perform(Int x){
    return (x*(x+1))/2LL;
}
vector<Int> A;
vector<int> adj[MAXN];
using D=long double;

bool inRange(Int a,Int b){
    return a*b<=0;
}

long long ModExpo(long long x,unsigned long long y,long long M){
    Int ans=1;
    ans=(long long)ans;
    
    while(y>0){
        if(y&1) ans=((ans%M)*(x%M))%M;
        y>>=1LL;
        x=((x%M)*(x%M))%M;
    }
    return ans%M;
}
long long dp[MAXN];
long long C[1000005];
Int solve(Int N){
    if(N<0) return 0;
    if(N==0) return 1;
    if(dp[N]!=-1) return dp[N];
    Int ans=0;
    for(int i=3;i<=N;++i){
        ans=(ans+solve(N-i))%MOD;
    }
    return dp[N]=ans;
}

void compute(){
        C[0]=0;
        for(int i=1;i<1000005;++i) C[i]=(C[i-1]+i-1)%MOD;
    }
int main()
{
    cin>>N;
    vector<pair<Int,Int>> arr;
    Int maxSumA=-1e15,maxSumB=-1e15;Int minSumA=1e15,minSumB=1e15;
    for(int i=0;i<N;++i){
        Int u,v;
        cin>>u>>v;
        maxSumA=max(maxSumA,u+v);
        maxSumB=max(maxSumB,u-v);
        minSumA=min(minSumA,u+v);
        minSumB=min(minSumB,u-v);
    }
    Int ans=max(abs(maxSumA-minSumA),abs(maxSumB-minSumB));
    cout<<ans<<"\n";
}


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

int main() {
	int a[3][3];
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			cin >> a[i][j];
		}
	}
	int x[3], y[3];
	x[0] = 0;
	rep(i, 3) y[i] = a[0][i] - x[0];
	rep(i, 3) x[i] = a[i][0] - y[0];
	bool flag = true;
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			if (x[i] + y[j] != a[i][j]) {
				flag = false;
			}
		}
	}
	(flag) ? puts("Yes") : puts("No");
	return 0;
}


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

int main(){
  int l, i, al[120] = {};
  char s[2048] ={};
  while(scanf("%s", s) != EOF){
     l = strlen(s);
    for(i = 0;i < l;i++) if('A' <= s[i] && 'Z' >= s[i]) s[i] += 'a' - 'A';
    for(i = 0;i < l;i++) if('a' <= s[i] && s[i] <= 'z') al[s[i] - 'a']++;
  }
  for(i = 0;i < 26;i++)
    printf("%c : %d\n", i + 'a', al[i]);
  return 0;
}



Measured memory_bytes: 2032