akhauriyash/Code-Regression huggingface dataset:
/*⠄⢰⣧⣼⣯⠄⣸⣠⣶⣶⣦⣾⠄⠄⠄⠄⡀⠄⢀⣿⣿⠄⠄⠄⢸⡇⠄⠄
⠄⠄⠄⣾⣿⠿⠿⠶⠿⢿⣿⣿⣿⣿⣦⣤⣄⢀⡅⢠⣾⣛⡉⠄⠄⠄⠸⢀⣿⠄
⠄⠄⢀⡋⣡⣴⣶⣶⡀⠄⠄⠙⢿⣿⣿⣿⣿⣿⣴⣿⣿⣿⢃⣤⣄⣀⣥⣿⣿⠄
⠄⠄⢸⣇⠻⣿⣿⣿⣧⣀⢀⣠⡌⢻⣿⣿⣿⣿⣿⣿⣿⣿⣿⠿⠿⠿⣿⣿⣿⠄
⠄⢀⢸⣿⣷⣤⣤⣤⣬⣙⣛⢿⣿⣿⣿⣿⣿⣿⡿⣿⣿⡍⠄⠄⢀⣤⣄⠉⠋⣰
⠄⣼⣖⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⢇⣿⣿⡷⠶⠶⢿⣿⣿⠇⢀⣤
⠘⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣽⣿⣿⣿⡇⣿⣿⣿⣿⣿⣿⣷⣶⣥⣴⣿⡗
⢀⠈⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡟⠄
⢸⣿⣦⣌⣛⣻⣿⣿⣧⠙⠛⠛⡭⠅⠒⠦⠭⣭⡻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠄
⠘⣿⣿⣿⣿⣿⣿⣿⣿⡆⠄⠄⠄⠄⠄⠄⠄⠄⠹⠈⢋⣽⣿⣿⣿⣿⣵⣾⠃⠄
⠄⠘⣿⣿⣿⣿⣿⣿⣿⣿⠄⣴⣿⣶⣄⠄⣴⣶⠄⢀⣾⣿⣿⣿⣿⣿⣿⠃⠄⠄
⠄⠄⠈⠻⣿⣿⣿⣿⣿⣿⡄⢻⣿⣿⣿⠄⣿⣿⡀⣾⣿⣿⣿⣿⣛⠛⠁⠄⠄⠄
⠄⠄⠄⠄⠈⠛⢿⣿⣿⣿⠁⠞⢿⣿⣿⡄⢿⣿⡇⣸⣿⣿⠿⠛⠁⠄⠄⠄⠄⠄
⠄⠄⠄⠄⠄⠄⠄⠉⠻⣿⣿⣾⣦⡙⠻⣷⣾⣿⠃⠿⠋⠁⠄⠄⠄⠄⠄⢀⣠⣴
⣿⣿⣿⣶⣶⣮⣥⣒⠲⢮⣝⡿⣿⣿⡆⣿⡿⠃⠄⠄⠄⠄⠄⠄⠄⣠⣴⣿*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
#define ll long long
#define ii pair<ll,ll>
#define iii pair<ii,ll>
#define fi first
#define se second
#define endl '\n'
#define debug(x) cout << #x << " is " << x << endl;

#define rep(x,start,end) for(auto x=(start)-((start)>(end));x!=(end)-((start)>(end));((start)<(end)?x++:x--))
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()

ll MAX(ll a){return a;}
ll MIN(ll a){return a;}
template<typename... Args>
ll MAX(ll a,Args... args){return max(a,MAX(args...));}
template<typename... Args>
ll MIN(ll a,Args... args){return min(a,MIN(args...));}

#define indexed_set tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>

mt19937 rng(chrono::system_clock::now().time_since_epoch().count());

int n,k;
int arr[500005];
vector<int> v;

int l[20][500005];
int r[20][500005];

int pref[500005];
int suf[500005];

int cnt[500005];

int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	cin>>n>>k;
	rep(x,0,n) cin>>arr[x];
	
	int curr=k;
	while (curr){
		curr>>=1;
		v.push_back(curr);		
	}
	
	v.push_back(k);
	
	rep(layer,0,sz(v)){
		l[layer][0]=0;
		rep(x,1,n) l[layer][x]=(arr[x]-arr[x-1]<=v[layer]?l[layer][x-1]:x);
		
		r[layer][n-1]=n-1;
		rep(x,n-1,0) r[layer][x]=(arr[x+1]-arr[x]<=v[layer]?r[layer][x+1]:x);
	}
	
	rep(x,0,(1<<(sz(v)-1))){
		pref[x]=-1,suf[x]=n;
		rep(bit,0,20) if (x&(1<<bit)){
			if (pref[x^(1<<bit)]==n-1) pref[x]=n-1;
			else pref[x]=max(pref[x],r[bit][pref[x^(1<<bit)]+1]);
			if (suf[x^(1<<bit)]==0) suf[x]=0;
			else suf[x]=min(suf[x],l[bit][suf[x^(1<<bit)]-1]);
		}
	}
	
	int bm=(1<<(sz(v)-1))-1;
	rep(x,0,(1<<(sz(v)-1))){
		//cout<<pref[x]<<" "<<suf[bm^x]<<endl;
		
		int a=pref[x]+1,b=suf[bm^x]-1;
		if (a>b) cnt[0]++;
		else{
			if (b<=r[sz(v)-1][a]){
				cnt[l[sz(v)-1][a]]++;
				cnt[r[sz(v)-1][a]+1]--;
			}
		}
	}
	
	rep(x,0,n){
		if (cnt[x]) cout<<"Possible"<<endl;
		else cout<<"Impossible"<<endl;
		
		cnt[x+1]+=cnt[x];
	}
}


Measured memory_bytes: 83968
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <stack>
#include <map>
#include <limits>
#include <string>
#include <algorithm>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <map>
#include "math.h"
#include "assert.h"

using namespace std;

#define ll long long

#define BUFF ios::sync_with_stdio(false)
#define epsilon 1e-07
#define pi 2 * acos(0.0);
#define mod 1000000007   // 1e9+7
#define cerr if(false)cerr
#define watch(x) cerr << #x << " = " << x << endl;

#define inf std::numeric_limits<int>().max();

int main() {
	string s;
	cin >> s;
	int n = s.size();
	bool vf = 1;
	for(int i=0; i<n; i++) {
		if ((i+1) % 2 == 0 and s[i] == 'R') vf = 0; 
		if ((i+1) % 2 == 1 and s[i] == 'L') vf = 0; 
	}
	if (vf) cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(void)
{
  int N;
  
  cin>>N;

  int input;
  int dh[101]={0};
  
  for(int i=0;i<N;i++){
    cin>>input;
    dh[input]=1;
  }

  int ans=0;
  for(int i=0;i<101;i++)
    if(dh[i]==1) ans++;

  cout<<ans<<endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set> 
#include <map>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <iomanip>
using namespace std;
#define assem99 ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ull unsigned long long
#define ld long double
#define ii pair<int, int>
#define vii vector<ii>
#define f(i,a,b) for(int i=a; i<b; i++)
#define F first
#define S second
#define sz(a) (int)(a).size()
#define ReadFile freopen("input.txt","r",stdin)
#define WriteFile freopen("output.txt","w",stdout)
int x[] = { 0, -1, 0, 1, -1, 1, -1, 1 };
int y[] = { -1, 0, 1, 0, 1, -1, -1, 1 };
const int MOD = 998244353, N = 2e5 + 5;
const double pi = acos(-1);

ll dp[N][10]; // days, activities

int main()
{
	assem99;

	int arr[N][3];
	int n; cin >> n;
	f(i, 0, n) f(j, 0, 3) cin >> arr[i][j];

	f(i, 0, 3) dp[0][i] = 0;
	f(i, 0, N) dp[i][0] = 0;

	f(i, 1, N + 1)
	{
		f(j, 1, 4)
		{
			int mx;
			if (j == 1) mx = max(dp[i - 1][2], dp[i - 1][3]);
			if (j == 2) mx = max(dp[i - 1][1], dp[i - 1][3]);
			if (j == 3) mx = max(dp[i - 1][1], dp[i - 1][2]);
			dp[i][j] = arr[i - 1][j - 1] + mx;
		}
	}
	ll ans = -1;
	f(i, 1, 4) ans = max(ans, dp[n][i]);
	cout << ans;

	return 0;
}

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

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


Measured memory_bytes: 3112
#include <iostream>
using namespace std;
int main() {
  int n, x;
  int l[100];

  cin >> n >> x;

  for (int i = 0; i < n; i++) {
    cin >> l[i];
  }

  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += l[i];
    if (ans > x) {
      cout << i + 1 << endl;
      return 0;
    }
  }

  cout << n + 1 << endl;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
long long q,cou=0,sum=0,s=0,mx=pow(10,18);
cin>>q;
vector<long long >v(q);
for(long long x=0;x<q;x++){
    cin>>v[x];
    sum+=v[x];

}
for(long long x=0;x<q;x++){
    s+=v[x];
    sum-=v[x];
    mx=min(mx,abs(sum-s));
}
cout<<mx;
return 0;}


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

// def
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
#define repeat(i, a, b) for (int i = (a); i < (b); i++)
#define revrepeat(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define revrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef pair<int, int> P;
typedef vector<vector<int>> Graph;
const int M = 1e9 + 7;
const ll INF = 1e9;
const int MAX_V = 100000 + 5;
const int MAX_N = 1e5 + 5;
const double PI = acos(-1);

int main() {
    int n;
    cin >> n;
    vector<pair<string, int>> v(n);
    rep(i, n) {
        string s;
        int t;
        cin >> s >> t;
        v[i] = make_pair(s, t);
    }
    string x;
    cin >> x;
    bool lock = true;
    int ans = 0;
    rep(i, n) {
        string s = v[i].first;
        int t = v[i].second;
        if (lock && x == s) {
            lock = false;
            continue;
        }
        if (lock) continue;
        if (!lock) ans += t;
    }
    out(ans);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << "\n"
#define COUTF(x) cout << setprecision(15) << (x) << "\n"
#define ENDL cout << "\n"
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SZ(x) (ll) x.size()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define ANS cout << ans << "\n"
#define RETURN(x)    \
  cout << x << "\n"; \
  return 0
clock_t CLOCK;
#define START_TIMER CLOCK = clock()
#define SHOW_TIMER cerr << "time: " << (ld)(clock() - CLOCK) / 1000000 << "\n"
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define LINE cerr << "[debug] line: " << __LINE__ << "\n";
#define debug(x) cerr << "[debug] " << #x << ": " << x << "\n";
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << "\n";
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll, ll>;
using qll = queue<ll>;
using P = pair<ll, ll>;

constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

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

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

signed main() {
  init();
  ll H, W, K;
  cin >> H >> W >> K;
  vector<string> C(H);
  rep(i, H) cin >> C[i];

  ll ans = 0;
  rep(bitH, 1 << H) {
    rep(bitW, 1 << W) {
      ll count = 0;
      rep(i, H) {
        if (bitH >> i & 1) continue;
        rep(j, W) {
          if (bitW >> j & 1) continue;
          if (C[i][j] == '#') count++;
        }
      }
      if (count == K) ans++;
    }
  }
  ANS;
  return 0;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> oset;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
using ll = long long;

/*Although they are all changed to the same integer, the whole number X of the destination to be changed is searched and the cost is the highest.
Output small ones. At this time, we only have to think about integers from -100 to 100. (-100
Less than or greater than 100, each (ai
-X)^2 is only larger than when X=-100 or 100
So useless. ) Computational complexity is O (N* coordinate width).
*/

