akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        while(true){
            String b = sc.next();
            if(b.equals("=")){
                break;
            }
            int c = sc.nextInt();
            if(b.equals("+")){
                a += c;
            }else if(b.equals("-")){
                a -= c;
            }else if(b.equals("*")){
                a *= c;
            }else if(b.equals("/")){
                a /= c;
            }
        }   
        System.out.println(a);
        sc.close();
    }
}


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

int n, m;
int fr[101][101] = {};
int ans = 0;

int calc_score(const vector<int> &node) {
    if (node.size() == 1) return 0;

    int score = 0;
    for (auto x : node) {
        int min_fr = 1e9;
        for (auto y : node) {
            if (x == y) continue;
            min_fr = min(min_fr, fr[x][y]);
        }
        score += min_fr;
    }
    return score;
}

void dfs(vector<int> &node) {
    ans = max(ans, calc_score(node));

    for (int i = node.back() + 1; i < n; i++) {
        bool is_ok = true;
        for (int j = 0; is_ok && j < node.size(); j++)
            if (fr[i][node[j]] == 0) is_ok = false;
        if (!is_ok) continue;

        node.push_back(i);
        dfs(node);
        node.pop_back();
    }
}

int main() {
    cin >> n >> m;

    for (int i = 0; i < m; i++) {
        int u, v, f; cin >> u >> v >> f;
        u--, v--;
        fr[u][v] = fr[v][u] = f;
    }

    for (int i = 0; i < n; i++) {
        auto node = vector<int>(1, i);
        dfs(node);
    }
    cout << ans << endl;
}



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

bool c (string a,string b)
{

}

int main()
{
	string a,b;
	cin >> a>>b;
	if(a.size()>b.size())
	{
		cout<<"GREATER"<<endl;
	}
	else if (b.size()>a.size())
	{
		cout<<"LESS"<<endl;
	}
	else if(a>b)
	{
		cout<<"GREATER"<<endl;
	}
	else if(b>a)
	{
		cout<<"LESS"<<endl;
	}
	else
	{
		cout<<"EQUAL"<<endl;
	}
	
	
	return 0;
}

Measured memory_bytes: 256
n = int(input())
s = input()
count=0
for pin in range(0, 1000):
    pin = str(pin).zfill(3)

    if s.find(pin[0]) == -1:
        continue
    s1 = s[s.find(pin[0]) + 1:]
    if s1.find(pin[1]) == -1:
        continue
    s2 = s1[s1.find(pin[1]) + 1:]
    if s2.find(pin[2]) == -1:
        continue
    
    count += 1

print(count)
    

Measured memory_bytes: 42608
#include<iostream>
#include<stdio.h>
#include<string>
#include<vector>
#include <cmath>
#define rep(i,n) for (int i=0;i<n;i++)
//#include <bits/stdc++.h>
using namespace std;
//void narabekae(string s[]){
    
//}


int main(){
    int N,K,C;
    cin>>N>>K>>C;
    string S;
    cin>>S;
    //for (int i=0;i<N;i++) cin>>S[i];
    vector<int> v;
    int j=0,k=0;
    while(k<K&&j<N){
        if (S[j]=='o'){
            //cout<<j<<" ";
            v.push_back(j);
            j+=C+1;
            k+=1;
        }
        else j+=1;
    }
    vector<int> w;
    j=N-1;
    k=0;
    while(k<K&&j>=0){
        if (S[j]=='o'){
            //cout<<j<<" ";
            w.push_back(j);
            j-=C+1;
            k+=1;
        }
        else j-=1;
    }
    rep(i,K){
        if (v[i]==w[K-1-i]) cout<<v[i]+1<<endl;
    }
    return 0;
}

Measured memory_bytes: 5736
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <climits>
#include <queue>

using namespace std;

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int main(){
  int H, W = 5;
  while(cin >> H, H){
	int bl[12][5];
	fill((int*)bl, (int*)bl+12*5, -1);
	REP(i,H) REP(j,W) cin >> bl[i][j];
	bool updated = true;
	int ans = 0;
	while(updated){
	  updated = false;
	  REP(y,H){
		int prv = -1, cnt = 0;
		REP(x,W){
		  if(bl[y][x] != prv){
			if(cnt >= 3){
			  FOR(dx,1,cnt+1)
				bl[y][x-dx] = 0;
			  ans += prv * cnt;
			}
			prv = bl[y][x];
			cnt = 1;
		  }
		  else ++cnt;
		}

		if(cnt >= 3){
		  FOR(dx,1,cnt+1)
			bl[y][W-dx] = 0;
		  ans += prv * cnt;
		}
	  }

	  for(int y=H-1;y>=0;--y){
		REP(x,W){
		  if(bl[y][x] == 0) continue;
		  int ty = y+1;
		  while(bl[ty][x] == 0) ++ty;
		  --ty;
		  if(y != ty){
			bl[ty][x] = bl[y][x];
			bl[y][x] = 0;
			updated = true;
		  }
		}
	  }
	}
	cout << ans << endl;
  }
  
  return 0;
}

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

int linearSearch(int key,int p, vector<int> S) {
    int cnt = 0;
    while(key != S.at(cnt)) {
        cnt++;
        if(cnt == p) return 0;
    }
    return 1;
}

int main() {
    int p;
    cin >> p;
    vector<int> S(p+1);
    rep(i, p) cin >> S.at(i);
    int q;
    cin >> q;
    vector<int> T(q);
    rep(i, q) cin >> T.at(i);

    int ans = 0;
    int key;
    rep(i, q) {
        key = T.at(i);
        S.at(p) = key;
        ans += linearSearch(key, p, S);
    }

    cout << ans << endl;


    return 0;
}


Measured memory_bytes: 3132
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
  let s: Vec<char> = read::<String>().chars().collect();
  let t: Vec<char> = read::<String>().chars().collect();

  let mut maxV: usize;
  maxV = 0;
  for i in 0..(s.len() - t.len()) + 1{
  	let mut sum = 0;
    for n in 0 ..t.len(){
    	if t[n] == s[i +n]  {sum += 1;}
    }
    if sum > maxV {maxV = sum;}
  }
  	
  let ans = t.len() - maxV;
  println!("{}", ans);
}

Measured memory_bytes: 2088
N = int(input())

if N <= 111:
    print(111)
