akhauriyash/Code-Regression huggingface dataset:
#include <cstdio>
#include <vector>

using namespace std;

static int f(const int* ws, int n, int P, int k) {
  int v = 0;
  int c = 0;
  int ntrack = 0;
  for (int i = 0; i < n; ++i) {
    if (c > 0 && P > 0 && c + ws[i] > P) {
      c = 0;
      ntrack++;
    }
    if (ntrack == k) {
      break;
    }

    if (c + ws[i] <= P) {
      c += ws[i];
      v++;
    }
  }
  return v;
}

int main() {
  int n, k;

  scanf("%d %d", &n, &k);

  //vector<int> ws(n);
  int ws[100000];
  int max = 0;
  for (int i = 0; i < n; ++i) {
    scanf("%d", &ws[i]);
    max += ws[i];
  }

  int min = 1;
  int P = (min + max) / 2;
  while (min <= max) {
    if (f(ws, n, P, k) >= n) {
      max = P - 1;
    } else { // v < n
      min = P + 1;
    }
    P = (min + max) / 2;
  }

  printf("%d\n", P + 1);
  return 0;
}

Measured memory_bytes: 1416
import sys

input = sys.stdin.readline


def main():
    A, B, C = map(int, input().split())

    if (A == B != C) or (B == C != A) or (C == A != B):
        ans = "Yes"
    else:
        ans = "No"

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 2940
from collections import defaultdict

alpha = defaultdict(int)
num = 0
for i in sorted(map(chr,range(97,123))):
    alpha[i] = 1 << num
    num += 1

n = int(input())
S = tuple(alpha[i] for i in input())

def init(init_val):
    #set_val
    for i in range(n):
        seg[i+num-1] = init_val[i]
    #built
    for i in range(num-2,-1,-1):
        seg[i] = seg[2*i+1] | seg[2*i+2]
    
def update(k,x):
    k += num-1
    seg[k] = x
    while k:
        k = (k-1)//2
        seg[k] = seg[k*2+1] | seg[k*2+2]
    
def query(p,q):
    if q<=p:
        return 0
    p += num-1
    q += num-2
    res=0
    while q-p>1:
        if p&1 == 0:
            res |= seg[p]
        if q&1 == 1:
            res |= seg[q]
            q -= 1
        p = p//2
        q = (q-1)//2
    if p == q:
        res |= seg[p]
    else:
        res |= (seg[p] | seg[q])
    cnt = 0
    i = 0
    while res:
        cnt += res & 1
        i += 1
        res >>= 1
    return cnt
#num:n以上の最小の2のべき乗
num =2**(n-1).bit_length()
seg=[0 for _ in range(2*num)]

init(S)

Q = int(input())
for _ in range(Q):
    x,y,z = map(str,input().split())
    x = int(x); y = int(y)
    if x == 1:
        update(y-1, alpha[z])
    else:
        z = int(z)
        print(query(y-1,z))

Measured memory_bytes: 32480
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#define swap(a,b) ((a != b) && (a += b,b = a - b,a -= b))
using namespace std;

int gcd(int a,int b){
    if(a<b)swap(a,b);
    if(a%b==0)return b;
    return gcd(b,a%b);
}

int f(int a){
    if(a%2){
        return 3*a+1;
    }
    return a/2;
}

int main()
{
    int s;

    int n;
    cin >> n;
    int c=1;
    vector<int> v(1000001,0);
    v[n]=1;
    while(1){
        //cout << n << endl;
        c++;
        n=f(n);
        if(v[n]){
            break;
        }
        v[n]=1;
    }




    cout<<c<<endl;
    return 0;
}






Measured memory_bytes: 4096
#include <iostream>
#include <vector>
#include <unordered_map>

std::vector<int> frends;

int root(int x)
{
    if (frends[x] == x)
        return x;
    frends[x] = root(frends[x]);
    return frends[x];
}

void unite(int x, int y)
{
    int root_x = root(x);
    int root_y = root(y);
    if (root_x == root_y)
        return;
    frends[root_x] = root_y;
}

int main()
{
    int N, M;
    std::cin >> N >> M;
    frends.resize(N);
    for (int i = 0; i < N; i++)
    {
        frends[i] = i;
    }
    for (int i = 0; i < M; i++)
    {
        int A, B;
        std::cin >> A >> B;
        A--;
        B--;
        unite(A, B);
    }

    std::unordered_map<int, int> n_frends;
    for (int i = 0; i < N; i++)
    {
        n_frends[root(i)]++;
    }
    int max = 0;
    for (auto const &e : n_frends)
    {
        max = std::max(max, e.second);
    }
    std::cout << max << std::endl;
}

Measured memory_bytes: 12136
#include<bits/stdc++.h>
using namespace std;
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(int x){
  char f[10];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int main(){
  int D, Lj4PdHRW, R, X;
  rd(R);
  rd(D);
  rd(X);
  for(Lj4PdHRW=0;Lj4PdHRW<10;Lj4PdHRW++){
    X = R*X-D;
    wt_L(X);
    wt_L('\n');
  }
  return 0;
}
// cLay varsion 20190526-1

// --- original code ---
// {
//   int R, D, X;
//   rd(R,D,X);
//   rep(10){
//     X = R*X-D;
//     wt(X);
//   }
// }


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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    vector<ll> A(N);
    for (int i=0;i<N;++i) cin >> A[i];
    vector<vector<ll>> dp(N+1,vector<ll>(4,-INF));
    dp[0][(N&1?0:2)]=0;
    for (int i=0;i<N;++i){
        dp[i+1][1]=max(dp[i+1][1],dp[i][0]);
        dp[(min(N,i+2))][0]=max(dp[(min(N,i+2))][0],dp[i][0]+A[i]);
        dp[(min(N,i+2))][2]=max(dp[(min(N,i+2))][2],dp[i][1]+A[i]);
        dp[(min(N,i+2))][2]=max(dp[(min(N,i+2))][2],dp[i][2]+A[i]);
        dp[(min(N,i+2))][3]=max(dp[(min(N,i+2))][3],dp[i][1]+A[i+1]);
        dp[(min(N,i+2))][3]=max(dp[(min(N,i+2))][3],dp[i][2]+A[i+1]);
        dp[(min(N,i+2))][3]=max(dp[(min(N,i+2))][3],dp[i][3]+A[i+1]);
    }
    cout << max({dp[N][1],dp[N][2],dp[N][3]}) << '\n';
}

