akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_set>
#include <vector>

using namespace std;

#define ll long long
#define P pair<int, int>
#define FOR(i, N) for (int i = 0; i < (int)N; i++)
#define FORIN(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define GI(name) \
  int(name);     \
  scanf("%d", &(name))
#define GI2(name1, name2) \
  int(name1), (name2);    \
  scanf("%d %d", &(name1), &(name2))
#define GI3(name1, name2, name3) \
  int(name1), (name2), (name3);  \
  scanf("%d %d %d", &(name1), &(name2), &(name3))
#define GVI(name, size)    \
  vector<int>(name)(size); \
  FOR(i, (size)) scanf("%d", &(name)[i])
#define GS(name) \
  string(name);  \
  cin >> (name);
#define MOD 1000000007
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

string to_string(string s) {
  return s;
}

template <class T>
string to_string(vector<T> v) {
  string ret = "{";
  FOR(i, v.size() - 1) { ret += to_string(v[i]) + ","; }
  if (v.size() > 0) {
    ret += to_string(v.back());
  }
  ret += "}";
  return ret;
}

void debug() {
  cerr << endl;
}

template <class Head, class... Tail>
void debug(Head head, Tail... tail) {
  cerr << to_string(head) << " ";
  debug(tail...);
}

void print() {
  cout << endl;
}

template <class Head, class... Tail>
void print(Head head, Tail... tail) {
  cout << to_string(head);
  print(tail...);
}

int main() {
  GI(N);
  vector<int> likes(N, -1);
  int ans = 0;
  FOR(i, N) {
    GI(a);
    if (likes[a - 1] == i)
      ans++;
    likes[i] = a - 1;
  }
  print(ans);
  return 0;
}

Measured memory_bytes: 640
/*
Author: Racer5x
 ***************************************   UNAUTHORISED COPYING OF CODE PROHIBITED   **********************************
*/
 
// #pragma GCC optimize("O3")
// #pragma GCC optimize("Ofast")
// #pragma GCC optimize("unroll-loops")
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
#include<bits/stdc++.h>
#define int         long long
#define double      long double
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
#define x           first
#define y           second
#define endl        '\n'
#define hell        998244353 
#define PI          3.141592653589
#define tezz        ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MAX         2000000000000000000
#define M           1000000007
using namespace std;

int modifyBit(int n, int p, int b) 
{ 
    int mask = 1 << p; 
    return (n & ~mask) | ((b << p) & mask); 
} 
 
signed main()
{
    tezz
    
    int n;
    cin>>n;

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

   		for(int j=0;j<a;j++){
   			int x, y;
   			cin>>x>>y;
   			v[i].pb(x, y);
   		}
   	}

   	int ans = 0;
   	for(int mask=0;mask<(1<<n);mask++){
   		bool flag = true;
   		// cout<<mask<<" ====>>> "<<endl;
   		for(int j=0;j<n;j++){
   			if(mask & (1<<j)){

   				// cout<<j<<" --> "<<endl;
   				for(int k=0;k<v[j].size();k++){
   					int x = v[j][k].x-1, y = v[j][k].y;

   					// cout<<x<<' '<<y<<" ----->   ";
   					// // curr = modifyBit(curr, x, y);
   					// cout<<mask<<" ___ "<<(y<<x)<<endl;

   					if(((mask ^ (y<<x))) & (1<<x)) {flag = false; break;}
   				}
   				if(!flag) break;
   			}
   		}

   		if(flag){
   			// cout<<'t';
   			int l = __builtin_popcount(mask);
   			ans = max(ans, l);
   		}
   		// cout<<" *********** "<<endl<<endl;
   	}
   	cout<<ans;
} 

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

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

		int ans;
		
		if(op == "+") ans = a + b;
		if(op == "-") ans = a - b;
		if(op == "*") ans = a * b;
		if(op == "/") ans = a / b;

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


Measured memory_bytes: 3148
#include <algorithm>
#include <climits>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <numeric>

constexpr long long MOD = 1000000007;

int main()
{
  int N, K;
  std::cin >> N >> K;
  std::vector<int> V(N);
  for (auto& v: V)
    std::cin >> v;
  long long ans = 0;
  for (int n = 1; n <= std::min(N, K); ++n)
  {
    int ext = std::min((n + K) / 2, N);
    long long val = 0;
    std::vector<long long> tmp;
    tmp.reserve(ext);
    for (int l = 0; l <= ext; ++l)
    {
      tmp.clear();
      for (int i = 0; i < l; ++i)
      {
        tmp.push_back(V[i]);
      }
      int cnt = ext - l;
      int j = (int)V.size() - 1;
      while (cnt--)
        tmp.push_back(V[j--]);
      std::sort(tmp.begin(), tmp.end(), std::greater<int>{});
      val = std::max(val,
                     std::accumulate(tmp.begin(), tmp.begin() + n, 0LL));
    }
    ans = std::max(ans, val);
  }
  std::cout << ans << std::endl;
  return 0;
}


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

namespace aizu
{
    class OnlineJudge
    {
        static void Main()
        {
            int count = int.Parse(Console.ReadLine());
            while(count-- > 0) {
                string input = Console.ReadLine();
                Console.WriteLine(int.Parse(new string(input.OrderByDescending(p => p).ToArray())) - int.Parse(new string(input.OrderBy(p => p).ToArray())));
            }
        }
    }
}

Measured memory_bytes: 6348
#include<stdio.h>

int main(){
  int H,W,i,j;
  while(1){
    scanf("%d %d",&H,&W);
    if(H == 0 && W == 0) break;
    
	for(i = 0; i < H; i++){
      for(j = 0; j < W; j++)
        if(i == 0 || i == H - 1){
			printf("#");
		}else if(j == 0 || j == W - 1){
			printf("#");
	    }else{
			printf(".");
	    }
		printf("\n");
	  }
	  printf("\n");
	}
	return 0;
}

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

using namespace std;
typedef long long int ll;

const ll M = 998244353;

