akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {
	private Scanner sc;
	
	public static void main(String[] args) {
		new Main();
	}
	
	public Main() {
		sc = new Scanner(System.in);
		
		boolean flag = false;
		
		String line = "";
		while (sc.hasNext() == true) {
			line = sc.nextLine();

			String bits = "";
			for (int i = 0; i < line.length(); i++) {
				char c = line.charAt(i);
				
				if (Character.isAlphabetic(c) == true) {
					String tmp = Integer.toBinaryString(c - 'A');
					
					int num = tmp.length();
					for (int j = 0; j < (5 - num); j++) {
						tmp = "0" + tmp;
					}
					bits = bits + tmp;
				} else {
					switch (c) {
					case ' ':
						bits = bits + "11010";
						break;
					case '.':
						bits = bits + "11011";
						break;
					case ',':
						bits = bits + "11100";
						break;
					case '-':
						bits = bits + "11101";
						break;
					case '\'':
						bits = bits + "11110";
						break;
					case '?':
						bits = bits + "11111";
						break;
					}
				}
			}
			
			System.out.println(getChar(bits));
		}
	}
	
	public String getChar(String str) {
		String ans = "";

		String state = "";
		for (int i = 0; i < str.length(); i++) {
			String newstate = state + str.charAt(i);
			state = "";
			
			
			switch (newstate) {
			case "101":
				ans = ans + " ";
				break;
			case "000000":
				ans = ans + "'";
				break;
			case "000011":
				ans = ans + ",";
				break;
			case "10010001":
				ans = ans + "-";
				break;
			case "010001":
				ans = ans + ".";
				break;
			case "000001":
				ans = ans + "?";
				break;
			case "100101":
				ans = ans + "A";
				break;
			case "10011010":
				ans = ans + "B";
				break;
				
			case "0101":
				ans = ans + "C";
				break;
			case "0001":
				ans = ans + "D";
				break;
			case "110":
				ans = ans + "E";
				break;
			case "01001":
				ans = ans + "F";
				break;
			case "10011011":
				ans = ans + "G";
				break;
			case "010000":
				ans = ans + "H";
				break;
			case "0111":
				ans = ans + "I";
				break;
			case "10011000":
				ans = ans + "J";
				break;
				
			case "0110":
				ans = ans + "K";
				break;
			case "00100":
				ans = ans + "L";
				break;
			case "10011001":
				ans = ans + "M";
				break;
			case "10011110":
				ans = ans + "N";
				break;
			case "00101":
				ans = ans + "O";
				break;
			case "111":
				ans = ans + "P";
				break;
			case "10011111":
				ans = ans + "Q";
				break;
			case "1000":
				ans = ans + "R";
				break;
				
			case "00110":
				ans = ans + "S";
				break;
			case "00111":
				ans = ans + "T";
				break;
			case "10011100":
				ans = ans + "U";
				break;
			case "10011101":
				ans = ans + "V";
				break;
			case "000010":
				ans = ans + "W";
				break;
			case "10010010":
				ans = ans + "X";
				break;
			case "10010011":
				ans = ans + "Y";
				break;
			case "10010000":
				ans = ans + "Z";
				break;
				
			default:
				state = newstate;
				break;
			}
		}
		
		return ans;
	}
}

Measured memory_bytes: 61688
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define loop(i,a,b) for(i=a;i<b;i++)
#define rloop(i,a,b) for(i=a;i>=b;i--)
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
const int inf=1000000001;
const ll INF=1e16;
#define MOD 1000000007
#define mod 1000000009
#define pi 3.14159265358979323846

int main(){
	int n,i;
	cin>>n;
	vl dp(n+1);
	dp[0]=dp[1]=1;
	loop(i,2,n+1){
		dp[i]=dp[i-1]+dp[i-2];
	}
	cout<<dp[n]<<endl;
}

Measured memory_bytes: 3092
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES 
#include<iomanip> 
#include<cmath>  
#include<iostream>
#include<fstream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<bitset>
#include<map>
// #include<unordered_map>
#include<set>
// #include<unordered_set>
#include<queue>
#include<deque>
#include<stack>
#include<functional>
using namespace std;
typedef long long ll;
#define repi(i,a,b) for(ll i = (ll)(a) ; i < (ll)(b) ; i++)
#define repd(i,a,b) for(ll i = (ll)(a) ; i > (ll)(b) ; i--)
#define rd(x) cin >> x
#define wr(x)  cout << x
#define wrln(x) cout << x << endl
#define wl() cout << endl
const ll MAX_10p5 = 100010;
const ll MAX_10p9 = 1000000010;
const ll MAX_10p18 = 1000000000000000010;
const ll MOD = 1000000007;
const ll m4x[4] = { 1,0,-1,0 };
const ll m4y[4] = { 0,1,0,-1 };
const ll m8x[8] = { 1,1,0,-1,-1,-1,0,1 };
const ll m8y[8] = { 0,1,1,1,0,-1,-1,-1 };
const ll m9x[9] = { 1,1,0,-1,-1,-1,0,1,0 };
const ll m9y[9] = { 0,1,1,1,0,-1,-1,-1,0 };

struct edge {
	ll from, to, cost;
	bool operator<(const edge& right) const {
		return cost < right.cost;
	}
};
struct point {
	ll x, y, idx;
	bool operator<(const point& right) const {
		return x == right.x ? y < right.y : x < right.x;
	}
};

template<typename T>
T minT(T a, T b) {
	if (a < b) return a;
	else return b;
}

template<typename T>
T maxT(T a, T b) {
	if (a > b) return a;
	else return b;
}

template<typename T>
T absT(T a) {
	if (a < 0) a *= -1;
	return a;
}

template<typename T>
T powT(T a, T x) {
	T res = 1;
	while (x > 0) {
		if (x & 1) res = res*a;
		a = a*a;
		x >>= 1;
	}
	return res;
}

ll StoLL(string str) {
	ll ret = 0, ini = 0;
	if (str[0] == '-') ini = 1;
	repi(i, ini, str.length()) {
		ret *= 10;
		ret += (ll)(str[i] - '0');
	}
	if (ini) ret *= -1;
	return ret;
}

///////////////////////////////////////////////////////////////////////////////////////

ll dp[MAX_10p5 * 2];

