akhauriyash/Code-Regression huggingface dataset:
#include<stdio.h>
#include<iostream>
#include<string.h>
#include <iomanip>
#include<math.h>
#include<queue>
#include<vector>
#include<algorithm>
#define Max (int)105
#define MAX2 (int)1e5+5
#define MOD ((int)1e9+7)
using namespace std;

int check(int i,char s[]){
	if(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T')
		return 1;
	return 0;
}


int main(){
	char s[100];
	int i,j;
	scanf("%s",s);
	int len = strlen(s);
	int l1,max=0;
	for(i=0;i<len;i++){
		if(check(i,s) == 0)
			continue;
		l1 = 1;
		for(j=i+1;j<len;j++){
			if(check(j,s) == 0)
				break;
			l1++;
		}

		if(max < l1)
			max = l1;
	}

	printf("%d\n",max);
}










/*
Atcoder Dp G-Longest Path iterative solution

vector<int>vec[Max];
queue<int>q;

int dp[Max];
int vis[Max];

void init(){
	int i;
	for(i=0;i<Max;i++){
		dp[i] = 0;
		vis[i] = 0;
	}
}

int getMax(int a,int b){
	return (a<b)?b:a;
}

void solve(int x){
	int i,u;
	q.push(x);

	while(!q.empty()){
		u = q.front();
		q.pop();

		if(vis[u])
			continue;
		vis[u] = 1;
		
		for(i=0;i<vec[u].size();i++){
			dp[vec[u][i]] = getMax(dp[vec[u][i]],dp[u]+1);
			q.push(vec[u][i]);
		}
	}

}

int main(){
	int n,m,incoming[Max],x,y,i;
	for(i=0;i<Max;i++)
		incoming[i] = 0;
	
	init();

	scanf("%d%d",&n,&m);
	for(i=0;i<m;i++){
		scanf("%d%d",&x,&y);
		vec[y].push_back(x);
		incoming[x]++;
	}
	
	for(i=1;i<=n;i++)
		solve(i);
	
	int max = 0;
	for(i=0;i<Max;i++)
		max = getMax(max,dp[i]);
	
	printf("%d\n",max);
	return 0;
}
*/

Measured memory_bytes: 256
# import sys
# input = sys.stdin.readline

def mp(): return map(int, input().split())
def lmp(): return list(map(int, input().split()))

s = list(input())
t = list(input())
ans = 0
for i in range(len(s)):
    if s[i] != t[i]:
        ans += 1
print(ans)




Measured memory_bytes: 12524
a, b = map(int, input().split())

ans = ''
for i in range(100):
    if b == 0:
        ans = '0'
        break
    if b == 1:
        if a == 0:
            ans = '1'
            break
        if a == 1:
            ans = '0'
            break
            
    n = 2 ** i
    if n > b:
        break

    if n == 1:
        num_1 = (a+1) // 2
        if (a+1) % 2 == 0 and a != 0:
            num_1 -= 1
        num_2 = (b+1) // 2
        if (num_2 - num_1) % 2 ==  0:
            ans += '0'
        else:
            ans += '1'
        continue
        
    r = (b + 1) % (2*n)
    if r == 0:
        num_1 = n
    elif r > n:
        num_1 = r - n
    else:
        num_1 = 0
    
    r = (a + 1) % (2*n)
    if r == 0:
        num_2 = 1
    elif r > n:
        num_2 = (2*n - r +1)
    else:
        num_2 = n

    if (num_1 + num_2) % 2 == 0:
        ans += '0'
    else:
        ans += '1'

print(int(ans[::-1], 2))    

Measured memory_bytes: 3064
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
using namespace std;
const int N=200005;
struct data{
	int to,next;
}e[N<<1];
int head[N],gs,m,n,x,y;
int col[N],flag;

void add(int fr,int to)
{
	e[++gs].to=to,e[gs].next=head[fr],head[fr]=gs;
	e[++gs].to=fr,e[gs].next=head[to],head[to]=gs;
}

void dfs(int u,int c)
{
	col[u]=c;
	for(int i=head[u];i;i=e[i].next)
	{
		int v=e[i].to;
		if(col[v]==-1)
		{
			dfs(v,c^1);
		}
		else
		{
			if(col[v]==col[u])  flag=1;
			else    continue;
		}
	}
}

int main()
{
	//freopen("1.txt","r",stdin);
	
	scanf("%d%d",&n,&m);
	for(int i=1;i<=m;++i)
	{
		scanf("%d%d",&x,&y);
		add(x,y);
	}
	memset(col,-1,sizeof(col));
	dfs(1,0);
	if(flag)
	{
		cout<<(long long)n*(n-1)/2-m;
	}
	else
	{
		long long cnt=0;
		for(int i=1;i<=n;++i)
			if(col[i])  cnt++;
		cout<<(long long)cnt*(n-cnt)-m;
	}
	return 0;
}

Measured memory_bytes: 4736
I=lambda:map(int,input().split())
n,m=I()
l=[[]for _ in range(n+1)]
for i in range(m):
  p,y=I()
  l[p].append([y,i])
a=[]
for p in range(1,n+1):
  l[p].sort()
  for i,t in enumerate(l[p]):
    a.append([t[1],'%06d'%p+'%06d'%-~i])
a.sort()
for t in a:
  print(t[1])

Measured memory_bytes: 48568
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

a,b = mi()

for i in range(1,1009,1):
    if math.floor(i*0.08) == a and math.floor(i*0.10) == b:
        print(i)
        exit()
print(-1)


Measured memory_bytes: 9036
#include<iostream>
#include<algorithm>

using namespace std;

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

	cout << "NO" << endl;


	return 0;
}

Measured memory_bytes: 256
/*   --------------------
    |       LOSER        |
    |     ~NOOBOSS~      |
     --------------------
*/
#include <bits/stdc++.h>
using namespace std;

