akhauriyash/Code-Regression huggingface dataset:
h,w,a,b = map(int,input().split())

list1 = []
list2 = []
for i in range(a):
    list1.append(0)
for i in range(w-a):
    list1.append(1)
for i in range(w):
    if list1[i] == 1:
        list2.append(0)
    else:
        list2.append(1)

for i in range(b):
    print("".join(map(str,list1)))
for i in range(h-b):
    print("".join(map(str,list2)))

Measured memory_bytes: 4084
N,M = map(int,input().split())
ans = {i:0 for i in range(1,N+1)}
ans[1] = 10000000
route = {i:set() for i in range(1,N+1)}
for _ in range(M):
    a,b = map(int,input().split())
    route[a].add(b)
    route[b].add(a)
x = {1}
for _ in range(N+1):
    tmp = set()
    count = 0
    for i in x:
        for j in route[i]:
            #print(j)
            if ans[j] == 0:
                ans[j] = i
                count += 1
                tmp.add(j)
    x = tmp
    #print(ans,x)
    if count == 0:
        break
check = 0
for i in ans.keys():
    if i != 1:
        if ans[i] == 0:
            check = 1
if check == 1:
    print('No')
else:
    print('Yes')
    for i in ans.keys():
        if i != 1:
            print(ans[i])

Measured memory_bytes: 82820
// C
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#ifdef __GXX_EXPERIMENTAL_CXX0X__
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif
//#include <bits/stdc++.h>

#define all(v) v.begin(), v.end()
typedef long long ll;
#define rep(i, z, n) for(int i = z; i < n; i++)
//const int INF = 1<<29;
//const ll MOD = 1000000007;
using namespace std;