elif N <= 222:
    print(222)
elif N <= 333:
    print(333)
elif N <= 444:
    print(444)
elif N <= 555:
    print(555)
elif N <= 666:
    print(666)
elif N <= 777:
    print(777)
elif N <= 888:
    print(888)
elif N <= 999:
    print(999)
else:
    print(1111)


Measured memory_bytes: 38256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define mod 1000000007
#define LIM 100005
#define IOS ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endl '\n'
#define vi vector <int>
#define pb push_back
#define sz(x) x.size()
#define all(x) x.begin(), x.end()
int calc(int a[], int n, int k)
{
    sort(a, a + n);
    int pp = 1;
    if (a[n - 1] == 0 && (k & 1))
        return 0;
    if (a[n - 1] <= 0 && (k & 1)) {
        for (int i = n - 1; i >= n - k; i--)
            {pp *= a[i]; pp%=mod;}
        return pp%mod;
    }

    int i = 0;
    int j = n - 1;
    if (k & 1) {
        pp *= a[j];
        pp%=mod;
        j--;
        k--;
    }
    k=k/2;
    for (int ii = 0; ii < k; ii++) {
        int left_pp = a[i] * a[i + 1];
        int right_pp = a[j] * a[j - 1];
        if (left_pp > right_pp) {
            pp *= a[i];
            pp%=mod;
            pp*=a[i+1];
            pp%=mod;
            i += 2;
        }
        else {
          pp *= a[j];
          pp%=mod;
          pp*=a[j-1];
          pp%=mod;
            j -= 2;
        }
        pp= pp%mod;
    }
    return pp%mod;
}

int32_t main()
{
  IOS;
  int t,x,y,k,n,i,j;
  cin>>n>>k;
  int a[n];
  for(i=0;i<n;i++)cin>>a[i];
  t=calc(a,n,k);
  while(t<0)t+=mod;
  cout<<t;
}


Measured memory_bytes: 5176
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n;
int h[100100];
int dp[100100];

int solve() {
    fill_n(dp, n, inf);
    dp[0] = 0;
    for (int i = 0; i < n-1; i++) {
        dp[i+1] = min(dp[i+1], dp[i] + abs(h[i]-h[i+1]));
        dp[i+2] = min(dp[i+2], dp[i] + abs(h[i]-h[i+2]));
    }
    return dp[n-1];
}

void input() {
    cin >> n;
    for (int i = 0; i < n; i++) cin >> h[i];
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    cout << solve() << endl;
}


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

int main(int argc, char *argv[])
{
    int a, b, c, d;
	int ret = 0;
	cin >> a >> b >> c >> d;

	if (a < b) {
		ret += a;
	} else {
		ret += b;
	}

	if (c < d) {
		ret += c;
	} else {
		ret += d;
	}
	cout << ret;
	
	return 0;
}


Measured memory_bytes: 256
from collections import deque

H, W = map(int, input().split())
Ch, Cw = map(int, input().split())
Dh, Dw = map(int, input().split())
Ch, Cw, Dh, Dw = Ch-1, Cw-1, Dh-1, Dw-1

maze = [list(input()) for _ in range(H)]
visit = [[-1] * W for _ in range(H)]
visit[Ch][Cw] = 0

DQ = deque([(Ch, Cw)])
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

while DQ:
    px, py = DQ.popleft()
    if (px, py) == (Dh, Dw):
        print(visit[px][py])
        exit()

    for i in range(4):
        nx = px + dx[i]
        ny = py + dy[i]
        if 0<=nx<=H-1 and 0<=ny<=W-1 and maze[nx][ny]=="." and (visit[nx][ny]>visit[px][py] or visit[nx][ny]==-1):
            visit[nx][ny] = visit[px][py]
            DQ.appendleft((nx, ny))

    for i in range(-2, 3):
        for j in range(-2, 3):
            if i == j == 0:
                continue

            nx = px + i
            ny = py + j

            if 0<=nx<=H-1 and 0<=ny<=W-1 and maze[nx][ny]=="." and visit[nx][ny]==-1:
                visit[nx][ny] = visit[px][py] + 1
                DQ.append((nx, ny))

    # for a in visit:
    #     print(a)

print(-1)

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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

int main()
{
    char c;
    cin >> c;

    string s = "aiueo";

    cout << (s.find(c) == -1 ? "consonant" : "vowel") << '\n';
    return 0;
}


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

namespace ABC087A
{
    class Program
    {
        static void Main(string[] args)
        {
            int x, a, b, c;

            x = int.Parse(Console.ReadLine());
            a = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());

            c = (x - a) % b;

            Console.WriteLine(c);

            Console.ReadKey();

        }
    }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll M = 1e9 + 7;
ll n,c[60];
int main()
{
    cin >> n;
    for (ll i = 0; i < n; ++i) {
        ll a;
        cin >> a;
        for (int j = 0; j < 60; ++j)
            if (a >> j & 1)
                c[j]++;
    }
    ll ans = 0;
    ll p = 1;
    for (int i = 0; i < 60; ++i,  p = 2 * p % M)
        ans += c[i] * (n - c[i]) % M * p % M;
    cout << ans % M << endl;
}


Measured memory_bytes: 256
N = int(input())

list_p = []

for i in range(N):
    list_p.append(int(input()))

sum_p = 0
cnt = 0
for i in list_p:
    if i == max(list_p):
        if cnt == 0:
            sum_p += int(i / 2)
            cnt += 1
        else:
            sum_p += i
    else:
        sum_p += i
print(int(sum_p))

Measured memory_bytes: 3064
using System;
using System.Text.RegularExpressions;

namespace CitySavers
{
    class Program
    {
        static void Main(string[] args)
        {
            int Savernum = Convert.ToInt32(Console.ReadLine());
            Double[] CityMonster = new Double[Savernum + 1];
            Double[] Saver = new Double[Savernum];
            int tmpnum = 0;
            foreach (string x in Regex.Split(Console.ReadLine(), @"\s+"))
            {
                CityMonster[tmpnum] = Convert.ToDouble(x);
                tmpnum += 1;
            }
            tmpnum = 0;
            foreach (string x in Regex.Split(Console.ReadLine(), @"\s+"))
            {
                Saver[tmpnum] = Convert.ToDouble(x);
                tmpnum += 1;
            }
            Double destroy = 0;
            for(int i = 0; i<Savernum; i++)
            {
                destroyMons(ref destroy, ref CityMonster, Saver, i);
            }
            Console.WriteLine(destroy);
        }

