akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>

using namespace std;

const int maxi=1e6+6;
int n,m;

int a[maxi],b[maxi],c[maxi];
int main()
{

   cin>>n>>m;

   for (int i=1;i<=m;i++)
    {
         scanf("%d%d",&a[i],&b[i]);
         if (a[i]==1) c[b[i]]++; else
         if (b[i]==n) c[a[i]]+=2;
    }

    for (int i=2;i<n;i++)
        if (c[i]==3)
    {
        printf("POSSIBLE\n");
        return 0;
    }

    printf("IMPOSSIBLE\n");
    return 0;
}


Measured memory_bytes: 9216
/**/
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <stack>
#include <queue>

typedef long long LL;
typedef unsigned long long ULL;
using namespace std;

const LL INF = 99999999999999;
const int inf = 999999999, maxn = 1e5 + 24;
int n;
LL a[maxn];

int main()
{
	//freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	while(scanf("%d", &n) == 1) {
		for(int i = 0; i < n; i++) {
			scanf("%lld", &a[i]);
		}
		vector<LL> L(n + 2, 0);
		for(int i = 0; i < n; i++) L[i+1] = __gcd(L[i], a[i]);
		vector<LL> R(n + 2, 0);
		for(int i = n; i > 0; i--) R[i] = __gcd(R[i+1], a[i-1]);
		LL res =0;
		for(int i = 1; i <= n; i++) res = max(res, __gcd(L[i-1], R[i+1]));
		printf("%lld\n", res);
	}

	return 0;
}
/*
    input:
    output:
    modeling:
    methods:
    complexity:
    summary:
*/

Measured memory_bytes: 2560
#include<bits/stdc++.h>
#define rep(i, l, r) for(int i = (l), i##end = (r);i <= i##end;++i)
using std::cin; using std::cout;
const int maxn = 200200;
typedef long long ll;
const int mod = 998244353;
inline ll pow(ll a,int b,int ans = 1) {
	for(;b;b >>= 1,a = a * a % mod) if(b & 1)
		ans = ans * a % mod;
	return ans;
}
inline ll inverse(int x){ return pow(x, mod - 2); }
int n, x, y;
struct T {
	int to, nxt;
} way[maxn << 1];
int h[maxn], num;
inline void link(int x,int y) {
	way[++num] = {y, h[x]}, h[x] = num;
	way[++num] = {x, h[y]}, h[y] = num;
}
inline bool dfs(int x,int f = 0) {
	int cnt = 0;
	for(int i = h[x];i;i = way[i].nxt) if(way[i].to != f) {
		cnt += dfs(way[i].to, x);
	}
	if(cnt >= 2) cout << "First" << '\n', exit(0);
	return ! cnt;
}
int main() {
	std::ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n;
	rep(i, 1, n - 1) {
		cin >> x >> y;
		link(x, y);
	}
	cout << (dfs(1) ? "First" : "Second") << '\n';
}


Measured memory_bytes: 2304
<?php

function calc($n) {
    $a = 0;
    $b = 0;
    for ($i = 0;$i < $n;$i++) {
        $num = explode(' ', trim(fgets(STDIN)));
        $na = $num[0];
        $nb = $num[1];
        if ($na > $nb) $a += ($na + $nb);
        if ($na < $nb) $b += ($na + $nb);
        if ($na == $nb) {
            $a += $na;
            $b += $nb;
        }
    }
    echo $a.' '.$b.PHP_EOL;
}

// main
while (true) {
    $n = trim(fgets(STDIN));
    if ($n == 0) break;
    calc($n);
}



Measured memory_bytes: 9272
N, M = map(int, input().split())

Ps = [[] for i in range(N)]
Cs = []
for i in range(M):
    p, y = map(int, input().split())
    p -= 1
    Cs.append([p, 0])
    Ps[p].append([i, y])

for p in Ps:
    p = sorted(p, key=lambda city: city[1])
    for i in range(len(p)):
        Cs[p[i][0]][1] = i+1

for i in range(M):
    print('{:0=6}{:0=6}'.format(Cs[i][0]+1, Cs[i][1]))




Measured memory_bytes: 45536
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pll = pair<ll, ll>;
const ll INF = 1LL << 60;
const ll MOD = (ll) 1e9 + 7;

int main(){
    int n;
    cin >> n;
    map<int, int> m;
    m[n] = 1;
    for (int i = 2; ; i++) {
        if (n % 2 == 0)
            n /= 2;
        else
            n = n * 3 + 1;
        if (m[n] > 0) {
            cout << i << "\n";
            return 0;
        }
        else {
            m[n] = i;
        }
    }
}

Measured memory_bytes: 256
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_B main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
// functions

#endif


int main_B() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    
    int N; cin >> N;
    vs S(N);vi P(N);
    REP(i, N) cin >> S[i] >> P[i];

    vector<pair<pair<string, int>, int>> rs;
    REP(i,N) {
        rs.push_back(pair<pair<string, int>, int>(
            pair<string,int>(S[i], P[i]*-1), i + 1));
    }

    sort(rs.begin(), rs.end());

    for (auto p : rs) { 
        cout << p.second << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
 
    int N;
    cin >> N;
    int A[N];
    unordered_map <long long, long long> mapL;
    for(int i=1; i<=N; i++){
        cin >> A[i];
        mapL[i-A[i]] += 1;
    }
 
    long long ans=0;
 
    for(int i=1; i<=N; i++){
        ans += mapL[A[i]+i];
    }
 
   cout << ans << endl; 
 
    return 0;
}

Measured memory_bytes: 19188
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace AtCoder
{
	// http://abc092.contest.atcoder.jp/tasks/abc092_a
	public class Abc092_a
	{
#if !Development
		public static void Main(string[] args)
		{
			Abc092_a.Solve(args);
		}
#endif

		public static void Solve(string[] args)
		{
			var d1 = ReadLineInt()[0];
			var d2 = ReadLineInt()[0];
			var b1 = ReadLineInt()[0];
			var b2 = ReadLineInt()[0];

			var solve = Math.Min(d1, d2) + Math.Min(b1, b2);

			Console.WriteLine(solve);
		}

		public static List<string> ReadLineString() { return Console.ReadLine().Split(' ').ToList(); }
		public static List<int> ReadLineInt() { return Console.ReadLine().Split(' ').Select(str => int.Parse(str)).ToList(); }
	}
}

