akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, n)       for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, s, t)   for (i64 i = (s), i##_limit = (t); i <= i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#ifndef DBG
#define trace(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> make_v(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}

template <class T, class... Args>
inline auto make_v(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initValue, args...))>(sz, make_v<T>(initValue, args...));
}

inline void read() {}

template <class Head, class... Tail>
inline void read(Head &head, Tail&... tail) { cin >> head; read(tail...); }

inline void print() { cout << "\n"; }

template <class Head, class... Tail>
inline void print(Head &&head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<< (ostream &out, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) out << e << delim[&e == &vec.back()];
    return out;
}
// }}} End Header

signed main() {
    ios_base::sync_with_stdio(false); cin.tie(nullptr);

    int N;
    read(N);

    set<char> s;

    rep(i, N) {
        char c;
        read(c);
        s.insert(c);
    }

    if (s.size() == 3) {
        print("Three");
    } else {
        print("Four");
    }

    return 0;
}


Measured memory_bytes: 256
import sys
mod = 1000000007

sys.setrecursionlimit(10**7)
readline = sys.stdin.readline
N, K = map(int, readline().split())

def P(x, y):
    r = 1
    for i in range(y):
        r = (r * (x - i)) % mod
    return r

G = [[] for _ in range(N)]
for v in range(N-1):
    a, b = map(int, readline().split())
    a, b = a-1, b-1
    G[a].append(b)
    G[b].append(a)

def dfs(bb, v):
    cn = 0
    r = 1
    for u in G[v]:
        if u == bb:
            continue
        cn += 1
        r = (r * dfs(v, u)) % mod
    if cn == 0:
        return 1
    else:
        if bb == None:
            return P(K-1, cn) * r % mod
        else:
            return P(K-2, cn) * r % mod

print((K*dfs(None, 0))%mod)


Measured memory_bytes: 87344
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <cstdio>
#include <algorithm>
#include <functional>
#include <map>

using namespace std;

#define MAX 2000000

int left(int i) {
    return i * 2;
}

int right(int i) {
    return i * 2 + 1;
}

void maxHeapify(int *heap, int index, int heapIndex) {
    int l = left(index);
    int r = right(index);
    int largest;

    if (l <= heapIndex && heap[l] > heap[index]) {
        largest = l;
    } else {
        largest = index;
    }

    if (r <= heapIndex && heap[r] > heap[largest]) {
        largest = r;
    }

    if (index != largest) {
        swap(heap[largest], heap[index]);
        maxHeapify(heap, largest, heapIndex);
    }

}

void insert(int *heap, int key, int heapIndex) {
    heap[heapIndex] = key;
}

void keyDelete(int *heap, int heapIndex) {
    swap(heap[1], heap[heapIndex]);
    printf("%d\n",heap[heapIndex]);

}

void increaseKey(int *heap,int key,int  index){
    heap[index]=key;
    while(index>1&&heap[index/2]<heap[index]){
        swap(heap[index/2],heap[index]);
        index=index/2;
    }
}

int main() {

    string str;
    int heap[MAX];
    int heapIndex = 0;    //ヒープのキーの可変サイズ

    while(true) {
        cin >> str;
        if (str == "end") {
            break;
        } else if (str[0] == 'i') {
            int key;scanf("%d", &key);
            heapIndex++;
            increaseKey(heap,key,heapIndex);
        } else if (str[0] == 'e') {
            keyDelete(heap,heapIndex);
            heapIndex--;
            maxHeapify(heap,1,heapIndex);
        }
    }

    return 0;
}


Measured memory_bytes: 7168
#include <iostream>
#include <queue>
#include <stack>
#include <set>
#include <list>
#include <map>
#include <deque>
#include <cmath>
#include <vector>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>

// short keywords

#define ipow(a,b) (ll)pow(a,b)
#define pi(a,b) pair<ll,ll>(a,b)
#define pis(a,b) pair<ll,string>(a,b)
#define pc(c,d) pair<ll,pair<ll,string>>(c,d)
#define pp(a,b,c) pair<pair<ll,ll>,ll>(pi(a,b),c)
#define ps(a,b,c) pair<string,pair<ll,ll>>(a,pi(b,c))

// for loops

#define rep(i,n) for(ll i=0;i<n;i++)
#define reps(i,a,b) for(ll i=a;i<=b;i++)
#define rev(i,a,b) for(ll i=a;i>=b;i--)
#define mod 1000000007
using namespace std;

// short keywords2
typedef long long ll;
typedef set<ll>::iterator sit;
typedef vector <ll> ::iterator vit;
typedef map<ll,ll>::iterator mit;
typedef multimap<ll,ll>::iterator mmit;

class Task
{
public:
    void solve(istream& in,ostream& out)
    {
        ll n;
        in>>n;
        vector<ll>check;

        vector<ll>prime;
        prime.push_back(2);
        prime.push_back(3);

        for(ll i=5 ;i<=n+5 ;i+=2)
        {
            if(isprime(i)==true)
            {
                prime.push_back(i);
            }
        }

     //  for(ll i=0 ;i<prime.size() ;i++)
    //    {
    //        out<<prime[i]<<endl;
    //    }

        for(ll i=0 ;i<prime.size() ;i++)
        {
            if(n/prime[i]==0)
            {
                break;
            }
            else
            {
                check.push_back(c(n,prime[i]));
            }
        }

   //     for(ll i=0 ;i<check.size() ;i++)
    //    {
    //        out<<check[i]<<" ";
    //    }

    //    out<<endl;

        ll p=1;

        for(ll i=0 ;i<check.size() ;i++)
        {
            p*=(check[i]+1);
            p%=mod;
        }

        out<<p<<endl;
    }

