akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define rev(v) reverse(v.begin(), v.end())
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
#define uniq(a) sort(all(a));(a).resize(unique(all(a)) - a.begin());
#define dab(v) for(auto i:v)cout<<i<<' '; cout << endl;
#define vin(v) for (ll i = 0; i < v.size(); ++i) cin >> v[i];
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 (a > b) { a = b; return 1; } return 0; }
int dx[] = { 0, 0, -1, 1 };
int dy[] = { 1, -1, 0, 0 };
int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } }


void dfs(int i, int j, int N, int M, vvi& garden) {
	if (garden.at(i).at(j) == 1) garden.at(i).at(j) = 0;
	repk(k, i - 1, i + 2) {
		repk(l, j - 1, j + 2) {
			if (k < 0 || k >= N || l < 0 || l >= M || (k == i && l == j))continue;
			cout << k << " " << l << endl;
			if (garden.at(k).at(l) == 1)dfs(k, l, N, M, garden);
		}
	}
}


int solve(int N, int M, vvi& garden) {
	int cnt = 0;
	rep(i, N) {
		rep(j, M) {
			if (garden.at(i).at(j) == 1) {
				cnt++;
				dfs(i, j, N, M, garden);
			}
		}
	}
	return cnt;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	//cout << fixed << setprecision(18);
	
	long double A;
	long double B;
	long long int C;
	cin >> A >> B;
	C = floor(A * B);
	cout << C;

	return 0;
}


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

using namespace std;

#define fori(x) for (int i = 0; i < x; ++i)
#define forj(x) for (int j = 0; j < x; ++j)

int main() {
	string s;
	cin >> s;
	switch (s[0]) {
		case 'S':
			cout << "Cloudy";
			break;
		case 'C':
			cout << "Rainy";
			break;
		case 'R':
			cout << "Sunny";
		default:
			break;
	}
	return 0;
}

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

using namespace std;

int main(){
    long long N,M;

    cin>>N>>M;

    vector<pair<long long,long long>> vec(N);
    for(auto &x:vec){
        cin>>x.first>>x.second;
    }

    sort(vec.begin(),vec.end());
    long long ans=0,sum=0;
    long long i=0;

    while(sum<M){
        if(vec[i].second<=M-sum){
            sum+=vec[i].second;
            ans+=vec[i].second*vec[i].first;
        }else{
            ans+=(M-sum)*vec[i].first;
            sum=M;
        }


        ++i;
    }
    

    cout<<ans<<endl;
}

Measured memory_bytes: 1792
macro_rules! get {
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
            get!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
            get!($($t),*)
        ).collect::<Vec<_>>()
    };
    ($t:ty ;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty ;; $n:expr) => {
        (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
    };
}

fn main() {
    let (n, y) = get!(i64, i64);

    for m in 0..n+1 {
        for g in 0..n+1-m {
            let s = n - m - g;
            if m * 10000 + g * 5000 + s * 1000 == y {
                println!("{} {} {}", m, g, s);
                std::process::exit(0);
            }
        }
    }
    println!("{} {} {}", -1, -1, -1);
}


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

#define for_(i,a,b) for(int i=(a);i<(b);++i)

int H, W;
string field[8];

int main() {
	cin >> H >> W;
	for_(i,0,H) cin >> field[i];
	
	int cx = 0, cy = 0;
	field[0][0] = '.';
	while (1) {
		if (cy != H - 1 && field[cy + 1][cx] == '#') {
			field[cy + 1][cx] = '.';
			++cy;
		} else if (cx != W - 1 && field[cy][cx + 1] == '#') {
			field[cy][cx + 1] = '.';
			++cx;
		} else {
			break;
		}
	}
	
	bool isok = true;
	for_(i,0,H) isok &= (field[i].find("#") == field[i].npos);
	cout << (isok ? "Possible" : "Impossible") << endl;
}

Measured memory_bytes: 256
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
N = int(input())

A = a1 + a2 + a3

b = [0]*9
for i in range(N):
    bingo = int(input())
    for j in range(len(A)):
        if bingo == A[j]:
            b[j] = 1

flag = 0
if b[0] + b[1] + b[2]==3:
    flag = 1
if b[3] + b[4] + b[5]==3:
    flag = 1
if b[6] + b[7] + b[8]==3:
    flag = 1
if b[0] + b[3] + b[6]==3:
    flag = 1
if b[1] + b[4] + b[7]==3:
    flag = 1
if b[2] + b[5] + b[8]==3:
    flag = 1
if b[0] + b[4] + b[8]==3:
    flag = 1
if b[2] + b[4] + b[6]==3:
    flag = 1
if flag == 1:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 3064
#include <iostream>

#include<vector>

#include<string>

#include<algorithm>

#include<cmath>

#include<cstdlib>

#define lli long long int

#define ulli unsigned long long int

using namespace std;

int main() {

  string s;

  cin>>s;

  s=s+'S';

  int ans=0, maxi=0;

  //sort(s.begin(),s.end());

  for(int i=0; i<s.size(); i++){

     if(s[i]=='R')

     ans++;

     else {

       maxi=max(ans, maxi);

       ans=0;}

  }

  cout<<maxi<<endl;

}

