akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define endl              "\n"
#define pb              push_back
#define fir               first
#define sec               second
#define all(v)            ((v).begin()), ((v).end())
#define sz(v)            ((int)((v).size()))
#define ll              long long
#define ld              long double
#define lp(i, n)        for(int i = 0 ; (int)i<n ; i++)
#define loop(i, x, n)       for(int i=x ; (int)i<=n ; i++)
#define isPowerOfTwo(s) (!(s & (s-1)))
#define vll vector<ll>
typedef vector<int> vi;
typedef deque<int> de;
void origi() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
}
void tiranga() {
    ll l, r, dif = 0;
    cin >> l >> r;
    dif = r - l;
    if (dif >= 2019) cout << 0;
    else {
        int Min = INT_MAX;
        loop(i, l, r-1) {
            loop(j, i + 1, r)
                Min = min(Min, (((i%2019)*(j%2019)) % 2019));
        }
        cout << Min;
    }
}
int main() {
#ifndef ONLINE_JUDGE.
    //freopen("input.txt", "r", stdin);
#else
#endif

    origi();
    tiranga();
    //cout << sumOfDig(123654);
   // genLarge(10, 10);
   // genSmall(10);

}

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

int main(){
    string s,t;
    cin>>s;
    int q;
    cin>>q;
    int ty;
    rep(i,q){
        cin>>ty;
        if(ty==1){
            swap(s,t);
        }else{
            int f;char c;
            cin>>f>>c;
            if(f==1){
                t+=c;
            }else{
                s+=c;
            }
        }
    }
    reverse(t.begin(),t.end());
    t+=s;
    cout<<t<<endl;
}

Measured memory_bytes: 1128
#include <cstdio>
typedef long long int64;
int64 n, a, b;
int main()
{
    scanf("%lld%lld%lld", &n, &a, &b);
    if((n > 1&&a <= b)||(a == b&&n == 1))
        printf("%lld\n", b*(n-1)+a-(a*(n-1)+b)+1);
    else puts("0");
    return 0;
}

Measured memory_bytes: 128
#include "bits/stdc++.h"
using namespace std;
const int N = 55;
const int mod = 1e9 + 7;
int n;
char a[N];
char b[N];
int main(){
	scanf("%d" , &n);
	scanf("%s" , a + 1);
	scanf("%s" , b + 1);
	int start;
	int ans = 1;
	if(a[1] == b[1]){
		start = 2;
		ans = 3;
	}
	else{
		start = 3;
		ans = 6;
	}
	while(start <= n){
		if(a[start - 1] == b[start - 1]){
			if(a[start] == b[start]){
				ans = (ans * 2LL) % mod;
				++start;
			}
			else{
				ans = (ans * 2LL) % mod;
				start += 2;
			}
		}
		else{
			if(a[start] == b[start]){
				++start;
			}
			else{
				ans = (ans * 3LL) % mod;
				start += 2;
			}
		}
	}
	printf("%d\n" , ans);
}

Measured memory_bytes: 256
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    dead_code
)]
use proconio::input;
//use proconio::marker::Usize1;
use proconio::marker::Chars;
//use std::collections::HashSet;
// use std::cmp::*;

const M: u64 = 1000_000_007;

fn main() {
    input! {
        k:u64,
        s:Chars
    }
    let n = s.len();
    // 最後の文字以降におく文字数をiとすると、
    // 文字のえらび方は、25.pow(k-i)*26.pow(i)
    // また、n-1 文字の挿入位置は (k-i+n-1 choose n-1)
    // n choose k = n*(n-1)*...*(n-k+1) /(k*...*1) なので、
    // あとは、各iについて、合計すればよい。
    let mut fact = vec![1u64; 2_000_010];
    let mut inv_fact = vec![1u64; 2_000_010];
    let mut pow25 = vec![1u64; 1_000_010];
    let mut pow26 = vec![1u64; 1_000_010];
    fact[0] = 1;
    for i in 0..2_000_005 {
        fact[i + 1] = fact[i] * ((i + 1) as u64) % M;
        inv_fact[i] = modInv(fact[i]);
    }
    pow25[0] = 1;
    pow26[0] = 1;
    for i in 0..1000_001 {
        pow25[i + 1] = pow25[i] * 25 % M;
        pow26[i + 1] = pow26[i] * 26 % M;
    }
    let choose = |n, k| fact[n as usize] * inv_fact[n - k] % M * inv_fact[k] % M;
    // ここまでは計算の準備。
    let mut ans = 0u64;
    for i in 0..k + 1 {
        ans += choose(n + (k as usize) - (i as usize) - 1, n - 1) * pow25[(k - i) as usize] % M
            * pow26[i as usize]
            % M;
    }
    println!("{}", ans % M);
}
fn modPow(x: u64, a: u64) -> u64 {
    if a == 0 {
        1
    } else {
        if a == 1 {
            x
        } else {
            if a % 2 != 0 {
                (modPow(x, a - 1) * x) % M
            } else {
                let t = modPow(x, a / 2);
                t * t % M
            }
        }
    }
}
fn modInv(x: u64) -> u64 {
    modPow(x, M - 2)
}


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

int main() {
  int a,b,c;
  cin >> a >> b >> c;
  if((a == b && a == c) && a%2 == 0){
    cout << -1 << endl;
    return 0;
  }
  int cnt = 0;
  while(a%2 == 0 && b%2 == 0 && c%2 == 0){
    cnt++;
    int aa,bb,cc;
    aa = b/2+c/2;
    bb = a/2+c/2;
    cc = a/2+b/2;
    a = aa;b == bb;c = cc;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 256
/*


The woods are lovely, dark and deep,   
But I have promises to keep,   
And miles to go before I sleep,   
And miles to go before I sleep.


*/
#include <iostream>
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll n,a;
    vector<ll> h;
    cin >> n;
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        h.push_back(a);
    }
    ll dp[n + 1];
    ll ans = 0;
    dp[0] = 0;
    dp[1] = abs(h[1] - h[0]);
    ans += dp[1];
    for (int i = 2; i < n; i++)
    {
        dp[i] = min(abs(h[i] - h[i - 1])+dp[i-1], abs(h[i] - h[i - 2])+dp[i-2]);
        //ans += dp[i];
    }
    cout << dp[n-1];
}

