akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

const long double EPS = 1e-10;
const long long INF = 1e18;
const long double PI = acos(-1.0L);
//const ll mod = 1000000007;
ll N, K;
ll a[200000];
ll ans = 0;
ll sum[200500];
int main() {
    //cout.precision(10);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N >> K;
    for(int i = 0; i < N; i++) cin >> a[i];
    for(int i = 1; i <= N; i++) {
        sum[i] = sum[i-1] + a[i-1];
    }
    for(int i = 0; i + K <= N; i++) {
        chmax(ans, sum[i+K] - sum[i]);
    }
    ans += K;
    cout << fixed << setprecision(20) << ans / 2.0;
    return 0;
}

Measured memory_bytes: 3456
#include<bits/stdc++.h>
#define int long long int 
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define vii vector<int>
#define mii map<int,int>
#define mod 1000000007
#define IOS std::ios::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL);
#define endl "\n"
#define pqmin priority_queue<int,vector<int>,greater<int>>
#define pqmax priority_queue<int>
using namespace std;
int32_t main()
{
    IOS;
  int n;
  cin>>n;
  int a[n];
  double s=0;
  for(int i=0;i<n;i++)
  {
      cin>>a[i];
     
  }
  sort(a,a+n);
  s=((double)(a[0]+a[1]))/2;
  for(int i=2;i<n;i++)
  {
      s=(s+(double)a[i])/2;
  }
  cout<<s<<endl;
    return 0;
}


Measured memory_bytes: 256
function Main(input) {
  "use strict"
  const temp = input.split("\n")[0].split(" ");

  const join_count = parseInt(temp.shift());
  const rating = parseInt(temp.shift());

  if(join_count < 10) console.log(rating + 1000 - join_count * 100)
  else console.log(rating)
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


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

int main(int argc, char *argv[]) { ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
  int n,k;string s;cin>>n>>k>>s;k--;
  for(int i=0;i<n;i++){
    if(k==i) {
      if(s[i]=='A')cout<<("a");
      if(s[i]=='B')cout<<("b");
      if(s[i]=='C')cout<<("c");
    }
    else{cout<<s[i];}
  }
  cout<<endl;

  
  return 0;
}


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

int dist(int x1, int x2, int y1, int y2) {
    return abs(x1 - x2) + abs(y1 - y2);
}

int main() {
    int n, a, b, c, d;
    cin >> n;
    cin >> a >> b >> c >> d;
    a--; b--; c--; d--;

    int res = 50000;
    for (int i = 1; i <= n; i++) {
        res = min(res, dist(a % i, b % i, a / i, b / i) + dist(c % i, d % i, c / i, d / i));
    }
    cout << res << endl;

    return 0;
}

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

using namespace std;

#define LOG(...) fprintf(stderr, __VA_ARGS__)
//#define LOG(...)
#define FOR(i, a, b) for(int i = (int)(a); i < (int)(b); ++i)
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define RREP(i, n) for(int i = (int)(n - 1); i >= 0; --i)
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort(ALL(c))
#define RSORT(c) sort(RALL(c))
#define SQ(n) (n) * (n)
#define BIT(x, i) (((x) >> (i)) & 1)

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<pii> vpi;
typedef vector<pll> vpl;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vc> vvc;
typedef vector<vll> vvll;

typedef bitset<64> SW;
typedef bitset<1024> BL;

int main() {
  unordered_map<SW, int> num;
  REP(i, 64){
    num[1ULL << i] = i;
  }

  ull N, M, Q;
  while(cin >> N >> M >> Q, N | M | Q) {
    SW sw;
    BL bl, sbl;
    vector<SW> unknown(M, (1L << N) - 1);

    bl = sbl;
    // REP(i, M){
    //   cout << unknown[i].to_string().substr(64 - N) << endl;
    // }
    // cout << "------------" << endl;
    REP(i, Q){
      cin >> sw >> sbl;
      BL change_bl = bl ^ sbl;
      // cout << "===" << endl;
      // cout << sw.to_string().substr(64 - N) << endl;
      // cout << change_bl.to_string().substr(1024 - M) << endl;
      // cout << "===" << endl;
      REP(i, M){
        if(change_bl[i]) {
          unknown[i] &= sw;
        }else{
          unknown[i] &= ~sw;
        }
      }

      bl = sbl;
      // REP(i, M){
      //   cout << unknown[i].to_string().substr(64 - N) << endl;
      // }
      // cout << "------------" << endl;
    }

    RREP(i, M){
      if (unknown[i].count() != 1)
        cout << '?';
      else{
        int n = N - 1 - num[unknown[i]];
        if (n < 10)
          cout << n;
        else
          cout << (char)('A' + n - 10);

      }
    }
    cout << endl;
  }
}

Measured memory_bytes: 3012
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main()
{
    string s;
    getline(cin, s);
    int len = s.size();
    rep(i, 0, len) {
        if ('A' <= s[i] && s[i] <= 'Z') s[i] += 'a' - 'A';
        else if ('a' <= s[i] && s[i] <= 'z')s[i] -= 'a' - 'A';
    }
    cout << s << endl;
    return 0;
}



Measured memory_bytes: 3136
/*
h s, d't skp th si tll i's sved
 * ABC141 E
 * ABC145 D
 * ABC147 F
 * ABC174 F
*/
#include<bits/stdc++.h>
#define ll long long
#define mod 1000000007
using namespace std;
int main()
{
ll n;
cin>>n;
ll ans=0;
for(ll i=2;i<=sqrt(n);i++)
{
if(n%i==0)
{
ll k=n;
while(k%i==0)
{
k/=i;
}
if((k-1)%i==0)
{
ans++;
}
if(n/i!=i)
{
k=n;
while(k%(n/i)==0)
{
k/=(n/i);
}
if((k-1)%(n/i)==0)
{
ans++;
}
}
}
}
for(ll i=1;i<=sqrt(n-1);i++)
{
if((n-1)%i==0)
{
if(i!=1)
{
ans++;
}
if((n-1)/i!=i)
{
ans++;
}
}
}
cout<<ans+1<<endl;
}



/*
 * ||||


 */

Measured memory_bytes: 3688
n = int(input())
s = list(input())

alphabet = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]