        public static void destroyMons(ref Double destroy,ref Double[] CityMonster,Double[] Saver,int num)
        {
            Double saver = Saver[num];
            Double sum = CityMonster[num] + CityMonster[num + 1];

            if (saver >= sum)
            {
                destroy += sum;
                CityMonster[num] = 0;
                CityMonster[num + 1] = 0;
            }
            else
            {
                destroy += saver;
                Double tmpnum = CityMonster[num] - saver;
                if (tmpnum < 0)
                {
                    CityMonster[num] = 0;
                    CityMonster[num + 1] += tmpnum;
                }
                else
                {
                    CityMonster[num] = tmpnum;
                }
                
            }
        }
    }
}


Measured memory_bytes: 36536
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
#define ld long double

using namespace std;
ll n, t, sum, mx, mn, m, k = 1, a;

void solve(){
	cin >> n >> a;
	mn = a;
	for(int i = 1; i < n; i++){
		cin >> a;
		if(mn >= a){
			k++;
			mn = a;
		}
	}
	cout << k;
}

int main()
{
	t = 1;
//	cin >> t;
	while(t--){
		solve();
	}
}

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

int main () {
  long long N , M ;
  cin >> N >> M ;
  vector<P> line ;
  for(long long i = 0 ; i < N ; i++ ){
    long long a , b ;
    cin >> a >> b ;
    line.push_back(P(a,b)) ;
  }
  sort(line.begin() , line.end()) ;
  reverse(line.begin() , line.end()) ;
  long long ans = 0 ;
  while(true){
    P pre = line.back() ;
    line.pop_back() ;
    
    if(pre.second > M ) {
      ans += pre.first * M ;
      break ;
    } else {
      ans += pre.first * pre.second ;
      M -= pre.second ;
    }
  }
  cout << ans << endl ;
}

Measured memory_bytes: 2420
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int n, k;
long long int w[100000];
int check(long long int mid) {
  int i = 0;
  for(int j = 0; j < k; j++) {
    long long int s = 0;
    while(s + w[i] <= mid) {
      s += w[i];
      if(++i == n) return n;
    }
  }
  return i;
}
int solve() {
  long long left = 0, right = 100000 * 10000, mid;
  while(1 + left < right){
    mid = (left + right) / 2;
    if(n <= check(mid)) right = mid;
    else left = mid;
  }
  return right;
}
int main() {
  cin>>n>>k;
  for(int i = 0; i < n; i++) scanf("%lld",&w[i]);
  cout<< solve() <<endl;
  return 0;
}



Measured memory_bytes: 4000
<?php
$N = (int)trim(fgets(STDIN));
$input = trim(fgets(STDIN));
$A = explode(" ", $input);
$n = 0;

foreach ($A as $value){
    $value = (int)$value;
    if ($value%2 == 0){
        if (($value%3 != 0)and($value%5 != 0)){
            $n = print 'DENIED';
            break;
        }
    }
}

if ($n === 0){
    print 'APPROVED';
}
?>

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

// 型定義
typedef long long ll;
typedef pair<ll, ll> P;

// forループ
#define REP(i,n) for(ll i=0; i<(ll)(n); ++i)

// 定数宣言
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

// グラフ表現
using Graph = vector<vector<int>>;

// グラフの辺表現
using Edge = map<pair<int,int>,int>;

// n次元配列の初期化。第２引数の型のサイズごとに初期化していく。
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

// 最大公約数
ll gcd(ll a,ll b){
   if (a%b == 0) return(b);
   else return(gcd(b, a%b));
}

// 最小公倍数
ll lcm(ll a, ll b){
    return a/gcd(a, b) * b;
}