int ans = INT_MAX;

void test_case(){
	int n; cin >> n;
	map<int,int> hash;
	for(int i = 0 ; i < n ; i++){
		int x; cin >> x; hash[x]++;
	}
	for(int i = -100 ;  i <= 100 ; i++){
		int best = 0;
		for(auto x : hash){
			best+=((i-x.first)*(i-x.first))*x.second;
		}
		ans = min(ans,best);
	}
	cout<<ans;
	
}
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int T=1;
	while(T--){
		test_case();
	}
	return 0;
}


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

int main()
{
  
 string res="",s,s1="maerd",s2="remaerd",s3="esare",s4="resare";
  cin>>s;
  long long i=0;
  
  reverse(s.begin(),s.end());
  for(;i<s.length();i++)
  {
    res+=s[i];
    
    if(res==s1||res==s2||res==s3||res==s4)
      res="";
  }
  
  if(res=="")
    cout<<"YES\n";
  else 
    cout<<"NO\n";
  
  
  return 0;
}

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

using namespace std;

int main(int argc, char const *argv[]) {
	std::vector<string> v(3);
	for (size_t i = 0; i < 3; i++) {
		std::cin >> v[i];
	}
	std::cout << v[0][0] << v[1][1] << v[2][2] << '\n';
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#define Endl endl
#define mp make_pair
#define rep(N) for(int i=0;i<N;i++)
#define repj(N) for(int j=0;j<N;j++)
#define ll long long 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define For(I,N) for(int I=0;I<N;I++)
#define cinone(N) int N;cin>>N;
#define scanfone(N) int N;cin>>N;
#define cinng(N,M) int N[M];for(int yiuytvnm=0;yiuytvnm<M;yiuytvnm++) cin>>N[yiuytvnm];
#define scanfng(N,M) int N[M];for(int qrwuoiq=0;qrwuoiq<M;qrwuoiq++) scanf("%d",&N[qrwuoiq]);
#define over(A) {cout<<A<<endl;exit(0);}
#define all(A) A.begin(),A.end()
typedef unsigned long long ull;
const int inf=1039074182;
using namespace std;
vector <int> vec[100005];
int n;
int v[100005];
set <pii> squ;

int main()
{	
//	freopen("input.txt","r",stdin);
	cin>>n;
	int x,y;
	for(int i=0;i<n-1;i++)
	{
		scanf("%d%d",&x,&y);
		x--;
		y--;
		vec[x].push_back(y);
		vec[y].push_back(x);
		v[i]=inf;
	}
	v[n-1]=inf;
	int q;
	cin>>q;
	while(q--)
	{
		scanf("%d%d",&x,&y);
		x--;
		v[x]=y;
		squ.insert(mp(y,x));
	}
	while(squ.size())
	{
		int s=squ.begin()->first;
		int x=squ.begin()->second;
		squ.erase(mp(s,x));
		for(int i=0;i<vec[x].size();i++)
		{
			if(v[vec[x][i]]!=inf) continue;
			v[vec[x][i]]=s+1;
			squ.insert(mp(s+1,vec[x][i]));
		}
	}
//	for(int i=0;i<n;i++)
//	{
//		cout<<v[i]<<' ';
//	}
//	cout<<endl;
	for(int i=0;i<n;i++)
	{
		for(int j=0;j<vec[i].size();j++)
		{
			if(abs(v[vec[i][j]]-v[i])!=1) over("No\n");
		}
	}
	cout<<"Yes\n";
	for(int i=0;i<n;i++)
	{
		cout<<v[i]<<'\n';
	}
	return 0;
}

Measured memory_bytes: 11520
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)