int main(){
    ll X, K, D;
    cin >> X >> K >> D;
    if(X < 0) X *= -1;
    ll n = X / D;
    ll m = X % D;
    ll M = 2 * m;
    if (n >= K){
        cout << ll(X - K * D) << endl;
    }
    else{
        ll odev = (K - n) % 2;
        if(odev == 0){
           cout << ll(m) << endl;
        }
        else{
            cout << ll(D - m) << endl;
        }
    }
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long
using namespace std;
int main()
{
    int n;
    cin >> n;
    string s;
    cin >> s;
    int cnt = 0;
    rep(i,n-2){
        string k;
        rep(j,3){
            k += s[i + j];
        }
        if ("ABC" == k)
        {
            cnt++;
        }
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
const double EPS = 1e-10;
using namespace std;
class Edge{
public:
    int from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};

int main(){
    int n;cin >> n;
    for(int i = 0;i < n;i++){
        int y,m,d;cin >> y >> m >> d;
        int ans = 0;
        while(1){
            if(y == 1000 && m == 1 && d == 1)break;
            ans++;
            d++;;
           // cout<<y<<" "<<m<<" "<<d<<endl;
            if(y % 3 != 0 && m % 2 == 0 && d == 20){
                d = 1;
                m++;
            }
            if((y % 3 == 0 || m % 2 == 1) && d == 21){
                d = 1;
                m++;
            }

            if(m == 11){
                y++;
                m = 1;
            }
        }
        cout<<ans<<endl;
    }
}



Measured memory_bytes: 3000
#include <cstdio>
#include <cctype>
#include <algorithm>
#define repu(i,x,y) for (int i=x; i<=y; ++i)
#define repd(i,x,y) for (int i=x; i>=y; --i)
using namespace std;

typedef long long LL;
int n,m,a[210][5010];
LL d[5010],sum[5010][5010],ans;

int getint()
{
    char ch;
    while (!isdigit(ch=getchar()));
    int x=ch-'0';
    for (; isdigit(ch=getchar()); x=x*10+ch-'0');
    return x;
}

void add(int x1,int x2,int y1,int y2,int w)
{
    sum[x1][y1]+=w;
    sum[x1][y2+1]-=w;
    sum[x2+1][y1]-=w;
    sum[x2+1][y2+1]+=w;
}

void solve(int *a)
{
    static int l[5010],r[5010],stk[5010],top;
    stk[top=0]=0;
    repu(i,1,n)
    {
        for (; top && a[stk[top]]<a[i]; --top);
        l[i]=stk[top]+1,stk[++top]=i;
    }
    stk[top=0]=n+1;
    repd(i,n,1)
    {
        for (; top && a[stk[top]]<=a[i]; --top);
        r[i]=stk[top]-1,stk[++top]=i;
        add(i,r[i],l[i],i,a[i]);
    }
}

int main()
{
    scanf("%d%d",&n,&m);
    repu(i,2,n)
        d[i]=d[i-1]+getint();
    repu(i,1,n)
        repu(j,1,m)
            a[j][i]=getint();
    repu(i,1,m)
        solve(a[i]);
    repu(i,1,n)
        repu(j,1,i+1)
        {
            sum[i][j]+=sum[i-1][j]+sum[i][j-1]-sum[i-1][j-1];
            ans=max(ans,sum[i][j]-d[i]+d[j]);
        }
    printf("%lld\n",ans);
    return 0;
}

Measured memory_bytes: 198400
#include <iostream>
#include <vector>
#include <map>
#include <iterator>

using namespace std;

int N, A;
vector<int> values;
map<int,int> numbers;
map<int,int>::iterator mayorA, mayorS;

int main()
{
  cin >> N;
  while(N--)
  {
    cin >> A;
    values.push_back(A);
    numbers[A]++;
  }
  mayorA = numbers.end();
  mayorA--;
  mayorS = mayorA;
  if(numbers.size()>1){mayorS--;}
  if((*mayorA).second > 1) { for(int v : values) {cout << (*mayorA).first << '\n';}}
  else 
  {
    for(int v : values)
    {
      if(v != (*mayorA).first) { cout << (*mayorA).first << '\n';}
      else { cout << (*mayorS).first << '\n';}
    }
  }
  return 0;
}

Measured memory_bytes: 7924
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    long p=1000000007;
    Long summer=(long)0;
    Long ans=(long)0;
    Long[] a=new Long[n];
    for(int i=0;i<n;i++){
      a[i]=sc.nextLong();
      summer+=a[i];
      summer%=p;
    }
    for(int i=0;i<n;i++){
      summer-=a[i];
      if(summer<0)summer+=p;
      ans+=a[i]*summer;
      ans%=p;
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 65604
#include <bits/stdc++.h>
using namespace std; inline void fileio(const char* in, const char* out) { freopen(in, "r", stdin); freopen(out, "w", stdout); } 
#define TD typedef
#define forx(i,n) for(int i = 0; i < (n); ++i)
TD long long ll; TD long double ld; TD pair<int,int> pii; TD pair<ll, ll> pll; TD vector<int> VI; TD vector<bool> VB; TD vector<ll> VL;
const char nl = '\n'; const int INF = 0x3f3f3f3f; const ll LINF = 0x3f3f3f3f3f3f3f3fll; const ld EPS = 1e-9, PI = acos(-1);
#define ff first
#define ss second

int main() {
  atexit([](){ cerr << "Time: " << (ld)clock() / CLOCKS_PER_SEC << nl; });
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  // Emily <3
  int M, D;
  cin >> M >> D;
  int ans = 0;
  for (int m = 1; m <= M; m++) {
    for (int d = 22; d <= D; d++) {
      int d0 = d%10;
      int d1 = d/10;
      if (d0 < 2) continue;
      if (d0*d1==m) ans++;
    }
  }
  cout << ans << nl;
  
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

ll dp[5050][5050];

int main(){
    int n; cin >> n;
    vector<Pi> a(n);
    vector<int> h(n),p(n);
    rep(i,n){
        cin >> h[i] >> p[i];
        a[i].first = h[i]+p[i];
        a[i].second = i;
    }
    sort(a.begin(),a.end());
    rep(i,5050)rep(j,5050) dp[i][j] = LINF;
    dp[0][0] = 0;
    rep(i,n)rep(j,n){
        if(dp[i][j] == INF) continue;
        dp[i+1][j] = min(dp[i+1][j],dp[i][j]);
        if(h[a[i].second] < dp[i][j]) continue;
        dp[i+1][j+1] = min(dp[i+1][j+1],dp[i][j]+p[a[i].second]);
    }
    int ans = 0;
    rep(i,n+1){
        if(dp[n][i] != LINF) ans = i;
    }
    cout << ans << endl;
} 




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

int main()
{
    string s; cin >> s;
    int num = 0;
    for (int i = 0; i < s.length(); i++) {
        if (s[i] == '+') num++;
        else num--;
    }
    cout << num << endl;
    return 0;
}

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

using namespace std;
#define rep(i, l, r) for (int i = l; i<r;i++)
#define vi vector<int>
#define all(v) v.begin(),v.end()
#define pb(c) push_back(c)
#define vii vector<pair<int,int>>
#define ii pair<int,int>
#define max(a, b) (((a)<(b))?b:a)
#define min(a, b) ((a>b)?b:a)
#define mp(i, j) make_pair(i,j)
#define ull unsigned long long int
#define ll  long long int
#define pi 3.141592653589793238
#define mod ((int)1e9 + 7)
#define inf ((ll)1e15)
#define eps 1e-14,
#define maxlg 18
#define left(i) ((i)<<1)
#define right(i) (((i)<<1)+1)
#define maxn 10005100
int n[maxn];

int get(int i) {
    if (i<maxn)return n[i];

    int def = i - (maxn-1);
    ll ans = n[maxn-1];
    while (def>0) {
        if (def>maxn)
            ans = (ans*n[maxn-1])%mod,def-=(maxn-1);
        else
            ans = (ans*n[def])%mod,def=0;
    }
    return ans%mod;
}



vi divs;
vi getAllDivisors(int num){
    vector<int> divs;
    int square_root = (int) sqrt(num) + 1;
    for (int i = 1; i < square_root; i++) {
        if (num % i == 0)
        {  if(i*i!=num) {
                divs.pb(i);
            }
            divs.pb(num/i);
        }

    }
    return divs;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
#ifndef ONLINE_JUDGE
 
#endif
    n[0]=1;
    rep (i,1,maxn)
        n[i] = (10l*n[i-1])%mod;
    int s;
    cin>>s;
    int l=1,r = 0;
    int dl = 1,dr=1;
    int sum =0;
    ll ans = 0;
    while (dl<8) {

        if (sum+dr   < s) {
            r++;
            sum+=dr;
            if ((r+1)/n[dr]>0) {
                dr++;
            }

        } else if (sum+dr   > s) {
            l++;
            sum-=dl;
            if (l/n[dl]>0) {
                dl++;
            }

        }else if (sum+dr  == s) {
            l++;
            r++;
            sum=sum-dl +dr;
            if (l/n[dl]>0) {
                dl++;
            }
            if ((r+1)/n[dr]>0) {
                dr++;
            }
            ans= (ans+1);
            if (ans>mod)
                ans-=mod;
        }

    }

        ans = (ans+s/8)%mod;
    divs = getAllDivisors(s);
    rep (i,0,divs.size()) {
        if ( divs[i] >=8)
        ans = (ans+get(divs[i])-get(divs[i]-1)-s/divs[i] + mod)%mod;
    }
    cout<<ans;
    return 0;
}

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

int main(){
    long c = 0;
    long int N, P[200001], i = 0, j = 0;

    scanf("%ld", &N);
    for(i = 1; i <= N; ++i){
        scanf("%ld", &P[i]);
    }

    int mini = 200001;
    for(i = 1; i <= N; ++i){
        if(P[i] <= mini){
            c++;
            mini = P[i];
        }
    }

    printf("%ld\n", c);
    return 0;
}


Measured memory_bytes: 1792
#include <stdio.h>
#include <string.h>
int main(void){
    int n;
    scanf("%d",&n);
    int a[110];
    memset(&a,0,sizeof(a));
    a[4] = 1;
    a[7] = 1;
    for(int i = 7;i<=100;i++){
        // printf("a[%d]=%d\n",i,a[i]);
        if(a[i - 4] == 1 || a[i - 7] == 1){
            a[i] = 1;
        }
        // printf("a[%d]=%d\n",i,a[i]);
    }
    if(a[n] == 1){
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <string.h>
#define maxN 100

int
main(int argc, char *argv[])
{
  int n, m; char s[maxN][11] = {}, t[maxN][11] = {};
  scanf("%d", &n);
  for(int i = 0; i < n; i++) scanf("%s", s[i]);
  scanf("%d", &m);
  for(int i = 0; i < m; i++) scanf("%s", t[i]);

  int ans = 0; int temp;

  for(int i = 0; i < n; i++){
    temp = 0;
    for(int j = 0; j < n; j++){
      if(strcmp(s[i], s[j]) == 0) temp++;
    }
    for(int j = 0; j < m; j++){
      if(strcmp(s[i], t[j]) == 0) temp--;
    }
    ans = (ans > temp ? ans : temp);
  }

  printf("%d\n", ans);

  return 0;
}


Measured memory_bytes: 128
import java.util.Scanner;

/**
 * Created by sonekenichiro on 2017/07/03.
 */
public class Main {
    public static void main(String[] args) {


        Scanner sc=new Scanner(System.in);
        while(true){//???????????¨????????????
            String line=sc.nextLine();

            if(line.equals("0")){
                break;
            }


            int judgeNum=Integer.parseInt(line);
            int[] point=new int[judgeNum];//?????????????????£?????????????????????

            for(int i=0; i<judgeNum; i++){//?????£???????????????????????????????????????????????§?????°???
                String line2=sc.nextLine();
                point[i]=Integer.parseInt(line2);
            }


            int max=point[0]; int min=point[0];
            for(int i=1; i<judgeNum; i++){//max,min????´¢
                if(point[i]>max){
                    max=point[i];
                }
                if(point[i]<min){
                    min=point[i];
                }
            }
            int pointSum=point[0];//????´?????¨?
            for(int i=1; i<point.length; i++){
                pointSum+=point[i];
            }
            int endPoint=(pointSum-max-min)/(judgeNum-2);
            System.out.println(endPoint);


        }
    }
}

Measured memory_bytes: 28916
#include <iostream>
#include <vector>
using namespace std;
int main() {
  int n, i, cnt=1;
  cin >> n;
  vector<int> vec(n);
  for (i=0; i<n; i++)
    cin >> vec.at(i);
  for (i=0; ; ) {
    if (vec.at(i)==2) {
      break;
    }
    else {
      cnt++;
      i=vec.at(i)-1;
      if (cnt>n) {
        cout << -1 << endl;
        return 0;
      }

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

Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<math.h>
#include<string>
#include<vector>
#include<queue>
#include<deque>
#include<iomanip>
#include<map>
using namespace std;
typedef pair<int, pair<int, int> >PP;
typedef long long ll;
typedef pair<int, int>P;
typedef vector<int>vec;
int inf=-1;
ll mod = pow(10, 9) + 7;
 
int main(){
    int n,k;string s;
    cin>>n;
    int a[100010];
    int sum=0;
    int x[100010];
    for(int i=0;i<n;i++){
        cin>>a[i];
        sum+=a[i];
    }
    int c=0;
    for(int i=1;i<n-1;i+=2){
        c+=2*a[i];
    }
    x[0]=sum-c;
    for(int i=1;i<n;i++){
        x[i]=2*a[i-1]-x[i-1];
    }
    for(int i=0;i<n;i++){
        cout<<x[i]<<' ';
    }
    cout<<endl;
    return 0;
}

Measured memory_bytes: 2048
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

class CumulativeSum {
    vector<ll> numbers;
    vector<ll> sums;

public:
    CumulativeSum(int n) {
        numbers.resize(n);
        sums.resize(n);
    }

    void set(int i, ll value) {
        numbers[i] = value;
    }

    ll getSum(int i) {
        if (i == -1) return 0;
        if (i == sums.size()) return sums.back();
        return sums[i];
    }

    ll getSectionSum(int start, int end) {
        return getSum(end) - getSum(start - 1);
    }

    void build() {
        for (int i = 0; i < numbers.size(); i++) {
            sums[i] = getSum(i - 1) + numbers[i];
        }
    }

};

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

    auto to = [&](char a) {
        if (a == 'A') return 1;
        return 2;
    };

    CumulativeSum scs(s.size()), tcs(t.size());
    rep(i, s.size()) scs.set(i, to(s[i]));
    rep(i, t.size()) tcs.set(i, to(t[i]));
    scs.build();
    tcs.build();

    int q;
    cin >> q;
    rep(_, q) {
        int a, b, c, d;
        cin >> a >> b >> c >> d;
        a--;
        b--;
        c--;
        d--;


        int x = scs.getSectionSum(a, b);
        int y = tcs.getSectionSum(c, d);

        cout << ((x % 3 == y % 3) ? "YES" : "NO") << endl;


    }

}


Measured memory_bytes: 6692
#include<bits/stdc++.h>
using namespace std;
using i64 = int_fast64_t;
#define rep(i, N) for(int (i) = 0; (i) < (N); (i)++)
#define all(v) (v).begin(), (v).end()
#define eb emplace_back
#define Cout(s) cout << s << endl
string Yes(bool b) {if(b){return "Yes";} else {return "No";}}
string YES(bool b) {if(b){return "YES";} else {return "NO";}}

int main(){
	int N, A;
	cin >> N >> A;
	Cout(N*N - A);
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
//#include <regex>

/* g++ -g -std=c++0x */
/* g++ -g -std=c++11 */

using namespace std;

// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

int main()
{
/* #ifndef ONLINE_JUDGE */
/*     freopen("foo", "rt", stdin); */
/* #endif */
    std::ios::sync_with_stdio(false);

    int n;
    cin >> n;
    cout << "ABC" << n << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FI first
#define SE second
#define EPS 1e-9
#define ALL(a) a.begin(),a.end()
#define SZ(a) int((a).size())
#define MS(s, n) memset(s, n, sizeof(s))
#define FOR(i,a,b) for (int i = (a); i <= (b); i++)
#define FORE(i,a,b) for (int i = (a); i >= (b); i--)
#define FORALL(it, a) for (__typeof((a).begin()) it = (a).begin(); it != (a).end(); it++)
#define WHATIS(x) cout << #x << " is " << x << endl;
#define ERROR(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
//__builtin_ffs(x) return 1 + index of least significant 1-bit of x
//__builtin_clz(x) return number of leading zeros of x
//__builtin_ctz(x) return number of trailing zeros of x

using namespace std;
using ll = long long;
using ld = double;
typedef pair<int, int> II;
typedef pair<II, ll> III;
typedef complex<ld> cd;
typedef vector<cd> vcd;

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
    cout << *it << " = " << a << endl;
    err(++it, args...);
}

const ll MODBASE = 1000000007LL;
const int MAXN = 2010;
const int MAXM = 35;
const int MAXK = 510;
const int MAXQ = 200010;

ll L, A, B, M;

vector<vector<ll> > operator* (vector<vector<ll> > a, vector<vector<ll> > b) {
    vector<vector<ll> > res;
    FOR(i,0,2) res.emplace_back(vector<ll> {0,0,0});
    FOR(i,0,2)
        FOR(j,0,2) {
            res[i][j] = 0;
            FOR(k,0,2) res[i][j] = (res[i][j] + a[i][k] * b[k][j] % M) % M;
        }
    return res;
}

vector<vector<ll> > matrixPow(vector<vector<ll> > mat, ll n) {
    vector<vector<ll> > res;
    FOR(i,0,2) res.emplace_back(vector<ll> {0,0,0});
    FOR(i,0,2) res[i][i] = 1;
    while (n > 0) {
        if (n & 1LL) res = res * mat;
        mat = mat * mat;
        n >>= 1LL;
    }
    return res;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(nullptr);
    cin >> L >> A >> B >> M;
    L--;
    ll upperb = 10, fi = 0;
    ll res = 0;
    FOR(cs,1,18) {
        ll l = fi, r = L;
        while (l <= r) {
            ll mid = (l + r) / 2;
            if (A + B * mid < upperb) l = mid + 1;
            else r = mid - 1;
        }
        if (r >= fi && r <= L && A + B * r < upperb) {
            // cout << fi << ' ' << r << endl;
            vector<vector<ll> > mat;
            FOR(i,0,2) mat.emplace_back(vector<ll> {0,0,0});
            mat[0][0] = upperb % M; mat[0][1] = 1; mat[0][2] = 0;
            mat[1][0] = 0;          mat[1][1] = 1; mat[1][2] = B % M;
            mat[2][0] = 0;          mat[2][1] = 0; mat[2][2] = 1;

            mat = matrixPow(mat, r - fi + 1);
            // FOR(i,0,2) {
            //     FOR(j,0,2) cout << mat[i][j] << ' ';
            //     cout << endl;
            // }
            // cout << endl;
            ll D = (A + fi * B) % M;

            res = (mat[0][0] * res % M + mat[0][1] * D % M + mat[0][2]) % M;
            fi = r + 1;
        }
        upperb *= 10;
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 256
import sys
import copy
import math
import itertools
import numpy as np

l = [int(c) for c in input().split()]
A=l[0]
B=l[1]
S=input()

if S[A] == "-" and str.isdecimal(S[0:A]+S[A+1:A+B]):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 27104
#include <stdio.h>

#include <algorithm>
#include <cmath>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <queue>
#include <string>
#include <utility>
#include <vector>

#define ALL(g) (g).begin(), (g).end()
#define REP(i, x, n) for (int i = x; i < n; i++)
#define rep(i, n) REP(i, 0, n)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define pb push_back

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
const int mod = 1e9 + 7, INF = 1 << 30;
const double EPS = 1e-12, PI = 3.1415926535897932384626;
const int MAX_N = 100001;
const ll LINF = 100000000000000000;

ll h[MAX_N], N, A, B;

bool calc(ll x) {
  ll cnt = 0;
  rep(i, N) {
    ll rest = h[i] - B * x;
    if (rest > 0) {
      cnt += (rest + A - B - 1) / (A - B);
    }
  }
  return cnt <= x;
}

int main() {
  cin >> N >> A >> B;
  rep(i, N) { scanf("%lld", &h[i]); }
  ll ng = 0;
  ll ok = LINF;
  while (abs(ok - ng) > 1) {
    int mid = (ok + ng) / 2;
    if (calc(mid))
      ok = mid;
    else
      ng = mid;
  }
  cout << ok << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
typedef long long ll;
const ll M=1000000007;
//------------------------------------------//

int main(){
  char C[3];
  rep(i,3) cin>>C[i];
  if(C[0]=='R' &&C[1]=='R' &&C[2]=='R') cout<<3<<endl;
  else if((C[0]=='R' &&C[1]=='R') ||(C[1]=='R' &&C[2]=='R')){
    cout<<2<<endl;
  }
  else if(C[0]=='R' ||C[1]=='R' ||C[2]=='R') cout<<1<<endl;
  else cout<<0<<endl;
}
  

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

int main() {
  string a, b;
  cin >> a >> b;
  int n = stoi(a+b);
  
  int root = sqrt(n);
  if (root * root == n) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <cmath>
#include <stack>
#include <iomanip>
#include <functional>
#include <array>
#include <memory>
#include <bitset>
#include <unordered_set>
#include <unordered_map>
#include <numeric>
#undef NDEBUG
#include <assert.h>

using namespace std;
typedef long long ll;

int n;
ll a[(int)2e5];
ll cs[(int)2e5];
ll ans = 1e18;

void eval(int i, int j, int k) {
	if (0 <= i && i < j && j < k && k < n - 1) {
		ll sums[] = {
			cs[i],
			cs[j] - cs[i],
			cs[k] - cs[j],
			cs[n-1] - cs[k]
		};
		ans = min(ans, *max_element(sums, sums + 4) - *min_element(sums, sums + 4));
	}
}

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

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

	partial_sum(a, a + n, cs);

	for (int j = 0; j < n; ++j) {
		// [0 -> j), [j -> n)


		int i = lower_bound(cs + 0, cs + j, (cs[j - 1] + 1) / 2) - cs; // i], i-1]
		int k = lower_bound(cs + j, cs + n, (cs[j - 1] + (cs[n - 1] - cs[j - 1] + 1) / 2)) - cs;
		eval(i, j - 1, k);
		eval(i - 1, j - 1, k);
		eval(i, j - 1, k - 1);
		eval(i - 1, j - 1, k - 1);
	}

	cout << ans;
	return 0;
}

Measured memory_bytes: 3328
//
//  main.c
///
//  main.c
//  uafh
//
//  Created by x19012xx on 2019/10/03.
//  Copyright © 2019 AIT. All rights reserved.
//
//
#include <stdio.h>

#define MaxCard (13)

int main(void){
    char ExitMark[] = {'S','H','C','D'};
    int AllNumber[4][MaxCard];
    
    int x,y,z,n;
    
    int CardNumber;
    char CardMark;
    
    char Garbage;
    
    //初期化
    for(x=0;x<4;x++){
        for(y=1;y<=MaxCard;y++){
            AllNumber[x][y] = 0;
        }
    }
    
    scanf("%d",&n);
    for(z=0;z<n;z++){
        scanf("%c",&Garbage); //バックスラッシュ格納用
        scanf("%c %d",&CardMark,&CardNumber);
        for(x=0;x<4;x++){
            if(ExitMark[x] == CardMark){
                AllNumber[x][CardNumber]++; //入力されたところの番号がずれる
            }
        }
    }
    
    //ずれてないところを印字
    for(x=0;x<4;x++){
        for(y=1;y<=MaxCard;y++){
            if(AllNumber[x][y] == 0){
                printf("%c %d\n",ExitMark[x],y);
            }
        }
    }
}



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

using namespace std;
using ll = long long;
using pii = pair<int, int>;

int M;
int K;
int A[1000010];

int main(){

    
    
    cin >> M >> K;
    
    if((1 << M) <= K){
        cout << -1 << endl;
    }
    else if(M == 1){
        if(K > 0){
            cout << -1 << endl;
        }
        else{
            cout << "0 0 1 1"  << endl;
        }
    }
    else{
        for(int i = 0; i < (1 << M); i++){
            A[i] = i;
        }
        swap(A[(1 << M) - 1], A[K]);
        int idx =  (1 << M);
        for(int i = (1 << M) - 2;i >= 0 ; i--){
            A[idx] = A[i];
            idx++;
        }
        A[(1 << (M + 1)) - 1] = K;
        for(int i = 0; i < (1 << M) * 2; i++)
            cout << A[i] << " ";
        cout << endl;
    }


    // int N = 4;
    // for(int i = 0; i < N; i++){
    //     A[i] = i;
    //     A[i + N] = i;
    // }
    // sort(A, A + 2*N);
    // do{
    //     set<int> tmps;
    //     for(int i = 0; i < 2*N; i++){
    //         for(int j = i + 1; j < 2*N; j++){
    //             if(A[i] == A[j]){
    //                 int tmp = 0;
    //                 for(int k = i; k <= j; k++){
    //                     tmp ^= A[k];
    //                 }
    //                 tmps.insert(tmp);                    
    //             }
    //         }
    //     }
    //     if(tmps.size() == 1){
    //         if(*tmps.begin() != 0){
    //             for(int i = 0; i < 2*N; i++)
    //                 cout << A[i] << " ";
    //             cout << " : " << *tmps.begin() << endl;
    //         }
    //     }
    // }while(next_permutation(A, A + 2*N));

    return 0;
}


Measured memory_bytes: 2816
// "include" {{{
#include <deque>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <deque>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <cstring>
// }}}
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long
const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;

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

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b,c;
	cin >> a >> b >> c;
	int cnt = 0;
	if(a % 2 == 0 && b % 2 == 1 && c % 2 == 1){
		++cnt;
		++b;
		++c;
	}
	else if(a % 2 == 1 && b % 2 == 0 && c % 2 == 0){
		++cnt;
		++b;
		++c;
	}
	else if(a % 2 == 0 && b % 2 == 1 && c % 2 == 0){
		++cnt;
		++a;
		++c;
	}
	else if(a % 2 == 1 && b % 2 == 0 && c % 2 == 1){
		++cnt;
		++a;
		++c;
	}
	else if(a % 2 == 0 && b % 2 == 0 && c % 2 == 1){
		++cnt;
		++a;
		++b;
	}
	else if(a % 2 == 1 && b % 2 == 1 && c % 2 == 0){
		++cnt;
		++a;
		++b;
	}
	while(!(a == b && b == c)){
		if(a == min({a,b,c})){
			a += 2;
			++cnt;
		}
		else if(b == min({a,b,c})){
			b += 2;
			++cnt;
		}
		else if(c == min({a,b,c})){
			c += 2;
			++cnt;
		}
	}

	cout << cnt << '\n';

	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>

using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
const int MAXN = 123456;
const LL MOD = (LL)1e9 + 7;

vector<int> G[MAXN];
LL dp[MAXN][2], tmp[MAXN][3];

void dfs(int cur, int par) {
   int pre = 0;
   tmp[0][0] = tmp[0][1] = 1;
   for (auto i : G[cur]) {
       if (i == par) continue;
       dfs(i, cur);
       //all white
       tmp[i][0] = (tmp[pre][0] * dp[i][0]) % MOD;
       //mixed color
       tmp[i][1] = (tmp[pre][1] * (dp[i][0] + dp[i][1])) % MOD;
       pre = i;
   }
   dp[cur][0] = tmp[pre][1];
   dp[cur][1] = tmp[pre][0];
   //printf("cur = %d w = %lld b = %lld\n", cur, dp[cur][0], dp[cur][1]);
}

int main() {
    int N;
    scanf("%d", &N);
    for (int i = 0; i < N - 1; i++) {
        int x, y;
        scanf("%d %d", &x, &y);
        G[x].push_back(y);
        G[y].push_back(x);
    }
    dfs(1, 1);
    printf("%lld\n", (dp[1][0] + dp[1][1]) % MOD);
    return 0;
}


Measured memory_bytes: 18048
#include <stdio.h>
int main(void){
    // Your code here!
    long n,a,b;
    scanf("%ld %ld %ld", &n, &a, &b);
    
    long q=n/(a+b);
    long r=n%(a+b);
    
    if(r<=a) printf("%ld", q*a+r);
    else printf("%ld", (q+1)*a);
}


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

const int maxn = 700 + 7;

int tot;
int n, m;
int color[maxn];
bool vis[maxn], mat[maxn][maxn];
int o[maxn];
bool ok[maxn], tmp[maxn];

void bfs(int _u) {
  int s[2]; s[0] = s[1] = 0;

  int h = 0, t = 0;
  o[h] = _u;
  vis[_u] = true;
  color[_u] = 0; s[0]++;

  while (h <= t) {
    int u = o[h]; h++;
    for (int i = 1; i <= n; i++) 
      if (mat[u][i]) {
        if (vis[i]) {
          if (color[u] == color[i]) {
            printf("-1\n");
            exit(0);
          }
          continue;
        }
        vis[i] = true;
        color[i] = color[u] ^ 1;
        s[ color[i] ]++;
        o[++t] = i;
      }
  }
  tot += s[0] + s[1];

  for (int i = 0; i <= n; i++) tmp[i] = ok[i], ok[i] = false;

  for (int i = n; i >= 1; i--) 
    if (i - s[0] >= 0 && tmp[i - s[0]]) ok[i] = true;
    else if (i - s[1] >= 0 && tmp[i - s[1]]) ok[i] = true;
}

int main(int argc, char **argv) {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) mat[i][j] = !(i == j);
  for (int i = 1; i <= m; i++) {
    int u, v;
    scanf("%d%d", &u, &v);
    mat[u][v] = mat[v][u] = false;
  }
  ok[0] = true;
  for (int i = 1; i <= n; i++) 
    if (!vis[i]) bfs(i);

  int ans = n * n;
  //assert(tot == n);
  //for (int i = 1; i < n; i++) 
    //assert(ok[i] == ok[n - i]);
  for (int i = n - 1; i >= 1; i--) {
    if (ok[i]) {
      ans = min(ans, i * (i - 1) / 2 + (n - i) * (n - i - 1) / 2);
    }
  }
  printf("%d\n", ans);
  return 0;
}

Measured memory_bytes: 768
def gcd(a,b) :
    while b :
        a,b = b, a % b
    return a

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

if len(L) == 1 :
    if L[0] == K :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"

else :
    for i in range(N-1) :
        q = gcd(L[i],L[i+1])
        if i == 0 :
            p = gcd(L[i],L[i+1])
        if q < p :
            p = q

    if (K % p ==  0) and (K <= max(L)) :
        ans = "POSSIBLE"
    else :
        ans = "IMPOSSIBLE"
print(ans)


Measured memory_bytes: 14224
#include <stdio.h>
#define pr 0.0000001
int main()
{
    double a; int b;
    scanf("%lf %d", &a, &b);
    if(a-13 >= -pr)
        printf("%d\n", b);
    else if(a-13 < pr && a-5>pr)
        printf("%d\n", b/2);
    else if(a-5 <= pr)
        printf("%d\n", 0);
    return 0;
}

Measured memory_bytes: 128
#include<stdio.h>

int main(){
  int n;
  scanf("%d", &n);
  
  int a[n];
  int box[n];
  int i;
  for(i = 0; i < n; i++){
    scanf("%d", a + i);
    *(box + i) = 0;
  }
  
  int m = 0;
  int sum;
  int j;
  for(i = n - 1; i >= 0; i--){
    sum = 0;
    for(j = i + i + 1; j < n; j += i + 1){
      sum += *(box + j);
    }
    if(sum % 2 != *(a + i)){
      *(box + i) = 1;
      m++;
    }
  }
  
  
  printf("%d\n", m);
  for(i = 0; i < n; i++){
    if(*(box + i) != 0){
      printf("%d ", i + 1);
    }
  }
  
  return 0;
}


Measured memory_bytes: 2432
#include <iostream>
#include <sstream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <map>

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

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

using namespace std;

const ll BIG = 1000000007LL;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

template<typename T>
void inputArray(T* p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

template<typename T>
void inputVector(vector<T> * p, int a){
    rep(i, a){
        T input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision = 0) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

const int Max = 110;
int N;

int main(int argc, const char * argv[]) {
    cin >> N;
    output(N*N*N);

    return 0;
}

Measured memory_bytes: 256
# coding: utf-8
# Your code here!


from collections import deque
 
N = int(input())
 
edges = [[] for _ in range(N)]
 
for i in range(N-1):
    u, v = map(int, input().rstrip().split(' '))
    u = u - 1
    v = v - 1
    
    edges[u].append(v)
    edges[v].append(u)
    
X = sorted(list(map(int, input().rstrip().split(' '))), key=lambda x: -x)

temp = deque([0])
 
vertices = [-1] * N
count_vertices = 0
value = 0
while len(temp) > 0:
    a = temp.popleft()
    vertices[a] = X[count_vertices]
    count_vertices += 1
    
    for edge in edges[a]:
        if vertices[edge] == -1:
            temp.append(edge)
 
print(sum(X[1:]))
print(' '.join(list(map(str, vertices))))

 

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

int main(){
  int N,M,A,B;
  cin >> N >> M;
  int count = 0;
  vector<int> H(N);//高さ

  for(int i = 0;i < N;i++){
    cin >> H.at(i);
  }

  vector<int> answer(N,0);

  // vector<vector<int>> graph(N,vector<int>(N,0));//グラフ生成

//   for(int i = 0;i < M;i++){
//     cin >> A >> B;
//     graph.at(A-1).at(B-1)++;
//     graph.at(B-1).at(A-1)++;
//   }
//
// for(int i = 0;i < N;i++){
//   for(int j = 0;j < N;j++){
//     if(i == j) continue;
//     if(graph.at(i).at(j) != 0){
//       if(H.at(i) <= H.at(j)){
//         count--;
//         break;
//       }
//     }
//   }
// }

for(int i = 0;i < M;i++){
    cin >> A >> B;
    if(H.at(A-1) < H.at(B-1)){
      answer.at(A-1)--;
    }else if(H.at(B-1) < H.at(A-1)){
      answer.at(B-1)--;
    }else{
      answer.at(A-1)--;
      answer.at(B-1)--;
    }
  }

  for(int i = 0;i < N;i++){
    if(answer.at(i) == 0){
      count++;
    }
  }


  // for(int i = 0;i < N; i++){
  //   for(int j  = 0;j < N;j++){
  //     cout << graph.at(i).at(j) << " ";
  //   }
  //   cout << endl;
  // }
  cout << count << endl;
  return 0;
}


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

int main()
{
    long long  n,i,j,k,l,a,b,c,gcd,lcm,x,y;
    cin>>n;
    long long arr[n+10];
    for(i=0; i<n; i++)
    {
        cin>>arr[i];

    }
    if(n<2)
    {
        cout<<arr[0]<<endl;
    }
    else if(n>=2)
    {
        k=__gcd(arr[0],arr[1]);
        l=(arr[0]/k)*arr[1];
        for(i=2;i<n;i++)
        {
            a=arr[i];
            b=l;
            c=__gcd(a,b);
            l=(a/c)*b;
        }
        cout<<l<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <string>
#include <vector>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <typeinfo>
#include <numeric>
#include <functional>
#include <unordered_map>
#include <bitset>
#include <stack>

using namespace std;
using ll = long long;
using ull = unsigned long long;

const ll INF = 1e9;
const ll MOD = 1e9 + 7;

#define REP(i, n) for(ll i = 0; i < n; i++)
#define Yes(condition) if(condition){ cout << "Yes" << '\n'; }else{ cout << "No" << '\n'; }
#define YES(condition) if(condition){ cout << "YES" << '\n'; }else{ cout << "NO" << '\n'; }
#define yes(condition) if(condition){ cout << "yes" << '\n'; }else{ cout << "no" << '\n'; }




int main() {
    string s;
    cin >> s;
    ll p = 0, ans = 0;
    REP(i, s.size()){
        if(s[i] == 'W'){
            ans += i - p;
            p++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 640
public class Main {


  private static void solve() {
    int n = ni();
    int[] h = na(n);
    long[] dp = new long[n];

    for (int i = 1; i < n; i ++) {
      if (i < n)
        dp[i] = dp[i - 1] + Math.abs(h[i] - h[i - 1]);
      if (i >= 2)
        dp[i] = Math.min(dp[i], dp[i - 2] + Math.abs(h[i] - h[i - 2]));
    }
    System.out.println(dp[n - 1]);
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 33860
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
//const ll INF = 1LL << 60;
//const int INF = 1001001001;

int main(void){
    int n;
    cin >> n;
    int a[n],b[n];
    REP(i,n) cin >> a[i] >> b[i];
    int cnt=0;
    REP(i,n){
        if(a[i]==b[i])cnt++;
        else cnt=0;
        if(cnt==3){
            cout << "Yes";
            return 0;
        }
    }
    cout << "No";

    return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <tuple>
#include <cstdio>
#include <cmath>
#define rep(i, n) for(i = 0; i < n; i++)
using namespace std;

signed main() {
	string s;
	cin >> s;
	if (s[1] == 'B') cout << "ARC" << endl;
	else cout << "ABC" << endl;
	return 0;
}

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

int main(){
	int A,B,C,D;
	cin>>A>>B>>C>>D;
	int L=A+B;
	int R=C+D;
	
	if(L>R){
    	cout<<"Left"<<endl;
    }
	
	else if(L==R){
    	cout<<"Balanced"<<endl;
    }

	else if(L<R){
    	cout<<"Right"<<endl;
    }
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
  char S[6];

  cin >> S;

  for(int i = 0;i < 5;i++){
    if(S[i] == 'A'){
      if(S[i+1] == 'C'){
	cout << "Yes" << endl;
	return 0;
      }
    }
  }

  cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 256
#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<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)


vector< ll > divisor(ll n) {
  vector< ll > ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return (ret);
}

int main(){
  ll n,m;
  cin >> n >> m;  
  vector<ll> div;
  div=divisor(m);
  ll ans=1;
  for(int i=0; i<div.size();i++){
    if(div[i]*n<=m){
      ans=max(ans,div[i]);
    }
  }
  cout << ans << endl;
  return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using vi = vector<int>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

const int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    int n;
    cin >> n;
    vi p(n);
    rep(i, n) cin >> p[i];

    int res = 0;

    for (int i = 1; i < n-1; i++) {
        if (p[i-1] > p[i] && p[i] > p[i+1]) res++;
        else if (p[i+1] > p[i] && p[i] > p[i-1]) res++;
    }

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


Measured memory_bytes: 256
#include <stdio.h>
int main()
{
  float xa1,ya1,xa2,ya2,xb1,yb1,xb2,yb2;
  while((scanf("%f%f%f%f%f%f%f%f",&xa1,&ya1,&xa2,&ya2,&xb1,&yb1,&xb2,&yb2))
	!= EOF) {
    if(xb2 < xa1 || xa2 < xb1 || ya2 < yb1 || yb2 < ya1) printf("NO\n");
    else printf("YES\n");
  }
  return 0;
}

Measured memory_bytes: 0
N = input()
a = int(N[-1])
if int(N[-1]) == 2 or int(N[-1]) == 4 or int(N[-1]) == 5 or int(N[-1]) ==7 or int(N[-1]) ==9:
    print('hon')
elif a == 0 or a == 1 or a == 6 or a == 8:
    print('pon')
else:
    print('bon')

Measured memory_bytes: 61628
#include <stdio.h>
#define N 101

int main() {
  int i, j, n, a[N], v;
  scanf("%d", &n);
  for(i = 0; i < n; i++) {
    scanf("%d", &a[i]);
  }
  for(i = 1; i < n; i++){
    for(j = 0; j < n; j++) {
      printf("%d", a[j]);
      if(j < n-1){
        printf(" ");
      }
    }
    v = a[i];
    j = i - 1;
    while(j >= 0 && a[j] > v) {
      a[j+1] = a[j];
      j--;
    }
    a[j+1] = v;
    printf("\n");
  }
  for(j = 0; j < n; j++){
    printf("%d", a[j]);
    if(j < n-1){
      printf(" ");
    }
  }
  printf("\n");
  return 0;
}

Measured memory_bytes: 2696
#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}
typedef long long ll;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}

void solve() {
    string s;
    cin >> s;
    set<char> ss;
    REP(i,3) ss.insert(s[i]);
    auto ans = (ss.size()==2)? "Yes" : "No";
    cout << ans << endl;
}

int main() {
    solve();
    return 0;
}


Measured memory_bytes: 256