akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define ll          long long int
#define lld          long double
#define pb          push_back
#define pii         pair<ll,ll>
#define mi          map<ll,ll>
#define vec         vector<ll>
#define all(a)     (a).begin(),(a).end()
#define F           first
#define S           second
#define mod         1000000007
#define rep(i,a,b)	for(ll  i=a;i<b;i++)
#define repi(i,a,b)	for(ll  i=a;i<=b;i++)
#define per(i,a,b)  for(ll i=a;i>=b;i--)
#define mp          make_pair
#define mit         map<ll,ll>::iterator
#define sit         set<ll>::iterator
#define pit         pair<ll,ll>::iterator
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;
ll xo(ll x, ll y) 
{ 
   return (x | y) & (~x | ~y); 
}  
ll bin_Expo(ll x,ll n)
{
		if(x==0)
		return 0;
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return bin_Expo(x*x,n/2);
    else                             //n is odd
        return x*bin_Expo(x*x,(n-1)/2);
}
ll mod_Expo(ll x,ll n,ll M)
{
		if(x==0)
		return 0;
    if(n==0)
        return 1;
    else if(n%2 == 0)        //n is even
        return mod_Expo((x*x)%M,n/2,M);
    else                             //n is odd
        return (x*mod_Expo((x*x)%M,(n-1)/2,M))%M;
 
}
ll NcR(int n, int r) 
{ 
    ll p = 1, k = 1; 
    if (n - r < r) 
        r = n - r; 
  
    if (r != 0) { 
        while (r) { 
            p *= n; 
            k *= r; 
            ll m=__gcd(p, k); 
            p /= m; 
            k /= m; 
            n--; 
            r--; 
        } 
    } 
    else
        p = 1; 
    return p;
}
bool prime_check(ll x)
{
    bool prime = (x >= 2);
    for (ll i = 2; i * i <= x; i++) 
    {
        if (x % i == 0) 
        {
            prime = false;
            break;
        }
    }
    return prime;
}
ll logg(ll base,ll x)
{
    return (ll)(log(x)/log(base));
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
    while(TESTS--)
    {
    	ll i,j,m,k,ans;
    	string s,t;
    	cin>>s>>t;
    	cout<<t<<s;
    } 
	return 0;
}

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

int main() {

long double a,b,d,f,r;

cin >> a >> b;

d=floor(a/b);
r=a-b*d;
f=a/b;

if(floor(f)==ceil(f)){
cout << setprecision(15) << d << " " << r << " " << f << endl;
}else{
cout << setprecision(15) << d << " " << r << " " << fixed << setprecision(15) << f << endl;
}
}


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

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

    int n; cin >> n;
    cout << (n+1000-1)/1000*1000-n << endl;
}

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

using namespace std;
int main() {
  while (true) {
    int N;
    cin >> N;
    if (N == 0)
      break;
    int jew[21*21];
    for (int i = 0; i < 21*21; ++i) {
      jew[i] = 0;
    }
    for (int i = 0; i < N; ++i) {
      int x, y;
      cin >> x >> y;
      jew[x + 21 * y] = 1;
    }
    int M;
    cin >> M;
    int x = 10, y = 10;
    int count = 0;
    for (int i = 0; i < M; ++i) {
      string d;
      int l;
      cin >> d >> l;
      int dx = 0, dy = 0;
      if (d == "N")
        dy = 1;
      if (d == "E")
        dx = 1;
      if (d == "S")
        dy = -1;
      if (d == "W")
        dx = -1;
      for (int k = 0; k <= l; ++k) {
        if (jew[x + (dx * k) + 21 * (y + dy * k)] == 1) {
          jew[x + (dx * k) + 21 * (y + dy * k)] = 0;
          ++count;
        }
      }
      x += dx * l;
      y += dy * l;
    }
    if (count == N)
      cout << "Yes" << endl;
    else
      cout << "No" << endl;
  }
}



Measured memory_bytes: 3116
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i,a,b) for(int i=a;i<=b;i++)
const int N = 1e2 + 5;
string ans;
#define PB push_back
int n;
int main() {
    cin >> n;
    int k = 0;
    if(n==0){cout<<0;return 0;}
    if ( n > 0 )
        while ( n ) {
            if ( n % 2 ) {
                if ( k % 2 ) {
                    n /= 2;
                    n++;
                    ans.PB ( '1' );
                } else {
                    n /= 2;
                    ans.PB ( '1' );
                }
            } else {
                n /= 2;
                ans.PB ( '0' );
            }
            k++;
        } else{n=-n;
        while ( n ) {
            if ( n % 2 ) {
                if ( k % 2 ) {
                    n /= 2;
                    ans.PB ( '1' );
                } else {
                    n /= 2;
                    n++;
                    ans.PB ( '1' );
                }
            } else {
                n /= 2;
                ans.PB ( '0' );
            }
            k++;
        }
        }
    reverse ( ans.begin(), ans.end() );
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func main() {
	buf := make([]byte, 0)
	sc.Buffer(buf, 1000000007)
	sc.Split(bufio.ScanWords)
	n := intScanner()
	k := intScanner()
	ls := make([]int, n+1)
	rs := make([]int, n+1)
	rs[0] = n
	for i := 1; i < n+1; i++ {
		ls[i] = ls[i-1] + i
	}
	for i := 1; i < n+1; i++ {
		rs[i] = rs[i-1] + n - i
	}
	ans := 0
	for i := k - 1; i < n+1; i++ {
		ans += rs[i] - ls[i] + 1
		ans %= int(1e9) + 7
	}
	fmt.Println(ans)
}


Measured memory_bytes: 4984
z[1010000];main(N,a,b,i){for(;scanf("%d%d%d",&N,&a,&b),N;printf("%d\n",a)){
for(memset(z,0,4040000),*z=1,i=0;i<=N;i++)if(z[i])z[a+i]=a+i<=N,z[b+i]=b+i<=N;
for(a=i=0;i<=N;i++)a+=!z[i];
}exit(0);}

Measured memory_bytes: 4552
from collections import defaultdict

d = defaultdict(lambda:0)
n = int(input())

for a in input():
    d[a] += 1

for i in range(n-1):
    dd = defaultdict(lambda:0)
    for j in input():
        dd[j] += 1
    dc = defaultdict(lambda:0)
    for k, j in d.items():
        if(k in dd):
            dc[k] = min(j, dd[k])
    d = dc

ans = ""
for i, j in sorted(d.items(), key=lambda x:x[0]):
    ans += i*j
print(ans)

Measured memory_bytes: 9468
#include <stdio.h>

int main(){
  int n,i,f=0;
  unsigned long a,b,m=1;
  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%lu",&a);
    if(a==0){
      m=0;
      break;
    }
    if(f) continue;
    b=m*a;
    if((b>1000000000000000000L)||(b/m!=a)){
      f=1;
    }
    m=b;
  }
  if(i!=n){
    printf("0");
  }else if(f){
    printf("-1");
  }else{
    printf("%lu",m);
  }
  return(0);
}

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