struct INIT{
    INIT(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(0);
        cout << fixed << setprecision(13);
    }
}INIT;

map<LL,int> primefact(LL n) {
	map<LL,int> ret;
	for(LL i = 2;i*i <= n;i++) while(n % i == 0) ret[i]++,n/=i;
	if(n>1) ret[n]++;
	return ret;
}

LL n, p;
map<LL, int> cnt;

int main(){
    cin >> n >> p;
    cnt = primefact(p);
    LL ans = 1;
    for(auto mp : cnt){
        REP(i, mp.second/n)ans *= mp.first;
    }
    cout << ans << endl;
}

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

using namespace std;

struct node
{
	vector<int> next;

};

int calc(vector<node> &n, int index, vector<bool> &map)
{
	map[index] = true;
	int result = 0;
	if (all_of(map.begin(), map.end(), [](auto v) {return v; }))
	{
		result = 1;
	}
	for (auto&& v : n[index].next)
	{
		if (!map[v])
			result += calc(n, v, map);

	}
	map[index] = false;
	return result;
}

int main()
{
	int n, m;
	cin >> n >> m;
	vector<node> a(n);
	for (int i = 0; i < m; i++)
	{
		int x, y;
		cin >> x >> y;
		a[x - 1].next.push_back(y - 1);
		a[y - 1].next.push_back(x - 1);
	}
	vector<bool> map(n,false);
	cout << calc(a, 0, map) << endl;
}


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

int main()
{
    char s[200];
    scanf("%s",s);

    int len = 0;
    for(int i=0;s[i] != 0; i++)
      len++;


    int cnt = 0;
    for(int i=0, j =len-1 ;i<=j ;i++ ,j--)
    {
      if( s[i] != s[j])
      {
        cnt++;
      }

    }


    printf("%d",cnt);
    return 0;
    }









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

using lli = long long int;

template <class T>ostream &operator<<(ostream &o,const vector<T>&v)
{o<<"{";for(int i=0;i<(int)v.size();i++)o<<(i>0?", ":"")<<v[i];o<<"}";return o;}

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