vector<ll> fac(300001); //n!(mod M)
vector<ll> ifac(300001); //k!^{M-2} (mod M)
//a,bの範囲的にこれだけ配列を用意していけば十分

ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = (ans*x) % M;
        x = (x*x) % M;
        n = n >> 1;
    }
    return ans;
}

ll comb(ll a, ll b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % M;
    return tmp * fac[a] % M;
}

int main()
{
    ll n,k;
    cin >> n;
    vector<int> d(n);
    for(int i=0;i<n;i++)cin>>d[i];
    if( d[0] != 0 ){
	cout<<0<<endl;
	return 0;
    }
    sort(d.begin(),d.end());
    /*for(int i=1;i<n;i++)if( abs(d[i]-d[i-1])>1 ){
	cout<<0<<endl;
	return 0;
    }*/
    k = d[n-1];
    vector<int> rank(k+1,0);
    for(int i=0;i<n;i++)rank[ d[i] ]++;
    if( rank[0] != 1 ){
	cout<<0<<endl;
	return 0;
    }
    //大した量ではないので，先にfax[i]とifax[i]を全て計算しておく
 /*   fac[0] = 1;
    ifac[0] = 1;
    for(ll i = 0; i<300000; i++){
        fac[i+1] = fac[i]*(i+1) % M; // n!(mod M)
        ifac[i+1] = ifac[i]*mpow(i+1, M-2) % M; // k!^{M-2} (mod M) ←累乗にmpowを採用
    }*/


    ll res = 1;
    for(int i = 0;i<k;i++){
	//ll tmp= comb( rank[i] + rank[i+1] -1 , rank[i+1] );
	//cout<<tmp<<' '<<rank[i]<<' '<<rank[i+1]<<endl;
	//res *=tmp;
	res *= mpow(  rank[i] , rank[i+1] );
	res %= M;
    }
    cout<<res<<endl;
    return 0;
}

Measured memory_bytes: 5760
#![allow(non_snake_case)]
#![allow(unused_imports)]
use ascii::AsciiChar;
use ascii::AsciiStr;
use itertools::Itertools as _;
use permutohedron::LexicalPermutation as _;
use petgraph::algo::dijkstra;
use petgraph::algo::min_spanning_tree;
use petgraph::data::FromElements;
use petgraph::graph::NodeIndex;
use petgraph::graph::UnGraph;
use petgraph::unionfind::UnionFind;
use proconio::fastout;
use proconio::input;
use proconio::marker::Chars;
use proconio::marker::Usize1;
use std::cmp::max;
use std::cmp::min;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::VecDeque;
use superslice::Ext as _;

#[fastout]
fn main() {
    input! {
        mut S: Chars,
    }

    if S.len() == 3 {
        S.reverse();
    }

    for &c in S.iter() {
        print!("{}", c);
    }
    println!();
}


Measured memory_bytes: 2116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

int gcd(int x, int y){
	if(y==0) return x;
	else return gcd(y, x%y);
}

int lcm(int x,int y){
	return x*y / gcd(x,y);
}

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

    int K;
    cin >> K;
    ll ans=0;
    rep1(i,K+1){
        rep1(j,K+1){
            rep1(k,K+1){
                int kari = gcd(j,k);
                ans += gcd(i,kari);
            }
        }
    }

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





Measured memory_bytes: 3692
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
	int n,i=0,e=0,w=0,an=1e9,a[300003];
	char c[300003];
	cin>>n;
	for(;i<n;)
	{
		cin>>c[i];
		a[i]=w;
		w+=c[i++]==87;
	}
	for(;i>0;)
	{
		an=min(an,a[--i]+e);
		e+=c[i]==69;
	}
	cout<<an<<endl;
}

Measured memory_bytes: 1664
#include<iostream>
#include <bits/stdc++.h>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;