typedef long long int LL;
typedef long long int LLint;

//Faster Program
#define endl "\n"

//Faster Coding
#define ED return
#define GET(a) int a;cin >> a
#define SGET(a) string a;cin >> a
#define CGET(a) char a;cin >> a
#define PRINT(a) cout << a << endl
#define ANS(a,b) int a;cin >> a;cout << b << endl
#define SORT(vec) sort(vec.begin(),vec.end())
#define REV(vec) reverse(vec.begin(),vec.end())

//As Function
#define UP(a,b) ((a+(b-1))/b)
#define ipow(x,y) LL(pow(x,y))

//Debug
#define TEST cout << "OK" << endl

const double PI = M_PI;
const long long INF = int(10e9-1);
const long long MOD = int(10e9+7);

//Settings
const bool DO_BENCHMARK = false;
const int DOUBLE_ACCURACY = 15;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(DOUBLE_ACCURACY);
    void solve();
    if(DO_BENCHMARK){
        clock_t start = clock();
        solve();
        clock_t end = clock();
        const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC * 1000.0;
        cout << endl << time << "[ms]" << endl;
    }
    else{
        solve();
    }
}

void solve(){
    vector<string> weather = {"Sunny","Cloudy","Rainy","Sunny"};
    string S;
    cin >> S;
    for(int i = 0;i < 3;i++){
        if(weather[i] == S){
            PRINT(weather[i+1]);
        }
    }
}



Measured memory_bytes: 764
#include <algorithm>
#include <cmath>
#include <iostream>
#include <vector>

using namespace std;

typedef long long ll;

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

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

vector<int> A;

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