Measured memory_bytes: 18692
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
ll modpow(ll a, int n, ll mod) {
  ll ret = 1;
  while (n) {
    if (n & 1) {
      ret *= a;
    }
    ret %= mod;
    a = a * a;
    a %= mod;
    n /= 2;
  }
  return ret;
}
int main () {
  int N;
  cin >> N;
  ll m = 1e9 + 7;
  ll ans = modpow(10, N, m);
  ans -= (modpow(9, N, m) * 2);
  while (ans < 0) ans += m;
  ans += modpow(8, N, m);
  ans %= m;
  cout << ans << endl;
}

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

     int arr[n];

     int count=0,ono=0;
     for(int i=0;i<n;i++)
    {
        cin>>arr[i];

          if(arr[i]%2==0)
          {
             count++;

               if(arr[i]%3==0 || arr[i]%5==0)
                ono++;
          }
      }
        if(count==ono)
         cout<<"APPROVED";

         else
         cout<<"DENIED";

}


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

const int MOD = 1000000007;

//long long
using ll = long long;

//出力系
#define print(x) cout << x << endl
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
 
// begin() end()
#define all(x) (x).begin(),(x).end()

//for
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

//最大公約数 
unsigned gcd(unsigned a, unsigned b) {
  if(a < b) return gcd(b, a);
  unsigned r;
  while ((r=a%b)) {
    a = b;
    b = r;
  }
  return b;
}

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

if(R - L >= 2018){
  cout << 0 << endl;
  return 0;
}
int ans = 10000;
for(ll i = L; i < R; i++){
  for(ll j = i + 1; j <= R; j++){ 
   int sum = (i * j) % 2019; 
  ans = min(ans, sum);

}
}
print(ans);

 }

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


int main(){
    ll a[6];
    rep(i,0,5){
        cin>>a[i];
        if(a[i]==0){
            cout<<i+1<<endl;
            return 0;
        }
    }
}

    









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

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N, A, B, C;
    cin >> N >> A >> B >> C;
    vector<ll> lengths(N);
    for (int i = 0; i < N; i++)
    {
        cin >> lengths.at(i);
    }
    ll answer = 1e10;
    sort(lengths.begin(), lengths.end());
    do
    {
        //0がA, 1がB, 2がC
        answer = min(answer, abs(A - lengths[0]) + abs(B - lengths[1]) + abs(C - lengths[2]));
        ll jointCost = 0;
        for (int i = 1; i <= N - 3; i++)
        {
            jointCost += 10;
            int bitS = pow(3, i);
            for(int j = 0; j < bitS; j++){
                vector<ll> targets(3);
                targets[0] = lengths[0];
                targets[1] = lengths[1];
                targets[2] = lengths[2];
                int tmp = j;
                for(int k = 0; k < i; k++)
                {
                    targets[tmp % 3] += lengths[3 + k];
                    tmp /= 3;
                }
                answer = min(answer, jointCost + abs(A - targets[0]) + abs(B - targets[1]) + abs(C - targets[2]));
            }
        }
    } while (next_permutation(lengths.begin(), lengths.end()));

    cout << answer << endl;
    return 0;
}


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

int main(){
  string s;
  cin >> s;
  int ans=754,n;
  for(int i=0;i<s.size()-2;i++){
    n=abs(753-(100*(s.at(i)-48)+10*(s.at(i+1)-48)+s.at(i+2)-48));
    ans=min(ans,n);
  }
  cout << ans << endl;
  return 0;
}

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

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = std::int64_t;
using P = std::tuple<int,int>;

int S, W;

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

  std::cin >> S >> W;

  if(S <= W){
      std::cout << "unsafe" << std::endl;
  }else{
      std::cout << "safe" << std::endl;
  }
}


Measured memory_bytes: 3652
n = int(input())
s = list(map(lambda x: 1 if x == "#" else 0, input()))

cs = [0] * (n+1)
for i in range(n):
    cs[i+1] = cs[i] + s[i]

ans = 10**6
for i in range(n+1):
    ans = min(ans, cs[i] + n - i - (cs[n] - cs[i]))

print(ans)


Measured memory_bytes: 12864
/*																													   
 Templatka c++ Kacper Fis																							   																											   //
*/																													  
																								   
#include <bits/stdc++.h>																							   
																													   
using namespace std; 																								   
		
const double eps = 1e-9;																							   
const int INF = 1000000001;																						   
const float PI = 3.14;																								   
typedef long long LL;																								   
																													   
typedef vector<int> vi;																								   
typedef list<int> li;																								   
typedef queue<int> qi; 																								   
typedef pair<int,int> ii; 																							   
typedef map<string,int> msi; //np msi['nazwa'] = 'liczba'															   
typedef vector<ii> vii; //vector par<int>, do tworzenia tablicy dla grafów wagowych #dijkstra #Bellman_Ford			   
typedef priority_queue< ii, vector<ii>, greater<ii> > pq; //kolejka priorytetowa vectorów par(top()=min) #dijkstra	   
																													   																				   
vector<ii>::iterator iter;																							   
																													   																				   
#define print_list(x) for(it = (x).begin(); it != (x).end(); it++) {cout << *it << " ";}							   
#define print_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++) {cout << *it2 << " ";}						   
#define search_list(x) for(it = (x).begin(); it != (x).end(); it++)													   
#define search_vector(x) for(it2 = (x).begin(); it2 != (x).end(); it2++);											   
#define pb(x) push_back(x) 																							   
#define pf(x) push_front(x)																							   
#define mp(x, y) make_pair(x, y)                                                                                       
///////////////////////////////////////////////GLOBAL DEFINITIONS////////////////////////////////////////////////////////