int main(void){
    int a, b;
    cin >> a >> b;
    if(a < 10 && b < 10) cout << a*b << endl;
    else cout << "-1" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<unordered_map>
#include<algorithm>
#include<queue>
#include<stack>
#include<map>
#include<ctime>
#define up(i,x,y) for(int i = x;i <= y;i ++)
#define down(i,x,y) for(int i = x;i >= y;i --)
#define mem(a,b) memset((a),(b),sizeof(a))
#define mod(x) ((x)%MOD)
#define lson p<<1
#define rson p<<1|1
using namespace std;
typedef long long ll;
const int SIZE = 500010;
const int INF = 2147483640;
const double eps = 1e-8;

inline void RD(int &x)
{
    x = 0;  char c; c = getchar();
    bool flag = 0;
    if(c == '-')    flag = 1;
    while(c < '0' || c > '9')   {if(c == '-')   {flag = 1;} c = getchar();}
    while(c >= '0' && c <= '9') x = (x << 1) + (x << 3) + c - '0',c = getchar();
}

//SQRT3(1e10) = 2200
int n;
ll a[SIZE],seq[SIZE];
unordered_map <ll,int> tong;
unordered_map <ll,ll> bu;
unordered_map <ll,bool> vis;


ll tmp,tmp1,tmp2,tmp3;
int num[233],cnt[233],tot;

void check(int i,ll x)
{
	//p or p1*p2 or p^2
	// p和p1*p2情况下，p > 2200，p1,p2 > 2200，所以补一定很大。
	ll sq = floor(sqrt(x));
	ll fang = sq*sq;
	seq[i] = tmp1 * x;
	if(fang == x)//完全平方数
	{
		bu[seq[i]] = tmp3 * sq;//它的补的sq的次数是1
	}
	else
	{
		if(x > 100000)//补数不存在
		{
		}
		else
		{
			bu[seq[i]] = tmp3*x*x;
		}
	}
	tong[seq[i]] ++;
}

void init()
{
	for(int i = 1;i <= n;i ++)
	{
		//solve a[i]
		tmp = a[i];
		tot = 0;
		tmp1 = 1;
		tmp3 = 1;
		for(ll j = 2;j <= 2200;j ++)
		{
			if(tmp % j == 0)
			{
				num[++tot] = j;
				cnt[tot] = 0;
				while(tmp % j == 0)
				{
					tmp /= j;
					cnt[tot] ++;
				}
				cnt[tot] %= 3;
				if(cnt[tot] == 1)	tmp1 *= j,tmp3 *= j*j;
				else if(cnt[tot] == 2)	tmp1 *= j*j,tmp3 *= j;
			}
		}
		//如果还有 那么一定大于2200
		if(tmp != 1)	check(i,tmp);
		else
		{
			seq[i] = tmp1;
			bu[seq[i]] = tmp3;
			tong[seq[i]] ++;
		//	printf("se and bu : %lld %lld\n",seq[i],bu[seq[i]]);
		}
	}
}

int main(int argc, char const *argv[])
{
//	tong[-1] = 0;
	scanf("%d",&n);
	for(int i = 1;i <= n;i ++)
	{
		scanf("%lld",&a[i]);
	}
	init();
	int ans = 0;
	for(int i = 1;i <= n;i ++)
	{
		if(seq[i] == 1 && !vis.count(1))
		{
			ans ++;
			vis[1] = 1;
		}
		else if(!bu.count(seq[i]) && !vis.count(seq[i]))
		{
		//	printf("ans1:%d\n",ans);
			vis[seq[i]] = 1;
			ans += tong[seq[i]];
		}
		else if(!vis.count(seq[i]))
		{
		//	printf("ans2:%d\n",ans);
			ans += max(tong[seq[i]],tong[bu[seq[i]]]);
			vis[seq[i]] = 1;
			vis[bu[seq[i]]] = 1;
		}
		
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 23056
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define MOD 1000000007
#define pi 3.141592653589793238
#define ll long long int
#define P pair<ll, ll>
#define VII vector<P>
#define P_B push_back

int DP[1000][1000];
char mat[1000][1000];
int m, n;

int main() {
	
	// ll T; cin>>T; while(T--) 
	{
		
		
		cin>>m>>n;
		memset(DP, -1, sizeof(DP));

		for (int i = 0; i < m; i++) 
			for (int j = 0; j < n; j++)
				cin>>mat[i][j];

		DP[0][0] = 1;

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

			if(mat[0][i] != '#') DP[0][i] = DP[0][i-1];
		}


		for (int i = 1; i < m; i++) {

			if(mat[i][0] != '#') DP[i][0] = DP[i-1][0];
		}


		for (int i = 1; i < m; i++) {
			for (int j = 1; j < n; j++) {

				if(mat[i][j] != '#') {

					int a = 0;
					if(DP[i-1][j] != -1) a = (a + DP[i-1][j])%MOD;
					if(DP[i][j-1] != -1) a = (a + DP[i][j-1])%MOD;
					if(a >= 0) DP[i][j] = a;

				}
			}
		}

		// for (int i = 0; i < m; i++) {
		// 	for (int j = 0; j < n; j++) cout<<DP[i][j]<<" ";
		// 		cout<<"\n";
		// }
		if(DP[m-1][n-1] == -1) DP[m-1][n-1] = 0;
		cout<<DP[m-1][n-1];

	}	
	return 0;
}

Measured memory_bytes: 8444
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <algorithm>

using namespace std;

int main(){
	int n;
	cin >> n;
	vector<int> d, t;
	d.resize(n);
	for(int i=0; i<n; i++) cin >> d[i];
	int m;
	cin >> m;
	t.resize(m);
	for(int i=0; i<m; i++) cin >> t[i];
	sort(d.begin(), d.end());
	sort(t.begin(), t.end());
	multiset<int> a;
	for(int i=0; i<n; i++) a.insert(d[i]);
	multiset<int>::iterator itr=a.begin();
	for(int i=0; i<m; i++){
		if(a.count(t[i]) >=1){
			itr = a.find(t[i]);
			a.erase(itr);
		}
		else{
			cout << "NO" << endl;
			return 0;
		}
	}
	
	cout << "YES" << endl;
	return 0;
}
		


Measured memory_bytes: 11136
/*#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>*/
#include <bits/stdc++.h>

using namespace std;
//using namespace __gnu_pbds;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;

#define FOR(i, a, b) for (int i=a; i<b; i++)
#define F0R(i, a) for (int i=0; i<a; i++)
#define FORd(i,a,b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i,a) for (int i = (a)-1; i >= 0; i--)
 
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound

const int MOD = 1000000007;
double PI = 4*atan(1);

int N,M, num[200001], co[200001], rec[200001], uncov = 0;

void upd(int a, int ind) {
    if (ind == 1) {
        co[a] ++;
        if (a-co[a]+1 > 0) {
            rec[a-co[a]+1] ++;
            if (rec[a-co[a]+1] == 1) uncov --;
        }
    } else {
        if (a-co[a]+1 > 0) {
            rec[a-co[a]+1] --;
            if (rec[a-co[a]+1] == 0) uncov ++;
        }
        co[a] --;
    } 
}

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin >> N >> M;
	F0R(i,N) {
	    cin >> num[i];
	    co[num[i]] ++;
	}
	FOR(i,1,N+1) for (int j = i; j > max(0,i-co[i]); --j) rec[j] ++;
	FOR(i,1,N+1) if (!rec[i]) uncov ++;
	F0R(i,M) {
	    int x,y; cin >> x >> y;
	    x--;
	    upd(num[x],-1);
	    num[x] = y;
	    upd(num[x],1);
	    cout << uncov << "\n";
	}
}

// read!
// ll vs. int!

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

int main(){
  int h, w, k;
  string gyo[7];
  cin >> h >> w >> k;
  rep(i, h)cin >> gyo[i];
  int ans = 0;

  for(int s=0;s<(1<<h);s++){
    for(int t=0;t<(1<<w);t++){
      int black = 0;
      rep(i, h){
        rep(j, w){
          if((s>>i&1)&&(t>>j&1)){
            if(gyo[i][j]=='#')black ++;
          }
        }
      }
      if(black==k)ans++;
    }
  }

  cout << ans;
  return 0;
}


Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin>>N;
  vector<int> Xs(N),sorted_Xs(N);
  for(int i=0;i<N;i++){cin>>Xs.at(i);}
  sorted_Xs=Xs;
  sort(sorted_Xs.begin(),sorted_Xs.end());
  int ml=sorted_Xs.at(N/2-1);
  int mr=sorted_Xs.at(N/2);
  for(int x:Xs){
    if(x<=ml){cout<<mr<<endl;}
    else{cout<<ml<<endl;}
  }
}