int main(void) {
    int N;
    cin >> N;

    A.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    sort(A.begin(), A.end());

    int cand1, cand2;
    {
        int cand_pos = -1;
        int prev_val = A[0];
        for (int i = 1; i < N; i++) {
            int val = gcd(A[i], prev_val);
            if (val < prev_val) {
                cand_pos = i;
            }
            prev_val = val;
            // printf("cand_pos: %d, prev_val: %d\n", cand_pos, prev_val);
        }

        cand1 = A[0];
        for (int i = 0; i < N; i++) {
            if (i == cand_pos) continue;
            cand1 = gcd(A[i], cand1);
        }
    }
    {
        int cand_pos = -1;
        int prev_val = A[N - 1];
        for (int i = N - 2; i >= 0; i--) {
            int val = gcd(max(A[i], prev_val), min(A[i], prev_val));
            if (val < prev_val) {
                cand_pos = i;
            }
            prev_val = val;
            // printf("cand_pos: %d, prev_val: %d\n", cand_pos, prev_val);
        }

        cand2 = A[N - 1];
        for (int i = 0; i < N; i++) {
            if (i == cand_pos) continue;
            cand2 = gcd(A[i], cand2);
        }
    }

    cout << max(cand1, cand2) << endl;

    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std ;
#define ll long long int 
#define pb push_back 
#define mp make_pair 
#define pii pair <int , int > 
#define pll pair < ll , ll >
int main(){
	ios_base::sync_with_stdio(false) ;
	cin.tie(NULL) ;
	int n , k , ans = 0 ;
  cin >> n >> k ;
  int arr[n] ;
  for(int i = 0 ; i < n ;i++) cin >> arr[i] ;
  sort(arr , arr + n  ) ; 
  for(int i = 0 ; i < k ; i++) ans += arr[i] ;
  cout << ans ;
}

Measured memory_bytes: 3572
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;
 
#define REP(i,n) for(int i=0; i<n; ++i)
#define FOR(i,a,b) for(int i=a; i<=b; ++i)
#define FORR(i,a,b) for (int i=a; i>=b; --i)
#define pi M_PI
 
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main() {
    int d;
    double e;
    while (cin >> d >> e && d){
        double ans = 10000;
        FOR(x,0,100) FOR(y,0,100){
            if (x + y != d) continue;
            double p = sqrt(x*x+y*y);
            ans = fmin(ans, fabs(p-e));
        }
        printf("%.10f\n", ans);
    }

    return 0;
}

Measured memory_bytes: 3256
#include<bits/stdc++.h>
#define forr(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = 1; i <= (n); i++)
#define ALL(a) (a.begin()),(a.end())
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll, ll> LP;
const ll LINF = 1LL<<60;
const int INF = 1001001001;
const int MOD = 1000000007;

/* --------------------------------------------------- */

int main() {
    int n;
    cin >> n;
    vector<int> A(n), B, C;
    rep(i, n) cin >> A[i];
    rep(i, n) {
        if(i % 2 == 0) {
            B.push_back(A[i]);
        } else {
            C.push_back(A[i]);
        }
    }
    if(n % 2 == 0) {
        reverse(ALL(C));
        for(auto x : C) cout << x << " ";
        for(auto x : B) cout << x << " ";
        cout << endl;
    } else {
        reverse(ALL(B));
        for(auto x : B) cout << x << " ";
        for(auto x : C) cout << x << " ";
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3956
#include<iostream>
#include<vector>
#include<math.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;

int main(){
	long long int x;
	cin>>x;
	long long int size = 1000;
	for(long long int i=-size;i<size;i++){
		for(long long int j=-size;j<size;j++){
			if(pow(i,5)-pow(j,5)==x){
				cout<<i<<" "<<j<<endl;
				return 0;
			}
		}
	}
	return 0;
}

Measured memory_bytes: 4012
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,N) for(ll (i)=0;(i)<(N);(i)++)
const int mod = 1000000007;

int n;
vector<pair<ll, ll>> prime_factorize(ll n) {
  vector<pair<ll, ll>> res;
  for(int i = 2; i * i <= n; ++i) {
    if(n % i) continue;
    res.emplace_back(i, 0);
    while (!(n % i)) {
      res.back().second++;
      n /= i;
    }
  }
  if(n != 1) res.emplace_back(n, 1);
  return res;
}

map<ll, int> sisuu;

ll rec(map<ll, int>::iterator p, ll mul) {
  if(p == sisuu.end()) {
    if(mul == 1) return 1;
    else return 0;
  }
  ll res = 0;
  for(int i = 0; i <= p->second; ++i) {
    if(mul % (i + 1)) continue;
    res += rec(++p, mul / (i + 1));
    --p;
  }
  return res;
}

int main(){
  cin >> n;
  for(int i = 2; i <= n; ++i) {
    auto ps = prime_factorize(i);
    for (auto it : ps) sisuu[it.first] += it.second;
  }
  cout << rec(sisuu.begin(), 75) << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdint>
#include<cstdlib>
template<typename T>
void fin(T const& t){ std::cout << t << std::endl; exit(0); }

int main() {
  std::cin.tie(0); std::ios::sync_with_stdio(false);
  int64_t N; std::cin >> N;
  int64_t ans = (N*(N+1))/2;
  for(int64_t i = 2; i <= N; ++i) {
    int64_t num = N/i;
    int64_t ma = num*i;
    ans += (ma+i)*num/2;
  }
  fin(ans);
  return 0;
}


Measured memory_bytes: 3664
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
	int n, k;
	long long h[100100];
	cin >> n >> k;
	for (int i = 0 ; i < n; i++) cin >> h[i];
	sort(h, h + n);

	long long mn = 1000010000;
	for (int i = 0; i < n - k + 1; i++) {
		if ( mn > h[i + k - 1] - h[i]) mn = h[i + k - 1] - h[i];
	}
	cout << mn << endl;
	return 0;
}

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

int main()
{
    string s;
    while(cin >> s){
        if(s == "0")return 0;
        int a = 0;
        for(int i = 0; i < s.size(); i++)
        {
            a += s[i] - '0';
        }
        cout << a << endl;
    }
}


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

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

    int n;
    cin >> n;
    vector<int> A(n);
    REP(i, n) cin >> A[i];

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

    int ans = 0;
    REP(i, n - 1){
        ans += A[i + 1] - A[i];
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(non_snake_case)]
use std::cmp::*;
use std::collections::*;
use std::io::Write;

#[allow(unused_macros)]
macro_rules! debug {
    ($($e:expr),*) => {
        #[cfg(debug_assertions)]
        $({
            let (e, mut err) = (stringify!($e), std::io::stderr());
            writeln!(err, "{} = {:?}", e, $e).unwrap()
        })*
    };
}

fn main() {
    let n = read::<usize>();
    let mut v = read_vec::<i64>();
    v.sort();

    let mut ans = 0;
    for i in 0..n {
        for j in i + 1..n {
            let b = v[i];
            let c = v[j];
            let l_bound = max(b - c, c - b);
            let u_idx = v.lower_bound(&(b + c)) - 1;
            let l_idx = v.upper_bound(&l_bound);
            let mut temp = u_idx + 1 - l_idx;
            if l_idx <= i && i <= u_idx {
                temp -= 1;
            }
            if l_idx <= j && j <= u_idx {
                temp -= 1;
            }
            // debug!(i, j, temp);
            ans += temp;
        }
    }
    println!("{}", ans / 3);
}

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
use std::cmp::Ordering;

pub trait BinarySearch<T> {
    fn lower_bound(&self, x: &T) -> usize;
    fn upper_bound(&self, x: &T) -> usize;
}

impl<T: Ord> BinarySearch<T> for [T] {
    fn lower_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less => {
                    low = mid + 1;
                }
                Ordering::Equal | Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }

    fn upper_bound(&self, x: &T) -> usize {
        let mut low = 0;
        let mut high = self.len();

        while low != high {
            let mid = (low + high) / 2;
            match self[mid].cmp(x) {
                Ordering::Less | Ordering::Equal => {
                    low = mid + 1;
                }
                Ordering::Greater => {
                    high = mid;
                }
            }
        }
        low
    }
}


Measured memory_bytes: 4352
import numpy as np
n,m=map(int,input().split())
a=np.array([[0 if i!="." else 1 for i in input()]for j in range(n)])
b=np.array([[0 if i!="." else 1 for i in input()]for j in range(m)])
ans = 'No'
for i in range(n-m+1):
  for j in range(n-m+1):
    if np.all(b == a[i:i+m,j:j+m]):
      ans = 'Yes'      
print(ans)

Measured memory_bytes: 12428
#include <iostream>
#include <string>
#include <sstream>
#include <algorithm>
#include <vector>
#include <utility>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
 
using namespace std;
 
#define rep(i,n) for(int i=0; i<(n); i++)
#define repc(i,s,e) for(int i=(s); i<(e); i++)
#define pb(n) push_back((n))
#define mp(n,m) make_pair((n),(m))
#define all(r) r.begin(),r.end()
#define fi first
#define se second
 
typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<ll> vl;
typedef vector<vl> vll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
 
 
 
const int INF = 1000000;
 

const int MAX_N = 4010;
const int MAX_M = 4010;





int main(){
	int n,m,a,b;
	//vector<pii> v;
	map<pii,int> mp;
	cin>>n;
	for(int i = 0; i < n; i++){
		cin>>a>>b;
		//v.pb(pii(a, b));
		mp[pii(a,b)] = 1;
	}
	cin>>m;
	for(int i = 0; i < m; i++){
		cin>>a>>b;
		//v.pb(pii(a,b));
		mp[pii(a,b)] = 1;
	}
	// sort(all(v));
	// for(int i = 0; i < v.size(); i++){
	// 	if(i != 0) printf(" ");
	// 	printf("%d:%02d",v[i].fi,v[i].se);
	// }
	// printf("\n");
	for(auto it = mp.begin(); it != mp.end(); it++){
		if(it != mp.begin()) printf(" ");
		printf("%d:%02d",it->fi.fi,it->fi.se);
	}
	printf("\n");
}

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

fn main() {
    let mut input = String::new();
    std::io::stdin().read_to_string(&mut input);
    let mut input: Vec<usize> = input.split_whitespace().map(|a| a.parse().unwrap()).collect();
    let (x, y, a, b, c) = (input[0], input[1], input[2], input[3], input[4]);
    let mut p: Vec<usize> = Vec::new();
    p.extend(&input[5..5 + a]);
    let mut q: Vec<usize> = Vec::new();
    q.extend(&input[5 + a..5 + a + b]);
    let mut r: Vec<usize> = Vec::new();
    r.extend(&input[5 + a + b..5 + a + b + c]);

    p.sort();
    q.sort();
    r.sort();
    r.reverse();
    let mut i = p.len() - x;
    let mut j = q.len() - y;
    let mut k = 0;
    while i < p.len() && j < q.len() && k < r.len() {
        if p[i] < q[j] && p[i] < r[k] {
            p[i] = r[k];
            i += 1;
            k += 1
        } else if p[i] >= q[j] && q[j] < r[k] {
            q[j] = r[k];
            j += 1;
            k += 1
        } else {
            break;
        }
    }

    while i < p.len() && k < r.len() {
        if p[i] < r[k] {
            p[i] = r[k];
            i += 1;
            k += 1;
        } else {
            break;
        }
    }
    while j < q.len() && k < r.len() {
        if q[j] < r[k] {
            q[j] = r[k];
            j += 1;
            k += 1;
        } else {
            break;
        }
    }
    let mut ans = 0;
    for i in p.len()-x..p.len() {
        ans += p[i];
    }
    for i in q.len()-y..q.len() {
        ans += q[i];
    }
    println!("{}", ans);
}


Measured memory_bytes: 16500
import sys
A,B,C = map(int,input().split())
time = 0
ss = set()
while True:
    if time%60 == C:
        print(time)
        sys.exit()
    for t in range(A):
        time += 1
        if time%60 == C:
            print(time)
            sys.exit()
    time += B
    if (time%60) in ss:
        break
    ss.add(time%60)
print(-1)

Measured memory_bytes: 5600
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#define MOD 1000000009
#define MAX(a,b) (a>b?a:b)
#define MAX3(a,b,c) MAX(a,MAX(b,c))
#define MIN(a,b) (a<b?a:b)
#define MIN3(a,b,c) MIN(a, MIN(b,c))
#define top(i,j) val[i*m+j]
typedef long long lli;
typedef unsigned short int usi;

lli nPr(int n, int r) {
    int i;
    lli val=1;
    for(i=0; i<r; i++) {
        val = val*(n-i);
        val = val % MOD;
    }
    printf("nPr(%d,%d)=%d\n",n,r,val);
    return val;
}

lli nCr(int n, int r) {
    int i;
    lli val=1;
    r = MIN(r, n-r);
    for(i=0; i<r; i++) {
        val = val*(n-i)/(i+1);
    }
    val = val % MOD;
    printf("nCr(%d,%d)=%d\n",n,r,val);
    return val;
}

int main()
{
    int s, i;
    int *flg = (int*)calloc(1000001, sizeof(int));
    int count = 0;

    scanf("%d",&s);
    while(1) {
        count++;
        if(flg[s]==0) {
            flg[s] = 1;
        } else {
            break;
        }

        if(s%2==0) {
            s /= 2;
        } else {
            s = 3*s + 1;
        }
    }
    printf("%d",count);

    return 0;
}


Measured memory_bytes: 4096
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
using namespace std;
#define i64  long long
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return;std::cout << e << std::endl;}
template<class T> void DEBUG(string str, T e){if(DEBUG_OUT == false)return;std::cout <<str << ">>" << e << std::endl;}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == 1)return;for(const auto& v : vv){ DEBUG(v); } }
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> void SORT_(std::vector<T>& v,bool GREATER = 0){if(GREATER == 0)sort(v.begin(),v.end());else{sort(v.begin(),v.end(),std::greater<T>());}}

 
void solve(void)
{
  int N;
  cin>>N;
  int R;
  cin>>R;
  if(N >= 10)
  {
    cout<<R<<endl;
  }
  else
  {
    cout<<R + 100*(10 - N)<<endl;
  }
 
  
  
  return;
}


