akhauriyash/Code-Regression huggingface dataset:
/// kazuki08
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef long long ll;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
//#define inf 1000000000
#define mod 1000000007
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
    return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
    o<<"{";
    for(const T& v:vc) o<<v<<",";
    o<<"}";
    return o;
}
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());



signed main(){
IOS;
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);

  int n,k;
  cin >> n >> k;
  int a[n+1];
  for(int i=1;i<=n;i++){
    cin >> a[i];
  }
  sort(a+1,a+n+1);
  int ans = 0;
  for(int i=n;i>=1;i--){
    if(k)k--;
    else {
      ans+=a[i];
    }
  }
  cout << ans << endl;


return 0;
}
///....


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

int main() {
  int N;
  cin>>N;
  int x;
  x=0;
  for(int i=0;i<N;i++){
    int a,b;
  cin>>a>>b;
  x+=b-a+1;
  }
  cout<<x<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
using ll = long long;
constexpr ll mod = 1000000007;
int main() {
  ll N, K, res{0};
  std::cin >> N >> K;
  ll left{0}, right{0};
  for (int i = 1; i <= N + 1; i++) {
    left += i - 1;
    right += N - (i - 1);
    if (i >= K) res += (right - left + 1) % mod;
  }
  std::cout << res % mod << std::endl;
  return 0;
}

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

int main() {
  int d[3];
  cin >> d[0] >> d[1] >> d[2];
  sort(d, d+3);
  int t = d[1] - d[0];
  cout << d[2]-d[1]+t/2+(t%2)*2 << endl;
  return 0;
}


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

int main()
{
	bool palindrome=true;
	string line;
	cin>>line;
	string front,all,last;
	all=line;
	int mid=line.size()/2 + 1;
	front=line.substr(0,mid-1);
	last=line.substr(mid,line.size());
	for(int i =0 ; i < all.size()/2;i++)
	{
		if(all[i]!=all[all.size()-i-1])
		{
			palindrome=false;
		}
	}
	
	for(int i =0 ; i < front.size()/2;i++)
	{
		if(front[i]!=front[front.size()-i-1])
		{
			palindrome=false;
		}
	}
	
	for(int i =0 ; i < last.size()/2;i++)
	{
		if(last[i]!=last[last.size()-i-1])
		{
			palindrome=false;
		}
	}
	if(palindrome)cout<<"Yes";
	else cout<<"No";
	//last=line[(line.size()-1)/2];
} 





Measured memory_bytes: 256
#include<stdio.h>

long int abs_(long int x){
	if(x < 0){
		x = -x;
	}
	return x;
}

int main(){
	long int N, K;
	scanf("%ld %ld", &N, &K);
	//printf("%d\n", abs_(K));
	if(N%K == 0){
		printf("%d\n", 0);
	}else{
		N = N%K;
		while(abs_(N-K)%K < N%K) N = abs_(N-K)%K; 
		printf("%ld\n", N);
	}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, int> pli;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

int main(){
        int n;
        while(scanf("%d", &n) && n){
                string s;
                int l=0, r=0, t=0, ans=0;
                rep(i, n){
                        cin>>s;
                        if(s[0]=='l') l^=1;
                        else r^=1;
                        if(!t && l && r) ++ans, t^=1;
                        else if(t && !l && !r) ++ans, t^=1;
                }
                printf("%d\n", ans);
        }
}


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

int main(){


  ll a,b,c,k;
  cin>>a>>b>>c>>k;
  
  if(k<=a){cout<<k<<endl;return 0;}

  k-=a;
  if(k<=b){cout<<a<<endl;return 0;}
  k-=b;
  cout<<a-min(c,k)<<endl;
  
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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 (b<a) { a = b; return 1; } return 0; }
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
void _main()
{
//    for (ll N = 1; N <= 1000000000000; ++N)
    {
//        cout << "attempt: " << N << endl;
    ll N;
    cin >> N;
    ll ans = 0;
    for (ll x = 1; x * x <= N; ++x)
    {
        if (N % x == 0)
        {
            const ll y = N / x;
            const ll z = y - 1;
            if (z <= 0)
            {
//                cout << x << endl;
                break;
            }
            if (N / z >= y)
            {
//                cout << x << endl;
                break;
            }

            ans += z;
        }
    }
    cout << ans << endl;
    }
}


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

def main():
	N=int(input())
	vA=list(map(int, input().split()))

	p = 0
	res = 0
	for a in vA:
		if p+1 == a:
			p += 1
		else:
			res += 1

	print(res if p else -1)

main()


Measured memory_bytes: 20384
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <utility>
using namespace std;

vector<pair<int, int>> bridge(const vector<vector<int>> &G) {
  const int N = G.size();
  vector<bool> vis(N, false);
  vector<int> parent(N);
  vector<int> indeg(N, 0);
  vector<int> imos(N, 0);
  stack<int> S;
  S.push(0);
  parent[0] = -1;
  while(!S.empty()) {
    int v = S.top(); S.pop();
    if(vis[v]) continue;
    vis[v] = true;
    for(int u : G[v]) {
      if(u == parent[v]) continue;
      if(vis[u]) {
        imos[v]++;
        imos[u]--;
        indeg[u]--;
      }
      else {
        parent[u] = v;
        indeg[v]++;
        S.push(u);
      }
    }
  }
  queue<int> Q;
  for(int i = 0; i < N; ++i) {
    if(indeg[i] == 0) Q.push(i);
  }
  vector<pair<int, int>> ret;
  while(!Q.empty()) {
    int v = Q.front(); Q.pop();
    if(parent[v] == -1) break;
    int u = parent[v];
    if(imos[v] == 0) ret.emplace_back(v, u);
    imos[u] += imos[v];
    indeg[u]--;
    if(indeg[u] == 0) Q.push(u);
  }
  return ret;
}

int main() {
  ios::sync_with_stdio(false);
  int V, E; cin >> V >> E;
  vector<vector<int>> G(V);
  for(int i = 0; i < E; ++i) {
    int s, t; cin >> s >> t;
    G[s].push_back(t);
    G[t].push_back(s);
  }
  auto &&ret = bridge(G);
  for(auto &&item : ret) {
    if(item.first > item.second) swap(item.first, item.second);
  }
  sort(ret.begin(), ret.end());
  for(auto &&item : ret) {
    cout << item.first << ' ' << item.second << endl;
  }
}

Measured memory_bytes: 2496
import java.io.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try{
            BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
            
            int N = Integer.parseInt(br.readLine());
            int si[] = new int[4];
            
            for(int i=0; i<N; i++){
                String str = br.readLine();
                
                if(str.equals("AC")){
                    si[0]++;
                }else if(str.equals("WA")){
                    si[1]++;
                }else if(str.equals("TLE")){
                    si[2]++;
                }else if(str.equals("RE")){
                    si[3]++;
                }
            }
            
            System.out.println("AC x " + si[0]);
            System.out.println("WA x " + si[1]);
            System.out.println("TLE x " + si[2]);
            System.out.println("RE x " + si[3]);
            
        }catch(Exception e){
            System.out.println(e);
        }
    }
}

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