Measured memory_bytes: 3600
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s=sc.next();
        String t=sc.next();
        char[] schar=new char[s.length()];
        char[] tchar=new char[t.length()];
        for(int i=0;i<s.length();i++){
            schar[i]=s.charAt(i);
        }
        for(int i=0;i<t.length();i++){
            tchar[i]=t.charAt(i);
        }
        Arrays.sort(schar);
        Arrays.sort(tchar);
        for(int i=0;i<Math.min(s.length(),t.length());i++){
            if(schar[i]<tchar[t.length()-i-1]){
                System.out.println("Yes");
                return;
            }else if(schar[i]>tchar[t.length()-i-1]){
                System.out.println("No");
                return;
            }
        }
        if(s.length()<t.length()){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 23124
N,M=map(int,input().split())
A=list(map(int,input().split()))
BC=[list(map(int,input().split())) for i in range(M)]
for i in A:
    BC.append([1,i])
BC.sort(key=lambda x:x[1],reverse=True)
ans=0
num=N
for i,j in BC:
    if num>=i:
        ans+=i*j
        num-=i
    else:
        ans+=num*j
        break
print(ans)


Measured memory_bytes: 97484
#pragma GCC optimize("Ofast")
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip> // setprecision
#include <complex> // complex
#include <math.h> 
#include <functional>
using namespace std;
using ll = long long;
using P = pair<int,int>;
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const int dx[8] = {1, 0, -1, 0,1,1,-1,-1};
const int dy[8] = {0, 1, 0, -1,1,-1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// --------------------------------------------------------------------------

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll D,T,S;
  cin >> D >> T >> S;
  if(T*S >= D){
    cout << "Yes\n";
  }else{
    cout << "No\n";
  }
  return 0;
}

Measured memory_bytes: 3644
#[allow(dead_code)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(dead_code)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

#[allow(dead_code)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize
    }

    let result: usize = (1..=n)
        .into_iter()
        .filter(|i| i % 3 != 0 && i % 5 != 0)
        .fold(0, |sum, a| sum + a);
    println!("{}", result);
}


