akhauriyash/Code-Regression huggingface dataset:
/* template.cpp [[[ */
#include <bits/stdc++.h>
using namespace std;
#define get_macro(a, b, c, d, name, ...) name
#define rep(...) get_macro(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rrep(...) get_macro(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define rep1(n) rep2(i_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, b) rep4(i, a, b, 1)
#define rep4(i, a, b, s) for (ll i = (a); i < (ll)(b); i += (ll)s)
#define rrep1(n) rrep2(i_, n)
#define rrep2(i, n) rrep3(i, 0, n)
#define rrep3(i, a, b) rrep4(i, a, b, 1)
#define rrep4(i, a, b, s) for (ll i = (ll)(b) - 1; i >= (ll)(a); i -= (ll)s)
#define each(x, c) for (auto &&x : c)
#define fs first
#define sc second
#define all(c) begin(c), end(c)
using ui = unsigned;
using ll = long long;
using ul = unsigned long long;
using ld = long double;
const int inf = 1e9 + 10;
const ll inf_ll = 1e18 + 10;
const ll mod = 1e9 + 7;
const ll mod9 = 1e9 + 9;
const int dx[]{-1, 0, 1, 0, -1, 1, 1, -1};
const int dy[]{0, -1, 0, 1, -1, -1, 1, 1};
template<class T, class U> void chmin(T &x, const U &y){ x = min<T>(x, y); }
template<class T, class U> void chmax(T &x, const U &y){ x = max<T>(x, y); }
struct prepare_ { prepare_(){ cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(12); } } prepare__;
/* ]]] */

int main(){
  string s;
  cin >> s;
  int n = s.size();
  int a = -1, b = -1;
  rep(i, n - 1){
    if (s[i] == s[i + 1]){
      a = i + 1;
      b = i + 2;
    }
  }
  rep(i, n - 2){
    if (s[i] == s[i + 2]){
      a = i + 1;
      b = i + 3;
    }
  }
  cout << a << " " << b << endl;
}



Measured memory_bytes: 512
a,b,k=map(int,input().split())
A=[i for i in range(a, min((a+k),b))]
B=[i for i in range(max((b-k),a)+1,b+1)]
ans=list(set(A)|set(B))
ans.sort()
if a==b:
    print(a)
else:
    for i in range(len(ans)):
        print(ans[i])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i=0; (i)<(n); ++(i))
#define rep1(i,n) for(int i=1; (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()))
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 long llINF = 1LL<<60;
const int INF = 1e9;

int main(){
    int n; cin >> n;
    vector<int> v(n); rep(i,n) cin >> v[i];
    int cnt=0;
    rep1(i,n-1){
      if(v[i]>v[i-1]&&v[i]>v[i+1]){}
      else if(v[i]<=v[i-1]&&v[i]<=v[i+1]){}
      else cnt++;
    }
    cout << cnt;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <numeric>
#include <algorithm>
#include <cstring>
#include <map>
#include <set>
#include <cmath>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define INF 1145141919
typedef long long int ll;
using namespace std;

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

ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

int main()
{
    string S;
    int w;

    cin >> S >> w;

    for(int i=0; i<S.size(); i=i+w){
        cout << S[i];
    }
    cout << endl;
    return 0;
}

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

#define ll long long
#define endl "\n"

void solve() {
  ll d, t, s;
  cin >> d >> t >> s;
  if (d <= t * s) {
    cout << "Yes\n";
    return;
  }
  cout << "No\n";
}

int main() {
  ll t;
  // cin >> t;
  t = 1;
  while (t--)
    solve();
  return 0;
}

Measured memory_bytes: 3640
/*
    Life Before Death, Strength Before Weakness, Journey Before Destination
    ------------------------------------------------------------------------
    You don't become great by trying to be great.
    You become great by wanting to do something,
    and then doing it so hard that you become great in the process.
    */

    //#pragma comment(linker, "/stack:200000000")
    #pragma GCC optimize ("Ofast")
    #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
    #include <bits/stdc++.h>
    using namespace std;
    
    #define TRACE
    
    #ifdef TRACE
    #define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
    template <typename Arg1>
    void __f(const char* name, Arg1&& arg1){
      cerr << name << " : " << arg1 << std::endl;
    }
    template <typename Arg1, typename... Args>
    void __f(const char* names, Arg1&& arg1, Args&&... args){
      const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
    }
    #else
    #define trace(...)
    #endif
    
    #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 trav(a, x) for(auto& a : x)
    #define all(x) x.begin(), x.end()
    #define sz(x) (int)(x).size()
    #define fill(a)  memset(a, 0, sizeof (a))
    #define fst first
    #define snd second
    #define mp make_pair
    #define pb push_back
    //#define M_PI           3.1415926535  /* pi */
    typedef long double ld;
    typedef long long ll;
    typedef pair<int, int> pii;
    typedef vector<ll> vi;
    const int maxN = 100224;

    void solve(){
      ll n, m,x,y;
      cin >> n >> m ;
      if(n){
      n--;
      if(n%4 == 0) x = n;
      else if(n%4 == 1) x = 1;
      else if(n%4 == 2) x = n+1;
      else if(n%4 == 3) x = 0;
      } else x = 0;
      if(m){
      if(m%4 == 0) y = m;
      else if(m%4 == 1) y = 1;
      else if(m%4 == 2) y= m+1;
      else if(m%4 == 3) y= 0;
      } else y = 0;
      //cout<<n<<" "<<m<<endl;
      //cout<<x<<" "<<y<<endl;
      x = x^y;
      cout<<x<<endl;
    }
    
    int main() {
      cin.sync_with_stdio(0); cin.tie(0);
      cin.exceptions(cin.failbit);
      solve();
      return 0;
    }   

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

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl





using ll = long long;

const ll mod = 1e9+7;
const int maxn = 1e6 + 5;

template<typename T> struct bit1 {
    T add(T x, T y) {
	return x+y;
    }
    int n;
    vector<T> t;
    void init(int n) {
	this->n=n;
	t.resize(n+10);
    }
    T qry(int i) {
	T res=0;
	for (; i>0; i-=i&-i) res=add(res,t[i]);
	return res;
    }
    void upd(int i, T dx) {
	assert(i>=1 && i<=n);
	for (; i<=n; i+=i&-i) t[i]=add(t[i],dx);
    }
    T get(int i) {
	return qry(i)-qry(i-1);
    }
};

int n; //1e6
string s;


ll brute(int k) {
    ll res = 0;
    for (int a=1; a<=n; a++) {
	for (int b=a+1; b<=n; b++) {
	    for (int c=b+1; c<=n; c++) {
		if (c-a<k && s[a]=='D' && s[b]=='M' && s[c]=='C') {
		    res++;
		}
	    }
	}
    }
    return res;
}


ll solve(int k) {

    bit1<ll> bit;
    bit.init(n+10);
    ll res = 0;

    auto inc = [&](int i) {
	bit.upd(1,1);
	bit.upd(i+1,-1);
    };

    auto get = [&](int i) {
	return bit.qry(i);
    };


    deque<int> D;
    ll sum = 0;

    for (int i=1; i<=n; i++) {
	while (!D.empty() && i-D.front() >= k) {
	    sum -= get(D.front());
	    D.pop_front();
	}
	if (s[i]=='D') {
	    D.push_back(i);
	}
	if (s[i]=='M') {
	    inc(i);
	    sum += D.size();
	}
	if (s[i]=='C') {
	    res += sum;
	}
    }

    return res;
}

int q; //75
vector<int> k;

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

    cin>>n;
    cin>>s;
    s="*"+s;

    
    cin>>q;
    k.resize(q);
    for (int i=0; i<q; i++) {
	cin>>k[i];
    }

    for (int i: k) {
	//assert(solve(i) == brute(i));
	cout<<solve(i)<<"\n";
    }
    
    
    return 0;
}


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  __MAKE_TIME__  Problem: __PROBLEM__ / Link: __CONTEST_URL__  ----- */
/* ------問題------



-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */



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

	string s; cin >> s;
	LL ans = -4;
	FOR(i, 0, SZ(s)) {
		if (s[i] == '+')ans += 2;

	}
	cout<<ans<<endl;

	return 0;
}


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

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();}

typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> P;
typedef tuple<int,int,int> tpl;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(c) reverse((c).begin(),(c).end())
#define LB(a,x) lower_bound((a).begin(), (a).end(), x) - (a).begin()
#define UB(a,x) upper_bound((a).begin(), (a).end(), x) - (a).begin()

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RFOR(i,a,b) for(int i=(a)-1;i>=(b);--i)
#define RREP(i,n) RFOR(i,n,0)

#define en "\n"

const double EPS = 1e-9;
const double PI  = acos(-1.0);
const int INT_INF = 2147483647;
const long long LL_INF = 1LL<<60;
const long long MOD = 1000000007; // 998244353

#define CLR(a) memset((a), 0, sizeof(a))

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

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 dp[1<<21];
int a[21][21], N;

int bit(int S){
    REP(i,N) if(S & 1<<i) return i;
    return -1;
}

ll rec(int S, int n){
    if(dp[S] != -1) return dp[S];
    if(n == 1){
        int b = bit(S);
        return dp[S] = a[b][0];
    }

    ll res = 0;
    REP(i,N){
        if(!(S & 1<<i)) continue;
        if(a[i][n-1]) res = (res + rec(S ^ 1<<i, n-1))%MOD;
    }

    return dp[S] = res;
}

int main(void){
    cin >> N;
    REP(i,N)REP(j,N) cin >> a[i][j];
    REP(i,1<<N) dp[i] = -1;
    ll ans = rec((1<<N)-1, N);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 16640
n = int(input())
t = [1, 2, 3, 4, 5, 6, 7, 8, 9]
i = 0
count = 0
for i in t:
  if (n / t[i-1]) in t:
    print("Yes")
    count = 1
    break
if count == 0:
  print("No")


Measured memory_bytes: 2940
mod = (10**9)+7
def modpow(x, n):
  ans = 1
  mod = (10**9)+7
  while(n > 0):
    if(bin(n & 1) == bin(1)):
      ans = ans*x
      ans %= mod
    x = x*x
    x %= mod
    n = n >> 1 #ビットシフト
  return ans


def nCr(n,r):
    mod = (10**9)+7
    r = min(n,r)
    bunsi = bunbo = 1
    for i in range(1,r+1):
      bunsi = (bunsi * (n+1-i) )% mod
      bunbo = bunbo * i % mod
    ans = (bunsi * pow(bunbo,mod-2,mod)) % mod
    return ans

n,a,b = map(int,input().split())
print((modpow(2,n)- 1 - nCr(n,a) - nCr(n,b) )% mod)


Measured memory_bytes: 3064
n, m = map(int, input().split())
ipy = []

for i in range(m):
    p, y = map(int, input().split())
    ipy.append([i, p , y])
    
city_count = {}
city = {}
    
for i, p, y in sorted(ipy, key=lambda x: x[2]):
    if not p in city_count:
        city_count[p] = 1
    else:
        city_count[p] += 1
    city[i, p] = city_count[p]

for i, p, y in ipy:
    print('{:06}{:06}'.format(p, city[i, p]))

Measured memory_bytes: 44484
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;

struct Info{
	int loc;
};

char T[500001],P[500001];

int main(){

	int T_length,P_length;

	scanf("%s",T);
	for(T_length = 0; T[T_length] != '\0'; T_length++);

	scanf("%s",P);
	for(P_length = 0; P[P_length] != '\0'; P_length++);

	Info* info = (Info*)malloc(sizeof(Info)*P_length);

	int T_loc = T_length-1;

	bool FLG;

	for(int i = P_length-1; i >= 0; i--){
		FLG = false;
		for(int k = T_loc; k >= 0; k--){
			if(T[k] == P[i]){
				info[i].loc = k;
				T_loc = k-1;
				FLG = true;
				break;
			}
		}

		if(!FLG){
			printf("no\n");
			return 0;
		}
	}

	int left,right;

	for(int i = P_length-1; i >=1; i--){
		left = info[i-1].loc+1;
		right = info[i].loc-1;

		if(left > right)continue;

		for(int k = right; k >= left; k--){
			if(T[k] == P[i]){
				printf("no\n");
				return 0;
			}
		}
	}

	for(int i = info[0].loc-1; i >= 0; i--){
		if(T[i] == P[0]){
			printf("no\n");
			return 0;
		}
	}

	printf("yes\n");

	return 0;
}

Measured memory_bytes: 6044
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string s;
  cin>>n>>s;
  
  for(int i=0; i<s.size();i++){
    cout << (char)((s[i]-'A'+n)%26 + 'A');
  }
  cout << endl;
  return 0;
}

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