int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

 
  return 0;
}

Measured memory_bytes: 256
s = gets.strip.split("")
count = 0
count+=1 if s[0] == 'A'
count+=1 if s[2..-2].include?("C") && s.count("C") == 1
s.delete("C")
s.delete("A") 
count+=1 if s.join == s.join.downcase
puts count == 3 ? "AC" : "WA"


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

int main() {
  int N, A, B;
  cin >> N >> A >> B;
  string S;
  cin >> S;
  
  int a = 0, b = 0;
  
  for (char s : S) {
    if (s == 'a') {
      if (a+b < A+B) {
        cout << "Yes" << endl;
        a++;
      } else {
        cout << "No" << endl;
      }
    } else if (s == 'b') {
      if (a+b < A+B && b < B) {
        cout << "Yes" << endl;
        b++;
      } else {
        cout << "No" << endl;
      }
    } else {
      cout << "No" << endl;
    }
  }

  
}

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

#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)

#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=int(a)-1;i>=int(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)

#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
#define popcount(n) (__builtin_popcountll(n))

using namespace std;

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

using ll=long long;
using R=long double;
const R EPS=1e-9L; // [-1000,1000]->EPS=1e-8 [-10000,10000]->EPS=1e-7
inline int sgn(const R& r){return(r > EPS)-(r < -EPS);}
inline R sq(R x){return sqrt(max(x,0.0L));}

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