int main()
{
    cout << fixed << setprecision(15);
    ll N;
    cin >> N;

    deque<ll> deq;

    REP(i, N){
        ll a;
        cin >> a;
        if(i%2 == 0){
            deq.push_back(a);
        }
        else{
            deq.push_front(a);
        }
    }

    if(N%2==0){
        while(!deq.empty()){
            cout << deq.front() << " ";
            deq.pop_front();
        }
        cout << endl;
    }
    else{
        while(!deq.empty()){
            cout << deq.back() << " ";
            deq.pop_back();
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 5276
#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};

#[allow(unused_imports)]
use std::io::Write;

pub struct Scanner<R> {
    reader: R,
}
impl<R: std::io::Read> Scanner<R> {
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf: String = self
            .reader
            .by_ref()
            .bytes()
            .map(|b| b.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect();
        buf.parse::<T>().ok().expect("Parse error.")
    }
    pub fn read_vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}

fn rec(flags: &mut Vec<bool>, cur: usize, ps: &Vec<usize>, ss: &Vec<Vec<usize>>, ans: &mut usize) {
    if cur == flags.len() {
        let mut ok = true;
        for i in 0..ps.len() {
            let mut on = 0;
            for &s in ss[i].iter() {
                if flags[s-1] {
                    on += 1;
                }
            }
            if on%2 != ps[i] {
                ok = false;
                break;
            }
        }
        if ok {
            *ans += 1;
        }
        return
    }

    flags[cur] = true;
    rec(flags, cur+1, ps, ss, ans);
    flags[cur] = false;
    rec(flags, cur+1, ps, ss, ans);
}


fn main() {
    let stdin = std::io::stdin();
    let mut sc = Scanner { reader: stdin.lock() };

    let n: usize = sc.read();
    let m: usize = sc.read();

    let mut ss = vec![];
    for _ in 0..m {
        let k: usize = sc.read();
        let s: Vec<usize> = sc.read_vec(k);
        ss.push(s);
    }
    let ps: Vec<usize> = sc.read_vec(m);
    let mut flags = vec![false; n];
    let mut ans = 0;
    rec(&mut flags, 0, &ps, &ss, &mut ans);
    println!("{}", ans);
}


Measured memory_bytes: 4352
from itertools import combinations
import math
from functools import reduce

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

n = int(input())

total = 0
for i in range(1, n+1):
    for j in range(i, n+1):
        for k in range(j, n+1):
            if  i == j and j == k and i == k:
                x = 1
            elif i != j and j != k and i != k:
                x = 6
            else:
                x = 3
            
            total += x * gcd_list([i, j, k])
        
print(total)

Measured memory_bytes: 9596
import sys
import numpy as np

read = sys.stdin.read

N, *A = map(int, read().split())
a = np.array(A, np.int64)
mod = 10 ** 9 + 7
answer = 0
for i in range(60):
    bit = np.count_nonzero(a & 1)
    answer += 2 ** i * bit * (N - bit)
    answer %= mod
    a >>= 1

print(answer)

Measured memory_bytes: 49944
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <climits>
#include <vector>
#include <map>
#include <set>
#include <list>
#include <stack>
#include <queue>
#include <algorithm>
#include <iostream>
#include <string>

#define REP(i,n) for(long long i=0;i<n;++i)
#define REPR(i,n) for(long long i=n;i>=0;--i)
#define REPI(itr,v) for(auto itr=v.begin();itr!=v.end();++itr)
#define REPIR(itr,v) for(auto itr=v.rbegin();itr!=v.rend();++itr)
#define FOR(i,a,b) for(long long i=a;i<b;++i)
#define SORT(v,n) sort(v, v+n)
#define SORTV(v) sort(v.begin(), v.end())
#define ALL(v) v.begin(),v.end()
#define llong long long
#define INF 999999999
#define MOD 1000000007
#define pb push_back
#define pf push_front
#define MP make_pair
#define SV(v) {for(long long sitr=0;sitr<v.size();++sitr){cin>>v[sitr];}}

int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

using namespace std;

typedef pair<int,int> pii;

int MAX = 1;
int w;

void solve(string s, int level, int sum){
  
  if(sum == 0){
    int len = s.length();
    for(int i = len - 1; i >= 0; --i){
      cout << s[i];
    }
    cout << endl;
    return;
  }
  if(level == MAX + 1) return;

  //減らす
  solve(s + "+", level + 1, sum - pow(3,level));
  //そのまま
  solve(s + "0", level + 1, sum);
  //増やす
  solve(s + "-", level + 1, sum + pow(3, level));

}

int main(){

  cin >> w;

  int sum = 3;
  while(true){
    if(sum >= 2 * w + 1) break;
    MAX++;
    sum *= 3;
  }

  solve("", 0, w);


  return 0;
}




Measured memory_bytes: 3352
#include<bits/stdc++.h>
using namespace std;
#define MN 100000
int a[MN+5],f[MN+5];
map<int,int> mp[MN+5];
int gf(int k){return f[k]?f[k]=gf(f[k]):k;}
int main()
{
	int n,m,i,x,y,ans=0;
	scanf("%d%d",&n,&m);
	for(i=1;i<=n;++i)scanf("%d",&a[i]);
	while(m--)scanf("%d%d",&x,&y),gf(x)!=gf(y)?f[gf(x)]=gf(y):0;
	for(i=1;i<=n;++i)mp[gf(i)][a[i]]=1;
	for(i=1;i<=n;++i)ans+=mp[gf(i)][i];
	printf("%d",ans);
}

Measured memory_bytes: 15104
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  cin>>n;
  vector<int> v(n);
  set<int> st;
  for(int i=0;i<n;i++) {
    cin>>v[i];
    st.insert(v[i]);
  }
  cout<<st.size()<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <map>
#include <numeric>
#include <iomanip>

int main(void) {
	long long n;

	std::cin >> n;

	long long sum = 0;

	long long tmp = n;

	while (tmp != 0) {
		sum += tmp % 10;
		tmp /= 10;
	}

	if (n % sum == 0) {
		std::cout << "Yes" << std::endl;
	}
	else {
		std::cout << "No" << std::endl;
	}

	return 0;
}

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

class MainClass
{
    static void Main()
    {
        var r = Array.ConvertAll(Console.ReadLine().Split(), int.Parse);
        int N = r[0], K = r[1];
        int R = N - K;int B = K;
        for (int i = 0; i < K; i++)
        {
            //i は Bの分割の個数
            var b = Modular.Ncr(B - 1, i);
            int ans = (int)(Modular.Ncr(R + 1, i + 1) * b);
            Console.WriteLine(ans);
        }
    }
}
class Modular  //Modしながら計算するクラス
{
    private const int M = 1000000007;
    private long value;
    public Modular(long value) { this.value = value; }
    public static implicit operator Modular(long a)
    {
        var m = a % M;
        return new Modular((m < 0) ? m + M : m);
    }
    public static Modular operator +(Modular a, Modular b)
    {
        return a.value + b.value;
    }
    public static Modular operator -(Modular a, Modular b)
    {
        return a.value - b.value;
    }
    public static Modular operator *(Modular a, Modular b)
    {
        return a.value * b.value;
    }
    public static Modular Pow(Modular a, int n)
    {
        switch (n)
        {
            case 0:
                return 1;
            case 1:
                return a;
            default:
                var p = Pow(a, n / 2);
                return p * p * Pow(a, n % 2);
        }
    }
    public static Modular operator /(Modular a, Modular b)
    {
        return a * Pow(b, M - 2);
    }
    private static readonly List<int> facs = new List<int> { 1 };
    public static Modular Fac(int n)   //階乗
    {
        for (int i = facs.Count; i <= n; ++i)
        {
            facs.Add((int)(Math.BigMul(facs.Last(), i) % M));
        }
        return facs[n];
    }
    public static Modular Fac(int r, int n)
    {
        int temp = 1;
        for (int i = r; i <= n; i++)
        {
            temp = (int)(Math.BigMul(temp, i) % M);
        }
        return temp;
    }
    public static Modular Ncr(int n, int r) //nCr
    {
        return (n < r) ? 0
             : (n == r) ? 1
                        : (n < 1000000) ? Fac(n) / (Fac(r) * Fac(n - r))
                            : Fac(n - r + 1, n) / Fac(r);
    }
    public static explicit operator int(Modular a)
    {
        return (int)a.value;
    }
}

Measured memory_bytes: 13268
#include <cstdio>
#include <iostream>
#include <string>

using namespace std;

int main(){
	string s;
	int before,after;
	int cup[3]={1,0,0};
	while(cin >> s){
		if(s[0] == 'A'){
			before = 0;
		}else if(s[0] == 'B'){
			before = 1;
		}else if(s[0] == 'C'){
			before = 2;
		}

		if(s[2] == 'A'){
			after = 0;
		}else if(s[2] == 'B'){
			after = 1;
		}else if(s[2] == 'C'){
			after = 2;
		}

		swap(cup[before],cup[after]);
	}

	if(cup[0] == 1){
		cout << "A" << endl;
	}else if(cup[1] == 1){
		cout << "B" << endl;
	}else{
		cout << "C" << endl;
	}
}

Measured memory_bytes: 3152
#include<cstdio>
#include<algorithm>
using namespace std;
long long b, e, w[101000];
int K;
int main() {
	int i;
	scanf("%d", &K);
	for (i = 1; i <= K; i++)scanf("%lld", &w[i]);
	b = e = 2;
	for (i = K; i >= 1; i--) {
		long long t1 = (b + w[i] - 1) / w[i], t2 = e / w[i];
		if (t1 > t2) {
			printf("-1\n");
			return 0;
		}
		b = t1*w[i], e = (t2 + 1)*w[i] - 1;
	}
	printf("%lld %lld\n", b, e);
}


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

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		ArrayList<String> list = new ArrayList<>();
		for(int i = 0; i < N; i++) {
			list.add(sc.next());
		}
		sc.close();

		int countAC = 0;
		int countWA = 0;
		int countTLE = 0;
		int countRE = 0;

		for(int i = 0; i < list.size(); i++) {
			String tmp = list.get(i);
			if(tmp.equals("AC")) {
				countAC++;
			}else if(tmp.equals("WA")) {
				countWA++;
			}else if(tmp.equals("TLE")) {
				countTLE++;
			}else if(tmp.equals("RE")) {
				countRE++;
			}
		}

		System.out.println("AC x " + countAC);
		System.out.println("WA x " + countWA);
		System.out.println("TLE x " + countTLE);
		System.out.println("RE x " + countRE);

	}

}

Measured memory_bytes: 63520
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int main(void){
	int n, m;
	int s, t;
	int x, y, z;
	long long ans;


	scanf("%d %d", &n,&y);
	z = 0;
	ans = 1;
	for (int i = 0; i < n; i++){
		scanf("%d", &x);
		if (x % 2 == 1)z = 1;
		ans = ans * 2;
	}
	if (z == 0){
		if (y == 0)printf("%lld\n", ans);
		else printf("0\n");
	}
	else printf("%lld\n", ans/2);

	return 0;
}


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


int main() {
	string S;
	cin >> S;

	int counter = 0;

	for (int i = 0; i < 3; ++i){
		if (S.at(i) == 'o') ++counter;
	}

	cout << 700 + 100 * counter << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<numeric>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<list>
#include<bitset>
#include<sstream>
using namespace std;

int main() {

	long long  K, A, B;
	cin >> K >> A >> B;

	long long ans = 1;
	if (A >= B) {
		cout << K + 1 << endl;
	}
	else {
		for (long long i = 1; i <= K; i++) {
			if (ans < A) {
				ans += 1;
			}
			else if (A <= ans && i < K) {
				ans += B - A;
				i++;
			}
			else if (i == K) {
				ans += 1;
			}
		}
		cout << max(ans, K + 1) << endl;
	}


	return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define P(x) cout << (x) << endl
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i));
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
typedef long long ll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
constexpr int MAX = 100;
enum Color { WHITE = 0, GRAY, BLACK };
int n;
vv(int, M, MAX, MAX, INT_MAX);
inline void dijkstra() {
    vi d(MAX, INT_MAX), color(MAX, WHITE);
    d[0] = 0;
    color[0] = GRAY;
    int minv, u;
    while(true) {
        minv = INT_MAX;
        u = -1;
        rep(i, 0, n) {
            if(minv > d[i] && color[i] != BLACK) {
                u = i;
                minv = d[i];
            }
        }
        if(u == -1) break;
        color[u] = BLACK;
        rep(v, 0, n) {
            if(color[v] != BLACK && M[u][v] != INT_MAX && d[v] > d[u] + M[u][v]) {
                d[v] = d[u] + M[u][v];
                color[v] = GRAY;
            }
        }
    }
    rep(i, 0, n) {
        cout << i << " " << d[i] << "\n";
    }
}
int main() {
    cin >> n;
    int u, k, v, c;
    rep(i, 0, n) {
        cin >> u >> k;
        rep(j, 0, k) {
            cin >> v >> c;
            M[u][v] = c;
        }
    }
    dijkstra();
    return 0;
}

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

int p[100001];

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

  int N; cin >> N;
  for(int i = 1; i <= N; i++){
    cin >> p[i];
  }

  int cnt = 0;
  for(int i = 1; i <= N; i++){
    if(p[i] == i){
      swap(p[i],p[i+1]);
      cnt++;
    }
  }
  cout << cnt << endl;

  return 0;
}


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