#define int long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define dbg(x) cerr << #x << ": " << x << endl;
#define dbg2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define dbg3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define dbgB(value, size) cerr<<#value<<": "<<bitset<size>(value) << endl;
#define line() cerr << "---------------" << endl;

const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
const double PI = 3.14159265358979323846;

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 (b<a) { a = b; return 1; } return 0; }

template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
  int paSize = printArray.size();
  for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
  if (between != '\n') {cerr << endl;}
}

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

signed main() {
  int N;
  cin >> N;
  int cnt = 0;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (a % 2 == 0) {
      cnt++;
    }
  }

  puts(cnt == N ? "second" : "first");

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SORT(x) sort((x).begin(),(x).end())
#define ALL(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
template<class T>bool maxi(T &a,const T &b){if(a<b){ a=b; return 1;} return 0;}
template<class T>bool mini(T &a,const T &b){if(b<a){ a=b; return 1;} return 0;}
#define y0 y3487465 //j0
#define y1 y1347829 //j1
#define INF2 4000000000000000037
#define INF 1000000007
#define PI (acos(-1))
#define MOD 1000000007
using namespace std;
typedef long long ll;

void Main(){


  int n; cin>>n;
  vector<int> x;
  vector<int> y;
  rep(i,n){
    int xx; cin>>xx;
    x.emplace_back(xx);
    y.emplace_back(xx);
  }

  SORT(y);

  int mi=y[n/2-1];
  int ma=y[n/2];

  rep(i,n){
    if(x[i]<=mi) cout<< ma<<"\n";
    else cout<< mi<<"\n";
  }
}

//-----------------------------------
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}
//-----------------------------------


Measured memory_bytes: 3948
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        int n = int.Parse(Console.ReadLine());
        var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        long current = 1000;
        for (int i = 1; i < n; i++)
        {
            if (a[i - 1] > a[i]) continue;
            current = (current / a[i - 1]) * a[i] + current % a[i - 1];
        }
        Console.WriteLine(current);
    }
}


Measured memory_bytes: 28304
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <sstream>
#include <cstring>
#include <queue>
#include <map>
using namespace std;

long long C[55][55];
int calc() {
  memset(C, 0, sizeof(C));
  C[0][0] = 1;
  for (int i = 1; i <= 50; ++i) {
	C[i][0] = C[i][i] = 1;
	for (int j = 1; j <= 50; ++j) {
	  C[i][j] = C[i-1][j-1] + C[i-1][j];
	  //cout << i << ", " << j << ": " << C[i][j] << endl;
	}
  }
}

int N, A, B;
long long v[55];

int main() {
  calc();
  while (cin >> N >> A >> B) {
	for (int i = 0; i < N; ++i) cin >> v[i];
	sort(v, v+N, greater<long long>());
	long long sum = 0;
	for (int i = 0; i < A; ++i) sum += v[i];
	double ave = double(sum) / A;

	int num = 0, rem = 0;
	for (int i = 0; i < N; ++i) {
	  if (v[i] == v[A-1]) ++num;
	  if (i < A && v[i] != v[A-1]) ++rem;
	}
	//cout << num << ", " << rem << endl;

	if (rem == 0) {
	  long long res = 0;
	  for (int k = A; k <= B; ++k) {
		res += C[num][k];
	  }
	  cout << fixed << setprecision(10) << ave << endl;
	  cout << res << endl;
	}
	else {
	  long long res = C[num][A-rem];  
	  cout << fixed << setprecision(10) << ave << endl;
	  cout << res << endl;
	}
  }
}


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

#define PI 3.14159265358979323846264338327950L

