akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
using namespace std;
 int main(){
 	int answer ;
 	string str;
 
while (1){
	answer = 0;
	cin >> str;
  	for (int i = 0 ; i < str.size(); i++){
 		answer += str[i] - '0';
}

 	if (answer == 0)break;
 	
 	
 	cout << answer <<endl;
 }
 	return 0;
}   

Measured memory_bytes: 3196
N, M = list(map(int,input().split()))
     
b = [0]*(N+2)
b[0] = 1
     
for i in range(M):
  b[int(input())] = -1
     
for i in range(N):
  if b[i] != -1:
    if b[i+1] != -1:
      b[i+1] += b[i]
    if b[i+2] != -1:
      b[i+2] += b[i]

print(b[N]%1000000007)

Measured memory_bytes: 462708
from queue import LifoQueue


def print_sol(c, sol):
    print('Case #{}: {}'.format(c, sol))


def rd_int():
    return int(input())


def rd_str():
    return input()


def rd_str_lst():
    return input().split(' ')


def sp_str_lst():
    return list(input())


def rd_int_lst():
    return [int(i) for i in rd_str_lst()]


def sp_int_lst():
    return [int(i) for i in sp_str_lst()]


def dfs(g, i, v):
    """
    recursive post order dfs
    Args:
        g: array of graph nodes
        i: node to traverse
        v: visited array

    Returns: a post order dfs of graph g
    """
    v[i] = True
    for j in g[i]:
        if not v[j]:
            dfs(g, j, v)

    print(i)


def dfs_iter(g, i, n):
    v = [False] * n
    stack = LifoQueue()
    stack.put(i)
    while stack.not_empty:
        u = stack.get()
        v[u] = True
        print(u)
        for i in g[u]:
            if not v[i]:
                stack.put(i)


def main():
    t = rd_str()
    if ord('a') <= ord(t) <=ord('z'):
        print('a')
    else:
        print('A')


if __name__ == '__main__':
    main()


Measured memory_bytes: 9540
#include <stdio.h>

int main(){
  int i, j, n, c, p;
  c = 1;
  scanf("%d",&n);
  int a[n];
  for(i=0;i<n;i++) scanf("%d",&a[i]);
  p = a[0];
  for(i=0;i<n;i++){
    if(p>a[i]){
      c++;
      p = a[i];
    }
  }
  printf("%d",c);
}

Measured memory_bytes: 896
#define _USE_MATH_DEFIMES
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

const int MOD = 1'000'000'007;
const int INF = 1'000'000'000; //1e9
const int NIL = -1;
const long long LINF = 1'000'000'000'000'000'000; // 1e18
const long double EPS = 1E-10;

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







long long power(long long a, unsigned long long b, long long m){
    long long ret(1);
    while(b){
        if(b & 1) ret = (ret * a) % m;
        a = (a * a) % m;
        b /= 2;
        if(ret < 0) ret += m;
        if(a < 0) a += m;
    }
    return ret;
}

int main(){
    int N; std::cin >> N;
    std::string X; std::cin >> X;
    int pop(0);
    for(int i(0); i < N; ++i){
        if(X[i] == '1') ++pop;
    }
    int p1(0), d1(0);
    for(int i(0); i < N; ++i){
        p1 = (p1 * 2 + (X[i]-'0')) % (pop+1);
        if(pop > 1){
            d1 = (d1 * 2 + (X[i]-'0')) % (pop-1);
        }
    }
    for(int i(0); i < N; ++i){
        long long n((X[i] == '0') ? p1 : d1), cnt(1);
        if(X[i] == '0'){
            n = (n + power(2, N-i-1, pop+1)) % (pop+1);
        }else{
            if(pop == 1){
                cnt = 0; n = 0;
            }else{
                n = (n - power(2, N-i-1, pop-1)) % (pop-1);
                if(n < 0) n += pop - 1;
            }
        }
        while(n){
            ++cnt; long long m(n);
            int a(__builtin_popcount(n));
            n %= a;
        }
        std::cout << cnt << "\n";
    }
    return 0;
}


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

int main(void)
{
	char num_str[1002];
	int num;
	long sum = 0;
	int i;
	char tmp;

	while (1)
	{
		fgets(num_str, sizeof(num_str), stdin);

		if (num_str[0] == '0') break;

		for (i = 0; i < strlen(num_str)-1; i++)
		{
			tmp = num_str[i];
			num = atoi(&tmp);
			sum = sum + num;
		}

		printf("%ld\n", sum);

		sum = 0;
		memset(num_str, 1002, 0);

	}
	return 0;
}

Measured memory_bytes: 532
// スタックサイズ: 100MB

#include <iostream>
#include <fstream>
#include <vector>
#include <map>
#include <unordered_map>
#include <string>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <numeric>
#include <iomanip>
#include <queue>
#include <list>
#include <set>
using namespace std;

typedef int64_t ll;
typedef vector<ll> vll;
typedef pair<ll, ll> pll;
const ll INF = 1000000000000000000;
#define fori(i, a, b) for (ll i = (a); i < (b); ++i)
#define ford(i, a, b) for (ll i = (b - 1); (a) <= i; --i)
#define rep(i, n) fori(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define fst first
#define snd second
ll pw(ll x, ll y) { ll r = 1;  rep(i, y) { r *= x; }; return r; }


int main() {

	char po[3][3];
	rep(i, 3) rep(j, 3) cin >> po[i][j];
	rep(i, 3) cout << po[i][i];
	cout << endl;
}

Measured memory_bytes: 256
import sys
from heapq import heappush,heappop
from bisect import bisect_left,bisect_right
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
def input(): return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    X,L=[0]*N,[0]*N
    l=[]
    for i in range(N):
        X[i],L[i]=map(int,input().split())
        l.append((X[i]+L[i]-1,X[i]-L[i]))
    l.sort()
    ans=0
    tmp=-INF
    for right,left in l:
        if tmp<left:
            ans+=1
            tmp=right
    print(ans)        
        