int main() {
  int N,M;
  cin >> N >> M;
  int sum=0;
  for(int i=0;i<M;i++){
    int a;
    cin >> a;
    sum+=a;
  }
  if(sum>N){
    cout << -1 << endl;
  }
  else{
    cout << N-sum << endl;
  }
}

 
  

Measured memory_bytes: 3596
#include <iostream>
#include <vector>
using namespace std;
int main(void){
    int h,w;
    cin>>h>>w;
    vector<vector<char>> grid(h,vector<char>(w));
    bool allw=true;
    for(int i=0; i<h; i++){
        allw=true;
        for(int j=0; j<w; j++){
            cin>>grid.at(i).at(j);
            if(grid.at(i).at(j)=='#'){
                allw=false;
            }
        }
        if(allw){
            grid.erase(grid.begin()+i);
            i--;
            h--;
        }
    }
    
    allw=true;
    for(int i=0; i<w; i++){
        allw=true;
        for(int j=0; j<h; j++){
            if(grid.at(j).at(i)=='#'){
                allw=false;
            }
        }
        if(allw){
            for(int j=0; j<h; j++){
                grid.at(j).erase(grid.at(j).begin()+i);
            }
            i--;
            w--;
        }
    }
    
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            cout<<grid.at(i).at(j);
        }
        cout<<endl;
    }
}


Measured memory_bytes: 256
n = gets.chomp.to_i
a = []
n.times do |i|
  a[i] = gets.chomp.to_i
end
min = a[-1]
mjmax = a[-1]
max = a[-1]
maxka= -9999999
ans = -999999999
dans = 0
a.reverse!
n.times do |i|
d = a[i]
  if(d > max)
  maxka = max - d
  if(ans < maxka)
    ans = maxka 
  end
  max = d
  min = d
  elsif(d <= min and i != (0))
  min = d
  maxka = max - min
      if(ans < maxka)
  ans = maxka 
      end
  end 
end
puts ans

Measured memory_bytes: 10448
#include<stdio.h>
int main()
{

    int A,B,C;
    scanf("%d %d %d",&A,&B,&C);
    if(C>A && B>C)
        printf("Yes\n");
    else if (A==B && B==C)
        printf("Yes\n");
    else
        printf("No\n");

    return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define rep(i,n) for(ll i=0;i<n;i++)
#define inf 999999999
const int mod = 1000000007;
ll cnt = 0;
// cout << fixed  << setprecision(10);
vector<ll>e[200100];
ll cnta[200100];

void dfs(int u,int fa){
    cnta[u]+=cnta[fa];
    for(auto v:e[u]){
        if(v!=fa)dfs(v,u);
    }
}

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

   for(int i=0;i<n-1;i++){
       int a,b;
       cin >> a >> b;
       e[a].push_back(b);
       e[b].push_back(a);
   }

   for(int i=0;i<q;i++){
       ll a,b;
       cin >> a >> b;
       cnta[a]+=b;
   }

   dfs(1,0);
   for(int i=1;i<=n;i++){
       cout << cnta[i] << " ";
   }
   cout << endl;
   return 0;


}

Measured memory_bytes: 24320
X = int(input())

C = 0
P = 0
D = 0
L = 0
total = 0

if X >= 0 and X <= 10 ** 9:
    while True:
        if X >= 500:
            C = X // 500
            P = 500 * C
            X = X - P
        elif X >= 5:
            D = X // 5
            L = 5 * D
            X = X - L
        else:
            break
man = 1000 * C
t   = 5 * D

total = man + t

print(total)

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

using namespace std;
typedef long long ll;

// #define DEBUG

const int INTMAX = 2 * 1e9 + 10;