Measured memory_bytes: 3712
d, n = gets.chomp.split.map(&:to_i)

if d == 0
  if n != 100
    puts n
  else
    puts 101
  end
elsif d == 1
  if n != 100
    puts n * 100
  else
    puts 10100
  end
elsif d == 2
  if n != 100
    puts n * 10000
  else
    puts 1010000
  end
end


Measured memory_bytes: 1788
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define INF 1000000000
#define LLINF 10000000000000000ll
#define MOD 1000000007LL

bool dbgflag = false;

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

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

  int n;
  cin >> n;
  map<pll, ll> iwashi;
  set<pll> iwashicount;
  vector<ll> pm(n+1, 1LL);
  for (int i = 0; i < n; i++) {
    pm[i+1] = 2*pm[i] % MOD;
  }
 
  for (int i = 0; i < n; i++) {
    ll a, b;
    cin >> a >> b;
    if (a < 0) {a = -a; b = -b;}
    if ((a == 0) && (b < 0)) b = -b;
    ll m = gcd(a, b);
    if (m != 0) {
      a /= m;
      b /= m;
    }
    iwashi[pll(a, b)]++;
    iwashicount.insert(pll(a, b));
  }
 
  if (dbgflag) cout << iwashicount.size() << endl;
 
  ll cnt = 1;
  ll oth = 0;
  bool flag = true;
  for (pll p: iwashicount) {
    //cout << p.first << " " << p.second << " " << iwashi[p] << " " << iwashi[pll(p.second, -p.first)] << endl;
    if ((p.first * p.second != 0) || (p.first + p.second != 0)) {
      ll cm = (p.second >= 0) ? iwashi[pll(p.second, -p.first)] : iwashi[pll(-p.second, p.first)];
      ll cp = iwashi[p];
      (p.second > 0) ? (iwashi[pll(p.second, -p.first)] = 0) : (iwashi[pll(-p.second, p.first)] = 0);
      iwashi[p] = 0;
      //if (dbgflag) cout << (pm[cm])+(pm[cp])-1 << endl;
 
      cnt *= pm[cm] + pm[cp] - 1;
      //cout << cnt << endl;
      cnt %= MOD;
      //if (cnt < 0) {cout << "nx: " << (1LL<<cm)+(1LL<<cp)-1 << endl; break;}
    }
    else {
      ll c3 = iwashi[pll(0, 0)];
        oth = c3;
    }
  }
 
  cnt = (cnt + oth + MOD - 1) % MOD;
 
  cout << cnt << endl;
}


Measured memory_bytes: 42232
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
signed main()
{
	 ios_base::sync_with_stdio(false);
	 cin.tie(NULL);
	 cout.tie(NULL);
	 int n,a,b;
	 cin>>n>>a>>b;
	 vector<int>v;
	 for(int i=0;i<n;i++)
	 {
	 	  int x;
	 	  cin>>x;
	 	  v.emplace_back(x);
	 }
	 int res=0;
	 for(int i=1;i<n;i++)
	 {
	 	   res+=min(b,a*(v[i]-v[i-1]));
	 }
	 cout<<res<<endl;
	 return 0;
}

Measured memory_bytes: 1400
use proconio::input;

fn main() {
    input! {
        n: usize,
        a: [u128; n]
    };

    if let Some(_) = a.iter().find(|&&x| x == 0) {
        println!("{}", 0);
    } else {
        let ans = a.iter().try_fold(1u128, |acc, &x| acc.checked_mul(x));
        if ans == None || ans.unwrap() > 10u128.pow(18) {
            println!("{}", -1);
        } else {
            println!("{}", ans.unwrap())
        }
    }
}


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

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
//const ll mod = 1000000007;

int main() {
    //cout.precision(10);
    ll ans = 0;
    int n;
    cin >> n;
    vector<int> field(n);
    for(int i = 0; i < n; i++){
        cin >> field[i];
    }
    sort(field.begin(), field.end());
    ll edge[2];
    if(n % 2 == 0){
        edge[0] = field[n / 2];
        edge[1] = field[n / 2 - 1];
        for(int i = 0; i < n / 2 - 1; i++){
            ans -= 2 * field[i];
        }
        for(int i = n / 2 + 1; i < n; i++){
            ans += 2 * field[i];
        }
        ans += edge[0];
        ans -= edge[1];
        cout << ans << endl;
        return 0;
    }
    edge[0] = field[n / 2];
    for(int i = 0; i < n / 2; i++){
        ans -= 2 * field[i];
    }
    for(int i = n / 2 + 1; i < n; i++){
        ans += 2 * field[i];
    }
    ans += max(-field[n/2] +field[n/2 - 1], -field[n/2+1] + field[n/2]);
    cout << ans << endl;
    return 0;
    ll a[100500];
    for(int i = 1; i <= n; i++){
        if((i % 2) == 1){
            //a[i - i / 2] = field[i - 1];
            a[i] = field[i - i / 2 - 1];
            continue;
        }
        //a[n + 1 - i / 2] = field[i - 1];
        a[i] = field[n - i / 2];
    }
    cout << endl;
    for(int i = 1; i <= n; i++){
        cout << a[i] << endl;
    }
    for(int i = 1; i < n; i++){
        //cout << a[i] << endl;
        ans += abs(a[i] - a[i + 1]);
    }
    cout << ans << endl;
    return 0;
}


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

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