int main() {
	
    int n,k ;    
    cin >> n >> k ;
     string s ;
    cin >> s ;
  
    s[k-1] = tolower(s[k-1]) ; 
  
    cout << s << endl ;
  
  

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn = 5e5 + 10;
const int mod = 1e9 + 7;
typedef long long ll;
vector<int> g[maxn];
ll dp[maxn], sum[maxn], fac[maxn], ifac[maxn], n;
ll fpow(ll a, ll b) {
    ll r = 1;
    while (b) {
        if (b & 1) r = r * a % mod;
        b >>= 1;
        a = a * a % mod;
    }
    return r;
}
ll C(int x, int y) {
    if (x < 0 || x < y || y < 0) return 0;
    return fac[x] * ifac[y] % mod * ifac[x - y] % mod;
}
void dfs1(int u, int fa) {
    dp[u] = 1;
    for (auto it : g[u]) {
        if (it == fa) continue;
        dfs1(it, u);
        sum[u] += sum[it];
        dp[u] = dp[u] * dp[it] % mod * C(sum[u], sum[it]) % mod;
    }
    sum[u] += 1;
}
void dfs2(int u, int fa) {
    for (auto it : g[u]) {
        if (it == fa) continue;
        ll tmp = dp[u] * fpow(dp[it], mod - 2) % mod * fpow(C(n - 1, sum[it]), mod - 2) % mod;
        dp[it] = dp[it] * tmp % mod * C(n - 1, sum[it] - 1) % mod;
        dfs2(it, u);
    }
}
int main() {
    fac[0] = 1;
    for (int i = 1; i <= maxn - 10; i++) fac[i] = fac[i - 1] * i % mod;
    ifac[maxn - 10] = fpow(fac[maxn - 10], mod - 2);
    for (int i = maxn - 10 - 1; i >= 0; i--)
        ifac[i] = ifac[i + 1] * (i + 1) % mod;
    scanf("%lld", &n);
    for (int i = 1, x, y; i < n; i++) {
        scanf("%d%d", &x, &y);
        g[x].push_back(y);
        g[y].push_back(x);
    }
    dfs1(1, 0); dfs2(1, 0);
    ll ans = 0;
    for (int i = 1; i <= n; i++)
    {
        printf("%lld\n", dp[i] % mod );
    }
    return 0;
}


Measured memory_bytes: 36596
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define inf 1000000000
#define IOS ios_base::sync_with_stdio(0);cin.tie(0)
#define meM(y,a) memset(y,a,sizeof y)
#define sC(a) scanf("%d",&a)
#define alL(a) a.begin(),a.end()
#define prinT(a,sz)  cout<<a[0];for(int i=1;i<sz;i++)cout<<" "<<a[i];cout<<endl
#define ranD srand(chrono::steady_clock::now().time_since_epoch().count());
typedef pair<int,int>pi;
typedef pair<ll,ll>pll;
//int fx[]={0,0,1,-1};
//int fy[]={1,-1,0,0};
//int gx[]={0,0,1,1,1,-1,-1,-1};
//int gy[]={1,-1,0,1,-1,0,1,-1};
const int N=100010;

int main()
{
    IOS;
    ll n,k;
    cin>>n>>k;
    ll res=0;
    for(int i=1;i<=n;i++)
    {
        ll x=i%k;
        if(x==0)
        {
            res+=(n/k)*(n/k);
//            cout<<" i = "<<i<<endl;
        }
        else if(x+x==k&&x<=n)
        {
            res+=((n-x)/k+1)*((n-x)/k+1);
//            cout<<"i = "<<i<<endl;
//            cout<<"res= "<<res<<endl;
        }
    }
    cout<<res<<endl;
}








Measured memory_bytes: 3656
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <array>
#include <cassert>
#include <bitset>
using namespace std;
using LL = long long;

//??????????????°??¨(min????§?????????§???????????°?????????????????§??¨???)
//less???greater???Comp?????\?????????
//???????§??????????operator()???????????????????????§???OK
//??????RMQ<int,less<int>>tree(N,INT_MAX);
template<typename T, typename Comp>
class RMQ {
private:
	const T DEF;//??????????????????(min??§???INF???sum??§???0??????)
	vector<T> seg;//????????????
	int width;//?????°??¨??????(???????????§????????§????????????)
	T query_raw(int a, int b, int k, int l, int r)const {
		if (a >= r || b <= l)return DEF;
		if (a <= l && r <= b)return seg[k];
		return min(
			query_raw(a, b, 2 * k + 1, l, (l + r) / 2),
			query_raw(a, b, 2 * k + 2, (l + r) / 2, r), Comp());
	}
public:
	//?????????n?????????????????????def????????°??¨?????????
	RMQ(int n, T def) :DEF(def) {
		width = 1;
		while (width < n)width *= 2;
		seg.assign(width * 2 - 1, DEF);
	}
	//??????[a,b)????????¨???????????????????????????
	T query(int a, int b)const { return query_raw(a, b, 0, 0, width); }
	//x?????????????´????k?????´??°??????
	void update(int k, T x) {
		k += width - 1;
		seg[k] = x;
		while (k > 0) {
			k = (k - 1) / 2;
			seg[k] = min(seg[2 * k + 1], seg[2 * k + 2], Comp());
		}
	}
	//???????????¨???????????????
	void init(const vector<T>& vec) {
		assert(vec.size() >= width);
		for (int i = 0; i < width; ++i)
			seg[i + width - 1] = vec[i];
		for (int k = width = 2; k >= 0; --k)
			seg[k] = min(seg[2 * k + 1], seg[2 * k + 2], Comp());
	}
};

int main() {
	int N, Q;
	cin >> N >> Q;
	RMQ<int, less<int>>tree(N, INT_MAX);
	for (int i = 0; i < Q; ++i) {
		int com, x, y;
		cin >> com >> x >> y;
		if (com) {
			cout << tree.query(x, y + 1) << endl;
		}
		else {
			tree.update(x, y);
		}
	}
	return 0;
}

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

int main()
{
  std::string s;
  std::cin>>s;
  bool res = true;
  for(int i=0;i<(int)s.size() - 1;i++){
   	if(s[i] == s[i+1]) res = false;
  }
  std::cout<<(res?"Good":"Bad")<<std::endl;
}

Measured memory_bytes: 256
n=int(input())
w=list(map(int,input().split()))
ans=[]
for i in range(n-1):
    s=w[:i+1]
    b=w[i+1:]
    s1=sum(s)
    b1=sum(b)
    ans.append(int(abs(s1-b1)))
print(min(ans))
    

Measured memory_bytes: 3060
import sys
from collections import deque
from collections import Counter

readline = sys.stdin.readline

S = readline().rstrip()

c = Counter(S)
a = list(c.items())

if len(a) == 2 and a[0][1] == 2 and a[1][1] == 2:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 38384
import itertools

N,K = map(int, input().split())

X = []
Y = []

for _ in range(N):
  x,y = map(int, input().split())
  X.append(x)
  Y.append(y)

# 全部数えても間に合う

min_area = 5*10**18

for x1,x2 in itertools.combinations(X,2):
  for y1,y2 in itertools.combinations(Y,2):
    if x1 > x2:
      x1,x2 = x2,x1
    if y1 > y2:
      y1,y2 = y2,y1

    area = (x2-x1) * (y2-y1)
    if area > min_area:
      continue
      
    cnt = 0
    for x,y in zip(X,Y):
      if x1 <= x <= x2 and y1 <= y <= y2:
        cnt += 1
    if cnt < K:
      continue
      
    min_area = area
    
print(min_area)

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

using namespace std;
typedef long long int ll;

int main()
{
    ll n,N;
    cin >> N;
    n = N;
    vector<pair<ll,ll>>v;
    for(ll num = 2; num <= sqrt(n); num++)
    {
        ll count = 0;
        if(n == 1) break;
        while(n % num == 0)
        {
            n = n / num;
            count++;
        }
        if(count != 0)
        {
            v.push_back(pair(num,count));
        }
    }
    if(n > 1) v.push_back(pair(n,1));
    ll ans = 0;
    for(ll i = 0; i < v.size(); i++)
    {
        for(ll j = 1; j <= v[i].second;j++)
        {
            if(N == 1) break;
            ll num = pow(v[i].first,j);
            if(N % num == 0)
            {
                N = N / num;
                ans++;
            }
        }
        if(N == 1) break;
    }
    cout << ans << endl;
}

Measured memory_bytes: 4108
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k,i;
  cin>>n>>k;
  vector<int> a(n);
  for(i=0;i<n;i++){
    cin>>a.at(i);
    if(i>=k){
      if(a.at(i)>a.at(i-k)) cout<<"Yes"<<endl;
      else cout<<"No"<<endl;
    }
  }
}