    ll c(ll a,ll b)
    {
        ll res=0;
        reps(i,1,15)
        {
            if(a/(ll)pow(b,i)!=0)
            {
                res+=a/(ll)pow(b,i);
            }
            else
            break;
        }

        return res;
    }

    bool isprime(ll n)
    {
        if(n==1 || (n%2==0 && n!=2))
        {
            return false;
        }
        else if(n==2 || n==3)
        {
            return true;
        }
        else
        {
            ll res=0;
            for(ll i=3 ;i<=(ll)sqrt(n) ;i+=2)
            {
                if(n%i==0)
                {
                    res++;
                    break;
                }
            }

            if(res==0)
            {
                return true;
            }
            else
            return false;
        }
    }
};


int main()
{
    ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	Task solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in,out);
	out.flush();

    return 0;
}


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

int main(){
    int a,b,c,cnt=0;
    cin >>a >>b >>c;
    int flag=0;
  if(a>b)cout <<"0" <<endl;
  else if(a*c<=b) cout <<c <<endl;
  else{
      for(int i=1; i*a<=b; i++){
      cnt++;
        flag=1;
      }
  }
  if(flag==1) cout <<cnt <<endl;
    return 0;
}

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


/* エイリアス */
#define ll long long
#define ld long double
#define vi vector<int>
#define vll vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vpi vector<pii>
#define vpll vector<pll>
#define endl '\n'

#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define em emplace


/* 関数マクロ */
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define rep2(i, n, m) for (ll i = n; i <= m; ++i)
#define rep3(i, n, m) for (ll i = n; i >= m; --i)
#define all(v) v.begin(), v.end()
#define si(v) int(v.size())
#define UNIQUE(v) sort(all(v)), v.erase(unique(all(v)),v.end())


/* 定数 */
const ll mod = 1e9 + 7;
const ll infll = (1LL << 62) - 1;
const ll inf = (1LL << 30) - 1;


/* その他 */
template<class S, class T> inline bool chmax(S &a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class S, class T> inline bool chmin(S &a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T> using pq = priority_queue<T>;
template<class T> using pqg = priority_queue<T, vector<T>, greater<T>>;


signed main()
{
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cout << fixed << setprecision(15);
  
  string s; cin >> s;
  if (si(s) == 3) reverse(all(s));
  
  cout << s << endl;
}

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

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

using namespace std;

using ll = long long;
using P = pair<int, int>;

int main() {
  int n;
  cin >> n;
  vector<int> l(n);
  rep(i, n) cin >> l[i];
  sort(l.begin(), l.end()); // 昇順
  int result = 0;
  // a < b < c で c < a + b を使用
  for (int i = 0; i < n - 2; ++i) {
    for (int j = i + 1; j < n - 1; ++j) {
      int a = l[i];
      int b = l[j];
      // c のインデックス範囲 [left, right)
      int left = j + 1;
      int right = lower_bound(l.begin(), l.end(), a + b) - l.begin();
      result += right - left;
    }
  }
  cout << result << endl;

  return 0;
}


Measured memory_bytes: 384
#ifdef _MSC_VER
#include "stdc++.h"
#endif
#ifdef __GNUC__
#include<bits/stdc++.h>
#endif
using namespace std;

using ll = long long;

//vector
using vi = vector<int>;
using vii = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

//constant
const double EPS = 1e-10;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, s, e) for (ll i = s; i < e; i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(), (x).rend()

//debug
#define DUMP(x)  cerr << #x << " = " << (x) << endl;
#define DEBUG(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl;

// vector
//template<typename T> vector<vector<T>> vv(ll H, ll W, T v) { return vector<vector<T>> vec(H, vector<T>(W, v)); }

// view vector
template<typename T> void view(T e) { cout << e << endl; }
template<typename T> void view(const vector<T>& v) { for (const auto& e : v) { cout << e << " "; } cout << endl; }
template<typename T> void view(const vector<vector<T> >& vv) { for (const auto& v : vv) { view(v); } }

// DP
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }




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


int main(){

    double a;
    cin >> a;
    cout << a + pow(a, 2) + pow(a, 3) << endl;

    return 0;
}


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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 4e5 + 5;

int n,m,a[maxn],par[maxn];

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

void join(int x, int y) {
  int px=parent(x);
  int py=parent(y);
  if (px==py) return;
  if (rand()%2) {
    swap(x,y); swap(px,py);
  }
  par[py]=px;
}

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

  cin>>n>>m;
  for (int i=1; i<=n; i++) {
    cin>>a[i];
    par[i]=i;
  }

  for (int i=1; i<=m; i++) {
    int x,y; cin>>x>>y;
    join(x,y);
  }

  int ans = 0;
  for (int i=1; i<=n; i++) {
    if (parent(i)==parent(a[i])) {
      ans++;
    }
  }

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


Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i=0; i<(int)(n); i++)
#define all(vec) vec.begin(),vec.end()
#define MOD 1000000007
#define int long long

signed main(){
    int a,b,c,k;cin>>a>>b>>c>>k;
    int v=max(a,max(b,c));
    int ans=a+b+c-v;
    rep(i,k)v*=2;
    cout<<ans+v<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <regex>
#include <string>
using namespace std; 
int main()
{
	int a,b;
	cin>>a>>b;
	string s;
	cin>> s;
	regex r("\\d{"+to_string(a)+"}-\\d{"+to_string(b)+"}");
	bool f=regex_match(s,r);
	cout << (f?"Yes":"No");
}

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

int grundy(int k,int y){
  if(y<k)return 0;
  int A=y/k;
  if(A*k==y)return A;
  return grundy(k,y-1-A);
}

signed main(){
  int n;cin>>n;
  int ans=0;
  while(n--){
    int k,a;cin>>a>>k;
    ans^=grundy(k,a);
  }
  if(ans)cout<<"Takahashi"<<endl;
  else cout<<"Aoki"<<endl;
}


Measured memory_bytes: 256
fn main() {
    let v: Vec<i32> = read_vec();
    let m = v.iter().max().unwrap() * 3 - v.iter().sum::<i32>();
    if m % 2 == 0 {
        println!("{}", m / 2);
    } else {
        println!("{}", (m + 3) / 2);
    }
}

// ========== 以下使い捨て関数  ===============================



// ========== 以下作り置き関数 ================================
pub use std::io::*;
pub use std::process::exit;
pub use std::str::FromStr;

pub const MOD: i64 = 1_000_000_007;

/// 標準入力から
/// 空白文字で囲まれた1つのトークンを
/// 指定の型に変換する
pub 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")
}