int tab[105];

///////////////////////////////////////////////////FUNCTIONS/////////////////////////////////////////////////////////////


/////////////////////////////////////////////////////MAIN////////////////////////////////////////////////////////////////
int main(int argc, char* argv[])																					 
{ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);                  												       
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
  
  int n;
  cin >> n;
  for(int i = 1; i <= n; i++){
	  cin >> tab[i];
  }
  
  LL ans = INF;
  for(int i = 1; i <= 100; i++){
	  LL current = 0;
	  for(int j = 1; j <= n; j++){
		  current += (pow((tab[j] - i), 2));
	  }
	  ans = min(ans, current);
  }
  
  cout << ans << endl;
  
  
  
  
  
  
  
 
	
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int llu;
typedef long double ld;
typedef float fl;
#define vi vector<int>
#define vl vector<ll>
#define vp vector<pair<int,int>>
#define pb push_back
#define pf push_front
#define mp map<ll,ll>
#define INF 1000000000000000000
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);
ll gcd(ll a,ll b)
{
    if(a==0)
    {
        return b;
    }
    else
    {
        return gcd(b%a,a);   
    }
}
ll lcm(ll a,ll b)
{
    return a*b/gcd(a,b);
}
int f(char c)
{
    return (int)c-96;
}
/**********************************************************************
***********************************************************************
*********************ACTUAL CODE BEGINS HERE***************************/
int main()
{   
    fast;
    ll i;
    ll n;
    cin>>n;
    ll x=0;
    for(i=1;i<=999999;i++)
    {
       x=((x%n)*(10%n)+(7%n))%n;
       if(x%n==0)
       {
           cout<<i;
           return 0;
       }
    }
    cout<<-1;
    return 0;
}

Measured memory_bytes: 3644
#include <stdio.h>
#include <string.h>
#define N 1000

char x[N], y[N];

int LCS(){
	int i, j;
	int m = strlen(x);
	int n = strlen(y);
	int c[m + 1][n + 1];
	
	for(i = 1; i <= m; i++) c[i][0] = 0;
	for(j = 0; j <= n; j++) c[0][j] = 0;
	
	for(i = 1; i <= m; i++){
		for(j = 1; j <= n; j++){
			if(x[i-1] == y[j-1]){
				c[i][j] = c[i-1][j-1] + 1;
			} else if (c[i-1][j] >= c[i][j-1]){
				c[i][j] = c[i-1][j];
			} else {
				c[i][j] = c[i][j-1];
			}
		}
	}
	
	return c[m][n];
}

main(){
	int n, i;
	
	scanf("%d", &n);
	for(i = 0; i < n; i++){
		scanf("%s%s", x, y);
		printf("%d\n", LCS());
	}
	
	return 0;
}