Measured memory_bytes: 4004
//Bi-smi llāh

#include<bits/stdc++.h>
using namespace std;
#define nn '\n'
#define pb push_back
#define F(i, n) for(int i = 0; i < n; ++i)
#define Fe(i, n) for(auto i: n)
#define  ll long long int



int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
  int n; cin >> n;
  int sum = 0;
  sum = (n / 500) * 1000;
  n %= 500;
  //cout << n <<' ';
  sum += (n / 5) * 5;
  cout << sum <<'\n';
	return 0;
	}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
  int n;
  cin>>n;
  set<ll> s;
  ll a;
  for(int i=0;i<n;i++){
    cin>>a;
    if(s.end()!=s.find(a))
      s.erase(a);
    else
      s.insert(a);
  }
  cout<<s.size();
}


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

static const int NMAX = 100;
bool G[NMAX][NMAX];

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

	for (int i = 0; i < n; i++) {
		for (int j = 0; j < n; j++) {
			G[i][j] = false;
		}
	}

	for (int i = 0; i < n; i++) {
		int deg; cin >> deg >> deg;
		for (int j = 0; j < deg; j++) {
			int p; cin >> p;
			G[i][p - 1] = true;
		}
	}

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

	return 0;
}


Measured memory_bytes: 3116
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
#define fi first
#define se second
#define endl '\n'
#define y1 holyshit
#define all(x) x.begin(),x.end()
const int inf=0x3f3f3f3f;

int N;
set<string> s;

int main(){
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin>>N;
    for(int i=0;i<N;i++){
        string t; cin>>t;
        s.insert(t);
    }
    cout<<s.size();
    return 0;
}

Measured memory_bytes: 19240
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;} return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;} return 0;}
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(vec) vec.begin(),vec.end()
typedef long long ll;
typedef pair<ll,ll> l_l;
typedef pair<int,int> i_i;
const ll mod=1e9+7;
const int inf=1<<30;

int main(){
  int n,m; cin >> n >> m;
  vector<int> a(n);
  map<int,int> mp;
  priority_queue<l_l> q;
  rep(i,n){
    cin >> a[i];
    q.push(l_l(a[i],1));
  }
  vector<int> b(m);
  vector<int> c(m);
  rep(i,m) cin >> b[i] >> c[i];
  rep(i,m){
    q.push(l_l(c[i],b[i]));
  }
  ll ans=0;
  int cnt=0;
  while(cnt+q.top().second<=n){
    ans+=q.top().first*q.top().second;
    cnt+=q.top().second;
    q.pop();
  }
  ans+=q.top().first*(n-cnt);
  cout << ans << endl;
}