/// 標準入力から1行読み取り
/// 空白文字で区切って
/// 指定の型のVecに格納する
pub fn read_vec<T: FromStr>() -> Vec<T> {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}


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

int main(){
    int w,h,n;
    cin >> w >> h >> n;
    vector<vector<bool> > plane(h, vector<bool>(w, true));
    for(int i=0; i<n; i++){
        int x,y,a;
        cin >> x >> y >> a;
        if(a==1){
            for(int j=0; j<h; j++){
                for(int k=0; k<x; k++){
                    plane[j][k] = false;
                }
            }
        }else if(a==2){
            for(int j=0; j<h; j++){
                for(int k=x; k<w; k++){
                    plane[j][k] = false;
                }
            }
        }else if(a==3){
            for(int j=0; j<y; j++){
                for(int k=0; k<w; k++){
                    plane[j][k] = false;
                }
            }
        }else{
            for(int j=y; j<h; j++){
                for(int k=0; k<w; k++){
                    plane[j][k] = false;
                }
            }
        }
    }
    int ans = 0;
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            if(plane[i][j]) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int x = Integer.parseInt(in.readLine());
    System.out.println(x==5||x==3||x==7?"YES":"NO");
  }
}

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

int main(){
    int N,digit,sum,num;
    scanf("%d", &N);
    sum = 0;
    num = N;
    for(int i = 0; i < N; i++){
        digit = num % 10;
        sum += digit;
        num /= 10;//小数点以下切り上げ 11/10->1,3/10->0
        if(num == 0){
            break;
        }
    }
    if(N % sum == 0){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<map>
#include<algorithm>
#include<string>
#include<stdio.h>
#include<stdlib.h>
#include<set>
#include<cmath>
#define MAX 2000050
#define ll long long int
using namespace std;

int n;
int a[500];
int main(){
  cin>>n;
  double avg = 0;
  for(int i=0;i<n;i++){
    cin>>a[i];
    avg+=a[i];
  }
  avg/=n*1.0;
  int norm = round(avg);
  int cost = 0;
  for(int i=0;i<n;i++){
    if(a[i]!=norm){
      cost+=(norm-a[i])*(norm-a[i]);
    }
  }
  cout<<cost<<endl;
  return 0;
}


Measured memory_bytes: 384
'use strict';
let execute = input => {
  let sides = input.split(' ').map(el => +el);
  let hypotenuse = Math.max(...sides);
  return (
    sides.filter(el => el != hypotenuse).reduce((sum, el) => sum * el, 1) / 2
  );
};

function Main(input) {
  console.log(execute(input));
}
Main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7372
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

def C(n,r):
    return fact[n] * pow(fact[n-r],mod-2,mod) * pow(fact[r],mod-2,mod) % mod


n,k = LI()

fact = [1]*(n+1)
for i in range(1,n+1):
    fact[i] = i*fact[i-1]
    fact[i] %= mod

ans = 0

for i in range(min(n,k+1)):
    ans += C(n,i) * C(n-1,n-i-1)
    ans %= mod
print(ans)

Measured memory_bytes: 44372
#include <stdio.h>
#include <stdlib.h>

#define lli long long int

typedef enum{
	false,
	true
}Boolean;

Boolean canBreak(lli N, lli A, lli B, lli *h, lli k){
	lli i, dec = k * B, rem = 0;
	for(i = 0; i < N; i++){
		if(h[i] > dec){
			rem += 1 + (h[i] - dec - 1) / (A - B);
		}
	}
	if(rem <= k){
		return true;
	}
	else{
		return false;
	}
}

int main(){
	lli N, A, B, i, j, k;
	scanf("%lld%lld%lld", &N, &A, &B);
	lli *h = (lli *)malloc(sizeof(lli) * N);
	lli hmax = 0;
	for(i = 0; i < N; i++){
		scanf("%lld", &h[i]);
		if(h[i] > hmax){
			hmax = h[i];
		}
	}
	//printf("test: hmax = %lld\n", hmax);
	for(j = 1; j <= hmax; j *= 2){}
	//printf("test: j = %lld\n", j);
	for(k = 0; j > 0; ){
		j /= 2;
		//printf("test: k = %lld\n", k);
		if(canBreak(N, A, B, h, k) == true){
			//printf("true\n");
			k -= j;
		}
		else{
			//printf("false\n");
			k += j;
		}
	}
	if(canBreak(N, A, B, h, k) == true){
		printf("%lld\n", k);
	}
	else{
		printf("%lld\n", k + 1);
	}
	return 0;
}

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

struct point{
    int x;
    int y;
};

bool used[110];

int main(){
    int N; cin >> N;
    P red[110];
    P blue[110];
    for(int i=0; i<N; i++){
        int a, b; cin >> a >> b;
        red[i]=P(a,b);
    }
    for(int i=0; i<N; i++){
        int c, d; cin >> c >> d;
        blue[i]=P(c,d);
    }
    //
    sort(red,red+N); sort(blue,blue+N);
    int ans=0;
    for(int i=0; i<N; i++){
        int x = blue[i].first;
        int y = blue[i].second;
        int mmin=-1;
        int num=300;
        for(int j=0; j<N; j++){
            int a= red[j].first;
            int b= red[j].second;
            if(a<x && b<y && mmin < b && used[j]==0 ){
                mmin=b;
                num=j;
            }
        }
        if(num==300) continue;
        used[num]=1;
        ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
 
const char newl = '\n';
 
using namespace std;
using ll = long long;
 
auto main() -> int
{
	cin.tie(0);
  	ios::sync_with_stdio(0);
    
	int N; cin >> N;
    vector<ll> A(N);
    
	ll h = 1;
    
    for(auto& a: A) cin >> a;
    
    sort(A.begin(), A.end());
    for(const auto& a: A)
    {
    	if(h == 0) break;
    	if(a <= 1000000000000000000 / h)
        {
        	h *= a;
        }
        else
        {
        	printf("-1");
            return 0;
        }
    }
    
    printf("%lld\n", h);
    
    return 0;
}

Measured memory_bytes: 3996
local n=io.read("*n")
local a,a_map={},{}
for i=1,n do
    local x=io.read("*n")
    a[i]=x
    a_map[x]=(a_map[x] or 0)+1
end
table.sort(a)

local counter=0
for i=n,2,-1 do
    local p=1
    while a[i]>=p do
        p=p*2
    end
    if a_map[a[i]] and a_map[a[i]]>0 then
        a_map[a[i]]=a_map[a[i]]-1
        if a_map[p-a[i]] and a_map[p-a[i]]>0 then
            a_map[p-a[i]]=a_map[p-a[i]]-1
            counter=counter+1
        end
    end
end
print(counter)

Measured memory_bytes: 11820
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use itertools::Itertools;
use num_traits::clamp;
use ordered_float::OrderedFloat;
use proconio::{input, marker::*, fastout};
use superslice::*;

#[fastout]
fn main() {
    input! {
        S: Chars, T: Chars,
    }

    let mut ans = 50000;
    for head in 0..=S.len() - T.len() {
        let mut count = 0;
        for i in 0..T.len() {
            if S[head + i] != T[i] {
                count += 1;
            }
        }
        ans = min(ans, count);
    }
    println!("{}", ans);
}


Measured memory_bytes: 2212
#pragma warning(disable:4786)
#pragma warning(disable:4996)
#include<list>
#include<bitset>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<vector>
#include<set>
#include<map>
#include<functional>
#include<string>
#include<cstring>
#include<cstdlib>
#include<queue>
#include<utility>
#include<fstream>
#include<sstream>
#include<cmath>
#include<stack>
#include<assert.h>
using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))
#define CLR(a) memset(a, 0, sizeof(a))
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define ABS(X) ( (X) > 0 ? (X) : ( -(X) ) )
#define S(X) ( (X) * (X) )
#define SZ(V) (int )V.size()
#define FORN(i, n) for(i = 0; i < n; i++)
#define FORAB(i, a, b) for(i = a; i <= b; i++)
#define ALL(V) V.begin(), V.end()
#define IN(A, B, C)  ((B) <= (A) && (A) <= (C))

typedef pair<int,int> PII;
typedef pair<double, double> PDD;
typedef vector<int> VI;
typedef vector<PII > VP;

#define AIN(A, B, C) assert(IN(A, B, C))

//typedef int LL;
typedef long long int LL;
//typedef __int64 LL;

int main()
{
	int cnt = 0;
	int n;
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		int a;
		scanf("%d", &a);
		cnt += a & 1;
	}
	if (cnt % 2) printf("NO\n");
	else printf("YES\n");

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <utility>
#include <cmath>
using namespace std;
using ll=long long;
using P=pair<int,int>;
#define rep(i,a,b) for(ll i=a;i<ll(b);i++)
#define repr(i,a,b) for(ll i=a;i>=ll(b);i--)
#define endl '\n'
#define ALL(x) x.begin(),x.end()
#define ALLR(x) x.rbegin(),x.rend()
#define INF 1e9
#define DEBUG(x) cout<<"debug: "<<x<<endl
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}

#include <iomanip>
long double l;
int main(){
	cin >> l;
	long double a = l /3;
	long double v = a*a*a;
	cout << fixed << setprecision(15) << v << endl;
    return 0;
}


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

int main(){
    ll n, m;
    cin >> n >> m;
    priority_queue<int> q;
    for(ll i = 0; i < n; i++){
        ll a;
        cin >> a;
        q.push(a);
    }
    for(ll i = 0; i < m; i++){
        ll a = q.top();
        q.pop();
        q.push(a / 2);
    }
    ll ans = 0;
    for(ll i = 0; i < n; i++){
        ans += q.top();
        q.pop();
    }
    cout << ans << endl;
}


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

using namespace std;
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define sz(x) ll(x.size())
typedef long long ll;
typedef pair<int, int> P;
const ll INF = 1001001001;
static const ll MOD = 1000000007;
const int n = 13;
ll dp[100005][n];

int main() {

    int k, x, y;
    cin >> k >> x >> y;

    bool mx = false, my = false, xys = false;

    if (x < 0) {
        x = -x;
        mx = true;
    }
    if (y < 0) {
        y = -y;
        my = true;
    }

    if (x < y) {
        swap(x, y);
        xys = true;
    }

    vector<vector<int>> ans;
    [&] {
        if ((x + y) % 2 == 1 && k % 2 == 0) {
            cout << -1 << endl;
            exit(0);
        }

        if (x + y == k) {
            ans.push_back({x, y});
            return;;
        }

        int n = (x + y + k - 1) / k;
        if (n <= 1) n = 2;

        if ((x + y) % 2 != n * k % 2) n++;

        if (n == 3 && x < k) {
            int over_right = (k + x - y) / 2;
            ans = {
                    {x,              -k + x},
                    {x + over_right, y - (k - over_right)},
                    {x,              y},
            };
            return;
        }

        int over = (k * n - (x + y)) / 2;
        for (int i = 0; i < n; i++) {
            int dist = (i + 1) * k;
            if (dist <= y + over) {
                ans.push_back({0, dist});
            } else if (dist <= y + over + x) {
                ans.push_back({dist - y - over, y + over});
            } else {
                ans.push_back({x, y + ((n - (i + 1)) * k)});
            }
        }
    }();

    if (xys) {
        for (int i = 0; i < ans.size(); i++) {
            swap(ans[i][0], ans[i][1]);
        }
    }

    if (mx) {
        for (int i = 0; i < ans.size(); i++) {
            ans[i][0] = -ans[i][0];
        }
    }

    if (my) {
        for (int i = 0; i < ans.size(); i++) {
            ans[i][1] = -ans[i][1];
        }
    }

    cout << ans.size() << endl;
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i][0] << ' ' << ans[i][1] << endl;
    }

}



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