typedef long long ll;
const ll MOD = 1e9 + 7;

template<typename T>
T GCD(T a, T b) {
  if(a > b) std::swap(a, b);
  if(a == 0) return b;
  else return GCD(b % a, a);
}

template<typename T>
T LCM(T a, T b) {
  if(a > b) std::swap(a, b);
  if(a == 0) return 0;
  else return a / GCD(a, b) * b;
}

int main() {
  ll A, B;
  std::cin >> A >> B;

  std::cout << LCM(A, B) << '\n';
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
#define ll long long
#define rep(i, s, n) for(int i = s; i < n; i++)

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, 0, n) cin >> a[i];
    unsigned int ans = 100000000;
    rep(i, -100, 101) {
        unsigned int sum = 0;
        rep(j, 0, n) {
            sum += pow(abs(a[j]-i), 2);
        }
        ans = min(ans, sum);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<algorithm>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<numeric>
#include<stdio.h>

using std::cout;
using std::cout;
using std::cin;
using std::setw;
using std::setfill;
using std::string;
using std::pair;
using std::make_pair;
using std::vector;
using std::queue;
using std::deque;
using std::priority_queue;
using std::next_permutation;
using std::iota;
using std::sort;
using std::greater;
using std::max;
using std::min;

#define INF 999999999;
#define MOD 1000000007

using ulli = unsigned long long int;

#define EVEL 1

#ifndef EVEL
#define dbug(X) std::cout << #X << ":" <<X<<" " ;
#define dbugf(s) std::cout << s << " ";
#define dbugln std::cout<<"\n";
#else
#define dbug(X) {}
#define dbugf(s) {}
#define dbugln {}
#endif

int W, H;
int M[21][21];
int xd[] = {0, 1, 0, -1};
int yd[] = {-1, 0, 1, 0};
bool Mf[21][21];
queue<int> Q;

int main(){
	cin.tie(0);
	std::ios::sync_with_stdio(false);
    
    while(1){
        cin >> W >> H;
        if(W == 0 && H == 0) break;
        for(int i = 0; i  < W; i++){
            for(int j = 0; j < H; j++){
                M[i][j] = 1;
                Mf[i][j] = false;
            }
        }
        char c;
        for(int i = 0; i < H; i++){
            for(int j = 0; j < W; j++){
                cin >> c;
                if(c == '.') M[j][i] = 0;
                else if(c == '#') M[j][i] = 1;
                else if(c == '@'){
                    M[j][i]=0;
                    Q.push(i*W+j);
                    Mf[j][i] = true;
                }
            }
        }

        int ans = 0;
        while(!Q.empty()){
            const int r = Q.front();Q.pop();
            ans++;
            int x, y;
            for(int i = 0; i < 4; i++){
                x = (r%W) + xd[i];
                y = (r/W) + yd[i];
                if(x < 0 || x >= W || y < 0 || y >= H)continue;
                if(Mf[x][y] || M[x][y]!=0)continue;
                Q.push(x + y*W);
                Mf[x][y] = true;     
            }
        }
        cout << ans << "\n";
    }
    return 0;
}
/*
6 9
....#.
.....#
......
......
......
......
......
#@...#
.#..#.
11 9
.#.........
.#.#######.
.#.#.....#.
.#.#.###.#.
.#.#..@#.#.
.#.#####.#.
.#.......#.
.#########.
...........
11 6
..#..#..#..
..#..#..#..
..#..#..###
..#..#..#@.
..#..#..#..
..#..#..#..
7 7
..#.#..
..#.#..
###.###
...@...
###.###
..#.#..
..#.#..
0 0

*/


Measured memory_bytes: 3104
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define srep(i,l,n) for(int i = l; i < (int)(n); i++)
#define drep(i,n) for(int i = (int)(n-1); i >= 0; i--)
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
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; }
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void err() {cout << -1 << endl;}
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define pb push_back

const int MOD = 1000000007;
const int INF = 1e9;

#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    int x, y;
    cin >> x >> y;
    rep(i, x+1) {
        if(i * 2 + (x - i) * 4 == y) {
            Yes();
            return 0;
        }
    }
    No();
}

Measured memory_bytes: 3600
#!/usr/bin/env python3
import sys