if __name__ == '__main__':
    main()


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

using namespace std;

int main(){
    string X;
    cin >> X;
    int N = X.size();
    vector<int> s, t;
    for(int i = 0; i < N; i++){
        if(X[i] == 'S') s.push_back(i);
        if(X[i] == 'T') t.push_back(i);
    }
    int ans = N;
    int r = 0;
    for(int i = 0; i < N/2; i++){
        int l = s[i];
        l = max(r, l);
        auto ptr = upper_bound(t.begin(), t.end(), l);
        if(ptr == t.end()) break;
        if(*ptr > r) {
            ans -= 2;
            r = *ptr;
        }
    }
    cout << ans << endl;
}

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

int main() {
  int n;
  cin >> n;
  vector<int> a(n+1), b(n);
  for(int i=0; i<n+1; i++)
    cin >> a.at(i);
  for(int i=0; i<n; i++) 
    cin >> b.at(i);
  
  long long answer = 0;
  
  for(int i=0; i<n; i++) {
    if(a.at(i) > b.at(i)) {
      answer += b.at(i);
    }
    else {
      if(a.at(i) + a.at(i+1) > b.at(i)) {
        answer += b.at(i);
        a.at(i+1) -= b.at(i) - a.at(i);
      }
      else {
        answer += a.at(i) + a.at(i+1);
        a.at(i+1) = 0;
      }
    }
  }
  
  cout << answer << endl;
}

Measured memory_bytes: 1024
line = input().split()
n, l = tuple([int(s) for s in line])
v = [0] * n
for i in range(n):
    v[i] = l + i
    
sum_l = sum(v)

if l >= 0:
    print(sum_l - v[0])
elif l < 0 and l+n <= 0:
    print(sum_l - v[-1])
else:
    print(sum_l)

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

public class Main {

	public static void main(String[] args) {
		FScanner sc = new FScanner();
		String S = sc.next();
		String ret = "Yes";
		for (int i = 0; i < S.length(); i++) {
			char w = S.charAt(i);
			if ((i + 1) % 2 == 1 && (w == 'R' || w == 'U' || w == 'D')) {
				ret = "Yes";
			} else if ((i + 1) % 2 == 0 && (w == 'L' || w == 'U' || w == 'D')) {
				ret = "Yes";
			} else {
				ret = "No";
				break;
			}
		}
		System.out.println(ret);

	}

}

class FScanner {
	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>
using namespace std;
#define ll long long

int power(int x,int n)
{
    if(n==0)
        return 1;
    return x*power(x,n-1);
}

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    // ll n;cin>>n;
    // while(n--)
    // {
        ll a,b,n;cin>>a>>b>>n;
        if(n<b)cout<<(a*n)/b;
        else if(n==b)cout<<(a*(n-1))/b;
        else{cout<<(a*(b-1))/b;}
    // }
    return 0;
}

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

#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define repr(x,fr,to) for(int (x)=(fr);(x)>=(to);(x)--)
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll; typedef vector<int> VI; typedef pair<int,int> pii;
const int mod = (int)1e9 + 7;

int main()
{
	
	//cin.tie(0); ios_base::sync_with_stdio(false);
	int a,b;
	cin >> a >>b;
	
	
	cout << (a+b)%24 << endl;
	return 0;
}


Measured memory_bytes: 256
#include <string>
#include <vector>
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<stack>
#include<queue>
#include<cmath>
#include<algorithm>
#include<functional>
#include<list>
#include<deque>
#include<bitset>
#include<set>
#include<map>
#include<unordered_map>
#include<unordered_set>
#include<cstring>
#include<sstream>
#include<complex>
#include<iomanip>
#include<numeric>
#include<cassert>
#define X first
#define Y second
#define pb push_back
#define rep(X,Y) for (int (X) = 0;(X) < (Y);++(X))
#define reps(X,S,Y) for (int (X) = S;(X) < (Y);++(X))
#define rrep(X,Y) for (int (X) = (Y)-1;(X) >=0;--(X))
#define rreps(X,S,Y) for (int (X) = (Y)-1;(X) >= (S);--(X))
#define repe(X,Y) for ((X) = 0;(X) < (Y);++(X))
#define peat(X,Y) for (;(X) < (Y);++(X))
#define all(X) (X).begin(),(X).end()
#define rall(X) (X).rbegin(),(X).rend()
#define eb emplace_back
#define UNIQUE(X) (X).erase(unique(all(X)),(X).end())
#define Endl endl
#define NL <<"\n"

using namespace std;
using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
template<class T> using vv=vector<vector<T>>;
template<class T> inline bool MX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool MN(T &l,const T &r){return l>r?l=r,1:0;}
//#undef NUIP
#ifdef NUIP
#include "benri.h"
#else
#define out(args...)
#endif
#ifdef __cpp_init_captures
template<typename T>vector<T> table(int n, T v){ return vector<T>(n, v);}
template <class... Args> auto table(int n, Args... args){auto val = table(args...); return vector<decltype(val)>(n, move(val));}
#endif
const ll MOD=1e9+7; //998244353
template<class T>
struct Seg{
	T s;
	Seg (T s=0):s(s){}
	Seg operator+(const Seg &seg){
		return s+seg.s;
	}
  static Seg e;
};
template<class T> Seg<T> Seg<T>::e=Seg();
template<class T>
ostream& operator<<(ostream& os, const Seg<T> &seg){ return os<<"("<<seg.s<<")";}

template<class Seg>
struct SegTree{
	vector<Seg> segs;
	
