akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main(int argc, char const *argv[])
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);

    int n;
    cin>>n;
    vector<int>num(n);
    int i;
    long count = 0;
    for(int i=0;i<n;i++){
        cin>>num[i];
    }
    for(i=1;i<n-1;i++){
        if(num[i]<num[i+1] && num[i]>num[i-1] || num[i]>num[i+1] && num[i]<num[i-1])
            count++;
    }
    cout<<count<<"\n";
    return 0;
}


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

int main() {
  int n,a,b,x,y;
  cin>>n>>a>>b;
  x=min(a,b);
  y=max(a,b);
  vector<int> num(n,0); 
  for(int i=1;i<=n;i++){
    for(int j=i+1;j<=n;j++){
      a=min(abs(j-i),abs(y-j)+abs(x-i)+1);
      num[a-1]++;
    }
  }
  for(int i=0;i<n-1;i++){
    cout<<num[i]<<endl;
  }
}

Measured memory_bytes: 256
a = int(input())
blue = []
count = []
for i in range(a):
    x = input()
    if x in blue:
        count[blue.index(x)] += 1
    else:
        blue.append(x)
        count.append(1)
b = int(input())
for i in range(b):
    x = input()
    if x in blue:
        count[blue.index(x)] -= 1
    else:
        blue.append(x)
        count.append(-1)

count.sort()
count.reverse()
if count[0] < 0:
    print("0")
else:
    print (count[0])

Measured memory_bytes: 3188
/////////////////////////////////////////Info/////////////////////////////////////////////////
//Problem:
//Date:
//Skill:
//Bug:
/////////////////////////////////////////Definations/////////////////////////////////////////////////
//循环控制
#define CLR(a) memset((a),0,sizeof(a))
#define F(i,a,b) for(int i=a;i<=int(b);++i)
#define F2(i,a,b) for(int i=a;i>=int(b);--i)
#define RE(i,n)  for(int i=0;i<int(n);i++)
#define RE2(i,n) for(int i=1;i<=int(n);i++)
//简化敲击
#define PII pair<int,int>
#define PLL pari<long long ,long long>
#define PB push_back
#define ENDL '\n'
#define x first
#define y second
using namespace std;
typedef long long ll;
const int inf = 0x3f3f3f3f;
const long long llinf = 0x3f3f3f3f3f3f3f3f;
////////////////////////////////////////Options//////////////////////////////////////////////////////
#define stdcpph
#define CPP_IO

#ifdef stdcpph
#include<bits/stdc++.h>
#else
#include<ctype.h>
#include<string.h>
#include<math.h>
#include<vector>
#include<map>
#include<algorithm>
#include<functional>
#ifdef CPP_IO
#include<iostream>
#include<iomanip>
#include<string>
#else
#include<stdio.h>
#endif
#endif
////////////////////////////////////////Basic Functions//////////////////////////////////////////////
template<typename INint> inline void IN(INint &x)
{
	x = 0; int f = 1; char c; cin.get(c);
	while (c<'0' || c>'9') { if (c == '-')f = -1; cin.get(c); }
	while (c >= '0'&&c <= '9') { x = x * 10 + c - '0'; cin.get(c); }
	x *= f;
}
template<typename INint> inline void OUT(INint x)
{
	if (x > 9)OUT(x / 10); cout.put(x % 10 + '0');
}
////////////////////////////////////////Added Functions//////////////////////////////////////////////
const int maxn = int(1e5+5);
int fa[maxn];
int ff(int x)
{
	return fa[x] == x ? x : fa[x] = ff(fa[x]);
}
void unite(int x, int y)
{
	x = ff(x), y = ff(y);
	fa[x] = y;
}
PII ps[maxn];
////////////////////////////////////////////Code/////////////////////////////////////////////////////
int main()
{
	//freopen("C:\\Users\\VULCAN\\Desktop\\data.in", "r", stdin);
	int T(1), times(0);
#ifdef CPP_IO// CPP_IO
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	//cin >> T;
#else
	//IN(T);
#endif 
	/////////////////////////////////////////////////////////////////////////////////////////////////
	while (++times, T--)
	{
		int n, m; cin >> n >> m;
		RE2(i, n)fa[i] = i;
		RE2(i, m)
		{
			int x, y, z; cin >> x >> y >> z;
			ps[i].x = x; ps[i].y = y;
		}
		RE2(i, m)
		{
			unite(ps[i].x, ps[i].y);
		}
		set<int>S;
		RE2(i, n)S.insert(ff(i));
		cout << S.size() << ENDL;


	}
	///////////////////////////////////////////////////////////////////////////////////////////////////
	return 0;
}

Measured memory_bytes: 6144
import bisect
n = int(input())
a = [int(i) for i in input().split()]
a.sort()
point = bisect.bisect_right(a, 0)
a_minus = a[:point]
a_plus = a[point:]
len_plus = len(a_plus)
if (len(a_minus) > 0) & (len(a_plus) > 0):
    ans = sum(a_plus) - sum(a_minus)
    print(ans)
    for i in range(len(a_plus)):
        if len_plus == 1:
            x = a_plus.pop(0)
            y = a_minus.pop(0)
            print(str(x) + " " + str(y))
        elif (i == 0):
            x = a_minus.pop(0)
            y = a_plus.pop(0)
            print(str(x) + " " + str(y))
        elif i == len_plus - 1:
            y = x - y
            x = a_plus.pop(0)
            print(str(x) + " " + str(y))
        else:
            x = x - y
            y = a_plus.pop(0)
            print(str(x) + " " + str(y))
    for j in range(len(a_minus)):
        x = x - y
        y = a_minus.pop(0)
        print(str(x) + ' ' + str(y))