int main() {
	ll n;
	vector<ll> vc;
	rd(n);

	vc.push_back(1);

	repi(i, 1, n + 1) dp[i] = MAX_10p18;

	ll x = 6;
	while (1) {
		if (x > n) break;
		vc.push_back(x);
		x *= 6;
	}

	x = 9;
	while (1) {
		if (x > n) break;
		vc.push_back(x);
		x *= 9;
	}

	repi(i, 0, n) {
		repi(j, 0, vc.size()) {
			ll t = i + vc[j];
			dp[t] = min(dp[t], dp[i] + 1);
		}
	}

	wrln(dp[n]);

	return 0;
}

Measured memory_bytes: 1536
N = int(input())
S = str(input())
cnt = 0
if N <= 2:
    print(0)
else:
    for i in range(N-2):
        if (S[i] == 'A')and(S[i+1]=='B')and(S[i+2]=='C'):
            cnt += 1
print(cnt)

Measured memory_bytes: 3060
n = int(input())
A = [int(x) for x in input().split()]

from collections import Counter
import operator
def f():
    a = Counter(A[::2]).most_common(2)
    b = Counter(A[1::2]).most_common(2)
    ac, bc = a[0][1], b[0][1]
    ret = n - (ac + bc)
    if a[0][0] == b[0][0]:
        bc_2 = b[1][1] if len(b) != 1 else 0
        ac_2 = a[1][1] if len(a) != 1 else 0
        ret = n - max(ac + bc_2, ac_2 + bc)
    return ret
print(f())

Measured memory_bytes: 15516
#include <iostream>
#include <vector>

using namespace std;

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


Measured memory_bytes: 256
#include <bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
using namespace std;
// using namespace __gnu_pbds;
#define lli long long int
#define llu unsigned long long int
#define pb push_back
#define rt return 0
#define endln "\n"
#define all(x) x.begin(), x.end()
#define sz(x) (lli)(x.size())
const lli MOD = 1e9 + 7;
const double PI = 2 * acos(0.0);
// cout << fixed << setprecision(0) << pi <<endl;
// typedef tree<int, null_type, less<int>, rb_tree_tag,
//              tree_order_statistics_node_update>
//     new_data_set;
// for multiset
// typedef tree<int, null_type, less_equal<int>, rb_tree_tag,
//              tree_order_statistics_node_update>
//     new_data_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)

void solve() {
    lli n, a;
    cin >> n;
    for (lli i = 0; i < n; i++) {
        cout << "ACL";
    }
    cout << endl;
}

int main(void) {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    // lli t; cin >> t; while(t--)
    solve();
    rt;
}

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

int main() {
    int n;
    cin >> n;
    vector<int> t(n);
    int sum = 0;
    for (int i = 0; i < n; i++) {
        cin >> t.at(i);
        sum += t.at(i);
    }

    int m, p, x;
    cin >> m;
    for (int i = 0; i < m; i++) {
        cin >> p >> x;
        cout << sum + (x - t.at(p-1)) << endl;
    }

    return 0;
}


Measured memory_bytes: 3572
import java.util.Scanner;

public class Main {
	public static void main (String args[]) {
	Scanner scan = new Scanner(System.in);
    int H = Integer.parseInt(scan.next());
    int A = Integer.parseInt(scan.next());
    int num = 0;
    if(H % A == 0) {
    	num = H / A;
    } else { 
    	num = H / A + 1; 
    }
  	System.out.println(num);
	}
}

Measured memory_bytes: 22740
#include<iostream>
main(){int n,m,i,a,c[1000001];for(std::string s;std::cin>>n>>m>>s,n;printf("%d\n",a))for(a=0,i=m;--i;a+=c[i]>=n)c[i]=s.substr(i,3)=="IOI"?c[i+2]+1:0;}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	//freopen("aa.in","r",stdin);
	int i,j;
	ll x,y;
	cin>>x>>y;
	for(i=1;x<=y/(1LL<<i);++i);
	cout<<i;
	return 0;
}

Measured memory_bytes: 384
// Problem Code: abc174_d

#include <iostream>
#include <string>

using namespace std;

int alter_altar(int N, string& c) {
	int cnt, l, r;
	cnt = l = 0;
	r = c.length() - 1;

	while (l < r) {
		while (l < r && c[l] != 'W')
			l++;
		while (l < r && c[r] != 'R')
			r--;
		if (l < r) {
			cnt++;
			swap(c[l], c[r]);
		}
	}

	return cnt;
}

int main() {
	int N;
	string c;
	cin >> N >> c;
	cout << alter_altar(N, c);
	return 0;
}

Measured memory_bytes: 3704
n = int(input())
a = list(map(int, input().split()))
mn = a[0]
mx = a[0]
sum = a[0]
for i in range(1, n):
	mn = min(mn, a[i])
	mx = max(mx, a[i])
	sum += a[i]
print(mn, mx, sum)


Measured memory_bytes: 6588
#include<bits/stdc++.h>
using namespace std;
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    long long ans=0;
    for(int a=1;a<=n;a++){
        for(int b=1;b<=n;b++){
            for(int c=1;c<=n;c++){
                ans+=__gcd(__gcd(a,b),c);
            }
        }
    }
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 3656
#include<iostream>
#include<queue>
#include<string>

using std::begin;
using std::end;

int main() {
  int n, q;
  std::cin >> n >> q;
  std::queue<std::pair<std::string, int>> queue;
  for(int i{0}; i < n; ++i) {
    std::string name;
    int t;
    std::cin >> name >> t;
    queue.emplace(name, t);
  }

  int time{0};
  while(!queue.empty()) {
    auto p = queue.front();
    queue.pop();
    if(p.second <= q) {
      time += p.second;
      std::cout << p.first << ' ' << time << std::endl;
    }
    else {
      time += q;
      queue.emplace(p.first, p.second - q);
    }
  }

  return 0;
}



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

using namespace std;

inline void ex()
{
    cout << 0;
    exit(0);
}

int main()
{

    long long a, b, c; cin >> a >> b >> c;
    if (a % 2 == 0)
        ex();
    if (b % 2 == 0)
        ex();
    if (c % 2 == 0)
        ex();

    vector <long long> v = {a, b, c};
    sort(v.begin(), v.end());

    cout << v[0] * v[1];




}


Measured memory_bytes: 256
from math import sqrt
x = []
y = []
while(1):
    try:
        a = [float(i) for i in input().split(",")]
        x.append(a[0])
        y.append(a[1])
    except EOFError:
        break