Measured memory_bytes: 11220
#include <stdio.h>
#define SIZE 100000
#define nil -1

typedef struct{
  int par,left,right;
}node;

node t[SIZE];
int n;
int dep[SIZE];

int depth(int,int);

int main(){
  int i,j,id,k,c,v;
  scanf("%d",&n);

  for(i=0; i<n; i++)
    t[i].par = t[i].right = t[i].left = nil;
  
  for(i=0; i<n; i++){
    scanf("%d %d",&id,&k);
    for(j=0; j<k; j++){
      int bef;
      scanf("%d",&c);
      if(j == 0) t[id].left = c;
      else t[bef].right = c;
      bef = c;
      t[c].par = id;
    }
  }

  for(i=0; i<n; i++)
    if(t[i].par == nil) v = i;

  depth(v,0);

  for(i=0; i<n; i++){
    printf("node %d: parent = %d, ",i,t[i].par);
    printf("depth = %d, ",dep[i]);

    if(t[i].par == nil)printf("root, ");
    else if(t[i].left == nil) printf("leaf, ");
    else printf("internal node, ");

    printf("[");
    
    int tmp;
    j = 0;
    tmp = t[i].left;
    while(tmp != nil){
      if(j != 0)printf(", ");
      printf("%d",tmp);
      j++;
      tmp = t[tmp].right;
    }
    printf("]\n");
  }
  
}

int depth(int u,int p){
  dep[u] = p;
  if(t[u].right != nil) depth(t[u].right,p);
  if(t[u].left != nil) depth(t[u].left,p+1);
}



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

#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b)) < EPS )
#define PI 3.141592653589793238
struct Point3D {
  double x, y, z;
  Point3D() {}
  Point3D(double x, double y, double z) : x(x), y(y), z(z) {}  
  Point3D operator+(Point3D p) { return Point3D(x+p.x, y+p.y, z+p.z); }
  Point3D operator-(Point3D p) { return Point3D(x-p.x, y-p.y, z-p.z); }
  Point3D operator*(double k) { return Point3D(x*k, y*k, z*k); }
  Point3D operator/(double k) { return Point3D(x/k, y/k, z/k); }
  
};

typedef Point3D Vector3D;

struct Segment3D {
  Point3D p1, p2;
  Segment3D() {}
  Segment3D(Point3D p1, Point3D p2) : p1(p1), p2(p2) {}
};
typedef Segment3D Line3D;

struct Sphere {
  Point3D c;
  double r;
  Sphere() {}
  Sphere(Point3D c, double r) : c(c), r(r) {}
};

double norm(Vector3D a) {
  return a.x*a.x+a.y*a.y+a.z*a.z;  
}

double abs(Vector3D a) {
  return sqrt(norm(a));
}

double dot(Vector3D a, Vector3D b) {
  return a.x*b.x+a.y*b.y+a.z*b.z;  
}

Vector3D cross(Vector3D a, Vector3D b) {
  return Vector3D(a.y*b.z-a.z*b.y, a.z*b.x-a.x*b.z, a.x*b.y-a.y*b.x);  
}

double getDistanceLP(Line3D l, Point3D p) {
  return abs(cross(l.p2-l.p1, p-l.p1)/abs(l.p2-l.p1));  
}

double getDistanceSP(Segment3D s, Point3D p) {
  if ( dot(s.p2-s.p1, p-s.p1) < 0.0 ) return abs(p-s.p1);
  if ( dot(s.p1-s.p2, p-s.p2) < 0.0 ) return abs(p-s.p2);
  return getDistanceLP(s, p);
}

bool intersectSC(Segment3D s, Sphere c) {
  double d = getDistanceSP(s, c.c);
  if ( d > c.r ) return 0;
  return !((abs(s.p1-c.c) <= c.r) && (abs(s.p2-c.c) <= c.r ));  
}

double calc(double b, Point3D a, Point3D e) {
  return b / (pow(a.x-e.x, 2) + pow(a.y-e.y, 2) + pow(a.z-e.z, 2));  
}

int main() {
  int N, M, R;
  while ( cin >> N >> M >> R, N ) {
    vector<Sphere> s(N);    
    for ( int i = 0; i < N; i++ ) {
      cin >> s[i].c.x >> s[i].c.y >> s[i].c.z >> s[i].r;      
    }
    vector<Point3D> p(M);
    vector<double> b(M);    
    for ( int i = 0; i < M; i++ ) {
      cin >> p[i].x >> p[i].y >> p[i].z >> b[i];      
    }
    Point3D E;
    cin >> E.x >> E.y >> E.z;

    vector<int> ps[M];    
    for ( int i = 0; i < M; i++ ) {
      Segment3D seg = Segment3D(E, p[i]);	  
      for ( int j = 0; j < N; j++ ) {
	if ( intersectSC(seg, s[j]) ) {
	  ps[i].emplace_back(j);	  
	}
      }
    }

    vector<double> sums(1<<M, 0);
    for ( int i = 0; i < (1<<M); i++ ) {
      for ( int j = 0; j < M; j++ ) {
	if ( !(i&(1<<j)) ) continue;
	sums[i] += calc(b[j], p[j], E);	
      }
    }
    
    double ans = 0;
    for ( int i = 0; i < (1<<M); i++ ) {
      int cnt = 0;
      vector<int> used(N, 0);
      for ( int j = 0; j < M; j++ ) {
	if ( !(i&(1<<j)) ) continue;
	// if ( ps[j].size() > R ) break;	
	for ( int k : ps[j] ) {
	  if ( used[k] ) continue;	  
	  cnt++;
	  used[k] = true;	    
	}      
	if ( cnt > R ) {
	  break;
	}
      }
      if ( cnt <= R ) ans = max(ans, sums[i]);      
    }

    printf("%.12lf\n", ans);    
  }
  return 0;
}



Measured memory_bytes: 3728
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <iomanip>
#include <climits>
#include <functional>
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<string> VS;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef vector<PII> VPI;
typedef vector<PLL> VPL;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define pf push_front
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define ub upper_bound
#define lb lower_bound