Measured memory_bytes: 1908
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,k,n) for(int i = (int)(k); i < (int)(n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) a.begin(), a.end()
#define MS(m,v) memset(m,v,sizeof(m))
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int, int> pii;
const int MOD = 1e9 + 7;
template<class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template<class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
template<class T>
istream& operator >> (istream& is, vector<T>& v)
{
	for (auto &i : v) is >> i;
	return is;
}
template<class T>
ostream& operator<<(ostream& os, vector<T>& v)
{
	const string delimiter = "\n";
	REP(i, v.size())
	{
		os << v[i];
		if (i != v.size() - 1) os << delimiter;
	}
	return os;
}
/*--------------------template--------------------*/

int main()
{
	cin.sync_with_stdio(false); cout << fixed << setprecision(10);
	string s; cin >> s;
	ll cnt = 0;
	ll ans = 0;
	REP(i, s.size())
	{
		if (s[i] == 'B') cnt++;
		else
		{
			ans += cnt;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 720
import math
from math import gcd,pi,sqrt
INF = float("inf")
MOD = 10**9 + 7

import sys
sys.setrecursionlimit(10**6)
import itertools
import bisect
from collections import Counter,deque
def i_input(): return int(input())
def i_map(): return map(int, input().split())
def i_list(): return list(i_map())
def i_row(N): return [i_input() for _ in range(N)]
def i_row_list(N): return [i_list() for _ in range(N)]
def s_input(): return input()
def s_map(): return input().split()
def s_list(): return list(s_map())
def s_row(N): return [s_input for _ in range(N)]
def s_row_str(N): return [s_list() for _ in range(N)]
def s_row_list(N): return [list(s_input()) for _ in range(N)]


def main():
    x = i_input()
    t = x%11
    if t == 0:
        t = 0
    elif t <= 6:
        t = 1
    else:
        t = 2
    if x < 11:
        print(t)
    else:
        print((x//11)*2 +t)


if __name__=="__main__":
    main()


Measured memory_bytes: 65844
N = int(input())
task = [list(map(int, input().split())) for i in range(N)]
task = sorted(task, key=lambda x: x[1])

ans = 0
for i in range(N):
    ans += task[i][0]
    if ans > task[i][1]:
        print("No")
        exit()

print("Yes")


Measured memory_bytes: 55264
import numpy as np
import heapq
N,M=map(int,input().split())
cost = list(map(int,input().split()))
ln=np.array(cost)
ln=ln*-1
cost=ln.tolist()
heapq.heapify(cost)
for i in range(M):
    v=heapq.heappop(cost)/2
    heapq.heappush(cost,v)
su=0
for i in range(len(cost)):
    x=-cost[i]
    su=su+int(x)
print(su)

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

int main() {

	int n; cin >> n;
	vector<int> p(n),q(n);
	for (int i = 0; i < n; i++) {
		cin >> p[i];
		q[i] = i + 1;
	}
	int cnt = 0;
	for (int i = 0; i < n; i++) {
		if (p[i] != q[i]) cnt++;
	}
	if (cnt <= 2) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>

using namespace std;

typedef vector<int> VI;
typedef long long ll;

struct Gift {
	int l, r;
	Gift() {}
	Gift(int l, int r) : l(l), r(r) {}
	bool operator<(const Gift& g) const {
		return (r-l) < (g.r - g.l);
	}
	bool operator>(const Gift& g) const {
		return (r-l) > (g.r - g.l);
	}
	int len() const {
		return r-l+1;
	}
};

struct Fenwick {
	VI y;
	int m;
	Fenwick(int m_) {
		m = m_ + 10;
		y = VI(m, 0);
	}
	void add(int i, int val) {
		for (; i < m; i += i&(-i)) {
			y[i] += val;
		}
	}
	void addinterval(int l, int r, int val) {
		add(l, val);
		add(r+1, -val);
	}
	int sum(int i) {
		int ans = 0;
		for (; i; i -= i&(-i)) {
			ans += y[i];
		}
		return ans;
	}
};


int main() {
	int n, m;
	cin >> n >> m;
	VI sols(m+1, 0);
	sols[1] = n;
	priority_queue<Gift, vector<Gift>, std::greater<Gift> > q;
	for (int i = 0, li, ri; i < n; ++i) {
		cin >> li >> ri;
		q.emplace(li, ri);
	}
	Fenwick ft(m);
	for (int d = 2; d <= m; ++d) {
		while (!q.empty() && q.top().len() < d) {
			Gift g = q.top();
			q.pop();
			ft.addinterval(g.l, g.r, 1);
		}
		sols[d] = q.size();
		for (int i = d; i <= m; i += d) {
			sols[d] += ft.sum(i);
		}
	}
	for (int d = 1; d <= m; ++d) cout << sols[d] << '\n';
}

Measured memory_bytes: 4976
#include<cstdio>
#include<cstring>
#include<iostream>
#define N 200010
using namespace std;
typedef long long LL;

int a[N], ans[N], L[N], R[N];
char c[N];

int main()
{	
	scanf("%s", c + 1);
	int n = strlen(c + 1), now = 0, Ltop = 0;
	LL res = 0;
	for(int i=1; i<=n; ++i)
	{
		if(c[i] == '(')
		{
			a[++now] = 0;
			ans[now] = 0;
			L[++Ltop] = now;
		}
		else if(c[i] == ')')
		{
			a[++now] = 1;
			if(Ltop)
			{
				ans[now] = ans[L[Ltop] - 1] + 1;
				res += ans[now];
				R[now] = L[Ltop];
				--Ltop;
			}
			else
			{
				R[now] = 0;
				ans[now] = 0;
			}
		}
		else
		{
			if(a[now])
			{
				res -= ans[now];
				if(R[now])
					L[++Ltop] = R[now];
			}
			else
			{
				--Ltop;
			}
			ans[now] = 0;
			--now;
		}
		printf("%lld\n", res);
	}
}


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

template<class Itr> auto rle(Itr first, Itr last) {
  vector< pair<decltype(*first), int> > res;
  for (; first != last; ++first) {
    if (res.empty() or res.back().first != *first) {
      res.emplace_back(*first, 1);
    } else {
      ++res.back().second;
    }
  }
  return res;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  int m, n;
  cin >> m >> n;
  vector<int> a(n);
  for (auto&& e : a) {
    cin >> e;
    --e;
  }
  int res = 0;
  if (m == 2) {
    res = n;
    int crr = 0;
    for (int i = 0; i < n; ++i) {
      crr += a[i] == (i & 1);
    }
    res = min(res, crr);
    crr = 0;
    for (int i = 0; i < n; ++i) {
      crr += a[i] != (i & 1);
    }
    res = min(res, crr);
  } else {
    for (auto e : rle(begin(a), end(a))) {
      res += e.second / 2;
    }
  }
  cout << res << '\n';
}



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

const int N = 2e5+15;

int a[N];
bool canDoit(int n,int maxi){
	if(maxi==1){
		for(int i=0;i<n-1;++i){
			if(a[i]>=a[i+1]){
				return false;
			}
		}
		return true;
	}
	stack<pair<int,int> >st;
	for(int i=0;i<n;++i){
		if(i==0){
			st.push(make_pair(a[i],1));
			continue;
		} else {
			bool big = true;
			while(!st.empty()){
				if(st.top().first>=a[i]){
					big = false;
				}
				if(st.top().first<=a[i]){
					break;
				} else {
					st.pop();
				}
			}
			if(big){
				st.push(make_pair(a[i],1));
			} else {
				int cur = a[i];
				while(!st.empty()){
					if(st.top().first <cur){
						st.push(make_pair(cur,2));
						break;
					} else {
						if(st.top().second +1 > maxi){
							st.pop();
							--cur;
						} else {
							st.top().second += 1;
							break;
						}
					}
				}
				if(st.size()==0 && cur>0){
					st.push(make_pair(cur,2));
				}
			}
			if(st.empty()){
				return false;
			}
		}
	}
	return true;
}
void solve(){
	int n;
	scanf("%d",&n);
	for(int i=0;i<n;++i){
		scanf("%d",&a[i]);
	}
	int l = 1,r = n,mid;


	while(l<r){
		mid = (l+r)/2;
		if(canDoit(n,mid)){
			r = mid;
		} else {
			l = mid+1;
		}
	}
	printf("%d\n",l);
}

int main(){
	//freopen("input.txt","r",stdin);
	solve();
}

Measured memory_bytes: 2720
#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()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef pair<int, int> p;
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int a, b, t;
    cin >> a >> b >> t;

    cout << b * (t / a) << endl;

    
}

Measured memory_bytes: 256
s = input()
n = len(s)
ans = 0
for i in range(2**(n-1)):
    x = []
    for j in range(n):
        x.append(s[j])
        if (i>>j) & 1:
            y = int("".join(x))
            ans += y
            x = []
        else:
            pass
    if x != []:
        y = int("".join(x))
        ans += y
print(ans)

Measured memory_bytes: 3060
def main():
    MOD = 10 ** 9 + 7
    H, W = list(map(int, input().split(' ')))
    A = [input() for _ in range(H)]
    dp = [[0 for _ in range(W)] for _ in range(H)]
    for w in range(W):
        if A[0][w] == '#':
            break
        dp[0][w] = 1
    for h in range(H):
        if A[h][0] == '#':
            break
        dp[h][0] = 1
    for h in range(1, H):
        for w in range(1, W):
            if A[h][w] == '#':
                continue
            dp[h][w] = (dp[h - 1][w] + dp[h][w - 1]) % MOD
    print(dp[-1][-1])


if __name__ == '__main__':
    main()


Measured memory_bytes: 44644
/*
	dp[i][j][0] = max. possible score possible from a[i, i+1, .... j-1, j]
	dp[i][j][1] = min. possible score possible from a[i, i+1, .... j-1, j]
*/

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

ll dp[3005][3005][2];

int main(){
	int n;
	vector<ll> a;
	cin>>n;
	a.assign(n+1, 0);
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	memset(dp, 0, sizeof dp);
	for(int i=n-1;i>=0;i--){
		dp[i][i][0] = a[i];
		dp[i][i][1] = -a[i]; 
		for(int j=i+1;j<n;j++){
			dp[i][j][0] = max(dp[i+1][j][1]+a[i], dp[i][j-1][1]+a[j]);
			dp[i][j][1] = min(dp[i+1][j][0]-a[i], dp[i][j-1][0]-a[j]);
		}
	}
	cout<<dp[0][n-1][0]<<"\n";
	return 0;
}

Measured memory_bytes: 141312
#include <stdio.h>
#include <iostream>
#include <cmath>
#include <algorithm>

using namespace std;

void solve()
{
	int k, a, b;
	cin >> k>>a>>b;

	for(int i = a; i <= b; ++i)
	{
		if(i % k == 0)
		{
			cout << "OK" << endl;
			return;
		}
	}
	cout << "NG" << endl;
}

int main()
{
	solve();

	return 0;
}

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

int main()
{
    int a , b , hole , ans = 0;
    
    cin >> a >> b;
    
    hole = 1;
    
    while(hole < b){
        ans ++;
        
        hole += a-1;
    }
    
    cout << ans << endl;
    
    return (0);
}

Measured memory_bytes: 3640
use std::io::Read;

fn run() {
    let mut s = String::new();
    std::io::stdin().read_to_string(&mut s).unwrap();
    let mut it = s.trim().split_whitespace();
    let n: usize = it.next().unwrap().parse().unwrap();
    let m: usize = it.next().unwrap().parse().unwrap();
    let mut g = vec![vec![]; n];
    for _ in 0..m {
        let s: usize = it.next().unwrap().parse::<usize>().unwrap() - 1;
        let t: usize = it.next().unwrap().parse::<usize>().unwrap() - 1;
        g[s].push(t);
    }
    let mut dp = vec![0.0; n];
    for v in (0..(n - 1)).rev() {
        let p = 1.0 / (g[v].len() as f64);
        dp[v] = 1.0;
        for &u in &g[v] {
            dp[v] += p * dp[u];
        }
    }
    let mut ans = dp[0];
    for v in 0..(n - 1) {
        if g[v].len() == 1 {
            continue;
        }
        let mut dp = dp.clone();
        let mut sum = 0.0;
        for &u in &g[v] {
            sum += dp[u];
        }
        let p = 1.0 / (g[v].len() - 1) as f64;
        for &u in &g[v] {
            let t = 1.0 + (sum - dp[u]) * p;
            if t < dp[v] {
                dp[v] = t;
            }
        }
        for v in (0..v).rev() {
            let p = 1.0 / (g[v].len() as f64);
            dp[v] = 1.0;
            for &u in &g[v] {
                dp[v] += p * dp[u];
            }
        }
        if dp[0] < ans {
            ans = dp[0];
        }
    }
    println!("{:.9}", ans);
}

fn main() {
    run();
}


Measured memory_bytes: 8444
#include <iostream>
#include <stdlib.h>
#include <utility>
#include <math.h>
#include <stdexcept>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <string.h>
#define   FOR(i,n) for(int i=0;i<n;i++)

using namespace std;
int int_sort(const void*a,const void *b) {
    return *(  int *) b - *(int *) a;
    //qsort(b, a, sizeof(long long int), int_sort);
}

template<typename T>
istream& operator >>(istream& is, vector<T>& vec){
    for(T& x: vec) is >>x;
    return is;
}
int main() {
	int N,M,k,cnt=0;
	cin >> N >> M;
	int tmp;
	vector<int> flag(10000);
	FOR(i,N){
		cin>>k;
		FOR(m,k){
			cin>>tmp;
			flag[tmp-1]++;
		}
	}
	FOR(i,M){
		if(flag[i]==N)
			cnt++;
	}
	cout<<cnt;
	return 0;

}


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

#define ll long long
#define ld long double
#define F first
#define S second

//#define ONLINE_JUDGE 1

using namespace std;

const int mod = 1e9+7;

void solve(){
	int x;
	cin >> x;
	ll a = 0;
	a += (x / 500) * 1000;
	x%=500;
	a+=  (x / 5) * 5;
	cout << a << "\n";
}

int main(){
//	#ifndef ONLINE_JUDGE	
//		freopen("in.txt","r",stdin);
//		freopen("out.txt","w",stdout);
//	#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL),cout.tie(NULL);		
	int t = 1;
	//cin >> t;
	while(t--)
		solve();
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <bitset>
#include <utility>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<pair<int,int>> vpii;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvc;
typedef vector<vector<string>> vvs;
#define rep(i,n) for(int i=0;i<n;i++)
#define fin(ans) cout<<(ans)<<endl
#define P 1000000007
#define STI(s) atoi(s.c_str())//string to int
#define mp(p,q) make_pair(p,q)
#define Sort(a) sort(a.begin(),a.end())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int INF = INT_MAX;
const long long LLINF = 1LL<<60;
//g++ -std=c++1z temp.cpp
//./a.exe
int digit(int a){
    int count = 0;
    for (int i = 0; i < a; i++)
    {   if (a == 0)
        {
            break;
        }else
        {
            a = a/10;
            count++;
        }     
    }
    return count;
}
//pow(x,n) == x^n

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

string s;
cin >> s;
if(s.at(0) != s.at(1) && s.at(1) != s.at(2)&& s.at(0) != s.at(2)){
    cout << "Yes" << endl;
}else{
    cout << "No" << endl;
}



//////////////////////////////////////////////////////
return 0;}

Measured memory_bytes: 256
#include <iostream>//cout<<right で右揃え
#include <iomanip>//cout<<setw(数字) で空白による桁揃え
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <algorithm>
#include <cstdlib>//abs()で整数絶対値
#include <cmath>//abs()かfabs()で少数絶対値
#include <functional>//sort第三引数greater<型名>()で降順
#include <map>

using namespace std;
using ll = long long int;

int main(){
    ll N;cin>>N;
    ll ans = 1;
    vector<ll> a(N);
    for(int i=0;i<N;i++){
        cin >> a[i];
        if(a[i]==0){
            cout << 0 << endl;
            exit(0);
        }
    }
    for(int i=0;i<N;i++){
        ll b = 1000000000000000000 / ans;
        if(a[i]<=b){
            ans *= a[i];
        }else{
            cout << -1 << endl;
            exit(0);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 4412
#include <stdio.h>
int main(void){
    int sum,i,num;
    char name[1000];
    while(1){
        sum=0;
        scanf("%s",name);
        if(name[0]=='0')break;
        for(i=0;i<1001;i++){
            if(name[i]==NULL)break;
            num= name[i] -'0';
            sum=sum+num;
        }
        printf("%d\n",sum);
    }
    return 0;
}



Measured memory_bytes: 2048
N,W=map(int,input().split())

def solve_knapsack(capacity):
    # basic checks
 
    dp = [0]*(capacity + 1)
    # populate the capacity = 0 columns, with '0' capacity we have '0' profit

    for i in range(0, N):
        weights,profits = map(int,input().split())
        for c in range(capacity, weights-1, -1):
            tmp = profits + dp[c - weights]
            if tmp > dp[c]: dp[c] = tmp
 
    # maximum profit will be at the bottom-right corner.
    return dp[capacity]
  
def main():
 
    res = solve_knapsack(W)
 
    print(res)
if __name__ == "__main__":
	main()

Measured memory_bytes: 9716
#include<bits/stdc++.h>
using namespace std;
char s;
long long a,b;
int main()
{
 //freopen(".in","r",stdin);
 //freopen(".out","w",stdout);
 scanf("%d",&a);
 cin>>s;
 scanf("%d",&b);
 if(s=='+')
 printf("%d",a+b);
 if(s=='-')
 printf("%d",a-b);
 return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string.h>
#include <algorithm>
#include <vector>
#include <queue>

using namespace std;
typedef long long ll;
const ll INF=100000000000000LL;

int main() {
	string s;
	cin>>s;
	for(int i=0;i<s.size();i+=2){
		cout<<s[i];
	}
	cout<<endl;
		return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#include <cmath>
#include <set>

#define lowbit(x) (x&(-x))
#define MAX(a,b) (a<b?b:a)
#define MIN(a,b) (a<b?a:b)
using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const int N = 1e7;
const int maxn = 2e3 + 5;
ll mod = 1e9 + 7;

int a[3];

int main()
{
	for (int i = 0; i < 3; i++) scanf("%d", a + i);
	sort(a, a + 3);

	int ans = a[2] - a[1];
	a[0] += ans;
	if (a[2] % 2 == a[0] % 2) printf("%d", ans + (a[2] - a[0]) / 2);
	else printf("%d", ans + (a[2] - a[0]) / 2 + 2);
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        long N = sc.nextInt();
        long D = sc.nextInt();
        int count = 0;
        for(int i = 0; i < N; i++){
            long X = sc.nextInt();
            long Y = sc.nextInt();
            if(X*X+Y*Y > D*D){
                continue;
            }
            count++;
        }
        System.out.println(count);
    }
}


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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  string s;
  cin >> s;
  for (auto& ss : s) {
    ss = 'x';
  }
  cout << s << '\n';
  return 0;
}

Measured memory_bytes: 3652
A,V=map(int,input().split())
B,W=map(int,input().split())
T=int(input())

if A<B:
    a=V*T
    b=W*T
    a=A+a
    b=B+b
    if b<=a:
        print("YES")
    else:
        print("NO")
elif B<A:
    a=V*T
    b=W*T
    a=A-a
    b=B-b
    if a<=b:
        print("YES")
    else:
        print("NO")
else:
    print("YES")

Measured memory_bytes: 9184
#include <iostream>
#include <cstdio>
using namespace std;
typedef long long ll;
#define M 200000

ll cnt = 0;
int A[M], L[M / 2 + 1], R[M / 2 + 1];
 
int merge(int l, int m, int r){
    int n1 = m - l, n2 = r - m, i, j;
    for(i = 0;i < n1;i++)L[i] = A[i + l];
    for(i = 0;i < n2;i++)R[i] = A[i + m];
    i = j = 0;
    for(int k = 0;k < r - l;k++){
        if(j == n2 || (i < n1 && L[i] <= R[j]))A[k + l] = L[i++];
        else A[k + l] = R[j++], cnt += n1 - i;
    }
}

int mergeSort(int l, int r){
    if(l + 1 < r){
        int m = (l + r) / 2;
        mergeSort(l, m);
        mergeSort(m, r);
        merge(l, m, r);
    }
}
 
int main(){
    int n;
    scanf("%d", &n);
    for(int i = 0;i < n;i++)scanf("%d", &A[i]);
	mergeSort(0, n);
	printf("%lld\n", cnt);
     
    return 0;
}

Measured memory_bytes: 4756
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <algorithm>

using namespace std;
using lint = long long;
constexpr int MOD = 1000000007, INF = 1010101010;
constexpr lint LINF = 1LL << 60;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (const auto &e : vec) os << e << (&e == &vec.back() ? "" : " ");
	return os;
}

#ifdef _DEBUG
template <class T>
void dump(const char* str, T &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + (*(str + 1) == ' ' ? 2 : 1), t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	lint n, s;
	cin >> n >> s;

	auto check = [&](lint b) {
		if (b < 2) return false;
		lint tmp = n, sum = 0;
		while (tmp) {
			sum += tmp % b;
			tmp /= b;
		}
		return sum == s;
	};

	auto end = [&](lint b) {
		cout << b << "\n";
		exit(0);
	};

	if (n < s) end(-1);
	else if (n == s) end(n + 1);

	for (int i = 2; i < 320000; i++) if (check(i)) end(i);
	for (int i = 320000; i >= 1; i--) {
		lint b = (n - s) / i + 1;
		if (check(b)) end(b);
	}

	end(-1);

}


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

using namespace std;

const auto MOD = (long long) 1e9 + 7;

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

    vector<long long> a(n);
    for (int i = 0; i < n; ++i) {
        cin >> a[i];
    }

    long long ans = 0;
    long long fac = 1;
    for (int i = 0; i < 60; ++i) {
        long long one = 0;
        for (int j = 0; j < n; ++j) {
            if (a[j] >> i & 1) one++;
        }
        long long t = (one % MOD) * ((n - one) % MOD) % MOD;
        ans += t * fac % MOD;
        ans %= MOD;
        fac = (fac * 2) % MOD;
    }

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

Measured memory_bytes: 2560
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

ll inv(ll a) {
    ll b = mod - 2, c = 1;
    while (b) {
        if (b % 2) c = c * a % mod;
        a = a * a % mod;
        b >>= 1;
    }
    return c;
}

int main() {
    ios::sync_with_stdio(false);
    ll n, m, k, z = 1;
    cin >> n >> m >> k;
    for (ll i = n * m - k + 1; i <= n * m - 2; i++) z = z * i % mod;
    for (ll i = 1; i <= k - 2; i++) z = z * inv(i) % mod;
    cout << z * ((n + 1) * n % mod * (n - 1) % mod * 166666668 * m % mod * m % mod + (m + 1) * m % mod * (m - 1) % mod * 166666668 * n % mod * n % mod) % mod;
}


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

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





using ll = long long;

const ll mod = 1e9+7;
const int maxn = 30;



int n, d;
int x[maxn][maxn];

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

    cin>>n>>d;
    int res=0;
    for (int i=0; i<n; i++) {
	for (int j=0; j<d; j++) {
	    cin>>x[i][j];
	}
    }
    for (int i=0; i<n; i++) {
	for (int j=i+1; j<n; j++) {
	    ll dist=0;
	    for (int k=0; k<d; k++) {
		dist += 1ll*(x[i][k]-x[j][k])*(x[i][k]-x[j][k]);
	    }
	    ll f = sqrtl(dist);
	    if (f*f==dist)res++;
	}
    }
    cout<<res<<endl;
    
    
    return 0;
}


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

int main(){
  int n;
  cin >> n;
  vector<int> b(n-1);
  rep(i,n-1)  cin >> b[i];

  int ans=b[0];
  REP(i,1,n-1)  ans+= min(b[i], b[i-1]);
  ans+= b[n-2];
  
  cout << ans << endl;
}

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

int main()
{
    int a, b, c;
    cin >> a >> b;

    c = a + b;

    if(c == a || c == b || c > 3)
    {
        if(a > b)
            c = a - b;
        else
            c = b - a;
    }

    cout << c << endl;

    return 0;
}


Measured memory_bytes: 256
# include <iostream>
# include <vector>
# include <limits>
# include <algorithm>
# include <map>
# include <string>
# include <functional>
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> target;
	int a;
	for (int i = 0; i < m; i++) {
		cin >> a;
		target.emplace_back(a);
	}
	int point[101] = {0};
	for (int i = 0; i < m; i++) {
		int out = 0;
		for (int j = 0; j < n; j++) {
			cin >> a;
			if (a == target[i]) {
				point[j]++;
			}
			else {
				out++;
			}
		}
		point[target[i]-1] += out;
	}
	for (int i = 0; i < n; i++) {
		cout << point[i] << endl;
	}
}

Measured memory_bytes: 3148
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cctype>
 
#include <algorithm>
#include <tuple>
#include <random>
#include <bitset>
#include <queue>
#include <functional>
#include <set>
#include <map>
#include <vector>
#include <chrono>
#include <iostream>
#include <limits>
#include <numeric>

#define LOG(FMT...) fprintf(stderr, FMT)

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

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

template <class T>
istream& operator>>(istream& is, vector<T>& v) {
  for (T& x : v)
    is >> x;
  return is;
}

ostream& operator<<(ostream& os, const pair<char, int>& unit) {
  return os << unit.first << "^" << unit.second;
}

template <class T>
ostream& operator<<(ostream& os, const vector<T>& v) {
  if (!v.empty()) {
    os << v.front();
    for (int i = 1; i < v.size(); ++i)
      os << ' ' << v[i];
  }
  return os;
}

string naive(string ba) {
  string ret = ba;
  while (!ba.empty()) {
    ba.erase(0, 1);
    ba.erase(ba.find_first_of('a'), 1);
    ret = max(ret, ba);
  }
  return ret;
}

int main() {
#ifdef LBT
  freopen("test.in", "r", stdin);
  int nol_cl = clock();
#endif
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  
  int n;
  string s;
  cin >> n >> s;
  vector<int> pre(n * 2);
  int cur = 0;
  for (int i = 0; i < n * 2; ++i) {
    if (s[i] == 'a') ++cur;
    else --cur;
    pre[i] = cur;
  }
  string ans;
  vector<string> vs;
  int last = 0;
  for (int i = 0; i < n * 2; i += 2) {
    if (pre[i] < 0) {
      int r = find(pre.begin() + i, pre.end(), 0) - pre.begin();
      last = r + 1;
      vs.push_back(naive(string(s.begin() + i, s.begin() + last)));
      i = r - 1;
    }
  }
  vector<int> match(n * 2);
  queue<int> q;
  for (int i = last; i < n * 2; ++i)
    if (s[i] == 'a')
      q.push(i);
    else {
      match[q.front()] = i;
      q.pop();
    }
  for (int i = last; i < n * 2; ++i) {
    if (s[i] == 'b') continue;
    ans += "ab";
    i = match[i];
  }
  reverse(vs.begin(), vs.end());
  for (const auto& str : vs)
    ans = max(ans, str + ans);
  cout << ans;

#ifdef LBT
  LOG("Time: %dms\n", int ((clock()
          -nol_cl) / (double)CLOCKS_PER_SEC * 1000));
#endif
  return 0;
}


Measured memory_bytes: 384
def main():
  n = int(input())
  a = list(map(int,input().split()))
  MOD = 10 ** 9 + 7
  digit = 60

  ans = 0
  for j in range(digit):
    o = 0
    for i in a:
      if (i >> j) & 1:
        o += 1
    ans += o*(n-o)*2**j
    ans %= MOD
  print(ans)
if __name__ == '__main__':
    main()

Measured memory_bytes: 51064
#include<cstdio>
#include<algorithm>
#include<queue>
#define min(a,b) (a<b?a:b)
using std::sort;
int n,k,q,a[2050],tul[2050],ab[2050],num,ans=0x3f3f3f3f;
void work(int x){
	int beg=0; num=0;
	for(int i=1;i<=n;i++){
		if(a[i]>=a[x]) if(!beg) beg=i;
		if(a[i+1]<a[x]&&beg){
			if(i-beg+1<k){beg=0;continue;}
			for(int j=beg;j<=i;j++) ab[j]=a[j];
			sort(ab+beg,ab+i+1);
			for(int j=beg;j<=i-k+1;j++)
				tul[++num]=ab[j];
			beg=0;
		}
	}
	if(num<q) return ;
	sort(tul+1,tul+num+1);
	ans=min(ans,tul[q]-a[x]);
	return ;
}
int main(){
	scanf("%d%d%d",&n,&k,&q);
	for(int i=1;i<=n;i++) scanf("%d",&a[i]);
	for(int i=1;i<=n;i++)
		work(i);
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdlib>
using namespace std;
int a[100];
int main() {
	int i = 3;
	while (i--) {
		char c;
		cin >> c;
		a[c]++;
	}
	if (a[97] == 1 && a[98] == 1 && a[99] == 1) {
		cout << "Yes";
	}
	else cout << "No";
	
	return 0;
}

Measured memory_bytes: 256
class UnionFind():
    def __init__(self, N):
        self.par = [i for i in range(N)]
        self.rank = [0 for _ in range(N)]
        self.size = [1 for _ in range(N)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]
    
    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            elif self.rank[x] < self.rank[y]:
                x, y = y, x
            self.par[y] = x
            self.size[x] += self.size[y]

    def is_same(self, x, y):
        return self.find(x) == self.find(y)
    
    def get_size(self, x):
        x = self.find(x)
        return self.size[x]

N, M = map(int, input().split())
edges = [list(map(int, input().split())) for i in range(M)]

uf = UnionFind(N)
ans = [None] * M
ans[M-1] = N*(N-1)//2
for i in range(M-1, 0, -1):
    x, y = edges[i][0] - 1, edges[i][1] - 1
    if uf.is_same(x, y):
        ans[i-1] = ans[i]
    else:
        ans[i-1] = ans[i] - (uf.get_size(x) * uf.get_size(y))
    uf.union(x, y)
for i in ans:
    print(i)

Measured memory_bytes: 113240
#coding:utf-8
import sys,os
sys.setrecursionlimit(10**6)
write = sys.stdout.write
dbg = (lambda *something: print(*something)) if 'TERM_PROGRAM' in os.environ else lambda *x: 0
def main(given=sys.stdin.readline):
    input = lambda: given().rstrip()
    LMIIS = lambda: list(map(int,input().split()))
    II = lambda: int(input())
    XLMIIS = lambda x: [LMIIS() for _ in range(x)]
    YN = lambda c : print('Yes') if c else print('No')
    MOD = 10**9+7

    a,b = LMIIS()
    if a < b:
        for i in range(b):
            write(str(a))
        print()
    else:
        for i in range(a):
            write(str(b))
        print()


    

if __name__ == '__main__':
    main()

Measured memory_bytes: 38256
def check_prime(k):
    '''
    素数の時1、合成数の時0を返す
    '''
    if k == 1:return 0
    num = int(k ** 0.5 // 1)
    for i in range(2, num + 1):
        if k % i == 0:return 0
    return 1
n = int(input())
if n == 1:
    print(0)
    exit()

num = int(n ** 0.5 // 1)
check = []
for i in range(2, num + 2):
    if n % i == 0:
        cnt = 0
        while True:
            if n % i != 0:break
            n = n // i
            if n > num and check_prime(n):
                check.append([n, 1])
            cnt += 1
        check.append([i, cnt])
ans = 0

for num, cnt in check:

    temp = 1
    while True:
        #print(ans, temp, cnt)
        if cnt >= temp:
            ans += 1
            cnt -= temp
            temp += 1
        else:break

print(ans if len(check) != 0 else 1)

Measured memory_bytes: 64048
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt(), B = sc.nextInt(), X = sc.nextInt();
    //There has to be at least A cats
    //There can be at most A+B cats
    //If X is between A and A+B, then it is possible
    if(X >= A && X <= A+B){
      System.out.println("YES"); 
    }
    else{
      System.out.println("NO"); 
    }
  }
}

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

name = list()
while N >= 1:
    num_name = N % 26
    if num_name == 0:
        name.append("z")
    else:
        name.append(chr(ord("a") + num_name - 1))
    N //= 26
    if num_name == 0:
        N -= 1

for i in range(len(name)-1, -1, -1):
    print(name[i], end = "")

Measured memory_bytes: 8924
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();
    int C = scanner.nextInt();
    System.out.println(Math.max(0, C - (A - B)));
  }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)   FOR(i,0,n)
#define pb emplace_back
typedef long long ll;
typedef pair<int,int> pint;

int n,v,u,ai,bi;
vector<int> g[100001];
int dv[100001],du[100001];
queue<pint> q;
int main(){
    cin>>n>>v>>u;
    --v,--u;
    rep(i,n-1){
        cin>>ai>>bi;
        --ai;--bi;
        g[ai].pb(bi);
        g[bi].pb(ai);
    }
    memset(dv,-1,sizeof(dv));
    memset(du,-1,sizeof(du));
    
    du[u]=0;
    q.push(pint(u,0));
    while(!q.empty()){
        pint c=q.front();q.pop();
        for(int nu:g[c.first])if(du[nu]==-1){
            q.push(pint(nu,c.second+1));
            du[nu]=c.second+1;
        }
    }
    dv[v]=0;
    q.push(pint(v,0));
    while(!q.empty()){
        pint c=q.front();q.pop();
        for(int nv:g[c.first])if(dv[nv]==-1){
            q.push(pint(nv,c.second+1));
            dv[nv]=c.second+1;
        }
    }
    int mx=0;
    rep(i,n)if(dv[i]<du[i])mx=max(mx,du[i]-1);
    cout<<mx<<endl;
    return 0;
}

Measured memory_bytes: 6784
#include <iostream>
#include <cmath>

int calc(int x, int y, int z)
{
  return x*x + y*y + z*z + x*y + y*z + z*x;
}

int f(int n)
{
  int num=0;
  for (int x=1; x < sqrt(n); x++)
    for (int y=1; calc(x, y, 1) <= n; y++)
      for (int z=1; calc(x, y, z) <= n; z++)
        if (calc(x, y, z) == n) {
          // std::cout << "(" << x << "," << y << "," << z << ")" << std::endl;
          num++;
        }

  return num;
}

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

  for (int i=1; i <= N; i++)
    std::cout << f(i) << std::endl;
}

Measured memory_bytes: 3256
#include <bits/stdc++.h>
using namespace std;
#define ld long long double
#define ll long long
#define mod 1000000007
#define scl(x) scanf("%lld",&x)
ll mul(ll a,ll b){
    return ((a%mod)*(b%mod))%mod;
}

ll power(ll a,ll b) {
    ll res=1LL;
    while(b>0){
        if(b&1) res = mul(res,a);
        b/=2;
        a = mul(a,a);
    }
    return res%mod;
}


int main(){
    ll n;
    cin >> n;
    setprecision(10);
    double num = (ceil(double(n/2.0)));
    num = num/(double)n;
    cout << fixed << num << endl; 
}

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

int main(){
  int a, b;
  cin >> a >> b;
  
  int ans = 0;
  if(a == 1 && b == 2){
    ans = 3;
  }else if(a == 1 && b == 3){
    ans = 2;
  }else if(a == 2 && b == 1){
    ans = 3;
  }else if(a == 2 && b == 3){
    ans = 1;
  }else if(a == 3 && b == 1){
    ans = 2;
  }else{
    ans = 1;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
//インクルード(アルファベット順)
#include<algorithm>//sort,二分探索,など
#include<bitset>//固定長bit集合
#include<cmath>//pow,logなど
#include<complex>//複素数
#include<deque>//両端アクセスのキュー
#include<functional>//sortのgreater
#include<iomanip>//setprecision(浮動小数点の出力の誤差)
#include<iostream>//入出力
#include<iterator>//集合演算(積集合,和集合,差集合など)
#include<map>//map(辞書)
#include<numeric>//iota(整数列の生成),gcdとlcm(c++17)
#include<queue>//キュー
#include<set>//集合
#include<stack>//スタック
#include<string>//文字列
//#include<unordered_map>//イテレータあるけど順序保持しないmap
//#include<unordered_set>//イテレータあるけど順序保持しないset
#include<utility>//pair
#include<vector>//可変長配列
#include<valarray>//なんとなく追加
//メモ：表示桁数を大きくする　　cout << fixed << setprecision(20) << cm << endl;
using namespace std;
typedef long long ll;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
//xにはvectorなどのコンテナ
#define ALL(x) (x).begin(),(x).end() //sortなどの引数を省略したい
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x)) //最大値を求める
#define MIN(x) *min_element(ALL(x)) //最小値を求める
//定数
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//略記
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first //pairの一つ目の要素
#define S second //pairの二つ目の要素
#define PI acos(-1.0)
#define answer(ans) cout<<ans<<endl;
#define input(N) cin >> N ;

signed main() {
int N,AC=0,WA=0,TLE=0,RE=0;
cin >>N;
string tmp;
REP(i,N){
    cin >> tmp;
if(tmp == "AC"){
        AC+=1;
    }
    if(tmp == "WA"){
        WA+=1;
    }
    if(tmp == "TLE"){
        TLE+=1;
    }
    if(tmp == "RE"){
        RE+=1;
    }
}
cout << "AC x " << AC << endl;
cout << "WA x " << WA << endl;
cout << "TLE x " << TLE << endl;
cout << "RE x " << RE << endl;
return 0;
}

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

#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define MIN(a) *min_element(all(a))
#define MAX(a) *max_element(all(a))
#define SUM(a, b) accumulate(all(a), b)
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1; (i)>=0; (i)--)
#define FOR(i, m, n) for(int (i)=(m); (i)<(n); i++)
#define FORR(i, m, n) for(int (i)=(n)-1; (i)>=(m); i--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
#define debug(x) cerr << #x << " = " << x << endl
//#define int long long

typedef long long ll;
typedef unsigned long long ull;
//ll const MOD = 998244353;
ll const MOD = 1e9+7;
ll const INF = 1e18;

template<typename T> int size(const T& a){return (int)a.size();}
template<typename T> T Div(T a, T b){return (a + b - 1) / b;}
template<typename T> bool chmin(T& a, const T& b){if(a > b){a = b; return true;} return false;}
template<typename T> bool chmax(T& a, const T& b){if(a < b){a = b; return true;} return false;}



signed main(){
    int n, k;
    string s;
    cin >> n >> k >> s;
    s[k-1] -= 'A' - 'a';
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 256
num = input().split(" ")
rec_vertex = [int(num[0]),int(num[1])]
circle_origin = [int(num[2]),int(num[3])]
circle_rad = int(num[4])

if rec_vertex[0] <= circle_origin[0] or rec_vertex[1] <= circle_origin[1]:
    print("No")
elif circle_origin[0] <= 0 or circle_origin[1] <= 0:
    print("No")
elif rec_vertex[0] - (circle_origin[0] + circle_rad) >= 0 and rec_vertex[1] - (circle_origin[1] + circle_rad) >= 0:
    print("Yes")
else:
    print("No")

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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> void chmax(t&a,u b){if(a<b)a=b;};
template<class t, class u> void chmin(t&a,u b){if(a>b)a=b;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  map<char, char> mp;
  mp['A'] = 'T';
  mp['T'] = 'A';
  mp['C'] = 'G';
  mp['G'] = 'C';

  char c;
  IN(c);
  OUT(mp[c]);

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> P;
const ll MOD=1000000007;
const ll MAX_N=500010;
const ll INF=1<<18;
ll dp[1010][1010];
int dh[]={-1,0,0,1};
int dw[]={0,1,-1,0};

int main(){
    int h,w;
    cin>>h>>w;
    int sh,sw,gh,gw;
    cin>>sh>>sw>>gh>>gw;
    sh--; sw--; gh--; gw--;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            dp[i][j]=INF;
        }
    }
    vector<string> G(h);
    for(int i=0;i<h;i++) cin>>G[i];

    dp[sh][sw]=0;
    queue<P> q;
    queue<P> qq;
    q.push(P(sh,sw));
    while(!q.empty()){
        while(!q.empty()){
            P p=q.front(); q.pop();
            int y=p.first;
            int x=p.second;
            qq.push(P(y,x));
            for(int d=0;d<4;d++){
                if(y+dh[d]>=0 && y+dh[d]<h && x+dw[d]>=0 && x+dw[d]<w && G[y+dh[d]][x+dw[d]]=='.' && dp[y+dh[d]][x+dw[d]]>dp[y][x]){
                    dp[y+dh[d]][x+dw[d]]=dp[y][x];
                    q.push(P(y+dh[d],x+dw[d]));
                }
            }
        }
        while(!qq.empty()){
            //cout<<"debug"<<endl;
            P p=qq.front(); qq.pop();
            int y=p.first;
            int x=p.second;
            for(int i=-2;i<3;i++){
                for(int j=-2;j<3;j++){
                    if(y+i>=0 && y+i<h && x+j>=0 && x+j<w && G[y+i][x+j]=='.' && dp[y+i][x+j]>dp[y][x]+1){
                        dp[y+i][x+j]=dp[y][x]+1;
                        q.push(P(y+i,x+j));
                    }
                }
            }
        }
    }
    /*
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            cout<<dp[i][j]<<" ";
        }
        cout<<endl;
    }
    */

    if(dp[gh][gw]==INF){
        cout<<-1<<endl;
    }else{
        cout<<dp[gh][gw]<<endl;
    }


}

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

int main()
{
	int n;

	cin >> n;

	int* num = new int[n];

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

	for (int i = 0;i < n - 1;i++)
	{
		for (int j = i + 1;j < n;j++)
		{
			int tmp = num[i];
			num[i] = num[j];
			num[j] = tmp;
		}
	}

	for (int i = 0;i < n - 1;i++)
	{
		cout << num[i] << ' ';
	}
	cout << num[n - 1] << '\n';

	delete[] num;

	return 0;
}


Measured memory_bytes: 3080