elif len(a_plus) > 0:
    ans = sum(a_plus) - ((a[0]) * 2)
    print(ans)
    for i in range(len(a_plus) - 1):
        if i == 0:
            x = a_plus.pop(0)
            y = a_plus.pop(0)
            print(str(x) + " " + str(y))
        elif i == len_plus - 2:
            y = x - y
            x = a_plus.pop(0)
            print(str(x) + " " + str(y))
        else:
            x = x - y
            y = a_plus.pop(0)
            print(str(x) + " " + str(y))
elif len(a_minus) > 0:
    ans = (a_minus[-1] * 2) - sum(a_minus)
    print(ans)
    for i in range(len(a_minus) - 1):
        if i == 0:
            x = a_minus[-1]
            y = a_minus.pop(0)
            print(str(x) + " " + str(y))
        elif i == len_plus - 2:
            x = x - y
            y = a_minus.pop(0)
            print(str(x) + " " + str(y))
        else:
            x = x - y
            y = a_minus.pop(0)
            print(str(x) + " " + str(y))

Measured memory_bytes: 14580
#include<bits/stdc++.h>
#define pi 3.141592653897932384626
//freopen("in.txt","r",stdin);freopen("out.txt","w",stdout);
using namespace std;
char a[315][315];
int main()
{
    long n;
    cin>>n;
    fgets(a[0],INT_MAX,stdin);
    for(long i=0;i<n;i++)fgets(a[i],INT_MAX,stdin);
    long s=0;
    for(long x=0;x<n;++x){
        long flag=1;
        for(long i=0;i<n;++i){
            for(long j=0;j<n;++j){
                if(a[(x+i)%n][j]!=a[(j+x)%n][i])
                    {flag=0;}
            }
        }
        s+=flag;
    }
    printf("%ld\n",s*n);
    return 0;
}


Measured memory_bytes: 384
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
long long n,t,a[200050],sum;
int main(){
	sum=0;
	scanf("%lld%lld",&n,&t);
	for(int i=1;i<=n;i++) scanf("%lld",&a[i]);
	for(int i=1;i<=n;i++){
		if(i!=n){
			if(a[i]+t>a[i+1]) sum=sum+a[i+1]-a[i];
			else sum=sum+t;
		}
		else sum=sum+t;
	}
	printf("%lld\n",sum);
}

Measured memory_bytes: 1792
# 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;

int r;