int main(){
  ll N,K;
  cin>>N>>K;
  VI A(N+1);
  rep(i,N) cin>>A[i];
  A[N]=0;
  rep(i,K){
    VI B(N+1);
    rep(j,N){
      if(j-A[j]<0) B[0]++;
      else B[j-A[j]]++;
      if(j+A[j]+1>N) B[N]--;
      else B[j+A[j]+1]--;
    }
    int F=1;
    rep(j,N){
      B[j+1]+=B[j];
      F*=(B[j]==N);
    }
    swap(A,B);
    if(F) break;
  }
  rep(i,N){
    if(i) cout<<" ";
    cout<<A[i];
  }
  cout<<endl;
}

Measured memory_bytes: 5168
use proconio::input;

fn main() {
    input! {n: usize, a: [u64; n]}
    
    let mut k: Vec<u64> = Vec::with_capacity(n);
    for _ in 0..n {
        k.push(0);
    }

    for (i, v) in a.iter().enumerate() {
        match a.get(i + 1) {
            Some(n) => {
                let c = k.get(i).unwrap_or(&0);
                if n < &(v + c) {
                    k[i + 1] = v + c - n;
                }
            },
            None => {}
        }
    }

    println!("{}", k.iter().sum::<u64>());
}


Measured memory_bytes: 7152
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(x) (x).begin(), (x).end()

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

    string s;
    cin >> s;
    int K;
    cin >> K;
    REP(i, s.size()) {
        if (s[i] > 'a' && 'z' - s[i] + 1 <= K) {
            K -= 'z' - s[i] + 1;
            s[i] = 'a';
        }
    }
    s[s.size() - 1] = 'a' + (s.back() - 'a' + K) % 26;
    cout << s << endl;
}

Measured memory_bytes: 592
#include <stdio.h>

int main(){
	int m,f,r;
	char grade;
	while(1){
		scanf("%d %d %d",&m,&f,&r);
		if(m == -1 && f == -1 && r == -1) break;
		if(m == -1 || f == -1){
			grade = 'F';
		}else if(m+f >= 80){
			grade = 'A';
		}else if(m+f >= 65){
			grade = 'B';
		}else if(m+f >= 50){
			grade = 'C';
		}else if(m+f >= 30){
			grade = (r >= 50)? 'C':'D';
		}else{
			grade = 'F';
		}
		printf("%c\n",grade);
	}
}


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

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

	cin >> n >> a >> b;

	int max = min(a, b);
	int min;
	if(b - (n - a) <= 0){
		min = 0;
	}else{
		min = b - (n - a);
	}

	cout << max << " " << min << endl;

}


Measured memory_bytes: 256
import sys

line = sys.stdin.readline()
output = []
for i in range( len( line )-1 ):
	c = ord( line[i] )
	if ord( 'a' ) <= c and c <= ord( 'z' ):
		c = chr( c ).upper()
	elif ord( 'A' ) <= c and c <= ord( 'Z' ):
		c = chr( c ).lower()
	else:
		c = chr( c )
	output.append( c )

print( "".join( output ) )

Measured memory_bytes: 6724
#include<stdio.h>
#include<iostream>

using namespace std;

int main(){
  string s;
  cin>>s;
  
  if(s[0]=='7' || s[1]=='7' || s[2]=='7'){
    cout<<"Yes";
  }else{
    cout<<"No";
  }
  
  return 0;
}

Measured memory_bytes: 3596
#include <stdio.h>
#include <bits/stdc++.h>
     
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = l; i < r; i++)
#define repb(i, r, l) for (int i = r; i > l; i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define mp(a, b) make_pair(a, b)
     
using namespace std;
     
const int N = 100000;
const int inf = (int)1e9 + 1;
const ll big = (ll)1e18 + 1;
const int P = 31;
const int MOD = (int)1e9 + 7;
const int MOD1 = (int)1e9 + 9;
const double eps = 1e-9;
const double pi = atan2(0, -1);
const int ABC = 26;

int p[N];
int r[N];

void build(int n)
{
    rep(i, 0, n)
        p[i] = i;
}

int get(int x)
{
    if (p[x] != x)
        p[x] = get(p[x]);
    return p[x];
}

bool uni(int x, int y)
{
    x = get(x);
    y = get(y);
    if (x == y)
        return false;
    if (r[x] >= r[y])
        p[y] = x;
    else
        p[x] = y;
    if (r[x] == r[y])
        r[x]++;
    return true;
}

int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.precision(20);
    //ll TL = 10.95 * CLOCKS_PER_SEC;
    //clock_t time = clock();
    int n;
    cin >> n;
    pair<int, int> a[n], b[n];
    rep(i, 0, n)
    {
        int x, y;
        cin >> x >> y;
        a[i] = {x, i};
        b[i] = {y, i};
    }
    sort(a, a + n);
    sort(b, b + n);
    vector<pair<int, pair<int, int> > > e;
    rep(i, 0, n - 1)
        e.push_back({a[i + 1].fi - a[i].fi, {a[i].se, a[i + 1].se}});
    rep(i, 0, n - 1)
        e.push_back({b[i + 1].fi - b[i].fi, {b[i].se, b[i + 1].se}});
    sort(e.begin(), e.end());
    build(n);
    int ans = 0;
    for (auto it : e)
        if (uni(it.se.fi, it.se.se))
            ans += it.fi;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 6516
#include<iostream>
using namespace std;
int main(){
	int a[100] = { 0 };
	cin >> a[0] >> a[1]>>a[2];
	int x = 0;
	int y = 0;
	for (int i = 0; i < 100; i++){
		for (int i = 0; i < 2; i++){
			if (a[i]>a[i + 1]){
				x = a[i];
				a[i] = a[i + 1];
				a[i + 1] = x;
			}
			
		}
	}
	cout << a[0] << " " << a[1] << " " << a[2] << endl;
	
	return 0;
}

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

using namespace std;

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);i--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define ll long long
#define ull unsigned long long
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll) 1e9 + 7;
typedef vector<ll> Array;
typedef vector<Array> Matrix;
constexpr int loose = 0;
constexpr int tight = 1;


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

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve(){
	ll n;
	cin>>n;
	string s;
	cin>>s;
	string t=s;
	reverse(all(t));

	ll ans=0;
	REP(bit,(1LL<<n)){
		Array red;
		Array blue;
		REP(i,n){
			if(bit&(1LL<<i)){
				red.push_back(i);
			}else{
				blue.push_back(i);
			}
		}
		Matrix dp(red.size()+1,Array(blue.size()+1,0));
		dp[0][0]=1;
		REP(i,red.size()+1){
			REP(j,blue.size()+1){
				if(i<red.size() && s[red[i]]==t[i+j]) dp[i+1][j]+=dp[i][j];
				if(j<blue.size() && s[blue[j]]==t[i+j]) dp[i][j+1]+=dp[i][j];
			}
		}
		ans+=dp[red.size()][blue.size()];
	}
	cout<<ans<<en;
}

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

    solve();
    return 0;
}

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