Measured memory_bytes: 4512
//Date : Sun Feb 25 21:33:21 2018
//Author : Rishabh Paul
 
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<stdbool.h>
#include<float.h>
#include<math.h>
#include<inttypes.h>
#include<assert.h>
#include<ctype.h>
#include<limits.h>
#include<time.h>
#define ll long long
#define For(i,n)	for(int i=0;i<n;i++)
#define rep(i ,a ,b)	for(int i=(a);i<=(b);i++)
#define mset(a ,value)	memset(a ,value ,sizeof(a))
#define s(a)	scanf("%d" ,&a);
#define ls(a)	scanf("%ld" ,&a)
#define reg(i)	register int i
#define infinite INT_MAX
#define MAX 100005
#define LEFT(i)	2*i + 1
#define RIGHT(i)	2*i + 2
#define EPS 0.00000000000001
#define NIL -1
int min(int a,int b){	return (a<b?a:b);	}
int max(int a,int b){	return (a>b?a:b);	}
int cmp(const void *a ,const void *b){
	int *a1 = (int *)a;
	int *b1 = (int *)b;
	if((*a1) > (*b1))	return 1;
	if((*a1) == (*b1))	return 0;
	return -1;
}
int a[5];
char s[10];
int main(){
	int n;
	s(n);
	For(i ,n){
		scanf(" %s" ,s);
		if(s[0] == 'M')	a[0]++;
		else if(s[0] == 'A')	a[1]++;
		else if(s[0] == 'R')	a[2]++;
		else if(s[0] == 'C')	a[3]++;
		else if(s[0] == 'H')	a[4]++;
	}
	ll ans = 0;
	for(int i = 0 ; i < 5 ; i++)
		for(int j = i + 1 ; j < 5 ; j++)
			for(int k = j + 1 ; k < 5 ; k++)
				ans += 1LL * a[i] * a[j] * a[k];
			printf("%lld" ,ans);
	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
int main() {
	char s[100]={};
	bool Skaibun=true;
	scanf("%s", s);
	int n=strlen(s);
	for (int i = 0; i < n/2; i++) {
		if(s[i]!=s[n-1-i]){
			Skaibun=false;
		}
	}
	for (int i = 0; i < (n-1)/4; i++) {
		if(s[i]!=s[(n-1)/2-1-i]){
			Skaibun=false;
		}
	}
	int cou=0;
	for (int i = (n+3)/2; i < n; i++) {
		if(s[i-1]!=s[n-cou-1]){
			Skaibun=false;
		}
		cou++;
	}
	if(Skaibun){
		printf("Yes\n");
	}else{
		printf("No\n");
	}
	return 0;
}


Measured memory_bytes: 128
import sys
N=int(input())
l=map(int,input().split())
a,b,c=0,0,True
for i in l:
    if i%4==0:b+=1
    else:
        if i%2!=0:a+=1
        else:c=False

if a==0:
    print("Yes")
    sys.exit()
if c:
    if b==0:
        print("No")
        sys.exit()
    if b>=a-1:print("Yes")
    else:print("No")
else:
    if b>=a:print("Yes")
    else:print("No")

Measured memory_bytes: 11096
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>
#include <map>
#include <iomanip>
#include <set>
#include <ctime>
#include <tuple>
#include <bitset>
#include <assert.h>
#include <deque>
#include <functional>
using namespace std;
typedef long long ll;

#define fi first
#define se second
#define rep(i, n) for (ll i = 0; i < n; i++)
#define debugA cerr << "AAAAA" << endl
#define debug_ cerr << "-------------" << endl
#define debug(x) cerr << #x << ": " << x << endl
#define debug_vec(v)                   \
    cout << #v << endl;                \
    for (int i = 0; i < v.size(); i++) \
    {                                  \
        cout << v[i] << " ";           \
    }                                  \
    cout << endl;
#define debug_vec2(v)                         \
    cout << #v << endl;                       \
    for (int i = 0; i < v.size(); i++)        \
    {                                         \
        for (int j = 0; j < v[i].size(); j++) \
        {                                     \
            cout << v[i][j] << " ";           \
        }                                     \
        cout << endl;                         \
    }

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

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

using Graph = vector<vector<int>>;
using P = pair<int, int>;
using P1 = pair<int, pair<int, int>>; // クラスカル法とかで、{cost, {from, to}}的に使う。
const ll LINF = 1001002003004005006ll;
const ll INF = 1001001001;
const double pi = acos(-1);

int main()
{
    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    for (int i = 0; i < n; i++)
    {
        cout << s[i] << t[i];
    }
    cout << endl;

    return 0;
}

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

int main() {
    int n;
    cin >> n;
    int mp[n + 1];
    for (int i = 0; i < n; i++) {
        int p;
        cin >> p;
        mp[p] = i;
    }
    multiset<int> st[2];
    st[0].insert(1);
    st[0].insert(1);
    st[1].insert(n);
    st[1].insert(n);
    long ans = 0;
    for (int p = n; p > 0; p--) {
        const int i = mp[p];
        auto it0 = st[0].upper_bound(-i);
        long x = - *it0++;
        long w = - *it0;
        auto it1 = st[1].upper_bound(i);
        long y = *it1++;
        long z = *it1;
        ans += p * ((x - w) * (y - i) + (i - x) * (z - y));
        //cout << w << ' ' << x << ' ' << y << ' ' << z << ' ' << ans << endl;
        st[0].insert(-i);
        st[1].insert(i);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 9984
import java.io.IOException;
import java.io.InputStream;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {

		FastScanner sc = new FastScanner();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int C = sc.nextInt();
		boolean[] flag = new boolean[101];
		for (int i = 0; i < Integer.MAX_VALUE; i++) {
			if (flag[A * i % B])
				break;
			flag[A * i % B] = true;
		}
		if (flag[C])
			System.out.println("YES");
		else
			System.out.println("NO");

	}
	//以下、自作ライブラリ

	//最大公約数
	public static long gcd(long a, long b) {
		if (a < b)
			return gcd(b, a);
		long c = 0;
		c = a % b;
		if (c == 0)
			return b;
		return gcd(b, c);
	}

	//最小公倍数
	public static long lcm(long m, long n) {
		return m * n / gcd(m, n);
	}

	//素数判定
	public static boolean isPrime(int n) {
		if (n < 2)
			return false;
		if (n == 2)
			return true;
		if (n % 2 == 0)
			return false;

		for (int i = 3; i * i <= n; i += 2) {
			if (n % i == 0)
				return false;
		}
		return true;
	}
}

//以下、高速スキャナークラス
class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) {
			return true;
		} else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) {
				return false;
			}
		}
		return true;
	}

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
		return hasNextByte();
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int nextInt() {
		long nl = nextLong();
		if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE)
			throw new NumberFormatException();
		return (int) nl;
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}
}


Measured memory_bytes: 21332
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define chmin(x,y) x = min(x,y)
using namespace std;
typedef long long ll;
const int INF = 1001001001;

int main() {
    int n;
    string s;
    cin >> n >> s;
    vector<int> w(n+1, 0), e(n+1, 0);
    rep(i, n){
        if(s[i] == 'W'){
            w[i+1]++;
        }else{
            e[i+1]++;
        }
        w[i+1] += w[i];
        e[i+1] += e[i];
    }

    int ans = INF;
    for(int i=0; i<n+1; i++){
        int tmp = e[n] - e[i] + w[i] - w[0];
        chmin(ans, tmp);
    }

    cout << ans << endl;
    return 0;
}

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

using namespace std;

#define all(v) (v).begin(), (v).end()

using li = long long;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    
    vector<int> a(n);
    
    int n4 = 0, n2 = 0, n1 = 0;
    
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] % 4 == 0) n4++;
        else if (a[i] % 2 == 0) n2++;
        else n1++;
    }
    
    int last = 4;
    
    while (n1 || n2 || n4) {
        if (last == 4) {
            if (n1 > 0) {
                last = 1;
                n1--;
            }
            else if (n2 > 0) {
                last = 2;
                n2--;
            }
            else {
                last = 4;
                n4--;
            }
        }
        else if (last == 2) {
            if (n2 > 0) {
                last = 2;
                n2--;
            }
            else if (n4 > 0) {
                last = 4;
                n4--;
            }
            else {
                cout << "No\n";
                return 0;
            }
        }
        else {
            if (n4 > 0) {
                last = 4;
                n4--;
            }
            else {
                cout << "No\n";
                return 0;
            }
        }
    }
    
    cout << "Yes\n";
    
    return 0;
}
 


Measured memory_bytes: 640
#include <iostream>
#include <utility>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <math.h>
#include <stack>
#include <set>
#include <deque>
#include <cmath>

using namespace std;
typedef long long ll;
ll mod = 1e9+7;
//ll mod = 998244353;
#define rep(i,n) for(int i = 0; i < (n); ++i)