int res = 0;

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

    int N,M,X;
    cin >> N >> M >> X;
    int A[110];
    for(int i = 0; i < M; i++ )
    {
        cin >> A[i];
    }
    int cost = 0;
    int pos = X;
    while (pos >= 0)
    {
        for(int i = 0; i < M; i++ )
        {
            if (A[i]==pos){
                cost++;
            }
        }
        pos--;
        //cout << pos << endl;
    }
    pos = X;
    while (pos <= N)
    {
        for(int i = 0; i < M; i++ )
        {
            if(A[i]==pos){
                res++;
            }
        }
        pos++;
    }
    if(cost<res){
        res = cost;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>

using namespace std ;
int main () {
  int N,A,B;
  cin >> N;
  if(N==2) {
    cin >> A;
    cin >> B;
  }

  if(N==1) cout << "Hello World" << endl;
  else cout << A+B << endl;
  return(0);
}

Measured memory_bytes: 256
n, m = map(int, input().split())
INF = 10**9
import sys
sys.setrecursionlimit(6000)
G = [[] for _ in range(n*m+2)]

def add_edge(s, t, cap):
    G[s].append([t, cap, len(G[t])])
    G[t].append([s, 0, len(G[s])-1])

def get_edges(s):
    pass

def dfs(v, t, f, used):
    """ 増加パスをDFSで探す、再帰バージョン
    Args:
        v (int): 探索の開始地点
        t (int): 探索の終了地点
        f (int): 流す量
        used (list): 訪れた点の記録
    Returns:
        int: 流すことのできた量
    """
    if v == t:
        return f
    used[v] = 1
    for idx, (nn, cap, rev) in enumerate(G[v]):
        if used[nn] == 0 and cap > 0:
            d = dfs(nn, t, min(f, cap), used)
            if d > 0:
                G[v][idx][1] -= d
                G[nn][rev][1] += d
                return d
    else:
        return 0

def flow(s, t):
    ans = 0
    while True:
        used = [0] * (n*m+2)
        f = dfs(s, t, INF, used)
        if f == 0:
            return ans
        ans += f


S = [list(input()) for _ in range(n)]

# n*mを始点, n*m+1を終点とする
for i, line in enumerate(S):
    for j, s in enumerate(line):
        cp = i*m+j
        if (i%2 == 0 and j%2 == 0) or (i%2 == 1 and j%2 == 1):
            if s == '.':
                add_edge(n*m, cp, 1)
                for mi, mj in [(-1, 0), (1, 0), (0, 1), (0, -1)]:
                    ni, nj = i+mi, j+mj
                    if 0 <= ni < n and 0 <= nj < m and S[ni][nj] == '.':
                        ep = ni*m+nj
                        add_edge(cp, ep, 1)
        else:
            if s == '.':
                add_edge(cp, n*m+1, 1)

f = flow(n*m, n*m+1)
print(f)

for a, cap, rev in G[n*m]:
    if cap == 0:
        for b, cap, rev in G[a]:
            if cap == 0:
                # a to b
                i, j = divmod(a, m)
                ii, jj = divmod(b, m)
                np = ii - i, jj - j
                if np == (1, 0):
                    S[i][j] = 'v'
                    S[ii][jj] = '^'
                elif np == (-1, 0):
                    S[i][j] = '^'
                    S[ii][jj] = 'v'
                elif np == (0, 1):
                    S[i][j] = '>'
                    S[ii][jj] = '<'
                elif np == (0, -1):
                    S[i][j] = '<'
                    S[ii][jj] = '>'
                break

for line in S:
    print(''.join(line))


Measured memory_bytes: 117808
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val inputs = readLine()!!.split(" ").map { it.toInt() }

    var cnt = 0
    for ( i in 0 until n) {
        if(inputs[i] != i+1) {
            cnt += 1
        }
    }

    if(cnt==0 || cnt == 2){
        println("YES")
    } else {
        println("NO")
    }
}

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