long long gcd(long long x, long long y) {
    while (true) {
        long long g = max(x, y);
        long long l = min(x, y);

        if (g == l) return g;

        x = g - l;
        y = l;
    }
}

void pf(long long x, long long prime, set<long long> &s) {
    if (prime == 1) {
        s.insert(1);
        pf(x, 2, s);
        return;
    }

    bool is_prime = true;
    long long tmp = x;
    long long lim = x;
    
    for (long long p = prime; p <= lim; ++p) {
        if (tmp % p == 0) {
            s.insert(p);
            is_prime = false;

            while (tmp % p == 0) tmp /= p;

            pf(tmp, p + 1, s);
            break;
        }
        else {
            lim = min(lim, x / p);
        }
    }

    if (is_prime) s.insert(x);
}

int main() {
    long long A, B;
    cin >> A >> B;

    set<long long> s;
    pf(gcd(A, B), 1, s);

    cout << s.size() << endl;

    return 0;
}


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

int main(){
    string A, B, C;
    cin >> A >> B >> C;

    int a = (int)A.at(0) - 32;
    int b = (int)B.at(0) - 32;
    int c = (int)C.at(0) - 32;

    cout << (char)a << (char)b << (char)c << endl;
}

Measured memory_bytes: 3568
#include<algorithm>
#include<iostream>
#include<vector>
#include<string>
#include<utility>
using std::cin;
using std::cout;
using std::string;
int main()
{
  int n;
  cin >> n;
  std::vector<std::pair<double, string>> data(n);
  const double jpy_per_btc = 380000;
  double jpy_sum = 0;
  double btc_sum = 0;
  for(size_t i = 0; i < n; ++i)
  {
    double item1;
    string item2;
    cin >> item1 >> item2;
    if(item2 == "JPY")
    {
      jpy_sum += item1;
    }else
    {
      btc_sum += item1;
    }
  }

  double sum = jpy_sum + btc_sum * jpy_per_btc;
  std::cout << sum << std::endl;
  return 0;
}


Measured memory_bytes: 256
// AtCoder template
// sabaより胡蝶しのぶさんの方が可愛いのではないか？
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < n; ++i)

// segment-tree
// Tはモノイドの台集合
template<typename T>
class segment_tree{
private:
    using F = function<T(T,T)>;
    int leafnum;             // 葉の数
    const T m1;                 // 単位元
    F f;
    vector<T> seg; // ノードの値を持つ配列
    int bilower(int x){
        int ret = 1;
        while(ret < x) ret <<= 1;
        return ret;
    }

    T _query(int a, int b, int k, int l, int r){
        // [a, b)の区間に対するクエリについて
        // ノード k （区間 [l, r) 担当）が答える
        if (r <= a || b <= l) return m1; // 区間が被らない場合は 単位元 を返す
        if (a <= l && r <= b) return seg[k]; // ノード k の担当範囲がクエリ区間 [a, b)
        else{ // に完全に含まれる
            T r1 = _query(a, b, 2 * k + 1, l, (l + r) / 2); // 左の子に値を聞く
            T r2 = _query(a, b, 2 * k + 2, (l + r) / 2, r); // 右の子に値を聞く
            return f(r1, r2); // 左右の子の値の f を取る
        }
    }

public:
    
    //constructor
    //nodenumは配列の要素数、 はモノイドの単位元
    segment_tree(int nodenum, const T m):m1(m){
        leafnum = bilower(nodenum);
        seg = vector<T> (2*leafnum, m);
        f = [](T a, T b){
            return a+b;
        };
    }

    // i 番目の葉の値を x に変える
    void update(int i, T x){    
        i += leafnum - 1; // i 番目の葉のノード番号
        seg[i] = x;
        while (i > 0) {
            i = (i - 1) / 2; // ノード i の親ノードの番号に変える
            seg[i] = f(seg[i * 2 + 1], seg[i * 2 + 2]); // 左右の子の f を計算しなおす
        }
    }

    //指定した区間の最小値を求める
    //引数a,bで指定した半開区間[a,b)の中の最小値を求める
    //_query(a,b,0,0,leafnum)として呼び出す、最期の引数に注意（leafnumはメンバ変数になっているのでそれを呼び出せばよい）
    T query(int a, int b){
        return _query(a, b, 0, 0, leafnum);
    }
    
    // i番目の値を答える
    T node(int i){
        return seg[i+2*leafnum];
    }
};



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n, q; string s; cin >> n >> s >> q;
    vector<segment_tree<int>> seg(26, segment_tree<int>(n,0));
    rep(i,n) seg[s[i]-'a'].update(i,1);

    rep(i,q){
        int query; cin >> query;
        if(query == 1){
            int iq; char cq; cin >> iq >> cq;
            iq--;
            seg[s[iq]-'a'].update(iq, 0);
            s[iq] = cq;
            seg[s[iq]-'a'].update(iq, 1);
        }else{
            int l,r; cin >> l >> r;
            l--;
            int ret = 0;
            rep(i,26) if(seg[i].query(l,r) >= 1) ret++;
            cout << ret << endl;
        }
    }
}

Measured memory_bytes: 111516
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n;
    cin >> n;
    vector<ll> a(n+1);
    for(int i=1;i<=n;++i) {
        cin >> a[i];
    }

    vector<vector<ll>> dp(n+1, vector<ll>(3, -LINF));
    dp[0][1] = 0;
    dp[1][1] = 0;
    dp[1][2] = a[1];
    for(int i=2;i<=n;++i) {
        if(i % 2) {
            dp[i][1] = max(dp[i-1][1], dp[i-2][1] + a[i]);
            dp[i][2] = max(dp[i-1][2], dp[i-2][2] + a[i]);
        } else {
            dp[i][0] = max(dp[i-1][1], dp[i-2][0] + a[i]);
            dp[i][1] = max(dp[i-1][2], dp[i-2][1] + a[i]);
        }
    }
    cout << dp[n][1] << endl;
}