#define      inl(x)              scanf("%lld",&x)
#define      in(x)               scanf("%d",&x)
#define      mxx                 10000000000000
#define      mnn                 -10000000000000
#define      Y()                 cout<< "YES" <<endl
#define      N()                 cout << "NO"<<endl
#define      endl                "\n"
#define      max_3(a,b,c)        max(a, max(b,c))
#define      max_4(a,b,c,d)      max(a,max(b,max(c,d)))
#define      min_3(a,b,c)        min(a, min(b,c))
#define      min_4(a,b,c,d)      min(a,min(b,min(c,d)))
#define      gcd(a,b)            __gcd(a,b)
#define      lcm(a,b)           (a*b)/gcd(a,b)
#define      loser               return 0
#define      ll                  long long
#define      PI                  acos(-1)
#define      mem(a,v)            memset(a,v,sizeof(a))
#define      SORT(v)             sort(v.begin(),v.end())
#define      REV(v)              reverse(v.begin(),v.end())
#define      O(x)                cout<<x<<endl
#define      B                   begin()
#define      E                   end()
#define      V                   vector
#define      F                   first
#define      S                   second
#define      PSB                 push_back
#define      EMB                 emplace_back
#define      MP                  make_pair
#define      PII                 pair<int,int>
#define      MII                 map<int,int>
#define      FAST()              ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
const ll MOD = 998244353;
//auto it=std:: unique(v.B,v.E);
//v.resize(std::distance(v.B,it));
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
/*-----*/
#define bug1(a)  cout<<a<<endl;
#define bug2(a,b)  cout<<a<<" "<<b<<endl;
#define bug3(a,b,c)  cout<<a<<" "<<b<<" "<<c<<endl;
/*----*/
ll power(ll n,ll p){if(p==0) return 1;if(p==1)return n;if(p%2)return power(n,p-1)*n;else{ll x=power(n,p/2);return x*x;}}
ll binpow(ll a, ll b){ll res = 1;while (b > 0) {if (b & 1)res*=a;a*=a;b>>=1;}return res;}
ll fact(ll num){ll fac=1;while(num!=1){fac=fac*num;num--;}return fac;}
string to_binary(int x) {string s;while(x > 0) {s += (x % 2 ? '1' : '0');x /= 2;}reverse(s.begin(), s.end());return s;}
ll nsum(ll num){return (num*(num+1))/2;}
/*-----*/
const int N=2e5+5;

/*-----*/
//vector<int> v[202];

/*-----*/
int main()
{
	FAST();

       ll test=1;
       //cin>>test;
       while(test--){
           ll n;
           string s;
           char ch;
           cin>>ch;
           if(ch>='A' && ch<='Z')
            cout<<"A"<<endl;
           else
            cout<<"a"<<endl;

        }
	loser;
}
///////LeArN MoRe AnD Wait FoR ThE Result///////


Measured memory_bytes: 3652
import java.io.*;

class Main {
	public static void main(String[] arg)throws IOException{
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String str = br.readLine();
		String[] div = str.split(" ");
		int s =  Integer.parseInt(div[0]);
		int l =  Integer.parseInt(div[1]);
		System.out.println(s*l + " "+ 2*(s+l));
    }   
}