int main(){
    cin >> r;
    cout << r * r << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
 
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("avx2,sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
 
using namespace __gnu_pbds; 
using namespace std;
 
#define ld long double
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define int long long
#define ull unsigned long long 
#define pii pair<int,int>
#define vii vector<int>
#define f first
#define s second
#define endl "\n"
#define all(container) container.begin(), container.end()
#define onlyunique(v) v.erase(unique(all(v)), v.end());
 
#define TRACE
#ifdef AYUSH
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cout << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 
template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <class T> ostream& operator << (ostream &os, const vector<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const unordered_set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const ordered_set<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T> ostream& operator << (ostream &os, const multiset<T> &v) { for (T i : v) os << i << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const pair<T, S> &v) { os << '{'<<v.first << ' ' << v.second << '}'; return os; }
template <class T, class S> ostream& operator << (ostream &os, const unordered_map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
template <class T, class S> ostream& operator << (ostream &os, const map<T, S> &v) { for (auto i : v) os << '(' << i.first << "=>" << i.second << ')' << ' '; return os; }
//order_of_key (k) : Number of items strictly smaller than k .
//find_by_order(k) : K-th element in a set (counting from zero)
 
int const mod = 1e9+7;
int const inf = 1e18;
 
int power(int x, int y, int mod = 2e18){ int ans = 1;x %= mod;while(y){if(y&1)ans = (x * ans) % mod;x = (x * x) % mod;y >>= 1;}return ans;}
int modinv(int a, int m){return power(a, m-2, m);}
const ld PI = 3.1415926535897932384626433832795;

void solve() {
    int n; cin >> n;
    if(n >= 30) {
        cout << "Yes\n";
    }
    else{
        cout << "No\n";
    }

}
signed main() {
    IOS
    int t = 1, T = 1;
    // cin>>t;
    while (t--) {
        // cout<<"Case #"<<T<<": ";
        solve();
        // ++T;
    }
    return 0;
}

Measured memory_bytes: 3632
#include <stdio.h>
#define N 20

int solve(int,int);
int A[20],n=0;

int main(){
  int q=0,m[200],i=0,j=0;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
      }
  scanf("%d",&q);
  for(j=0;j<q;j++){
    scanf("%d",&m[j]);
    if(solve(0,m[j])==1)
      printf("yes\n");
    else if(solve(0,m[j])==0)
      printf("no\n");
  }
  return 0;
}
int solve(int i,int m){
  int res;
  if(m==0)
    return 1;
  if(i>=n)
    return 0;
  res = solve(i+1,m)||solve(i+1,m-A[i]);
    return res;
}
  
     



Measured memory_bytes: 2604
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define all(obj) (obj).begin(),(obj).end()
#define debug(x) cerr << #x << ": " << endl
#define rep(i,n) for(int i=0; (i)<(n); ++(i))
#define rrep(i,n) for(int i=(n); (i)>=0; --(i))
#define reps(i,s,n) for(int i=(s); (i)<(n); ++(i))
#define maxi(v) distance(v.begin(), max_element(v.begin(), v.end()))
#define mini(v) distance(v.begin(), min_element(v.begin(), v.end()))
#define maxemt(v) *max_element(v.begin(), v.end())
#define minemt(v) *min_element(v.begin(), v.end())
#define lb(v,x) v[lower_bound(v.begin(), v.end(), x) - v.begin()]
#define ub(v,x) v[upper_bound(v.begin(), v.end(), x) - v.begin()]
template<class T> inline bool print(T& x){ cout << x << endl; return true; }
template<class T> inline bool print_(T& x){ cout << x << " "; return true; }
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; }
ll gcd(ll x, ll y){
  if(y==0) return x;
  else return gcd(y, x%y);
  }
ll lcm(ll x, ll y){
  return x / gcd(x,y) * y;
}
const int INF = 1e9;
const ll llINF = 1LL<<60;
const int MOD = 1e9+7;
const double EPS = 1e-9;
int main(){
  int a, b; cin >> a >> b;
  //vector<int> a(n); rep(i,n) cin >> a[i];
  if(a<b) rep(i,b) cout << a;
  else rep(i,a) cout << b;
  
return 0;
}


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

int main() {
  LL n, q;
  string s;
  cin >> n >> q >> s;
  vector<LL> a(n, 0);
  for (int i = 1; i < s.size(); i ++) {
    if (s[i] == 'C' && s[i-1] == 'A') a[i] = a[i-1] + 1;
    else a[i] = a[i-1];
  }

  int l, r;
  for (int i = 0; i < q; i ++) {
    cin >> l >> r;
    l --, r --;
    cout << a[r] - a[l] << endl;
  }
}

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


using namespace std;

#define ll long long

#define max(a,b) ((a>b)?a:b)


int main()
{
    int n,w;

    cin>>n>>w;

    int cost,val;

    vector<ll> dp(w+1,0);


    for(int i=0;i<n;i++)
    {       
        cin>>cost>>val;

        for(int cost_i=w;cost_i>=cost;cost_i--)
            dp[cost_i]=max(dp[cost_i],dp[cost_i-cost]+val);


    }



    cout<<*max_element(dp.begin(),dp.end());

}

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

int main(){
  string s;
  int k;
  int one_count = 0;
  cin >> s;
  cin >> k;
  char output;
  for(int i = 0;i < s.size();i++){
    if(s.at(i) == '1')
      one_count++;
    else
      break;
  }

  if(one_count == 0)
    output = s.at(0);

  if(one_count < k)
    output = s.at(one_count);
  else
    output = '1';

  cout << output << endl;
  return 0;
}



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

int N, H;
const int MAX_N = 1.0e5 + 100;
int a[MAX_N], b[MAX_N]; 

int main() {
    cin >> N >> H;
    for (int i = 0; i < N; i++) cin >> a[i] >> b[i];

    sort(a, a+N, greater<>());
    sort(b, b+N, greater<>());

    int ans = 0;
    int slash = a[0];
    for (int i = 0; i < N; i++) {
        if (slash < b[i]) {
            ans++;
            H -= b[i];
        }

        if (H <= 0) break;
    }
    
    if (H > 0) {
        ans += (H / slash);
        if (H % slash != 0) ans++;
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define all(v) ((v).begin()), ((v).end())
#define INF 1e9
#define EPS 1e-9
#define bitcount __builtin_popcount
#define sz(v) ((int)((v).size()))
#define clr(v, d) memset(v, d, sizeof(v))
#define rep(i, v) for (int i = 0; i < sz(v); ++i)
#define lp(i, n) for (int i = 0; i < (int)(n); ++i)
#define LSOne(S) (S & (-S))
#define PI acos(-1.0)
#define P(x) cout << #x << " = { " << x << " }\n"
#define tests()  \
    int tttt;    \
    cin >> tttt; \
    while (tttt--)
#define fast_IO                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define file_IO                       \
    freopen("input.txt", "r", stdin); \
    freopen("output.txt", "w", stdout)
typedef long long ll;
int dcmp(long double x, long double y)
{
    return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1;
}
const int MAX = 3001;
const int MOD = 1e9 + 7;
int n, m;
double memo[MAX][MAX];
bool vis[MAX][MAX];
void read();
void solve();
void clear();
double dp(int i, int j);
double arr[MAX];
int main()
{
#ifndef ONLINE_JUDGE
    file_IO;
#else
    fast_IO;
#endif

    solve();
}
void read()
{
    cin >> n;
    lp(i, n)
    {
        cin >> arr[i];
    }
}

void solve()
{
    read();
    double p = dp(0, 0);
    cout << setprecision(10) << fixed;
    cout << p << '\n';
}
double dp(int i, int j)
{
    if (i == n)
        return (2 * j >= n ? 1.0 : 0.0);
    double &ret = memo[i][j];
    if (vis[i][j])
        return ret;
    vis[i][j] = 1;
    double path = 0.0;
    double path2 = 0.0;
    path = arr[i] * dp(i + 1, j + 1);
    path2 = (1.0 - arr[i]) * dp(i + 1, j);
    return ret = path + path2;
}

Measured memory_bytes: 58916
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define debug(a) cout << #a << ": " << a << endl
#define sz(a) int(a.size())
#define rep(i,n) for(int i=0;i<n;i++)
#define forr(i, st, en) for(int i = st; i < en; i++)
#define all(v) (v).begin(),(v).end()
#define fast cin.tie(0); ios::sync_with_stdio(false)

int32_t main(){ fast;
	//assets vs liabilities
	//keeping cash = risk of losing money to inflation
	//financial freedom
	int k, n; cin>>n>>k;
	vector<int> a(n);
	rep(i, n){
		cin>>a[i];
	}
	sort(all(a), greater<int>());
	int answer = 0;
	rep(i, k){
		answer += a[i];
	}
	cout<<answer<<endl;
}


Measured memory_bytes: 256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip> // fixed, setprecision 
#include <math.h> // double sqrt
using namespace std;

int main(){
    int N;
    cin>>N;
    int x=N;
    string S;
    cin>>S;
    for(int i=0;i<N-1;i++){
        if(S[i]==S[i+1])x--;
    }
cout<<x;
return 0;
}

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

void print(auto x) {
    cout << x << endl;
}

ll sum(auto x) {
    return accumulate(x.begin(), x.end(), 0LL);
}

int main() {
    int N;
    cin >> N;
    vector<pair<int, int>> A;
    for (int i = 1; i <= N; i++) {
        int x;
        cin >> x;
        A.push_back(make_pair(x, i));
    }
    sort(A.begin(), A.end());
    cout << A[0].second;
    for (int i = 1; i < N; i++) {
        cout << " " << A[i].second;
    }
    cout << endl;
}


Measured memory_bytes: 1780
#include <stdio.h>

int main(void)
{
	int N;

	scanf("%d", &N);

	if ( (N/100 == 7) || ((N-(N/100)*100)/10 == 7) || ((N-(N/10)*10) == 7) ) {
		printf("Yes\n");
	} else {
		printf("No\n");
	}

	return 0;
}

Measured memory_bytes: 1660
#include <bits/stdc++.h>
using namespace std;
int main(){
	int a,b,c,d,e,f,sum=0;
	cin>>a>>b>>c>>d>>e>>f;
	sum+=a+b*5+c*10+d*50+e*100+f*500;
	if(sum>=1000)cout<<1<<endl;
	else cout<<0<<endl;
}

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

int main()
{
    int H, N;
    cin >> H >> N;
    int A;
    int sum = 0;
    for (int i = 0; i < N; i++) {
        cin >> A;
        sum += A;
    }

    if (sum >= H) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3660
//https://atcoder.jp/contests/abc170/tasks/abc170_b
#include <bits/stdc++.h>
using namespace std;

int x, y;

int main() {
    cin >> x >> y;

    int OK = 0;
    for (int i = 0 ;i <= x; i++) {
        int leg = i*2 + (x-i)*4;
        if (leg == y) OK = 1 ;
    }
    cout << (OK?"Yes":"No") << endl;
    return 0;
}

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

int main(){
	int x[100] = {};
	int n;

	cin >> n;

	rep(i,n){
		cin >> x[i];
	}

	rep(i,n){
		if(i != 0) cout << " ";
		cout << x[n-1-i];
	}
	cout << endl;
}

Measured memory_bytes: 1160
using System;

namespace ABC081
{
    class Program
    {
        static void Main(string[] args)
        {
            //B
            // 入力
            // 1 <= N <= 200, 1 <= Ai <= 10^9
            var N = int.Parse(Console.ReadLine());
            var Ai = Console.ReadLine().Split(' ');

            // 出力
          	Console.WriteLine(B_ShiftOnly.BreakInOnTwo(N, Ai));
        }
    }
  	public class B_ShiftOnly
    {
        public static int BreakInOnTwo(int n, string[] ai)
        {
            var cnt = 0;
            // 割り算ができるか
            var isEven = true;
            var aiNum = new int[201];

            for (int i = 0; i < n; i++)
            {
                aiNum[i] = int.Parse(ai[i]);
            }

            while (true)
            {
                for (int i = 0; i < n; i++)
                {
                    if (aiNum[i] % 2 != 0) isEven = false;
                }

                if (!isEven) break;

                for (int i = 0; i < n; i++)
                {
                    aiNum[i] = aiNum[i] / 2;
                }
                cnt++;
            }
            return cnt;
        }
    }
}


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

main()
{
    char s[4];
    scanf("%s",s);
    bool flag=0;
    if(s[0]==s[1] && s[1]==s[2])flag=1;
    if(s[1]==s[2] && s[2]==s[3])flag=1;
    puts(flag ? "Yes" : "No");
    return 0;
}



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

int main() {
  string N;
  cin >> N;
  size_t size = N.length();
  int s = size, count = 0;
  for (int i = 0; i<s; i++){
    count += N[i] - '0';
  }
  if(count%9 == 0) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


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

int main() {
	string s,t;
	cin>>s>>t;
	int l=s.size(),ans=1;
	rep(i,l){
	    if(s[i]!=t[i])ans=0;
	}
	if(ans)cout<<"Yes";
	else cout<<"No";
	return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
int main(void){
   int sx,sy,tx,ty;
   cin >> sx >> sy >> tx >> ty;
   int difx = tx - sx, dify = ty - sy;
   cout << string(difx,'R') << string(dify,'U'); 
   cout << string(difx,'L') << string(dify,'D');
   cout << 'D' << string(difx+1,'R') << string(dify+1,'U') << 'L';
   cout << 'U' << string(difx+1,'L') << string(dify+1,'D') << 'R';
   cout << endl;
}

Measured memory_bytes: 3532
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>

using namespace std;

// conversion
//------------------------------------------
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }

// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c)                                                             \
  for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

// repetition
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)

// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);

// clear memory
#define CLR(a) memset((a), 0, sizeof(a))

// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                                               \
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"                       \
       << " " << __FILE__ << endl;

void solve(std::string S) {
  if(S=="Sunny")cout<<"Cloudy"<<endl;
  if(S=="Cloudy")cout<<"Rainy"<<endl;
  if(S=="Rainy")cout<<"Sunny"<<endl;
  return;
}

int main() {
  std::string S;
  std::cin >> S;
  solve(S);
  return 0;
}


Measured memory_bytes: 256
n = int(input())
h = list(map(int,input().split()))

i = 0
cnt = 0
while 1:
    if i == n:
        print(cnt)
        exit()

    if h[i]==0:
        i+=1
        continue
    j = i
    
    while 1:
        if j==n:
            j-=1
            break
        elif h[j]>=1:
            j+=1
        else:
            j-=1
            break


    cnt += 1
    

    for k in range(i,j+1):
        h[k] -= 1





Measured memory_bytes: 40176
#include<stdio.h>
#include<stdlib.h>

int main(){
	int n, k, c;
	char *s;

	scanf("%d %d %d", &n, &k, &c);
	s = (char *)malloc(sizeof(char)*(n+1));
	scanf("%s", s);

	int *l, *r;
	l = (int *)malloc(sizeof(int)*n);
	r = (int *)malloc(sizeof(int)*n);

	int x = 0, d = 1;
	while(d <= n){
		if(s[d-1] == 'o'){
			l[x] = d;
			d += (c + 1);
			x++;
			if(x > k-1){
				break;
			}
		}else{
			d++;
		}
	}

	x = k-1; d = n;
	while(d > 0){
		if(s[d-1] == 'o'){
			r[x] = d;
			d -= (c + 1);
			x--;
			if(x < 0){
				break;
			}
		}else{
			d--;
		}
	}

	int i;
	for(i=0; i<k; i++){
		if(l[i] == r[i]){
			printf("%d\n", l[i]);
		}
	}
	return 0;
}


Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

int main() {
  int n; cin >> n;
  vector<int> d(n);
  rep(i, n) cin >> d[i];

  int ans = 0;
  for (int i = 0; i < n; i ++) {
    for (int j = i + 1; j < n; j ++) {
      ans += d[i] * d[j];
    }
  }

  cout << ans << endl;
}

Measured memory_bytes: 256
import Control.Applicative ((<$>), (<*>))
import Control.Monad
import Data.List

main :: IO ()
main = do
  solve <$> getl (wrds toInt) >>= putStrLn

solve :: [Int] -> String
solve [1,1,0] = "Open"
solve [0,0,1] = "Open"
solve _ = "Close"

toInt :: String -> Int
toInt = read

wrds :: (String -> a) -> String -> [a]
wrds f = map f . words

getl :: (String -> a) -> IO a
getl f = f <$> getLine

Measured memory_bytes: 3584
N = int(input())
a = N - ((N//10)*10)
if a == 2 or a == 4 or a == 5 or a == 7 or a== 9:
  print("hon")
elif a == 0 or a == 1 or a == 6 or a == 8:
  print("pon")
else:
  print("bon")

Measured memory_bytes: 9176
#include<bits/stdc++.h>
#pragma GCC optimize ("-O3")
    using namespace std;
    #define ll long long
    #define ld long double
    #define vll vector<ll>
    #define mll map<ll,ll>
    #define pll pair<ll,ll>
    #define ff first
    #define ss second
    #define pb push_back
    #define deb(x) cout<<#x<<" : "<<x<<endl;
    #define deb2(x,y) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<endl;
    #define deb3(x,y,z) cout<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<endl;
    #define deb4(w,x,y,z) cout<<#w<<" : "<<w<<"\t"<<#x<<" : "<<x<<"\t"<<#y<<" : "<<y<<"\t"<<#z<<" : "<<z<<endl;
    #define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    #define printv(a)  for(ll i=0;i<a.size();i++)  cout<<a[i]<<" ";
   
   
    const int mod=998244353.;
    const int N=1e6+5; 
   
    bool sortbysec(const pair<pair<ll,ll>,ll> &a, 
                      const pair<pair<ll,ll>,ll> &b) 
        { 
            return (a.second > b.second); 
        } 
        ll powermod(ll x, ll y, ll p)
        {
            ll res = 1;
            x = x % p;
            while (y > 0)
            {
                if (y & 1) res = (res*x) % p;
                y = y>>1;
                x = (x*x) % p;
            }
            return res;
        }
       
        bool isprime(int n) 
        { 
            if (n <= 1)  return false; 
            if (n <= 3)  return true; 
            if (n%2 == 0 || n%3 == 0) return false; 
            for (int i=5; i*i<=n; i=i+6) 
                if (n%i == 0 || n%(i+2) == 0) 
                   return false; 
           return true; 
        }
       
       
        int main()
    {
        FAST;
        ll n,W;
        cin>>n>>W;
        vll wt(n),val(n);
        for(ll i=0;i<n;i++)
        {
            cin>>wt[i]>>val[i];
        }
       ll sum_value=0;
       for(ll i=0;i<n;i++)
       sum_value+=val[i];
       ll inf=1e18+5;
       vll dp(sum_value+1,inf);
       dp[0]=0;
       for(ll i=0;i<n;i++)
       {
            for(ll value_already=sum_value-val[i];value_already>=0;value_already--)
            {
                dp[value_already+val[i]]=min(dp[value_already+val[i]],dp[value_already]+wt[i]);
            }
       }
       ll ans=0;
       for(ll i=0;i<=sum_value;i++)
       { //  deb(dp[i]);
           if(dp[i]<=W)
           ans=max(ans,i);
       }
       cout<<ans;
       
        return 0;
    }

Measured memory_bytes: 1024
#include<stdio.h>

int main()
{
	int n;
	scanf("%d", &n);

	if (n % 10 == 2 || n % 10 == 4 || n % 10 == 5 || n % 10 == 7 || n % 10 == 9) {
		printf("hon");
	}
	else if (n % 10 == 0 || n % 10 == 1 || n % 10 == 6 || n % 10 == 8) {
		printf("pon");
	}
	else {
		printf("bon");
	}
	return 0;
}

Measured memory_bytes: 1728
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
#include <map>
#include <math.h>

using namespace std;
#include <vector>
#define rep(i,n) for (ll i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define base10_4 10000      //1e4
#define base10_5 100000     //1e5
#define base10_6 1000000    //1e6
#define base10_7 10000000   //1e7
#define base10_8 100000000  //1e8
#define base10_9 1000000000 //1e9

#define MOD 1000000007
#define pb push_back
#define ll long long
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 

ll A;
ll B;
ll C;
ll N;
ll M;
ll K;

ll ltmp;
string stmp;
double dtmp;

int main(){

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

    cin >> A;
    cin >> B;
    if(A*500>=B) cout << "Yes" << endl;
    else cout << "No" << endl;

}

Measured memory_bytes: 3540
#include <bits/stdc++.h>
#include <time.h>
using namespace std;
typedef long long ll;
typedef long double ld;
const ll MOD = 1e9 + 7/*998244353*/;
const ll INF = 1LL << 60;
ll mod_pow(ll, ll, ll); ll mod_fact(ll, ll); ll mod_inv(ll, ll); ll gcd(ll, ll); ll lcm(ll, ll);
//
int main(){
    int j[4] = {};
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        string s;
        cin >> s;
        if(s == "AC") j[0]++;
        else if(s == "WA") j[1]++;
        else if(s == "TLE") j[2]++;
        else j[3]++;
    }
    {
        cout << "AC x " << j[0] <<"\n";
        cout << "WA x " << j[1] << "\n";
        cout << "TLE x " << j[2] << "\n";
        cout << "RE x " << j[3] << "\n";
    }
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repf(i,a,b) for (int i = (a); i < (b); i++)
#define repi(i,a,b) for (int i = (a); i <= (b); i++)
#define repr(i,a,b) for (int i = (a); i >= (b); i--)
#define all(x) (x).begin(),(x).end()
#define debug(x)  cout << #x << " = " << (x) << endl;
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using tiii = tuple<int, int, int>;

int main() {
  string s; cin >> s;
  
  string sbet = s.substr(1,s.size()-2);
  cout << s.at(0) << sbet.size() << s.at(s.size()-1) << endl;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;


vector<vector<int>>edge_compress(const vector<vector<int>>&edges) {
	return vector<vector<int>>();
}

int main() {

	string st;cin>>st;
	map<char,char>rev;
	rev['(']=')';
	rev['w']='w';
	rev[')']='(';
	rev['i']='i';
	int ans=0;
	for (int i = 0; i < st.size() / 2; ++i) {
		char l=st[i];
		char r=st[st.size()-1-i];
		if(rev[l]!=r)ans++;
	}
	if (st.size() % 2) {
		if (st[st.size() / 2] == '(' || st[st.size() / 2] == ')') {
			ans++;
		}
	}
	cout<<ans<<endl;

	return 0;
} 

Measured memory_bytes: 3212
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<unordered_map>
#include<bitset>
#include<complex>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

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

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD =  (int)1e9 + 7;
const double EPS = 1e-9;

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

	int H, W;
	cin >> H >> W;
	if (H == 1 || W == 1)
	{
		cout << 1 << endl;
	}
	else
	{
		cout << ((H*W + 1) / 2) << endl;
	}

	return 0;
}

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

int main(){
  string T;
  cin >>T;
  int sum=0;
  for(int i=0;i<T.size();i++){
   if(T.at(i)=='?'){
     T.at(i)='D';
   }
  }
  cout<<T<<endl;
}


Measured memory_bytes: 3752
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#include <set>
#include <fstream>
#include <chrono>
#include <random>
#include <bitset>
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define sz(x) ((int)(x).size())
#define pb push_back
#define mod 1000000007
using ll = long long;
using namespace std;
ll gcd(ll a, ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) {return a/gcd(a,b)*b;}

int main(){
  ll H; cin >> H;
  ll en = 1;
  ll ans = 0;
  while(1){
    ans += en;
    H /= 2;
    en *= 2;
    if(H==0) break;
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
  int a1, a2, a3, sum;
  cin >> a1 >> a2 >> a3;
  
  sum = a1 + a2 + a3;
  
  if(sum >= 22) cout << "bust" << endl;
  else cout << "win" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repi(i, s, n) for (int i = (s); i < (n); i++)
#ifdef LOCAL
#define INPUT_FILE                   \
  ifstream in("m_solutions2020/m_solutions2020_a.txt"); \
  cin.rdbuf(in.rdbuf());
#define print_vec(v) \
rep(l, v.size()) { cout << v[l] << " "; } \
cout << endl;
#else
#define INPUT_FILE
#define print_vec(v)
#endif
#define CIN_OPTIMIZE \
  cin.tie(0);        \
  ios::sync_with_stdio(false);
typedef pair<int, int> P;
typedef long long ll;
typedef pair<ll, ll> pl;
const int INF = 100100100;
const ll LINF = 1e18+100;
const int MOD = 1e9 + 7;

int main() {
  INPUT_FILE CIN_OPTIMIZE;

  int N;
  cin >> N;

  ll ans = 0;
  if (N >= 1800) {
    ans = 1;
  } else if (N >= 1600) {
    ans = 2;
  } else if (N >= 1400) {
    ans = 3;
  } else if (N >= 1200) {
    ans = 4;
  } else if (N >= 1000) {
    ans = 5;
  } else if (N >= 800) {
    ans = 6;
  } else if (N >= 600) {
    ans = 7;
  } else if (N >= 400) {
    ans = 8;
  }

  cout << ans << endl;
}

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

int main(){
    int N;
    cin >> N;
    vector<int> H(N);
    for(int i=0;i<N;++i) cin >> H[i];
    int tmp=H[0]-1;
    for(int i=1;i<N;++i){
        if(H[i]<tmp) {
            cout << "No" << endl;
            return 0;
        }
        else if(H[i]==tmp);
        else tmp = H[i]-1;
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double db;
#define pb push_back
#define fr(i,n) for(int i=0;i<n;i++)
#define Fr(i,n) for(int i=0;i++<n;)
#define ifr(i,n) for(int i=n-1;i>=0;i--)
#define iFr(i,n) for(int i=n;i>0;i--)

int main(){
  int n,a[100010],ans=0;
  cin>>n;
  Fr(i,n) cin>>a[i];
  Fr(i,n) if(a[a[i]]==i) ans++;
  cout<<ans/2<<endl;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
int main() {
  int X, Y, Z;
  cin >> X >> Y >> Z;
  cout << Z << ' ' << X << ' ' << Y << endl;
  return 0;
}


Measured memory_bytes: 256
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

//conversion
//------------------------------------------
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1000000007;

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

int main(int argc, char const* argv[])
{
	int d,n;
	cin >> d >> n;
	if (n == 100) {
		cout << int(pow(100,d)) * 101 << endl;
	}
	else {
		cout << int(pow(100,d)) * n << endl;
	}
	return 0;
}


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

int main(){
    string S,T;
    cin>>S;
    cin>>T;
    int cnt0=0,cnt1=0;
    for(int i=0;i<S.size();i++){
        int cnt=0;
        char tmp=S[0];
       for(int j=0;j<S.size()-1;j++){
           S[j]=S[j+1];
       }
       S[S.size()-1]=tmp;
       for(int j=0;j<S.size();j++){
           if(S[j]==T[j]){
               cnt++;
           }
       }
       if(cnt==S.size()){
           cout<<"Yes"<<endl;
           return 0;
       }
    }
    cout<<"No"<<endl;
    return 0;
   
  
}

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

#define fi first
#define se second
#define pb push_back
#define ii pair<int, int>
#define mp make_pair
#define iii pair< int, pair<int, ii> >
#define ll long long
#define FOR(a, b, c) for(int a = b; a <= c; ++a)
const int N = 5*1e5 + 10;
const int oo = 1e6;
const ll mod = 998244353;
const double PI = acos(-1);
ll n,A, B,k;
ll fac[N], facw[N];
ll powe(ll x, ll y)
{
    if(y ==0) return 1ll;
    ll mid = powe(x, y/2);
    if(y%2) return mid * mid % mod * x % mod;
    else return mid*mid%mod;
}
ll getC(int k, int n){
    if(k > n) return 0ll;
    ll res = fac[n];
    res = (res * (facw[k]*facw[n - k] % mod) % mod);
    return res;
}
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);  cout.tie(0);
    cin >> n >> A >> B >> k;
    ll sum = 0ll;
    fac[0] = 1; for(int i = 1; i <= 3*100000; ++i) fac[i] = (fac[i - 1]*i) % mod;
    facw[0] = 1;    for(int i = 1; i <= 3*100000; ++i) facw[i] = powe(fac[i], mod - 2);
    for(int i = 0; i <= n; ++i)
        if(k >= A*i && (k - A*i) % B == 0){
            int j = (k - A*i)/B;
            sum += (getC(i, n) * getC(j, n) % mod);
            sum %= mod;
        }
    cout << sum;
}


Measured memory_bytes: 6656
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


const char moji[52] ={'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','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'};
  
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);

  int n;
  cin >> n;
  string s;
  cin >> s;
  rep(i,s.size()){
    rep(j,52){
      if(s[i]==moji[j]){
	cout << moji[j+n];
	break;
      }
    }
  }
  cout << "" << endl;
  
  return 0;
    

}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		String s = sc.next();
		char[] c = s.toCharArray();
		int ans = 753;
		for (int i = 0; i < c.length - 2; i++) {
			int x = (c[i] - '0') * 100 + (c[i + 1] - '0') * 10 + (c[i + 2] - '0');
			ans = Math.min(ans, Math.abs(753 - x));
		}
		System.out.println(ans);
		sc.close();
	}
}

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

typedef long long int lli;
#define int lli
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vi> vvi;
typedef vector<lli> vli;
typedef vector<pii> vii;

const int MOD   = 1e9 + 7;
const double PI = acos(-1.0);
const int xd[4] = {1, 0, -1, 0}, yd[4] = {0, 1, 0, -1};
const int INF   = 1e18;

#define fastio            ios_base::sync_with_stdio(false);cin.tie(0)
#define sz(a) int((a).size())
#define rsz resize
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
#define f first
#define s second
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define rep(i, n)    for(int i = 0; i < (n); ++i)
#define repA(i, a, n)  for(int i = a; i <= (n); ++i)
#define repD(i, a, n)  for(int i = a; i >= (n); --i)
#define endl "\n"
#define spc " "
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template <typename T> T lcm(T a, T b){return (a*b)/gcd(a,b); }

void solve(){

    int n;
    cin >> n;
    
    vb d(n, false);
    rep(i, n){
        int x, y;
        cin >> x >> y;
        if(x == y) d[i] = true;
    }

    bool ans = false;
    rep(i, n - 2){
        if(d[i] && d[i + 1] && d[i + 2]) ans = true;

    }

    cout << (ans ? "Yes" : "No") << endl;
}

signed main(){
    fastio;

    solve();

    return 0;
}


Measured memory_bytes: 3652
#include<iostream>
#include<cstdio>
#include<iomanip>
#define rep(i,n) for(int i=0; i<(n); i++)
using namespace std;
typedef long long ll;

int main(){
    int N;
    cin >> N;
    if(N%2==0){
        cout << "0.50000000000" << endl;
    }else{
        int tmp=(N+1)/2;
        double ans = (double)tmp/N;
        cout << setprecision(10) << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
// abc129_a
#include <bits/stdc++.h>
using namespace std;
int main(void){
  int P, Q, R;
  cin >> P >> Q >> R;
  int max = P;
  if(max <= Q){
		max = Q;
	}
	if(max <= R){
		max = R;
	}
	
  cout << P + Q + R - max << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define F first
#define S second
#define f real()
#define s imag()
using namespace std;
typedef complex<double> P;
typedef pair<P,P> L;
const double EPS = 1e-10;

double dot(P a, P b){ return real(conj(a)*b); }

double cross(P a, P b){ return imag(conj(a)*b); }

P crossPoint(L l, L m){
  double A = cross(l.second - l.first, m.second - m.first);
  double B = cross(l.second - l.first, l.second - m.first);
  if(fabs(A) < EPS && fabs(B) < EPS) return m.first;
  else if(fabs(A) >= EPS) return m.first + B / A * (m.second - m.first);
}

int n,x,y,x2,y2;
vector<L> lines;


int main(){
  while(1){
    cin>>n;
    if(!n)break;
    for(int i=0;i<n;i++){
      cin>>x>>y>>x2>>y2;
      lines.push_back(L(P(x,y),P(x2,y2)));
    }
    int ans=2;
    for(int i=1;i<n;i++){
      vector<P> points;
      for(int j=0;j<i;j++){
	double XA=lines[i].S.f-lines[i].F.f,YA=lines[i].S.s-lines[i].F.s;
	double XB=lines[j].S.f-lines[j].F.f,YB=lines[j].S.s-lines[j].F.s;
	if(!XA&&!XB)continue;
	if(XA&&XB&&abs(YA/XA-YB/XB)<EPS)continue;
	P r=crossPoint(lines[i],lines[j]);
	if(!(-100<r.real()-EPS&&r.real()+EPS<100))continue;
	if(!(-100<r.imag()-EPS&&r.imag()+EPS<100))continue;
	points.push_back(r);
      }
      int cnt=1;
      for(int j=0;j<points.size();j++){
	int flag=0;
	for(int k=0;k<j;k++)
	  if(abs(points[j]-points[k])<EPS)flag=1;
	if(!flag)cnt++;
      }
      ans+=cnt;
    }
    cout<<ans<<endl;
    lines.clear();
  }
  return 0;
}

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

int main(){
    long long a;
    string b;
    cin >> a >> b;
    int n = b.size();
    long long c = (long long) (b[n-1]-'0') + 
        (long long) ((b[n-2]-'0')*10) + 
        (long long) ((b[n-4]-'0')*100);
    cout << (a*c)/100 << endl;
    return 0;
} 


Measured memory_bytes: 3628