Measured memory_bytes: 15872
s = input().split()
W=int(s[0])
H=int(s[1])
x=int(s[2])
y=int(s[3])
r=int(s[4])

if 0<x and x<W and 0<y and y<H:
    if x+r <=W and y+r <=H:
        print("Yes")
    else :
        print("No")
else:
    print("No")

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

#define mp                    make_pair
#define pb                    push_back
#define ll                    long long
#define ld					  long double

#define ss                       second
#define ff                        first

#define fr(i,a,b)   for(ll i=a;i<b;i++)
#define f(i,n)                fr(i,0,n)
#define rf(i,b,a) for(ll i=b-1;i>=a;i--)
#define r(i,n)                rf(i,n,0)

#define sz(a)                int((a).size())
#define all(c)               (c).begin(),(c).end()
#define tr(c,i)              for(typeof(c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x)         ((c).find(x) != (c).end())
#define cpresent(c,x)        (find(all(c),x) != (c).end())

#define pi                   pair<int,int>
#define pll                  pair < ll , ll >
#define pd					 pair<ld,ld>
#define endl                 '\n'

#define PI                   3.141592653589793238462643383279502884197169399375105820974944592307816406286
#define mod					 1000000007
#define inf                  1000000007
#define eps                  0.000000000000001

typedef vector<int> vi; 
typedef vector< ll > vl;
typedef vector< ld > vd;
typedef vector< pi > vpi;
typedef vector< pll > vpl;
typedef vector< vi > vvi;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

//vector<int> adj[200010],value(200010),par(200010),vis(200010,0),dis(200010,0),g(200010,0),col(200010,-1);
//int myrandom (int i) { return std::rand()%i;}

int main()
{
	int n,k;
	cin>>n>>k;
	vi p(n);
	f(i,n) cin>>p[i];
	sort(all(p));
	int s=0;
	f(i,k) s+=p[i];
	cout<<s<<endl;
}


Measured memory_bytes: 3636
#include<cmath>
#include<iostream>
#include<algorithm>
#include<iomanip>
#include<vector>
#include<string>
#include<queue>
#include<stack>
#include<cstdio>
#include<map>
#include<utility>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define fori(i,k,n) for(int i=k;i<(int)n;i++)
using namespace std;
const int dx[4] = { 0, 1, 0, -1 }, dy[4] = { 1, 0, -1, 0 };
const int dX[8] = { 0, 1, 1, 1, 0, -1, -1, -1 }, dY[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
/*
(char)'1' - (int)48 = (int)1;


*/


int main()
{
	string a[300];
	int n;
	int m; cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	cin >> m;
	bool now = true;
	for (int i = 0; i < m; i++)
	{
		string x;
		cin >> x;
		bool ok=false;
		for (int l = 0; l < n; l++)
		{
			if (a[l] == x)
			{
				ok = true; break;
			}
		}
		if (ok)
		{
			if (now)
			{
				cout << "Opened by " << x << endl;
				now = false;
			}
			else
			{
				cout << "Closed by " << x << endl;
				now = true;
			}
		}
		else
		{
			cout << "Unknown " << x << endl;
		}
	}
}

Measured memory_bytes: 1216
(defun solver ()
  (let* ((max 100001)
         (ar1 (make-array max :initial-element t))
         (ar2 (make-array max :initial-element 0))
         (q (read))
         (lq (make-array q :fill-pointer 0))
         (rq (make-array q :fill-pointer 0)))
    (loop for i from 4 below max by 2 do
          (setf (svref ar1 i) nil))
    (loop for i from 3 below max by 2 do
          (when (svref ar1 i)
            (loop for j from (* i 2) below max by i do
                  (setf (svref ar1 j) nil))))
    (loop for i from 3 below max by 2 do
          (when (and (svref ar1 i) (svref ar1 (floor (1+ i) 2)))
            (incf (svref ar2 i))))
    (loop for i from 3 below max do
          (incf (svref ar2 i) (svref ar2 (1- i))))
    (loop repeat q do
          (vector-push (read) lq)
          (vector-push (read) rq))
    (loop for i from 0 below q do
          (format t "~a~%"
                  (- (svref ar2 (aref rq i)) (svref ar2 (1- (aref lq i))))))))

(solver)

Measured memory_bytes: 73860
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define fill fill_n
#define vli vector<ll>
#define pb push_back
#define comp(v) v.begin(),v.end()
const int M = 1e9+7;
const int N = 2e+5;
ll po(int a,int b){
    if(b==0) return 1;
    ll ans=1;
    if(b%2==0){
        ans = po(a,b/2)%M;
        ans=(ans%M * ans%M)%M;
    }
    else{
        ans = po(a,(b-1)/2)%M;
        ans = (ans%M * ans%M * a)%M;
    }
    return ans%M;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;cin>>n;
	 double p[n+1],dp[n+5][n+5];
	for(int i=1;i<=n;i++){
	    cin>>p[i];
	}
	dp[0][1] = 1-p[1];
	dp[1][1] = p[1];
	for(int j=2;j<=n;j++){
	    for(int i=0;i<=j;i++){
	        if(i==0) dp[i][j] = (1-p[j])*dp[i][j-1];
	        else if(i==j) dp[i][j] = p[j]*dp[i-1][j-1];
	        else{
	            dp[i][j] = p[j]*dp[i-1][j-1] + (1-p[j])*dp[i][j-1];   
	        }
	    }   
	}
	double ans = 0.0;
	for(int i=n/2+1;i<=n;i++){
	    ans += dp[i][n]; 
	}
	cout<<setprecision(10)<<ans<<'\n';
	
	
	
	return 0;
}


Measured memory_bytes: 70272
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <list>
#include <stdio.h>
#include <string.h>
#include <cstdlib>
#include <math.h>
#include <bitset>
#include <iterator>
#include <iomanip>
#include <sstream>
#include <numeric>
#define INF 2000000000
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define sym cout<<"---------"<<endl;
#define ll long long
#define PL pair<long long, long long>
#define P pair<int,int>
#define mk make_pair
#define en endl
#define WHITE 0
#define BLACK 2
#define GRAY 1
#define RE return 0
#define int ll

#define MAX 200005
int piece[MAX];

signed main(){
  int n;
  cin>>n;
  for(int i=1; i<=n; i++){
    int a;
    cin>>a;
    piece[i]=piece[i-1]+a;
  }
  
  for(int i=1; i<=n; i++){
    piece[i+n]=piece[n]+piece[i];
  }
  
  int l=0;
  int r=100000000000000;
  while(l+1<r){
    int m=(r+l)/2;
    bool ok=false;
    for(int i=1; i<=n-2; i++){
      int bet=lower_bound(piece, piece+2*n, piece[i-1]+m)-piece;
      bet=lower_bound(piece, piece+2*n, piece[bet]+m)-piece;
      bet=lower_bound(piece, piece+2*n, piece[bet]+m)-piece;
      if(bet<=i+n-1) {
        ok=true;
        break;
      }
    }
    if(ok) l=m;
    else r=m;
  }
  
  cout<<l<<en;
}




Measured memory_bytes: 4632
#include<stdio.h>

int main(){

char x[102]={};
char n[102][102]={};

int w,h;

while(1){

scanf("%d %d",&h,&w);
if(h==0&&w==0)break;
bool f[102][102]={};
for(int i=0;i<h;i++)
{scanf("%s",&x);
for(int j=0;j<=w;j++)
{	n[i][j]=x[j];f[i][j]=true;}
}


int a=0,b=0;
while(f[b][a]!=false){
if(n[b][a]=='>'){a++;f[b][a-1]=false;}
else if(n[b][a]=='<'){a--;f[b][a+1]=false;}
else if(n[b][a]=='v'){b++;f[b-1][a]=false;}
else if(n[b][a]=='^'){b--;f[b+1][a]=false;}
else if(n[b][a]=='.'){break;}
}

if(f[b][a]==false)printf("LOOP\n");
else printf("%d %d\n",a,b);
}
return 0;
}

Measured memory_bytes: 1068
import * as fs from 'fs';

//in
// 5 3
//out
// 9
const main = (inp: string) => {
    let buttons: number[] = inp.split(' ').map(Number);
    let ans: number = 0;
    for (let i: number = 0; i < 2; i++) {
        buttons = buttons.sort((a, b) => {
            return b - a
        });
        ans += buttons[0];
        buttons[0]--;
    }
    console.log(ans);
};

main(fs.readFileSync('/dev/stdin', 'utf8').trim());


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

void solve() {
  long long H1, M1, H2, M2, K;
  cin >> H1 >> M1 >> H2 >> M2 >> K;

  long long res = (H2 - H1) * 60 + (M2 - M1) - K;
  cout << res << "\n";
}

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

    solve();

  return 0;
}