int main(){

	int N,M;
	int NSUM=0;
	int T[100];
	int A[100],B[100];

	cin>>N;

	for(int i=0 ; i<N ; i++){
		cin>>T[i];
		NSUM+=T[i];
	}
	cin>>M;
	for(int i=0 ; i<M ; i++){
		cin>>A[i]>>B[i];
	}

	for(int i=0 ; i<M ; i++){
		cout<<NSUM+B[i]-T[A[i]-1]<<endl;
	}

	return 0;
}


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

typedef long long int ll;
//Factors of an num
/*
vector<ll> fact(ll n){
	vector<ll>v;
	for(int i=1;i*i<=n;i++){
		if(n%i ==0){
			v.push_back(i);
		
		if(i!=n/i)
			v.push_back(n/i);
	    }
	}

	return v;
}
*/


/*
Seive Of Eratos..
int N=1e5;
vector<bool> isprime(N+1,true);
void pri(int n){
	for(int i=2;i*i<=n;i++){
		if(isprime[i]){
			for(int j=i*i;j<=n;j+=i){
				isprime[j]=false;
			}
		}
	}
	return;
}
*/

/*
//Prime Factors
vector<bool> isprime(1e6+1,true);
 vector<int> primes;
 void sieve()
 {

    ll  i,j;
    isprime[0] = false;
    isprime[1] = false;

    for(i=2; i<=1e6 ;i++)
  {

    if(isprime[i])
    {

      primes.push_back(i);

      for(j=i*i; j<=1e6; j+=i)
      {
        isprime[j]=false;
      }

    }

  }
}

vector<int> primefactors(int  N)

 {

    vector<int> factors;
    ll pf_idx = 0, pf=primes[pf_idx];

    while(pf*pf<=N)
    {
        while(N % pf == 0)
        {
            N/=pf;
            factors.push_back(pf);
        }
        pf = primes[++pf_idx];
    }
    
    if(N != 1) factors.push_back(N);
    return factors;
}
 */   