Measured memory_bytes: 7280
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a, b, c; cin >> a >> b >> c;
	using T = tuple<int, int, int>;
	set<T> st;
	int ans = 0;
	int na, nb, nc;
	while (true) {
		if (a % 2 || b % 2 || c % 2)break;
		if (st.count(T(a, b, c))) {
			ans = -1;
			break;
		}
		st.emplace(a, b, c);
		ans++;
		na = b / 2 + c / 2;
		nb = c / 2 + a / 2;
		nc = a / 2 + b / 2;
		a = na;
		b = nb;
		c = nc;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int a, b;
    cin >> a >> b;
    string s;
    cin >> s;
    for(int i = 0; i < a; i++)
    {
        if(s[i] < '0' || s[i] > '9')
        {
            cout << "No" << endl;
            return 0;
        }
    }
    if(s[a] != '-')
    {
        cout << "No" << endl;
        return 0;
    }
    for(int i = a+1; i < a+1+b; i++)
    {
        if(s[i] < '0' || s[i] > '9')
        {
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}


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

class Program
{
    static void Main(string[] args)
    {
        new Program().Calc();
    }

    Scanner cin;

    public Program() { }

    bool chmax<T>(ref T a, T b) where T : IComparable<T> { if (a.CompareTo(b) < 0) { a = b; return true; } return false; }
    bool chmin<T>(ref T a, T b) where T : IComparable<T> { if (b.CompareTo(a) < 0) { a = b; return true; } return false; }

    void Calc()
    {
        cin = new Scanner();

        int n = cin.nextInt();
        long k = cin.nextLong();

        int[] a = cin.ArrayInt(n);

        int[] index = new int[n];

        int[] index_ = new int[n];

        int i = 0;
        int count = 0;
        while (index[i] == 0)
        {
            index_[count] = i;

            ++count;

            index[i] = count;

            i = a[i] - 1;
        }

        int loopCount = (count + 1) - index[i];

        int loopStart = index[i] - 1;

        if (k - loopStart > 0)
        {
            int mod = (int) ((k - loopStart) % loopCount);

            WriteLine(index_[loopStart + mod] + 1);
        }
        else
        {
            WriteLine(index_[k] + 1);
        }
    }
}

public static class StringExtension
{
    public static char GetChar1(this string str, int indexOneBase)
    {
        return str[indexOneBase - 1];
    }
}

class Scanner
{
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner()
    {
        s = new string[0];
        i = 0;
    }

    public string next()
    {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt()
    {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0)
    {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong()
    {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0)
    {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble()
    {
        return double.Parse(next());
    }


    public double[] ArrayDouble(int N, double add = 0)
    {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++)
        {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}


Measured memory_bytes: 43876
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.InputMismatchException;
import java.io.IOException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastScanner in = new FastScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskC solver = new TaskC();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskC {
        public void solve(int testNumber, FastScanner in, PrintWriter out) {
            int n = in.nextInt();
            int ans = 0;
            int pre = in.nextInt();
            for (int i = 1; i < n; i++) {
                int cn = in.nextInt();
                if (cn < pre)
                    ans += pre - cn;
                pre = cn;
            }
            out.println(ans + pre);
        }

    }

    static class FastScanner {
        private InputStream in;
        private byte[] buffer = new byte[1024];
        private int bufPointer;
        private int bufLength;

        public FastScanner(InputStream in) {
            this.in = in;
        }

        private int readByte() {
            if (bufPointer >= bufLength) {
                if (bufLength == -1)
                    throw new InputMismatchException();

                bufPointer = 0;
                try {
                    bufLength = in.read(buffer);
                } catch (IOException e) {
                    throw new InputMismatchException();
                }

                if (bufLength <= 0)
                    return -1;
            }
            return buffer[bufPointer++];
        }

        private static boolean isSpaceChar(int c) {
            return c == ' ' || c == '\n' || c == '\r' || c == '\t' || c == -1;
        }

        public long nextLong() {
            long n = 0;

            int b = readByte();
            while (isSpaceChar(b))
                b = readByte();

            boolean minus = (b == '-');
            if (minus)
                b = readByte();

            while (b >= '0' && b <= '9') {
                n *= 10;
                n += b - '0';
                b = readByte();
            }

            if (!isSpaceChar(b))
                throw new NumberFormatException();

            return minus ? -n : n;
        }

        public int nextInt() {
            long n = nextLong();

            if (n < Integer.MIN_VALUE || n > Integer.MAX_VALUE)
                throw new NumberFormatException();

            return (int) n;
        }

    }
}



Measured memory_bytes: 24788
#include <algorithm>
#include <iostream>
#include <unordered_map>
#include <string>
#include <vector>

int main(int argc, char const* argv[])
{
    std::array<std::string, 4> words = {
        "dream", "dreamer", "erase", "eraser"
    };
    for (auto &e : words) {
        std::reverse(e.begin(), e.end());
    }

    std::string S;
    std::cin >> S;
    std::reverse(S.begin(), S.end());

    for (auto it = S.begin(); it != S.end(); ) {
        bool canDevide = false;
        for (const auto& word : words) {
            if (word.size() > (S.end() - it)) {
                continue;
            }
            if (std::equal(word.begin(), word.end(), it)) {
                canDevide = true;
                it += word.size();
                break;
            }
        }
        if (!canDevide) {
            std::cout << "NO" << std::endl;
            return 0;
        }
    }
    std::cout << "YES" << std::endl;
    return 0;
}


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


int main(void){

  char s[1100];
  char x[1000][50];
  int i, j, n, len;
  int max, size;

  int a, b;
  int count;


  scanf("%[a-zA-Z ]", s);
  getchar();


  n=0;
  len=strlen(s);
  i=j=0; 
  while(i<len){
    x[n][j]=s[i];
    i++;
    j++;
    if(s[i]==' '){
      i++;
      n++;
      j=0;
    }
  }
  n++;

  max=0;
  size=0;
  for(i=0; i<n; i++){
    count=1;
    for(j=i+1; j<n; j++){
      if(strcmp(x[i], x[j])==0){
	count++;
      }
    }
    if(max<count){
      max=count;
      a=i;
    }
    if(size<strlen(x[i])){
      size=strlen(x[i]);
      b=i;
    }
  }

  printf("%s %s\n", x[a], x[b]);


  return(0);
}



Measured memory_bytes: 2064
#include<iostream>
#include<math.h>
using namespace std;
int main(){
	int N;
	cin>>N;
	int num[110]={0};
	for(int i=1;i<=N;i++){
		//现在求证它能被2整除几次
		int t=i;
		int j;
		for( j=0;;j++){
			if(t%2==0){
				t=t/2;
			}else{
				break;
			}
		}
		num[i]=j;
	}
	int max=-1;
	for(int i=1;i<=N;i++){
		if(num[i]>max){
			max=num[i];
		}
	}
	for(int i=1;i<=N;i++){
		if(max==num[i]){
			cout<<i<<endl;
			break;
		}
	}
//	cout<<max;
	return 0;
}

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

using namespace std;

template <typename T>
using vec1 = vector<T>;

template <typename T>
T cin2var()
{
    T val;
    cin >> val;
    return val;
}

template <typename T>
vec1<T> cin2vec(size_t size)
{
    vec1<T> vec1(size);
    for (auto& v : vec1) {
        v = cin2var<T>();
    }
    return vec1;
}

void sub()
{
    const auto N(cin2var<size_t>());
    const auto As(cin2vec<char>(N));
    uint64_t c1 = 0;
    uint64_t max_c1 = 0;
    for (const auto& c : As) {
        if (c == '1') {
            ++c1;
            if (max_c1 < c1) max_c1 = c1;
        }
        else {
            c1 = 0;
        }
    }
    cout << max_c1 + 1 << endl;
}

int main()
{
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    sub();
    return 0;
}


Measured memory_bytes: 3108
#include <cstdio>
#include <iostream>
using namespace std;
const long long M = 998244353;

long long c[5001][5001];
long long ch(int n, int k) {
    if (0 > n || k > n) return 0;
    if (k < 0) return 0;
    return c[n][k];
}

int main() {
    int k, n; cin >> k >> n;
    for (int a = 0; a <= 5000; a++) {
        c[a][0] = 1; c[a][a] = 1;
        for (int b = 1; b < a; b++) {
            c[a][b] = (c[a-1][b] + c[a-1][b-1])%M;
        }
    }
    for (int i0 = 2; i0 <= 2*k; i0++) {
        int i = (i0 > k+1) ? 2*k - i0 + 2 : i0;
        long long ans = 0;
        int u = min(k, i/2), l = max(1, i-k);
        for (int m = 0; m <= u - l + 1; m++) {
            ans += (ch(u-l+1, m) * ch(n+k-1-2*m, n-2*m) * (m%2 == 0 ? 1 : -1)) % M;
            ans %= M;
        }
        cout << (ans%M + M) % M << endl;
    }
}


Measured memory_bytes: 193792
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        long W = sc.nextLong();
        long[] w = new long[N];
        int[] v = new int[N];
        for (int i = 0; i < N; i++) {
            w[i] = sc.nextLong();
            v[i] = sc.nextInt();
        }

        long[][] dp = new long[N + 1][100001];
        for (int i = 0; i < N + 1; i++) {
            for (int j = 0; j < 100001; j++) {
                dp[i][j] = Integer.MAX_VALUE;
            }
        }
        dp[0][0] = 0;
        for (int i = 0; i < N; i++) {
            for (int sumv = 0; sumv < 100001; sumv++) {
                if (sumv >= v[i]) {
                    dp[i + 1][sumv] = Math.min(dp[i + 1][sumv], dp[i][sumv - v[i]] + w[i]);
                }
                dp[i + 1][sumv] = Math.min(dp[i + 1][sumv], dp[i][sumv]);
            }
        }
        long ans = 0;
        for (int sumv = 0; sumv < 100001; sumv++) {
            if (dp[N][sumv] <= W) {
                ans = sumv;
            }
        }
        System.out.println(ans);
    }

}


Measured memory_bytes: 129616
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int S = getInt(sc.nextLine());
      
        if(S <= 111){
          println("111");
          return;
        }else if(S <= 222){
          println("222");
          return;
        }else if(S <= 333){
          println("333");
          return;
        }else if(S <= 444){
          println("444");
          return;
        }else if(S <= 555){
          println("555");
          return;
        }else if(S <= 666){
          println("666");
          return;
        }else if(S <= 777){
          println("777");
          return;
        }else if(S <= 888){
          println("888");
          return;
        }else{
          println(999);
          return;
        }
        
    }
    static long getLong(String val) {return Long.parseLong(val);}
    static int getInt(String val) {
        return Integer.parseInt(val);
    }

    static void println(String val){System.out.println(val);};
    static void println(int val){System.out.println(val);};
    static void println(long val){System.out.println(val);};
    static void println(Object val){System.out.println(val);};
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define rep(i,n) for(long long i=0; i<n; i++)
#define Rep(i,n) for(long long i=1; i<n; i++)
#define ll long long
#include <math.h>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <numeric>
#include <queue>
#include <set>
#include <vector>


using namespace std;
#define PI acos(-1)
using P =pair<ll,ll>;

ll ketasu(ll a){
   ll num=1;
   while(a/10){
       num++;
       a/=10;
   }
   return num;
}

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

ll kosuu(ll a){
    ll sum=0;
    for(ll i=1;i*i<=a;i++){
        if(a%i==0){
            if(a!=1&&i*i!=a){
            sum+=2;
            }else{
             sum++;   
            }
        }
    }
    return sum;
}

ll n;



    vector<pair<ll,ll>>p;
void fs(ll a){
    for(ll i=2;i*i<=n;i++){
        ll cnt=0;
        while(n%i==0){
            n/=i;
            cnt++;
        }
        p.emplace_back(i,cnt);
    }
    return;
}


ll di[]={1,0,-1,0};
ll dj[]={0,-1,0,1};
int main()
{
 const ll m=1000000007;
 ll n;
 cin>>n;
 vector<ll>a(n);
 rep(i,n)cin>>a[i];
 vector<ll>v(n-1);
 ll sum=0;
 Rep(i,n)sum+=a[i];
 v[0]=sum%m;
 Rep(i,n-1){
     v[i]=(v[i-1]-a[i]);
     v[i]=v[i]%m;
     if(v[i]<0)v[i]+=m;
 }  
 ll ans=0;
 rep(i,n-1){
     
         ans+=(a[i]%m * (v[i]%m))%m;
         ans%=m;
 }
 cout<<ans<<endl;
 
}
 




Measured memory_bytes: 6404
n, m = map(int, input().split())
a = [int(input()) for _ in range(m)]

mod = 1000000007
brok = [False] * (n+1)

for i in a:
    brok[i] = True

dp = [0] * (n+2)
dp[n] = 1

for i in range(n-1, -1, -1):
    if brok[i]:
        dp[i] = 0
        continue
    else:
        dp[i] = (dp[i+1]+dp[i+2]) % mod

print(dp[0])

Measured memory_bytes: 51096
#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 n,a,b;
	cin >> n >> a >> b;
	if(a%2 != b%2) cout<< "Borys" << endl;
	else cout << "Alice" << endl;
}

Measured memory_bytes: 3608
#include<stdio.h>
int main(void){
	int a,b,coin;
	coin = 0;
	scanf("%d %d",&a,&b);
	
	for(int i = 1;i<=2;i++){
		if(a>b){
		coin = coin + a;
		a = a-1;
	}else{
		coin = coin + b;
		b = b-1;
	}}
	printf("%d\n", coin);
	return 0;
}


Measured memory_bytes: 128
using System;
using System.Collections.Generic;
using System.Collections;
using System.Collections.Specialized;
using System.Linq;
using System.Text;
using System.IO;
using System.Reflection;
using static System.Math;
static class Program{
	const int mod=(int)1e9+7;
	static long[] r;
	static void Main(){
		Sc sc=new Sc();
		long[] s=sc.La;
		r=new long[s[0]*s[1]];
		r[0]=1;
		long ans=0;
		for(int i = 1;i<s[0]*s[1];i++) {r[i]=(r[i-1]*i)%mod;}
		long p=(((s[1]*s[1])%mod)*Cb1(s[0]*s[1]-2,s[2]-2))%mod;
		for(int i = 1;i<s[0];i++) {ans=(ans+(((p*i)%mod)*(s[0]-i))%mod)%mod;}
		p=(((s[0]*s[0])%mod)*Cb1(s[0]*s[1]-2,s[2]-2))%mod;
		for(int i = 1;i<s[1];i++) {ans=(ans+(((p*i)%mod)*(s[1]-i))%mod)%mod;}
		Console.WriteLine("{0}",ans);
	}
	static long Cb1(long n,long k){return (r[n]*Mi(r[k]*r[n-k]))%mod;}
	static long Mi(long a){
		a=(a+mod)%mod;
		long b=mod,u=1,v=0;
		while(b>0){
			long t=a/b;
			a-=t*b;a^=b;b^=a;a^=b;
			u-=t*v;u^=v;v^=u;u^=v;
		}
		u%=mod;
		if(u<0){u+=mod;}
		return u%mod;
	}
}

public class Sc{
	private string[] a;
	private int n=-1,m=0;
	public int I{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return int.Parse(a[n]);}}
	public long L{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return long.Parse(a[n]);}}
	public double D{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return double.Parse(a[n]);}}
	public string S{get{if(n==-1||n==a.Length-1){n=-1;a=Console.ReadLine().Split();}n++;return a[n];}}
	public string Sz{get{return Console.ReadLine();}}
	public int[] Ia{get{if(n!=-1&&n!=a.Length-1){m=n;n=-1;return Array.ConvertAll(a.Skip(m+1).ToArray(),int.Parse);}return Array.ConvertAll(Console.ReadLine().Split(),int.Parse);}}
	public int[] Ia2(int b){return Array.ConvertAll((((b&1)!=0?"0 ":"")+Console.ReadLine()+((b&2)!=0?" 0":"")).Split(),int.Parse);}
	public long[] La{get{return Array.ConvertAll(Console.ReadLine().Split(),long.Parse);}}
	public long[] La2{get{return Array.ConvertAll(("0 "+Console.ReadLine()+" 0").Split(),long.Parse);}}
	public double[] Da{get{return Array.ConvertAll(Console.ReadLine().Split(),double.Parse);}}
	public string[] Sa{get{return Console.ReadLine().Split();}}
	public string[] Sa2{get{return (Console.ReadLine()+" 0").Split();}}
	public T[] Arr<T>(int n,Func<string[],T> f){var a=new T[n];for(int i=0;i<n;i++){a[i]=f(Console.ReadLine().Split());}return a;}
}

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