// Problem Specific Parameter:

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

	const string s_front = s.substr(0,n);
	const string s_back = s.substr(n,n);

	//  red ->  0
	//  blue <- 1

	using psi = pair<string,int>;
	map<psi,int> cnt;

	ll ans = 0LL;

	rep(bmask,1 << n){
		string cur_red = "";
		string cur_blue = "";
		rep(i,n){
			if((bmask >> i) & 1)
				cur_blue += s_front[i];
			else
				cur_red += s_front[i];
		}
		reverse(begin(cur_blue),end(cur_blue));
		string cur = cur_red + cur_blue;
		const int red = n - __builtin_popcountll(bmask);
		cnt[psi(cur,red)]++;
	}

	// 	red -> 0
	//  blue <- 1

	rep(bmask,1 << n){
		string cur_red = "";
		string cur_blue = "";
		rrep(i,n){
			if((bmask >> i) & 1)
				cur_blue += s_back[i];
			else
				cur_red += s_back[i];
		}
		reverse(begin(cur_red),end(cur_red));
		string cur = cur_blue + cur_red;
		const int red = n - __builtin_popcountll(bmask);
		ans += cnt[psi(cur,n - red)];
	}

	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 70656
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (n); i++)
typedef long long ll;
using namespace std;

int main()
{
    int h, w;
    cin >> h >> w;
    vector<string> a(h);
    rep(i, h) {
        cin >> a[i];
    }

    string s = "##";
    rep(i, w) {
        s += '#';
    }

    cout << s << endl;
    rep(i, h) {
        cout << "#" << a.at(i) << "#" << endl;
    }
    cout << s << endl;

    return 0;
}

Measured memory_bytes: 256
/******************
*  Writer: Oh no  *
******************/
#include<algorithm>
#include<cstdio>
#include<iostream>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<string>
#include<vector>
using namespace std;

int k;
string s;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin>>s;
	cin>>k;
	int i;
	for(i=0;s[i]=='1'&&i<k-1;i++);
	cout<<s[i]<<endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int sum[109],p;

int main(){
  int n;
  cin>>n;
  for(int i=1;i<=n;i++){
    int w;
    cin>>w;
    p+=w;
    sum[i]=sum[i-1]+w;
  }
  int ans=p;
  for(int i=1;i<=n;i++){
    ans=min(ans,abs(sum[i]-(p-sum[i])));
  }
  cout<<ans<<endl;
  return(0);
}


Measured memory_bytes: 256
import sys
from collections import defaultdict
def input(): return sys.stdin.readline().strip()

def main():
    N = int(input())
    A = list(map(int, input().split()))
    rate = set()
    top = 0
    for a in A:
        if a >= 3200:
            top += 1
        else:
            rate.add(a // 400)
    print("{} {}".format(max(1, len(rate)), len(rate) + top))
    
    

if __name__ == "__main__":
    main()


Measured memory_bytes: 64896
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    # divisors.sort()
    return divisors
ans = []
n = int(input())
for i in range(3,200,2):
    tmp = len(make_divisors(i))
    if tmp == 8:
        ans.append(i)
m = 0
for tmp in ans:
    if tmp <= n:
        m+=1
print(m)

Measured memory_bytes: 38512
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <iomanip>
#include <iostream>
#include <map>
#include <set>
#include <vector>

using namespace std;

int main()
{
    int n;
    cin >> n;
    vector<int> as(n);
    for (auto& a : as)
    {
        cin >> a;
        a--;
    }
    vector<int> bs(n);
    for (auto& b : bs)
    {
        cin >> b;
    }
    vector<int> cs(n - 1);
    for (auto& c : cs)
    {
        cin >> c;
    }
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        ans += bs[as[i]];
        if (i < n - 1 && as[i] + 1 == as[i + 1])
        {
            ans += cs[as[i]];
        }
    }
    cout << ans << endl;
}


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

using namespace std;