	void upd_node(int k){segs[k]=segs[2*k+1]+segs[2*k+2];}
	Seg query(int l,int r,int k,int a,int b){
		if(b<=l || r<=a)return Seg::e; 
		if(l<=a && b<=r){return segs[k];}
		int m=(a+b)/2;
		Seg vl=query(l,r,2*k+1,a,m);
		Seg vr=query(l,r,2*k+2,m,b);
		upd_node(k);
		return vl+vr;
	}
	void add(int k,const Seg &seg){
		k+=segs.size()/2-1;
		segs[k]=segs[k]+seg;
		while(k>0){
			k=(k-1)/2;
			upd_node(k);
		}
	}
	void upd(int k,const Seg &seg){
		k+=segs.size()/2-1;
		segs[k]=seg;
		while(k>0){
			k=(k-1)/2;
			upd_node(k);
		}
	}
	struct Updater{
		SegTree &st;
		int k;
		Seg operator+=(const Seg &seg){ st.add(k,seg);}
		Seg operator=(const Seg &seg){ st.upd(k,seg);}
	};

	SegTree(int n){
		int pw=1;
		while(pw<n) pw*=2;
		segs.resize(2*pw);
	}
	Seg operator()(int l,int r){ return query(l,r,0,0,segs.size()/2);};
	Updater operator[](int k){ return Updater{*this,k};}
};

int main(){
  ios_base::sync_with_stdio(false); cin.tie(0);
  cout<<fixed<<setprecision(0);
	int n,q;
	cin>>n>>q;
	SegTree<Seg<ll>> st(n);
	while(q--){
		int t;
		cin>>t;
		if(t){
			int l,r;
			cin>>l>>r; --l;
			cout<<st(l,r).s NL;
		}else{
			int i,x;
			cin>>i>>x; --i;
			st[i]+=x;
		}
	}
  return 0;
}



Measured memory_bytes: 4956
#include<iostream>
#include<string>
#define rep(i,x) for(i=0;i<(x);i++)
using namespace std;

int main(){
	
  int N,i,j;
  cin>>N;
  string S;
  int ab=0,ba=0,a=0,b=0;
  
  rep(i,N){
  	cin>>S;
    if(S[0]=='B'){
    	if(S[S.size()-1]=='A'){
        	ba++;
        }else{
        	b++;
        }
    }else if(S[S.size()-1]=='A'){
    	a++;
    }
    rep(j,S.size()){
    	if(j!=0){
        	if(S[j]=='B' && S[j-1]=='A'){
              ab++;
            }
        }
    }
    
  }
  int ans=0;
  if(ba>0){
  	ans+=ba-1;
    if(a>0 && b>0){
    	if(a>b){
        	ans=ans+b+1;
        }else{
        	ans=ans+a+1;
        }
    }else if(a>0 || b>0){
    	ans+=1;
    }
  }else{
    	if(a>0 && b>0){
        	if(a>b){
            	ans+=b;
            }else{
            	ans+=a;
            }
        }
    }
      ans+=ab;
      cout<<ans;
      return 0;
  
  
  
}

Measured memory_bytes: 256
N,K = map(int, input().split())
A = [int(i) for i in input().split()]
A.sort()

if A[-1] < K:
    print("IMPOSSIBLE")
    exit()

from bisect import bisect_left

flag = False
for i in range(N):
    if A[i] == K:
        flag = True
    
    idx = bisect_left(A, K - A[i])
    if idx < N and i != idx and A[idx] == K - A[i]:
        flag = True

if flag:
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Measured memory_bytes: 14224
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, M;
  cin >> N >> M;
  
  string S;
  string tmp;
  for(int i=0; i<N; i++){
    cin >> tmp;
    S += tmp;
  }
  
  int bomb;
  for(int i=0; i<S.size(); i++){
    bomb = 0;
    
    if(M != 1){
    if((i+1) % M != 0){
    if(i+1 < N * M){
      if(S.at(i+1) == '#') bomb += 1;
    }
    if(i+M+1 < N * M){
      if(S.at(i+M+1) == '#') bomb += 1;
    }
    if(i-M+1 >= 0){
      if(S.at(i-M+1) == '#') bomb += 1;
    }
    }
    
    if((i+1) % M != 1){
    if(i-1 >= 0 ){
      if(S.at(i-1) == '#' ) bomb += 1;
    }
    if(i+M-1 < N * M){
      if(S.at(i+M-1) == '#') bomb += 1;
    }
    if(i-M-1 >= 0){
      if(S.at(i-M-1) == '#') bomb += 1;
    }
    }
    }
    
    if(i+M < N * M){
      if(S.at(i+M) == '#') bomb += 1;
    }
    if(i-M >= 0){
      if(S.at(i-M) == '#') bomb += 1;
    }

    if(S.at(i) == '#') cout << '#';
    else cout << bomb;
    
    if((i+1) % M == 0){
      cout << endl;
    }
  }
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>

int main(){
    int n;
    std::cin >> n;
    
    std::vector<long long> R(n);
    for(int i = 0; i < n; i++){
        std::cin >> R[i];
    }
    
    long long max_value = -1e9;
    long long min_value = R[0];
    
    for(int i = 1; i < n; i++){
        max_value = std::max(max_value, R[i] - min_value);
        min_value = std::min(min_value, R[i]);
    }
    
    std::cout << max_value << std::endl;
    return 0;
}


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

using namespace std;