n = len(x)
S = 0

for i in range(n-2):
    if i == 0:
        a = sqrt((x[1]- x[0])**2 + (y[1]-y[0])**2)
    b = sqrt((x[i+2]- x[i+1])**2 + (y[i+2]-y[i+1])**2)
    c = sqrt((x[i+2]- x[0])**2 + (y[i+2]-y[0])**2)
    z = (a+b+c)/2
    s = sqrt(z*(z-a)*(z-b)*(z-c))
    S = S + s
    a = c

print("{:.6f}".format(S))


Measured memory_bytes: 5676
//競技プログラミング用のテンプレート
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <queue>
#include <string>
#include <math.h>
#include <stack>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define repr(i, n) for(int i = n - 1; i >= 0; i--)

using namespace std;
using ll = long long int;
using p = pair<int, int>;
using pl = pair<ll, ll>;
using v = vector<int>;
using vd = vector<double>;
using vs = vector<string>;
using vl = vector<ll>;

int main()
{
  ll h;
  int n;
  cin >> h >> n;
  ll total = 0;
  rep(i, n)
  {
    int temp = 0;
    cin >> temp;
    total += temp;
  }
  if(total < h)
  {
    cout << "No" << endl;
  }else{
    cout << "Yes" << endl;
  }
}


Measured memory_bytes: 256
MOD = 1000000007
NCK_MAX = 510000

fac = [0 for _ in range(NCK_MAX)]; finv = [0 for _ in range(NCK_MAX)]
inv = [0 for _ in range(NCK_MAX)]; facn = [0 for _ in range(NCK_MAX)]

def myPow(x,n,MOD=MOD):
    if n == 0:
        return 1
    elif n % 2 == 0:
        return myPow(x*x%MOD,n//2)
    else:
        return x*myPow(x,n-1)%MOD

def COMinit(n):
    fac[0] = 1; fac[1] = 1
    facn[1] = n
    finv[0] = 1; finv[1]=1
    inv[1]=1
    for i in range(2,NCK_MAX):
        fac[i] = fac[i-1]*i%MOD
        facn[i] = facn[i-1]*(n-i+1)%MOD
        inv[i] = MOD-inv[MOD%i]*(MOD//i)%MOD
        finv[i] = finv[i-1]*inv[i]%MOD

def modinv(a,MOD=MOD):
    return myPow(a,MOD-2)

def COM(n,k):
    if n<k:
         return 0
    elif n<0 and k<0:
         return 0
    return facn[k] * finv[k]%MOD

def shokou(i):
    return (i*(i-1))//2
def makkou(i,n):
    return ((2*n+1-i)*i)//2

n,k = map(int, input().split())
n = n
# COMinit(n)
ans = 0
li = list(range(n))
for i in range(k,n+2):
    ans = (ans + makkou(i,n)-shokou(i)+1+MOD)%MOD
    # print(ans)

print(ans)


Measured memory_bytes: 32800
#include <iostream>

int main()
{
    int N;
    std::cin >> N;
    long prev = 0L;
    int count = 0;
    int max = 0;
    for (int i=0; i<N; ++i) {
        long H;
        std::cin >> H;
        if (prev >= H) {
            count += 1;
            if (max < count) {
                max = count;
            }
        } else {
            count = 0;
        }
        prev = H;
    }
    std::cout << max << std::endl;
    return 0;
}

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

int main()
{
  vector<int> v(200001, 200001);
  int count = 0, ans = 0;
  int N, K, a;

  cin >> N >> K;
  for (int i = 0; i < N; i++)
  {
    cin >> a;
    if (v[a] == 200001)
    {
      count++;
      v[a] = 1;
    }
    else
      v[a]++;
  }
  sort(v.begin(), v.end());
  for (int i = 0; i < count - K; i++)
    ans += v[i];
  cout << ans << endl;
}

Measured memory_bytes: 1024
N = int(input())
A = list(map(int,input().split()))
A = A
dp = [[0] * (N+1) for _ in range(N+1)]

for i in range(N+1):
    dp[i][i] = 0

for k in range(1,N+1):#区間の残り数
    for i in range(N):#左端
        x = i+k#右端
        if x > N:
            continue
        elif (N-k) % 2 == 0:#太郎
            #print(i,x)
            dp[i][x] = max(dp[i+1][x] + A[i], dp[i][x-1] + A[x-1])
        elif (N-k) % 2 == 1:#次郎
            #print(i,x)
            dp[i][x] = min(dp[i+1][x] - A[i], dp[i][x-1] - A[x-1])
            
print(dp[0][N])

Measured memory_bytes: 115420
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const int INF = 1e9;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " ";} cout<<endl;
typedef struct{
    ll S;
    ll T;
    ll X;
} P;

bool comp(P p1, P p2){
    return p1.X > p2.X;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,Q;
    cin >> N >> Q;
    ll S[200010], T[200010], X[200010];
    ll D[200010];
    rep(i,0,N){
        cin >> S[i] >> T[i] >> X[i];
        T[i]--;
    }
    rep(i,0,Q){
        cin >> D[i];
    }
    ll pos[200010];
    memset(pos, -1, sizeof(pos));
    vector<P> lp;
    rep(i,0,N){
        P tmp = {S[i], T[i], X[i]};
        lp.push_back(tmp);
    }
    sort(lp.begin(), lp.end(), comp);
    vector<lpair> ans;
    rep(i,0,N){
        ll s = lp[i].S;
        ll t = lp[i].T;
        ll x = lp[i].X;
        if(s < x) s = x;
        if(t < x) t = x;
        ll ss = max(0LL, s - x);
        ll tt = max(0LL, t - x);
        ll p1 = lower_bound(D, D+Q, ss) - D;
        ll p2 = upper_bound(D, D+Q, tt) - D;
        ans.push_back(make_pair(p1,p2));
    }
    reverse(ans.begin(), ans.end());
    set<ll> st;
    rep(i,0,Q) st.insert(i);
    rep(i,0,N){
        auto it1 = st.lower_bound(ans[i].first);
        auto it2 = st.lower_bound(ans[i].second);
        while(it1 != it2){
            auto it_tmp = it1;
            ll v = *it_tmp;
            pos[v] = lp[N-1-i].X;
            it_tmp++;
            st.erase(it1);
            it1 = it_tmp;
        }

    }
    rep(i,0,Q) print(pos[i]);
}


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

#ifdef DEBUG
    #include "debug.h"
    #define dump(...)                                                              \
        DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                            \
                << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]"        \
                << endl                                                            \
                << "    ",                                                         \
            dump_func(__VA_ARGS__)