Measured memory_bytes: 3656
#include<iostream>
using namespace std;
int main(){
  //  /*
  long long max;
  max = -(1<<30);
  int n;
  cin >> n;

  int f[n][10], p[n][11];

  for(int i=0; i<n; i++){
    for(int j=0; j<10; j++){
      cin >> f[i][j];
    }
  }

  for(int i=0; i<n; i++){
    for(int j=0; j<11; j++){
      cin >> p[i][j];
    }
  }

  for(int k=1; k<(1<<10); k++){
    long long sales = 0;

    for(int i=0; i<n; i++){
      int cnt = 0;

      for(int j=0; j<10; j++){
        if((k>>j)%2 && f[i][j]) cnt++;
      }

      sales += p[i][cnt];
    }

    if(sales > max){
      max = sales;
    }
  }

  cout << max << endl;

  //  */
return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll, ll>
#define vi          vector<ll>
#define vvi			vector<vi>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
#define tr(c,i)		for(typeof((c).begin() i = (c).begin(); i != (c).end(); i++)
#define present(c,x)	((c).find(x) != (c).end()) 
#define cpresent(c,x)	(find(all(c),x) != (c).end()) 
#define int ll
using namespace std;

#define N  100005

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	#endif
	int TESTS=1;
//	cin>>TESTS;
	while(TESTS--)
	{
		int x;
		cin >> x;

		vector< pii > a;

		for(int i = 0; i*i*i*i*i<=1e18; i++)
		{
			int j = i*i*i*i*i;
			a.pb({j, i});
			if(j!=-j)
				a.pb({-j, -i});
		}

		sort(all(a));

		int a1 = 0, b1 = 0;

		int minv = -1e18;

		rep(i, 0, sz(a))
		{
			int cand = a[i].first;
			int idx = lower_bound(all(a), make_pair(x+cand, minv)) - a.begin();
			if(idx==sz(a) || cand+x!=a[idx].first)
				continue;
			a1 = a[i].second;
			b1 = a[idx].second;
			break;
		}

		cout << b1 << " " << a1 << endl;
	}
	return 0;
}

Measured memory_bytes: 3772
n,a,b = map(int,input().split())
MOD = 10**9 + 7
def calc(a, b, p):
    if b == 0:
        return 1
    elif b%2 == 0:
        d = calc(a,b/2, p)
        return (d * d) % p
    else:
        return (a * calc(a,b-1,p)) % p




def combination(n, r, mod=10**9+7):
    n1, r = n+1, min(r, n-r)
    numer = denom = 1
    for i in range(1, r+1):
        numer = numer * (n1-i) % mod
        denom = denom * i % mod
    return numer * pow(denom, mod-2, mod) % mod

print((calc(2, n, MOD) - combination(n, a) - combination(n, b) - 1) % MOD)

Measured memory_bytes: 3064
#include <cstdio>
#include <cctype>

using namespace std;

int main(){
	char ch;
	while(true){
		scanf("%c", &ch);
		if(islower(ch)){
			ch = toupper(ch);
		}
		else if(isupper(ch)){
			ch = tolower(ch);
		}
		printf("%c", ch);
		if(ch == '\n') break;
	}

	return 0;
}

Measured memory_bytes: 944
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto hw = readln.split.to!(int[]);
    auto H = hw[0];
    auto W = hw[1];
    char[][] MAP;
    foreach (_; 0..H) MAP ~= readln.chomp.to!(char[]);
    auto MEMO = new int[][](H, W);
    foreach (ref memo; MEMO) memo[] = int.max;
    auto ss = [[0, 0, MAP[0][0] == '#' ? 1 : 0]];
    while (!ss.empty) {
        auto h = ss[0];
        ss = ss[1..$];
        auto i = h[0];
        auto j = h[1];
        foreach (d; [[1,0], [0,1]]) {
            auto k = i+d[0];
            auto l = j+d[1];
            auto c = h[2];
            if (k >= H || l >= W) continue;
            if (MAP[i][j] == '.' && MAP[k][l] == '#') ++c;
            if (MEMO[k][l] <= c) continue;
            MEMO[k][l] = c;
            ss ~= [k, l, c];
        }
    }
    writeln(MEMO[H-1][W-1]);
}

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