int main(){
	 
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
     int N;
    cin >> N;
    vector<int> L(N);
    for(int i=0;i<N;i++) cin >> L[i];
    int cnt = 0;
    for(int i = 0; i < N; i++){
        for(int j = i + 1; j < N; j++){
            for(int k = j + 1; k < N; k++){
                if(L[i] != L[j] && L[j] != L[k] && L[k] != L[i]){
                    if(L[i] + L[j] > L[k] && L[j] + L[k] > L[i] && L[k] + L[i] > L[j]) cnt++;
                }
            }
        }
    }
    cout << cnt << endl;
    return 0;
    }




Measured memory_bytes: 3596
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <unordered_map>

using namespace std;
using LL = long long;

constexpr int MOD = 1000000000 + 7;
constexpr int INF = 2000000000;

int main() {
	int n;
	cin >> n;
	int x , y , b , p;
	for (int i = 0; i < n; i++) {
		cin >> x >> y >> b >> p;
		cout << min({ x*b + y*p ,(max(b,5)*x + max(p,2)*y) * 4 / 5 }) << endl;
	}
}

Measured memory_bytes: 3100
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<set>
#pragma warning(disable:4996)
using namespace std;
const int maxn = 200005;
typedef long long ll;
multiset<ll>q;
int n;
ll ans;
ll a[maxn];
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%lld", &a[i]);
		q.insert(a[i]);
	}
	while (!q.empty()) {
		ll v = *--q.end();
		q.erase(--q.end());
		for (int i = 0; i <= 32; i++) {
			ll t = (1 << i) - v;
			if (q.find(t) != q.end()) {
				ans++;
				q.erase(q.find(t));
				break;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}

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

int main() {
    int n;
    cin >> n;
    vector<int> t(n);
    int acc = 0;
    for (int i = 0; i < n; i++) {
        cin >> t[i];
        acc += t[i];
    }
    int m;
    cin >> m;
    vector<int> ans(m);
    for (int i = 0; i < m; i++) {
        int p, x;
        cin >> p >> x, p--;
        ans[i] = acc - t[p] + x;
    }
    for (auto& e : ans) cout << e << endl;
}


Measured memory_bytes: 256
s=list(input())
s=list(set(s))
s.sort()
key='A'
for i in range(len(s)-1):
    if s[i+1]!=chr(ord(s[i])+1):
        key=chr(ord(s[i])+1)
        break
            
if len(s)==1:
    print(chr(ord(s[0])+1))
elif len(s)==26:
    print('None')
elif key!='A' and s[0]=="a": print(key)
elif key!='A' and s[0]!="a": print("a")
else: print(chr(ord(s[len(s)-1])+1))


Measured memory_bytes: 3956
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <tuple>
#include <queue>
#include <set>
#include <math.h>
#include <array>
#include <list>
#include <set>
const int MOD=1000000007;
const int INF=1000000000;
using namespace std;
typedef long long ll;
typedef tuple<ll,int,int> tup;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vp;
set<int> st;
vi s(3);
int odd=0,even=0,ans=0; 
int main(int argc,char const* argv[])
{
  for(int i=0;i<3;i++)
    {
      cin >> s[i];
    }
  sort(s.begin(),s.end(),greater<int>());
  for(int i=1;i<=2;i++)
    {
      if((s[0]-s[i])%2!=0 && s[0]-s[i]!=0)
	{
	  odd++;
	}
      else if((s[0]-s[i])%2==0)
	{
	  even++;
	}
    }
  if(even==2)
    {
      cout << (s[0]-s[1])/2+(s[0]-s[2])/2 << endl;
    }
  else if(odd==1)
    {
      if((s[0]-s[1])%2!=0) s[1]++;
      else s[2]++;
      s[0]++;
      cout << (s[0]-s[1])/2+(s[0]-s[2])/2 +2 << endl;
    }
  else if(odd==2)
    {
      cout << (s[0]-s[1])/2+(s[0]-s[2])/2+1 << endl;
    }
  
}


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

def gcd(a,b):
  if(a<b):
    temp = a
    a = b
    b = temp
  if(a%b==0):
    return b;
  else:
    return gcd(a%b,b);

sum = 0

for a in range(1,K+1):
  for b in range(1,K+1):
    for c in range(1,K+1):
      temp=gcd(a,b)
      sum+=gcd(c,temp)

print(sum)


Measured memory_bytes: 84492
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;

int main(){
    ll X, Y;
    cin >> X >> Y;

    int k=0;
    while((1L<<k)*X<=Y) k++;
    cout << k << endl;

    return 0;
}


Measured memory_bytes: 256
N = int(input())
X = list(map(int,input().split()))
s = 0
for i in range(1,101):
    temp = 0
    for j in range(N):
        temp += (i - X[j])**2
    if i == 1:
        s = temp
    elif s < temp:
        pass
    elif s >= temp:
        s = temp
print(s)
    


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

int main() {
	int a,v,b,w,dt;
	cin>>a>>v>>b>>w>>dt;
	if(b>a){
	    double d=b-a;
	    double s=v-w;
	    if(s!=0){
	        double t=d/s;
	        if(t<=dt && t>0)cout<<"YES";
	        else cout<<"NO";
	    }
	    else cout<<"NO";
	}
	else{
	    double d=a-b;
	    double s=v-w;
	    if(s!=0){
	        double t=d/s;
	        if(t<=dt && t>0)cout<<"YES";
	        else cout<<"NO";
	    }
	    else cout<<"NO";
	}
}


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

namespace abc55 {
    class Program {
        static void Main(string[] args) {
            int n = int.Parse(Console.ReadLine());
            int x = 800 * n;
            int y = 200 * (n / 15);
            Console.WriteLine(x - y);
        }
    }
}


Measured memory_bytes: 11092
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <map>
#include <algorithm>

using namespace std;
#define n_max 100000
#define N_max 100

//#define ForRepeat(i, a, b) for(int i = a; i < b; i++)
#define rep(i, a, n) for(int i = a; i < n; i++)
#define rep2(i, a, n) for(int i = a; i <= n; i++)

int main()
{
	int c[3][3];	
	int a[3];
	int b[3];
	bool ans = true;

	rep(i, 0, 3) rep(j, 0, 3) { cin >> c[i][j]; }

	rep(a1, 0, 100) {
		a[0] = a1;
		rep(i, 0, 3) { b[i] = c[0][i] - a[0]; } 
		rep(i, 1, 3) { a[i] = c[i][0] - b[0]; } 
	
		rep(i, 0, 3) rep(j, 0, 3) {
			if(a[i] + b[j] != c[i][j]) ans = false;  
		}
	}

	if(ans) cout << "Yes" << endl;
	else    cout << "No"  << endl;

    return 0;
}


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();
        
        int rem = n % 10;
        
        if(rem == 2 || rem == 4 || rem == 5 || rem == 7 || rem == 9)
            System.out.println("hon");
        else if(rem == 3)
            System.out.println("bon");
        else
            System.out.println("pon");
    }
}