int main()
{
    string s;
    cin >> s;
    if (s[2] == s[3] && s[4] == s[5])
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

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

int main(int argc, const char * argv[]) {
    int array[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    int K;
    cin >> K;
    
    std::cout << array[K-1];
    return 0;
}


Measured memory_bytes: 888
s = input().strip()
yy, mm = int(s[:2]), int(s[2:])

yymm = False
mmyy = False
if 1 <= mm and mm <= 12:
    yymm = True
if 1 <= yy and yy <= 12:
    mmyy = True

if yymm and mmyy:
    print("AMBIGUOUS")
elif yymm:
    print("YYMM")
elif mmyy:
    print("MMYY")
else:
    print("NA")

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

public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);

		long n = sc.nextLong();
		for (long i = (long) Math.sqrt(n); i > 0; i--) {
			if (n % i == 0) {
				out.println(digit(n / i));
				break;
			}
		}

		out.flush();
	}

	static int digit(long n) {
		int d = 0;
		while (n > 0) {
			n /= 10;
			d++;
		}
		return d;
	}

}

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 byte readByte() {
		if (hasNextByte()) {
			return buffer[ptr++];
		} else {
			return -1;
		}
	}

	private boolean isPrintableChar(int c) {
		return '!' <= c && c <= '~';
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

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

	public int nextInt() {
		if (!hasNext()) { throw new NoSuchElementException(); }
		int n = 0;
		boolean minus = false;
		byte 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 long nextLong() {
		if (!hasNext()) { throw new NoSuchElementException(); }
		long n = 0;
		boolean minus = false;
		byte 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();
		}
	}

}

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