int main(){
    int n;
    cin >> n;
    int b = 0;
    
    for(int i=1;i<10;i++){
        if(n % i == 0){
            if(n / i < 10 && n / i > 0){
                cout << "Yes"<< endl;
                b = 1;
                break;
            }
        }
    }
    if(b == 0){
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
use proconio::input;

fn main() {
    input! {
        n: usize, k: u64,
        a: [usize; n],
    }

    let mut done = vec![false; n];
    done[0] = true;
    let mut idx = 0;
    let mut start = 0;
    let mut end = 0;
    for _ in 0..n {
        let tmp = a[idx] - 1;
        if done[tmp] {
            start = tmp;
            end = idx;
            break;
        }
        idx = tmp;
        done[idx] = true;
    }

    let mut d1 = 0;
    let mut d2 = 0;
    let mut idx = 0;
    let mut flag = false;
    for _ in 0..n {
        if idx == start {
            flag = true;
        } else if idx == end {
            break;
        }

        if flag {
            d2 += 1;
        } else {
            d1 += 1;
        }

        idx = a[idx] - 1;
    }

    let mut idx = 0;
    let mut x = k;
    if k < d1 {
        for _ in 0..k {
            idx = a[idx] - 1;
        }
    } else {
        for _ in 0..d1 {
            idx = a[idx] - 1;
            x -= 1;
        }
        x %= d2 + 1;
        for _ in 0..x {
            idx = a[idx] - 1;
        }
    }
    println!("{}", idx + 1);
}


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

int main(void)
{
    int N;
    cin >> N;

    string S, T;
    cin >> S >> T;

    for (int i = 0; i < N; i++)
        cout << S[i] << T[i];
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

int main(void) {
  string w;

  cin >> w;

  for(int i = 'a'; i <= 'z'; i++) {
    int count = 0;
    for(int j = 0; j < w.length(); j++) {
      if(w[j] == i) {
	count++;
      }
    }
    if(count % 2 != 0) {
      printf("No\n");
      return 0;
    }
  }

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

Measured memory_bytes: 256
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int i = 1;
        int[] nums = new int[n + 1];
        while (true) {
            if (i*i > n) { break; }
            int j = 1;
            while (true) {
                if ( i*i + j*j + i*j > n) { break; }
                int k = 1;
                while (true) {
                    int f = i*i + j*j + k*k + i*j + j*k + i*k;
                    if (f > n) {
                        break;
                    }
                    nums[f]++;
                    k++;
                }
                j++;
            }
            i++;
        }
        for (int idx = 1; idx <= n; idx++) {
            System.out.println(nums[idx]);
        }
    }
}


Measured memory_bytes: 30088
#include<bits/stdc++.h>
using namespace std;
main()
{
	long long int ans = 0;
 	string a , b;
	 cin >> a >> b;
	 long long int i;
	 for(i=0;i<a.size();i++)
	 if(a[i] != b[i])
	 ans++;
	 cout << ans;	
	return 0;
}

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


int main(){
  int N;
  string S;
  int Q;
  cin >> N >> S >> Q;
  vector<set<int>> pos(26);
  for(int ii=0; ii<S.size(); ii++){
    pos[S[ii]-'a'].insert(ii);
  }
  for(int ii=0; ii<Q; ii++){
    int type;
    cin >> type;
    if(type==1){
      int a;
      char b;
      cin >> a >> b;
      a--;
      pos[S[a]-'a'].erase(a);
      pos[b-'a'].insert(a);
      S[a] = b;
    }else if(type==2){
      int a, b;
      cin >> a >> b;
      a--;
      b--;
      int ans=0;
      for(int jj=0; jj<26; jj++){
        auto it = pos[jj].lower_bound(a);
        if(it!=pos[jj].end()&&*it<=b) ans++;
      }
      cout << ans << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 24196
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>

// =======================================================

using namespace std;

// =======================================================

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

// =======================================================

//ライブラリ(*'▽')
int gcd(int a, int b) //最大公約数
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}

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

// =======================================================

int main() {
	int n, x, t;
	int ans;
	cin >> n >> x >> t;
	if (n % x == 0) {
		ans=n / x * t;
	}
	else {
		ans=(n / x + 1)* t;
	}
	cout << ans << endl;
	return 0;
}

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

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

	if (n == 3) {
		cout << "2 5 63" << endl;
	}
	else if (n == 4) {
		cout << "2 5 20 63" << endl;
	}
	else {
		set<int> s;
		long long sum = 0;
		for (int i = 0;i < n;i++) {
			int a = i / 4 * 6;
			switch (i % 4) {
			case 0:
				a += 2;
				break;
			case 1:
				a += 3;
				break;
			case 2:
				a += 4;
				break;
			case 3:
				a += 6;
				break;
			}
			sum += a;
			s.insert(a);
		}
		n--;
		switch (sum % 6) {
		case 2:
			s.erase(6);
			s.insert(n / 4 * 6 + 4);
			break;
		case 3:
			s.erase(6);
			s.insert((n / 4 + 1) * 6 + 3);
			break;
		case 5:
			if (n % 4 == 0) {
				s.erase(8);
				s.insert(n / 4 * 6 + 3);
			}
			else {
				s.erase(9);
				s.insert(n / 4 * 6 + 4);
			}
		}
		
		for (auto x : s) {
			cout << x << ' ';
		}
		cout << endl;
	}




	return 0;
}

Measured memory_bytes: 1280
# --- ワーシャルフロイド 任意のペアに対して最短距離を求める（非負）
def warshall_floyd(dp):
    for k in range(n):
        for i in range(n):
            for j in range(n):
                dp[i][j] = min(dp[i][j] , dp[i][k] + dp[k][j])
    return dp

n, m,R = map(int, input().split())
r = list( map(int, input().split()))

d = [[float("inf")]*n for i in range(n)]

abc = [tuple(map(int,input().split())) for i in range(m)]
for a,b,c in abc:
    a,b = a-1,b-1
    d[a][b] = c
    d[b][a] = c

for i in range(n):
    d[i][i] = 0

warshall_floyd(d)

import itertools

p = itertools.permutations(r, R)

INF = float('inf')
ans = INF
for path in p:
    tmp = 0
    for i in range(R-1):
        tmp += d[path[i]-1][path[i+1]-1]
    ans = min(ans,tmp)

print(ans)


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

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;

		double min = Double.MAX_VALUE;
		double max = Double.MIN_VALUE;

		while ((line = br.readLine()) != null) {

			if (max < Double.parseDouble(line)) {

				max = Double.parseDouble(line);

			}

			if (min > Double.parseDouble(line)) {

				min = Double.parseDouble(line);

			}

		}

		System.out.println(max - min);

	}

}

Measured memory_bytes: 16916
#include<bits/stdc++.h>
    using namespace std;
     
     
    void solve()
    {
     
       int N,K;
       int counter=0;
       int no=0;
     
       cin>>N>>K;
     
       vector<int> arr(N,0);
     
       for(int i=1;i<=N;i++)
       {
           cin>>arr[i];
       }
       for(int i=1;i<=N;++i)
       {
           if(arr[i]>=K)
           {
               counter++;
     
           }else{
            no--;
            //cout<<"0";
           }
     
       }
     
        cout<<counter<<endl;
     
     
    }
     
    int main()
    {
        solve();
     
     
        return 0;
    }
     

Measured memory_bytes: 640
#include<iostream>
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
const int Maxn = 100010;
int N,M,ans,t;
int main()
{
    cin>>N>>M;
    ans = (100 * (N - M) + 1900 * M) * pow(2,M);   
    cout<<ans<<endl;
    return 0;
}

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

int main(){
    int H;
    cin >> H;
    int N;
    cin >> N;
    vector<pair<int,int> > p(N);
    rep(i,N){
        cin >> p[i].first >> p[i].second;
    }
    vector<int> dp(H + 1);
    rep(i,H + 1){
        dp[i] = 1000000000;
    }
    dp[0] = 0;
    rep(i,H){
        rep(j,N){
            if (i + p[j].first >= H){
                dp[H] = min(dp[H], dp[i] + p[j].second);
            }
            else{
                dp[i + p[j].first] = min(dp[i + p[j].first], dp[i] + p[j].second);
            }
        }
    }
    cout << dp[H] << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
//using namespace __gnu_pbds;
//template<typename key, typename val>
//using ordered_tree =
//  tree<key, val, less<>, rb_tree_tag, tree_order_statistics_node_update>;
typedef long long int64;
typedef complex<double> comp;
const double pi = 3.14159265358979323846;
const int inf = (int)1e+9 + 2;
const int64 inf64 = (int64)1e+18 + 2;
const double dinf = 1e+20;
const int mod = /*1'000'000'007;*/998244353;
const int base = 2187;
const double eps = 1e-8;
const int N = 100'000;
const int LOGN = 18;

int n, m, k;

void solve(int test)
{
  cin >> n;
  vector<int> a(n), b(n, 0);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
  }
  vector<int> ans;
  for (int i = n - 1; i >= 0; --i) {
    if (a[i] != b[i]) {
      ans.push_back(i + 1);
      for (int j = 1; j * j <= (i + 1); ++j) {
        if ((i + 1) % j == 0) {
          b[(i + 1) / j - 1] ^= 1;
          if (j * j != i + 1) b[j - 1] ^= 1;
        }
      }
    }
  }
  cout << ans.size() << '\n';
  for (int val : ans) {
    cout << val << ' ';
  }
  cout << '\n';
}

void precalc()
{
}

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0), cout.tie(0);
  precalc();
  int test = 1;
  //cin >> test;
  //auto start = chrono::high_resolution_clock::now();
  for (int i = 1; i <= test; ++i)
    solve(i);
  //cerr << chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - start).count() << '\n';
  return 0;
}