#else
    #define dump(...)
#endif


// http://beet-aizu.hatenablog.com/entry/2018/04/08/145516
template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}

//////////////////

#define int long long
 
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)

#define YES puts("YES")
#define Yes puts("Yes")
#define NO  puts("NO")
#define No  puts("No")
#define ALL(v) (v).begin(), (v).end()
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

/*
#define mod 1000000007 /*/
#define mod 998244353 //*/

typedef pair<int, int> P;
#define INF (1LL<<60)


void solve(){
    int X;
    cin >> X;
    if(X>=30) Yes;
    else No;
    
}


signed main(){
    cout << fixed << setprecision(18);
    cerr << fixed << setprecision(18);
    solve();
}


Measured memory_bytes: 3616
/// Rustで競技プログラミングの入力をスッキリ記述するマクロ
///
/// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

fn main() {
    let scan = std::io::stdin();

    let mut s = String::new();
    scan.read_line(&mut s).ok();

    let n = s.trim().parse::<u64>().unwrap();

    if n == 1 {
        println!("Hello World");
    } else {
        let mut a_s = String::new();
        scan.read_line(&mut a_s).ok();
        let a = a_s.trim().parse::<u64>().unwrap();

        let mut b_s = String::new();
        scan.read_line(&mut b_s).ok();
        let b = b_s.trim().parse::<u64>().unwrap();

        println!("{}", a + b);
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
 using namespace std;
 string S, T;
 void input() {
 cin >> S >> T;
 }
 void solve() {
 T.pop_back();
 if(S == T) cout << "Yes" << endl;
 else cout << "No" << endl;
}
 int main() {
 input();
 solve();
 return 0;
 }


Measured memory_bytes: 3624
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<cstdlib>
#include<cstring>
using namespace std;
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0' || ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0' && ch<='9')x=x*10+ch-'0',ch=getchar();
	return x*f;
}
int stack[20];
inline void write(int x)
{
	if(x<0){putchar('-');x=-x;}
	if(!x){putchar('0');return;}
	int top=0;
	while(x)stack[++top]=x%10,x/=10;
	while(top)putchar(stack[top--]+'0');
}
inline void pr1(int x){write(x),putchar(' ');}
inline void pr2(int x){write(x),puts("");}
char ss[1000010];
int main()
{
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    scanf("%s",ss+1);int len=strlen(ss+1);
    bool bk=false;
    ss[0]='0';
    int ans=0;
    for(int i=len;i>=1;i--)
    {
    	int ul=ss[i]-'0';if(bk==true)ul++;
    	if(ul<=4)ans+=ul,bk=false;
    	else if(ul==10)bk=true;
    	else
    	{
    		if(ul>=6)ans+=10-ul,bk=true;
    		else
    		{
    			ans+=5;
    			int he=ss[i-1]-'0';
    			if(he<=4)bk=false;
    			else bk=true;
    		}
    	}
    }if(bk==true)ans++;
	pr2(ans);
    return 0;
}

Measured memory_bytes: 1152
using System;
using System.Text;

class Program {
    //--------------------------------------------------
    static void Main( string[] args )
    {
        University university = new University();

        university.Read();
        university.Print();
    }

    //--------------------------------------------------
    public class University {
        //--------------------------------------------------
        public University()
        {
            for ( int i = 0; i < _buildings.Length; ++i ) {
                _buildings[ i ] = new Building();
            }
        }

        //--------------------------------------------------
        public void Read()
        {
            int n = int.Parse( Console.ReadLine() );

            for ( int i = 0; i < n; ++i ) {
                string[] strings = Console.ReadLine().Split();

                int b = int.Parse( strings[ 0 ] ) - 1;
                int f = int.Parse( strings[ 1 ] ) - 1;
                int r = int.Parse( strings[ 2 ] ) - 1;
                int v = int.Parse( strings[ 3 ] );

                _buildings[ b ]._floors[ f ]._rooms[ r ] += v;
            }
        }

        //--------------------------------------------------
        public void Print()
        {
            StringBuilder builder = new StringBuilder();

            _buildings[ 0 ].AppendString( ref builder );

            for ( int i = 1; i < _buildings.Length; ++i ) {
                builder.AppendLine( "####################" );
                _buildings[ i ].AppendString( ref builder );
            }

            Console.Write( builder.ToString() );
        }

        //--------------------------------------------------
        private Building[] _buildings = new Building[ 4 ];
    }

    //--------------------------------------------------
    public class Building {
        //--------------------------------------------------
        public Building()
        {
            for ( int i = 0; i < _floors.Length; ++i ) {
                _floors[ i ] = new Floor();
            }
        }

        //--------------------------------------------------
        public void AppendString( ref StringBuilder builder )
        {
            for ( int i = 0; i < _floors.Length; ++i ) {
                _floors[ i ].AppendString( ref builder );
            }
        }

        //--------------------------------------------------
        public Floor[] _floors = new Floor[ 3 ];
    }

    //--------------------------------------------------
    public class Floor {
        //--------------------------------------------------
        public void AppendString( ref StringBuilder builder )
        {
            for ( int i = 0; i < _rooms.Length; ++i ) {
                builder.AppendFormat( " {0}", _rooms[ i ] );
            }

            builder.AppendLine();
        }

        //--------------------------------------------------
        public int[] _rooms = new int[ 10 ];
    }
}

Measured memory_bytes: 9208
/*
for (int i = 0; i < N; ++i){}

// 各桁の和を計算する関数
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート

int num[110] = {0};  // バケット
for (int i = 0; i < N; ++i) {
    num[d[i]]++;  // d[i] が 1 個増える
}

map<string, int> mp; // 連想配列 map<キー型, 値型> オブジェクト名
for (int i = 0; i < N; ++i) {
    auto itr = mp.find(s[i]);        // s[i] が設定されているか？
    if(itr != mp.end() ) {
         mp[s[i]] += 1;
    }
    else {
         mp[s[i]] += 1 ;
    }
}
stack<int> s;	//intをデータとするスタックを用意
s.push(1);		//{} -> {1}
printf("%d\n", s.top());	// 3
s.pop();

queue<int> que;	//intをデータとするキューを用意
que.push(1);		//{} -> {1}
printf("%d\n", que.front());	// 1
que.pop();
*/
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>