def solve(N: int, S: str):
    counter = 0
    for i in range(N-2):
        if S[i:i+3] == 'ABC':
            counter += 1
    print(counter)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = next(tokens)  # type: str
    solve(N, S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3060
#include <cstdio>

char S[101010];

int main()
{
	scanf("%s", S);

	bool app[26];
	for (int i = 0; i < 26; ++i) {
		app[i] = false;
	}
	for (int i = 0; S[i] != '\0'; ++i) {
		app[S[i] - 'a'] = true;
	}
	for (int i = 0; i < 26; ++i) {
		if (!app[i]) {
			printf("%c\n", (char)(i + 'a'));
			return 0;
		}
	}
	puts("None");
	return 0;
}


Measured memory_bytes: 888
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
#include <queue>
#include <limits>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
	int64_t N, M;
	cin >> N >> M;

	int64_t DIVIDER = 1000000007;
	int64_t res = 1;
	for (int32_t i = 1; i <= N; i++) {
		res *= i;
		res %= DIVIDER;
	}
	for (int32_t i = 1; i <= M; i++) {
		res *= i;
		res %= DIVIDER;
	}

	if (N == M) {
		res *= 2;
		res %= DIVIDER;
	} else if (N + 1 == M || N == M + 1) {
	} else {
		res = 0;
	}

	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
int main(void){
  int n,i;
  long long int a;
  vector<long long int> v;
  v.push_back(0LL);
  cin >> n;
  for(i=0; i<n; ++i){
    cin >> a;
    v.push_back(v[i]+a);
  }
  sort(v.begin(),v.end());
  a = -(n+1);
  for(i=0; i<=n; ++i){
    a += (long long int)(upper_bound(v.begin(),v.end(),v[i])-lower_bound(v.begin(),v.end(),v[i]));
  }
  a /= 2;
  cout << a << endl;
  return 0;
}

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

int main(){
  	string s,t;
  	cin >> s >> t;
  	int ans=0;
  	for(int i=0;i<3;i++){
    	if(s[i]==t[i]){
        	ans++;
        }
    }
  	cout << ans;
  	return 0;
}


Measured memory_bytes: 256
'use strict'
function main(inp) {
  inp = inp.trim().split(' ').map(x=> x*1);
  let ans = inp[0] < 10 ? (10- inp[0])*100 + inp[1]: inp[1];
  console.log(ans);
}

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


Measured memory_bytes: 19780
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int Apo,Bpo;
char ans[14]={0};
void func(int A,int B,int depth){
    if(Apo==A&&Bpo==B){
        for(int i=0;i<Apo+Bpo;i++)printf("%c",ans[i]);
        puts("");
    }
    if(max(A,B)==5&&min(A,B)<=3)return;
    if(max(A,B)==6)return;
    ans[depth]='A';
    func(A+1,B,depth+1);
    ans[depth]='B';
    func(A,B+1,depth+1);
}
int main(){
    cin>>Apo>>Bpo;
    func(0,0,0);
    return 0;
}

Measured memory_bytes: 3096
using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.IO.Compression;
using System.Linq;
using System.Numerics;

namespace Atcoder
{
    class Program
    {
        private const long COMDIV = 1000000007;
        static void Main(string[] args)
        {
            var K = int.Parse(Console.ReadLine());
            var S = Console.ReadLine();
            if (K >= S.Length)
            {
                Console.WriteLine(S);
            }
            else
            {
                Console.WriteLine(S.Substring(0,K) + "...");
            }

        }
        
    }
}

Measured memory_bytes: 17628
#include <stdio.h>

int main(void){
	int a=0, b=0, n=0, t1, t2;
	while(scanf("%d,%d",&t1,&t2)==2) n++, b+=t2, a+=t1*t2;
	printf("%d\n%d\n",a,(int)((double)b/n+0.5));
	return 0;
}

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a/gcd(a, b) * b;
}

int main()
{
    cout << fixed << setprecision(15);
    string S;
    cin >> S;

    ll N=S.length();

    for(ll i= 2; i<=N-2; i=i+2){
        ll k=(N-i)/2;
        bool flag =true;
        // cout << k << endl;
        for(ll j=0; j<k; j++){
            if(S[j] != S[j+k]){
                flag =false;
                break;
            }
        }
        if(flag){
            cout << N-i << endl;
            return 0;
        }
    }
    return 0;
}

Measured memory_bytes: 3532
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.lang.AssertionError
import java.util.*
import kotlin.math.abs
import kotlin.math.max
import kotlin.math.min

val MOD = 1_000_000_007L

class Solver(stream: InputStream, private val out: java.io.PrintWriter) {
  fun solve() {
    val N = ni()
    val A = na(N)
    var ans = 0L
    for (i in 0 until N) {
      for (j in i + 1 until N) {
        for (k in j + 1 until N) {
          val sum = A[i] + A[j] + A[k]
          val mx = max(A[i], max(A[j], A[k]))
          if (A[i] != A[j] && A[j] != A[k] && A[k] != A[i] && mx < sum - mx) {
//            debug{"$i $j $k"}
//            debug{"${A[i]} + ${A[j]} + ${A[k]}"}
            ans++
          }
        }
      }
    }
    out.println(ans)
  }













































  private val isDebug = try {
    // なんか本番でエラーでる
    System.getenv("MY_DEBUG") != null
  } catch (t: Throwable) {
    false
  }

  private var tokenizer: StringTokenizer? = null
  private val reader = BufferedReader(InputStreamReader(stream), 32768)
  private fun next(): String {
    while (tokenizer == null || !tokenizer!!.hasMoreTokens()) {
      tokenizer = StringTokenizer(reader.readLine())
    }
    return tokenizer!!.nextToken()
  }

  private fun ni() = next().toInt()
  private fun nl() = next().toLong()
  private fun ns() = next()
  private fun na(n: Int, offset: Int = 0): IntArray {
    return map(n) { ni() + offset }
  }
  private fun nal(n: Int, offset: Int = 0): LongArray {
    val res = LongArray(n)
    for (i in 0 until n) {
      res[i] = nl() + offset
    }
    return res
  }

  private fun na2(n: Int, offset: Int = 0): Array<IntArray> {
    val a  = Array(2){IntArray(n)}
    for (i in 0 until n) {
      for (e in a) {
        e[i] = ni() + offset
      }
    }
    return a
  }

  private inline fun map(n: Int, f: (Int) -> Int): IntArray {
    val res = IntArray(n)
    for (i in 0 until n) {
      res[i] = f(i)
    }
    return res
  }

  private inline fun debug(msg: () -> String) {
    if (isDebug) System.err.println(msg())
  }

  private inline fun debug(a: LongArray) {
    debug { a.joinToString(" ") }
  }

  private inline fun debug(a: IntArray) {
    debug { a.joinToString(" ") }
  }

  private inline fun debug(a: BooleanArray) {
    debug { a.map { if (it) 1 else 0 }.joinToString("") }
  }

  private inline fun debugDim(A: Array<LongArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }
  private inline fun debugDim(A: Array<IntArray>) {
    if (isDebug) {
      for (a in A) {
        debug(a)
      }
    }
  }

  /**
   * 勝手にimport消されるのを防ぎたい
   */
  private fun hoge() {
    min(1, 2)
    max(1, 2)
    abs(-10)
  }

  private inline fun assert(b: Boolean) = run{if (!b) throw AssertionError()}
}

fun main() {
  val out = java.io.PrintWriter(System.out)
  Solver(System.`in`, out).solve()
  out.flush()
}

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

ll N, A, B;
vector<ll> H(100001, 0);

int main(void){
	
	scanf("%lld %lld %lld", &N, &A, &B);
	for(int i = 0; i < N; ++i) scanf("%lld", &H[i]);
	
	ll ans = LLONG_MAX;
    ll left = 1, right = 1000000010;
	while(left <= right){
	    ll mid = (left + right) / 2;
	    
	    ll num = 0;
	    for(int i = 0; i < H.size(); ++i){
	        ll h = H[i] - (B * mid);
	        if(h <= 0) continue;
	        num += h / (A - B);
	        if(h % (A - B)) ++num;
	    }
	    
	    if(mid >= num){
	        right = mid - 1;
	        ans = min(ans, mid);
	    }
	    else left = mid + 1;
	}
	printf("%lld\n", ans);
	
    return 0;
}