Measured memory_bytes: 3192
import java.util.Arrays;
import java.util.Scanner;


public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int can[]=new int[3];
		for(int i=0;i<3;i++){
			can[i]=sc.nextInt();
		}
		Arrays.sort(can);
	    if(can[0]+can[1]==can[2])System.out.println("Yes");
	    else System.out.println("No");
		
	}

}

Measured memory_bytes: 10184
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vec;
typedef vector<vec> mat;
ll mod=1e9+7;
ll inv(ll a){
    ll n=mod-2,ans=1;
    while(n>0){
        if(n&1) ans=ans*a%mod;
        n=n/2;
        a=a*a%mod;
    }
    return ans;
}
ll A[200001];
void init(){
    A[0]=1;
    rep(i,200000) A[i+1]=A[i]*(i+1)%mod;
}
ll nCk(ll n,ll k){
    return A[n]*inv(A[k])%mod*inv(A[n-k])%mod;
}
int main(){
    init();
    ll n,k,B[200001];
    cin>>n>>k;
    rep(i,n) cin>>B[i];
    sort(B,B+n);
    ll ma=0,mi=0;
    rep(i,n){
        if(i>=k-1) ma=(ma+B[i]*nCk(i,k-1))%mod;
        if(i<=n-k) mi=(mi+B[i]*nCk(n-i-1,k-1))%mod;
    }
    cout<<(ma-mi+mod)%mod<<"\n";
}

Measured memory_bytes: 2560
import math


def main():
    N, D = map(int, input().split())
    points = [tuple(map(int, input().split())) for _ in range(N)]

    cnt = 0

    for x, y in points:
        if math.sqrt(x ** 2 + y ** 2) <= D:
            cnt += 1

    print(cnt)


if __name__ == '__main__':
    main()


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

int main(){
    int n,l;
    cin >> n >> l;
    vector<string> s(n);
    for(int i = 0; i < n; i++) cin >> s[i];
    std::sort(s.begin(), s.end());
    string res="";
    for(int i = 0; i < n; i++) res+=s[i];
    cout << res << endl; 
    return 0;
}

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

typedef long long ll;