int main() {
    int n;
    cin >> n;
    vector<ll> a(n);
    ll max_num = -1e8;
    ll min_num = 1e8;
    ll max_idx = 0;
    ll min_idx = 0;
    bool ok = true;
    rep(i, n) {
        cin >> a[i];
        if (i >= 1 && a[i-1] > a[i]) ok = false; 
        if (max_num < a[i]) {
            max_num = a[i];
            max_idx = i;
        }
        if (min_num > a[i]) {
            min_num = a[i];
            min_idx = i;
        }
    }
    if (ok) {
        cout << 0 << endl;
        return 0;
    }
    if (max_num >= 0 && min_num >= 0) {
        cout << n-1 << endl;
        rep(i, n-1) {
            cout << i+1 << " " << i+2 << endl;
        }
        return 0;
    }
    if (max_num < 0 && min_num < 0) {
        cout << n-1 << endl;
        rep(i, n-1) {
            cout << n-i << " " << n-i-1 << endl;
        }
        return 0;
    }
    if (abs(max_num) >= abs(min_num)) {
        cout << 2 * n - 1 << endl;
        rep(i, n) {
            cout << max_idx+1 << " " << i+1 << endl;
        }
        rep(i, n-1) {
            cout << i+1 << " " << i+2 << endl;
        }
        return 0;
    }
    else {
        cout << 2 * n - 1 << endl;
        rep(i, n) {
            cout << min_idx + 1 << " " << i+1 << endl;
        }
        rep(i, n-1) {
            cout << n-i << " " << n-i-1 << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 3608
let n = Scanf.scanf "%d\n" (fun x -> x)

let ls =
  let rec aux n tmp =
    if n = 0 then List.rev tmp
    else
      let line = Scanf.scanf "%d %d %d\n" (fun t x y -> (t, x, y)) in
      aux (n - 1) (line :: tmp)
  in
  aux n [(0, 0, 0)]


let rec solve = function
  | [] | [_] -> "Yes"
  | pre :: now :: t ->
    let pt, px, py = pre and nt, nx, ny = now in
    let dift = nt - pt and difd = abs (nx - px) + abs (ny - py) in
    if difd <= dift && (dift + difd) mod 2 = 0 then solve (now :: t)
    else "No"


let () = solve ls |> print_endline

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

int main(void){

    while(1){
        int h, w; cin >> h >> w;
        if(h == 0) break;
        bool flag = 0;

        int ans_i = 200, ans_j = 200;
        int temp = 2000000000;
        for(int i = h + 1; i < 200; i++){
            for(int j = i + 1; j < 200; j++){
                if(h*h + w*w == i*i + j*j){
                    if(i == h && j == w) continue;
                    flag = 1;
                    ans_i = i;
                    ans_j = j;
                    break;
                }
            }
            if(flag == 1) break;
        }

        if(flag == 1){
            cout << ans_i << " " << ans_j << endl;
            continue;
        }else{
            for(int i = 1; i < 200; i++){
                for(int j = i + 1; j < 200; j++){
                    if(temp > i*i + j*j && h*h + w*w < i*i + j*j){
                        ans_i = i;
                        ans_j = j;
                        temp = i*i + j*j;
                    }
                }
            }

            cout << ans_i << " " << ans_j << endl;
        }

    }



    return 0;
}

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


#define NUM 22

int POW[NUM+1],RANK[4194304],max_union[4194304],num[4194304];
vector<int> STATE[NUM+1];
set<int> SET[4194304];


void calc(){

	int count;

	for(int state = 0; state < POW[NUM]; state++){
		count = 0;
		for(int loop = 0; loop < NUM; loop++){
			if(state & (1 << loop)){
				count++;
			}
		}
		RANK[state] = count;
		STATE[count].push_back(state);
	}
}


int main(){

	for(int i = 0; i < NUM+1; i++)POW[i] = pow(2,i);
	for(int i = 0; i < POW[NUM]; i++){
		num[i] = 0;
		max_union[i] = i;
	}

	calc();

	int N;
	scanf("%d",&N);

	int k,tmp,sum;
	for(int loop = 0; loop < N; loop++){
		scanf("%d",&k);
		sum = 0;
		for(int i = 0; i < k; i++){
			scanf("%d",&tmp);
			tmp--;
			sum += POW[tmp];
		}
		num[sum]++;
		SET[sum].insert(sum);
	}

	int current_state,plus_one_bit_state;
	int ans = 0,copy_count;

	for(int num_bit = NUM; num_bit >= 1; num_bit--){
		for(int k = 0; k < STATE[num_bit].size(); k++){
			current_state = STATE[num_bit][k];

			for(int add_bit = 0; add_bit < NUM; add_bit++){
				if(current_state & (1 << add_bit))continue;

				plus_one_bit_state = current_state+POW[add_bit];

				if(SET[plus_one_bit_state].size() > 0){

					set<int>::iterator it = SET[plus_one_bit_state].begin();
					copy_count = 0;
					while(SET[current_state].size()+copy_count < 3 && it != SET[plus_one_bit_state].end()){
						SET[current_state].insert(*it);
						it++;
						copy_count++;
					}
					max_union[current_state] |= max_union[plus_one_bit_state];
				}
			}

			if((SET[current_state].size() >= 3) ||
					(num[current_state] > 0 && num[current_state]+SET[current_state].size()-1 >= 3)){
				ans = max(ans,RANK[max_union[current_state]]*RANK[current_state]);
			}
		}
	}

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

	return 0;
}



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



int main(){
  ll N, M;
  cin >> N >> M;
  ll H;
  vector<ll> height(N);
  vector<bool> good1(N, true);
  vector<ll> good2(N, 0);

  for(int i=0; i<N; i++){
    cin >> height[i];
  } 
  ll A, B;
  for(int i=0; i<M; i++){
    cin >> A >> B;
    A--;
    B--;
    if(height[A] <= height[B]){
      good1[A] = false;
    }
    if(height[B] <= height[A]){
      good1[B] = false;
    }
    good2[A] += 1;
    good2[B] += 1;
  }

  ll sum = 0;
  for(int i=0; i<N; i++){
    if(good1[i] | good2[i] == 0){
      sum += 1;
    }
  }
  cout << sum << endl;
}

Measured memory_bytes: 4844
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main(void){

  long n, m, l;
  long i, j, k;

  scanf("%ld %ld %ld", &n, &m, &l);

  long a[n][m], b[m][l];
  long c[n][l];

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

  for(j = 0; j < m; j++){
    for(k = 0; k < l; k++){
      scanf("%ld", &b[j][k]);
    }
  }

  for(i = 0; i < n; i++){
    for(k = 0; k < l; k++){
      c[i][k] = 0;
      for(j = 0; j < m; j++){
	c[i][k] += a[i][j] * b[j][k];
      }
    }
  }

  for(i = 0; i < n; i++){
    for(k = 0; k < l - 1; k++){
      printf("%ld ", c[i][k]);
    }
    printf("%ld\n", c[i][l - 1]);
  }

  return 0;
}


Measured memory_bytes: 2124
use std::io::prelude::*;

fn main() {
    let mut input_str = String::new();
    std::io::stdin().read_to_string(&mut input_str).unwrap();

    let input_parts = input_str.split_whitespace().collect::<Vec<_>>();
    let mut input_parts_it = input_parts.iter().cloned();

    let x: u8 = input_parts_it.next().unwrap().parse().unwrap();
    let a: u8 = input_parts_it.next().unwrap().parse().unwrap();

    println!("{}", if x < a { 0 } else { 10 });
}


Measured memory_bytes: 4352
fn main() {
    const MOD: usize = 998244353;

    let [a, b, c, d]: [usize; 4] = {
        let mut buf = String::new();
        std::io::stdin().read_line(&mut buf).unwrap();
        let mut iter = buf.split_whitespace();
        [
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
        ]
    };

    let mut dp = vec![vec![vec![0; 2]; d + 1]; c + 1];
    dp[a][b][1] = 1;
    for i in a..(c + 1) {
        for j in b..(d + 1) {
            if i + 1 <= c {
                dp[i + 1][j][0] = (dp[i][j][0] + dp[i][j][1]) * j % MOD;
            }
            if j + 1 <= d {
                dp[i][j + 1][1] = (dp[i][j][0] + dp[i][j][1] * i) % MOD;
            }
        }
    }

    let ans = (dp[c][d][0] + dp[c][d][1]) % MOD;
    println!("{}", ans);
}

Measured memory_bytes: 494644
<?php 
    $sc = new Scanner();
    $x = $sc->nextInt();
    $y = $sc->nextInt(); 

    if($x<$y){
        echo "a < b";
    }else if($x>$y){
        echo "a > b";
    }else{
        echo "a == b";
    }
    
    class Scanner {
        private $arr = [];
        private $count = 0;
        private $pointer = 0;
        public function next() {
            if($this->pointer >= $this->count) {
                $str = trim(fgets(STDIN));
                $this->arr = explode(' ', $str);
                $this->count = count($this->arr);
                $this->pointer = 0;
            }
            $result = $this->arr[$this->pointer];
            $this->pointer++;
            return $result;
        }
        public function hasNext() {
            return $this->pointer < $this->count;
        }
        public function nextInt() {
            return (int)$this->next();
        }
        public function nextDouble() {
            return (double)$this->next();
        }
    }
 ?>

Measured memory_bytes: 15324
#include <algorithm>
#include <iostream>
#include <vector>

int main() {
    auto n = std::size_t(0);
    auto m = 0;
    std::cin >> n >> m;

    auto adj = std::vector<std::vector<unsigned char>>(n, std::vector<unsigned char>(n, 0));
    for (auto i_ = 0; i_ < m; ++i_) {
        auto a = std::size_t(0);
        auto b = std::size_t(0);
        std::cin >> a >> b;
        adj[a - 1][b - 1] = 1;
        adj[b - 1][a - 1] = 1;
    }

    auto perm = std::vector<unsigned char>();
    perm.reserve(n);
    for (auto i = static_cast<unsigned char>(0); i < n; ++i) perm.emplace_back(i);

    auto counter = 0;
    do {
        auto itr = perm.begin();
        while ((adj[*itr][*(itr + 1)] != 0) && (itr + 1 < perm.end())) itr++;

        if (itr + 1 == perm.end()) counter++;
    } while (std::next_permutation(perm.begin() + 1, perm.end()));

    std::cout << counter << std::endl;
    return 0;
}

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

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> p(1+n);
    vector<ll> c(1+n);
    for(int i=1; i<=n; ++i) cin >> p[i];
    for(int i=1; i<=n; ++i) cin >> c[i];

    // ループのスコア計算は前処理
    vector<ll> loop_score(1+n);
    vector<int> loop_size(1+n);
    vector<bool> loop_checked(1+n, false);
    for(int start_point = 1; start_point <= n; start_point++){
        if(!loop_checked[start_point]){
            ll score = c[start_point];
            int loop_size_tmp=1;
            for(int point=p[start_point]; point != start_point; point=p[point]){
                score += c[point];
                loop_size_tmp += 1;
            }
            loop_score[start_point] = score;
            loop_size[start_point] = loop_size_tmp;
            loop_checked[start_point] = true;
            for(int point=p[start_point]; point != start_point; point=p[point]){
                loop_score[point] = score;
                loop_size[point] = loop_size_tmp;
                loop_checked[point] = true;
            }
        }
    }

    ll ans=-1e10;
    for(int start_point=1; start_point<=n; start_point++){
        // 最後の2周弱はケチらず数える
        ll current_score = 0, max_score = -1e10;
        int k_tmp = k, point=start_point;
        if (loop_size[start_point] * 2 <= k){
            if (loop_score[start_point] > 0){
                current_score = (k / loop_size[start_point] - 1) * loop_score[start_point];
                max_score = current_score;
            }
            k_tmp = k - (k / loop_size[start_point] - 1) * loop_size[start_point];
        }
        for(int i=0; i<k_tmp; ++i){
            point=p[point];
            current_score += c[point];
            max_score = max(current_score, max_score);
        }
        ans = max(ans, max_score);
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 3748
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VL vector<long long>
#define VPII vector<pair<int,int>>
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long>>
#define F first
#define S second
typedef long long LL;
using namespace std;

/*
 
 8/8/2018
 
 16:36-17:36 give up
 19:15- read editorials and got AC
 
 Editorials:
  - https://img.atcoder.jp/abc076/editorial.pdf
  - https://youtu.be/T1zXzsoK268?t=1804
  - simulation
   - http://ferin-tech.hatenablog.com/entry/2017/10/28/231616
   - http://www.neetaro.com/entry/atcoder-beginner-contest-abc-076
   - http://kazune-lab.net/contest/2017/10/28/abc076/
  - dp
   - https://www.hamayanhamayan.com/entry/2017/10/28/230944
   - https://kimiyuki.net/writeup/algo/atcoder/abc-076-d/
   - http://hamko.hatenadiary.jp/entry/2017/10/28/224055
 
 I tried to compute possible range of velocity at T[i].
 However actually total time is upper-bounded by 2*10^4.
 It's possible to calculate area by "manual integral".
 Also velocity should satisfy limit which is coming from both-ends.
 We need to calculate it in both ways.
 
 Key:
  - T is small. We can manually compute integral by simulation
  -
 
 */
const int MOD = 1e9+7;
const int SIZE=1e6+10;
int t[SIZE],v[SIZE],a[SIZE],m;

template <class T>
void mii(T& x,T y){
  if(x>y)x=y;
}

// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG x.cpp && ./a.out
//const int MAX_N=2*100*200+1;
int N;
void solve() {
  REP(i,SIZE) a[i]=MOD;
  int it=0;
  a[0]=0;
  REP(i,N) {
    mii(a[it],v[i]);
    REP(j,t[i]) {
      it++;
      mii(a[it],v[i]);
    }
  }
  mii(a[it],0);
  REPP(i,1,it+1) {
    mii(a[i],a[i-1]+1);
  }
  for(int i=it-1; i>=0; i--) {
    mii(a[i],a[i+1]+1);
  }
  LL an=0;
  REP(i,it) an+=(a[i]+a[i+1]);
  printf("%.12f\n",an*0.125);
//  double ans=an*0.125;
//  cout<<ans<<endl;
  
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  
  cin>>N;
  REP(i,N) cin>>t[i],t[i]*=2;
  REP(i,N) cin>>v[i],v[i]*=2;
  solve();
  return 0;
}


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

// エイリアス
using  ll = long signed long;
using ull = long unsigned long;
using  ld = long double;
using   P = pair<int, int>;
using llP = pair<ll, ll>;
using DoP = pair<double, double>;

// 汎用マクロ
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(i,q) for (auto &i : q)
#define UNIQUE(v) do { sort((v).begin(), (v).end()); (v).erase(unique((v).begin(), (v).end()), (v).end()); } while (false)
#define SZ(x) ((int)(x).size())
template <class T>inline bool chmin(T &a, const T b) {if (a > b) { a = b; return true;} return false;}
template <class T>inline bool chmax(T &a, const T b) {if (a < b) { a = b; return true;} return false;}
template <class T>inline void line_out(const vector<T> vec) {int n = SZ(vec); rep(i, n) { cout << vec[i]; if(i < n-1) cout << " ";}cout << endl;}
const int di[] = {0, 1, 0, -1, 1, 1, -1, -1};
const int dj[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int INF = 1 << 28;
const ll INF64 = 1ll << 62;
const int mod = 1000000007;
//const int mod = 998244353;
struct mint
{
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  mint &operator+=(const mint a)
  {
    if ((x += a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator-=(const mint a)
  {
    if ((x += mod - a.x) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator*=(const mint a)
  {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const
  {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const
  {
    mint res(*this);
    return res -= a;
  }
  mint &operator++()
  {
    if ((x += 1) >= mod)
      x -= mod;
    return *this;
  }
  mint &operator--()
  {
    if ((x += mod - 1) >= mod)
      x -= mod;
    return *this;
  }
  mint operator*(const mint a) const
  {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const
  {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const
  {
    return pow(mod - 2);
  }
  mint &operator/=(const mint a)
  {
    return (*this) *= a.inv();
  }
  mint operator/(const mint a) const
  {
    mint res(*this);
    return res /= a;
  }
};

int main()
{
  int n; cin >> n;
  vector<int> a(n);
  rep(i, n) cin >> a[i];
  int ans = 0;
  rep(i, n) if(i%2==0 && a[i]%2==1) ++ans;
  cout << ans << endl;
}


Measured memory_bytes: 3572
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
#define ll long long

int main() {
	ll a,b,c;
	cin>>a>>b>>c;
	if(a==b && b!=c)
	{
		cout<<"Yes"<<endl;
		return 0;
	}
	if(a==c && b!=c)
	{
		cout<<"Yes"<<endl;
		return 0;
	}
	if(c==b && a!=b)
	{
		cout<<"Yes"<<endl;
		return 0;
		
	}
	cout<<"No"<<endl;
	return 0;
}

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

#define SZ(x) ((int)(x).size())
#define LEN(x) ((int)(x).length())
using namespace std;

int main() {
	int k, a, b;
	cin >> k;
	cin >> a >> b;
	for (int i = a; i <= b; i++) {
			if (i % k == 0){cout<<"OK";
					return 0;}
	}
	cout << "NG";

}

Measured memory_bytes: 3636
<?php
		
	$keys = array();
	for( $i=0; $i<=ord('z')-ord('a'); $i++ ) {
		array_push( $keys, chr( ord('a')+$i ) );
	}
	$cnt = array_fill_keys( $keys, 0 );
	
	while( FALSE != ( $data = fgets( STDIN ) ) ) {
		$data = strtolower( trim( $data ) );
		
		$strs = str_split( $data );
		foreach( $strs as $c ) {
			if( 'a' <= $c && $c <= 'z' ) {
				$cnt[ $c ]++;
			}
		}
	}
	foreach( $cnt as $k => $val ) {
		print $k." : ".$val.PHP_EOL;
	}

Measured memory_bytes: 6824
#ifdef DEBUG
#define _GLIBCXX_DEBUG
#endif

#include <bits/stdc++.h>

using namespace std;

typedef long double ld;

#ifdef DEBUG
#define eprintf(...) fprintf(stderr, __VA_ARGS__), fflush(stderr)
#else
#define eprintf(...) ;
#endif

#define sz(x) ((int) (x).size())
#define TASK "text"

const int inf = (int) 1.01e9;
const long long infll = (long long) 1.01e18;
const ld eps = 1e-9;
const ld pi = acos((ld) -1);

#ifdef DEBUG
mt19937 mrand(300); 
#else
mt19937 mrand(chrono::steady_clock::now().time_since_epoch().count()); 
#endif

int rnd(int x) {
  return mrand() % x;
}

void precalc() {
}

const int mod = (int) 1e9 + 7;

int mul(int a, int b) {
  return (long long) a * b % mod;
}

void add(int &a, int b) {
  a += b;
  if (a >= mod) {
    a -= mod;
  }
}

const int maxn = (int) 2e5 + 5;
int n, m;
string s;
char tmp[maxn];

bool read() {
  if (scanf("%d%d", &n, &m) < 2) {
    return false;
  }
  scanf("%s", tmp);
  s = tmp;
  return true;
}

int dp1[maxn][2];
int dp[maxn];
int toadd[maxn];

void solve() {
  if (s[0] == 'B') {
    for (int i = 0; i < m; i++) {
      if (s[i] == 'B') {
        s[i] = 'R';
      } else {
        s[i] = 'B';
      }
    }
  }
  int d = inf;
  for (int j = 0; j < m;) {
    if (s[j] == 'B') {
      j++;
      continue;
    }
    int i = j;
    while (j < m && s[j] == 'R') {
      j++;
    }
    if (j == m) {
      continue;
    }
    int len = j - i;
    if (!(len & 1)) {
      if (i) {
        continue;
      }
      len++;
    }
    d = min(d, len);
  }
  if (d >= inf) {
    int res = 0;
    dp1[1][0] = 1;
    dp1[1][1] = 0;
    for (int i = 2; i <= n; i++) {
      {
        auto &cur = dp1[i][0];
        cur = dp1[i - 1][0];
        add(cur, dp1[i - 1][1]);
      }
      {
        auto &cur = dp1[i][1];
        cur = dp1[i - 1][0];
      }
    }
    add(res, dp1[n][0]);
    add(res, dp1[n][1]);
    dp1[1][0] = 0;
    dp1[1][1] = 1;
    for (int i = 2; i <= n; i++) {
      {
        auto &cur = dp1[i][0];
        cur = dp1[i - 1][0];
        add(cur, dp1[i - 1][1]);
      }
      {
        auto &cur = dp1[i][1];
        cur = dp1[i - 1][0];
      }
    }
    add(res, dp1[n][0]);
    printf("%d\n", res);
    return;
  }
  if (n & 1) {
    printf("0\n");
    return;
  }
  for (int i = 0; i <= n; i++) {
    toadd[i] = 0;
    dp[i] = 0;
  }
  dp[0] = 1;
  int curadd = 0;
  for (int i = 0; i < n; i += 2) {
    add(curadd, toadd[i]);
    auto &cur = dp[i];
    add(cur, curadd);
    if (!cur) {
      continue;
    }
    int l = i + 2, r = i + d + 3;
    if (l >= n) {
      continue;
    }
    add(toadd[l], cur);
    if (r < n) {
      add(toadd[r], mod - cur);
    }
  }
  int res = 0;
  for (int i = max(0, n - d - 1); i < n; i += 2) {
    auto cur = dp[i];
    if (!cur) {
      continue;
    }
    int len = n - i;
    add(res, mul(cur, len));
  }
  printf("%d\n", res);
}

int main() {
  precalc();
#ifdef DEBUG
  assert(freopen(TASK ".in", "r", stdin));
  assert(freopen(TASK ".out", "w", stdout));
#endif
  while (read()) {
    solve();
#ifdef DEBUG
    eprintf("Time %.2f\n", (double) clock() / CLOCKS_PER_SEC);
#endif
  }
  return 0;
}


Measured memory_bytes: 2176
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
using ll = long long;
using namespace std;
using Graph = vector<vector<int>>;

vector<bool> seen;
void dfs(const Graph &G,int v) {
    seen[v] = true ;
    for (auto next_v:G[v]) {
        if (seen[next_v]) continue;
        dfs(G, next_v);
    }
} 

// int main () {
//     int n,m;
//     cin >> n >> m;
//     Graph G(n+1);

//     for (int i=0;i<m;i++) {
//         int a,b;
//         cin >> a >> b;
//         G[a].push_back(b);
//         G[b].push_back(a);
//     }
//     seen.assign(n+1,false);
//     dfs(G,1);
//     if (seen[n]==true) {
//         cout << "POSSIBLE" <<endl;
//     }
//     else {
//         cout << "IMPOSSIBLE" << endl;
//     }
//     return 0;

// }


int main (){
    int n,m;
    cin >>n >> m;
    vector<bool> seen1(n);
    vector<bool> seen2(n);
    for (int i=0;i<m;i++) {
        int a,b;
        cin >> a >> b;
        if (a==1) seen1[b-1]=true;
        else if (b==n) seen2[a-1]=true;
    }
    for (int i=0;i<n;i++) {
        if (seen1[i]==true && seen2[i]==true){
            cout << "POSSIBLE" << endl;
            return 0;
        }
    
    }
    cout << "IMPOSSIBLE" << endl; 
    return 0;   
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007
#define INF 1000000000
#define LINF 1000000000000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define bit(n) (1LL<<(n))
using namespace std;

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

int main() {

    string S;
    cin >> S;
    int ans = 700;
    rep(i,3) if (S[i] == 'o') ans += 100;
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256