using namespace std;

#ifdef NeverBeRed
#include "debug.h"
#else
#define debug(...) 9715
#endif
typedef long long ll;
typedef long double ld;
typedef complex<ll> point;
#define F first
#define S second

ld dp[2][605];

int main()
{
	#ifdef TurnRed
		freopen("a.in", "r", stdin);
		//freopen("a.out", "w", stdout);
	#endif

	ios_base::sync_with_stdio(0), cin.tie(0);

	int n, m;
	cin >> n >> m;
	vector<vector<int>> adj(n);
	for (int u, v; m--; )
	{
		cin >> u >> v;
		--u, --v;
		adj[u].push_back(v);
	}

	ld ans = 1e60;
	for (int i = 0; i < n; ++i)
	{
		memset(dp, 0, sizeof dp);
		for (int u = n-2; u >= 0; --u)
		{
			int sz = adj[u].size();
			for (auto v : adj[u]) dp[0][u] += dp[v==i][v];
			dp[0][u] = dp[0][u] / sz + 1;
			dp[1][u] = dp[0][u];
			if (sz > 1 && u == i)
			{
				ld s = 0;
				for (auto v : adj[u])
					s += dp[0][v];
				for (auto v : adj[u])
					dp[1][u] = min(dp[1][u], (s - dp[0][v]) / (sz-1) + 1);
			}
		}
		ans = min(ans, dp[1][0]);
	}
	cout << setprecision(20) << fixed << ans << "\n";

	return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
#define REV_WHOLE(v) (v).rbegin(), (v).rend()
using i64 = int64_t;
using namespace std;
template <size_t I, class H, class... T> struct TupleReaderWriter{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple_cat(tuple<H>(v),TupleReaderWriter<sizeof...(T)-1,T...>::r(i));}static void w(ostream&o,tuple<H,T...>&t,string d){TupleReaderWriter<I-1,H,T...>::w(o,t,d);o<<d<<get<I>(t);}};
template <class H, class... T> struct TupleReaderWriter<0,H,T...>{static tuple<H,T...> r(istream&i){H v;i>>v;return tuple<H>(v);}static void w(ostream&o,tuple<H,T...>&t,string d){o<<get<0>(t);}};
template<class T>istream&operator>>(istream&i,vector<T>&v){for(auto&x:v)i>>x;return i;}
template<class T>ostream&operator<<(ostream&o,vector<T>&v){string delim="";for(auto&x:v)o<<delim<<x,delim=" ";return o;}
template <class... T> istream& operator>>(istream&i,tuple<T...>& t) { t = TupleReaderWriter<sizeof...(T), T...>::r(i); return i; }
template <class... T> ostream& operator<<(ostream& o, tuple<T...>& t) { string delim = " "; TupleReaderWriter<sizeof...(T) - 1, T...>::w(o, t, delim); return o; }
template<typename T> using rev_priority_queue = priority_queue<T, vector<T>, greater<T>>;
template<typename T> using vector2d = vector<vector<T>>;
void R_YESNO(bool p) { cout << (p ? "YES" : "NO") << endl; }
void R_YesNo(bool p) { cout << (p ? "Yes" : "No") << endl; }
int main() {
    const int INF = 1e9;
    int K;
    cin >> K;
    vector<int> A(K, INF);
    deque<int> q;
    A[1] = 1;
    q.push_back(1);
    while(q.size()) {
        int x = q.front();
        q.pop_front();
        int y = (x * 10) % K, z = (x + 1) % K;
        if (A[x] < A[y]) {
            q.push_front(y);
            A[y] = A[x];
        }
        if (A[x] < A[z]) {
            q.push_back(z);
            A[z] = A[x] + 1;
        }
    }
    cout << A[0] << endl;
    return 0;
}

Measured memory_bytes: 896
import std.algorithm;
import std.array;
import std.conv;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

T read(T)() { return readln.chomp.to!T; }
T[] reads(T)() { return readln.split.to!(T[]); }
alias readint = read!int;
alias readints = reads!int;

int calc(int lo, int hi) {
    // abcba = 10001 * a + 1010 * b + 100 * c
    // 1 <= a <= 9
    // 0 <= b, c <= 9
    int ans = 0;
    for (int a = 1; a <= 9; a++) {
        for (int b = 0; b <= 9; b++) {
            for (int c = 0; c <= 9; c++) {
                int x = 10001 * a + 1010 * b + 100 * c;
                if (lo <= x && x <= hi) {
                    ans++;
                }
            }
        }
    }
    return ans;
}

void main() {
    auto ab = readints;
    int a = ab[0], b = ab[1];
    writeln(calc(a, b));
}


Measured memory_bytes: 256
import java.util.*;

class Main{
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        if(n%2==0){
            System.out.println(n/2);
        }
        else{
            System.out.println(n/2+1);
        }
    }
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>

using namespace std;

long long MOD = 1e9+7;
int MAX_INT = 1e9;

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

  int A, B, M;
  cin >> A >> B >> M;
  vector<int> a(A);
  vector<int> b(B);
  for (int i = 0; i < A; i++)cin >> a[i];
  for (int i = 0; i < B; i++)cin >> b[i];
  int minA = *min_element(a.begin(), a.end());
  int minB = *min_element(b.begin(), b.end());
  int ans = minA + minB;
  for (int i = 0; i < M; i++) {
    int x, y, c;
    cin >> x >> y >> c;
    ans = min(ans, a[x-1] + b[y-1] - c);
  }

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


Measured memory_bytes: 3928
#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#include <complex>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<58;
const double pi=acos(-1);
const double eps=1e-7;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int a,b,c,d;

int main(){
	cin>>a>>b>>c>>d;
	if(b<c||d<a) cout<<0<<endl;
	else cout<<min(b,d)-max(a,c)<<endl;
}

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