Measured memory_bytes: 27068
def is_prime(n):
    for i in range(2,n):
        if n % i == 0:
            return False
    return True

if __name__ == "__main__":
    N = int(input())
    v = [0]*(N+1)
    for i in range(2, N+1):
        for j in range(2, i+1):
            ii = i
            while ii%j == 0:
                v[j] += 1
                ii = ii / j
    ans = 1
    for i, e in enumerate(v):
        if is_prime(i) == False: continue
        ans *= e+1
    print(ans % (10**9+7))

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

#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

int main()
{
    int N,M;
    cin >> N >> M;

    vector<vector<int > >K;
    rep(i,M)
    {
        int k;
        cin >> k;
        vector<int> TMP;
        rep(i,k)
        {
            int tmp;
            cin >> tmp;
            TMP.push_back(tmp-1);
        }
        K.push_back(TMP);
    }
    vector<int> p(M);
    rep(i,M) cin >> p[i];

    ll ans = 0;

    vector<int> array;
    rep(bit,(1<<N))
    {
        vector<bool> use(M,false);
        rep(i,N)
        {
            if (bit & (1<<i)) {
                use[i] = true;
            }
        }
        bool flag = true;
        rep(j,K.size())
        {
            int num = 0;
            rep(k,K[j].size())
            {
                if( use[K[j][k]] ) num++;
            }
            if( (p[j] && (num+2)%2 == 0) || (!p[j] && (num+2)%2 != 0) )
            {
                flag = false;
                break;
            }
        }
        if(flag) ans++;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
// I SELL YOU...! 
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<chrono>
#include<iomanip>
#include<map>
#include<set>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
void init_io(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << setprecision(10);
}
signed main(){
  init_io();
  int c[3][3],a[3],b[3];
  for(int i=0;i<3;i++){
    for(int j=0;j<3;j++){
      cin >> c[i][j];
    }
  }
  for(int i=0;i<=100;i++){
    a[0] = i;
    bool can=true;
    for(int j=0;j<3;j++){
      b[j] = c[j][0] - a[0];
      if(b[j]<0) can = false;
    }
    for(int j=1;j<3;j++){
      a[j] = c[j][j] - b[j];
      if(a[j]<0) can = false;
    }
    for(int x=0;x<3;x++){
      for(int y=0;y<3;y++){
        if(c[x][y]!=b[x]+a[y]){
          can = false;
        }
      }
    }
    if(can){
      cout <<"Yes\n";
      return 0;
    }
  }
  cout << "No\n";
}


Measured memory_bytes: 256
#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 a;
    cin >> a;

    cout << (0 <= a - 'A' and a - 'A' <= 26 ? 'A' : 'a') << '\n';
    return 0;
}


Measured memory_bytes: 3480
#include "bits/stdc++.h"
#define rep(i,a,n) for(int i = a;i < n;i++)
typedef unsigned long long ull;
typedef long long ll;
using namespace std;

int main(){
    int a,b,c;
    cin >> a >> b >> c;
    
    cout << min(a,min(b,c)) << " " << max(a,max(b,c)) << endl;
    
    
    return 0;   
}


Measured memory_bytes: 3084
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

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

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
const ll mod=1000000007;
#define MAX 50 

void prin(ll n) 
{ 
    char str[MAX]; // To store result (Excel column name) 
    ll i = 0; // To store current index in str which is result 
  
    while (n > 0) { 
        // Find remainder 
        ll rem = n % 26; 
  
        // If remainder is 0, then a 'Z' must be there in output 
        if (rem == 0) { 
            str[i++] = 'z'; 
            n = (n / 26) - 1; 
        } 
        else // If remainder is non-zero 
        { 
            str[i++] = (rem - 1) + 'a'; 
            n = n / 26; 
        } 
    } 
    str[i] = '\0'; 
  
    reverse(str, str + strlen(str)); 
    cout << str << endl; 
  
    return; 
} 

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

   
    ll n;
    cin>>n;
    prin(n);
    
    
    


    

    return 0;
}