int top, s[1000];

void push(int x)
{
    top++;
    s[top] = x;
}

int pop()
{
    top--;
    return s[top + 1];
}

int main()
{
    int a, b;
    top = 0;
    char inputstring[100];

    while (scanf("%s", inputstring) != EOF)
    {
        if (inputstring[0] == '+')
        {
            a = pop();
            b = pop();
            push(a + b);
        } else if (inputstring[0] == '-')
        {
            b = pop();
            a = pop();
            push(a - b);
        } else if (inputstring[0] == '*')
        {
            a = pop();
            b = pop();
            push(a * b);
        } else
        {
            push(atoi(inputstring));
        }
    }
    
    printf("%d\n", pop());
    return 0;
}


Measured memory_bytes: 2076
#include <stdio.h>
 
int gcd(int p,int q){
if(p>q){
if(p%q==0){return q;}
return gcd(q,p%q);
}else{
if(q%p==0){return p;}
return gcd(p,q%p);
}
}

int main(void){
    int num;
    long long int sum=0;
    scanf("%d", &num);
    
for(int i=1;i-1<num;i++){
    for(int j=1;j-1<num;j++){
        for(int k=1;k-1<num;k++){
            if(i!=1 & j!=1 & k !=1){
                sum+=gcd(gcd(i,j),k);
            }else{
                sum++;
            }
        }
    }
}        
    printf("%lld",sum);
    return 0;
}