Measured memory_bytes: 1024
//by rko27
//One more....
//---------------------------------------------------------------------------------------------------------------------------------------------------

#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int  long long 
#define ll  long long 
#define pb push_back
#define mp make_pair
#define fe first
#define se second
#define nl "\n"
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define god ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);

//----------------------------------------------------------------------------------------------------------------------------------------------------


int mod=1000000000+7;
int modu=998244353;

//----------------------------------------------------------------------------------------------------------------------------------------------------

ll power(ll x,ll y){ll res=1;x=x;while(y>0){if(y&1)res=(res*x);y=y>>1;x=(x*x);}return res;}
ll powe(ll x, ll y){ x = x%mod, y=y%(mod-1);ll ans = 1;while(y>0){if (y&1){ans = (1ll * x * ans)%mod;}y>>=1;x = (1ll * x * x)%mod;}return ans;}
void fun()
{
//	#ifndef ONLINE_JUDGE
//	freopen("input.txt", "r", stdin);
//	freopen("output.txt", "w", stdout);
//	#endif
	//786
}
bool isPrime(int n){for(int i=2;i*i<=n;i++)if(n%i==0) return false;return true;}
ll ncr(ll n,ll r){ll res=1;if(r>n)return 0;if(r>n-r)r=n-r;for(ll i=0;i<r;i++){res*=(n-i);res/=(i+1);}return res;}

//-------------------------------------------------------------------------------------------------------------------------------------------------------

std::vector<pair<int,int > > v;

//--------------------------------------------------------------------------------------------------------------------------------------------------------


//--------------------------------------------------------------------------------------------------------------------------------------------------------
signed main() 
{
	god;
	//rko;
	fun();
	int tt=1; //cin>>tt;
	while(tt--)
	{
		int n,w; cin>>n>>w;
		int wt[n+1]={0}, price[n+1]={0};
		int dp[n+1][w+1];
		for(int i=0;i<n;i++) cin>>wt[i]>>price[i];
		memset(dp,0,sizeof(dp));
		for(int i=0;i<=n;i++)
		{
			for(int j=0;j<=w;j++)
			{
				if(i==0 or j==0) dp[i][j]=0;
				else if(j<wt[i-1]) dp[i][j]=dp[i-1][j];
				else
				{
					dp[i][j]=max({dp[i-1][j], dp[i-1][j-wt[i-1]]+price[i-1]});
				}
			}
		}
		// for(int i=1;i<=n;i++)
		// {
		// 	for(int j=1;j<=w;j++)
		// 	{
		// 		cout<<dp[i][j]<<' ';
		// 	}
		// 	cout<<nl;
		// }
		cout<<dp[n][w];
	}
	return 0;
}

Measured memory_bytes: 79104
#include<vector>
#include<iostream>
#include<string>

#define rep(i,n) for (int i = 0; i < (n) ; ++i)
#define Cout(s) cout<<(s)<<endl;
using ll = long long;

using namespace std;

int main() {
	int X;
	int a, b;
	cin >> X >> a >> b;
	if (a % X == 0)Cout("OK")
	else	if (b / X != a / X) {
		Cout("OK");
	}
	else
		Cout("NG");
	return 0;
}

Measured memory_bytes: 3596
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define vecprint(v) rep(i,0,v.size()-1)cout << v[i] << " ";cout << endl;
#define mod 1000000007
using namespace std;

int main(){
    int n;
    string s,ans;
    cin >> n;
    cin >> s;
    rep(i,0,sz(s)){
        s[i] += n;
        while(s[i]>'Z'){
            s[i] -= ('Z'-'A'+1);
        }
    }

    cout << s << endl;
//  printf("%.10f\n",ans);

    return 0;
}

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

using namespace std;

#define sz(x) (int)(x.size())
#define fi(a, b) for(int i=a;i<b;++i)
#define fj(a, b) for(int j=a;j<b;++j)
#define fk(a, b) for(int k=a;k<b;++k)
#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
////////////////

int const N = 5e3 + 41;
int const K = 1e4 + 41;

bool pr[N][K];
short sf[N][K];
vector<int> a;
int n, k;

void solve(){
	scanf("%d %d",&n,&k);
	fi(0, n){
		int v;
		scanf("%d",&v);
		v = min(v, k);
		a.pb(v);
	}
	n = sz(a);
	
	pr[0][0] = 1;
	fi(1, n + 1){
		fj(0, K){
			if(pr[i-1][j]){ 
				pr[i][min(j + a[i-1], K - 1)] = true;
				pr[i][j] = true;
			}
		}
	}

	sf[n+1][0] = 1;
	for(int i=n;i>=1;--i){
		for(int j=0;j<K;++j){
			if(sf[i+1][j]){
				sf[i][min(j + a[i-1], K-1)] = 1;
				sf[i][j] = 1;
			}
		}
	}

	for(int i=n;i>=1;--i){
		for(int j=K-2;j>0;--j){
			if(sf[i][j]) sf[i][j] = j;
			else sf[i][j] = sf[i][j+1];
		}
	}

	int ans = 0;
	int sum;
	fi(1, n+1){
		bool f = true;
		fj(0, K){
			if(pr[i-1][j]){
				sum = j + a[i-1];
				if(sum >= k){
					if(j < k){
						f = false;
						break;
					}
				}else{
					sum = j + sf[i+1][(k - j - a[i-1])];
					if(sum + a[i-1] < k) continue;
					if(sum < k){
						f = false;
						break;
					}
				}
			}
		}
		if(f){
			++ans;
			//cerr << i << endl;
		}
	}
	printf("%d\n",ans);
}

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

	solve();


	return 0;
}

Measured memory_bytes: 148224
from sys import stdin
import math
import fractions
from collections import deque

INF = 10 ** 10

N, K = [int(x) for x in stdin.readline().rstrip().split()]
S = stdin.readline().rstrip()

ans = ""
for i in range(N):
    if i == K-1:
        ans += str(S[i]).lower()
    else:
        ans += S[i]

print(ans)

Measured memory_bytes: 66156