Measured memory_bytes: 3648
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());
        String s = sc.next();
        String t = sc.next();

        String result = "";
        for (int i = 0; i < n; i++) {
            result += "" + s.charAt(i) + t.charAt(i);
        }

        System.out.println(result);

        sc.close();
    }
}


Measured memory_bytes: 21844
#include "bits/stdc++.h"

using namespace std;

using ll = long long;
using ld = long double;

const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;

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

int f(int x) {
	int res = 0;
	while (x % 100 == 0) {
		x /= 100;
		res++;
	}

	return res;
}

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

	int d, n;
	cin >> d >> n;

	int ans = 0;
	int now = 0;
	for (int i = 1; i <= 10000000; i++) {
		if (f(i) == d) {
			now++;
			if (now == n) {
				ans = i;
				break;
			}
		}
	}

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


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#define N 200020
using namespace std;
typedef long long ll;
int main(){
    ll n, s, a[N], ans = 0, j = 0;
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
    }
    ll sa = 0, sb = 0;
    for(int i = 1; i <= n; i++){
        while(j + 1 <= n && sb + a[j + 1] == (sa ^ a[j + 1])){
            sa ^= a[j + 1];
            sb += a[j + 1];
            j++;
        }
        ans = ans + j - i + 1;
        sa ^= a[i];
        sb -= a[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
int main() 
{
    //ifstream cin("input.in");
    //ofstream cout("output.out");
    ios::sync_with_stdio(0);cin.tie(0);
    long long n,m;
cin>>n>>m;
cout<<max(n-m,0ll);
    return 0;
}   

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

int main() {
  int s;
  cin>>s;
  int a=s,b=2;
  while(a>1){
    if(a%2==0){
      a/=2;
    }
    else{
      a=3*a+1;
    }
    b++;
  }
  if(s==1||s==2||s==4){
    cout<<"4"<<endl;
  }
  else{
    cout<<b<<endl;
  }
}

Measured memory_bytes: 256
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
typedef pair<LL, LL> P;
constexpr int INF = 2000000000;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)      (x).begin(),(x).end()
# define UNIQ(c)     (c).erase(unique(ALL((c))),(c).end())
# define mp          make_pair
# define eb          emplace_back
# define FOR(i,a,b)  for(int i=(a);i<(b);i++)
# define RFOR(i,a,b) for(int i=(a);i>=(b);i--)
# define REP(i,n)    FOR(i,0,n)
# define INIT        std::ios::sync_with_stdio(false);std::cin.tie(0)

string a, b, c;

int main() {
	cin >> a >> b >> c;
	cout << a[0] << b[1] << c[2] << endl;
}

Measured memory_bytes: 256
import sys
sys.setrecursionlimit(10**6)
n, m = map(int, input().split())
adjacent_list = [[] for i in range(n + 1)]
for i in range(m):
    x, y, z = map(int,input().split())
    adjacent_list[x].append(y)
    adjacent_list[y].append(x)
##結局、グラフが何個あるか数える
finished = set()
ans = 0
def dfs(node):
    global finished
    finished.add(node)
    for i in adjacent_list[node]:
        if i not in finished:
            dfs(i)

while len(finished) != n:
    for i in range(1,n+1):
        if i not in finished:
            dfs(i)
            ans += 1
print(ans)




Measured memory_bytes: 108008
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    long N = sc.nextInt();
    long sum = 0;
    
    for(long i=1; i<=N; i++){
      if((i%3) != 0 && (i%5) != 0){
        sum += i;
      }
    }
    
    System.out.println(sum);
    
  }
  
}