a = []
for i in range(len(s)):
    for j in range(26):
        if s[i] == alphabet[j]:
            a.append(alphabet[(j+n)%26])
print("".join(a))

Measured memory_bytes: 3188
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
#include <vector>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

#define pb push_back
#define mp make_pair
#define x first
#define y second

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;

template <class T>
void read(T &x)
{
	char ch;
	for (ch=getchar();(ch<'0'||ch>'9')&&ch!='-';) ch=getchar();
	x=0;int t=1;if (ch=='-') {ch=getchar();t=-1;}
	for (;ch>='0'&&ch<='9';ch=getchar()) x=x*10+ch-'0';
	x*=t;
}

const int mod=1000000007;
int dp[4010],dp2[4010],fac[4010];

int main()
{
	#ifndef ONLINE_JUDGE
		//freopen("input.txt","r",stdin);
		//freopen("output.txt","w",stdout);
	#endif
	int n,k;scanf("%d%d",&n,&k);
	int ans=1;
	for (int i=1;i<n;i++) ans=ll(ans)*(k+1)%mod;
	ans=ll(ans)*(k*(k+1)/2)%mod;ans=ll(ans)*n%mod;
	memset(dp,0,sizeof(dp));dp[0]=min(k+1,n);dp[1]=(k==n);
	fac[0]=1;for (int i=1;i<=n;i++) fac[i]=ll(fac[i-1])*(k+1)%mod;
	ans=((-ll(fac[n-1])*dp[1]+ans)%mod+mod)%mod;
	for (int i=n-1;i;i--)
	{
		for (int j=0;j<=4000;j++) dp2[j]=dp[j];
		memset(dp,0,sizeof(dp));
		for (int j=0;j<=4000;j++)
			if (dp2[j])
				for (int p=0;p<=k;p++)
				{
					if (p>i) {dp[j]=(dp[j]+dp2[j])%mod;continue;}
					int t=(p+j)/i;ans=((-ll(fac[i-1])*t%mod*dp2[j]+ans)%mod+mod)%mod;
					dp[t+j]=(dp[t+j]+dp2[j])%mod;
				}
	}
	printf("%d\n",ans);
	return 0;
}



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

using namespace std;

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

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