using namespace std;

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

// int 
// // 各桁の和を計算する関数
// int findSumOfDigits(int n) {
//   int amari = 0;
//   int keta = 0;
//   while (n > 0) { // n が 0 になるまで
//     amari += n % 2;
//     if (keta%2==0)
//     n /= 10;
//   }
//   return sum;
// }
 
 

int main() {
	// 入力
	ll A, B, C, X;
	cin >> A >> B >> C >> X;
	
 
	// 解法
	ll ans = 0;
	for (ll i = 0; i <= A; ++i){
		for (ll j = 0; j <= B; ++j){
			for (ll k = 0; k <= C; ++k){
				ll tmp = 500*i + 100*j + 50*k;
				if (tmp==X) ans++;
			}
		}
	}
 
	//出力
	cout << ans << endl;
}


Measured memory_bytes: 256
def fact(n):
  v = 1
  for i in range(2, n + 1):
    v = v * i % 1000000007
  return v

n, m = map(int, input().split())
if abs(n - m) > 1:
  print('0')
elif n == m:
  print(2 * fact(n) * fact(m) % 1000000007)
else:
  print(fact(n) * fact(m) % 1000000007)

Measured memory_bytes: 3064
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int n;
    cin >> n;
    int n2 = n*n;
    VI x(n), a(n2), f(n2);
    REP(i,n){
        cin >> x[i];
        x[i]--;
        a[x[i]] = i+1;
        f[x[i]] = 1;
    }

    bool pos = true;

    int s = 0;
    REP(i,n2){
        if (f[i]){
            s += n - a[i];
        }else{
            if (s > 0) s--;
        }
    }
    if (s > 0) pos = false;

    s = 0;
    FORR(i,n2-1,0){
        if (f[i]){
            s += a[i] - 1;
        }else{
            if (s > 0) s--;
        }
    }
    if (s > 0) pos = false;

    if (!pos){
        cout << "No" << endl;
        return 0;
    }

    cout << "Yes" << endl;

    vector<P> vp(n);
    REP(i,n){
        vp[i].first = x[i];
        vp[i].second = i+1;
    }
    sort(vp.begin(), vp.end());
    VI ra;
    REP(i,n){
        REP(t,vp[i].second-1) ra.push_back(vp[i].second);
    }
    REP(i,n){
        REP(t,n-vp[i].second) ra.push_back(vp[i].second);
    }
    int j = 0;
    REP(i,n2){
        if (!f[i]){
            a[i] = ra[j];
            j++;
        }
    }
    REP(i,n2) printf("%d ", a[i]);
    cout << endl;

    return 0;
}

Measured memory_bytes: 4216
n = int(input())
s = input()
r,w = 0,0
for i in range(n):
    if(s[i]=='W'):
        w+=1
    else:
        r+=1
ans = 0
if(w<=r):
    for i in range(n-1, n-w-1, -1):
        if(s[i]!='W'): ans+=1
else:
    for i in range(r):
        if(s[i]!='R'): ans+=1
print(ans)

Measured memory_bytes: 9440
// AOJ 1319 Driving an Icosahedral Rover
// 2018.2.8 bal4u

#include <stdio.h>
#include <string.h>

//#define getchar_unlocked()  getchar()
int in()
{
	int n = 0;
	int c = getchar_unlocked();
	if (c == '-') {
		c = getchar_unlocked();
		do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
		while (c >= '0');
		return -n;
	}
	do n = (n<<3)+(n<<1) + (c & 0xf), c = getchar_unlocked();
	while (c >= '0');
	return n;
}

#define INF  100
#define BASE 100
#define LIM	 200
#define QMAX 910000

typedef struct { unsigned char x, y, k; } Q;
Q q[QMAX+2]; int top, end;

int mv[60][3] = {
{ 5, 13, 15},{14, 16,  3},{17,  4, 12},
{20,  8,  1},{ 6,  2, 18},{ 0, 19,  7},
{ 4, 22, 11},{23,  9,  5},{10,  3, 21},
{12,  7, 24},{ 8, 25, 13},{26, 14,  6},
{ 9, 28,  2},{29,  0, 10},{ 1, 11, 27},
{32, 34,  0},{35,  1, 30},{ 2, 31, 33},
{34, 37,  4},{38,  5, 35},{ 3, 33, 36},
{37, 40,  8},{41,  6, 38},{ 7, 36, 39},
{40, 43,  9},{44, 10, 41},{11, 39, 42},
{43, 32, 14},{30, 12, 44},{13, 42, 31},
{28, 46, 16},{47, 17, 29},{15, 27, 45},
{50, 20, 17},{18, 15, 48},{16, 49, 19},
{53, 23, 20},{21, 18, 51},{19, 52, 22},
{56, 26, 23},{24, 21, 54},{22, 55, 25},
{59, 29, 26},{27, 24, 57},{25, 58, 28},
{58, 50, 32},{48, 30, 59},{31, 57, 49},
{46, 53, 34},{51, 35, 47},{33, 45, 52},
{49, 56, 37},{54, 38, 50},{36, 48, 55},
{52, 59, 40},{57, 41, 53},{39, 51, 58},
{55, 47, 43},{45, 44, 56},{42, 54, 46}};

char d[LIM+1][LIM+1][60];
int dx[2][3] = {{-1,1,0},{-1,1, 0}};
int dy[2][3] = {{ 0,0,1},{ 0,0,-1}};
int dk[2][3] = {{ 1,0,2},{ 0,1, 2}};