Measured memory_bytes: 35712
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
int main() {
cout<<fixed<<setprecision(10);
string S;
  cin >>S;
  int len=S.size();
  int dif = 999;
  for (int i=0; i<len-2 ;i++){
   int num=0;
    num += 100*(S.at(i)-48)+10*(S.at(i+1)-48)+S.at(i+2)-48;
    //cout << 100*(int)S.at(i) <<endl;
    dif=min (dif, abs(num-753));
  }
  
                 
cout << dif << endl;
	
}

Measured memory_bytes: 256
#include <cstdio>
#define rg register
using namespace std;
typedef long long ll;
const int maxn=500010;
template <typename Tp> inline int getmin(Tp &x,Tp y){return y<x?x=y,1:0;}
template <typename Tp> inline int getmax(Tp &x,Tp y){return y>x?x=y,1:0;}
template <typename Tp> inline void read(Tp &x)
{
    x=0;int f=0;char ch=getchar();
    while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if(ch=='-') f=1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    if(f) x=-x;
}
int n,m,d,x,a[maxn],dis[maxn],f[maxn];
inline int abs(int x){return x<0?-x:x;}
int main()
{
	read(n);read(dis[0]);
	for(rg int i=1;i<=n;i++)
	{
		read(a[i]);
		dis[i]=dis[i-1];
		getmin(dis[i],abs(dis[i-1]-a[i]));
	}
	read(m);f[n+1]=0;
	for(rg int i=n;i;i--)
	{
		f[i]=f[i+1];
		if(a[i]<=(f[i+1]<<1|1)) f[i]+=a[i];
	}
	while(m--)
	{
		read(x);
		if(dis[x-1]>f[x+1]) puts("YES");
		else puts("NO");
	}
	return 0;
}

Measured memory_bytes: 7680
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>//cout << fixed からの cout << setprecision(n) << 小数　によって小数を整数部分含めてn桁表示できるようにする
#include <cctype>
#include <unordered_map>
#include <math.h>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
  ll n;
  ll ans;
  cin >> n;
  for(int i = 1;i <= sqrt(n);i++){
    if(n % i == 0) ans = (n / i) + i - 2;
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <unistd.h>
#include <random>

using namespace std;
typedef long long int LL;
typedef long long int LLint;
typedef pair<int,int> intpair;
typedef pair<bool,bool> boolpair;
typedef pair<string,string> strpair;
typedef pair<LL,LL> LLpair;
typedef pair<double,double> doublepair;
typedef pair<float,float> floatpair;
typedef vector<int> intvector;
typedef vector<bool> boolvector;
typedef vector<string> strvector;
typedef vector<LL> LLvector;
typedef vector<double> doublevector;
typedef vector<float> floatvector;
#define wait(sec) usleep((sec) * 1000000)
#define ED return 0;
#define TEST cout << "OK" << endl;
#define UP(a,b) ((a+(b-1))/b)
#define SORT(vec) sort(vec.begin(),vec.end());
#define DOUBLECHANGE(count) cout << setprecision(count);
#define REV(vec) reverse(vec.begin(),vec.end());
#define ipow(x,y) LL(pow(x,y))
#define INF 999999999
const long long mod = 1000000007;

int main(){
//    random_device rnd;
//    mt19937 mt(rnd());
      cin.tie(0);
      ios::sync_with_stdio(false);
      int N, M, C;
      cin >> N >> M >> C;
      vector<int> B (M);
      vector<vector<int>> A (N,vector<int>(M));
      for(int i = 0;i < M;i++){
      	cin >> B[i];
      }
      for(int i = 0;i < N;i++){
      	for(int j = 0;j < M;j++){
      		cin >> A[i][j];
      	}
      }
      
      int ans = 0;
      for(int i = 0;i < N;i++){
      	int sum = C;
      	for(int j = 0;j < M;j++){
      		sum += A[i][j]*B[j];
      	}
      	if(sum > 0){
      		ans++;
      	}
      }
      cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <string>
#include <utility>

using namespace std;

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

int main(){
    int w, h;
    while(cin >> w >> h && w > 0 && h > 0){
        string tmp;
        pair<int, int> init;
        vector<vector <int> > grid(25, vector<int>(25, -1));
        vector<vector <int> > visited(25, vector<int>(25, 0));
        for(int i = 0; i < h; i++){
            cin >> tmp;
            for (int j = 0; j < w; j++){
                if(tmp[j] == '.'){
                    grid[i][j] = 0;
                }else if(tmp[j] == '#'){
                    grid[i][j] = -1;
                }else if(tmp[j] == '@'){
                    grid[i][j] = 0;
                    init = make_pair(i, j);
                }
            }
        }
        queue<pair<int, int> > Q;
        Q.push(init);
        visited[init.first][init.second] = 1; 
        while(!Q.empty()){
            pair<int, int> cur = Q.front(); 
            Q.pop();
            int cur_x = cur.first;
            int cur_y = cur.second;
            for(int i = 0; i < 4; i++){
                pair<int, int> dst = make_pair(cur_x + dx[i], cur_y + dy[i]);
                int x = dst.first;
                int y = dst.second;
                if(0 <= x && 0 <= y && grid[x][y] == 0 && visited[x][y] == 0){
                    Q.push(dst);
                    visited[x][y] = 1;
                }
            }
        }
        int ans = 0;
        for(int i = 0; i < h; i++){
            for (int j = 0; j < w; j++){
                ans += visited[i][j];
            }
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 3172