int main() {
	int n,k,i,t,ans=0;
	cin >> n >> k;
	multiset<int> l;
	for(i=0; i<n; i++){
		cin >> t;
		l.insert(t);
	}
	auto itr=l.end();
	for(i=0; i<k; i++){
		itr--;
		ans+=*itr;
	}
	cout << ans;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<bits/stdc++.h>
#define lli long long int
#define mod 1000000007
//#include<math.h>
#define pb push_back
#define mk make_pair
#define fastio ios_base::sync_with_stdio(false); cout.tie(NULL);
using namespace std;

int main()
{
	fastio;
	lli n;
	cin>>n;
	cout<<2*3.14159265358979323846*n;
	return 0;
}


Measured memory_bytes: 3804
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define REP(i, d, n) for(int i=(d); i<(n); ++i)
#define all(v) v.begin(), v.end()
using ll = long long;
using P = pair<int, int>;

ll mypow(ll x, int n){
    ll ret = 1;
    while(n > 0){
        if(n & 1){
            ret *= x;
        }
        x *= x;
        n >>= 1;
    }
    return ret;
}

int main() {

    int n, p;
    cin >> n >> p;
    vector<int> a(n);
    int cnt_odd = 0;
    rep(i, n){
        cin >> a[i];
        if(a[i] % 2 == 0){
            cnt_odd++;
        }
    }

    if(cnt_odd == n){
        if(p == 0){
            cout << mypow(2LL, n) << endl;
        }
        else{
            cout << 0 << endl;
        }
    }
    else{
        cout << mypow(2LL, n-1) << endl;
    }

    return 0;
}

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

struct UnionFind {
  vector<ll> par, siz;

  UnionFind(ll n):par(n),siz(n,1) {
    for (ll i = 0; i < n; ++i) par[i] = i; //すべて根として初期化
  }

  ll root(ll x) {
    if (par[x] == x) return x;
    else return par[x] = root(par[x]);
  }

  void merge(ll x, ll y) {
    ll rx = root(x);
    ll ry = root(y);
    if (rx == ry) return;
    if (siz[rx] < siz[y]) swap(rx, ry);
    par[rx] = ry;
    siz[ry] += siz[rx];
  }

  bool isSame(ll x, ll y) {
    return root(x) == root(y);
  }

  ll size(ll x) {
    return siz[root(x)];
  }
};

int main() {
  int n, m, k;
  cin >> n >> m >> k;
  UnionFind Ftree(n);
  vector< vector<int> > Fr(n), Bl(n);
  rep(i,m) {
    int a, b;
    cin >> a >> b;
    a--; b--;
    Ftree.merge(a, b);
    Fr[a].push_back(b);
    Fr[b].push_back(a);
  }
  rep(i,k) {
    int c, d;
    cin >> c >> d;
    c--; d--;
    if (!Ftree.isSame(c, d)) continue;
    Bl[c].push_back(d);
    Bl[d].push_back(c);
  }
  rep(i, n) {
    int ans = Ftree.size(i) - Fr[i].size() - Bl[i].size() - 1;
    ans = max(ans, 0);
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 13816
#include <iostream>
#include <algorithm>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <string.h>
#include <vector>
#include <queue>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <numeric>
#include <iomanip>

// output
#define SPBR(w, n) std::cout<<(w + 1 == n ? '\n' : ' ');
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
// utility
#define ALL(i) (i).begin(), (i).end()
#define FOR(i, a, n) for(int i=(a);i<(n);++i)
#define RFOR(i, a, n) for(int i=(n)-1;i>=(a);--i)
#define REP(i, n) for(int i=0;i<int(n);++i)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define IN(a, x, b) (a<=x && x<b)
#define OUT(a, x, b) (x<a || b<=x)
template<class T> inline T chmax(T & a, const T b) { return a = (a < b) ? b : a; }
template<class T> inline T chmin(T& a, const T b) { return a = (a > b) ? b : a; }

// type/const
#define int ll
using ll = long long;
using ull = unsigned long long;
using ld = long double;
const int MOD = 1000000007;
/* const int MOD = 998244353; */
const int INF = 1e18;
const double PI = acos(-1);

using namespace std;
struct INIT { 
  INIT(){cin.tie(0); ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);
}}INIT;


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

  if(s.size() > t.size()) cout << "GREATER" << "\n";
  else if(s.size() < t.size()) cout << "LESS" << "\n";
  else{
    if(s > t) cout << "GREATER" << "\n";
    else if(s == t) cout << "EQUAL" << "\n";
    else cout << "LESS" << "\n";
  }

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <utility>
#include <iomanip>
using namespace std;
typedef long long ll;

const ll MOD = 1e9+7;


int main()
{
	ll n;
	string ans;
	int keta=0;
	cin>>n;
	ll now=n;
	if(now&1)
	{
		ans+='1';
		now--;
	}else{
		ans+='0';
	}
	keta++;
	while(now!=0)
	{
		//cerr<<now<<endl;
		ll r=now%(1LL<<(keta+1));
		if(r<0)
			r+=1LL<<(keta+1);
		if(r==(1LL<<keta))
		{
			ans+='1';
			now-=pow(-2,keta);
		}else{
			ans+='0';
		}
		keta++;
	}
	reverse(ans.begin(),ans.end());
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 512
/**
** 
** Last Updated: 2019/09/26 18:01:24 JST
** (c) was
**/
#include <bits/stdc++.h>
using namespace std;

int main() {
  //input
  int n,x;cin >> n >> x;
  int tmp,sum=1;
  vector<int> l(n, 0);
  for(int i=1;i<=n;i++){
    cin >> tmp;
    l[i] = tmp+l[i-1];
    if(l[i]<=x)
      sum++;
  }
  
  //output
  cout << sum << endl;

  return 0;
	
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <math.h>
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) > (b) ? (b) : (a))
#define abs(x) ((x) > 0 ? (x) : -(x))
#define rep(i, n) for(int i = 0; i < (n); i++)
#define INF 1000000000000 //10^12
#define MOD 1000000007 //10^9 + 7
#define endl printf("\n")
typedef long long ll;

int sort(const void *a, const void *b){
  int A = *(int *)a, B = *(int *)b;
  if(A > B) return  1;
  if(A < B) return -1;
  return 0;
}

int
main(int argc, char *argv[])
{
  int n;
  scanf("%d", &n);
  int cnt = 0;
  int m = n;
  while(m > 0){
    m /= 10;
    cnt++;
  }
  int d[100]; d[1] = 9; d[2] = 90;
  for(int i = 3; i < 7; i++){
    d[i] = d[i - 1] * 10;
  }
  int ans = 0;

  for(int i = 0; 2 * i + 1 < cnt; i++){
    ans += d[2 * i + 1];
  }

  int k = 0; int s = 1;
  for(int i = 0; i < cnt - 1; i++){
    k += 9 * s;
    s *= 10;
  }
  if(cnt % 2 == 1) ans += n - k;
  printf("%d\n", ans);

  return 0;
}


Measured memory_bytes: 128
import sys
input = sys.stdin.readline

N = int(input())
xy = []
xs = []
ys = []
for _ in range(N):
    x, y = map(int, input().split())
    xy.append([x - y, x + y])
    xs.append(x - y)
    ys.append(x + y)

diff1 = max(xs) - min(xs)
diff2 = max(ys) - min(ys)
ans = max(diff1, diff2)
print(ans)


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

struct Benri { Benri() { std::cin.tie(0); ios::sync_with_stdio(false); cout << fixed << setprecision(12);}} benri;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int, int>;
using vll = vector<long long>;
using pll = pair<ll, ll>;
using ull = unsigned long long;

template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define mp make_pair
#define F first
#define S second

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 (b < a) { a = b; return 1; } return 0; }

constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
constexpr int INF = 1001001001;
//constexpr ll INF = 1001001001001001001ll;
constexpr double EPS = 1e-10;
using number = long long;



struct UnionFind {
    vector<int> par, rank;

    UnionFind(int n) : par(n , -1), rank(n, 0) { }
    void init(int n) { par.assign(n, -1), rank.assign(n, 0); }

    int root(int x) {
        if (par[x] == -1) return x;
        else return par[x] = root(par[x]);
    }

    bool same(int x, int y) {
        return root(x) == root(y);
    }

    bool unite(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y);
        if (rank[x] == rank[y]) ++rank[x];
        par[y] = x;
        return true;
    }
};


struct edge {
    int from, to;
    number cost;
    edge(int a, int b, number c) : from(a), to(b), cost(c) {}
};

using Edges = vector< edge >;

number kruskal(int V, Edges &edges) {
    sort(all(edges), [](const edge & a, const edge & b) {
        return (a.cost < b.cost);
    });
    UnionFind uf(V);
    number ret = 0;
    for (auto &e : edges) {
        if (uf.unite(e.from, e.to)) ret += e.cost;
    }
    return ret;
}


inline ll distance(pll P, pll Q) {
    return min(abs(P.F - Q.F), abs(P.S - Q.S));
}


int main() {
    int V; cin >> V;
    Edges G;
    vector<pll> P(V), X(V), Y(V);
    rep(i, V) {
        cin >> P[i].F >> P[i].S;
        X[i] = pii(P[i].F, i);
        Y[i] = pii(P[i].S, i);
    }
    sort(all(X));
    sort(all(Y));

    rep(a, V - 1) { //x座標でソートした時の道を追加
        int i = X[a].S, j = X[a + 1].S;
        edge e(i, j, distance(P[i], P[j]));
        G.pb(e);
    }
    rep(a, V - 1) { //y座標
        int i = Y[a].S, j = Y[a + 1].S;
        edge e = edge(i, j, distance(P[i], P[j]));
        G.pb(e);
    }

    cout << kruskal(V, G) << endl;

}