int main()
{
	int x, y, k, i, f, nx, ny, nk, ans;

	memset(d, INF, sizeof(d));
	d[BASE][BASE][0] = 0;
	q[0].x = BASE, q[0].y = BASE, q[0].k = 0, top = 0, end = 1;
	while (top != end) {
		x = q[top].x, y = q[top].y, k = q[top++].k;

		f = (x+y) & 1;
		for (i = 0; i < 3; i++) {
			nx = x + dx[f][i], ny = y + dy[f][i], nk = mv[k][dk[f][i]];
			if (nx >= 0 && nx <= LIM && ny >= 0 && ny <= LIM && d[x][y][k]+1 < d[nx][ny][nk]) {
				d[nx][ny][nk] = d[x][y][k]+1;
				q[end].x = nx, q[end].y = ny, q[end++].k = nk;
			}
		}
	}

	while (1) {
		x = in(), y = in(), k = in();
		if ((x|y|k) == 0) break;
		x += BASE, y += BASE, k *= 3;
		ans = INF;
		for (i = 0; i < 3; i++) if (ans > d[x][y][k+i]) ans = d[x][y][k+i];
		printf("%d\n", ans);
	}
	return 0;
}



Measured memory_bytes: 6624
s=input()
ans=0
count=0
for i in range(len(s)):
    if s[i]=='A' or s[i]=='C' or s[i]=='G' or s[i]=='T':
        count+=1
    else:
        if count>ans:
            ans=count
            count=0
else:
    if count>ans:
        ans=count
print(ans)


Measured memory_bytes: 3064
n = int(input())
X = list(map(int,input().split()))
Y = list(map(int,input().split()))
for p in range(1,4):
    print("{0:.6f}".format(sum([abs(a-b)**p for a,b in zip(X,Y)])**(1/p)))
print("{0:.6f}".format(max([abs(a-b) for a,b in zip(X,Y)])))


Measured memory_bytes: 5652
#include <bits/stdc++.h>
using namespace std;
#define rep(i, s, n) for (int i = (s); i < (n); ++i)
#define rem(i, s, n) for (int i = (s); i >= (n); --i)
using ll = long long;
const int MAX = 1e9+7;

int main(){
    ll n, m, k;
    cin >> n >> m >> k;
    vector<ll> a(n), b(m);
    rep(i, 0, n) cin >> a[i];
    rep(i, 0, m) cin >> b[i];

    //累積和
    vector<ll> accum_a(n+1), accum_b(m+1);
    accum_a[0] = 0; accum_b[0] = 0;
    rep(i, 0, n) accum_a[i+1] = accum_a[i] + a[i];
    rep(i, 0, m) accum_b[i+1] = accum_b[i] + b[i];

    // 机aの本をi冊読んだとき机bの本はv[i]冊読める
    vector<ll> v(n + 1);
    int i = 0;
    while(i <= n && k - accum_a[i] >= 0){
      int l = -1, r = m + 1;
      ll t = k - accum_a[i];
      while(r - l > 1){
        int j = (l + r) / 2;
        if(accum_b[j] <= t) l = j;
        if(accum_b[j] > t) r = j;
      }
      v[i++] = l;
    }
    int v_siz = i;
    ll ans = 0;
    rep(i, 0, v_siz){
      ans =  max(ans, i + v[i]);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 10988
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

int main() {
	int N;
	vector<ll> X, X2;
	ll mid;
	cin >> N;
	for (int i = 0; i < N; i++) {
		ll Xi;
		cin >> Xi;
		X.push_back(Xi);
	}
	X2 = X;
	sort(X.begin(), X.end());
	bool switchX = true;
	for (int i = 0; i < N; i++) {
		if (X2[i] < X[N / 2]) {
			mid = X[N / 2];
		}
		else {
			mid = X[N / 2 - 1];
		}
		cout << mid << endl;
	}

	return 0;
}

Measured memory_bytes: 5488
#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return 1;
    }
    return 0;
}
typedef long long int ll;

#define EPS (1e-7)
#define INF (1 << 30)
#define LLINF (1LL << 60)
#define PI (acos(-1))
#define MOD (1000000007)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<ll> a(3 * n);
    for (int i = 0; i < 3 * n; i++)
    {
        cin >> a[i];
    }
    // 左からを考える
    vector<ll> left(2 * n + 1, 0); //累積和
    priority_queue<ll, vector<ll>, greater<ll>> queL;
    for (int i = 0; i < n; i++)
    {
        left[i + 1] = left[i] + a[i];
        queL.push(a[i]);
    }
    for (int i = n; i < 2 * n; i++)
    {
        ll tp = queL.top();
        if (a[i] > tp)
        {
            left[i + 1] = left[i] - tp + a[i];
            queL.pop();
            queL.push(a[i]);
        }
        else
        {
            left[i + 1] = left[i];
        }
    }
    // 右からを考える
    vector<ll> right(2 * n + 1, 0);
    priority_queue<ll> queR;
    for (int i = 0; i < n; i++)
    {
        right[i + 1] = right[i] + a[3 * n - i - 1];
        queR.push(a[3 * n - i - 1]);
    }
    for (int i = n; i < 2 * n; i++)
    {
        ll tp = queR.top();
        if (tp > a[3 * n - i - 1])
        {
            right[i + 1] = right[i] - tp + a[3 * n - i - 1];
            queR.pop();
            queR.push(a[3 * n - i - 1]);
        }
        else
        {
            right[i + 1] = right[i];
        }
    }
    ll ans = -LLINF;
    for (int i = n; i <= 2 * n; i++)
    {
        chmax(ans, left[i] - right[3 * n - i]);
    }
    cout << ans << endl;
}

Measured memory_bytes: 8052
#include<bits/stdc++.h>
using namespace std;
int n,m,a[105];
double c,s;
int main()
{
    cin>>n>>m;
    for(register int i=1;i<=n;i++)
        cin>>a[i],s+=a[i];
    for(register int i=1;i<=n;i++)c+=(a[i]>=(s/(4*m)));
    if(c>=m)
        cout<<"Yes\n";
    else
        cout<<"No\n";
    return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
int main()
{
    int N;
    std::cin >> N;

    std::vector<std::pair<std::pair<std::string, int>, int>> r;
    std::string s;
    int p;
    for (int i = 0; i < N; i++) {
        std::cin >> s;
        std::cin >> p;
        r.push_back(std::make_pair(std::make_pair(s, -p), i+1));
    }

    std::sort(std::begin(r), std::end(r));

    for (int i = 0; i < N; i++) {
        std::cout << r[i].second << std::endl;
    }

    return 0;
}

Measured memory_bytes: 256
n,k=map(int,input().split())
p=[int(i) for i in input().split()]
ans=chk=0
w=[0]*(n+1)
for i in range(n):
    w[i+1]=w[i]+p[i]
for i in range(k,n+1):
    chk=max(chk,w[i]-w[i-k])
print((chk+k)/2)


Measured memory_bytes: 71792
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
#define inf 10000000000000
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)
#define f first
#define ss second
#define pb push_back
//#define mp make_pair