signed main() {
	string s;
	cin >> s;
	
	int ans = 0;
	int len = 0;
	for (int i = 0; i < s.length(); i++) {
		if (s[i] == 'R') {
			len++;
		}
		else {
			ans = max(ans, len);
			len = 0;
		}
	}
	ans = max(ans, len);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3624
#include <algorithm>
#include <iostream> //入出力
#include <stdio.h>
#include <map>
#include <set>
#include <string>
#include <math.h> //算術演算子
#include <vector>
#include <cstdlib>
#include <queue>
#include <stack>
#include <list>
#include <iomanip> //小数点以下を表示させる(setprecision())
// #include <bits/stdc++.h>
using namespace std;
typedef long long ll; //64bit型

#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(a) (a).begin(), (a).end()
#define debug(x) cerr << x << " " \
                      << "(L:" << __LINE__ << ")" << '\n'
#define PRINT(V)                                   \
        {                                          \
                for (int i = 0; i < V.size(); i++) \
                {                                  \
                        cout << V[i] << " ";       \
                }                                  \
                cout << endl;                      \
        }

int gcd(int a, int b)
{
        return b ? gcd(b, a % b) : a;
}
string trans(int N)
{
        string S;
        while (N != 0)
        {
                if (N % 2 == 1)
                {
                        N--;
                        S = '1' + S;
                }
                else
                {
                        S = '0' + S;
                }
                N /= 2;
        }
        return S;
}

int main() //input->compute->output
{
        string S;
        cin >> S;

        map<char, int> mp;
        for (int i = 0; i < S.size(); i++)
        {
                mp[S[i]]++;
        }

        map<char, int>::iterator itr;
        bool ok=true;
        for(itr=mp.begin();itr!=mp.end();itr++){

                if(itr->second!=1){
                        ok=false;
                }
        }
        if(ok){
                cout<<"yes"<<endl;
        } else{
                cout<<"no"<<endl;
        }

        return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <list>
#define pie 3.141592653589793
#define si(a) scanf("%d",&a)
#define ss(a) scanf("%s",a)
#define sl(a) scanf("%lld",&a)
#define pi(a) printf("%d",a)
#define pl(a) printf("%lld",a)
#define ps(a) printf("%s",a)
#define ll long long
using namespace std;
int main()
{
  int n;
  cin >> n;
  if(n==0){
    cout << "2" << endl;
  }
  else if(n==1){
    cout << "1" << endl;
  }
  else{
    ll arr[100];
    arr[1]=2;
    arr[2]=1;
    for(int i=3;i<=n+1;i++){
      arr[i]=arr[i-1]+arr[i-2];
      // cout << arr[i] << endl;
    }
    cout << arr[n+1] << endl;
  }
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main()
{
    int W, H, x, y, r;
    cin >> W;
    cin >> H;
    cin >> x;
    cin >> y;
    cin >> r;
    if (x - r >= 0 && x + r <= W && y - r >= 0 && y + r <= H) {
        cout << "Yes\n";
    }
    else{
        cout << "No\n";
    }
}


Measured memory_bytes: 3100
#include <iostream>
#include <string>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <functional>
#include <stack>
#include <queue>
#include <climits>
#include <set>
#define endl '\n'
#define ll long long
#define mod 1000000007

using namespace std;

ll dp[1001][1001];
char grid[1001][1001];

int main(void)
{
    cin.tie(NULL); ios_base::sync_with_stdio(false);
    int H, W; cin >> H >> W;
    
    for(int i = 0; i <= H; i++)
        for(int j = 0; j <= W; j++)
            grid[i][j] = '#';
    
    for(int i = 1; i <= H; i++)
        for(int j = 1; j <= W; j++) cin >> grid[i][j];
    
    for(int i = 1; i <= H; i++)
    {
        for(int j = 1; j <= W; j++)
        {
            if(i == 1 && j == 1)
            {
                dp[i][j] = 1;
                continue;
            }
            if(grid[i][j] == '#') continue;
            
            if(grid[i-1][j] == '.')
                dp[i][j] += dp[i-1][j];
            
            dp[i][j] %= mod;
            
            if(grid[i][j-1] == '.')
                dp[i][j] += dp[i][j-1];
            
            dp[i][j] %= mod;
        }
    }
    cout << dp[H][W] << endl;
    return 0;
}


Measured memory_bytes: 9088
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define pii std::pair<int,int>
#define pli std::pair<ll,int>
#define pil std::pair<int,ll>
#define psi std::pair<string,int>
#define pll std::pair<ll,ll>
#define pci std::pair<char,int>
#define sll(x) scanf("%lld",&x)
#define prll(x) printf("%lld ",x)
#define pri(x) printf("%d ",x)
#define si(x) scanf("%d",&x)
#define pb push_back
#define vll std::vector<ll>
#define vpi std::vector<std::pair<int,int>>
#define vi std::vector<int>
#define vvi std::vector<std::vector<int>>
#define vvpil std::vector<std::vector<std::pair<int,ll>>>
#define vlpii std::vector<std::list<pii>>
#define vlpil std::vector<std::list<pil>>
#define li std::list<int>
#define lpil std::list<pil>
#define Endl printf("\n")
#define vli vector<list<int>>
#define vvll vector<vector<ll>>
#define mp make_pair
#define x first
#define y second
#define ull uint64_t
#define ma 100000000
#define imie(...) "[" << #__VA_ARGS__": " << (__VA_ARGS__) << "] "
const ll  INF=10000000000000;
const ll mod =  1e9 + 7;
using namespace std;
void add(ll& a , ll b){
	a += b;
	if(a >= mod) a -= mod;
}
ll mul(ll a , ll b){
	return (a * b) % mod;
}
ll Pow(ll a , ll b){
	if(b == 0) return 1 ;
	ll c = Pow(a , b / 2) ;
	if(b % 2) return (a * ((c * c)% mod )) % mod ;
	return (c * c) % mod ;
}

//check modulo
int main(){
	IOS;
	cout.precision(30) ;
	int n ; cin >> n ;
	vll a(n); for(int i = 0 ; i < n ; i++) cin >> a[i] ;
	ll nb = 0 ;
	for(int i = 0 ; i < n ; i++){
		while(a[i] % 2 == 0) {a[i] /= 2 ; nb++ ;}
	}
	cout << nb << endl; 
	
	return 0;
}


Measured memory_bytes: 384
import scala.io.StdIn._
object Main extends App {
  val Array(h, w) = readLine.trim.split(' ').map(_.toInt)
  val state = Array.fill(h){readLine.trim.split(' ').map(_.toInt)}
  val isCenter = Array.fill(h){Array.fill(w){false}}
  for (d ← 0 until h + w - 1; y ← math.max(0, d - w + 1) to math.min(d, h - 1)) {
    val x = d - y
    while (state(y)(x) >= 1){
      isCenter(y + 1)(x + 1) = true
      for (dx ← 0 to 2; dy ← 0 to 2) state(y + dy)(x + dx) -= 1
    }
  }
  (1 until w - 1).flatMap(x ⇒ (1 until h - 1).filter(y ⇒ isCenter(y)(x) && (-1 to 1).map(dx ⇒ (-1 to 1).count(dy ⇒ isCenter(y + dy)(x + dx))).sum <= 2).map(y ⇒ (y, x))).sortBy{case (i, j) ⇒ 10000 * i + j}.toList match {
    case (ti, tj)::(si, sj)::_ ⇒
      println(s"$si $sj $ti $tj")
    case (ti, tj):: Nil ⇒
      println(s"$ti $tj $ti $tj")
    case _ ⇒ ???
  }
}


Measured memory_bytes: 73660
#include <iostream>
#include <cmath>
using namespace std;
const int LIMIT = pow(10, 6);
int main (void) {
    int A, B, C;

    cin >> A >> B >> C;

    int ans = 0;
    while (true) {
        if (A % 2 != 0 || B % 2 != 0 || C % 2 != 0) {
            break;
        }
        if (ans == LIMIT) {
            break;
        }
        int a = B / 2 + C / 2;
        int b = C / 2 + A / 2;
        int c = A / 2 + B / 2;
        A = a;
        B = b;
        C = c;
        ans++;
    }

    if (ans == LIMIT) {
        cout << -1 << endl;
    } else {
        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef vector<long long> VL;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef long double db;
const ll mod=1000000007;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

int main() {
	char a[200100],b[200100];
	scanf("%s",a);
	scanf("%s",b);
	int ans=0;
	rep(i,0,strlen(a)){
		if(a[i]!=b[i]) ++ans;
	}
	printf("%d\n",ans);
}


Measured memory_bytes: 4084
#include <stdio.h>

int main(void)
{
  int N, M, i, A[10000][20], B[10000], C, j, s, count;

  scanf("%d%d%d",&N,&M,&C);
  for(i=0;i<M;i++) scanf("%d",&B[i]);
  for(i=0;i<N;i++)
        for(j=0;j<M;j++) scanf("%d",&A[i][j]);

  count=0;
  for(i=0;i<N;i++){
        s=0;
        for(j=0;j<M;j++) s = s + A[i][j] * B[j];
        if((s + C) > 0) count++;
        }
  printf("%d\n",count);
  return 0;
}


Measured memory_bytes: 128
w = str(input())
alp = 'abcdefghijklmnopqrstuvwxyz'
flag = True

for i in range(len(alp)):
    cnt = 0
    for j in range(len(w)):
        if alp[i]==w[j]:
            cnt += 1
    if cnt%2!=0:
        flag = False
        break

print('Yes' if flag else 'No')

Measured memory_bytes: 3060
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <utility>
#include <functional>
#include <sstream>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>
#include <memory>
#include <time.h>
using namespace std;
inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef long long ll;
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
const double EPS = 1e-9;
const double PI  = acos(-1.0);
 
bool bigger(int h1,int w1,int h2,int w2){
	if(h1*h1+w1*w1==h2*h2+w2*w2){
		return h1>h2;
	}else{
		return h1*h1+w1*w1 > h2*h2+w2*w2;
	}
}


int main(){
	int h,w;
	while(cin>>h>>w,h|w){
		int ah=1000,aw=1000;
		FOR(y,1,151){
			FOR(x,1,151){
				if(x>y&&bigger(y,x,h,w)&&bigger(ah,aw,y,x)){
					ah=y;
					aw=x;
				}
			}
		}
		cout<<ah<<" "<<aw<<endl;
	}
	
}

Measured memory_bytes: 1160
import std.stdio,
       std.algorithm,
       std.array,
       std.conv;

void main(){
    int[] ary = readln.split.to!(int[]);
    ary = array(filter!("a != 5")(ary));
    ary[0] == 7 && ary.length == 1 ? write("YES") : write("NO");
}

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

int ans[100000];

int main() {
  int n, m;
  int a, b;

  cin >> n
      >> m;

  for (int i = 0, j = 0; i < m; i++) {
    cin >> a
         >> b;
    ans[a - 1] += 1;
    ans[b - 1] += 1;
  }

  for (int i = 0; i < n; i++) {
    if (ans[i] % 2 != 0) {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
  return 0;
}



Measured memory_bytes: 768
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    S = readline().strip()
    K = int(readline())

    subs = set()

    for i in range(len(S)):
        for j in range(i + 1, min(len(S) + 1, i + K + 1)):
            subs.add(S[i:j])

    subs = sorted(subs)
    print(subs[K - 1])

    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 10488
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    X=int(input())
    z=100
    for i in range(1,10000):
        z=int(z*1.01)
        if z>=X:
            print(i)
            exit()
    

if __name__ == '__main__':
    main()


Measured memory_bytes: 63636
from collections import deque

H, W = [int(_) for _ in input().split()]
S = [input() for _ in range(H)]

move = ((1, 0), (-1, 0), (0, 1), (0, -1))
visited = [[False] * W for _ in range(H)]


que = deque([(0, 0, 1)])


result = -1
while que:
    ci, cj, step = que.popleft()
    visited[ci][cj] = True
    if (ci, cj) == (H-1, W-1):
        result = step
        break

    for di, dj in move:
        ni, nj = ci + di, cj + dj
        if not (0 <= ni < H and 0 <= nj < W) or visited[ni][nj]:
            continue
        if S[ni][nj] == '.':
            visited[ni][nj] = True
            que.append((ni, nj, step+1))

if result == -1:
    print(-1)
else:
    W = 0
    for s in S:
        W += s.count('.')
    print(W-result)


Measured memory_bytes: 40176
#include <bits/stdc++.h>
#define int long long
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int n[]={0,1,2,1,3,1,3,1,1,3,1,3,1};
main(){
	int a,b,c;
	cin>>a;
	cout<<"ABC"<<a;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <vector>
#include <queue>
#include <map>
#include <string>
using namespace std;

int main(){
	int n;
	cin >> n;
	int ans = 1;
	int i = 2;
	 while(1){
		if(ans*i <= n) ans *= i;
		else break;
	}
	cout << ans << endl;
	return 0;
}

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

long long n,k,hxt[200010],ans;

bool cmp(int a,int b)
{
	return a>b;
}

int main()
{
	scanf("%lld %lld",&n,&k);
	for(int i=1;i<=n;i++)
	{
		scanf("%lld",&hxt[i]);
	}
	sort(hxt+1,hxt+n+1,cmp);
	for(int i=k+1;i<=n;i++) ans+=hxt[i];
	printf("%lld",ans);
	return 0;
} 

Measured memory_bytes: 1792
import numpy as np
n, m = map(int, input().split())
if m == 0:
    print(0)
    exit()
r = [[] for i in range(n)]
for i in range(m):
    f, s = map(int, input().split())
    r[f-1].append(s - 1)
    r[s-1].append(f - 1)
ans = []
def dfs(now, visited = []):
    global ans
    if len(visited) == n:
        ans.append([visited])
        return
    for j in r[now]:
        if j not in visited:
            dfs(j, visited + [j])
dfs(0, [0])
print(len(ans))

Measured memory_bytes: 13144
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define Graph vector<vector<int>>;
#define iterG(next_v, G, v) for(auto next_v : G[v]
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, num, ans, res;
    cin >> n;
    res = 0;
    for(int i=1;i<=n;i+=2){
        ans = 1;
        vector<int> x(i+1, 0);
        num = i;
        for(int j=2;j<=i;j++){
            while(num%j == 0){
                x.at(j)++;
                num/=j;
            }
        }
        for(int j=2;j<=i;j++){
            ans *= x.at(j) + 1;
        }
        if (ans==8){
            res++;
        }
    }
    cout << res << endl;
    return 0;
}



Measured memory_bytes: 3164
# from math import factorial,sqrt,ceil,gcd
# from itertools import permutations as permus
# from collections import deque,Counter
# import re
# from functools import lru_cache # 簡単メモ化 @lru_cache(maxsize=1000)
# from decimal import Decimal, getcontext
# # getcontext().prec = 1000
# # eps = Decimal(10) ** (-100)

# import numpy as np
# import networkx as nx
# from scipy.sparse.csgraph import shortest_path, dijkstra, floyd_warshall, bellman_ford, johnson
# from scipy.sparse import csr_matrix
# from scipy.special import comb

# slist = "abcdefghijklmnopqrstuvwxyz"
Q,H,S,D = map(int,input().split())
N = int(input())

ltl_1 = min(4*Q,2*H,S)
lit_2 = min(2*ltl_1,D)
num1 = N%2
num2 = N//2

ans = num2 * lit_2 + num1 * ltl_1
print(ans)
# print(*ans)   # unpackして出力。間にスペースが入る
# for row in board:
#     print(*row,sep="")    #unpackして間にスペース入れずに出力する
# print("{:.10f}".format(ans))
# print("{:0=10d}".format(ans))


Measured memory_bytes: 2940
N,K = map(int,input().split())
A = list(map(int,input().split()))
k = [[0,i] for i in range(1,N+1)]
for i in range(N):
  k[A[i]-1][0] += 1
B = set(A)
C = list(B)
k.sort()
if len(C) <= K:
  print(0)
else:
  now = len(C)-K
  ans = 0
  for i in range(len(k)):
    if k[i][0] == 0:
      continue
    else:
      now -= 1
      ans += k[i][0]
      if now == 0:
        print(ans)
        break

Measured memory_bytes: 50744
#include <bits/stdc++.h>
using namespace std;
#define REP(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) REP(i, 0, n)
#define rrep(i, n) for (int i = (int)(n-1); i >= 0; i--)
#define sz(x) int(x.size())
#define bitsz(x) int(__builtin_popcount(x))
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb(x) push_back(x)
#define INF 1e9
#define LINF 1e18
#define mod 1000000007
template<class T> inline bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b) { if (a > b) { a = b; return 1; } return 0; }
template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };
typedef long long ll;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
const int di[4] = {1,0,-1,0};
const int dj[4] = {0,1,0,-1};

const int M = 1000005;

int main() {
    int a,b; cin >> a >> b;
    cout << a*b << endl;
}

Measured memory_bytes: 3608
import java.util.*;
class Main{
  public static void main(String[] args){
    Scanner stdIn=new Scanner(System.in);
    int A = stdIn.nextInt();
    String op = stdIn.next();
    int B = stdIn.nextInt();
    if(op.contains("+")){
      System.out.println(A+B);
    }else{
      System.out.println(A-B);
    }
  }
}

Measured memory_bytes: 21844
package main

import (
	"fmt"
)

func COM(n, k int64) int64 {
	r := int64(1)
	for i := int64(0); i < k; i++ {
		r = ModMul(r, n-i)
		r = ModDiv(r, i+1)
	}

	return r
}

const (
	MOD = 1000000000 + 7
)

func ModAdd(a, b int64) int64 {
	return (a + b) % MOD
}

func ModMul(a, b int64) int64 {
	return a * b % MOD
}

func ModSub(a, b int64) int64 {
	r := (a%MOD - b%MOD) % MOD
	if r < 0 {
		r += MOD
	}
	return r
}

func ModDiv(a, b int64) int64 {
	return a % MOD * ModInv(b) % MOD
}

func ModPow(a, n int64) int64 {
	var r int64 = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModInv(a int64) int64 {
	var b, u, v int64 = MOD, 1, 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= MOD
	if u < 0 {
		u += MOD
	}
	return u
}

type Q struct {
	value int
	index int
	A, B  int
}

type QS []*Q

func (p QS) Len() int           { return len(p) }
func (p QS) Less(i, j int) bool { return p[i].value > p[j].value }
func (pq QS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *QS) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Q)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *QS) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}

func FactoredPrimeNumber(num int) map[int]int {
	m := map[int]int{}
	return factor(m, num, 2)
}

func factor(result map[int]int, num, pnum int) map[int]int {
	if pnum*pnum > num {
		if num != 1 {
			result[num] += 1
		}
		return result
	}

	if num%pnum == 0 {
		num /= pnum
		result[pnum]++
	} else {
		pnum++
	}
	return factor(result, num, pnum)
}

func GCD(a, b int64) int64 {
	if b == 0 {
		return a
	}
	return GCD(b, a%b)
}

func LCM(a, b int64) int64 {
	return a * b / GCD(a, b)
}

func main() {
	var A, B, C int
	fmt.Scanf("%d %d %d\n", &A, &B, &C)
	min := A + B
	if min > B+C {
		min = B + C
	}
	if min > C+A {
		min = C + A
	}

	fmt.Println(min)
}

func Reverse(runes []rune) []rune {
	for i, j := 0, len(runes)-1; i < j; i, j = i+1, j-1 {
		runes[i], runes[j] = runes[j], runes[i]
	}
	return runes
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
int main()
{
    long long int t,x;
    scanf("%lld",&t);
    scanf("%lld",&x);
    t=t*500;
    if(t>=x)
    {
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    printf("\n");
    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-

C1=raw_input()
C2=raw_input()

if C1[0]!=C2[2]:
    print 'NO'
elif C1[1]!=C2[1]:
    print 'NO'
elif C1[2]!=C2[0]:
    print 'NO'
else:
    print 'YES'

Measured memory_bytes: 2568
typedef unsigned int uint;

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

#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }
inline uint getX(){ uint s; scanf("%x", &s); return s; }

#include <set>
using namespace std;

int main(){
  const int n = getInt();

  REP(cc, n){
    const uint t = getX();
    const int sig = (t & (1u << 31)) ? -1 : 1;
    const double ans = sig * (((t & ((1u << 31) - 1)) >> 7) +
                              (t & ((1 << 7) - 1)) / 128.0);
    const int keta = t ? max(1, 7 - __builtin_ctz(t)) : 1;
    printf("%.*f\n", keta, ans);
  }

  return 0;
}

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

int main() {
  int w, h;
  cin>>w>>h;
  long long p[w], q[h];
  for (int i=0; i<w; i++) cin>>p[i];
  for (int i=0; i<h; i++) cin>>q[i];

  sort(p, p + w);
  sort(q, q + h);

  int i = 0, j = 0;
  long long cost = 0;
  while (i < w && j < h) {
    if (p[i] < q[j]) {
      cost += p[i] * (h + 1 - j);
      ++i;
    } else {
      cost += q[j] * (w + 1 - i);
      ++j;
    }
  }
  while (i < w) {
    cost += p[i] * (h + 1 - j);
    ++i;
  }
  while (j < h) {
    cost += q[j] * (w + 1 - i);
    ++j;
  }
  cout<<cost<<endl;
}

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

int main(void)
{
    int N, A;
    int mod;

    cin >> N >> A;

    mod = N % 500;

    if (mod <= A)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++)
#define loop(i,x,n) for(int i=(x);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define int long long
using namespace std;
const int MOD=1e9+7;
const int INF=1e18;


signed main(){
  int n;
  while(cin>>n,n){
    vector<string> st;
    int m=0;
    rep(i,n){
      string s,t="";cin>>s;
      rep(i,s.size()){
        if(i==0)t+=s[i];
        if(s[i]=='a'||s[i]=='i'||s[i]=='u'||s[i]=='e'||s[i]=='o'){
          if(i<s.size()-1)t+=s[i+1];
        }
      }
      int tmp=t.size();
      m=max(m,tmp);
      st.push_back(t);
    }
    int f=true;
    loop(i,1,m+1){
      set<string> u;
      for(auto x:st){
        if(i<=x.size())u.insert(x.substr(0,i));
        else u.insert(x);
      }
      if(u.size()==n){
        cout<<i<<endl;
        f=false;
        break;
      }
    }
    if(f)cout<<-1<<endl;
  }
  return 0;
}



Measured memory_bytes: 3112
#include<iostream>
#include<vector>
#include<string>
#include<array>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<numeric>
#include<iomanip>
#include<utility>
#include<cstdlib>
#include<typeinfo>
#include<stack>
#include<cassert>
#include<functional>
#define int long long int
#define double long double
using namespace std;
#define INT_MAX 1000000005
#define INF 1000000005
const int MAX_N = 1 << 17;
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;

signed main()
{
double n,fd,x;
std::cin >> n >> fd >> x;
std::vector<double> d;
std::vector<double> dsum;
double dall = 0;
double index = 0;
for(int i = 0; i < n; i++){
    d.push_back((double)(2 * fd + index * x + (index + 1) * x));
    dall += fd + index * x + (index + 1) * x;
    index += 2.0;
}
dsum.push_back(d[0]);
for(int i = 1; i < n; i++){
    dsum.push_back(dsum[i - 1] + d[i]);
}
std::vector<double> fsum;
fsum.push_back(1.0);
for(double i = 2; i <= n; i++){
    fsum.push_back(fsum[i - 2] + 1.0/i);
}
/*for(int i = 0; i < n; i++){
    std::cout << fsum[i] << std::endl;
}*/
double sum = 0;
for(int i = 0; i < n; i++){
    sum += (fsum[n - i - 1] + fsum[i]) * d[i];
}
sum = sum / 2.0;
sum = sum / 2.0;
std::cout << std::fixed <<std::setprecision(15) <<  sum << std::endl;
return 0;
}

Measured memory_bytes: 16236
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass
{
	public const long Giri = 1000000007;
	public const long DpInf = 99999999999;
	
	public static void Main(string[] args)
	{
		var n = Input().ToInt();
		var a = n[0];
		var b = n[1];
		int k = 0;
		int q = (b - a);
		for(int i = 1; i <= q; i++)
			k += i;
		Console.WriteLine(k-b);
	}

	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt();
		return r;
	 }
}


Measured memory_bytes: 11092
/*  In the name of ALLAH */

#include<bits/stdc++.h>
using namespace std;
/*******  All Required define Pre-Processors and Constants    *******/

#define int long long
#define ull unsigned long long 
#define ld long double
#define mem(a, b) memset(a, (b), sizeof(a))
#define rep(i, j, k) for (int i = j ; i < k ; ++i)
#define rrep(i, j, k) for (int i = j; i > k; --i)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define foreach(i, a) for(auto i: a)
#define forEach(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define in(A, B, C) assert( B <= A && A <= C)
#define debug(a) cout << #a << ": " << a << endl
#define Flag(n) cout << "here " << n << endl
#define w(x) int x;cin>>x;while(t--)
#define mp make_pair
#define pb push_back

#define endl '\n';
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int POSITIVE_INFINITY = 9223372036854775807;
const int NEGATIVE_INFINITY = -9223372036854775807;
const int MOD = 1000000007;
const ld PI = acos(-1.0);
 

#define TRACE
#ifdef TRACE
#define see(...) __f(#__VA_ARGS__,__VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr<<name<<" : "<<arg1<<endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma=strchr(names+1,',');cerr.write(names,comma-names)<<" : "<<arg1<<" | ";__f(comma+1, args...);
}
#else
#endif



int32_t main() {
    io;
    // freopen("input.txt","r",stdin); 
    // freopen("output.txt","w",stdout);
    int n,m,k;
    cin>>n>>m>>k;
    int a[n],b[m];
    int ans = 0;
    for(int i = 0; i < n;i++){
        cin>>a[i];
        if(i) a[i]+=a[i-1];
        if(a[i]<=k)ans++;
    }
    for(int i =0;i<m;i++){
        cin>>b[i];
        if(i)b[i]+=b[i-1];
        if(b[i]<=k){
            ans = max(ans, i+1 +( upper_bound(a,a+n, k-b[i])-a));
        }
    }
    cout<<ans<<endl;
 

 
    
 
    return 0;
}


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

using namespace std;

int main() {
    int k;
    string s;

    cin >> k >> s;

    if(s.size() <= k) {
        cout << s << "\n";
    } else {
        cout << s.substr(0, k) << "...\n";
    }

    return 0;
}

Measured memory_bytes: 3628
<?php
fscanf(STDIN, "%d %d %d", $n, $k, $q);
$p = array_fill(0,$n,$k-$q);
for($i=0; $i<$q; $i++) {
    fscanf(STDIN, "%d", $a);
    $p[$a-1] += 1;
}
for($i=0; $i<$n; $i++) {
    if($p[$i] > 0){
        echo "Yes"."\n";
    } else {
        echo "No"."\n";
    }
}

Measured memory_bytes: 9080