int bfs(int n, int m, vector<int> v[])
{

    int t = 1;
    int ret = 0;
    for (int i = 0; i < n; i++)
    {
        vector<int> search, new_search;
        int color[n] = {};
        search.push_back(i);
            color[i] = 1;
        while (!search.empty())
        {

            for (auto itr = search.begin(); itr != search.end(); itr++)
            {
                for (auto itr2 = v[*itr].begin(); itr2 != v[*itr].end(); itr2++)
                {
                    if (color[*itr2] == 0){
                        new_search.push_back(*itr2);
                        color[*itr2] = 1;}
                    if (*itr2 == i)
                        ret = 1;
                }
            }

            vector<int>().swap(search);
            search = new_search;
            vector<int>().swap(new_search);
        }


    }
    return ret;
}

int main()
{

#ifdef DEBUG
    cout << "DEBUG MODE" << endl;
    ifstream in("input.txt"); //for debug
    cin.rdbuf(in.rdbuf());    //for debug
#endif

    int n, m, s, t;
    cin >> n >> m;
    vector<int> connect[n];

    for (int i = 0; i < m; i++)
    {
        cin >> s >> t;
        connect[s].push_back(t);
    }
    cout << (bfs(n, m, connect) ? 1 : 0) << endl;

    return 0;
}

// getline(cin,s);
// a = strtok(s, ",");  ","で分解
// for (int i = 0; i < n; i++)


Measured memory_bytes: 3172
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		String s = sc.nextLine();
		String p = sc.nextLine();

		sc.close();

		for(int offset=0; offset<s.length(); offset++) {
			String cmpStr = "";
			for(int i=0; i<p.length(); i++) {
				int count = i + offset;
				if(count >= s.length()) count = count - s.length();
				cmpStr += s.charAt(count);
			}
			if(cmpStr.equals(p)) {
				System.out.println("Yes");
				return;
			}
		}

		System.out.println("No");

	}

}


Measured memory_bytes: 26288
#include <iostream>
#include <assert.h>
#include <vector>
#include <unordered_map>
#include <queue>
#include <climits>
#include <cmath>
#include <algorithm>
using namespace std;

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

  int32_t N;
  cin >> N;
  int64_t res = 0;
  vector<int64_t> fx(N+1,0);
  fx[1] = 1;
  for (int i = 2; i <= N; i++) {
    if (fx[i] != 0) continue;
    for (int j = 1; j * i <= N; j++) {
      int64_t idx = i * j;
      int64_t bcnt = fx[j];
      int64_t pcnt = 1;
      while (idx <= N && fx[idx] == 0) {
        fx[idx] = bcnt * (pcnt+1);
        idx *= i;
        pcnt++;
      }
    }
  }
  for (int i = 1; i <= N; i++) {
    res += (int64_t) i * fx[i];
  }
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 81340
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		while(true){

			int a = in.nextInt();
			String op = in.next();
			int b = in.nextInt();

			if(op.equals("?"))break;

			int ans = 0;

			switch(op){
			case "+":
				ans = a+b;
				break;
			case "-":
				ans = a-b;
				break;
			case "*":
				ans = a*b;
				break;
			case "/":
				ans = a/b;
				break;
			}

			System.out.println(ans);
		}
	}

}



Measured memory_bytes: 26288
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <map>
#include <iostream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <random>
#include <stack>
#include <set>
#include <unordered_set>

#define bug(x) cout<<"zdongdebug1: "<<x<<endl;
#define bug2(x, y) cout<<"zdongdebug2: "<<x<<" "<<y<<endl;
#define bug3(x, y, z) cout<<"zdongdebug3: "<<x<<" "<<y<<" "<<z<<endl;
using namespace std;
typedef long long ll;
const int maxn = 200005;
const int mod = 1000000007;

int a[maxn];

int main() {
#ifdef suiyuan2009
  freopen("/Users/suiyuan2009/CLionProjects/icpc/input.txt", "r", stdin);
  //freopen("/Users/suiyuan2009/CLionProjects/icpc/output.txt", "w", stdout);
#endif
  int n,m;
  cin>>n>>m;
  for(int i=0;i<n;i++)cin>>a[i];
  int l=1, r=1000000000;
  int ret = r;
  while(l<=r){
    int mid = (l+r)>>1;
    ll cnt = 0;
    for(int i=0;i<n;i++){
      if(a[i]<=mid)continue;
      cnt += (a[i] + mid-1)/mid - 1;
    }
    if(cnt<=m){
      ret = mid;
      r = mid -1;
    } else l = mid + 1;
  }
  cout<<ret<<endl;
  return 0;
}

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

int main(){
    int N, ans;
    cin >> N;
    vector<int> a(N), b(N);
    for(int i=0; i<N; i++){
	cin >> a[i];
	b[i] = a[i];
    }

    sort(a.begin(), a.end());
    int mid = a[(N-1)/2];
    
    for(int i=0; i<N; i++){
	if(b[i] <= mid){
	    cout << a[(N-1)/2+1] << endl;;
	}
	else if(b[i] > mid){
	    cout << a[(N-1)/2] << endl;;
	}
    }

}



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

using namespace std;

int score[10];

int main() {
	int sum = 0;
	for (int i = 0; i < 5; i++) {
		cin >> score[i];
		if (score[i] < 40) {
			score[i] = 40;
		}
		sum += score[i];
	}
	cout << sum / 5 << endl;
}


Measured memory_bytes: 3068
#include <iostream>
#include <algorithm>
#include <cmath>
#include <limits>
#include <vector>
#include <cstdio>
#include <bits/stdc++.h>
#include <set>
#include <map>
#include <stdio.h>
#include <stack>
#include <queue>
#include <deque>
#include <numeric>
#include<bits/stdc++.h>