#define int long long
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)
#define all(v) (v).begin(),(v).end()
#define each(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)
#define pb push_back
#define fi first
#define se second
template<typename A,typename B>inline void chmin(A &a,B b){if(a>b)a=b;}
template<typename A,typename B>inline void chmax(A &a,B b){if(a<b)a=b;}

signed main(){
    int n;
    cin>>n;
    vint l(2*n);rep(i,2*n)cin>>l[i];
    sort(all(l));
    int ans=0;
    rep(i,n)ans+=l[i*2];
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
N, K = map(int, input().split())
P = list(map(int, input().split()))
max = 0
S = 0
for i in range(len(P)):
    S += P[i]
    if i-K < 0:
        pass
    else:
        S -= P[i-K]
    if max < S:
        max = S

print((max+K)/2)

Measured memory_bytes: 71792
#include <stdio.h>

int main() {
    int A,B,C,D,Sum,train,bus;
    
    scanf("%d%d%d%d",&A,&B,&C,&D);
    

    if (A<B) train=A;
    else train=B;
    
    if (C<D) bus=C;
    else bus=D;
    
    
    
    Sum = train + bus;
    
    

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

    
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int main() {
	int arr[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	int c;
	cin >> c;
	cout << arr[c - 1] << endl;
	return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define rep2(i,n) for(int i=0;i<=n;i++)
#define repr(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define P pair<long long,long long>
#define uni(e) e.erase(unique(e.begin(),e.end()),e.end())
#define double long double
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 INF=1e10;
int MOD=1e9+7;
signed main(){
int a;
  cin>>a;
  cout<<(a-2)*180<<endl;
}

Measured memory_bytes: 256
x,y,a,b,c=map(int,input().split())
reds=sorted(list(map(int,input().split())))
greens=sorted(list(map(int,input().split())))
neutral=sorted(list(map(int,input().split())))

reds=reds[a-x:]
greens=greens[b-y:]
total=sorted(reds+greens+neutral)

print(sum(total[len(total)-x-y:]))


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

int main() {
    int n, m; cin >> n >> m;
    unordered_map<int, unordered_map<int, bool>> possible;
    for (int i = 0; i < m; ++i) {
        int a, b; cin >> a >> b;
        possible[a][b] = possible[b][a] = true;
    }

    for (int i = 2; i < n; ++i) {
        if (possible[1][i] && possible[i][n]) {
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }

    cout << "IMPOSSIBLE" << endl;
}



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

using namespace std;

int main()
{
  int n,k;
  
  cin>>n>>k;
  
  vector<int> a;
  
  int buf_d,buf_a;
  
  for(int i=0;i<k;i++)
  {
	cin>>buf_d;
    
    for(int j=0;j<buf_d;j++)
    {
		cin>>buf_a;
        a.push_back(buf_a);
    }
  }
  
  int ans=0;
  
  bool hoge=false;
  
  for(int i=1;i<=n;i++)
  {
    for(int j=0;j<(int)a.size();j++)
    {
		if(i==a[j])
          hoge=true;
    }
    
    if(!hoge)
      ans++;
    
    hoge=false;
  }
  
  cout<<ans<<endl;
  
  return 0;
}

Measured memory_bytes: 3676
N, M = map(int, input().split())
A = [int(input()) for _ in range(M)]
DIV = 10**9+7

def main():
    if M>0:
        B = [0]*(M+1)
        for i in range(M+1):
            if i==0:
                B[i] = A[i]-1
            elif i==M:
                B[i] = N-A[i-1]-1
            else:
                if A[i]==A[i-1]:
                    B[i] = 0
                else:
                    B[i] = A[i] - A[i-1] - 2
    else:
        B = [N]
    min_B = min(B)
    if min_B<0:
        return 0
    
    max_B = max(B)
    F = [1]*(max_B+1)
    for i in range(max_B+1):
        if i<2:
            pass
        else:
            F[i] = F[i-2] + F[i-1]
    ans = 1
    for b in B:
        ans *= F[b]
        if ans >= DIV:
            ans %= DIV
    return ans

print(main())


Measured memory_bytes: 471288
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<utility>
#include<map>
#include<set>
#include <sstream>
#include<queue>
#include<stack>
#include<functional>
#include<math.h>
using namespace std;

int main(void){

    int table[3][3] = {{0,0,0},{0,0,0},{0,0,0}};
    for(int i =0; i < 9; i++){
        int tmp;
        cin >> tmp;
        table[i/3][i%3] = tmp;
    }
    int N;
    cin >> N;
    for(int i = 0; i < N; i++){
        int tmp;
        cin >> tmp;
        for(int i =0; i < 9; i++){
            if( table[i/3][i%3] == tmp){
                table[i/3][i%3] = -1;
            }
        }
    }



    for(int i =0; i < 3; i++){
        if(table[i][0]== -1 &&table[i][1]== -1 &&table[i][2]== -1 ){
            cout << "Yes" << endl;
            return 0;
        }
        if(table[0][i]== -1 &&table[1][i]== -1 &&table[2][i]== -1 ){
            cout << "Yes" << endl;
            return 0;
        }
    }
    if(table[0][0]== -1 &&table[1][1]== -1 &&table[2][2]== -1 ){
        cout << "Yes" << endl;
        return 0;
    }
    if(table[2][0]== -1 &&table[1][1]== -1 &&table[0][2]== -1 ){
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
using ll=long long;

int main(){
	int n,q,l,r,c[100000];
	string s;

	cin>>n>>q;
	cin>>s;

	for(int i=0;i<n;i++)c[i]=0;
	for(int i=1;i<n;i++){
		c[i]=c[i-1];
		if(s[i-1]=='A'&&s[i]=='C')c[i]++;
	}

	for(int i=0;i<q;i++){
		cin>>l>>r;
		l--,r--;
		cout<<c[r]-c[l]<<endl;
	}
}

Measured memory_bytes: 1408
s = input()
flg = 0
for i in range(0, len(s), 2):
    if s[i]=='R'or s[i]=='U' or s[i]=='D':
        flg = 1
    else:
        flg = 0
        break
if (flg):
    for i in range(1, len(s), 2):
        if s[i]=='L'or s[i]=='U' or s[i]=='D':
            flg = 1
        else:
            flg = 0
            break
if (flg):
    print("Yes")
else: print("No")

Measured memory_bytes: 3064