Measured memory_bytes: 1704
#define ENABLE_DEBUG 0
// Kana's kitchen {{{
#include<bits/stdc++.h>
#define ALL(v) std::begin(v),std::end(v)
#define LOOP(k) for(i64 ngtkana_is_a_genius=0; ngtkana_is_a_genius<(i64)k; ngtkana_is_a_genius++)

using i32 = std::int_least32_t;
using i64 = std::int_least64_t;
using u32 = std::uint_least32_t;
using u64 = std::uint_least64_t;
using usize = std::size_t;

template <class T> using vec = std::vector<T>;
template <class T> using numr = std::numeric_limits<T>;

#ifdef NGTKANA
#include<debug.hpp>
#else
#define DEBUG(...)(void)0
#endif
/*}}}*/
template <
    usize N, class T, class... Args,
  std::enable_if_t<N==0, int> = 0
>
auto mkvec(Args... args) {
  return T(args...);
}

template <
    usize N, class T, class... Args,
    std::enable_if_t<N!=0, int> = 0
>
auto mkvec(usize sz, Args... args) {
  using value_type = std::decay_t<decltype(mkvec<N-1, T>(args...))>;
  return vec<value_type>(sz, value_type(args...));
}
auto cmn=[](auto&x,auto y){if(x>y){x=y;return true;}return false;};
int main(){
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::setprecision(15) << std::fixed;

    usize h, w, k;
    std::cin >> h >> w >> k;
    auto ckd = mkvec<2, usize>(h, w);
    usize si=-1, sj=-1;
    for (usize i=0; i<h; i++) for (usize j=0; j<w; j++) {
        char c;
        std::cin >> c;
        if (c=='S') {
            si = i;
            sj = j;
        }
        ckd.at(i).at(j) = c=='#';
    }
    DEBUG(matrix_style(ckd));

    vec<std::pair<i32, i32>> didj = {
        {1,0},
        {-1,0},
        {0, 1},
        {0, -1}
    };

    i32 inf = numr<i32>::max();
    auto dist = mkvec<2, i32>(h, w, inf);
    dist.at(si).at(sj) = 0;
    vec<std::pair<i32, i32>> que = {{si, sj}};
    for (usize t=0; t<que.size(); t++) {
        i32 i, j;
        std::tie(i, j) = que.at(t);
        DEBUG(i,j);
        for (usize k=0; k<4; k++) {
            i32 di, dj;
            std::tie(di, dj) = didj.at(k);
            i32 ni = i + di;
            i32 nj = j + dj;
            DEBUG(ni, nj);

            if (0<=ni && ni<h && 0<=nj && nj<w && !ckd.at(ni).at(nj)) {
            DEBUG(ni, nj);
                ckd.at(ni).at(nj) = true;
                dist.at(ni).at(nj) = dist.at(i).at(j) + 1;
                que.emplace_back(ni, nj);
            }
        }
    }
    DEBUG(matrix_style(skipinf(dist, inf)));

    usize ans = h + w;
    for (usize i=0; i<h; i++) for (usize j=0; j<w; j++) {
        if (dist.at(i).at(j) <= k) {
            DEBUG(i,j);
            for (usize d: {i, j, h-1-i, w-1-j}){
                cmn(ans, 1 + (d + k-1)/k);
            }
        }
    }
    std::cout << ans << '\n';
}


Measured memory_bytes: 18028
using System;
using System.Collections.Generic;

namespace Project
{
	class MainClass
	{
		public static int count = 0;
		public static void Main(string[] args)
		{
			int n = int.Parse(Console.ReadLine());
			string[] s = Console.ReadLine().Split(' ');
			int[] S = new int[n];
			for (int i = 0; i < n; i++)
			{
				S[i] = int.Parse(s[i]);
			}
			mergeSort(S, 0, n);
			Console.WriteLine(string.Join(" ",Array.ConvertAll(S, str => str.ToString())));
			Console.WriteLine(count);

		}

		public static void mergeSort(int[] A, int left, int right)
		{
			if (left + 1 < right)
			{
				int mid = (left + right) / 2;
				mergeSort(A, left, mid);
				mergeSort(A, mid, right);
				merge(A, left, mid, right);

			}
		}
		public static void merge(int[] A, int left, int mid, int right)
		{
			int n1 = mid - left;
			int n2 = right - mid;
			int[] L = new int[n1 + 1];
			int[] R = new int[n2 + 1];
			for (int p = 0; p < n1; p++)
			{
				L[p] = A[left + p];
			}
			for (int p = 0; p < n2; p++)
			{
				R[p] = A[mid + p];
			}
			L[n1] = int.MaxValue;
			R[n2] = int.MaxValue;
			int i = 0;
			int j = 0;
			for (int k = left; k < right; k++)
			{
				if (L[i] <= R[j])
				{
					A[k] = L[i];
					i++;
				}
				else
				{
					A[k] = R[j];
					j++;
				}
				count++;
			}
		}
	}
}

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

int N;
int T[100010], A[100010];

int main() {
	int i, max = 0, maxMt = 0;
	ios_base::sync_with_stdio(0);

	cin >> N;
	for (i = 0; i < N; i++) {
		cin >> T[i];
		if (T[i] > max) {
			max = T[i];
			maxMt = i;
		}
	}

	for (i = 0; i < N; i++) {
		cin >> A[i];
	}

	int maxA = 0;
	int maxMtA = 0;
	for (i = N - 1; i >= 0; i--) {
		if (maxA < A[i]) {
			maxA = A[i];
			maxMtA = i;
		}
	}
	if (maxMt > maxMtA) {
		cout << 0;
		return 0;
	}

	if (maxA != max) {
		cout << 0;
		return 0;
	}


	for (i = 0; i < maxMt; i++) {
		if (A[i] < T[i]){
			cout << 0;
			return 0;
		}
	}

	for (i = N-1; i >= maxMtA; i--) {
		if (A[i] > T[i]) {
			cout << 0;
			return 0;
		}
	}


	long long sum = 1;

	max = 0;
	for (i = 0; i < maxMt; i++) {
		if (max < T[i]) {
			max = T[i];
		}
		else
			sum *= T[i];
		sum %= 1000000007;
	}

	max = 0;
	for (i = N - 1; i > maxMt; i--) {
		if (max < A[i]) {
			max = A[i];
		}
		else
			sum *= A[i];
		sum %= 1000000007;
	}

	cout << (sum % 1000000007) << endl;
	
	system("pause");
	return 0;
}

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