Measured memory_bytes: 2136
#include<bits/stdc++.h>
/**CLICK ss---> ctrl+j**/
#define PI 2.0*acos(0.0)
#define ll              long long int
#define gcd(a,b)        __gcd(a,b)
#define lcm(a,b)        ((a)*(b))/gcd(a,b)
#define MOD             1000000007
#define mx              123456789
using namespace std;
void solve()
{
   int k;
   cin>>k;
   string s;
   cin>>s;
   if(s.size()<=k)
    cout<<s<<endl;
   else
   {
       for(int i=0; i<k; i++)
       {
           cout<<s[i];
       }
       cout<<"..."<<endl;
   }
}
int main()
{
    int t;
    //cin>>t;
    t=1;
    while(t--)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
const int atoz = 26;

string parse(string str){
	string ret="";
	int ptr=0;
	while(ptr<(int)str.length()){
		int plus = 0;
		while(str[ptr]=='+' || str[ptr]=='-'){
			if(str[ptr]=='+') plus++;
			if(str[ptr]=='-') plus+=atoz-1;
			ptr++;
		}
		if(str[ptr]=='?'){
			ret += "A";
			ptr++;
		}else if('A' <= str[ptr] && str[ptr] <= 'Z'){
			ret += (char)((str[ptr]-'A'+plus)%atoz +'A');
			ptr++;
		}else{
			ptr++;
			int depth = 1;
			int memptr = ptr;
			while(depth!=0){
				if(str[ptr]=='[') depth++;
				if(str[ptr]==']') depth--;
				ptr++;
			}
			string retsub = parse(str.substr(memptr, ptr-memptr-1));
			reverse(retsub.begin(), retsub.end());
			ret += retsub;
		}
	}
	return ret;
}

int main(){
	while(1){
		string str;
		cin >> str;
		if(str==".") break;
		cout << parse(str) << endl;
	} 
	return 0;
}

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

#define rep(i, N) for (ll i = 0; i < N; i++)
#define rep1(i, N) for (ll i = 1; i <= N; i++)
#define repr(i, N) for (ll i = N-1; i >= 0; i--)
#define repr1(i, N) for (ll i = N; i > 0; i--)

#define INF 1000000007

using ll = long long;
using namespace std;

typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<P> vpi;


int main() {
    ll K,N,num,ans=0;
    int A[12];
    rep(i,12) A[i] = -1;
    
    cin >> K;
    
    queue<ll> q;
    rep1(i,9) q.push(i);
    
    ll x;
    rep(i,K){
        x = q.front(); q.pop();
        if(x%10 != 0) q.push(10*x+x%10-1);
        q.push(10*x+x%10);
        if(x%10 != 9) q.push(10*x+x%10+1);
    }
    ans = x;
    
    cout << ans;
    //printf("%.15lf", ans);
    cout << "\n";
    return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <map>
#include <cstdio>
#include <numeric>
#include <iomanip>

using namespace std;

using ll = long long;

int main()
{
    ll N;
    cin >> N;
    ll a = N % 10;
    string ans;
    if(a == 3)
    {
        ans = "bon";
    }
    else if(a == 0 || a == 1 || a == 6 || a == 8)
    {
        ans = "pon";
    }
    else
    {
        ans = "hon";
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3132
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

typedef long long ll;

ll INF = (1<<30);

int main(){
  ll in;
  INF += (1<<30);

  while(cin >> in && in){

    vector<ll> V;

    for(ll i = 0; i < in; i++){
      ll a;
      cin >> a;
      V.push_back(a);
    }
    V.push_back(INF);
    sort(V.begin(),V.end());


    ll ans = -1;
    ll now = V[0];
    while(now != INF){
      if(upper_bound(V.begin(),V.end(),now)-lower_bound(V.begin(),V.end(),now) > in/2) ans = now;
      now = *upper_bound(V.begin(),V.end(),now);
    }
    if(ans == -1) cout << "NO COLOR" << endl;
    else cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 8852
#include <iostream>
#include <algorithm>
#include <vector>
#include <functional>
#include <sstream>
#include <cstdio>
#include <stack>
using namespace std;

// Plastic Board(0032)
int main()
{
	//freopen("0032.txt", "r", stdin);
	int r1 = 0, r2 = 0;
	int s1, s2, d;
	while (scanf("%d,%d,%d", &s1, &s2, &d) != EOF) {
		if (s1*s1 + s2*s2 == d*d)
			++r1;
		else if (s1 == s2)
			++r2;
	}
	cout << r1 << endl << r2 << endl;
	return 0;
}

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

using namespace std;

typedef pair<double, double> P;
typedef long long ll;

int N;
int visited[9] = {0};
vector<P> d;


void solve(){
    double sum = 0.0;
    int n = 0;
    double dx, dy;
    do{
        for (int i = 0; i < N - 1; i++)
        {
            dx = d[i].first - d[i + 1].first;
            dy = d[i].second - d[i + 1].second;
            sum += sqrt(dx * dx + dy * dy);
        }
        n++;
    }while(next_permutation(d.begin(), d.end()));
    printf("%8f\n", sum / (double)n );
}


int main(){
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        P p;
        cin >> p.first >> p.second;
        d.push_back(p);

    }
    sort(d.begin(), d.end());
    solve();

    return 0;

}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include<algorithm>
#include <stdio.h>
#include <bitset>
#include<math.h>
#include<list>
#include<map>
#include <queue>
using namespace std;
using Graph = vector<vector<int>>;
typedef long long ll;
#define PI 3.14159265358979323846  
typedef pair<int, int> P;



int main() {
	string a, b;
	int ans = 0;
	cin >> a >> b;
	for (int i = 0; i < a.length(); i++) {
		if (a.at(i) != b.at(i)) {
			ans++;
		}
	}
	cout << ans<< endl;
}

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


int main(){
    string s,t; cin>>s>>t;
    bool ans=false;

  for(int i=0;i<s.size();i++){
   string a;
    a=s.substr(i,s.size()-i)+s.substr(0,i);
  if(a==t){
    ans=true;
    break;
  }
  }
   if(ans)cout<<"Yes"<<endl;
   else cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <cstdio>

int main()
{
	int a[3];
	int k;
	for (int i = 0; i < 3; i++)
	{
		if (scanf("%d", &a[i]) == -1)return 0;
	}

	if (scanf("%d", &k) == -1)return 0;

	int asum[3];
	int c = 0;
	for (int j = 0; j < 3; j++)
	{
		int ar[3] = { a[0],a[1],a[2] };
		for (int i = 0; i < k; i++)
		{
			ar[c] = ar[c] * 2;
		}
		asum[j] = ar[0] + ar[1] + ar[2];
		c++;
	}

	int max = asum[0];
	for (int i = 1; i < 3; i++)
	{
		if (max < asum[i])
		{
			max = asum[i];
		}
	}
	printf("%d\n", max);
	return 0;
}

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

inline int power(int x, int n){
  int ans=1;
  while(n>=1){
    if(n%2==1){ans*=x;}
    x*=x;
    n/=2;
  }
  return ans;
}

inline int get_numbers(int x, int a, vi& B){
  int ans=0;
  ans-=lower_bound(B.begin(), B.end(), x-a)-B.begin();
  ans+=lower_bound(B.begin(), B.end(), 2*x-a)-B.begin();
  ans-=lower_bound(B.begin(), B.end(), 3*x-a)-B.begin();
  ans+=lower_bound(B.begin(), B.end(), 4*x-a)-B.begin();
  return ans;
}

int main(){
  int N;cin>>N;
  vi A,B;
  vi power_table(30);
  for (int k=0;k<30;++k){
    power_table[k]=power(2, k);
  }
  for (int i=0;i<N;++i){
    int a;cin>>a;
    A.push_back(a);
  }
  for (int i=0;i<N;++i){
    int b;cin>>b;
    B.push_back(b);
  }

  vi Ak[29], Bk[29];
  for (int k=0;k<29;++k){
    for (int i=0;i<N;++i){
      Ak[k].push_back(A[i]%power_table[k+1]);
      Bk[k].push_back(B[i]%power_table[k+1]);
    }
  }

  vi sgn_table(29);
  for (int k=0;k<29;++k){
    sort(Bk[k].begin(), Bk[k].end());
    for (int i=0;i<N;++i){
      int a=Ak[k][i];
      int x=power_table[k];
      int num=get_numbers(x, a, Bk[k]);
      sgn_table[k]+=((num)%2);
    }
  }

  int ans=0;
  for (int k=0;k<29;++k){
    if (sgn_table[k]%2==1){ans+=power_table[k];}
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 48084
#include<stdio.h>
#include<algorithm>
#include<vector>
#include<iostream>
#define K 100001
using namespace std;
int main()
{
  int n,ans;
  ans=0;
  scanf("%d",&n);
  int a[n];
  int b[n+1]={0};
  for(int i=0;i<n;i++)
    {
      scanf("%d",&a[i]);
      if(a[i]>n)
	{
	  ans++;
	}
      else
	{
	  b[a[i]]++;
	}
    }
  for(int i=1;i<(n+1);i++)
    {
      if(b[i]<i)
	{
	  ans+=b[i];
	}
      else if(b[i]>i)
	{
	  ans+=b[i]-i;
	}
    }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
typedef vector<vector<P>> vvP;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

int main() {
    string a, b;
    cin >> a >> b;
    ll c = stoi(a + b);

    exrep(i, 1, 1000) {
        if(i*i == c) {
            out("Yes");
            re0;
        }
    }

    out("No");
    re0;
}

Measured memory_bytes: 256
N,K=map(int,input().split())

if isinstance(N,int)==1 and isinstance(K,int)==1 \
   and 1<=N<=50 and 1<=K<=N :

    S=input()
    null_char=S.replace('A','').replace('B','').replace('C','')

    if len(S)==N and S.isupper()==1 and not null_char:
        small_S=S[K-1:K].lower()
        print(S[:K-1] + small_S + S[K:])

    else :
        print("Unexpected parameter S")
        exit()

else :
    print("Unexpected parameter N or K")
    exit()


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

int main(){
    ll int x,y,a,b,c;
    cin>>x>>y>>a>>b>>c;
    vector<int> p(a),q(b);
    priority_queue<int> r;
    rep(i,a) cin>>p.at(i);
    rep(i,b) cin>>q.at(i);
    rep(i,c){
        int val;
        cin>>val;
        r.push(val);
    }
    sort(p.begin(),p.end(),greater<int>());
    sort(q.begin(),q.end(),greater<int>());
    while(p.size()>x) p.pop_back();
    while(q.size()>y) q.pop_back();
    rep(i,x) r.push(p.at(i));
    rep(i,y) r.push(q.at(i));
    ll int sum=0;
    for(int l=0;l<x+y;++l){
        sum+=(ll int)r.top();
        r.pop();
    }
    cout<<sum<<endl;
    return 0;
}

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

using namespace std;

typedef long long ll;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

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

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  int N, M;
  cin >> N >> M;
  vector<set<int>> G(N);
  int a, b;
  for(int i = 0; i < M; i++){
    cin >> a >> b;
    a--;
    b--;
    G[a].insert(b);
    G[b].insert(a);
  }

  vector<int> v(N);
  for(int i = 0; i < N; i++){
    v[i] = i;
  }

  int ans = 0;
  do{

    if(v[0] == 0){
      bool ok = true;
      for(int i = 0; i < N-1; i++){

        if(G[v[i]].find(v[i+1]) == G[v[i]].end()){
          ok = false;
        }
      }
      if(ok){
        ans++;
      }
    }

  } while(next_permutation(v.begin(), v.end()));
  
  cout << ans << endl;

  return 0;
}


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

int main(void){
    int n;
    int min = 2000000000;
    int max = 0;
    cin >> n;
    vector<int> vec(n);
    for (int i = 0; i < n; i++) cin >> vec.at(i);

    for (int i = 0; i < n; i++){
        if (vec.at(i)<min){
            min = vec.at(i);
        }
        if (vec.at(i)>max){
            max = vec.at(i);
        }
    }
    int ans = abs(max-min);
    cout << ans << endl;

}

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

#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return a[0]<b[0];});

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define RREP(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define FOR(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define FORR(i,a,b) for(ll (i)=(b)-1;(i)>=(a);(i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a,b) a=max((a),(b))
#define CHMIN(a,b) a=min((a),(b))
/*}}}*/

ll gcd(ll a,ll b){
  if(a<b) swap(a,b);
  if(a%b==0) return b;
  else return gcd(b,a%b);
}
int main() {
  ll a,b,c,d;
  cin >> a >> b >> c >> d;
  a--;
  ll ans = 0;
  ans += b/c - a/c;
  ans += b/d - a/d;
  ll g = gcd(c,d);
  c = c*d/g;
  ans -= b/c - a/c;
  ans = (b-a) - ans;
  cout << ans << endl;
  return 0;
}


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

int main()
{
    int x;
    cin >> x;
    if(x>=400 && x<=599) cout << "8";
    if(x>=600 && x<=799) cout << "7";
    if(x>=800 && x<=999) cout << "6";
    if(x>=1000 && x<=1199) cout << "5";
    if(x>=1200 && x<=1399) cout << "4";
    if(x>=1400 && x<=1599) cout << "3";
    if(x>=1600 && x<=1799) cout << "2";
    if(x>=1800 && x<=1999) cout << "1";


    return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll n;
    cin>>n;
    int ar[n][3],dp[n][3];
    for(int i=0;i<n;i++)
    cin>>ar[i][0]>>ar[i][1]>>ar[i][2];
    dp[0][0]=ar[0][0];
    dp[0][1]=ar[0][1];
    dp[0][2]=ar[0][2];
    for(int i=1;i<n;i++)
    {
        dp[i][0]=max(ar[i][0]+dp[i-1][1],ar[i][0]+dp[i-1][2]);
        dp[i][1]=max(ar[i][1]+dp[i-1][0],ar[i][1]+dp[i-1][2]);
        dp[i][2]=max(ar[i][2]+dp[i-1][0],ar[i][2]+dp[i-1][1]);
    }
    cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]))<<endl;
}



Measured memory_bytes: 2560
#include <iostream>
#include <vector>
#include <list>
#include <math.h>
#include <algorithm>
#include <functional>
#include <string>
#include <iomanip>
#include <queue>
#include <map>

int main()
{
	std::string s;
	std::cin >> s;

	char one, two;
	int count;
	one = s[0];
	std::map<char, int> mp;

	for (int i = 0; i < 4; i++) {
		for (int j = 0; j < 4; j++) {
			if (s[i] == s[j]) {
				mp[s[i]] = 1;
			}
		}
//		std::cout << s[i] << std::endl;
	}
	
	if (mp.size() == 2) {
		std::cout << "Yes";
	}
	else {
		std::cout << "No";
	}
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<math.h>
using namespace std;
int n;

void KochCurve(double start_x, double end_x, double start_y,double end_y,int n){
    if (n>0){
        double x_1=(2*start_x+end_x)/3, y_1=(2*start_y+end_y)/3;
        double x_3=(start_x+2*end_x)/3, y_3=(start_y+2*end_y)/3;
        double x_2=start_x+(end_x-start_x)/2 + sqrt(3)*(start_y-end_y)/6;
        double y_2=start_y+(end_y-start_y)/2 + sqrt(3)*(end_x-start_x)/6; 
        KochCurve(start_x, x_1, start_y, y_1, n-1);
        cout <<setprecision(10)<< x_1 << " " << y_1 << "\n";
        KochCurve(x_1, x_2, y_1, y_2, n-1);
        cout << x_2 << " " << y_2 << "\n";
        KochCurve(x_2, x_3, y_2, y_3, n-1);
        cout << x_3 << " " << y_3 << "\n";
        KochCurve(x_3, end_x, y_3, end_y, n-1);    
    }
}

int main(){
    cin >> n;
    cout << 0.0 << " " <<  0.0 << "\n";  
    KochCurve(0.0,100.0, 0.0,0.0,n);
    cout << 100.0 << " " << 0.0 << "\n"; 
}


Measured memory_bytes: 3240
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <sstream>
#include <cmath>
 
using namespace std;

int N;
int a, b, c;

int main(){
    scanf("%d", &N);
    for(int i= 0; i <N; ++i) {
        cin >> a >> b >> c;   
        string ans;
        if (a > b && a > c){
            ans = pow(a,2) == pow(b,2) + pow(c,2) ? "YES" : "NO";
        } else if (b > a && b > c){
            ans = pow(b,2) == pow(a,2) + pow(c,2) ? "YES" : "NO";
        }else {
            ans = pow(c,2) == pow(a,2) + pow(b,2) ? "YES" : "NO";
    }
    cout << ans << endl;
    }
}
       
    

Measured memory_bytes: 3184
#include <bits/stdc++.h>
#define ll long long
#define ulli unsigned long long int
#define ld long double  
#define endl "\n"
using namespace std; 

void solve() {
    ll n, k;
    cin >> n >> k;

    if (n == k) {
        cout << "0" << endl;
    } else if (n < k) {
        cout << min(n, abs(n - k)) << endl;
    } else {
        if (n % k == 0) {
            cout << 0 << endl;
        } else {
            cout << fixed;
            cout << (ll)min(abs(n-floor(n/(ld)k) * k), abs(n - ceil(n/(ld)k) * k)) << endl;
        }
    }
}

int main() 
{ 
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
  
    int t = 1; 
    //cin >> t; 
    while (t--) { 
        solve(); 
    } 
  
    cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl; 
    return 0; 
} 


Measured memory_bytes: 3780
#include<stdio.h>
#include<iostream>
int main(){
  int N,K;
  char a[50];
  
  scanf("%d %d",&N,&K);
  scanf("%s",a);
  
  a[K-1]=tolower(a[K-1]);
  
  printf("%s",a);
  
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
    
    
using namespace std;
     
int main() {
	long long n;
	cin >> n;
	long long sum = 0;
	long long ans = 0;	
	vector<int> A(n);
	int mod = 1000000007;
	for(int i = 0; i < n; ++i){
		cin >> A[i];
		sum += A[i];
		sum %= mod;
		}	
		
	    for (int i = 0; i < n; i++)
    {
		
        sum -= A[i];
        if (sum < 0) sum += mod;
 
        ans += A[i] * sum;
        ans %= mod;
    }
		
	cout << ans<< endl;
	return 0;
}


Measured memory_bytes: 4064
#include<iostream>
#include<string>
#include<cstring>
#include <cstdio>
#include<utility>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<bitset>
#include<queue>
#include<stack>
#include<set>
#include <limits>
#include <climits>
#include <numeric>
#include <cassert>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<int>VI;
typedef pair<int,int>P;
typedef pair<double,double>P_D;
//const int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
#define PI 3.1415926535897932384626433832795
#define rep(i, n) for (ll i = 0; i < (ll)n; i++)
#define reprev(i, n) for (ll i = (ll)n - 1; i >= 0; i--)
#define ALL(a)  (a).begin(),(a).end()
#define C_MAX(a, b) ((a)>(b)?(a):(b))
#define fi first
#define se second
#define MAX 100100//5
#define MAX_N 200100
#define MAX_B 1001001//6
#define MAX_S 10010010//7
#define SENTINEL 2000000000//9
#define NIL -1
#define MOD 1000000007
#define INF 1 << 29
#define INFTY 1000000000000000000LL
#define MAX_INT INT_MAX

int main(){
    int n,m,l[MAX],r[MAX];
    cin>>n>>m;
    rep(i,m)cin>>l[i]>>r[i];
    int max_v=0,min_v=INF;
    rep(i,m){
        if(max_v<l[i])max_v=l[i];
        if(min_v>r[i])min_v=r[i];
    }
    if(min_v<max_v)cout<<0<<endl;
    else cout<<min_v-max_v+1<<endl;
    
}

Measured memory_bytes: 1024
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll = long long;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repk(i, k, n) for (int i = k; i < n; i++)
#define MOD 1000000007
#define INF 1e9
#define PIE 3.14159265358979323

template <class T>
inline bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
inline bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T>
T GCD(T a, T b) {
    if (b == 0)
        return a;
    else
        return GCD(b, a % b);
}
template <class T>
inline T LCM(T a, T b) {
    return (a * b) / GCD(a, b);
}

using namespace std;
//#inculude <bits/stdc++.h>
//#define int long long

signed main() {
    int a;
    cin >> a;
    cout << a + a * a + a * a * a << endl;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  ll n,a,b,c,ma = 0,mb = 0,mc = 0;
  cin >> n;
  for(ll i = 0; i < n; ++i){
    cin >> a >> b >> c;
    ll na = a+max(mb,mc);
    ll nb = b+max(ma,mc);
    ll nc = c+max(ma,mb);
    ma = na;
    mb = nb;
    mc = nc;
  }
  cout << max(max(ma,mb),mc);
  return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
 
  int ans = 0;
  for (int i=0; i<1000; i++) {
	string t(3,'0');
	for (int tmp=i,j=0; j<3; j++) t[j] = '0' + (tmp%10),tmp/=10;
     
	auto pos = -1;
    bool f = false;
    for (int i=0; i<3; i++) {
	  pos = s.find(t[i], pos+1);
      if (pos == string::npos)  break;
      if (i==2) f = true;
    }
    
    if (f) ans++;
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 3276
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;

// debug methods
// usage: debug(x,y);
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0,a1,a2,a3,a4,x,...) x
#define debug_1(x1) cout<<#x1<<": "<<x1<<endl
#define debug_2(x1,x2) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<endl
#define debug_3(x1,x2,x3) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<endl
#define debug_4(x1,x2,x3,x4) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<endl
#define debug_5(x1,x2,x3,x4,x5) cout<<#x1<<": "<<x1<<", "#x2<<": "<<x2<<", "#x3<<": "<<x3<<", "#x4<<": "<<x4<<", "#x5<<": "<<x5<<endl
#ifdef LOCAL
    #define debug(...) CHOOSE((__VA_ARGS__,debug_5,debug_4,debug_3,debug_2,debug_1,~))(__VA_ARGS__)
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define debug(...) 42
    #define eprintf(...) 42
#endif

#define PI 3.1415926535897932384626433832795
#define INF 2e9
#define SINV(t) greater<t>()
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i=(n); i>=0; --i)
#define FOR(i, n, m) for(int i=(m), i##_len=(n); i<i##_len; ++i)
#define FOREACH(i, v) for(auto i=(v).begin(); i!=(v).end(); ++i)
#define ALL(x) (x).begin(),(x).end()

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

typedef long long ll;
#define vv(t) vector<t>

#define CHC(mp, x) if(mp.end() != mp.find(x))

ll lcm(ll a, ll b) {
    return a / __gcd(a, b) * b;
}

#pragma endregion

template<typename T>
void SV(vector<T> v){
    REP(i,v.size()){
        #ifdef LOCAL
            cout << i << " : " << v[i] << endl;
        #endif
    }
}
int bitCount(int bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >> 16);
}

int main(void){
    int N;
    ll T;
    cin >> N;
    ll ans = 1;
    REP(i, N){
        cin >> T;
        ans = lcm(ans, T);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import Control.Monad
import Data.List

main = do
    n <- readLn :: IO Int
    ta <- replicateM n $ do
            [t,a] <- map read . words <$> getLine :: IO [Int]
            return (t,a)
    let f (x,y) (t,a) = (k*t, k*a)
            where k = max ((x-1) `div` t + 1) ((y-1) `div` a +　1)
    let (x, y) = foldl' f (1,1) ta
    print $ x + y

Measured memory_bytes: 5620
#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() {
  char c[3]; rep(i, 3) cin >> c[i];
  int s = 0;
  rep(i, 3) s += c[i] - 'A';
  if (s == 0 || s == 3) cout << "No" << endl;
  else cout << "Yes" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#define abs(x) ( x>=0 ? x : -x )

int main() {
	
	char str[10];
	int map[3][3];
	int vec, hor, res;
	
	while( std::cin >> str) {
		// Load a map.
		for( int i=0; i<9; i++) {
			if(str[i]=='o') map[i%3][i/3] = 1;
			if(str[i]=='x') map[i%3][i/3] = -1;
			if(str[i]=='s') map[i%3][i/3] = 0;
		}
		
		res = 0;
		
		// diagonal
		vec = 0; hor = 0;
		for( int i=0; i<3; i++) {
			vec += map[i][i];
			hor += map[i][2-i];
		}
		if( abs(vec)==3 ) res = vec/3;
		if( abs(hor)==3 ) res = hor/3;
		
		// straight line
		if(!res) {
			for( int i=0; i<3; i++) {
				vec = 0; hor = 0;
				for( int j=0; j<3; j++) {
					vec += map[j][i]; hor += map[i][j];
				}
				if( abs(vec)==3 ) res = vec/3;
				if( abs(hor)==3 ) res = hor/3;
				if(res) break;
			}
		}
		// result
		std::cout << ( res!=0 ? ( res>0 ? "o" : "x" ) : "d" ) << std::endl;
	}
	return 0;
}

Measured memory_bytes: 1132
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i,n) for(int i=0;i<(n);++i)
#define fore(i,a) for(auto &i:a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define answer cout << ans << endl;
signed _main(); signed main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> using v = vector<T>;
template<class T> using vv = vector<v<T>>;
const int MOD=1e9+7;
const long long INF = 1LL << 60;

signed _main(){
  double R; cin >> R;
  cout << fixed << setprecision(6) << 2.0*M_PI*R << endl;
  return 0;
}


Measured memory_bytes: 3808
#include<bits/stdc++.h>
using namespace std;
int main(){
  int A,B,M;
  cin >> A >> B >> M;
  vector<int> a(A);
  vector<int> b(B);
  for(int i = 0; i<A;i++){
    cin >> a.at(i);
  }
  for(int j = 0; j<B; j++){
    cin >> b.at(j);
  }
  int ans = 200001;
  int sum;
  for(int i = 0; i<M; i++){
    int x,y,c;
    cin >> x >> y >> c;
    sum = a.at(x-1)+b.at(y-1)-c;
    ans = min(sum,ans);
  }
  sort(a.begin(),a.end());
  sort(b.begin(),b.end());
  cout << min(ans,a.at(0)+b.at(0)) << endl;
}

Measured memory_bytes: 1024
#キューのクラス
class Queue:
    def __init__(self,data = []):
        self.data = data
    def enqueue(self,x):
        self.data.append(x)
        return self.data
    def dequeue(self):
        if len(self.data) == 0:
            return "Queue is Empty!"
        else:
            cell = self.data[0]
            del self.data[0]
            return self.data

H, W = map(int, input().split())
s = [list(input()) for i in range(H)]
#4近傍探索のために用意
dy = [-1, 0, 1, 0]
dx = [0, 1, 0, -1]
#最小距離のリスト(Falseで初期化)
min_dis = [[False for i in range(W)] for j in range(H)]
min_dis[0][0] = 1#スタート位置を1にする(注意!!)
#キューのインスタンスQ作成
Q = Queue()
Q.enqueue([0, 0])
#キューの中身がなくなるまでループ
while Q.data:
    y = Q.data[0][0]
    x = Q.data[0][1]
    #4近傍探索
    for i, j in zip(dy, dx):
        if  (0 <= y + i < H) and  (0 <= x + j <W) and s[y + i][x + j] == ".":#（範囲内にあった場合）かつ（道だった場合）
            if min_dis[y+i][x+j] == False:#最小距離がFalseだった場合
                min_dis[y+i][x+j] = min_dis[y][x] + 1
                Q.enqueue([y+i, x+j])#値を更新したマスをQにプッシュ
    Q.dequeue()#探索し終わったマスをQからプル

if not min_dis[H-1][W-1]:
    print(-1)
    exit()

##マスをカウント
num_shap = 0
for i in range(H):
    for j in range(W):
        if s[i][j] == "#":
            num_shap += 1
#スコア＝（全マス)-(#マス)-(gへの最短経路)
score = (H*W) - num_shap - (min_dis[H-1][W-1])
print(score)


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

bool dfs(vector<int> que, int index, int left, int right) {
    if (index == que.size()) {
        return true;
    } else {
        bool res = false;
        if (que[index] > left) res |= dfs(que, index+1, que[index], right); 
        if (que[index] > right) res |= dfs(que, index+1, left, que[index]); 
        return res;
    }
}

int main() {
    int T; cin >> T;
    string s;
    getline(cin, s);
    for (int i = 0; i < T; i++) {
        vector<int> v;
        getline(cin, s);
        stringstream ss(s);
        int t;
        while (ss >> t) v.push_back(t);

        cout << (dfs(v, 0, 0, 0) ? "YES" : "NO") << endl;
    }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast")
#define rep(i,n) for(int i=0;i<n;i++)
const long long MOD = 1000000007;
typedef pair<int,int> P;
typedef long long ll;
ll n,m,k,ans;
string s;

int main(){
  cin >> n >> k;
  ll a = 0;
  ll b = 0;
  for(int i = 1; i<=n; i++) {
    if(i % k == 0) a++;
    else if((double)(i % k) == (double)(k/2)) b++;
  }
  if(k%2){
    cout << a*a*a << "\n";
  }else{
    cout << a*a*a+b*b*b << "\n";
  }
}

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define repp(i, l, r) for(int i = (l); i < (r); i++)
#define per(i, n) for(int i = ((n)-1); i >= 0; i--)
#define perr(i, l, r) for(int i = ((r)-1); i >= (l); i--)
#define all(x) (x).begin(),(x).end()
#define MOD 1000000007
#define IINF 1000000000
#define LINF 1000000000000000000
#define SP <<" "<<
#define CYES cout<<"Yes"<<endl
#define CNO cout<<"No"<<endl
#define CFS cin.tie(0);ios::sync_with_stdio(false)

typedef long long LL;
typedef long double LD;

int main(){
  LL n,t;
  cin >> n >> t;
  LL sum=0;
  LL h;
  LL pre=0,presum=0;
  rep(i,n){
    cin >> h;
    if(pre<h){
      sum+=presum+pre;
      cout << max(0LL,t-sum)/h+1 << endl;
      presum=0;
      pre=h;
    }else{
      presum+=h;
      cout << max(0LL,t-sum-presum)/pre+1 << endl;
    }
  }
  return 0;
}



Measured memory_bytes: 3104
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define pb push_back
#define sz(x) (int)(x).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}

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

    int red=0, blue=0;
    rep(i, sz(s)){
        if(s[i]=='0') red++;
        else          blue++;
    }

    cout << sz(s) - abs(red-blue) << endl;

    return 0;
}

Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int main(){
string a,b;
  cin >> a >> b;
  if(a == b)
    cout << "EQUAL";
  else if(a.size() < b.size() || (a.size() == b.size() && a < b))
    cout << "LESS";
  else
    cout << "GREATER";
  cout << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<iomanip>
using namespace std;
#define pi 3.141592653589793283462
int main(){
	int w,h,x,y,r;
	cin>>w>>h>>x>>y>>r;
	if(x>=r && x<=w-r){
	    if(y>=r && y<=h-r)
			cout<<"Yes"<<endl;
		else
			cout<<"No"<<endl;
	}
	else
		cout<<"No"<<endl;
	return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<algorithm>
#include<vector>
#include<string>
#include<cmath>
#include<cstdio>
#include<queue>
#include<deque>
using namespace std;
typedef pair<int,int> ii;
typedef long long ll;
typedef pair<ll,ll> pll;
const int INF=1e9;
const ll MOD=1e9+7;

ll gcd(ll x,ll y){
    if(y==0) return 0;
    return gcd(y,x%y);
}

int dis2(int x1,int y1,int x2,int y2){
    return (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2);
}

int main(){
    string s;cin>>s;
    if((int)s.size()==2) cout<<s<<endl;
    else cout<<s[2]<<s[1]<<s[0]<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;
#define ll long long
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, n+1)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define whole(x) (x).begin(),(x).end()
#define rwhole(x) (x).rbegin(), (x).rend()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
#define P pair<int, int>
#define debug(var) cerr << "[" << #var << "] " << var << endl
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
#define vi vector<int>
#define vl vector<ll>
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define pr(s) cout << (s) << '\n'
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};
const int INF = 1001001001;
const ll INFll = 1E+18;


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n, q;
    cin >> n >> q;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    vector<ll> sum(n+1);
    rep(i, n) {
        sum[i+1] = sum[i] + a[n-1-i];
    }
    vector<ll> sumeven(n), sumodd(n);
    rep(i, n) {
        if (i%2==0) {
            int j = i/2;
            sumeven[j+1] = sumeven[j] + a[i];
        }
        else {
            int j = i/2;
            sumodd[j+1] = sumodd[j] + a[i];
        }
    }

    rep(qi, q) {
        ll x;
        cin >> x;
        int l = 0;
        int r = n/2+1;
        while (r-l>1) {
            int z = (l+r)/2;
            bool ok = true;
            ll v1 = a[n-z-1];
            ll v2 = a[n-2*z-1];
            if (v2>=x || abs(v2-x)<=abs(v1-x)) ok = false;
            //debug(ok);
            if (ok) r = z;
            else l = z;
            //debug(z);
            //debug(ok);
        }
        //debug(r);
        chmin(r, (n+1)/2); 
        ll ans = 0;
        ans += sum[r];
        int total = (n+1)/2;
        if (n%2==0) {
            ans += sumodd[total-r];
        }
        else {
            ans += sumeven[total-r];
        }
        pr(ans);
    }
    return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> i_i;
typedef pair<long long, int> ll_i;

#define PI 3.141592653589793238462643383279
#define mod 1000000007LL
#define rep(i, n) for(i = 0;i < n;++i)
#define rep1(i, n) for(i = 1;i < n;++i)
#define per(i, n) for(i = n - 1;i > -1;--i)
#define int(x) int x; scanf("%d",&x)
#define int2(x, y) int x, y; scanf("%d%d",&x, &y)
#define int3(x, y, z) int x, y, z; scanf("%d%d%d",&x, &y, &z)
#define int4(v, x, y, z) int v, x, y, z; scanf("%d%d%d%d", &v, &x, &y, &z)
#define int5(v, w, x, y, z) int v, w, x, y, z; scanf("%d%d%d%d%d", &v, &w, &x, &y, &z)
#define pri(x) cout << (x) << "\n"
#define pri2(x, y) cout << (x) << " " << (y) << "\n"
#define pri3(x, y, z) cout << (x) << " " << (y) << " " << (z) << "\n"
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define kabe puts("---------------------------")
#define kara puts("")
#define debug(x) cout << " --- " << (x) << "\n"
#define debug2(x, y) cout << " --- " << (x) << " " << (y) << "\n"
#define debug3(x, y, z) cout << " --- " << (x) << " " << (y) << " " << (z) << "\n"
#define X first
#define Y second
#define eps 0.0001
#define prid(x) printf("%.15lf\n", x)


signed main(void){
  int i, j;
  for(int testcase = 0;testcase >= 0;testcase++){
    int4(sx, sy, tx, ty);
    int dx = tx - sx, dy = ty - sy;
    rep(i, dx)cout << "R";
    rep(i, dy)cout << "U";
    rep(i, dx)cout << "L";
    rep(i, dy)cout << "D";

    cout << "D";
    rep(i, dx + 1)cout << "R";
    rep(i, dy + 1)cout << "U";
    cout << "L";
    cout << "U";
    rep(i, dx + 1)cout << "L";
    rep(i, dy + 1)cout << "D";
    cout << "R";

    puts("");

/*/

//*/ break;
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define M 1000000007
#define endl '\n'
#define ll long long
using namespace std;

int main(){
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    
	ll distance{0};
	ll time{0};
	ll speed{0};
	cin>>distance>>time>>speed;

	ll temp=time*speed;

	if(temp>=distance){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}

	return 0;
}



Measured memory_bytes: 3648