#define ALL(obj) (obj).begin(), (obj).end()
#define FOR(i,a,b) for(int i = (a); i < (b); i++)
#define RFOR(i,a,b) for(int i = (a); (b) <= i; i--)
#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = n; n <= i; i--)
#define ABS(a) ((a < 0) ? ((-1)*(a)) : (a))
#define elif else if
#define MOD 1000000007
#define INF (1<<29)

using namespace std;
using ll = long long;
map <int ,int> mpa,mpb;
typedef pair<ll, ll> P;
priority_queue<P, vector<P>, greater<P>> pque;

ll gcd(ll m, ll n){
  // 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;

	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd

ll lcm( ll m, ll n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm


int main(){
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  ll N,X;
  ll ans=0;
  cin >> N >> X;
  ll x[N]={0};
  ll t=0;
  for(int i=0;i<N;i++){
    cin >> t;
    x[i]=llabs(t-X);
  }
  if(N==1) {
    cout << x[0] << endl;
    return 0;
  }
  sort(x,x+N);
  ans=x[0];
  REP(i,N-1){
    ans=__gcd(ans,x[i]);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 1024
N,M = map(int,input().split())
ks = [list(map(int,input().split())) for _ in [0]*M]
*p,= map(int,input().split())
ans = 0
for i in range(1<<N):
    S = [(i&(1<<j))>0 for j in range(N)]
    tmp = 0
    for j,ks1 in enumerate(ks):
        k,*s = ks1
        tmp = sum(S[c-1] for c in s)
        if tmp%2 != p[j]:break
    else:
        ans+=1
print(ans)

Measured memory_bytes: 3064
#include <iostream>

using namespace std;

int main() {

	long long int n;
	cin >> n;
	for (long long int i = 1; ; i++) {
		if (i*i > n) {
			cout << (i - 1)*(i - 1) << endl;
			break;
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,a,n) for(int i=(a); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define FOR(it,c) for(__typeof((c).begin()) it=(c).begin(); it!=(c).end(); ++it)
#define ALLOF(c) (c).begin(), (c).end()
typedef long long ll;
typedef unsigned long long ull;


int main(){
  char c;
  cin >> c;

  cout << (char)(c+1) << endl;
  
  return 0;
}


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

int main() {
    
    string p;
    cin >> p;
    int ans = 0;
    for (int i = p.size() - 2; i >= 0; i--) {
        if (i % 2 )continue;
        
        string t = p.substr(0, i);
        string r = t.substr(0, i / 2);
        //        cout << t << endl;;
        if (r + r == t) {
            ans = t.size(); break;
        }
        
        
    }
    cout << ans << endl;
    
    
    return 0;
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define all(x) x.begin(), x.end()

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
typedef long long ll;

template <typename T> void max_self(T& a, T b){
  a = max(a,b);
}

void solve(){	
 int n;cin>>n;
 while(n){
    int t = n%10;
    if(t == 7){
      cout<<"Yes\n";
      return;
    }
    n/=10;
 }
 cout<<"No\n";
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  //int t; cin >> t;
  //while(t--) solve();
  solve();
  return 0;
}


Measured memory_bytes: 3616
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pi 3.141592653589793238
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
ll MOD=1e9+7;

void solve()
{
	ll sx,sy,tx,ty;
	ll y,x;
	cin>>sx>>sy>>tx>>ty;
	y=ty-sy;
	x = tx-sx;
	for(ll i=0;i<y;i++)
    	cout<<"U";

	  for(ll i=0;i<x;i++)
	    cout<<"R";
	  
	  for(ll i=0;i<y;i++)
	    cout<<"D";
	
	  for(ll i=0;i<x;i++)
	    cout<<"L";
	    
	  cout<<"L";
	  for(ll i=0;i<y+1;i++)
	    cout<<"U";
	  
	  for(ll i=0;i<x+1;i++)
	    cout<<"R";
	
	  cout<<"D";
	  cout<<"R";
	  for(ll i=0;i<y+1;i++)
	    cout<<"D";
	  
	  for(ll i=0;i<x+1;i++)
	    cout<<"L";
	
	  cout<<"U";
	return;
}
int main()
{
        fast;
        ll q;
        q=1;
        // cin>>q;
        while(q--)
        	solve();
        
        return 0;
}

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

int main(){
	string s,t; cin >> s >> t;
	ll a,b; cin >> a >> b;
	string u; cin >> u;

	if(s == u)cout << a - 1 << " " << b << endl;
	else cout << a << " " << b - 1 << endl;

}

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);
		int N = sc.nextInt();
		int[] input = new int[N];
		for (int i = 0; i < input.length; i++) {
			input[i] = sc.nextInt();
		}
		int[] ans = new int[N];
		for (int i = 0; i < input.length; i++) {
			int tmp = input[i];
			int sum = input[tmp - 1];
			ans[sum - 1] = tmp;
		}
		for (int i = 0; i < ans.length; i++) {
			if (i == ans.length - 1)
				System.out.print(ans[i]);
			else
				System.out.print(ans[i] + " ");
		}
		sc.close();
	}
}

Measured memory_bytes: 60692
import java.io.*;
public class Main {

    public static void main(String[] args) throws IOException{
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String number;
        int sum =0,ave=0,a=0;
        while((number = bf.readLine())!=null){
            String []numbers = number.split(",");
            if (numbers.length!=2)break;
            int b =Integer.parseInt(numbers[0]);
            int c =Integer.parseInt(numbers[1]);
            a++;
            sum += b*c;
            ave += c;
            }
        System.out.println(sum);
        System.out.println(Math.round((double)ave/a));
        }
    }

Measured memory_bytes: 16892
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
#define int long long int

signed main(){
    string a;
    cin >> a;
    
    for(int i=0;i<3;i++){
        if(a[i]=='7'){cout << "Yes" << endl;return 0;}
    }
    cout << "No" << endl;
}

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

int main() {
    long long  L, R;
    cin >> L >> R;

    if (R-L >= 2019){
        cout << 0 << endl;
    }else {
        long long ans = 2020;
        for(long long  i=L; i<R; i++){
            for(long long j=i+1; j<=R; j++){
                ans = min(ans, (i*j) % 2019);
            }
        }
        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 256
def main():
    N = int(input())
    B = list(map(int, input().split()))
    A = [1001001] * N
    for i in range(N - 1):
        A[i] = min(A[i], B[i])
        A[i+1] = min(A[i + 1], B[i])
    print(sum(A))


if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include <stdio.h>
enum ROTETYPE{
	W,
	E,
	S,
	N
};
class cDICE{
public:
	cDICE(){ Init(); };
	~cDICE(){};
	void Init(){
		int Me[6] = { 1, 2, 4, 8, 16, 32 };
		int Dice[6] = { 0, 1, 2, 3, 4, 5 };
		int Rote[2][4] = {
			{ 0, 1, 5, 4 },
			{ 2, 5, 3, 0 }
		};
		InputData(Dice, mDice);
		InputData(Me, mMe);
		for (int i = 0; i < 2; i++){
			for (int j = 0; j < 4; j++){
				mRote[i][j] = Rote[i][j];
			}
		}
	}
	void Draw(){
		//??¨???????????????
		for (int i = 0; i < 6; i++){
			printf("???????????????:%d >> ??????????????????:%d\n", mMe[i], mDice[i]);
		}
	};
	void LastDraw(){
		//?????????????????????????´¢?????????
		for (int i = 0; i < 6; i++){
			if (mDice[i] == 0){
				printf("?????????????????????:%d\n", mMe[i]);
				break;
			}
		}
	}
	int GetLast(){
		int Last = 0;
		for (int i = 0; i < 6; i++){
			if (mDice[i] == 0){
				Last = mMe[i];
				break;
			}
		}
		return Last;
	}
	void Rote(ROTETYPE _TYPE){
		int Add = 1;
		if (_TYPE == S || _TYPE == W){ Add = 3; };
		switch (_TYPE){
		case W:
			RoteH(3);
			break;
		case E:
			RoteH(1);
			break;
		case S:
			RoteV(1);
			break;
		case N:
			RoteV(3);
			break;
		}
	}
	void InputData(int _Dice[6], int _Inp[6]){
		for (int i = 0; i < 6; i++){
			_Inp[i] = _Dice[i];
		}
	}
public:
	int mMe[6];
private:
	
	void RoteV(int _Add){			//1????¬?3??????
		for (int i = 0; i < 6; i++){
			for (int j = 0; j < 4; j++){
				if (mDice[i] == mRote[0][j]){
					//int ans = (mDice[i] <= 1) ? mDice[i] : -mDice[i] + 7;
					int ans = j;
					ans = (ans + _Add) % 4;
					mDice[i] = mRote[0][ans];
					break;
				}
			}
		}
	};	//????????¢
	void RoteH(int _Add){
		for (int i = 0; i < 6; i++){
			for (int j = 0; j < 4; j++){
				if (mDice[i] == mRote[1][j]){
					int ans = j;
					ans = (ans + _Add) % 4;
					mDice[i] = mRote[1][ans];
					break;
				}
			}
		}
	};	//?¨??????¢
private:
	int mDice[6];
	int mRote[2][4];
};
int main(){
	cDICE *DiceMgr;
	char Direct[100];
	int Me[6];
	DiceMgr = new cDICE();
	scanf("%d %d %d %d %d %d", &Me[0], &Me[1], &Me[2], &Me[3], &Me[4], &Me[5]);
	DiceMgr->InputData(Me,DiceMgr->mMe);
	scanf("%s", Direct);
	for (int i = 0; Direct[i] != '\0'; i++){
		switch (Direct[i]){
		case 'S':
			DiceMgr->Rote(S);
			break;
		case 'W':
			DiceMgr->Rote(W);
			break;
		case 'E':
			DiceMgr->Rote(E);
			break;
		case 'N':
			DiceMgr->Rote(N);
			break;
		}
	}
	printf("%d\n", DiceMgr->GetLast());
	return 0;
}

Measured memory_bytes: 2740
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp4
{
    class Program
    {
        static void Main(string[] args)
        {
            var InputCount = int.Parse(Console.ReadLine());
            var OtoshidamaList = new List<Otoshidama>();
            for(int i = 0; i < InputCount; i++)
            {
                var temp = Console.ReadLine().Split(' ');
                OtoshidamaList.Add(new Otoshidama
                {
                    Amount = decimal.Parse(temp[0]),
                    Classification = temp[1]
                });
            }
            Console.WriteLine(OtoshidamaList.Sum(e => e.Yen).ToString());
        }
    }
    public class Otoshidama
    {
        public decimal Amount { get; set; }
        public string Classification { get; set; }
        public decimal Yen
        {
            get
            {
                if(Classification == "JPY")
                {
                    return Amount;
                }
                else
                {
                    return Amount * 380000;
                }
            }
        }
    }

}


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


/* macro */
#define int long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define sec second
#define fir first
#define pb push_back



/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;


/* constant */
const int inf = pow(2, 62);
const int mod = 1e9 + 7;
int dx[8]={1,0,-1,0,-1,1,-1,1};
int dy[8]={0,1,0,-1,-1,-1,1,1};



/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}


/* general_method */
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }




/* main */



signed main(){

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

    
    print((input() - 1) * (input() - 1));

    

    
    




    
    



    
    

    







   




    

    

    




    



    



    

 
    
    


    

    
   
    













}






    










    




    










Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IDX 1000000000
map<long long,long long>mp;

int main(){
  int n;
  long long ans=0,sum=0;
  cin>>n;
  mp[IDX]=1;
  for(int i=0;i<n;i++){
    long long a;
    cin>>a;
    sum+=a;
    long long temp=sum+IDX;
    if(mp.count(temp)==0){
      mp[temp]=1;
    }
    else{
      ans+=mp[temp];
      mp[temp]++;
    }
  }
  cout<<ans<<endl;
  return(0);
}


Measured memory_bytes: 12800
H, W = map(int, input().split())

s = []
for h in range(H):
    s.append(input())

for h in range(H):
    t = ''
    for w in range(W):
        if s[h][w] == '#':
            t += '#'
            continue

        cnt = 0
        if w < W - 1 and s[h][w + 1] == '#':
            cnt += 1

        if w < W - 1 and h < H - 1 and s[h + 1][w + 1] == '#':
            cnt += 1

        if h < H - 1 and s[h + 1][w] == '#':
            cnt += 1

        if h < H - 1 and w > 0 and s[h + 1][w - 1] == '#':
            cnt += 1

        if w > 0 and s[h][w - 1] == '#':
            cnt += 1

        if w > 0 and h > 0 and s[h - 1][w - 1] == '#':
            cnt += 1

        if h > 0 and s[h - 1][w] == '#':
            cnt += 1

        if h > 0 and w < W - 1 and s[h - 1][w + 1] == '#':
            cnt += 1

        t += str(cnt)

    print(t)

Measured memory_bytes: 3064
def islower (t_a,t_b):
	if t_a[1] != t_b[1]:
		return t_a[1] < t_b[1]
	elif t_a[2] != t_b[2]:
		return t_a[2] > t_b[2]
	else :
		return t_a[0] < t_b[0]

import sys
while 1:
	M, T, P, R = map(int,raw_input().split())
	if (T,P,R) == (0,0,0):
		break
	score = [[i,0,0] for i in xrange(1,T+1)]
	wrong = [[0 for i in xrange(P)] for j in xrange(T)]
	for x in xrange(R):
		m, t, p, j = map(int,raw_input().split())
		if j != 0 :
			wrong[t-1][p-1] += 1
		else :
			score[t-1][1] += 1
			score[t-1][2] += 20 * wrong[t-1][p-1] + m

	for j in xrange(T - 1):
		for i in xrange(T - 1 - j):
			t_l = score[i]
			t_r = score[i+1]
			if islower(t_l, t_r):
				score[i] = t_r
				score[i+1] = t_l

	for i in xrange(T):
		if i != 0:
			if (score[i-1][1], score[i-1][2]) == (score[i][1], score[i][2]):
				sys.stdout.write("=")
			else :
				sys.stdout.write(",")
		sys.stdout.write(str(score[i][0]))
	print ""

Measured memory_bytes: 4332
// https://atcoder.jp/contests/arc069/tasks/arc069_b
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (int)(b); ++i)
const int MAXN = 1e5 + 4;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    string s;
    cin >> s;
    s[n] = s[0], s[n + 1] = s[1];
    bitset<100005> a;
    REP(i, 4) {
        a[0] = i & 1, a[1] = (i >> 1) & 1;
        FOR(j, 2, n + 2) a[j] = (s[j - 1] == 'x') ^ a[j - 1] ^ a[j - 2];
        if (a[0] == a[n] && a[1] == a[n + 1]) {
            REP(j, n) cout << (a[j] ? "W" : "S");
            cout << "\n";
            return 0;
        }
    }
    cout << "-1\n";
    return 0;
}


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

int main() {
    int s,w;
    cin >> s >> w;
    string ans = "unsafe";
    if (w < s) ans="safe";
    else ans="unsafe";
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
/*|In The Name of Allah|*/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<pair<int,int> > vii;
typedef map<int, int> mii;
typedef map<string, int> msi;
typedef pair<int, int> pii;
#define el	'\n'
#define lp(i,n) for(int i = 0;i < int(n);i++)
#define rlp(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rng(i,a,b) for(int i = int(a);i <= int(b);i++)
#define mp(x,y)  	make_pair((x),(y))
#define pb(x)    	push_back((x))
#define all(v)  	((v).begin()),((v).end())
#define sz(x)  		((int) (x).size())
#define bits(a) 	__builtin_popcountll(a)
#define fr first
#define sc second
#define pii pair<int, int>
#define sortva(v) sort(all(v))
#define sortvd(v) sort(v.rbegin(),v.rend())
#define sortaa(a,n) sort(a,a+n)
#define sortad(a,n) sort(a,a+n),reverse(a,a+n)
#define SS stringstream
#define ll long long
#define clr(x, y) memset(x, y, sizeof(x))
#define foreach(it,x) for(__typeof__((x).begin()) it = (x).begin(); it != (x).end(); ++it)
int dx[] = { 0, 0, 1, -1, 1, -1, 1, -1 };
int dy[] = { 1, -1, 0, 0, -1, 1, 1, -1 };
ll gcd(ll a, ll b){if (a == 0)return b;return gcd(b % a, a);}



void MisSiOn_ImPosSiBlE(){
//freopen("portals.in", "r", stdin);
ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

}


int const N = 5e6 + 9, mod = 1e9+7 , oo = 0x3f3f3f3f;
//------------------------------------------------------------------------------------

int s;
int main()
{
    string str;
    cin>>str;
    for (int i=1;i<str.size();i++){
        if (str[i]==str[i-1]){
            if (str[i-1]=='0')str[i]='1';
            else str[i]='0';
            s++;
        }
    }

cout<<s;











/*
*/
    return 0;
}


Measured memory_bytes: 512
def main(ss):
    sorted_ss = ["".join(sorted(s)) for s in ss]
    # print(sorted_ss)
    visited = dict()
    count = 0
    for s in sorted_ss:
        if s in visited:
            count += visited[s]
            visited[s] += 1
        else:
            visited[s] = 1

    return count


n = int(input())
ss = []
for _ in range(n):
    ss.append(input())

print(main(ss))

Measured memory_bytes: 26640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmax(T& a, 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 1; } return 0; }

int main() {
    string s;
    cin >> s;
    int ans = 0;
    for (int i=0; i<s.size(); i++){
        if (s.at(i) == '+') ans++;
        else ans--;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define N ((ll)301*1000)
#define MOD ((ll)1e9+7)

ll n,x[N],y[N],par[N],ans;
vector <pair<ll,ll> > vx,vy;
set <pair<ll,pair<ll,ll> > > s;

ll root(ll x){if(par[x]==-1)return x;return par[x]=root(par[x]);}

int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>x[i]>>y[i];
		vx.push_back({x[i],i});
		vy.push_back({y[i],i});
		par[i]=-1;
	}
	sort(vx.begin(),vx.end());
	sort(vy.begin(),vy.end());
	for(int i=1;i<vx.size();i++)
	{
		s.insert({vx[i].first-vx[i-1].first,{vx[i].second,vx[i-1].second}});
		s.insert({vy[i].first-vy[i-1].first,{vy[i].second,vy[i-1].second}});
	}
	while(s.size())
	{
		ll val=s.begin()->first;
		ll v=s.begin()->second.first,u=s.begin()->second.second;
		s.erase(s.begin());
		v=root(v);u=root(u);
		if(v==u)continue;
		ans+=val;
		par[v]=u;
	}
	cout<<ans<<"\n";
	return 0;
}

Measured memory_bytes: 21192
#include<bits/stdc++.h>
using namespace std;
#define READ() freopen("in.txt","r",stdin)
#define WRITE() freopen("out.txt","w",stdout)
#define  pb(x)  push_back(x)
#define mem(arr,val) memset(arr,val,sizeof(arr));
typedef long long ll;
const int mx=30005;
vector<int>G[mx],cost[mx];
struct data{
    bool ev;
    int val;
};

bool cmp(data a,data b)
{
    if(a.val<b.val)
    {
        return true;
    }
    if(a.val==b.val)
    {
        return a.ev;

    }
    return false;
}
int vis[100][26];

int main()
{
//    READ();
    int a,b;
    cin>>a>>b;
    if(a<=b)
    cout<<a<<endl;
    else
        cout<<a-1<<endl;




    return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <string>

typedef long long ll;

using namespace std;

int main() {
    string ret;
    ret = "AGC";
    int n;
    cin >> n;
    if (n<1200) ret = "ABC";
    else if (n<2800) ret = "ARC";
    std::cout << ret << endl;
    return 0;
}


Measured memory_bytes: 888
H=int(input())
W=int(input())
N=int(input())
sumation=0
count=1
while True:
    index=max(H,W)
    if(index==H):
        sumation+=index
        W-=1
    elif(index==W):
        sumation+=index
        H-=1
    

    if(sumation>=N):
        break
    else:
        count+=1

print(count)

Measured memory_bytes: 3060
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;
const double PI=2*asin(1);

int main() {
  string S;
  cin>>S;
  map<char, int> amap;
  for(int i=0;i<S.size();++i) {
    amap[S[i]]++;
  }
  if(S.size()<26) {
    for(char i='a';i<='z';++i) {
      if(amap[i]==0) {
        S.push_back(i);
        break;
      }
    }
    cout<<S<<endl;
    return 0;
  }
  else {
    int num;
    bool can = false;
    vector<char> arr;
    arr.push_back(S[S.size()-1]);
    for(int i=S.size()-2;i>=0;--i) {
      for(int j=0;j<arr.size();++j) {
        if(S[i]<arr[j]) {
          can = true;
          num = S.size()-i;
          S[i] = arr[j];
          break;
        }
      }
      if(can) break;
      arr.push_back(S[i]);
      sort(arr.begin(), arr.end());
    }
    if(!can) {
      cout<<-1<<endl;
      return 0;
    }
    for(int i=0;i<num-1;++i) S.pop_back();
    cout<<S<<endl;
    return 0;
  }
}



Measured memory_bytes: 3576
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bint = boost::multiprecision::cpp_int;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
#define rrepSE(i,s,e) for (int i = (s); i > (e); i--)
#define ssort(v) sort(v.begin(), v.end())
#define gsort(v) sort(v.rbegin(), v.rend())
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }

int main()
{
    int n;
    cin >> n;
    vector<int> p(n), q(n);
    rep(i,n) cin >> p[i];
    rep(i,n) cin >> q[i];
    vector<int> v(n);
    rep(i,n) v[i] = i + 1;
    int a = 0, b = 0, cnt = 0;
    do {
        bool flaga = true, flagb = true; cnt ++;
        rep (i,n) {
            if (v[i] != p[i]) { flaga = false; break; }
        }
        rep (i,n) {
            if (v[i] != q[i]) { flagb = false; break; }
        }
        if (flaga) a = cnt;
        if (flagb) b = cnt;
    } while (next_permutation(v.begin(), v.end()));
    int ans = abs(a - b);
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 3576