Measured memory_bytes: 11248
#include <iostream>
#include<algorithm>
#include <stdio.h>
#include <string>
#include <string.h>
#include <map>
#include <math.h>
#include <vector>
#include <set>
#include <map>
#include <deque>
//#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=2e5+7;
int gcd(int a,int b)
{
    return b?gcd(b,a%b):a;
}
int get_bit(int x,int i){return (x>>i)&1;}
int a[1000],b[1000];
int main()
{
    int n,m,x,y;
    cin>>n>>m>>x>>y;
    for(int i=1;i<=n;i++)cin>>a[i];
    for(int i=1;i<=m;i++)cin>>b[i];
    sort(a+1,a+n+1);sort(b+1,b+m+1);
    int tx=a[n]+1,ty=b[1];
    int ans=0,f=1;
    for(int i=tx;;i++)
    {
        if(i>ty)
        {
            f=0;
            break;
        }
        if(i<=ty) {
            ans = i;
            break;
        }
    }
    if(f==0){
        cout<<"War"<<endl;
       return 0;
    }
    if(x<ans&&ans<=y)
        cout<<"No War"<<endl;
    else
        cout<<"War"<<endl;
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func nextString() string {
	if !sc.Scan() {
		panic("failed scan string")
	}
	return sc.Text()
}

func nextInt() int {
	if !sc.Scan() {
		panic("failed scan int")
	}
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc.Split(bufio.ScanWords)

	a := nextInt()
	b := nextInt()
	c := nextInt()

	if a+b >= c {
		fmt.Println(b + c)
	} else {
		fmt.Println(a + b + b + 1)
	}
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<ll, int> Pl;
typedef pair<int, pair<int, int>> PP;
const double PI = 3.1415926535897932;   // acos(-1)
const double EPS = 1e-15;
const int INF = 1001001001;
const int mod = 1e+9 + 7;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define chadd(x, y) x = (x + y) % mod

struct UnionFind{
    int sz;     // vertex number
    vector<int> par;
    vector<int> rank;
    vector<int> cnt;

    UnionFind(int n) : sz(n) {
        par.resize(sz);
        rank.assign(sz, 0);
        cnt.assign(sz, 1);
        for(int i = 0; i < sz; ++i){
            par[i] = i;
        }
    }

    int find(int x){
        if(par[x] == x) return x;
        else    return par[x] = find(par[x]);
    }

    bool same(int x, int y){
        return find(x) == find(y);
    }

    void unite(int x, int y){
        x = find(x), y = find(y);
        if(x == y)  return;
        if(rank[x] < rank[y]){
            par[x] = y;
            cnt[y] += cnt[x];
        }
        else{
            par[y] = x;
            cnt[x] += cnt[y];
            if(rank[x] == rank[y])  ++rank[x];
        }
    }

    int get_cnt(int x){
        return cnt[find(x)];
    }
};

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

    int n, m;
    cin >> n >> m;
    vector<ll> output(m);
    UnionFind uf(n);
    vector<int> a(m), b(m);
    for(int i = 0; i < m; ++i){
        cin >> a[i] >> b[i];
        --a[i], --b[i];
    }
    
    output[m - 1] = (ll)n * (n - 1) / 2;
    for(int i = m - 1; i > 0; --i){
        if(uf.same(a[i], b[i])){
            output[i - 1] = output[i];
        }
        else{
            ll dif = (ll)uf.get_cnt(a[i]) * uf.get_cnt(b[i]);
            output[i - 1] = output[i] - dif;
            uf.unite(a[i], b[i]);
        }
    }

    for(int i = 0; i < m; ++i)  cout << output[i] << "\n";
}


Measured memory_bytes: 4096
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AOJ1_6_C
{
    class Program
    {
        const int _numOfBuilding = 4;
        const int _numOfFloor = 3;
        const int _numOfRoom = 10;
        static void Main(string[] args)
        {
            Building[] Dormitry1 = new Building[_numOfBuilding];
            for (int i = 0; i < _numOfBuilding; ++i)
            {
                Dormitry1[i] = new Building(_numOfFloor, _numOfRoom);
            }
            int numberOfEntry = int.Parse(Console.ReadLine());
            for (int i = 0; i < numberOfEntry; ++i)
            {
                int[] entry = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
                int _buildingNumber = entry[0];
                Dormitry1[_buildingNumber - 1].floorNumber = entry[1];
                Dormitry1[_buildingNumber - 1].roomNumber = entry[2];
                Dormitry1[_buildingNumber - 1].numberOfTenant = entry[3];
                Dormitry1[_buildingNumber - 1].Entry();
            }
            OutputCurrentDormStatus(Dormitry1);
        }
        private static void OutputCurrentDormStatus(Building[] Dormitry)
        {
            for (int i = 0; i < _numOfBuilding; ++i)
            {

                if (i != 0)
                {
                    Console.WriteLine("####################");
                }
                for (int j = 0; j < _numOfFloor; ++j)
                {
                    for (int k = 0; k < _numOfRoom; ++k)
                    {
                        Console.Write(" " + Dormitry[i].AllRooms[j, k]);
                    }
                    Console.WriteLine();
                }
            }
        }
    }
    class Building
    {
        internal int floorNumber = 1;
        internal int roomNumber = 1;
        internal int numberOfTenant = 0;
        internal int[,] AllRooms;
        internal Building(int NumOfFloor, int NumOfRoom)
        {
            AllRooms = new int[NumOfFloor, NumOfRoom];
        }
        internal void Entry()
        {
            AllRooms[floorNumber - 1, roomNumber - 1] += numberOfTenant;
        }
    }
}


Measured memory_bytes: 16288
#include <cstdio>
#define int long long

int a,b;

int gcd(int a,int b) {
	if(!b) return a;
	return gcd(b,a % b); 
}

signed main() {
	scanf("%lld%lld",&a,&b);
	printf("%lld\n",a * b / gcd(a,b));
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds; 
using namespace std;
#define int long long
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mll map<ll,ll>
#define mii map<int,int>
#define mp make_pair
#define pb push_back
#define rep(i,b) for(ll (i)=0;i<(b);i++)
#define all(c) (c).begin(), (c).end()
#define F first
#define S second
#define CLR(p) memset(p, 0, sizeof(p))
#define SET(p) memset(p, -1, sizeof(p))
#define DEBUG true
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);
//typedef long long int ll;
typedef tree<int, null_type, less<int>, rb_tree_tag, 
tree_order_statistics_node_update> new_data_set; 
const int MAX=200005;
#define MOD 1000000007
/*std::cout << std::fixed;
std::cout << std::setprecision(6);*/
//(a%mod-b%mod+mod)%mod



/************************************


 
*************************************/

vector<vector<ll>>v;
ll T=0;
ll cnt1=0,cnt0=0;
vector<ll>dep;
bool visited[MAX];
vector<ll>par;
vector<ll>tin,tout;
vector<ll>col;
ll f=0,k=1;
map<pll,ll>m;
ll dp1[MAX],dp2[MAX];
ll red,blue;
ll ans;
ll dp[MAX];

ll lca(ll u,ll v){
	while(u!=v){
		ll l1,l2;
		l1 = log2(u);
		l2 = log2(v);
		//cout<<l1<<"$$"<<l2<<endl;
		if(l1<l2)
			swap(u,v);
		u /=2;
	}
	return u;
}





signed main(){
	boost;
	int t=1;
	// cin>>t;
	while(t--){
		int n;
		cin>>n;
		string s;
		cin>>s;
		vector<int>r,g,b;
		for(int i=0;i<n;i++){
			if(s[i]=='R')
				r.pb(i+1);
			else if(s[i]=='G')
				g.pb(i+1);
			else b.pb(i+1);
		}
		//cout<<r.size()<<" "<<g.size()<<" "<<b.size()<<endl;
		int ans = r.size()*g.size()*b.size();
		//cout<<ans<<endl;
		for(int i=0;i<n;i++){
			for(int j=1;j<n;j++){
				int a = i+j;
				int c = i+(2*j);

				if(c<n&&s[a]!=s[i]&&s[i]!=s[c]&&s[a]!=s[c])
					ans--;
			}
		}
		cout<<ans<<endl;
	}

	return 0;
}

Measured memory_bytes: 3708
s_num = int(input())
s_list = list(map(int,input().split()))
q_num = int(input())
q_list = list(map(int,input().split()))



def binary_search(A,x):

    low = 0
    high = len(A)
    mid = len(A)//2

    while 1:
        if low > high: return False
        if A[mid] == x: return True
        elif A[mid] > x: high = mid-1
        elif A[mid] < x: low = mid + 1
        mid = (low+high) //2

count = 0
for x in q_list:
    if binary_search(s_list,x):
        count += 1
print(count)


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

#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)

int main(){
	int y,m,d;
	while(cin>>y>>m>>d){
		int num=y*100*100+m*100+d;
		if(num<18680908)cout<<"pre-meiji";
		else if(num<19120730)cout<<"meiji "<<y-1867<<" "<<m<<" "<<d;
		else if(num<19261225)cout<<"taisho "<<y-1911<<" "<<m<<" "<<d;
		else if(num<19890108)cout<<"showa "<<y-1925<<" "<<m<<" "<<d;
		else cout<<"heisei "<<y-1988<<" "<<m<<" "<<d;
		cout<<endl;
		
	}
}

Measured memory_bytes: 1164
N = int(input())
ARR = [int(s) for s in input().split(" ")]

def calculate(n,arr):

    dict = {}

    for ar in arr:
        a1 = ar - 1
        a2 = ar
        a3 = ar + 1

        if dict.get(a1) == None:
            dict.__setitem__(a1,1)
        else:
            dict.__setitem__(a1,dict.get(a1)+1)

        if dict.get(a2) == None:
            dict.__setitem__(a2, 1)
        else:
            dict.__setitem__(a2, dict.get(a2) + 1)

        if dict.get(a3) == None:
            dict.__setitem__(a3, 1)
        else:
            dict.__setitem__(a3, dict.get(a3) + 1)


    print(max(dict.values()))
calculate(N,ARR)

Measured memory_bytes: 19672
# http://ja.wikipedia.org/wiki/%E3%83%97%E3%83%AA%E3%83%A0%E6%B3%95

class vertex:
    def __init__(self):
        self.is_in_V = False

def is_single_in_V(v,p):
    a = v[p[0]].is_in_V
    b = v[p[1]].is_in_V
    return ( a and not b ) or ( not a and b )

def all_in_V(v):
    for e in v:
        if not e.is_in_V:
            return False
    return True

def add_in_V(v,d):
    v[d[0]].is_in_V = True
    v[d[1]].is_in_V = True

def remove_all_in_V_pass(v,d):
    for i in xrange(len(d)):
        try:
            if v[d[i][0]].is_in_V and v[d[i][1]].is_in_V:
                d.pop(i)
        except:
            pass

def solve(nu,mu,du):
    E = []
    vertexes = [vertex() for i in xrange(nu)]
    vertexes[0].is_in_V = True

    while True:
        if all_in_V(vertexes):
            break
        min_dist,ind = float("inf"),float("inf")
        for i in xrange(len(du)):
            if is_single_in_V(vertexes,du[i][0:2]):
                if min_dist > du[i][2]:
                    min_dist,ind = du[i][2],i
        E.append(min_dist)
        add_in_V(vertexes,du[ind])
        du.pop(ind)
        remove_all_in_V_pass(vertexes,du)
    print sum(E)/100 - len(E)

while True:
    n = input()
    if n == 0:
        exit()
    m = input()
    data = []
    for i in xrange(m):
        data.append( map(int,raw_input().split(",")) )
    solve(n,m,data)

Measured memory_bytes: 4904
#include <bits/stdc++.h>
using namespace std;
const int lim=100000;
set<int> adjl[lim+1];
vector<bool> vis(lim+1,false);
int dp[lim+1];
void dfs(int u)
{
    vis[u]=true;
    int ll=0;
    for(int v: adjl[u])
    {
        if(!vis[v])
        {
            dfs(v);
        }
        ll=max(ll,dp[v]);
    }
    dp[u]=ll+1;
}
int main()
{
    int n, m, l=0;
    cin>>n>>m;
    for(int i=1;i<=m;i++)
    {
        int x, y;
        cin>>x>>y;
        adjl[x].insert(y);
    }
    for(int i=1;i<=n;i++)
    {
        if(!vis[i]) dfs(i);
    }
    for(int i=1;i<=n;i++) l=max(l,dp[i]);
    cout<<l-1;
}

Measured memory_bytes: 16768
#include<ctime>
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath> 
#include<cstring> 
#include<cassert>
#include<string>
#include<sstream>
#include<fstream>
#include<deque>
#include<queue>
#include<vector>
#include<map>
#include<list>
#include<stack>
#include<set>
#include<bitset>
#include<iomanip>
#include<utility>
#include<functional>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cwchar>
#include<cwctype>
#include<exception>
#include<locale>
#include<numeric>
#include<new>
#include<stdexcept>
#include<limits>
using namespace std;

#define ll long long
#define INF 1e9
#define rep(i,n) for(int (i)=0;(i)<n;i++)
#define REP(i,n) for(int (i)=1;(i)<=n;i++)
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
inline void Fail(){
	printf("0");
	exit(0);
}

const int maxn=100005;
int n,m,cnt[2];
bool ok=true;
int f[maxn*2];

int Find(int x){
	return f[x]==x?x:f[x]=Find(f[x]);
}

void Union(int x,int y){
	x=Find(x);y=Find(y);
	if(x!=y)f[x]=y;
}

int main(){
	scanf("%d%d",&n,&m);
	REP(i,2*n)f[i]=i;
	rep(i,m){
		int u,v;
		scanf("%d%d",&u,&v);
		Union(u,v+n);
		Union(u+n,v);
	}
	REP(i,n)if(Find(i)==Find(i+n))ok=false;
	if(ok){
		REP(i,n*2)if(Find(1)==Find(i)){
			if(i<=n)cnt[0]++;
			else cnt[1]++;
		}
		printf("%lld",1LL*cnt[0]*cnt[1]-m);
	}
	else{
		printf("%lld",1LL*n*(n-1)/2LL-m);
	}
	return 0;
}

Measured memory_bytes: 1024
IDENTIFICATION                   DIVISION.
PROGRAM-ID.                      ABC_079_B.
ENVIRONMENT                      DIVISION.
DATA                             DIVISION.
WORKING-STORAGE                  SECTION.
    01 N      PIC 9(2).
    01 i      PIC 9(2).
    01 tmp    PIC 9(18).
    01 ppr    PIC 9(18).
    01 pr     PIC 9(18).
    01 lucas  PIC 9(18).
    01 ans    PIC X(18).
    01 ZS     PIC Z(18)9.
    01 DUMMY  PIC X(1).
PROCEDURE                        DIVISION.
MAIN.
    ACCEPT N.

    PERFORM LUCASNUMBER.

    MOVE lucas TO ZS.

    PERFORM UNANS.

    DISPLAY ans(1:FUNCTION STORED-CHAR-LENGTH(ans)).
    STOP RUN.

UNANS                            SECTION.
    UNSTRING
        ZS DELIMITED BY ALL SPACE
        INTO DUMMY ans
    END-UNSTRING.

LUCASNUMBER                      SECTION.
    MOVE 2 TO ppr.
    MOVE 1 TO pr.

    PERFORM VARYING i FROM 2 BY 1 UNTIL N < i
        ADD ppr pr GIVING lucas
        MOVE pr TO ppr
        MOVE lucas TO pr
    END-PERFORM.

    IF N = 1 THEN
        MOVE 1 TO lucas
    END-IF.


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

int main(void)
{
	int N, D;
	double X, Y;
	int i, a=0;

	scanf("%d %d", &N, &D);
	for (i = 0;i < N;i++) {
		scanf("%lf %lf", &X, &Y);
		if (D >= sqrt(X * X + Y * Y)) {
			a++;
		}
	}

	printf("%d", a);
	
}

Measured memory_bytes: 2216
/*
　　こんにちは。あたしはｶｳｶﾞｰﾙ。
　　RedcoderになるためAtCoderを巡る旅をしてます。

　　　 　＿_
　　　 ヽ|＿_|ノ　　　　ﾓｫ
　　　　||‘‐‘||ﾚ　　_)_, ―‐ 、
　　　　/(Ｙ (ヽ＿ /・ ヽ　　   ￣ヽ
　　　　∠ ＿ ゝ　 ｀^ヽ ﾉ.::::_(ノヽ
　　　　 _/ヽ　 　　  /ヽ￣￣￣/ヽ
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define dump(x) cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO") << endl
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE") << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible") << endl

#define rep(i, n) REP(i, 0, n)                  // 0, 1, ..., n-1
#define REP(i, x, n) for(int i = x; i < n; i++) // x, x + 1, ..., n-1
#define FOREACH(x, a) for(auto &(x) : (a))

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()

#define COUT(x) cout << (x) << endl

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

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

    string s;
    cin >> s;
    s == "Sunny" ? COUT("Cloudy")
                 : s == "Cloudy" ? COUT("Rainy") : COUT("Sunny");
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
  int x,y,mem;
  while(cin>>x>>y){
    if(x==0&&y==0) break;
    int count=0;
    if(y>x){
      mem = x;
      x = y;
      y = mem;
    }
    while(y!=0){
      x %= y;
      mem = x;
      x = y;
      y = mem;
      count++;
      //cout << y << endl;
    }
    cout << x << endl;
  }
  return 0;
}

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

using i64 = long long int;

int main(){
    int n;
    cin >> n;
    vector<i64> acc;
    for(int i=0;i<n;++i){
        i64 a;
        cin >> a;
        if(i == 0)acc.push_back(a);
        else acc.push_back(a+acc.back());
    }

    i64 ans = 2000000000;
    for(int i=0;i<n-1;++i){
        i64 tmp = abs(acc[i] - (acc.back() - acc[i]));
        ans = min(ans, tmp);
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 2420
#include<bits/stdc++.h>
using namespace std;
#define M 1000000007
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
typedef pair<int,int> P;
typedef pair<P,P> PP;
int main(void)
{
	int i,j,n,m,s,g,v,p,flg[101],ky[101],a,min,ri[21][21],sum;
	PP ga[101];
	scanf("%d%d",&n,&m);
	for(i=1;i<=m;i++) scanf("%d,%d,%d,%d",&ga[i].ff,&ga[i].fs,&ga[i].sf,&ga[i].ss);
	sort(ga,ga+m);
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++) ri[i][j]=M;
	}
	for(i=1;i<=m;i++) {
		ri[ga[i].ff][ga[i].fs]=ga[i].sf;
		ri[ga[i].fs][ga[i].ff]=ga[i].ss;
	}
	scanf("%d,%d,%d,%d",&s,&g,&v,&p);
	/*printf("\n");
	for(i=1;i<=n;i++){
		for(j=1;j<=n;j++) printf("%d ",ri[i][j]);
		printf("\n");
	}*/
	for(i=1;i<=n;i++) flg[i]=0,ky[i]=M;
	ky[s]=0;
	for(i=1;i<=n;i++){
		min=M;
		for(j=1;j<=n;j++) if(flg[j]==0&&min>ky[j]) a=j,min=ky[j];
		flg[a]=1;
		if(M==min) break;
		for(j=1;j<=n;j++) if(ky[j]>ky[a]+ri[a][j]) ky[j]=ky[a]+ri[a][j];
	}
	/*for(i=1;i<=n;i++) printf("%d=%d ",i,ky[i]);
	printf("\n");*/
	sum=ky[g];
	for(i=1;i<=n;i++) flg[i]=0,ky[i]=M;
	ky[g]=0;
	for(i=1;i<=n;i++){
		min=M;
		for(j=1;j<=n;j++) if(flg[j]==0&&min>ky[j]) a=j,min=ky[j];
		flg[a]=1;
		if(M==min) break;
		for(j=1;j<=n;j++) if(ky[j]>ky[a]+ri[a][j]) ky[j]=ky[a]+ri[a][j];
	}
	/*for(i=1;i<=n;i++) printf("%d=%d ",i,ky[i]);
	printf("\n");*/
	sum+=ky[s];
	printf("%d\n",v-sum-p);
	return 0;
}