int main() {
	int N, ans = 0;
	cin >> N;
	vector<int> P(N), a(N);
	for (int& i : P) cin >> i;
	a.front() = P.front();
	for (int i = 1; i < N; i++) a[i] = min(P[i], a[i - 1]);
	for (int i = 0; i < N; i++) {
		if (P[i] <= a[i]) ans++;
	}
	cout << ans << endl;
}

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

const int MAXN = 100010;

inline int read() {
	int x = 0, f = 1;
	char ch = getchar();
	for(; !isdigit(ch); ch = getchar()) if(ch=='-') f=-1;
	for(; isdigit(ch); ch = getchar()) x = (x*10)+(ch^48);
	return x * f;
}

int e, st[MAXN], to[MAXN<<1];
int nxt[MAXN<<1], l[MAXN][20];
inline void Add(int u, int v) {
	to[++e] = v, nxt[e] = st[u];
	st[u] = e;
}

int n, ans;

void dfs(int u, int fa) {
	int i, j;
	for(i = st[u]; i; i = nxt[i]) {
		int v = to[i];
		if(v == fa) continue;
		dfs(v, u);
		for(j = 0; j < 20; j++) l[u][j] += l[v][j];
	}
	int loc = -1;
	for(j = 0; j < 20; j++) if(l[u][j] >= 2) loc = j;
	for(j = loc+1; j < 20; j++) if(!l[u][j]) break;
	loc = j;
	ans = max(ans, loc);
	l[u][loc] = 1;
	for(j = 0; j < loc; j++) l[u][j] = 0;
}

int main() {

	int i;

	n = read();
	for(i = 1; i < n; i++) {
		int u = read(), v = read();
		Add(u, v), Add(v, u);
	}

	dfs(1, 0);

	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 15744
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, n) for(int i = 1; i < n; i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define P pair<int, int>
typedef long long ll;
const ll mod = 1e9+7;

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

//繰り返し自乗法による累乗計算
//a**n
ll pow(ll a, ll n){
  if(n == 0) return 1;
  if(n%2 == 0){
    ll res = pow(a, n/2);
    return res * res;
  }
  return a * pow(a, n-1);
}
//繰り返し自乗法によるmod累乗計算
//a**n (mod)
ll modpow(ll a, ll n){
  if(n == 0) return 1;
  if(n%2 == 0){
    ll res = modpow(a, n/2);
    return res * res % mod;
  }
  return a * modpow(a, n-1) % mod;
}
//組み合わせ
//nCa
ll com(ll n, ll a){
  ll x = 1, y = 1;
  rep(i,a){
    x *= n-i;
    y *= i+1;
  }
  ll res = x / y;
  return res;
}
//組み合わせ(mod)
//nCa (mod)
ll modcom(ll n, ll a){
  ll x = 1, y = 1;
  rep(i, a){
    x = x * (n-i) % mod;
    y = y * (i+1) % mod;
  }
  ll ans = x * modpow(y, mod-2) % mod;
  return ans;
}
//gcd 最大公約数
ll gcd(ll x, ll y){
  if(x % y == 0) return y;
  return gcd(y, x%y);
}
//lcm 最小公倍数
ll lcm(ll x, ll y){
  return x * y / gcd(x, y);
}
//ngcd n個の最大公約数
ll ngcd(vector<ll> a){
  ll res;
  res = a[0];
  for(ll i = 1; i < a.size() && res != 1; i++) {
    res = gcd(a[i], res);
  }
  return res;
}
//nlcm n個の最小公倍数
ll nlcm(vector<ll> a) {
  ll res;
  res = a[0];
  for (ll i = 1; i < a.size(); i++) {
    res = lcm(res, a[i]);
  }
  return res;
}
// 素数判定
bool isprime(ll x){
  ll i;
  if(x < 2) return false;
  else if(x == 2) return true;
  if(x % 2 == 0) return false;
  for(i = 3; i*i <= x; i += 2){
    if(x % i == 0) return false;
  }
  return true;
}
// 桁和
ll digsum(ll x){
  ll res = 0;
  while(x > 0){
    res += x % 10;
    x /= 10;
  }
  return res;
}


int main(){
  string a, b, c;
  cin >> a >> b >> c;
  char A = a[0]-'a'+'A';
  char B = b[0]-'a'+'A';
  char C = c[0]-'a'+'A';
  cout << A << B << C << endl;
} 






Measured memory_bytes: 256
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = sc.nextInt() - 1;
		}
		sc.close();

		Set<Integer> set = new HashSet<>();
		set.add(0);
		int i = 0;
		int ans = 0;
		while (true) {
			int j = a[i];
			ans++;
			if (j == 1) {
				System.out.println(ans);
				return;
			}
			if (!set.add(j)) {
				System.out.println(-1);
				return;
			}
			i = j;
		}
	}
}


Measured memory_bytes: 51828
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <queue>
#include <cmath>
using namespace std;
const int maxn=100;
int a,b,k;
int c,cnt;
int ans[maxn];
int main()
{
    while(~scanf("%d%d%d",&a,&b,&k))
    {
        memset(ans,0,sizeof ans);
        a<b?c=a:c=b;//printf("c=%d\n",c);
        cnt=0;
       for(int i=c;i>=1;i--)
       {
           if(a%i==0&&b%i==0){ans[cnt]=i;cnt++;}
           else{continue;}
       }

       printf("%d\n",ans[k-1]);
    }
    return 0;
}


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

int cnt;

void selection_sort(int n,int array[MAX]){
    for(int i = 0 ; i < n ; i++){
        int mini = i, flg = 0;
        for(int j = i ; j < n ; j++){
            if(array[j] < array[mini]){
                mini = j;
                flg = 1;
            }
        }
        if(!flg) continue;
        swap(array[i],array[mini]);
        cnt++;
    }
}