Measured memory_bytes: 24400
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,a,b) for(int i =(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define REPS(i,n) for(int i=1;i<=(n);i++)
#define RREPS(i,n) for(int i=(n);i>0;i--)
#define mp make_pair
#define pb(a) push_back(a)
typedef long long ll;

int main(){
  ll N;
  cin >> N;
  for(ll h = 1;h <= 3500;h++){
    for(ll n = 1;n <= 3500;n++){
      if(N*(n+h) < 4*h*n){
        if(N*h*n%(4*h*n-N*(n+h)) == 0){
          ll w = N*h*n/(4*h*n-N*(n+h));
          printf("%lld %lld %lld\n",h,n,w);
          return 0;
        }
      }
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define eps 1e-9
#define maxp 1004
#define mod 998244353
#define sin(s) scanf("%lld",&s);
#define sout(s) printf("%lld\n",s);
#define in(s) cin>>s
#define in2(a,b) cin>>a>>b
#define in3(a,b,c) cin>>a>>b>>c
#define vll vector<ll>
#define out(s) cout<<s
#define outs(s,a) cout<<s<<a
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define gear_change ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0)
#define nfl(i,n) for(i=0;i<n;i++)
#define sfl(i,s,e) for(i=s;i<e;i++)
#define ufl(i,n) for(i=n-1;i>=0;i--)
void solve(){
    ll s,w;
    in2(s,w);
    if(w>=s){
        cout<<"unsafe\n";
    }else{
        cout<<"safe\n";
    }
}
int main(){
    clock_t t1=clock();
    gear_change;
    ll test=1;
    // in(test);
    while(test--){
        solve();
    }
    clock_t t2=clock();
    cerr<<"Time elapsed:- "<<(double)(t2-t1)/CLOCKS_PER_SEC<<'\n';
}    

Measured memory_bytes: 3780
#include <stdio.h>
#include <stdlib.h>
//#include <string.h>
//#include <stdbool.h>
//#include <limits.h>
//#include <math.h>

int main() {
  int n;
  scanf("%d", &n);
  int a[n], min = 0, max = 0, mini, maxi, p, pi;
  for (int i=0; i<n; i++) {
    scanf("%d", a+i);
    if (a[i]<min) {
      min = a[i];
      mini = i;
    }
    if (a[i]>max) {
      max = a[i];
      maxi = i;
    }
  }
  if (abs(min)<abs(max)) {
    p = max;
    pi = maxi;
  } else {
    p = min;
    pi = mini;
  }
  max += p;
  min += p;
  printf("%d\n", 2*n-1);
  for (int i=0; i<n; i++) {
    a[i] += p;
    printf("%d %d\n", pi+1, i+1);
  }
  if (min >= 0) {
    for (int i=1; i<n; i++)
      printf("%d %d\n", i, i+1);
  } else {
    for (int i=1; i<n; i++)
      printf("%d %d\n", n-i+1, n-i);
  }
  return 0;
}


Measured memory_bytes: 128
//B - Trained? 2017/06/24
#include <bits/stdc++.h>
using namespace std;

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

    int ans=1;int cnt=0;
    for(int i=1;i<=n;){
        if(a[i-1]==2) break;
        i=a[i-1];
        ++cnt;
        if(cnt==n+1) {cout << -1 << endl; return 0;}
        ++ans;
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <vector>
#include <limits.h>
#include <math.h>

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

using namespace std;

typedef long long ll;
typedef pair<int,int> Pii;
typedef vector<int> vint;
const int INF = INT_MAX;

int digit_num(ll n){
    int ret = 0;
    while(n>0){
        n/=10;
        ret++;
    }
    return ret;
}

int main() {
    // insert code here...    return 0;
    //////
    // input from txt
    /*
     std::ifstream in("input.txt");
     std::cin.rdbuf(in.rdbuf());
     std::ofstream out("output.txt");
     std::cout.rdbuf(out.rdbuf());
     ////
     */
    ll N;
    cin >> N;
    int ans = INF;
    for(ll A=1;A*A<=N;A++){
        if(N % A==0){
            ll B = N/A;
            ans = min(ans,digit_num(B));
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256
// https://atcoder.jp/contests/abc145/tasks/abc145_a
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };

    ($iter:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, [ next / $t:tt ]) => {
        {
            let len = read_value!($iter, usize);
            (0..len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
        }
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_macros)]
macro_rules! dvec {
    ($t:expr ; $len:expr) => {
        vec![$t; $len]
    };

    ($t:expr ; $len:expr, $($rest:expr),*) => {
        vec![dvec!($t; $($rest),*); $len]
    };
}

#[allow(unused_macros)]
macro_rules! ifv {
    ($t:expr, $a:expr, $b: expr) => {
        if $t { $a } else { $b }
    }
}

#[allow(unused_macros)]
macro_rules! fill {
    ($t:expr, $v:expr) => {
        for i in 0..$t.len() {
            $t[i] = $v;
        }
    };
}

#[allow(unused_macros)]
macro_rules! join {
    ($t:expr, $glue:expr) => {
        $t.into_iter().map(|w| w.to_string()).collect::<Vec<_>>().join($glue)
    };
}

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    input! {
        r: usize
    };
    println!("{}", r*r);
}


Measured memory_bytes: 4352
import java.util.*;

public class Main {

    static long MOD = 1_000_000_007;

    static int n;
    static char[] l;
    static long[] a;
    static long[] b;

    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        l = sc.next().toCharArray();
        n = l.length;
        a = new long[n];
        b = new long[n];
        Arrays.fill(a, -1);
        Arrays.fill(b, -1);

        System.out.println(calc(0, true));

    }

    static long calc(int depth, boolean exact) {

        if(depth == n) return 1;

        long res = 0;
        if(exact && a[depth] >= 0) {
            return a[depth];
        }
        if(!exact && b[depth] >= 0) {
            return b[depth];
        }

        if(exact) {
            if(l[depth] == '1') {
                res += calc(depth+1, true) * 2 + calc(depth+1, false);
            } else {
                res += calc(depth+1, true);
            }
            a[depth] = res % MOD;
        } else {
            res += calc(depth+1, false) * 3;
            b[depth] = res % MOD;
        }

        return res % MOD;
    }

}


Measured memory_bytes: 39892
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using M = map<string,ll>;

ll MAX=1000007;
ll MOD=1000000007;
vector<ll> F(MAX,1);

void T(){
    for(int i=1;i<MAX;i++){
        F[i]=F[i-1]*i%MOD
    ;}
    return;
}
// mod. m での a の逆元 a^{-1} を計算する
//ただしmとaが互いにその時のみ
long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}




int main(){
    T();
    ll X;
    cin >> X;
    ll Y ;
    cin >> Y ;
    ll ans=0;

    if(!(2*Y-X>=0&&(2*Y-X)%3==0&&2*X-Y>=0&&(2*X-Y)%3==0)){}
    else {ll x=(2*Y-X)/3,y=(2*X-Y)/3;
    ans=(F[x+y]*modinv(F[x],MOD)%MOD)*modinv(F[y],MOD)%MOD;}

cout<<ans<<endl;

return 0;


}  



Measured memory_bytes: 8064
#include <iostream>
#include <string>
using namespace std;
int main(){
	string s;
	string ans="";
	cin >> s;
	for (int i = 0; i < s.size(); ++i)
	{
		switch(s[i]){
			case '0':
			ans+="0";
			break;
			case '1':
			ans+="1";
			break;
			case 'B':
			if(!ans.empty()) ans.erase(ans.size()-1);
			break;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize(2)
#include<iostream>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<string>
#include<algorithm>
#include<map>
#include<vector>
#include<set>
#include<queue>
#include<stack>
#define lowbit(n) (n&(-n))
#define ls x<<1
#define rs x<<1|1
#define clc(a, b) memset(a, b, sizeof(a))
#define Buff ios::sync_with_stdio(false)
#define rush() int Case = 0; int T; scanf("%d", &T);  while(T--)
#define rep(i, a, b) for(int i = a; i <= b; i ++)
#define per(i, a, b) for(int i = a; i >= b; i --)
#define reps(i, a, b) for(int i = a; b; i ++)
#define read(a) scanf("%d", &a)
#define readd(a) scanf("%lf", &a)
#define readl(a) scanf("%lld", &a)
#define readc(a) scanf("%c", &a)
#define reads(a) scanf("%s", a)
#define sqr(x) x*x
#define pb push_back
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int>PII;
const int mod = 1e9 + 7;
const double eps = 1e-6;
const int N = 3e5+7;
int a[N], f[N];
struct BIT {
    int n, bit[N];
    void init()
    {
        clc(bit, 0), clc(f, 0);
    }
    int query(int l, int r)
    {
        int res = f[r];
        for(; r > l; )
        {
            for(r --; r - lowbit(r) >= l; r -= lowbit(r))
                res = max(res, bit[r]);
            res = max(res, f[r]);
        }
        return res;
    }
    void modify(int p, int v)
    {
        f[p] = v;
        for(int i = p; i <= n; i += lowbit(i))
        {
            bit[i] = v;
            for(int j = 1; j < lowbit(i); j <<= 1)
                bit[i] = max(bit[i], bit[i-j]);
        }
    }
} tree;
int main()
{
    Buff;
    int n, k, maxv = 0, res = 0;
    cin >> n >> k;
    tree.init();
    rep(i, 1, n)
    {
        cin >> a[i];    a[i] ++;
        maxv = max(maxv, a[i]);
    }
    tree.n = maxv;
    for(int i = 1; i <= n; i ++)
    {
        int l = max(1, a[i]-k);
        int r = min(maxv, a[i]+k);
        int t = tree.query(l, r);
//        cout <<"t:"<< t <<endl;
        res = max(res, t + 1);
        tree.modify(a[i], t+1);
    }
    cout << res <<endl;
    return 0;
}


Measured memory_bytes: 6644
/*
	Failure is not the reason for you to stop trying 
	   it is actually a remainder that you should 
			KEEP GOING 
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define SaveTime ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back 
#define eb emplace_back
#define fn for(int i =0 ;i <n;i++)
#define fn1 for( int i =1;i<=n;i++)
#define fm for(int j =0 ;j <m;j++)
#define fm1 for(int j =1;j<=m;j++)
#define fi first
#define se second
#define MOD 1000000007
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
const int N = 1e6+5;
const int INF = 1e18L;
int ar[N];
int dp[N];
signed main(){
	// #ifndef ONLINE_JUDGE
	// freopen("input.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
	SaveTime;
	int T=1;
	// cin >> T;
	while(T--){
		int x,y;
		cin >> x>>y;
		ar[x]++;
		ar[y]++;
		for(int i =1;i<=3;i++){
			if(ar[i]==0)return cout<<i,0;
		}
	
	}
	
	cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
	return 0;
}



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

typedef long long ll;
const ll mod = 1e9 + 7;
const int N=2000000;
const int M=2000;

void Run()
{
     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
int main()
{
    Run();
    int r,l,d,cnt=0;
    cin>>r>>l>>d;
    for(int i=r;i<=l;i++)
    {
        if(i%d==0)
            cnt++;
    }
    cout<<cnt;
}


Measured memory_bytes: 3596
import sys
from collections import defaultdict
from heapq import *
sys.setrecursionlimit(200000)
input = sys.stdin.readline

# N, M, = map(int, input().split())
# L = [int(v) * -1 for v in input().split()]

S = input().strip()

a = [ "Sunny", "Cloudy", "Rainy" ]

for i in range(3):
    if a[i] == S:
        print(a[(i + 1) % 3])

Measured memory_bytes: 3316
//#pragma comment(linker, "/STACK:102400000,102400000")
#include <fstream>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <cassert>
//#include <unordered_map>
//#include <unordered_set>
using namespace std;

typedef long long ll;
#define eps 1e-8
#define LL_INF 0x3fffffffffffffff
#define INF 0x3f3f3f3f
#define mem(a, b) memset(a, b, sizeof(a))
#define pper(i,n,m) for(int i = n;i >= m; i--)
#define repp(i, n, m) for (int i = n; i <= m; i++)
#define rep(i, n, m) for (int i = n; i < m; i++)
#define sa(n) scanf("%d", &(n))
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define DE(val) cout<<#val<<": "<<val<<endl;

const int dx44[5] = { 0,-1,-1,1,1 };
const int dy44[5] = { 0,-1,1,-1,1 };

const int dx4[5] = { 0,-1,0,1,0 };
const int dy4[5] = { 0,0,1,0,-1 };
const int dx8[9] = { 0,-1,0,1,0,1,1,-1,-1 };
const int dy8[9] = { 0,0,1,0,-1,1,-1,1,-1 };
const int maxn = 3e5 + 5;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
ll po(ll a, ll b, ll mod) { ll res = 1; a %= mod; for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }
ll gcd(ll a, ll b) { if (a == 0) { return b; } else { return gcd(b%a, a); } }
void YES() { puts("YES"); exit(0); }
void Yes() { puts("Yes");}// exit(0); }
void NO() { puts("NO"); exit(0); }
void No() { puts("No");}// exit(0); }
void one() { puts("-1"); exit(0); }

int n;
map<int,int>hax;
void solve()
{
	sa(n);
	repp(i,1,n)
	{
		int x;
		sa(x);
		hax[x]++;
	}
	ll res=0;
	int pre=0;
	for(auto it:hax)
	{
		if(it.second>=4)
		{
			res=max(res,1LL*it.first*it.first);
			pre=it.first;
		}
		else if(it.second>=2)
		{
			res=max(res,1LL*pre*it.first);
			pre=it.first;
		}
	}
	cout<<res<<endl;
}

int main()
{
	solve();
	// system("pause");
	return 0;
}





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

int n, a[100010], mx, mn = 1e9;
set<int> ss;

void T_T(){ puts("No"); exit(0); }
void O_O(){ puts("Yes"); exit(0); }

int main(){
	scanf("%d", &n);
	for(int i = 1; i <= n; i++){
		scanf("%d", a + i);
		mx = max(mx, a[i]);
		mn = min(mn, a[i]);
		ss.insert(a[i]);
		if(ss.size() > 2) T_T();
	}
	if(ss.size() == 1){
		if(mx == n - 1 || mx <= n / 2) O_O();
		T_T();
	}
	else{
		if(mx - mn != 1) T_T();
		int c = 0;
		for(int i = 1; i <= n; i++) if(a[i] == mn) c++;
		if(mx - c <= 0 || (n - c) / 2 < mx - c) T_T();
		O_O();
	}
}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <complex>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <bitset>
#include <ctime>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <cassert>
#include <cstddef>
#include <iomanip>
#include <numeric>
#include <tuple>
#include <sstream>
#include <fstream>
#include <functional>

using namespace std;
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define FOR(i, a, b) for (int (i) = (a); (i) < (b); (i)++)
#define RREP(i, a) for(int (i) = (a) - 1; (i) >= 0; (i)--)
#define FORR(i, a, b) for(int (i) = (a) - 1; (i) >= (b); (i)--)
#define DEBUG(C) cerr << #C << " = " << C << endl;
using LL = long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<LL>;
using VVL = vector<VL>;
using VD = vector<double>;
using VVD = vector<VD>;
using PII = pair<int, int>;
using PDD = pair<double, double>;
using PLL = pair<LL, LL>;
using VPII = vector<PII>;
template<typename T> using VT = vector<T>;
#define ALL(a) begin((a)), end((a))
#define RALL(a) rbegin((a)), rend((a))
#define SORT(a) sort(ALL((a)))
#define RSORT(a) sort(RALL((a)))
#define REVERSE(a) reverse(ALL((a)))
#define MP make_pair
#define FORE(a, b) for (auto &&a : (b))
#define EB emplace_back
#define GREATER(T) T, VT<T> greater<T>
template<typename T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}

const int INF = 1e9;
const int MOD = INF + 7;
const LL LLINF = 1e18;

int N;
int x[10], y[10];

long double calc(int i, int j) {
    return sqrtl((x[i] - x[j]) * (x[i] - x[j]) + (y[i] - y[j]) * (y[i] - y[j]));
}

long bikkuri(int v) {
    long res = 1;
    while (v > 0) {
        res *= v;
        v--;
    }
    return res;
}

int main(void) {
    cin >> N;
    REP(i, N) {
        cin >> x[i] >> y[i];
    }

    VI v(N);
    iota(ALL(v), 0);
    long double sum = 0;
    do {

        long double cur = 0;
        FOR(i, 1, N) {
            cur += calc(v[i - 1], v[i]);
        }
        sum += cur;

    } while (next_permutation(ALL(v)));

    cout << fixed << setprecision(10) <<  sum / bikkuri(N) << endl;
}


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

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

int main() {
  double l;
  cin >> l;
  double a,b,c;
  a=l/3;
  b=l/3;
  c=l/3;
  double ans=a*b*c;
  cout <<setprecision(15) << ans <<endl;

  return 0;

}

Measured memory_bytes: 3716
import java.util.*;
import java.lang.*;
import java.math.*;
import java.io.*;

import static java.lang.Math.*;
import static java.util.Arrays.*;

public class Main{

	Scanner sc=new Scanner(System.in);

	int INF=1<<28;
	double EPS=1e-9;

	int m, n;
	int[][] a;
	int sx, sy, gx, gy;
	int[] dxs={0, 0, -1, 1};
	int[] dys={-1, 1, 0, 0};

	void run(){
		for(;;){
			m=sc.nextInt();
			n=sc.nextInt();
			if((m|n)==0){
				break;
			}
			a=new int[n][m];
			for(int j=0; j<n; j++){
				for(int i=0; i<m; i++){
					int c=sc.nextInt();
					if(c==2){
						sx=i;
						sy=j;
					}else if(c==3){
						gx=i;
						gy=j;
					}else{
						a[j][i]=c;
					}
				}
			}
			solve();
		}
	}

	int ans;

	void solve(){
		ans=11;
		for(int i=0; i<4; i++){
			dfs(sx, sy, dxs[i], dys[i], 1);
		}
		println(""+(ans<11?ans:-1));
	}

	void dfs(int x, int y, int dx, int dy, int c){
		if(c>10){
			return;
		}
		// debug(x, y, dx, dy);
		for(int t=0;; t++){
			x+=dx;
			y+=dy;
			if(x<0||x>=m||y<0||y>=n){
				return;
			}
			if(x==gx&&y==gy){
				ans=min(ans, c);
				return;
			}
			if(a[y][x]==1){
				if(t==0){
					return;
				}else{
					break;
				}
			}
		}
		// debug(x, y);
		a[y][x]=0;
		for(int i=0; i<4; i++){
			dfs(x-dx, y-dy, dxs[i], dys[i], c+1);
		}
		a[y][x]=1;
	}

	void debug(Object... os){
		System.err.println(Arrays.deepToString(os));
	}

	void print(String s){
		System.out.print(s);
	}

	void println(String s){
		System.out.println(s);
	}

	public static void main(String[] args){
		// System.setOut(new PrintStream(new BufferedOutputStream(System.out)));
		new Main().run();
	}
}

Measured memory_bytes: 12000
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main() {
    std::ios::sync_with_stdio(false);
    
    long n, m;
    cin >> n >> m;
    long ar[n][m];
    for(long i = 0; i<n; i++){
        for(long j = 0; j<m; j++){
            cin >> ar[i][j];
            ar[i][j]--;
        }
    }
    bool on[m];
    for(long i = 0; i<m; i++){
        on[i] = true;
    }
    long ans = n;
    while(true){
        bool emp = true;
        for(long i = 0; i<m; i++){
            emp &= !on[i];
        }
        if(emp){
            break;
        }
        long c[m];
        for(long i = 0; i<m; i++){
            c[i] = 0;
        }
        for(long i = 0; i<n; i++){
            for(long j = 0; j<m; j++){
                if(on[ar[i][j]]){
                    c[ar[i][j]]++;
                    break;
                }
            }
        }
        long maxi = 0;
        for(long i = 0; i<m; i++){
            maxi = max(maxi,c[i]);
        }
        for(long i = 0; i<m; i++){
            if(c[i]==maxi){
                on[i] = false;
            }
        }
        ans = min(ans,maxi);
    }
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
const bool DEBUG = true;
#define coutd if(DEBUG) cout 
#define ff first
#define ss second
#define debug(x) cout << "> x:" << x << endl;
#define len(x) int(x.size())
#define all(x) x.begin(), x.end()
using ll = long long;
using ii = pair<ll, ll>;
using vi = vector<ll>;
using vii = vector<ii>;
const double PI = acos(-1);
const double EPS = 1e-9;

int main(){
	ios::sync_with_stdio(0);
	ll n;
	cin >> n;
	vector<ll> vs(n);
	ll s1=0, s2=0;
	for(auto &x:vs) cin >> x, s2+=x;
	ll ans = abs(s1-s2);
	for(auto x:vs){
		s1+=x; s2-=x;
		ans = min(ans, (ll)labs(s1-s2));
	}
	cout << ans << endl;
}


Measured memory_bytes: 1792
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization ("unroll-loops")

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;

const int MX=200005;
ll a[MX];

int main()
{
    int n,k;
    scanf("%d %d",&n,&k);
    for(int i=1;i<=k;i++){
        scanf("%lld",&a[i]);
    }
    for(int i=k+1,j=1;i<=n;i++,j++){
        scanf("%lld",&a[i]);
        if(a[i]>a[j]) puts("Yes");
        else puts("No");
    }
    return 0;
}

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

using namespace std;

const int X = 2e5;

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

    int n, k;
    cin >> n >> k;
    int r, s, p;
    cin >> r >> s >> p;
    string t;
    cin >> t;

    int clen[n];
    int ans = 0;
    for (int i = 0; i < n; i++) {
        clen[i] = i < k || t[i] != t[i-k] ? 1 : clen[i-k] + 1;
        if (clen[i] % 2 == 1) {
            ans += t[i] == 'r' ? p : t[i] == 's' ? r : s;
        }
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 848
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    String s = sc.next();
    String answer = "";
    for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) == '0') {
        answer += "0";
      } else if (s.charAt(i) == '1') {
        answer += "1";
      } else if (s.charAt(i) == 'B' && answer.length() > 0) {
        answer = answer.substring(0, answer.length() - 1);
      }
    }
    System.out.println(answer);
  }
}

Measured memory_bytes: 21716
#include<stdio.h>
int main(void)
{
	int a,b,c,x,y;
	scanf("%d %d %d",&a,&b,&c);
	x=0;
	y=0;
	x=b-a;
	y=c-b;
	if(x==y){
		printf("YES\n");
	}
	else{
		printf("NO\n");
	}
	return 0;
}


Measured memory_bytes: 128
#![allow(non_snake_case, unused)]
use std::cmp::*;
use std::collections::*;

pub fn readln() -> String {
    let mut line = String::new();
    ::std::io::stdin()
        .read_line(&mut line)
        .unwrap_or_else(|e| panic!("{}", e));
    line
}
macro_rules! read {
	($($t:tt),*; $n:expr) => {{
		let stdin = ::std::io::stdin();
		let ret = ::std::io::BufRead::lines(stdin.lock()).take($n).map(|line| {
			let line = line.unwrap();
			let mut it = line.split_whitespace();
			_read!(it; $($t),*)
		}).collect::<Vec<_>>();
		ret
	}};
	($($t:tt),*) => {{
		let line = readln();
		let mut it = line.split_whitespace();
		_read!(it; $($t),*)
	}};
}

macro_rules! _read {
	($it:ident; [char]) => {
		_read!($it; String).chars().collect::<Vec<_>>()
	};
	($it:ident; [u8]) => {
		Vec::from(_read!($it; String).into_bytes())
	};
	($it:ident; [$t:ty]) => {
		$it.map(|s| s.parse::<$t>().unwrap_or_else(|e| panic!("{}", e))).collect::<Vec<_>>()
	};
	($it:ident; $t:ty) => {
		$it.next().unwrap_or_else(|| panic!("input mismatch")).parse::<$t>().unwrap_or_else(|e| panic!("{}", e))
	};
	($it:ident; $($t:ty),+) => {
		($(_read!($it; $t)),*)
	};
}

fn main() {
    let n = read!(usize);
    let mut table = vec![vec![2; n]; n];

    for i in 0..n {
        let a = read!(usize);
        for j in 0..a {
            let l = read!([usize]);
            table[i][l[0]-1] = l[1];
        }
    }

    let mut cnt = 0;
    for bit in 0..1 << n {
        let mut hyp = vec![0; n];
        for i in 0..n {
            hyp[i] = (bit >> i) & 1;
        }

        let mut flag = true;
        for r in 0..n {
            if hyp[r] == 0 {
                continue;
            }
            for c in 0..n {
                let acc = table[r][c];
                if acc == 2 {
                    continue;
                }
                let acc_hyp = hyp[c];
                if acc != acc_hyp {
                    flag = false;
                }
            }
        }
        //
        if flag {
            cnt = max(cnt, hyp.iter().sum());
        }
    }

    println!("{}", cnt);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second
#define endl "\n"

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T> ostream& operator<<(ostream& s,const multiset<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1'000'000'007;
const ll inf=1'000'000'000'000'000'00;
const int INF=1'000'000'000;
const double EPS=1e-10;
const double PI=acos(-1);

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int n;
	cin>>n;
	int ans=0;
	FOR(i,1,n+1){
		int a;
		cin>>a;
		if(i%2 && a%2) ans++;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3648
//#define NDEBUG
#include <cstddef>
#include <cstdint>
#include <vector>

namespace n91 {

	using i8 = std::int_least8_t;
	using i32 = std::int_least32_t;
	using i64 = std::int_least64_t;
	using u8 = std::uint_least8_t;
	using u32 = std::uint_least32_t;
	using u64 = std::uint_least64_t;
	using isize = std::ptrdiff_t;
	using usize = std::size_t;

	class rep {
		const usize f, l;

	public:
		class itr {
			friend rep;
			usize i;
			constexpr itr(const usize x) noexcept : i(x) {}

		public:
			void operator++() noexcept { ++i; }
			constexpr usize operator*() const noexcept { return i; }
			constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
		};
		constexpr rep(const usize first, const usize last) noexcept
			: f(first), l(last) {}
		constexpr itr begin() const noexcept { return itr(f); }
		constexpr itr end() const noexcept { return itr(l); }
	};
	class revrep {
		const usize f, l;

	public:
		class itr {
			friend revrep;
			usize i;
			constexpr itr(usize x) noexcept : i(x) {}

		public:
			void operator++() noexcept { --i; }
			constexpr usize operator*() const noexcept { return i; }
			constexpr bool operator!=(const itr x) const noexcept { return i != x.i; }
		};
		constexpr revrep(usize first, usize last) noexcept : f(--first), l(--last) {}
		constexpr itr begin() const noexcept { return itr(l); }
		constexpr itr end() const noexcept { return itr(f); }
	};
	template <class T> using vec_alias = std::vector<T>;
	template <class T> auto md_vec(const usize n, const T &value) {
		return std::vector<T>(n, value);
	}
	template <class... Args> auto md_vec(const usize n, Args... args) {
		return std::vector<decltype(md_vec(args...))>(n, md_vec(args...));
	}
	template <class T> constexpr T difference(const T &a, const T &b) {
		return a < b ? b - a : a - b;
	}

} // namespace n91

#include <algorithm>
#include <iostream>
#include <utility>
#include <numeric>

namespace n91 {

	void main_() {
		char c;
		std::cin >> c;
		char ans;
		if (c == 'A') {
			ans = 'T';
		}
		else if (c == 'T') {
			ans = 'A';
		}
		else if (c == 'C') {
			ans = 'G';
		}
		else {
			ans = 'C';
		}
		std::cout << ans;
	}

} // namespace n91

int main() {
	n91::main_();
	return 0;
}


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

using namespace std;

#define lp(i,n) for(int i = 0; i <n;i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define MP make_pair
#define SZ(v) ((int)((v).size()))
typedef long long ll;

const ll MOD = 1e9 + 7;
const int OO = (int)1e6;
const int N = (int)1e7;

void init(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

int main() {
	#   ifdef LOCAL_PROJECT
        freopen("in.txt", "r", stdin);
    #   endif
    ll n;
    cin>>n;
    ll sum =0;
    while(n>=500){
        sum+=1000;
        n-=500;
    }
    while(n>=5){
        sum+=5;
        n-=5;
    }
    cout<<sum;
    return 0;
}

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

int main(){
  string S;
  cin >> S;
  int L=S.size();
  int cnt=0;
  for(int i=0; i<L; i++){
    if(i%2==0 && S.at(i)!='L') cnt++;
    if(i%2!=0 && S.at(i)!='R') cnt++;
  }
  if(cnt==L) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

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

	int ans = 1;
	while(ans <= n){
		ans *= 2;
	}
	cout << ans/2 << endl;
}

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

int N,M,K;

int main(){
  cin >> N >> M >> K;
  vector<long long> A(N+1);
  for(int i = 0; i < N; i++){
    cin >> A[i+1];
    A[i+1] += A[i];
  }
  
  vector<long long> B(M+1);
  for(int i = 0; i < M; i++){
    cin >> B[i+1];
    B[i+1] += B[i];
  }
  int ans = 0;
  int last = M;
  for(int i = 0; i <= N; i++){
    if(A[i] > K) break;
    while(B[last] > K-A[i]){
      last -= 1;
    }
    ans = max(ans,i+last);
  }
  cout << ans << endl;
}


Measured memory_bytes: 6424
s = input()
t = input()

slist = list(s)
tlist = list(t)
ans = 0
for i in range(len(slist)-len(tlist)+1):
    
    num = 0
    for k in range(len(tlist)):
        if slist[i+k] == tlist[k]:
            num += 1
    if num >= ans:
        ans = num
print(len(tlist)-ans)

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

int main(){
    int d;
    cin >> d;
    if(d==25){
        cout << "Christmas";
    }else if(d==24){
        cout << "Christmas Eve";
    }else if(d==23){
        cout << "Christmas Eve Eve";
    }else if(d==22){
        cout << "Christmas Eve Eve Eve";
    }
}

Measured memory_bytes: 256
using System;
using System.Linq;
class c
{
    static void Main()
    {
        var inp = Array.ConvertAll(Console.ReadLine().Split(), long.Parse);
        long n = int.Parse(Console.ReadLine());
        inp[0] *= 4;
        inp[1] *= 2;
        var qhs = new long[3] { inp[0], inp[1], inp[2] };
        long best = qhs.Min();
        Console.WriteLine(Math.Min(n / 2 * inp[3] + (n % 2 == 0 ? 0 : best), n * best));
    }
}

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

int main(){
  int N;
  cin >> N;
  if(N==1){
    cout <<"Yes";
    return 0;
  }  
  vector<int> H(N);
  for(int i=0;i<N;i++){
    cin >> H.at(i);
  }
  for(int i=N-2;i>=0;i--){
    if(H.at(i) - H.at(i+1) == 1){
      H.at(i) -= 1;
    }else if(H.at(i) - H.at(i+1) >= 2){
      cout << "No" ;
      return 0;
    }
  }
  cout << "Yes";
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <map>
#include <list>
#include <queue>
#include <algorithm>
#include <cassert>
#include <string>
#include <climits>
#include <numeric>

#define all(x) begin(x),end(x)

using namespace std;
using ll = long long;

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

    int res = 0;
    char c = 'A';
    for (int i = 0; i < n; ++i) {
        if (s[i] != c) {
            c = s[i];
            res++;
        }
    }

    cout << res << endl;
}


Measured memory_bytes: 512
#include<iostream>
#include<algorithm>
#include<queue>
#include<cmath>
#include<cstdio>
#include<cstdlib>
#include<cassert>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)

const int N = 300;
const int inf = (1<<20);
int cap[N][N];
bool vis[N];
int parent[N];
int flow[N][N];
int layer[N];

bool edge[N][N];
int num[N][N];

void make_layer(int n,int s,int t){
  queue<int> Q;
  Q.push(s);
  layer[s]=0;
  while(!Q.empty()){
    int now = Q.front();Q.pop();
    rep(i,n){
      if (cap[now][i]-flow[now][i] > 0 && layer[i] == -1){
        layer[i]=layer[now]+1;
        Q.push(i);
      }
    }
  }
}


int augment(int now,int t,int n,int f){
  if (now == t || f == 0)return f;
  if (vis[now])return 0;
  vis[now]=true;
  rep(i,n){
    if (layer[now] < layer[i]){
      int tmp = augment(i,t,n,min(f,cap[now][i]-flow[now][i]));
      if (tmp > 0){
        flow[now][i]+=tmp;
        flow[i][now]=-flow[now][i];
        vis[now]=true;
        return tmp;
      }
    }
  }
  return 0;
}

int dinic(int n,int s,int t){
  int ansflow=0;
  bool flag=true;
  rep(i,n)rep(j,n)flow[i][j]=0;
  while(flag){
    fill(layer,layer+n,-1);
    fill(vis,vis+n,false);
    flag=false;
    //make layer
    make_layer(n,s,t);
    if (layer[t] == -1)break;
    for(int f=1;f;flag=true){
      f=augment(s,t,n,inf);
      if (f==0)break;
      ansflow+=f;
    }
  }
  return ansflow;
}

main(){
  int n,m;
  while(cin>>n>>m){
    rep(i,n)rep(j,n)edge[i][j]=false,cap[i][j]=0;
    rep(i,m){
      int f,t;
      cin>>f>>t;
      f--;t--;
      cap[f][t]=1;
      cap[t][f]=1;
      edge[f][t]=1;
      num[f][t]=i+1;
      num[t][f]=i+1;
    }
    int s,t;
    cin>>s>>t;s--;t--;
    int ans=dinic(n,s,t);
    /*
    rep(i,n){
      rep(j,n)cout << flow[i][j] << " ";
      cout << endl;
    }
    */
    cout << ans << endl;
    int cnt=0;
    rep(i,n)rep(j,n)if (!edge[i][j] && flow[i][j] > 0)cnt++;
    cout << cnt << endl;
    rep(i,n)rep(j,n)if (!edge[i][j] && flow[i][j] > 0)cout << num[i][j] << endl;
#ifdef DEBUG
    cout << "end " << endl;
#endif
  }
  return false;
}

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

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

    int l, r, max_l = 0, min_r = 100001;
    for (int i = 0; i < m; i++) {
        cin >> l >> r;
        if (l > max_l) max_l = l;
        if (r < min_r) min_r = r;
    }

    if (min_r < max_l) {
        cout << 0 << endl;
    } else {
        cout << min_r - max_l + 1 << endl;
    }

    return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <algorithm>
#include <math.h>
#include <queue>
#include <cstdio>
using namespace std;

template <class T> using V = vector<T>;
template <class S, class T> using P = pair<S, T>;
template <class... T> using TP = tuple<T...>;

using ll = long long;
using db = double;
using ldb = long db;
using str = string;
using vll = V<ll>;
using vvll = V<V<ll>>;
using vvvll = V<V<V<ll>>>;
using pll = P<ll,ll>;
using tpll = TP<ll,ll,ll>;
using vpll =V<pll>;
using vvpll = V<vpll>;
using vtpll = V<tpll>;
using vst = V<str>;
using vch = V<char>;
using vvch = V<vch>;

#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(b);i>(ll)(a);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) __lcm(a,b)
#define co(a) cout<<a<<endl
#define ci(a) cin>>a
#define pb(a) push_back(a)
#define pob pop_back()
#define mp make_pair
#define mt make_tuple
#define pbmp(a,b) push_back(mp(a,b))
#define subs(a,b) substr(a,b)
#define cfs(a) cout<<fixed<<setprecision(a) //
#define INF 1e16
#define mod 1e9+7
/*vvll v(n,vll(m)) n行m列
A.erase(A.begin()+i); 配列Aのi番目を消せる
std::binary_search(v.bgn,v.en,a); 二分探索
abs(a,b)   pow(a,n)  to_string  stoll
auto Iter=lower_bound(v.bgn,v.en,a); v[i]>=aのv[i]
v.insert(lower_bound(v.bgn,v.en,a),b); bを入れられる
lower upper  co(*Iter) co(Iter-v.bgn) v[i]>=aのi
priority_queue<ll> pque;  pque.push(ai);
pque.top()=max(ai)  pque.pop() pque.sz
*/

const int MAX = 510000;
const int MOD = 1000000007;
long long fac[MAX], finv[MAX], inv[MAX];
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
#define comuse Comuse()
ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
  ll n,m;
  cin>>n>>m;
  vpll v(n);
  FOR(i,0,n){
    cin>>v[i].fi>>v[i].se;
  }
  SORT(v);
  priority_queue<ll> pque;
  ll ans=0;
  ll c=0;
  FOR(i,1,m+1){
    FOR(j,c,n){
      if(v[j].fi==i){
        pque.push(v[j].se);
      }
      if(v[j].fi!=i||j==n-1){
        if(pque.sz>0){
          ans+=pque.top();
          pque.pop();
        }
        c=j;
        break;
      }
      //co(c);
    }
  }
  co(ans);
}
          

Measured memory_bytes: 2936
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<map>
#include<set>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<sstream>
#include<numeric>

#define f first
#define s second
#define mp make_pair

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()

using namespace std;

typedef unsigned int uint;
typedef long long ll;

#define MAX (10+300000/7)

int gd[2*MAX];

int main(){
  REP(i,MAX){
    gd[2*i]   = 7*i + 1;
    gd[2*i+1] = 7*i + 6;
  }

  vector<bool> isPrime(gd[2*MAX-1]+1, true);
  vector<int> prime;

  for(int i=1; i<MAX*2; i++){
    if(isPrime[gd[i]]){
      prime.push_back(gd[i]);
      for(int j=gd[i]+gd[i]; j<=gd[2*MAX-1]; j+=gd[i]){
        isPrime[j] = false;
      }
    }
  }

  int n;
  while(scanf("%d",&n), n-1){
    printf("%d:",n);
    REP(i,n){
      if(prime[i] > n) break;
      if(n % prime[i] == 0){
        printf(" %d",prime[i]);
      }
    }
    puts("");
  }
  return 0;
}

Measured memory_bytes: 1560
#include <bits/stdc++.h>
#define int long long
using namespace std;

int n, k, edge;
vector<int> G[205];

vector<int> make_graph(int node){
  
  if( n <= node ) return vector<int>();
  
  vector<int> res;
  
  vector<int> l = make_graph(node*2+1);
  
  vector<int> r = make_graph(node*2+2);
  
  for(int num : l ) G[node].push_back(num);
  
  if( n > node*2+2 ) G[node].push_back(node*2+2);
  
  for(int num : l ) res.push_back(num);
  
  for(int num : r ) res.push_back(num);
  
  res.push_back(node);
  
  return res;  
}

signed main(){
  
  cin>>n>>k;
  
  make_graph(0);
  
  for(int i=0;i<n;i++){
    for(int to : G[i] ) edge++;
  }
  
  cout<<edge<<endl;
  
  for(int i=0;i<n;i++){
    for(int to : G[i] ) cout<<i+1<<' '<<to+1<<endl;
  }
  
  for(int i=0;i<k;i++){
    
    int A = 0;
    int S = -1;
    
    while(1){
      
      if( n <= A ){
	cout<<S+1<<endl;
      }else cout<<A+1<<endl;
            
      string s;

      cin>>s;
      
      if( s == "Yes" ) break;
      
      if( s == "No" ) A = A * 2 + 2;
      
      if( s == "Near" ){
	S = A * 2 + 2;
	A = A * 2 + 1;
      }

      
    }
    
  }
  
  return 0;
}



Measured memory_bytes: 3308