int main(){
  fastIO;
  ll a, b;
  cin >> a >> b;
  ll x = __gcd(a, b);
  bool ok;
  int res = 0;
  for(ll t = 2; t * t <= x; t ++ ){
    ok = false;
    while(x % t == 0){
      x /= t;
      ok = true;
    }
    res += ok;
  }
  res ++;
  res += (x > 1);
  cout << res;
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>
#include <cassert>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//edit
class Solve {
public:
    void solve() {
        vector<vector<Int>> tapu(3, vector<Int>(3));
        for (int i = 0; i < 3; ++i) {
            for (int j = 0; j < 3; ++j) {
                cin >> tapu[i][j];
            }
        }
        Int N;
        cin >> N;
        set<Int> tapi;
        for (int i = 0; i < N; ++i) {
            Int t;
            cin >> t;
            tapi.insert(t);
        }

        bool flag = false;

        for (int i = 0; i < 3; ++i) {
            bool ok = true;
            for (int j = 0; j < 3; ++j) {
                if (!tapi.count(tapu[i][j])) {
                    ok = false;
                }
            }
            if (ok) flag = true;
        }

        for (int i = 0; i < 3; ++i) {
            bool ok = true;
            for (int j = 0; j < 3; ++j) {
                if (!tapi.count(tapu[j][i])) {
                    ok = false;
                }
            }
            if (ok) flag = true;
        }

        {

            bool ok = true;
            for (int i = 0; i < 3; ++i) {
                if (!tapi.count(tapu[i][i])) {
                    ok = false;
                }

            }
            if (ok) flag = true;

        }


        {

            bool ok = true;
            for (int i = 0; i < 3; ++i) {
                if (!tapi.count(tapu[i][2 - i])) {
                    ok = false;
                }

            }
            if (ok) flag = true;

        }

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


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 504
#include <iostream>
#include <string>
#include <bitset>
#include <cmath>
#include <algorithm>
using namespace std;
int main(void){

    string str;
    long long sum = 0;
    cin >> str;
    
    for(int tmp = 0; tmp < (1 << (str.size()-1)); tmp++){
        bitset<10> s(tmp);
        string now_Str = "";
        now_Str = str[0];
        
        for(int i = 0; i < (str.size()-1); i++){
            if(s.test(i)) now_Str += "+";
                now_Str += str[i+1];
        }

        int pos = 0;
        
        while(now_Str.find("+", pos) != string::npos){
            int next_Pos = now_Str.find("+", pos);
            sum += stoll(now_Str.substr(pos, next_Pos - pos));
            pos = next_Pos + 1;
        }
        sum += stoll(now_Str.substr(pos));
        
    }
    
    cout << sum << endl;
    
}


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

int main() {
  int d, n;
cin >> d >> n;
    if (n == 100)n++;
    if (d == 0) {
        cout << n << endl;
    }
    if (d == 1) {
        cout << 100 * n << endl;
    }
    if (d == 2) {
        cout << 10000 * n << endl;
    }
}

Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
    long long int A,B;
    cin>>A>>B;
    long long int minans=min(A,B);
    if(A%3==0||B%3==0){
        cout<<0<<endl;
        return 0;
    }
    if(A==2&&B==2){
        cout<<1<<endl;
        return 0;
    }
    for(int i=1;i<A;i++){
        if(B%2==0){
            minans=min(minans,abs(i*B-B/2*(A-i)));
        }
        else{
            long long int karimax=0;
            karimax=max(karimax,abs(i*B-B/2*(A-i)));
            karimax=max(karimax,abs(i*B-(B/2+1)*(A-i)));
            karimax=max(karimax,abs(A-i));
            minans=min(minans,karimax);
        }
    }
    for(int i=1;i<B;i++){
        if(A%2==0){
            minans=min(minans,abs(i*A-A/2*(B-i)));
        }
        else{
            long long int karimax=0;
            karimax=max(karimax,abs(i*A-A/2*(B-i)));
            karimax=max(karimax,abs(i*A-(A/2+1)*(B-i)));
            karimax=max(karimax,abs(B-i));
            minans=min(minans,karimax);
        }
    }
    cout<<minans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define f(i,a,b) for(int i=a,inc=(b-a)/abs(b-a); i!=b ; i+=inc)
#define deb(x) cout<<#x<<"->"<<x<<endl;
#define print(arr,a,b) for(int i=a;i!=b;i++){cout<<arr[i]<<" ";}cout<<endl;
using ll=long long int;
int arr_min(int arr[],int a,int b){ int min=arr[0]; for(int i=a;i!=b;i++){if(min>arr[i]) min=arr[i];}return min;}
int arr_max(int arr[],int a,int b){ int max=arr[0]; for(int i=a;i!=b;i++){if(max<arr[i]) max=arr[i];}return max;}

signed main()
{
	ios_base::sync_with_stdio(false);   
    cin.tie(NULL);

	#ifndef ONLINE_JUDGE
      	freopen("input.txt", "r", stdin);
      	freopen("output.txt", "w", stdout);
    #endif
    int t=1;
    // cin>>t;
    while(t-->0){
    	int k;
    	cin>>k;
    	ll sum=0;
    	for(int a=1;a<=k;a++)
    	{
    		for(int b=1;b<=k;b++)
    		{
    			for(int c=1;c<=k;c++)
    			{
                      int x=__gcd(b,c);
                      sum+=__gcd(x,a);
    			}
    		}
    	}
    	cout<<sum<<endl;
    	
    	
    }
    return 0;
}

Measured memory_bytes: 3640
// AOJ ALDS1_9_B Maximum Heap
// 2018.5.1 bal4u

#include <stdio.h>

#if 1
#define gc() getchar_unlocked()
#define pc(c) putchar_unlocked(c)
#else
#define gc() getchar()
#define pc(c) putchar(c)
#endif

int in()
{
	int n = 0, c = gc();
	if (c == '-') { c = gc();
		do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
		return -n;
	}
	do n = 10*n + (c & 0xf), c = gc(); while (c >= '0');
	return n;
}

void out(int n)
{
	int i;
	char ob[20];

	if (!n) { pc('0'); return; }
	if (n < 0) pc('-'), n = -n;
	i = 0; while (n) ob[i++] = n%10 + '0', n/=10;
	while (i--) pc(ob[i]); 
}

#define QSIZE     500005
#define PARENT(i) ((i)>>1)
#define LEFT(i)   ((i)<<1)
#define RIGHT(i)  (((i)<<1)+1)

int que[QSIZE+5]; int qsize;

void max_heapify(int i)
{
	int l, r, max;
	int qt;

	l = LEFT(i), r = RIGHT(i);
	if (l <= qsize && que[l] > que[i]) max = l; else max = i;
	if (r <= qsize && que[r] > que[max]) max = r;
	if (max != i) {
		qt = que[i], que[i] = que[max], que[max] = qt;
		max_heapify(max);
	}
}

int main()
{
	int H, i;

	qsize = H = in();
	for (i = 1; i <= H; i++) que[i] = in();
	for (i = H>>1; i >= 1; i--) max_heapify(i);
	for (i = 1; i <= H; i++) pc(' '), out(que[i]);
	pc('\n');
	return 0;
}


Measured memory_bytes: 3552
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T> using vt = vector<T>;
template<class T> using vvt = vector<vt<T>>;
template<class T> using ttt = tuple<T,T>;
using tii = tuple<int,int>;
using vi = vector<int>;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define mt make_tuple
#define ALL(a) (a).begin(),(a).end()
#define FST first
#define SEC second
#define DEB cerr<<"!"<<endl
#define SHOW(a,b) cerr<<(a)<<" "<<(b)<<endl
#define DIV int(1e9+7)
const int INF = (INT_MAX/2);
const ll LLINF = (LLONG_MAX/2);
const double eps = 1e-8;
//const double PI = M_PI;  
inline ll pow(ll x,ll n,ll m){ll r=1;while(n>0){if((n&1)==1)r=r*x%m;x=x*x%m;n>>=1;}return r%m;}
inline ll lcm(ll d1, ll d2){return d1 / __gcd(d1, d2) * d2;}

/*Coding Space*/
int main(){
  string s; cin >> s;
  int n; cin >> n;
  int t = 0;
  while(t < (int)s.size())
    cout << s[t], t += n;
  cout << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
typedef long long ll;
#define MOD 1000000007
using namespace std;
int main() {
    char a;
    cin >> a;
    if(isupper(a)) {
        cout << "A" << endl;
    } else {
        cout << "a" << endl;
    }
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <queue>
#include <iomanip>
#include <string>
#include <algorithm>
using namespace std;
using Graph = vector<vector<int>>;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep_1 (i,j,n) for(int i=j;i<n;i++)
typedef long long ll;
const ll l_INF = 1010101010101010;
const int INF = 1010101010;
const int dx[4] = {-1,0,1,0};
const int dy[4] = {0,-1,0,1};
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
const ll mod=1000000007;


// x!のmod
ll kaijou_mod(ll n){
  ll ans=1;
  rep(i,n){
    ans*=(i+1);
    ans%=mod;
  }
  return ans;
}
// a^nのmod
ll modpow(ll a,ll n){
  ll ans=1;
  while(n!=0){
      if(n&1)ans=ans*a%mod;
      a=a*a%mod;
      n=n>>1;
  }
  return ans;
}
// 逆元の計算
ll modinv(ll a, ll m){
  return modpow(a,m-2);
}

long long com_mod(long long x, long long y){
  long long ans = 1;
  ans *= kaijou_mod(x);
  ans%=mod;
  ans *= modinv(kaijou_mod(y),mod);
  ans%=mod;
  ans *= modinv(kaijou_mod(x-y),mod);
  ans%=mod;
  return ans;
}

int main(){
  int s; cin>>s;
  ll ans=0;
  int x=s/3;
  rep(i,x){
    ans+=com_mod(s-2*i-3,i);
    //cout<<ans<<endl;
    ans%=mod;
  }
  cout<<ans<<endl;
}


Measured memory_bytes: 3620
#include<iostream>
using namespace std;
int main()
{
  int n,s=0,i;
  cin>>n;
  int a[n],b[n],c[n-1];
  for(i=0;i<n;i++)
    cin>>a[i];
  for(i=0;i<n;i++)
  {
    cin>>b[i];
    s+=b[i];
  }
  for(i=0;i<n-1;i++)
    cin>>c[i];
  for(i=0;i<n-1;i++)
  {
    if((a[i+1]-a[i])==1)
      s+=c[a[i]-1];
  }
  cout<<s;
}
  
  


Measured memory_bytes: 256
def gcd(a, b):
	while b:
		a, b = b, a%b
	return a
def lcm(a, b):
	return a*b // gcd(a, b)
n = int(input())
ls = []
for i in range(n):
    ls.append(int(input()))
result = ls[0]
for i in ls[1:]:
    result = lcm(i,result)
print(result)



Measured memory_bytes: 3060
alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"]

key = dict()
for a in alphabet:
  key[a] = 50

n = int(input())
for i in range(n):
  x = input()
  for a in alphabet:
    key[a] = min(key[a], x.count(a))

for k, v in key.items():
  for _ in range(v):
    print(k, end="") 
print()

Measured memory_bytes: 9204
#include<bits/stdc++.h>
using namespace std;
char s[4];
int main()
{
	scanf("%s",s);
	int len=strlen(s);
	if(len==3)
	{
		if(s[0]==s[2]) {cout<<"Yes\n";return 0;
		}
		else {cout<<"No\n";return 0;		}
	} 
	else if(len==2)
	{
		if(s[0]==s[1]) {cout<<"Yes\n";return 0;
		}
		else {cout<<"No\n";return 0; 
		}
	}
	else cout<<"Yes\n";return 0;
}

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

int main()
{
  int N ;
  cin>>N ;
  string S=to_string(N) ;
  int sum=0 ;
  for(int i=0;i<S.size();i++) sum+=S[i]-'0' ;
  
  if(N%sum==0) cout<<"Yes"<<endl ;
  else cout<<"No"<<endl ;

  return 0 ;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

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

		int count = 0;
		int var=0;
		for (int i=0; i<=a; i++) {
			for (int j=0; j<=b; j++) {
				for (int n=0; n<=c;n++) {
					if (x == 500*i + 100*j + 50*n) {
						count++;
					}
				}
			}
		}
		
		System.out.println(count);
	}

}


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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
  pr(b);
}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

int main()
{
  int n, k, x;
  cin >> n >> k;
  int ans = 0;
  rep(i, n)
  {
    cin >> x;
    if (x >= k)
      ans++;
  }
  pr(ans);
  return 0;
}


Measured memory_bytes: 3672
#include<stdio.h>
#include<math.h>
int kock(int n, double p1x, double p1y, double p2x, double p2y) {
    double sx, sy, tx, ty, ux, uy;
    double cos60 = 0.5, sin60 = sqrt(3) / 2;
    if (n == 0) {
        return 0;
    }
    sx = (2 * p1x + p2x) / 3;
    sy = (2 * p1y + p2y) / 3;
    tx = (p1x + 2 * p2x) / 3;
    ty = (p1y + 2 * p2y) / 3;
    ux = (tx - sx) * cos60 - (ty - sy) * sin60 + sx;
    uy = (tx - sx) * sin60 + (ty - sy) * cos60 + sy;
    
    kock(n-1, p1x, p1y, sx, sy);
    printf("%f %f\n", sx, sy);
    kock(n-1, sx, sy, ux, uy);
    printf("%f %f\n", ux, uy);
    kock(n-1, ux, uy, tx, ty);
    printf("%f %f\n", tx, ty);
    kock(n-1, tx, ty, p2x, p2y);
}

int main() {
	int n;
	double p1x = 0.0, p1y = 0.0, p2x = 100.0, p2y = 0.0;
	scanf("%d", &n);
	printf("%f %f\n", p1x, p1y);
	kock(n, p1x, p1y, p2x, p2y);
	printf("%f %f\n", p2x, p2y);
	return 0;
}

Measured memory_bytes: 636
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        String n = sc.next();
        if (n.charAt(0) == n.charAt(2)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 22736
#include <iostream>
#include <string>

using namespace std;

int main()
{
	string S, T;
	bool flag = true;
	cin >> S >> T;
	for (int count = 0; count < S.length(); count++)
	{
		if (S.at(count) != T.at(count))
		{
			flag = false;
			break;
		}
	}
	if (flag)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

Measured memory_bytes: 3624
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;

int main(){
int n;
cin >> n;
char Moji[n];
int Num[n];
int cards[4][13];
for(int i = 0; i<4; i++){
     for(int j = 0; j<13; j++){
          cards[i][j] = 0;
     }
}

for(int i = 0; i<n; i++){
     cin >> Moji[i] >> Num[i];
    int N = Num[i]-1;
     if(Moji[i] == 'S'){
          cards[0][N] = 1;
     }else if(Moji[i] == 'H'){
          cards[1][N] = 1;
     }else if(Moji[i] == 'C'){
          cards[2][N] = 1;
     }else if(Moji[i] == 'D'){
          cards[3][N] = 1;
     }
}

for(int i = 0; i<4; i++){
     for(int j = 0; j<13; j++){
          if(cards[i][j] == 0){
               if(i == 0){
                    cout <<  "S " << j+1 << endl;
               }else if(i == 1){
                    cout << "H " << j+1 << endl;
               }else if(i == 2){
                    cout << "C " << j+1 << endl;
               }else if(i == 3){
                    cout << "D " << j+1 << endl;
               }
          }
     }
}

return 0;
}


Measured memory_bytes: 3076
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
using ll = long long;
using ld = long double;

#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
#define e_b emplace_back
#define all(x) (x).begin(),(x).end()
#define uniq(x) ((x).erase(unique(all(x)),(x).end()))
#define sz(x) ((int)(x).size())

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

#ifdef LOCAL//compile with -DLOCAL
#define debug(x) cerr<<"LINE"<<__LINE__<<" : "<<#x<<" = "<<(x)<<endl
#define debug_vec(x) cerr<<"LINE"<<__LINE__<<" : "<<#x<<" = ";\
  rep(i,sz(x)){cerr<<x[i]<<" ";}cerr<<endl
#define debug_mat(x) cerr<<"LINE"<<__LINE__<<" : "<<#x<<" = "<<endl;\
  rep(i,sz(x)){rep(j,sz(x[i])){cerr<<x[i][j]<<" ";}cerr<<endl;}cerr<<endl
#else
#define debug(x) void(0)
#define debug_vec(x) void(0)
#define debug_mat(x) void(0)
#endif

template<class T> bool chmax(T &a,T b){if(a<b){a=b;return true;}return false;}
template<class T> bool chmin(T &a,T b){if(a>b){a=b;return true;}return false;}


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

  int MA=1000001;
  vector<int> prime(MA);
  rep(i,MA) prime.at(i)=i;
  REP(i,2,MA){
    if(prime.at(i)!=i)  continue;
    for(int j=i+i;j<MA;j+=i){
      if(prime.at(j)==j)  prime.at(j)=i;
    }
  }

  ll ans = 0;
  REP(i,1,N){
    ll tmp = 1;
    int a = N-i;

    while(prime.at(a)!=a){
      int div=prime.at(a);
      int cnt=0;
      while(a%div==0){
        a/=div;
        cnt++;
      }
      tmp *= ll(cnt+1);
    }
    if(a!=1)  tmp *= 2;
    ans += tmp;
  }
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 7156
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
LL dp[10][12]; //dp[i][j]代表以i开头的j位数有多少个lun number 
LL k, ans[12]; //ans[i]表示i位lun number的个数
int bit;

void dfs(LL num, LL lst) {
	if(num > bit) return ;
	if(num == 1) {
		for(LL i = 1; i < 10; i++) {
			if(k > dp[i][bit - num + 1]) k -= dp[i][bit - num + 1];
			else {
				cout << i;
				dfs(num + 1, i);
				break;
			}
		}
	}
	else {
		for(LL i = lst - 1; i <= lst + 1; i++) {
			if(i < 0 || i > 9) continue;
			if(k > dp[i][bit - num + 1]) k -= dp[i][bit - num + 1];
			else {
				cout << i;
				dfs(num + 1, i);
				break;
			}
		}
	}
}

int main() {
	cin >> k;
	for(int i = 0; i < 10; i++) dp[i][1] = 1;
	ans[1] = 9LL;
	for(int j = 2; j <= 10; j++) { //位数:2 ~ 10
		for(int i = 0; i < 10; i++) { //最高位:0 ~ 9
			if(i == 0) dp[i][j] = dp[i][j - 1] + dp[i + 1][j - 1];
			//最高位i = 0时的j位数只能以i和i + 1作最高位的j - 1位数作为后缀
			else if(i == 9) dp[i][j] = dp[i - 1][j - 1] + dp[i][j - 1];
			//最高位i = 9时的j位数只能以i - 1和i作最高位的j - 1位数作为后缀
			else dp[i][j] = dp[i - 1][j - 1] + dp[i][j - 1] + dp[i + 1][j - 1]; 
			//最高位非0非9时, 以i - 1、i本身、i + 1作最高位的j - 1位数均可作为最高位是i的j位数的后缀
			if(i) ans[j] += dp[i][j]; //没有前导0时就将dp[i][j]表示的个数存入ans[j]
		}
	}
	for(int i = 1; i <= 20; i++) {
		if(k > ans[i]) k -= ans[i];
		else {
			bit = i; //所求转化为:位数为bit位的所有数中的第k小的那个(将当前k定位在bit位)
			break;
		}
	}
	dfs(1, 0);
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
// package app;

import java.util.Arrays;
import java.util.Scanner;
import java.util.stream.Stream;

public class Main {

    public static void main(final String[] args) throws Exception {
        final Scanner sc = new Scanner(System.in);

        // final String S = sc.next();
        // final int A = sc.nextInt();
        // final int A = sc.nextInt();
        // final int B = sc.nextInt();
        // final int C = sc.nextInt();
        int N = sc.nextInt();
        int A = sc.nextInt();

        boolean result = N % 500 == 0 || N % 500 <= A;

        // System.out.println();
        System.out.println(result ? "Yes" : "No");

        // System.out.println(A <= X && A + B >= X ? "YES" : "NO");

    }
}

Measured memory_bytes: 21844
#include <iostream>
#include <iomanip>
double r(double b,int i,double sum){
  if(i==11)return sum;
  if(!(i%2))b*=2;
  else{b/=3;}
  return r(b,i+1,sum+b);
}
int main(){
  double n;
  while(std::cin>>n){
    if(std::cin.eof())break;
    std::cout<<std::fixed<<std::setprecision(8)<<r(n,2,n)<<std::endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include<cstdio>
const int mod=998244353;
char s[300005];
int S[300005];
int posi[300005];//0:left 1:mid 2:right
int main(){
    int n;scanf("%d",&n);
    scanf("%s",s+1);
    int N=n*3;
    int r=0,g=0,b=0;
    for(int i=1;i<=N;++i){
        if(s[i]=='R'){
            S[i]=0;
        }else if(s[i]=='G'){
            S[i]=1;
        }else{
            S[i]=2;
        }
    }
    int cnt[3]={0,0,0};
    for(int i=1;i<=N;++i){
        cnt[S[i]]++;
        if(cnt[0]==cnt[1]&&cnt[1]==cnt[2]){//完全相同
            posi[i]=2;
        }
        int lt=0,gt=0,eq=0;
        for(int j=0;j<3;++j){
            if(cnt[j]>cnt[S[i]])gt++;
            else if(cnt[j]<cnt[S[i]])lt++;
            else eq++;
        }
        if(gt==2)posi[i]=2;
        else if(lt==2)posi[i]=0;
        else if(eq==3)posi[i]=2;
        else if(gt==1&&lt==1)posi[i]=1;
        else if(eq==2){
            if(gt==1){
                posi[i]=2;
            }else{
                posi[i]=1;
            }
        }
    }
    int ans=1;
    for(int i=1;i<=n;++i)ans=ans*1ll*i%mod;
    int num[3]={0,0,0};
    for(int i=1;i<=N;++i){
        if(posi[i]==0){
            num[0]++;
        }else if(posi[i]==1){
            ans=ans*1ll*num[0]%mod;
            num[0]--;num[1]++;
        }else{
            ans=ans*1ll*num[1]%mod;
            num[1]--;num[2]++;
        }
    }
    printf("%d\n",ans);
    return 0;
}
//RGB R  B G

Measured memory_bytes: 2816
import java.util.*;

fun Eratos(n:Int):List<Int>{
    var h=BooleanArray(n,{true})
    h[0]=false
    h[1]=false
    for(i in h.indices){
        if(h[i]==true){
            var j=i+i
            while(j<n){
                h[j]=false
                j+=i
            }
        }
    }
    return h.indices.filter{i->h[i]==true}
}

fun ANSWER():List<Int>{
    val era=Eratos(100000);
    return era.filter{it->it%5==1}
}

fun main(args: Array<String>) {
    val sc = Scanner(System.`in`)
    val n = sc.nextLong()
    val ans = ANSWER()
    for(i in ans.indices){
        if(i>=n){
            break
        }
        print("${ans[i]} ")
    }
}

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

using namespace std;

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


int main(){
	int a,b,c,d,e,k;
	cin >> a >> b >> c >> d >> e >> k;
	if (e-a <= k){
		cout << "Yay!" << endl;
	}else{
		cout << ":(" << endl;
	}

		return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <bits/stdc++.h>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <deque>
#include <tuple>
#include <unordered_set>
#include <array>
#include <string>

using namespace std;
#define ll long long
#define ar array

int main() {
	int n, q;
	cin >> n >> q;
	ll ans=1LL*(n-2)*(n-2);
	set<pair<int, int>> se[2];
 	se[0].insert({n, n});
	se[1].insert({n, n});
	while (q--) {
		int t, x;
		cin >> t >> x, t--;
		auto it=se[t].lower_bound({x, -1});
		int k=(*it).second;
		ans-=k-2;
		se[t^1].insert({k, x});
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 12888
a, b = map(int, input().split())
if a < 1 or 10000 < a:
    print('"a" has invalid value.')
elif b < 1 or 10000 < b:
    print('"b" has invalid value.')
elif 0 == (a * b) % 2:
    print('Even')
else:
    print('Odd')

Measured memory_bytes: 2940
#include <cassert>
#include <limits>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#include <random>
#include <memory>
#include <utility>
 
#define rep(i, a, b) for (long long (i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr << "debug " <<"LINE:"<<__LINE__<<"  "<< #i <<":"<< i << std::endl

 
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << pa.first << " " << pa.second;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (int i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
 
template<typename T1,typename T2>
inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);}
 
template<typename T1,typename T2>
inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);}
 
long long pow_mod(long long a, long long b, long long mod=-1) {
  if ((a == 0)||(mod!=-1&&a%mod==0)) {
    return 0;
  }
 
  long long x = 1;
 
  while (b > 0) {
    if (b & 1) {
      x = (mod!=-1)?(x * a) % mod:x*a;
    }
    a = (mod!=-1)?(a * a) % mod:a*a;
    b >>= 1;
  }
  return x;
}
 
// const long long MOD = 998244353;
const long long MOD = 1e9 + 7;

using ll = long long;
using P = std::pair<ll, ll>;

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

  ll num=1;

  rep(i,0,10){
    std::cout<<"? "<<pow_mod(10,num)<<std::endl;

    char ans;
    std::cin>>ans;

    if(ans=='N')break;
    
    num++;
  }

  if(num>10){
    num=1;
    while(1){
      std::cout<<"? "<<2*num<<std::endl;

      char ans;
      std::cin>>ans;

      if(ans=='Y'){
        std::cout<<"! "<<num<<std::endl;
        return 0;
      }
      num*=10;
    }
  }else{
    ll left=pow_mod(10,num-1)-1,right=pow_mod(10,num)-1;
    while(right-left>1){
      ll mid=left+(right-left)/2;

      std::cout<<"? "<<mid*10<<std::endl;

      char ans;
      std::cin>>ans;
      if(ans=='Y')right=mid;
      else left=mid;
    }

    std::cout<<"! "<<right<<std::endl;
    return 0;
  }

  return 0;
}

Measured memory_bytes: 596
#include <stdio.h>
int main()
{
     int c,d;
     char a,b;
     scanf("%d %d", &c,&d);
     if(c < d) {
          printf("a < b\n");
     }
     if(c > d) {
          printf("a > b\n");
     }
     if(c == d) {
          printf("a == b\n");
     }
     return 0;
}



Measured memory_bytes: 2044
import sys
N, X = map(int, input().split())

lst = list(map(int, input().split()))

if N == 1:
    print (abs(X-lst[0]))
    sys.exit()

lst += [X]

lst2 = []
for i in range(N):
    lst2 += [abs(lst[i]-lst[i+1])]


def gcd(a,b): #aとbの最大公約数を求める
    if a < b:
        a, b = b, a
    r = a%b
    if r == 0:
        return b
    else:
        return gcd(b, r)
    return

A = lst2[0]
B = lst2[1]
C = gcd(A, B)
for i in range(2, N):
    C = gcd(C, lst2[i])

print (C)

Measured memory_bytes: 14480
#include <iostream>
#include <string>

using namespace std;

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

  cin >> s;

  int cnt = 0;

  std::string::size_type pos = s.find("ABC");
  while (pos != std::string::npos)

  {
    cnt++;
    pos = s.find("ABC", pos + 3);
  }

  cout << cnt << endl;
  return 0;
}

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

  int x;
  for(int i=0;i<5;i++)
  {
    int k;cin>>k;
    if(k==0)
    {
      x=i+1;
    }
  }
  cout<<x<<endl;
  return 0;
}


Measured memory_bytes: 3584
#include<bits/stdc++.h>
using namespace std;
int main(){
    int N;
    cin >> N;
    double sum = 0;
    for(int i = 0; i < N; i++){
        double x;
        string u;
        cin >> x >> u;
        if(u == "JPY"){
            sum += x;
        }else{
            sum += x*380000.0;
        }
    }
    cout << sum << endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int n;
  int i;
  int a[10000], b[10000];
  int sum_a, sum_b;

  while(1){
    scanf("%d",&n);
    if(n == 0){
      break;
    }

    sum_a = 0;
    sum_b = 0;

    for(i = 0; i < n; i++){
      scanf("%d",&a[i]);
      scanf("%d",&b[i]);
    }


    for(i = 0; i < n; i++){
      if(a[i] > b[i]){
	sum_a = sum_a + a[i] + b[i];
      }else if(a[i] < b[i]){
	sum_b = sum_b + a[i] + b[i];
      }else{
       sum_a = sum_a + a[i];
       sum_b = sum_b + b[i];
      }
    }



    
  printf("%d %d\n",sum_a, sum_b);
    
  }

  return 0;

}

    

Measured memory_bytes: 676
import sys
sys.setrecursionlimit(10**6)

INF = 10**11


def main(input, print):
    n, m, k = map(int, input().split())
    a = list(map(int, input().split()))
    b = list(map(int, input().split()))
    at = [0] * (n+1)
    bt = [0] * (m+1)
    for i in range(1, n+1):
        at[i] = at[i-1]+a[i-1]
    for i in range(1, m+1):
        bt[i] = bt[i-1]+b[i-1]

    ans = 0
    j = m
    for i in range(n+1):
        if at[i] > k:
            break
        while k < at[i] + bt[j]:
            j -= 1
        ans = max(ans, i+j)

    print(ans)


if __name__ == '__main__':
    main(sys.stdin.readline, print)


Measured memory_bytes: 118292
#include <iostream>

using namespace std;

int main(void)
{
	int n;
	int *a;

	cin >> n;
	a = new int[n];

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

	while (--n > 0)
		cout << a[n] << ' ';

	cout << a[n] << endl;
}

Measured memory_bytes: 3100
A=[int(input()) for i in range(5)]
ans=0
for i in range(5):
    if A[i]%10==0:
        ans+=A[i]
        A[i]=0
B=[str(i) for i in A]
C=[B[i][-1] for i in range(5)]
C=[int(C[i]) for i in range(5)]
D=[None]*5
for i in range(5):
    D[i]=int(B[i])-int(C[i])
E=list([n for n in(sorted(C,reverse=True)) if n>0])
for i in range(len(E)-1):
    ans+=10
try:
    ans=ans+E[-1]+int(sum(D))
except(IndexError):
    ans=ans+int(sum(D))
print(ans)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i=0; i<(n); i++)
template <typename T>
bool check_prime(T m){
    if (m == 1) return false;
    if (m %2 == 0&&m != 2) return false;
    for (int i=3; i<=sqrt(m); i += 2){
        if (m%i == 0) return false;
    }
    return true;
}
int main(){
    int n; cin >> n;
    int count=0;
    rep(i, n){
        int a;
        cin >> a;
        if(check_prime<int>(a)){
          count++;
        }
    }
    cout << count << endl;
}


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

int main() {
  int n, r;
  cin >> n >> r;
  if (n>10) cout << r;
  else cout << r + 100 * (10-n);
}


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

int main() {
  string s;
  cin >> s;
  bool a = true;
  for(int i =0;i<s.size();i++) {
    if(s.at(i) != s.at(s.size()-1-i)) {
      a = false;
    }
  }
  int n = s.size();
  int k = (n+1)/2;
  for(int i =0;i<k-1;i++) {
    if(s.at(i) != s.at(k+i)) {
      a = false;
    }
  }
  if(a) {
    cout << "Yes" <<endl;
  }
    else {
      cout << "No" <<endl;
    }
}

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

const ll INF = 1001001001;
ll gcd(ll a, ll b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

int main(){
  int k; cin>>k;
  ll ans =0;
  rep(i,k){
    rep(j,k){
      rep(l,k){
        ans+=gcd(gcd(i,j),l);
      }
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
#define  rep(i, n) for(int i = 0; i < n; i++) 
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  INF 1000000000
#define  pow(x) pow(10,(x)) 
typedef long long int LL;
const int MOD = 1000000007;
//sort(all(x))とするとソートできるよ

int main(){
    int N;cin >> N;
    int ans;
    int a;
    int tmp;
    rep(i,N){
        cin >> a;
        tmp += a;
    }
    ans = tmp - N;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <cstdlib>
#include <queue>
using namespace std;


int main(){
	string S;
	cin>>S;
	int min = 99999;
	for(int i=0;i<S.size()-2;i++){
		int n = 0;
		n+=(S[i]-'0')*100;
		n+=(S[i+1]-'0')*10;
		n+=S[i+2]-'0';
		n=abs(n-753);
		if(min>n){
			min=n;
		}
	}
	cout<<min<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  long N;
  cin>>N;
  if(N%2==0){
  
  long k=N/2;
  long s=0;
  while(k>4){
	s+=k/5;
    k=k/5;
  }
    cout<<s<<endl;
  }else cout<<0<<endl;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(int argc, const char * argv[]) {
    int a,b;
    int ans = 0;
    cin>>a>>b;
    int c =b -a;
    for(int i=1;i<=c;i++){
        ans += i;
    }
    ans -=b;
    cout<<ans<<endl;
}

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

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
	
	string s;
	
	cin >> s;
	
	stack<char> st;
	
	int ans = 0;
	for (char c : s) {
		if (st.size() && st.top() != c) {
			ans += 2;
			st.pop();
		}
		else {
			st.push(c);
		}
	}
	
	cout << ans << '\n';
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define s(x) (x).begin(),(x).end();
using namespace std;
typedef long long ll; 
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; }
const ll INF = 1LL<<60;

int main(){

    int  N;
    cin >> N;
    ll vac[100010][3];
    rep(i,N){
        rep(j,3)cin >>vac[i][j];
    }
    ll dp[100010][3];
    rep(i,100010){
        rep(j,3)dp[i][j]=0;
    }

    rep(i,N){
        rep(j,3){
            rep(k,3){
                if(j==k)continue;
                chmax(dp[i+1][k],dp[i][j]+vac[i][k]);
            }
        }
    }
    ll ans =0;
    rep(i,3) chmax(ans, dp[N][i]);

    cout<<ans<<endl;


   
    
}

Measured memory_bytes: 4992
n = int(input())
prime = [2,3,5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]


def yakusuu(n,p):
    res = 0
    while n > 0:
        n //= p
        res += n
    return res

l2 = 0
l4 = 0
l14 = 0
l24 = 0
l74 = 0

for p in prime:
    y = yakusuu(n,p)
    if y >= 2:
        l2 += 1
    if y >= 4:
        l4 += 1
    if y >= 14:
        l14 += 1
    if y >= 24:
        l24 += 1
    if y >= 74:
        l74 += 1

print(l4*(l4-1)*(l2-2)//2+l14*(l4-1)+l24*(l2-1)+l74)

Measured memory_bytes: 3064
#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;
}
void print() { cout << "\n"; }
template <class T> void print(const T &x) { cout << x << "\n"; }
template <class T, class... Args> void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
template <class T> void printVector(const vector<T> &v) {
    for(const T &x : v) {
        cout << x << " ";
    }
    cout << "\n";
}
using ll = long long;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    ll x;
    cin >> n >> m >> x;
    vector<vector<ll>> a(n, vector<ll>(m));
    vector<ll> c(n);
    for(int i = 0; i < n; i++) {
        cin >> c[i];
        for(int j = 0; j < m; j++) {
            cin >> a[i][j];
        }
    }
    ll ans = LLINF;
    for(int bit = 0; bit < (1 << n); bit++) {
        ll sum = 0;
        vector<ll> algo(m, 0);
        for(int i = 0; i < n; i++) {
            if(bit & (1 << i)) {
                sum += c[i];
                for(int j = 0; j < m; j++) {
                    algo[j] += a[i][j];
                }
            }
        }
        if(*min_element(ALL(algo)) >= x) {
            chmin(ans, sum);
        }
    }
    print(ans == LLINF ? -1 : ans);
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> mp;
ll inf =  1e9;


int main(){
 ll n;cin>>n;
 vector<ll> a(n);
 for(ll i=0;i<n;i++)cin>>a[i];
 set<ll> s;
 ll sum = 0;
 for(ll i=0;i<n;i++) s.insert( a[i] );
 set<ll> ss = s;
 //for(auto i:ss)cout<<i<<endl;
 for(ll i=0;i<n;i++){
  for(ll j=2;j*j<=a[i];j++){
   if( a[i]%j== 0){
    //s.erase(j);
    //s.erase(a[i]/j);
    //cout<<a[i]<<' '<<j<<endl;
    if( ss.find( j ) != ss.end() ){
     s.erase( a[i] );
     break;
    }
    if( ss.find( a[i]/j ) != ss.end() ){
     s.erase( a[i] );
     break;
    }

   }
  }

 }

 sort(a.begin(),a.end() );
 if( a[0] == 1 ){
  if( a.size() != 1 && a[1] == 1 ){
   cout<<0<<endl;
  }else{
   cout<<1<<endl;
  }
  return 0;
 }

 for(ll i=0;i<n-1;i++){
  if( a[i] == a[i+1] ){
   s.erase( a[i] );
  }
 }
 
 //for(auto i:s)cout<<i<<endl;

 cout<<s.size()<<endl;
    return 0;
}


Measured memory_bytes: 23504
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int n,f[100005],tot;
int a1[100005];
int main()
{
    a1[++tot]=1;
    scanf("%d",&n);
    for(int i=6;i<=n;i*=6)
        a1[++tot]=i;
    for(int i=9;i<=n;i*=9)
        a1[++tot]=i;
	memset(f,0x3f,sizeof(f));
	f[0]=0;
    for(int i=1;i<=tot;i++)
        for(int j=a1[i];j<=n;j++)
            f[j]=min(f[j],f[j-a1[i]]+1);
    printf("%d",f[n]);
}

Measured memory_bytes: 512
def valid?(a, b, c)
  (a <= b + c && b <= c + a && c <= a + b) || (a + 1 <= b + c && b <= c + a + 1 && c <= a + b + 1)
end

def calc(rear, front, west, east, north, south, best)
  path = ''
  loop do
    a = rear + front
    b = west + east
    c = north + south

    return path if a + b + c == 0

    if east > 0 && valid?(b - 1, c, a)
      rear, front, west, east = east - 1, west, rear, front
      y = 'E'
    elsif north > 0 && valid?(c - 1, a, b)
      rear, front, north, south = north - 1, south, front, rear
      y = 'N'
    elsif south > 0 && valid?(c - 1, a, b)
      rear, front, north, south = south - 1, north, rear, front
      y = 'S'
    elsif west > 0 && valid?(b - 1, c, a)
      rear, front, west, east = west - 1, east, front, rear
      y = 'W'
    else
      throw 'error'
    end
    
    if best
      x = best[path.size]
      return best if x < y
      best = nil if x > y
    end
    path << y  
  end
end

def find(target)
  best = nil
  target.permutation(6).to_a.uniq.each do |rear, front, west, east, north, south|
    a = rear + front
    b = west + east
    c = north + south
    if valid?(a, b, c)
      best = calc(rear, front, west, east, north, south, best)
    end
  end
  best
end

loop do
  target = STDIN.gets.split.map!(&:to_i)
  break if target.max == 0
  p, q = STDIN.gets.split.map!(&:to_i)
  result = find(target)
  puts result ? result[p-1...q] : 'impossible'
end

Measured memory_bytes: 9892
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define deg_to_rad(deg) (((deg)/360)*2*M_PI)
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)

int main(){
    int a,b,h,m;
    cin >> a;
    cin >> b;
    cin >> h;
    cin >> m;
    // cout <<a<<b<<h<<m;
    // cout <<30*h-5.5*m<<endl;
    // cout <<sin((deg_to_rad(90)))<<endl;
    // cout <<sin(deg_to_rad(90))<<endl;
    double ans=sqrt(a*a + b*b - 2*a*b*cos(deg_to_rad(30*h-5.5*m)));
    printf("%.10lf",ans);
    return 0;
}

Measured memory_bytes: 4140
#include <iostream>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;

int main(){
    int h,a;    cin >> h >> a;
    if(h%a){
        cout << h/a+1 << endl;
    }else{
        cout << h/a << endl;
    }
}


Measured memory_bytes: 256