int main(){
    int n,array[MAX];
    
    cin >> n;
    for(int i = 0 ; i < n ; i++) cin >> array[i];
    
    cnt = 0;
    selection_sort(n,array);
    
    for(int i = 0 ; i < n ; i++){
        if(!i) cout << array[i];
        else cout << ' ' << array[i];
    }
    cout << endl;
    cout << cnt << endl;
    
    return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <stack>

using namespace std;

int main(){
	string str;
	cin>>str;
	int l=str.length();
	stack<char> st;
	for(int i=0; i<l; i++){
		if(st.size()==0){
			st.push(str[i]);
		}else if(st.top()=='S' && str[i]=='T'){
			st.pop();
		}else{
			st.push(str[i]);
		}
	}
	
	cout<<st.size()<<endl;

	return 0;
}


Measured memory_bytes: 644
N = int(input())
L = list(map(int,input().split()))

L = sorted(L)

ln = len(L)

ans = 0

for i in range(ln-2):
   for j in range(i+1, ln-1):
      for k in range(j + 1, ln):
         if L[i] + L[j] > L[k] and L[i] != L[j] and L[j] != L[k]:
             ans += 1

print(ans)

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

#define int long long
typedef pair<int, int> P;

signed main(){
  int n, u, v, m;
  cin >> n >> u >> v >> m;

  vector<P> A(1000001, P{-1, -1}), B;
  B = A;  
  for ( int i = 0; i < n; i++ ) {
    for ( int j = 0; j < n; j++ ) {
      int a;
      cin >> a;
      A[a] = P{i, j};      
    }
  }

  for ( int i = 0; i < n; i++ ) {
    for ( int j = 0; j < n; j++ ) {
      int a;
      cin >> a;
      B[a] = P{i, j};      
    }
  }

  vector<int> num(m); 
  for ( int i = 0; i < m; i++ ) {
    cin >> num[i];
  }

  vector<int> cnth1(n, 0), cntw1(n, 0), cnth2(n, 0), cntw2(n, 0);
  int cntl1 = 0, cntr1 = 0, cntl2 = 0, cntr2 = 0;
  int c1 = 0, c2 = 0;  
  for ( int i = 0; i < m; i++ ) {
    int a = num[i];
    P p1 = A[a], p2 = B[a];
    if ( p1.first != -1 ) {
      if ( ++cnth1[p1.first] == n ) c1++;
      if ( ++cntw1[p1.second] == n ) c1++;
      if ( p1.first == p1.second ) {
	if ( ++cntl1 == n ) c1++;
      }
      if ( p1.first + p1.second == n-1 ) {
	if ( ++cntr1 == n ) c1++;
      }
    }
    if ( p2.first != -1 ) {
      if ( ++cnth2[p2.first] == n ) c2++;
      if ( ++cntw2[p2.second] == n ) c2++;
      if ( p2.first == p2.second ) {
	if ( ++cntl2 == n ) c2++;
      }
      if ( p2.first + p2.second == n-1 ) {
	if ( ++cntr2 == n ) c2++;
      }

    }
    if ( n == 1 ) {
      if ( u > 1 && v > 1 ) {
	break;	
      } else if ( u == 1 && v > 1 ) {
	if ( c1 >= u ) {
	  cout << "USAGI" << endl;
	  return 0;
	}
      } else if ( u > 1 && v == 1 ) {
	cout << "NEKO" << endl;
	return 0;
      } else {
	if ( c1 >= u && c2 >= v ) {
	  break;      
	} else if ( c1 >= u ) {
	  cout << "USAGI" << endl;
	  return 0;
	} else if ( c2 >= v ) {
	  cout << "NEKO" << endl;
	  return 0;
	}
      }
    } else {
      if ( c1 >= u && c2 >= v ) {
	break;      
      } else if ( c1 >= u ) {
	cout << "USAGI" << endl;
	return 0;
      } else if ( c2 >= v ) {
	cout << "NEKO" << endl;
	return 0;
      }
    }
  }

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


Measured memory_bytes: 34460
n = int(input())
a = [list(map(int, input().split())) for _ in range(n)]
def Warshall_Floyd(edges,N):
  ans = 0
  for j in range(N):
    for i in range(N):
      flag = 0
      for k in range(N):
        if edges[i][j]> edges[i][k]+edges[k][j]:
          print(-1)
          exit()
        if (edges[i][k] + edges[k][j] == edges[i][j] and i != k and k != j):
          flag = 1
      if flag == 0:
        ans += edges[i][j]
  return edges,ans
x,ans = Warshall_Floyd(a,n)
print(ans//2)

Measured memory_bytes: 42460
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>

using namespace std;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }
int bsr(int x) { return 31 - __builtin_clz(x); }

template<class T>
T pow(T x, ll n, T r = 1) {
    while (n) {
        if (n & 1) r *= x;
        x *= x;
        n >>= 1;
    }
    return r;
}

struct Perm {
    //i -> a[i]
    vector<int> a;
    Perm(int n) {
        a = vector<int>(n);
        iota(begin(a), end(a), 0);
    }
    Perm(vector<int> a) : a(a) {}
    Perm operator*(const Perm &r) const {
        int n = int(a.size());
        Perm res(n);
        for (int i = 0; i < n; i++) {
            res.a[i] = r.a[a[i]];
        }
        return res;
    }
    Perm& operator*=(const Perm &r) {
        return *this = *this*r;
    }
};


using R = double;
const int MN = 100100;

//#undef LOCAL
struct Solver {
    // global variable
    R p[MN], d[MN];
    int q[MN];
    void solve();
};

void Solver::solve() {
    // main
    int n;
    cin >> n;
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
    for (int i = 0; i < n-1; i++) {
        d[i] = p[i+1]-p[i];
    }
    int m; ll k;
    cin >> m >> k;
    Perm v(n-1);
    for (int i = 0; i < m; i++) {
        int c;
        cin >> c; c--;
        swap(v.a[c-1], v.a[c]);
    }
    Perm u = pow(v, k, Perm(n-1));
    R st = p[0];
    cout << st << endl;
    for (int i = 0; i < n-1; i++) {
        st += d[u.a[i]];
        cout << st << endl;
    }
}

int main() {
    cout << setprecision(20);
#ifdef LOCAL
    const string ProbName = "A";
    const int T = 3;
    for (int i = 0; i < T; i++) {
        string fname = ProbName + "in" + to_string(i) + ".txt";
        freopen(fname.c_str(), "r", stdin);
        cerr << "## Start " << fname << endl;
        Solver s; s.solve();
    }
#else
    Solver s;
    s.solve();
#endif
    return 0;
}

Measured memory_bytes: 3740