int main() {
    int H, W;
    int ans = 0;
    cin >> H >> W;
    int a[H][W];
    int X[250000][4];
    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W; j++) {
            cin >> a[i][j];
        }
    }

    for (int i = 0; i < H; i++) {
        for (int j = 0; j < W-1; j++) {
            if (a[i][j] % 2 == 1) {
                a[i][j+1] += 1;
                X[ans][0] = i+1;
                X[ans][1] = j+1;
                X[ans][2] = i+1;
                X[ans][3] = j+2;
                ans++;
            }
        }
    }
    for (int i = 0; i < H-1; i++) {
        if (a[i][W-1] % 2 == 1) {
            a[i+1][W-1] += 1;
            X[ans][0] = i+1;
            X[ans][1] = W;
            X[ans][2] = i+2;
            X[ans][3] = W;
            ans++;
        }
    }

    cout << ans << endl;
    for (int i = 0; i < ans; i++) {
        cout << X[i][0] << " " << X[i][1] << " " << X[i][2] << " " << X[i][3] << endl;
    }
}


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

int main(void){
  int num,a,flag=0;
  (void)scanf("%d",&num);
  a=num;
  if(a/100==7){
    flag=1;
  }else{
    num=num-100*(a/100);
  }
  a=num;
  if(a/10==7){
    flag=1;
  }else{
    num=num-10*(a/10);
  }
  if(num==7){
    flag=1;
  }
  if(flag){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 1644
#include<stdio.h>
#include<string.h>
  
#define MAX 1001
  
int c[MAX][MAX];
int m,n;
  
void LCRLength(char *,char *);
  
int main(){
  int i,q;
  char a[MAX],b[MAX];
  
  scanf("%d",&q);
  
  for(i=1;i<=q;i++){
    scanf("%s",a);
    scanf("%s",b);
    LCRLength(a,b);
    printf("%d\n",c[m][n]);
  }
  return 0;
}
 
void LCRLength(char *a,char *b){
  int i,j;
  
  m=strlen(a);
  n=strlen(b);
  
  for(i=1;i<=m;i++) c[i][0]=0;
  for(j=0;j<=n;j++) c[0][j]=0;
  
  for(i=1;i<=m;i++){
    for(j=1;j<=n;j++){
      if(a[i-1]==b[j-1]) c[i][j]=c[i-1][j-1]+1;
      else if(c[i-1][j]>=c[i][j-1]) c[i][j]=c[i-1][j];
      else c[i][j]=c[i][j-1];
    }
  }
}

Measured memory_bytes: 4520
N=int(input())
xy=[]
xmax,xmin,ymax,ymin = -10**10,10**10,-10**10,10**10
for i in range(N):
  x,y=map(int,input().split())
  xmax = max(xmax,x+y)
  ymax = max(ymax,x-y)
  xmin = min(xmin,x+y)
  ymin = min(ymin,x-y)
print(max(xmax-xmin,ymax-ymin))

Measured memory_bytes: 9212
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
 ll N;
 cin>>N;
 priority_queue<ll>A;
 for(ll i=0;i<N;i++){
   ll x;cin>>x;
   A.push(x);
 }
 ll cnt=1;
 ll ans=0;
 ans+=A.top();
 A.pop();
ll tmp=1;
ll x=A.top();
A.pop();
//cout<<ans<<endl;
 while(true){
  if(cnt==N-1)break;
  if(tmp>2){
    tmp=1;
    x=A.top();
    A.pop();
 }
  ans=ans+x;
  // cout<<ans<<" "<<x<<endl;
   tmp++;
   cnt++;
  //cout<<ans<<" "<<cnt<<endl;
 }
 cout<<ans<<endl;
}

Measured memory_bytes: 5312
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <map>
using namespace std;

struct node
{
    int x,y;
} a[55];

map<int,int> mpx,mpy;
map<int,int> invx,invy;

int sum[55][55];
int b[55][55];

bool cmp1(node aa,node bb)
{
    return aa.x < bb.x;
}

bool cmp2(node aa,node bb)
{
    return aa.y < bb.y;
}

int main()
{
    int n,k;

    scanf("%d%d",&n,&k);

    for (int i = 1;i <= n;i++)
    {
        scanf("%d%d",&a[i].x,&a[i].y);
    }

    long long ans;

    sort(a+1,a+n+1,cmp1);

    for (int i = 1;i <= n;i++)
    {
        invx[i] = a[i].x;
        mpx[a[i].x] = i;
    }

    long long dx = a[n].x - a[1].x;

    sort(a+1,a+n+1,cmp2);

    for (int i = 1;i <= n;i++)
    {
        invy[i] = a[i].y;
        mpy[a[i].y] = i;
    }

    long long dy = a[n].y - a[1].y;

    ans = dx * dy;

    for (int i = 1;i <= n;i++)
    {
        int x = a[i].x,y = a[i].y;

        b[mpx[x]][mpy[y]] = 1;
    }

    for (int i = 1;i <= n;i++)
        for (int j = 1;j <= n;j++)
        {
            sum[i][j] = sum[i-1][j] + sum[i][j-1] - sum[i-1][j-1] + b[i][j];
        }

    for (int i = 1;i <= n;i++)
        for (int j = 1;j <= n;j++)
        {
            for (int s = i;s <= n;s++)
                for (int q = j;q <= n;q++)
                {
                    if (sum[s][q] - sum[s][j-1] - sum[i-1][q] + sum[i-1][j-1] >= k)
                    {
                        long long dx = invx[s] - invx[i];
                        long long dy = invy[q] - invy[j];

                        long long tmp = abs(dx) * abs(dy);

                        ans = min(ans,tmp);
                    }
                }
        }

    printf("%lld\n",ans);

    return 0;
}

Measured memory_bytes: 256