ll n, a[202002];

int main(){

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

cin >> n;
rep(i,1, n){
cin >> a[i];
}

sort(a+1, a+n+1);
ll k = a[n];
ll t = (a[n]+1)/2;

//auto m = lower_bound(a+1, a+n+1, t)-(a+1);

ll mni = (n+1)/2, mn = inf;

rep(i, 1, n-1){
if(abs(t-a[i])<mn){
    mn= abs(t-a[i]);
    mni = i;
}
}

cout << k << " " << a[mni] << endl;

}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <istream>
#define rep0(i,n) for (int i = 0; i <= (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define vec vector<int>a(n)
#define soot(a) sort(a.begin(),a.end())
/*int n;
cin >> n;
vector<int>a(n);
rep0(i, n - 1)cin >> a[i];*/
using namespace std;
int main() {
	int n;
	cin >> n;
	cout << n*n*n<< endl;
	return 0;
}


Measured memory_bytes: 3104
#include <bits/stdc++.h>
#define FOR(i,a,b) for(ut i=(a);i<(ut)(b);i++)
#define REP(i,b) FOR(i,0,b)
#define ALL(c) c.begin(),c.end()
#define PB push_back
#define cat //cout << __LINE__ << endl;
using namespace std;
typedef long long LL;
typedef double ld;
typedef int ut;
typedef complex<int> cli;
typedef vector<ut> VI;
typedef pair<ut,ut> pr;
typedef pair<ut,pr> ppr;
typedef vector<pr> Vpr;
typedef vector<ppr> Vppr;
typedef priority_queue<pr,Vpr> PQ;
const int SIZE=5+1e5;
const LL INF=1<<30;
int T[SIZE];
int A[SIZE];
int absol[SIZE];
int maxim[SIZE];
LL solve(){
	int N;
	cin.tie(0);
	cin >> N;
	REP(i,N+1) maxim[i]=INF;
	FOR(i,1,N+1){
		cin >> T[i];
		if(T[i]!=T[i-1]) absol[i]=true;
		maxim[i]=min(maxim[i],T[i]);
	}
	FOR(i,1,N+1){
		cin >> A[i];
	}	

	FOR(i,1,N+1){
		if(A[i]<T[i] && absol[i]) return 0; 
		if(A[i]!=A[i+1]) {
			if(absol[i] && A[i]!=T[i])	return 0;
			if(A[i]>T[i]) return 0;
			absol[i]=true;
		}
		maxim[i]=min(maxim[i],A[i]);
		
	}
	LL p=1e9+7;
	LL ans=1;
	FOR(i,1,N+1){
		if(!absol[i]){
			ans*=maxim[i];
			ans%=p;
		}
	}
	return ans;
}
int main(){

	cout << solve() << endl;
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
using namespace std;
int s[100100];
int binarysearch(int a[], int n,int key){
	int left = 0;
	int right = n;
	while (left < right) {
		int mid = (left + right) / 2;
		if (a[mid] == key)
			return 1;
		else if (key < a[mid])
			right = mid;
		else
			left = mid + 1;
	}
	return 0;
}

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

Measured memory_bytes: 3468
#include <stdio.h>
#include <math.h>

int	main(void)
{
	long long int N, K;
	scanf("%lld %lld", &N, &K);
	long long int index =0;
	while(N!=0)
	{
		N = N/K;
		index++;
	}
	printf("%lld\n", index);
	return (0);
}


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

int main(){
  int n,m;
  cin >> n >> m;
  int c[200001]={},d[200001]={};
  for(int i=0;i<m;i++){
    int a,b;
    cin >> a >> b;
    if(a==1) c[b]=1;
    if(b==n) d[a]=1; 
  }
  for(int i=0;i<200001;i++){
    if(c[i]&&d[i]) {
      cout << "POSSIBLE" << endl;
      return 0;
    }   
  }
 cout << "IMPOSSIBLE" << endl;
}


Measured memory_bytes: 1792
n = int(input())
C = list(input())

a, b = 0, 0
for i in range(n):
    if C[i] == "R":
        a += 1
    ans = max(a, b)

for i in range(n):
    if C[i] == "R":
        a -= 1
    else:
        b += 1
    tmp = max(a, b)
    ans = min(ans, tmp)

print(ans)

Measured memory_bytes: 10764
#include<bits/stdc++.h>
// Useful constants
#define INF  (int)1e9
#define EPS   1e-9
#define MOD 1000000007ll
#define PI 3.14159
// for input-output
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
// iteration macros: have advantage of auto-casting and not recomputing arguments
#define REP(i, a, b) \
for (int i = int(a); i <= int(b); i++) // a to b, and variable i is local!
#define TRvi(c, it) \
for (vi::iterator it = (c).begin(); it != (c).end(); it++)
#define TRvii(c, it) \
for (vii::iterator it = (c).begin(); it != (c).end(); it++)
#define TRmsi(c, it) \
for (msi::iterator it = (c).begin(); it != (c).end(); it++)
#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 setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
// input macro
#define in(x,n)   for(int e=0;e<n;e++){ll y;cin>>y;x.pb(y);}
//output macro
#define print(x)    for(auto it:x) cout<<it<<' '; cout<<endl;
#define printii(x)  for(auto it:x) cout<<it.F<<' '<<it.S<<'\t';  cout<<endl;
// shortcut for data type
#define ll long long
#define vi vector<ll>
#define vvi vector<vi>
#define ii pair<ll,ll>
#define pll pair<ll,ll>
#define vii vector<ii>
#define vvii vector<vii>
#define viii vector<pair<ii,ll>>
#define pb push_back
#define ppb pop_back
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
#define uset unordered_set
#define umap unordered_map
//--namespace
using namespace std;
//--useful function
ll gcd(ll a, ll b){ll temp;while (b > 0){temp = a%b;a = b;b = temp;} return a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
ll fpow(ll  b, ll exp, ll mod){if(exp == 0) return 1;ll t = fpow(b,exp/2,mod);if(exp&1) return t*t%mod*b%mod;return t*t%mod;}
ll divmod(ll i, ll j, ll mod){i%=mod,j%=mod;return i*fpow(j,mod-2,mod)%mod;}
// --clock funtion
clock_t time_p=clock();
void TimeTaken()
{
    time_p=clock()-time_p;
    cerr<<"Completion time : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
// --solve function
void solve() {

}
void swap(int *xp, int *yp)  
{  
    int temp = *xp;  
    *xp = *yp;  
    *yp = temp;  
}  

void bubbleSort(int arr[], int n)  
{  
    int i, j;  
    for (i = 0; i < n-1; i++)      
      
    // Last i elements are already in place  
    for (j = 0; j < n-i-1; j++)  
        if( ( (arr[j]%10) < (arr[j+1]%10) ) || arr[j+1]%10==0)
            swap(&arr[j], &arr[j+1]);  
}

//--main function
int main(){
	int a[5];
	REP(i,0,4)cin>>a[i];
	bubbleSort(a,5);
	int s=0;
	REP(i,0,4){
		s=s+a[i];
		if(s%10!=0 && i!=4){
			s=((s/10)+1)*10;
		}
	}
	cout<<s;

//   TimeTaken();
}


Measured memory_bytes: 256
#include <iostream>

int main() {
    int x;
    std::cin >> x;
    if (x == 1) {
        std::cout << "Hello World" << std::endl;
    } else if (x == 2) {
        int A, B;
        std::cin >> A >> B;
        std::cout << A + B << std::endl;
    }
    return 0;
}


Measured memory_bytes: 504
n, k = list(map(int, input().split()))
bl = [1 for _ in range(n)]
d = []
a = []
for _ in range(k):
    d.append(int(input()))
    ai = list(map(int, input().split()))
    for i in ai:
        if bl[i - 1]:
            bl[i - 1] = 0
print(sum(bl))


Measured memory_bytes: 9072
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		ArrayList<Integer> valList = new ArrayList<>();

		// 標準入力（アンテナの座標）を取得する。
		for (int i = 0; i < 5; i++) {
			valList.add(scanner.nextInt());
		}
		//通信可能距離を取得する。
		int k = scanner.nextInt();

		scanner.close();

		boolean canCommuFlg = true;

		//拠点間の通信が可能かチェックする
		for (int i = 1; i < valList.size(); i++) {
			if(canCommuFlg == false) break;
			for (int j = 0; j < i; j++) {
				if (valList.get(i) - valList.get(j) > k) {
					canCommuFlg = false;
					break;
				}
			}
		}

		if (canCommuFlg == true) {
			System.out.println("Yay!");
		} else {
			System.out.println(":(");
		}
	}

}


Measured memory_bytes: 21716
#include <iostream>

using namespace std;

long long n, m, z;

int main()
{
    cin >> n >> m;
    if((n * m * 1) % 2 == 1 || (n * m * 2) % 2 == 1 || (n * m * 3) % 2 == 1){
        cout << "Yes" << endl;
    }
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
		int a, b;
		scanf("%d %d", &a, &b);

		if ( (a % 2 != 0) && (b % 2 !=0) )
				printf("Odd\n");
		else
				printf("Even\n");

		return 0;
}


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

main() {
	int n;
	cin>>n;
	vector<int>f;
	f.pb(n);
	for(int i=2; i*i<=n; i++){
		if(n%i==0 && i*i!=n){
			f.pb(i);
			f.pb(n/i);
			continue;
		}
		if(i*i==n){
			f.pb(i);
		}
	}
	int val=n-1;
	vector<int>f2;
	f2.pb(val);
	for(int i=2; i*i<=val; i++){
		if(val%i==0 && i*i!=val){
			f2.pb(i);
			f2.pb(val/i);
			continue;
		}
		if(i*i==val){
			f2.pb(i);
		}
	}
	vector<int>fin;
	for(auto u:f){
		int num=n;
		while(num%u==0){
			num=num/u;
		}
		num=num%u;
		if(num==1){
			fin.pb(u);
		}
	}
	for(auto u:f2){
		if(n%u!=0){
			fin.pb(u);
		}
	}
	cout<<fin.size();
	return 0;
}

Measured memory_bytes: 3636
import java.util.Scanner;

public class Main {
	
	Scanner sc;
	
	class Point{
		public double x,y;
		
		public String toString(){
			return "("+x+","+y+")";
		}
		
		public Point(double x,double y){
			this.x=x;
			this.y=y;
		}
	}
	
	double getTheta(Point p,Point p0){
		double theta=Math.acos((p.x-p0.x)/Math.hypot(p.x-p0.x,p.y-p0.y));
		if(p.y<p0.y)theta=Math.PI*2-theta;
		return theta;
	}
	
	int solve(Point[] points){
		Point start=points[0];
		for(Point v:points){
			if(v.y<start.y)start=v;
		}
		Point p0=start;
		int n=0;
		double prev=0;
		do{
			double min=Math.PI*3;
			Point next=p0;
			for(Point p: points){
				double theta=getTheta(p,p0);
				if(theta>=prev&&theta<min){
					min=theta;
					next=p;
				}
			}
			p0=next;
			prev=min;
			++n;
		}while(p0!=start);
		return points.length-n;
	}
	
	double nd(){
		return sc.nextDouble();
	}
	
	int ni(){
		return sc.nextInt();
	}
	
	void io(){
		sc=new Scanner(System.in).useDelimiter(",|\r\n|\n");
		
		int n;
		Point[] points;
		while((n=ni())!=0){
			points=new Point[n];
			for(int i=0;i<n;++i){
				points[i]=new Point(nd(),nd());
			}
			System.out.println(solve(points));
		}
		sc.close();
	}
	
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new Main().io();
	}
}

Measured memory_bytes: 21068
import java.util.Arrays;
import java.util.Scanner;

 class Main{
 
    public static void main(String[] args) {
        // TODO code application logic here
        Scanner scan = new Scanner(System.in) ;
        int n = scan.nextInt();
        int arr[] = new int[n];
        for(int i = 0 ; i <n ;i++){
            arr[i]=scan.nextInt();
        }
        Arrays.sort(arr);
        int x = arr[n/2] - arr[n/2 -1] ;
        System.out.println(x);
    }
    
}


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

void c1() {
	string s;
	cin >> s;
	auto c = s.find_first_of('C');
	auto f = s.find_last_of('F');
	if (c != string::npos && f != string::npos && c < f)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	c1();
	
	return 0;
}


Measured memory_bytes: 256