using namespace std;

int main() {
  int N;
  cin >> N;
  int A[N];
  for (int i = 0; i < N; i++)
  {
    cin >> A[i];
  }
  long long ans = 0;
  int  maxValue = 0;
  for (int a : A)
  {
    maxValue = max(maxValue, a);
    ans += maxValue - a;
  }
  cout << ans << "\n";
}


Measured memory_bytes: 4352
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
    int n;
    int pd[110];
    while(cin>>n)
    {
        int m=0,ans=0,cnt=0;
        memset(pd,0,sizeof(pd));
        for(int i=1;i<=n;i++)
        {
            cin>>pd[i];
            if(pd[i]!=m&&cnt>1)
            {
                //ans++;
                m=pd[i];

                ans+=cnt/2;
                //cout<<cnt<<endl;
                cnt=1;
            }
            else if(pd[i]!=m)
            {
                m=pd[i];
                cnt=1;
            }
            else cnt++;
            //printf("pd[%d]=%d m=%d ans=%d cnt=%d\n",i,pd[i],m,ans,cnt);
        }
        if(cnt>1) ans+=cnt/2;
        cout<<ans<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextLine() int {
  sc.Scan()
  data, _ := strconv.Atoi(sc.Text())
  return data
}

func main() {
  var a [5]int
  a[0] = nextLine()
  a[1] = nextLine()
  a[2] = nextLine()
  a[3] = nextLine()
  a[4] = nextLine()

  var last = a[0]
  var index = 0
  var total = 0
  for i := 1; i < 5; i++ {
    var c = a[i] % 10
    if c < last % 10 && c != 0 {
      last = a[i]
      index = i
    }
  }

  for i:=0; i < 5; i++ {
    var t = 0
    var d = 0
    if index != i {
      t = a[i] % 10
      d = a[i] - t
      if t != 0 {
        d += 10
      }
      total += d
    }
  }
  total += a[index]

  fmt.Println(total)
}



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

int main()
{
   int64_t n,a=0,b,p;
   cin>>n;
   p=n;
   while(p)
   {
       b=p%10;
       a+=b;
       p/=10;
   }
   
   if(n%a==0) cout<<"Yes";
   else cout<<"No";

    return 0;
}


Measured memory_bytes: 764
#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
using namespace std;
int main(){
   
    string a,b,c;
    cin>>a>>b>>c;
    
    cout<<"A"<<b[0]<<"C"<<endl;
    
    
    return 0;
   
}






Measured memory_bytes: 256
# import sys
# import math #sqrt
# import decimal
# import queue # queue
# import bisect
# import heapq # priolity-queue
# import time
# import itertools
# import collections # deque
# from operator import itemgetter
# from fractions import Fraction

mod = int(1e9+7)
INF = 1<<29
lINF = 1<<35

def main():
    k,n = map(int,input().split())
    a = list(map(int,input().split()))
    l = []
    for i in range(n-1):
        l.append(a[i+1]-a[i])
    l.append((a[0]+k)-a[n-1])
    print(k-max(l))
    return

if __name__=='__main__':
    main()

Measured memory_bytes: 26548
#include <iostream>
#include <set>
#include <vector>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }

const int N = 100009;
const long long INF = 1LL << 60;
const long long MOD = 1000000007;

int main() {
    int n, c;
    cin >> n >> c;
    Graph D(c);
    rep(i, c) rep(j, c) {
        int d;
        cin >> d;
        D[i].push_back(d);
    }
    
    vector < vector<long long>> iwakan(c, vector<long long>(3, 0));
    rep(i, n) rep(j, n) {
        int g;
        cin >> g;
        rep(k, c)
            iwakan[k][(i + j) % 3] += D[g-1][k];
    }

    long long ans = -1;
    rep(i0, c) {
        rep(i1, c) {
            if (i0 == i1) continue;
            rep(i2, c) {
                if (i0 == i2 || i1 == i2) continue;
                long long temp = 0;
                temp += iwakan[i0][0];
                temp += iwakan[i1][1];
                temp += iwakan[i2][2];
                if (ans<0 || ans>temp) ans = temp;
                //cout << i0 << " " << i1 << " " << i2 << endl;
            }
        }
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
// #Badhi moh maya chhe!


#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ld long double
#define pll pair<long long,long long>
#define vll vector<long long>
#define pb push_back
#define Fo(i,k,n) for(ll i=k;k<n?i<=n:i>=n;k<n?i+=1:i-=1)
#define deb(x) cout << #x << "=" << x << endl
#define in(a,n) F(i,0,n-1)cin>>a[i]
#define out(a,n) F(i,0,n-1)cout<<a[i]<<" ";cout<<endl
#define IOS              ios_base::sync_with_stdio(0); cin.tie(NULL);

ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
bool com(pll x,pll y)
{    return x.first>y.first;
}


int main() {
	IOS
    	ll t;
	//cin>>t;	
	t=1;
	while(t--)
	{
	ll n,m;
	cin>>n;
	string s;
	cin>>s;
	for(auto x:s)
	{
	    int ch=(int)(x+n);
	    if(ch<='Z')cout<<(char)ch;
	    else cout<<char(ch-26);
	}
	
	
	
	}
	
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mod 1000000007
#define mod998 998244353
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;

string S;
string T[4] = { "Sunny","Cloudy","Rainy","Sunny" };

int main() {
	cin >> S;
	for (int i = 0;; ++i) {
		if (T[i] == S) {
			cout << T[i + 1] << endl;
			return 0;
		}
	}
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
#define INF (1<<30)
#define INFLL (1ll<<60)
typedef pair<ll, int> P;
#define MOD (1000000007ll)
#define l_ength size

ll sq(ll x){
	return x*x;
}

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

bool isvowel(char c){
	int i;
	string v="aeiou";
	for(i = (v.size()-1); i>=0; --i){
		if(c == v[i]){
			return true;
		}
	}
	return false;
}

int main(void){
	int x;
	cin >> x;
	cout << ((x<1200)?"ABC":"ARC") << endl;
	return 0;
}

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

typedef long long ll;
typedef unsigned long long ull;

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

  ll N = s.size();

  // i = 位置
  // j = 区切った数
  vector<vector<ll>> dp(N, vector<ll>(2));
  dp[0][0] = 1;
  dp[1][1] = 1;

  for (ll i = 0; i < N; ++i) {
    if (i+1 < N) {
      // 1文字と次の1文字を比較
      if (s[i] != s[i+1]) {
        dp[i+1][0] = max(dp[i+1][0], dp[i][0]+1);
      }
      // 2文字と次の1文字を比較（はするまでもない）
      dp[i+1][0] = max(dp[i+1][0], dp[i][1]+1);
    }

    if (i+2 < N) {
      if (i > 0) {
        // 2文字と次の2文字を比較
        if (s[i-1] != s[i+1] || s[i] != s[i+2]) {
          dp[i+2][1] = max(dp[i+2][1], dp[i][1]+1);
        }
      }
      // 1文字と次の2文字を比較（はするまでもない）
      dp[i+2][1] = max(dp[i+2][1], dp[i][0]+1);
    }
  }

  cout << max(dp[N-1][0], dp[N-1][1]) << endl;

  return 0;
}

Measured memory_bytes: 11396
import numpy as np
import math
n = int(input())
A = np.fromstring(input(),dtype=np.int64,sep=" ")
#rng = int(math.log2(np.max(A)))+1
sum = 0
d = 10**9+7
for bit in range(64):
    c = int((A & 1).sum())
    sum += c *(n-c)*(1<<bit)%d
    A = A>>1

print(sum %(d))

Measured memory_bytes: 29148
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

X, Y, Z = MAP()

print((X-Z)//(Y+Z))


Measured memory_bytes: 5200
#include <iostream>
#include <cstdio>
#include <map>
#include <cmath>
#include <string.h>
#include <algorithm>
#include <set>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
using namespace std;
int main()
{
    int n,m,a,b;
    cin >> n >> m >> a >> b;
    cout << (n-a)*(m-b) << endl;
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>

using namespace std;

int main(){
    int a, b, k;
    scanf("%d %d %d",&a, &b, &k);

    int c = min(a, b);
    int count = 0;
    int ans;
    for(int i = c; i >= 1; i--){
        if(a % i == 0 && b % i == 0){
            count++;
            if(count == k){
                ans = i;
                break;
            }
        }
    }
    printf("%d\n",ans);

    return 0;
}


Measured memory_bytes: 128
#include<stdio.h>
int main(void)
{
	int m,n,k,count;
	while(scanf("%d %d",&m,&n)!=EOF){
	    if(n>m){count=n;n=m;m=count;}
	    if(m==0 || n==0){break;}
	    
    count=0;
	do{
		k=m%n;
		m=n;
		n=k;
		count ++;
	}while (k!=0);

	
	printf("%d %d\n",m,count);
	}
    return 0;
}


Measured memory_bytes: 1980
package main

import (
  "fmt"
  "sort"
)

//3
//2 7 4
func main() {

  var n int
  fmt.Scan(&n)

  var cards = make([]int, n)
  for i:=0 ; i<n ; i++ {
    fmt.Scan(&cards[i])
  }
  sort.Sort(sort.Reverse(sort.IntSlice(cards)))

  var result int
  for i:=0 ;i <n ; i++ {
    if (i+1)%2 == 1 {
      result += cards[i]
    } else {
      result -= cards[i]
    }
  }

  fmt.Println(result)

}



Measured memory_bytes: 512