Measured memory_bytes: 3216
#include <assert.h>
#include <limits.h>
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>
#include <random>
 
#define rep(i, a, b) for (long long (i) = (a); i < (b); i++)
#define all(i) i.begin(), i.end()
#define debug(i) std::cerr << "debug " << #i <<" "<< i << std::endl
 
template <typename T1, typename T2>
std::ostream& operator<<(std::ostream& os, std::pair<T1, T2> pa) {
  return os << pa.first << " " << pa.second;
}
 
template <typename T>
std::ostream& operator<<(std::ostream& os, std::vector<T> vec) {
  for (int i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
  return os;
}
 
template<typename T1,typename T2>
inline bool chmax(T1& a,T2 b){return a<b && (a=b,true);}
 
template<typename T1,typename T2>
inline bool chmin(T1& a,T2 b){return a>b && (a=b,true);}
 
long long pow_mod(long long a, long long b, long long mod=-1) {
  if ((a == 0)||(mod!=-1&&a%mod==0)) {
    return 0;
  }
 
  long long x = 1;
 
  while (b > 0) {
    if (b & 1) {
      x = (mod!=-1)?(x * a) % mod:x*a;
    }
    a = (mod!=-1)?(a * a) % mod:a*a;
    b >>= 1;
  }
  return x;
}
 
// const long long MOD = 998244353;
const long long MOD = 1e9 + 7;

using ll = long long;
using P = std::pair<ll, ll>;

std::vector<ll> seq(ll n,ll a,ll b){
  if(n==1){
    return {a,b};
  }

  ll hold;

  rep(i,0,n){
    if((a^b)&(1ll<<i)){
      hold=i;
      break;
    }
  }

  ll na=0,nb=0;
  rep(i,0,hold){
    if(a&(1ll<<i))na+=(1ll<<i);
    if(b&(1ll<<i))nb+=(1ll<<i);
  }
  rep(i,hold+1,n){
    if(a&(1ll<<i))na+=(1ll<<(i-1));
    if(b&(1ll<<i))nb+=(1ll<<(i-1));
  }

  std::vector<ll> first=seq(n-1,na,na^1),second=seq(n-1,na^1,nb);

  rep(i,0,1ll<<(n-1)){
    first.push_back(second[i]);
  }

  rep(i,0,1ll<<(n-1)){
    ll num=first[i];
    first[i]=0;
    rep(j,0,hold){
      if(num&(1ll<<j))first[i]+=(1ll<<j);
    }
    rep(j,hold,n){
      if(num&(1ll<<j))first[i]+=(1ll<<(j+1));
    }
    if(a&(1ll<<hold))first[i]+=(1ll<<hold);
  }
  rep(i,1ll<<(n-1),1ll<<n){
    ll num=first[i];
    first[i]=0;
    rep(j,0,hold){
      if(num&(1ll<<j))first[i]+=(1ll<<j);
    }
    rep(j,hold,n){
      if(num&(1ll<<j))first[i]+=(1ll<<(j+1));
    }
    if(b&(1ll<<hold))first[i]+=(1ll<<hold);
  }

  return first;
}

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

  ll n,a,b;
  std::cin>>n>>a>>b;

  ll cnt=0;
  rep(i,0,n){
    if((a^b)&(1ll<<i))cnt++;
  }

  if(cnt%2==0){
    std::cout<<"NO\n";
    return 0;
  }

  std::cout<<"YES\n";

  std::cout<<seq(n,a,b)<<"\n";

  return 0;
}

Measured memory_bytes: 2416
#include<bits/stdc++.h>
using namespace std;
int main(){
  char b;
  cin>>b;
  if(b=='A')cout<<'T'<<endl;
  if(b=='C')cout<<'G'<<endl;
  if(b=='G')cout<<'C'<<endl;
  if(b=='T')cout<<'A'<<endl;
}
  

Measured memory_bytes: 256