akhauriyash/Code-Regression huggingface dataset:
using namespace std;
#include <bits/stdc++.h>
#define rep(i, s) for (int i = 0; i < s; ++i)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define all(v) (v.begin(), v.end())
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a) priority_queue<int>a
#define PQmin(a) priority_queue< int, :vector<int>, greater<int> >a
#define PAIR pair<int, int>
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define EPS (1e-7)
#define INF (1e10)
#define PI (acos(-1))
const ll mod = 1000000007;
 
int main(){
  ios::sync_with_stdio(false);
  cin.tie(0);
  int A,B;
  cin>>A>>B;
  int c;
  if(B==100)
    c=A*1000+B;
  else if(B>9)
    c=A*100+B;
  else
    c=A*10+B;
  int d=1;
  while(c>=d*d){
    if(c==d*d){
      cout<<"Yes"<<endl;
      return 0;
    }
    else
      d++;
  }
  cout<<"No"<<endl;
    
    

 
}
  





Measured memory_bytes: 256
import java.util.*;

class Main{
  public static void main(String[] args){
    try(Scanner sc = new Scanner(System.in)){
      int[]a = new int[3];
      for(int i = 0; i < 3; i++){
        a[i] = Integer.parseInt(sc.next());
      }
      Arrays.sort(a);
      System.out.println(a[0] + a[1]);
    }
  }
}

Measured memory_bytes: 22612
#![allow(unused_imports, non_snake_case)]
use proconio::{
    input, fastout,
    marker::{Chars, Bytes, Usize1}
};

#[fastout]
fn main() {
    input!{
        N: usize,
        l: [(u8, u8); N]
    }
    let mut cnt = 0;
    let mut fl = false;
    for &(x, y) in &l {
        if x == y {
            cnt += 1;
        } else {
            cnt = 0;
        }
        fl |= cnt > 2;
    }
    println!("{}", if fl { "Yes" } else { "No" });
}


Measured memory_bytes: 2168
// #pragma GCC optimize("O3", "unroll-loops")
// #pragma GCC target("avx2")
 
#include <bits/stdc++.h>
using namespace std;
 
// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds;
// #define ost tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 
 
#define    int                      long long int
#define    ld                       long double
#define    f(i,j,n)                 for(int i = j; i <= n; i++)
#define    r(i,n,j)                 for(int i = n; i >= j; i--)
#define    mod                      1000000007
#define    speed                    ios_base::sync_with_stdio(false);
#define    upp                      cin.tie(NULL),cout.tie(NULL);
#define    pb                       push_back
#define    mp                       make_pair
#define    T                        int ttt; cin >> ttt; while(ttt--)
#define    ff                       first
#define    ss                       second
#define    all(container)            container.begin() , container.end()
#define    sz(container)            (int)container.size()
#define    pii                      pair <int , int>
#define    sp(x)                    setprecision(x)
#define    bp(x)                    __builtin_popcount(x)
#define    endl                     "\n"
int power(int x, int y, int p)  
{  
    int res = 1;    
    x = x % p; 
    if (x == 0) return 0; 
    while (y > 0)  
    {     
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res; 
}

int32_t main()
{
    speed upp
    int n,x=100,j=0;
    cin>>n;
    while(x<n)
    {
        x=x+x/100;
        j++;
    }
    cout<<j;
}

Measured memory_bytes: 3636
#include <iostream>
#include <stack>
#define FOR(i,a,b) for(int i=(a);i<(int)(b);i++)
#define rep(i,n) FOR(i,0,n)

using namespace std;

void solve(string s) {
    bool balance = true;
    stack<char> S;
    for(char& c : s) {
        if(c == '(') S.push('(');
        if(c == '[') S.push('[');
        if(c == ')') {
            if(S.size() == 0) {balance = false; break;}
            if(S.top() == '(') S.pop();
            else balance = false;
        }
        if(c == ']') {
            if(S.size() == 0) {balance = false; break;}
            if(S.top() == '[') S.pop();
            else balance = false;
        }
    }
    if(S.size()) balance = false;
    cout << (balance ? "yes" : "no") << "\n";
}

int main() {
    string s;
    while(getline(cin,s)) {
        if(s[0] == '.') break;
        solve(s);
    }
    return 0;
}

Measured memory_bytes: 3220
import java.util.Scanner;

public class Main {

	public static final int MOD = 1000000007;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		sc.close();

		long[] factorial = new long[n + 1];
		long[] inverse = new long[n + 1];
		long[] factorial_inverse = new long[n + 1];

		factorial[0] = 1;
		factorial[1] = 1;
		inverse[1] = 1;
		factorial_inverse[0] = 1;
		factorial_inverse[1] = 1;
		for (int i = 2; i <= n; i++) {
			factorial[i] = factorial[i - 1] * i % MOD;
			inverse[i] = MOD - inverse[MOD % i] * (MOD / i) % MOD;
			factorial_inverse[i] = factorial_inverse[i - 1] * inverse[i] % MOD;
		}

		long answer = 0;
		if (k == 1) {
			print(n * (n - 1));
			return;
		}
		if (k > n - 1) {
			k = n - 1;
		}
		for (int i = 0; i <= k; i++) {
			long combination = factorial[n] * (factorial_inverse[i] * factorial_inverse[n - i] % MOD) % MOD;
			long combination2 = factorial[n - 1] * (factorial_inverse[n - i - 1] * factorial_inverse[i] % MOD) % MOD;
			answer = (answer + (combination * combination2 % MOD)) % MOD;
		}
		print(answer);
	}

	public static void print(Object obj) {
		System.out.println(obj);
	}

}

Measured memory_bytes: 26836
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
long long int INF = 1001001001001001LL;
int inf = 1000000007;
long long int MOD = 1000000007LL;
double PI = 3.1415926535897932;

template<typename T1,typename T2>inline void chmin(T1 &a,const T2 &b){if(a>b) a=b;}
template<typename T1,typename T2>inline void chmax(T1 &a,const T2 &b){if(a<b) a=b;}

#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()

/* do your best */

int main() {
  
  string s, t; cin >> s >> t;
  int ans = inf;
  bool end = false;
  for (int i = 0; i < s.size(); i++) {
    int tmp = 0;
    for (int j = 0; j < t.size(); j++) {
      int k = i + j;
      if (k >= s.size()) {
        end = true;
        break;
      }
      if (s[k] != t[j]) tmp++;
    }
    if (end) break;

    // cerr << i << " " << tmp << endl;

    ans = min(ans, tmp);
  }

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


Measured memory_bytes: 3164
#include <cmath>
#include <vector>
#include <queue>
#include <iostream>
#include <bits/stdc++.h>
#define lli long long int
#define mp make_pair
#define pb push_back
using namespace std;

const lli mod = 998244353;

lli power(lli x, lli y) {
    // x %= mod;
    if (y == 0) return 1;
    // return ((y % 2 == 1 ? x : 1) * power(x * x, y / 2)) % mod;
    return ((y % 2 == 1 ? x : 1) * power(x * x, y / 2));
}

vector <long long int> primeNumbers;

void SieveOfEratosthenes(int n){
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime));
    for (int p=2; p*p<=n; p++){ 
        if (prime[p] == true) 
        { 
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
    for (int p=2; p<=n; p++){
      if (prime[p]){
        primeNumbers.push_back(p);
      }
    }        
}

#define MAXN 305
// vector < vector < int >  > v(MAXN);
// vector < vector < int >  > vnew(MAXN);
// int visit[MAXN];

int mat[MAXN][MAXN];

// void dfs(int index, int parent){
//   visit[index] = 1;
//   for(int i = 0;i<v[parent].size();i++){
//     int node = v[parent][i];
//     if(visit[node]) continue;
//     else if (!binary_search(v[index].begin(),v[index].end(),node)){
//       visit[node] = 1;
//       dfs(node,index);
//     }
//   }
// }
long long int preval[16];
void pre(){
  preval[0] = 1;
  preval[1] = 10;
  for(int i = 2;i<=15;i++){
    long long int val = (long long int)pow(10,i-1) - 1 + preval[i-1] + 10;
    preval[i] = val;
  }

  // for(int i = 0;i<=14;i++) cout<<preval[i]<<' ';
}

void solve(){
  int n;
  cin>>n;
  int h[n];
  for(int i = 0;i<n;i++){
    cin>>h[i];
  }
  int dp[n];
  dp[0] = 0;
  for(int i = 1;i<n;i++){
    if(i == 1){
      dp[i] = dp[i-1] + abs(h[i] - h[i-1]);
    }else{
      dp[i] = min(dp[i-1] + abs(h[i]-h[i-1]),dp[i-2] + abs(h[i]-h[i-2]));
    }
  }
  // for(int i = 0;i<n;i++) cout<<dp[i]<<' ';
  //   cout<<endl;
  cout<<dp[n-1];

}
 
 
int main(){
  ios::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
  #ifndef ONLINE_JUDGE
      freopen("input.txt", "r", stdin);
      freopen("output.txt", "w", stdout);
  #endif
 
  int t;
  // cin>>t;
  // scanf("%d",&t);
  t = 1;
  pre();
  while(t--){
    // cout<<
    solve();
 
    if(t>0){
      cout<<endl;
      // printf("\n");
    } 
  }
 
 
  cerr << "Time : " << (double)clock() / (double)CLOCKS_PER_SEC << "s\n";
 
  return 0;
}


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

int n;

int main() {
    while (scanf("%d", &n) == 1) {
        long long res = 0;
        for (int d = 1; d <= n; d++) {
            int k = n / d;
            long long t = 1ll * d * k * (k + 1) / 2;
            res += t;
        }
        printf("%lld\n", res);
    }
}


Measured memory_bytes: 3808
using System;
using System.Collections.Generic;
using System.Linq;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var k = int.Parse(Console.ReadLine());
            var ab = Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
            int cnt = 0;
            string ans;
            while (true)
            {
                if(k*cnt >= ab[0] && k * cnt <= ab[1])
                {
                    ans = "OK";
                    break;
                }
                else if(k * cnt > ab[1])
                {
                    ans = "NG";
                    break;
                }
                cnt++;
            }

            Console.WriteLine(ans);

        }
    }
}


Measured memory_bytes: 28140
from functools import lru_cache
import sys

#@lru_cache(maxsize=1000)
def dfs(A,B):
    if len(A)==n:
        ans=0
        for i in num_list:
            if A[i[1]-1]-A[i[0]-1]==i[2]:
                ans+=i[3]
        B.append(ans)
        return
    for i in range(max(A),m+1):
        A.append(i)
        dfs(A,B)
        A.pop()
if __name__=="__main__":
    sys.setrecursionlimit(10000)
    n,m,q=map(int,input().split())
    num_list=[]
    ans_lst=[]
    for i in range(q):
        tmp=list(map(int,input().split()))
        num_list.append(tmp)
    a=[]
    for i in range(1,m+1):
        a.append(i)
        dfs(a,ans_lst)
        a.clear()
    print(max(ans_lst))


Measured memory_bytes: 79528
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

int main() {
    int N, C;
    cin >> N >> C;
    vector<vector<int>> D(C, vector<int>(C));
    rep(i, C) rep(j, C) cin >> D[i][j];
    vector<vector<int>> c(N, vector<int>(N));
    rep(i, N) rep(j, N) cin >> c[i][j];
    
    vector<vector<int>> d(C, vector<int>(3, 0));
    rep(i, N) rep(j, N) rep(k, C) d[k][(i + j) % 3] += D[c[i][j] - 1][k];
    int ans = 1001001001;
    rep(i, C) rep(j, C) rep(k, C) {
        if (i == j || j == k || k == i) continue;
        ans = min(ans, d[i][0] + d[j][1] + d[k][2]);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1280
#include<iostream>
#include<vector>
using namespace std;
const int N=3400;
vector<int> E[N];
int n,A[N];
int dfs(int x,int fr)
{
	for(auto R:E[x])
		if(R!=fr&&A[x]>A[R]&&!dfs(R,x)) return 1;
	return 0;
}
int main()
{
	cin>>n;
	for(int i=1;i<=n;i++) cin>>A[i];
	for(int i=1,x,y;i<n;i++) cin>>x>>y,E[x].push_back(y),E[y].push_back(x);
	for(int i=1;i<=n;i++) if(dfs(i,0)) printf("%d ",i);
}


Measured memory_bytes: 1024
//
//AtCoder Beginner Contest 145
//C - Average Length
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <ctime>
#include <queue>
#include <map>
#include <functional>

using namespace std;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()

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

const double PI = 3.14159265358979323846;

ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }            //最小公倍数

double dist(int x1, int y1, int x2, int y2){
    return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
}

int main()
{
    int n;

    cin >> n;

    int x[n];
    int y[n];
   
    vector<int> p(n);

    REP(i,n) {
        cin >> x[i] >> y[i];
        p[i] = i;
    }

    int c = 0;
    double d = 0;
    do{
        //REP(i, n) cout << p[i] << " ";
        //cout << endl;
        REP(i,n-1){
            d += dist(x[p[i]], y[p[i]], x[p[i+1]], y[p[i+1]]);
        }
        c++;
    }while(next_permutation(ALL(p)));


    cout << setprecision(12) << d / c << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<queue>
#include<string>
#include<cmath>
#include<cstdio>
#include<cctype>
#include<cstring>
#include<iomanip>
#include<cstdlib>
#include<ctime>
#include<set>
#include<map>
#include<utility>
#include<vector>
#include<stack>
#include<sstream>
#include<algorithm>
using namespace std;
/****************************/
#define ll long long
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vpii vector<pair<int,int> >
#define qi queue<int>
#define mii map<int,int>
#define msi map<string,int>
#define vs vector<string>
#define vc vector<char>
/****************************/
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rep2(i,n) for(ll i=(n)-1;i>=0;i--)
#define rep3(i,a,n) for(ll i=(a);i<(n);i++)
#define rep4(i,a,n) for(ll i=(a)-1;i>=n;i--)
#define mp make_pair
#define pb push_back
#define st first
#define nd second
#define pi 3.1415926535897932384626433832795
#define zero(n) memset(n,0,sizeof(n));
#define SZ(n) n.size()
#define sn st.nd 
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
/****************************/
ll m,n;
int a[100010];
string s; 
int main()
{
	cin>>n;
	zero(a);
	ll ans=0;
	rep(i,n)
	{
		int x;
		cin>>x;
		ans+=x;
		a[x]++;
	}
	cin>>m;
	rep(i,m)
	{
		int y,z;
		cin>>y>>z;
		ans+=a[y]*(z-y);
		a[z]+=a[y];
		a[y]=0;
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 4012
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int i;
    string str;
    cin>>str;
    for(i=0;i<str.length();i++)
    {
       str[i]='x';
       cout<<str[i];


    }



 return 0;
}



Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define rep(i, a, b) for(int i=(a); i<(b); i++)
#define sz(a) (int)a.size()
#define de(a) cout<<#a<<" = "<<a<<endl
#define dd(a) cout<<#a<<" = "<<a<<" "
#define all(a) a.begin(), a.end()
#define pw(x) (1ll<<(x))
typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef vector<int> vi;
const int P = 1e9 + 7;
inline int add(int a, int b) {if((a += b) >= P) a -= P; return a;}
inline int sub(int a, int b) {if((a -= b) < 0) a += P; return a;}
inline int mul(int a, int b) {return 1ll * a * b % P;}
inline int kpow(int a, int b) {int r=1;for(;b;b>>=1,a=mul(a,a)) {if(b&1)r=mul(r,a);}return r;}
//----
const int N = 101010;
char s[N];
int main(){
	scanf("%s", s);
	int n = strlen(s);
	int ans = n;
	rep(i, 0, n - 1) if(s[i] != s[i + 1]) ans = min(ans, max(i + 1, n - i - 1));
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 3920
num = input()
evens = [int(x) for x  in input().split()]

itr = 0
flg = True
while flg:
  evens = list(map(lambda x: (x/2), evens))
  is_evens = list(map(lambda x: x.is_integer(), evens))
  if not all(is_evens):
    flg = False
    break
  itr+=1
print(itr)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
typedef long long LL;
int N;
LL A[200001];
LL B[200001];
LL C[200001];
LL D[200001];
LL E[200001];
LL dp[5][200001];
int main(){
	cin>>N;
	REP(i,N){
		cin>>A[i];
	}
	REP(i,3){
		REP(j,N){
			dp[i][j]=-1e17;
		}
	}
	if(N==2){
		cout<<max(A[0],A[1])<<endl;
		return 0;
	}
	if(N==3){
		cout<<max(max(A[0],A[1]),A[2])<<endl;
		return 0;
	}
	dp[0][0]=A[0];
	dp[2][2]=A[2];
	dp[1][1]=A[1];
	dp[0][2]=A[0]+A[2];
	for(int i=3;i<N;i++){
		REP(j,3){
			dp[j][i]=max(dp[j][i-2]+A[i],dp[j][i]);
			dp[j+1][i]=max(dp[j][i-3]+A[i],dp[j+1][i]);
			if(i!=3){
				dp[j+2][i]=max(dp[j][i-4]+A[i],dp[j+2][i]);
			}
		}
	}
	LL answer=-1e17;
	REP(j,3){
		if(j==2&&N%2==0)continue;
		answer=max(answer,dp[j][N-1]);
	}
	cout<<answer<<endl;
	return 0;
}

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

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

    long long pl_1000 = X/500;
    long long pl_5 = (X-pl_1000*500)/5;
    long long pl = 1000*(pl_1000) + 5*pl_5;
    cout << pl << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>

int main(){
	int i,N;
	double v,t;
	while(scanf("%lf",&v)!=EOF){
		t=v/9.8;
		for(i=1;;i++){
			N=5*i-5;
			if(N>=4.9*t*t) break;
		}
		printf("%d\n",i);
	}
	return 0;
}

Measured memory_bytes: 628
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
template<typename T = int> T in() { T x; cin >> x; return x; }
template<typename T = int> T in(T &&x) { T z(forward<T>(x)); cin >> z; return z; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &x : v) is >> x; return is; }
// clang-format on

template<typename CommutativeGroup> class WeightedUnionFind {
  using T = typename CommutativeGroup::value_type;
  CommutativeGroup g;

  vector<int> tree, rank;
  vector<T> diffWeight;

public:
  WeightedUnionFind(const int &n) : tree(n), rank(n), diffWeight(n, g.id()) { iota(all(tree), 0); }

  int root(const int &x) {
    if (tree[x] == x) {
      return x;
    } else {
      int r = root(tree[x]);
      diffWeight[x] += diffWeight[tree[x]];
      return tree[x] = r;
    }
  }

  T weight(const int &x) {
    root(x);
    return diffWeight[x];
  }

  bool same(const int &a, const int &b) { return root(a) == root(b); }

  bool unite(int a, int b, T w) {
    w = g(w, g(weight(a), g.inv(weight(b))));
    a = root(a), b = root(b);
    if (a == b) return false;
    if (rank[a] < rank[b]) swap(a, b), w = g.inv(w);
    tree[b] = a;
    diffWeight[b] = w;
    if (rank[a] == rank[b]) ++rank[a];
    return true;
  }

  T diff(int x, int y) { return g(weight(y), g.inv(weight(x))); }
};

template<typename T> struct sumGroup {
  using value_type = T;
  constexpr value_type id() { return 0; }
  constexpr value_type operator()(const value_type &a, const value_type &b) { return a + b; }
  constexpr value_type inv(const value_type &x) { return -x; }
};

int main() {
  int n = in();
  int q = in();
  WeightedUnionFind<sumGroup<int>> wuf(n);
  while (q--) {
    int c = in();
    if (c) {
      int x = in();
      int y = in();
      if (wuf.same(x, y)) {
        cout << wuf.diff(x, y) << endl;
      } else {
        cout << '?' << endl;
      }
    } else {
      int x, y, z;
      cin >> x >> y >> z;
      wuf.unite(x, y, z);
    }
  }
}



Measured memory_bytes: 3908
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <cmath>
#include <iomanip>
#include <set>
using namespace std;
typedef long long ll;

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

  map<char, int> dic;

  for (int i = 0; i < w.size(); i++) {
    dic[w[i]]++;
  }

  for (auto& p : dic) {
    if (p.second % 2 != 0) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;

  return 0;
}

Measured memory_bytes: 3636
# D - Blue and Red Balls

n, k = map(int, input().split())
mod = 10**9+7

'''
赤の隙間にi個の青を置く選び方
　(n-k+1)C(i)

青の組み合わせ(i個の分け方)
　(k-1)C(i-1)
'''

def comb_mod(n, r, p):
    num = 1
    den = 1
    for i in range(r):
        num = (num*(n-i))%mod
        den = (den*(i+1))%mod
    return (num * pow(den, p-2, p))%mod

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

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
string st;
char ch[100010];
long long len;
int main()
{
    cin>>st;
    len=st.size();
    for(int i=0;i<st.size();i++)
    {
        ch[len-i-1]=st[i];
        if(st[i]=='b')ch[len-i-1]='d';
        if(st[i]=='d')ch[len-i-1]='b';
        if(st[i]=='p')ch[len-i-1]='q';
        if(st[i]=='q')ch[len-i-1]='p';
    }
    for(int i=0;i<len;i++)
        if(ch[i]!=st[i])
        {
            cout<<"No"<<endl;
            return 0;
        }
    cout<<"Yes"<<endl;
    return 0;
}

Measured memory_bytes: 512
import java.util.*

fun main(args: Array<String>) = codeFestival2017QualAC()

fun codeFestival2017QualAC() {
    val (h, w) = readLine()!!.split(' ').map { it.toInt() }
    val a = (1..h).flatMap { readLine()!!.toList() }

    val queue = PriorityQueue(h * w,
        Comparator { o1: Int, o2: Int -> o2 - o1 })
    queue.addAll(a.groupBy { it }.map { it.value.size })

    fun simulate(take: Int, takePer: Int): Boolean {
        var remainToTake = take
        while (remainToTake > 0) {
            val poll = queue.poll()
            val remain = poll - takePer
            remainToTake -= takePer
            if (remain < 0) return false
            if (remain > 0) queue.add(remain)
        }
        return true
    }

    val centerHeight = h % 2
    val centerWidth = w % 2

    val takeCorners = (h / 2) * (w / 2) * 4
    val takePerCorner = 4

    val takeVertical = (w % 2) * h - centerHeight
    val takePerVertical = centerWidth * 2

    val takeHorizontal = (h % 2) * w - centerWidth
    val takePerHorizontal = centerHeight * 2

    val answer = if (simulate(takeCorners, takePerCorner)
        && simulate(takeVertical, takePerVertical)
        && simulate(takeHorizontal, takePerHorizontal)
    ) "Yes" else "No"

    println(answer)
}


Measured memory_bytes: 38188
import sys
import math
from collections import deque
import heapq
import itertools
MAX_INT = int(10e25)
MIN_INT = -MAX_INT
mod = 998244353
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

s = S()
N = len(s)

s = s.replace('?', 'D')
print(s)

Measured memory_bytes: 68116
#include <stdio.h>

int main(void) {

 int W ,H ,x ,y ,r;    

scanf("%d %d %d %d %d" ,&W ,&H ,&x ,&y ,&r);    

if((0<=(x-r) && (x+r)<=W && 0<=(y-r) && (y+r)<=H)){      

printf("Yes\n");     

}    

else{      

printf("No\n");     

}    

return 0;

}

Measured memory_bytes: 580
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#include<complex>
#include<cstdio>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ppi pair<pii,int>
#define pip pair<int,pii>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define inf 1000000001
#define inf1 1000000000000000001
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l,r) l+(r-l)/2
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}

void solve(){
	int n;
  cin>>n;
  cout<<1-n<<"\n";
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 3648
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
int main(void){
    int n,m,l;
    ll a[100][100],b[100][100];
    cin>>n>>m>>l;
    int i,j,k;
    for(i=0;i<n;i++){
        for(j=0;j<m;j++){
            cin>>a[i][j];
        }
    }
    for(i=0;i<m;i++){
        for(j=0;j<l;j++){
            cin>>b[i][j];
        }
    }
    ll sum;
    for(i=0;i<n;i++){
        for(j=0;j<l;j++){
            sum=0;
            for(k=0;k<m;k++){
                sum+=a[i][k]*b[k][j];
            }
            cout<<sum;
            if(j<l-1){
                cout<<" ";
            }
            else{
                cout<<endl;
            }
        }
    }

    return 0;
}



Measured memory_bytes: 3252
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
#define SIZE 200005
#define INF 1000000005LL
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
int main(){
  int number;
  int answer;
  cin >> number;
  if(number%2 == 1){
      answer = number/2 + 1;
  }else{
      answer = number /2;
  }
  cout << answer << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<map>
#include<vector>
#include<algorithm>
#include<queue>
#define INF 1000000000000LL
using namespace std;

typedef pair<int,int> P;

long long dis[6100];
vector<P> g[6100];
long long g2[310][310];
map<string,int> id;
vector<int> gas;
int n,m,cap,d;
string a,b;

int main(){
  ios_base::sync_with_stdio(false);
  while(cin >> n >> m >> cap,n||m||cap){
    id.clear(); gas.clear();
    for(int i=0;i<6100;i++)g[i].clear();
    
    cin >> a >> b;
    id[a] = id.size(); id[b] = id.size();
    gas.push_back(1); gas.push_back(2);

    for(int i=0;i<n;i++){
      cin >> a >> b >> d;
      if(id.find(a) == id.end())id[a] = id.size();
      if(id.find(b) == id.end())id[b] = id.size();
      g[id[a]].push_back(P(d,id[b]));
      g[id[b]].push_back(P(d,id[a]));
    }
    for(int i=0;i<m;i++){
      cin >> a;
      gas.push_back(id[a]);
    }

    for(int i=0;i<gas.size();i++){
      for(int j=0;j<gas.size();j++)g2[i][j] = INF;
      g2[i][i] = 0;
    }

    for(int i=0;i<gas.size();i++){
      for(int j=0;j<=id.size();j++)dis[j] = INF;
      dis[gas[i]] = 0;
      priority_queue<P,vector<P>,greater<P> > q;
      q.push(P(0,gas[i]));
      
      while(q.size()){
	P p = q.top();q.pop();
	long long dist = p.first;
	int pos = p.second;
	
	for(int x=0;x<g[pos].size();x++){
	  int tdis = dist + g[pos][x].first;
	  int nxt = g[pos][x].second;
	  if(dis[nxt] > tdis){
	    dis[nxt] = tdis;
	    q.push(P(tdis,nxt));
	  }
	}
      }
      for(int j=0;j<gas.size();j++){
	if(cap*10<dis[gas[j]])continue;
	g2[i][j] = dis[gas[j]];	
      }
    }

    for(int k=0;k<gas.size();k++)
      for(int i=0;i<gas.size();i++)
	for(int j=0;j<gas.size();j++)
	  g2[i][j] = min(g2[i][j],g2[i][k] + g2[k][j]);

    if(g2[0][1] == INF)cout << -1 << endl;
    else cout << g2[0][1] << endl;
  }
}

Measured memory_bytes: 3120
// ===================================
//   author: M_sea
//   website: http://m-sea-blog.com/
// ===================================
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#define re register
using namespace std;

inline int read() {
    int X=0,w=1; char c=getchar();
    while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
    while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
    return X*w;
}

const int N=200+10;

int n,a[N];

int main() {
    n=read()<<1;
    for (re int i=1;i<=n;++i) a[i]=read();
    sort(a+1,a+n+1); int ans=0;
    for (re int i=1;i<=n;i+=2) ans+=a[i];
    printf("%d\n",ans);
    return 0;
}


Measured memory_bytes: 256
S = input()

count = 0
a = int(S[0])
b = 0 if a == 1 else 1

for i in range(1,len(S)):
    color = int(S[i])
    if i % 2 == 1 and color !=b:
        count += 1
    elif i % 2 == 0 and color != a:
        count += 1
print(count)

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

using namespace std;

using int64 = long long;
const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

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

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 = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int64 N, K;
  cin >> N >> K;

  auto check = [&](int64 S) {
    int64 rest = K - S;
    for(int i = 1; i < N; i++) {
      S /= 2;
      rest -= S;
      if(S == 0) break;
      if(rest < 0) return false;
    }
    return true;
  };
  int64 ok = 0, ng = K + 1;
  while(ng - ok > 1) {
    int64 mid = (ok + ng) / 2;
    if(check(mid)) ok = mid;
    else ng = mid;
  }
  cout << ok << endl;
}


Measured memory_bytes: 3212
import java.util.Scanner;
 
public class Main{
    public static void main(String[] args){
        Scanner S = new Scanner(System.in);
        int n = S.nextInt();
        int m = S.nextInt();
        int[][] A = new int[n][m];
        int[] b = new int[m];
        int[] ans = new int[n];
         
        for(int i = 0;i < n;i++){
            for(int j = 0;j < m;j++){
                A[i][j] = S.nextInt();
            }
        }
         
        for(int i = 0;i < m;i++){
            b[i] = S.nextInt();
        }
         
        for(int i = 0;i < n;i++){
            for(int j = 0;j < m;j++){
                ans[i] += A[i][j] * b[j];
            }
        }
         
        for(int i = 0;i < n;i++){
            System.out.println(ans[i]);
        }
    }       
}

Measured memory_bytes: 31384
A,B,K=map(int,input().split())
A_yaku=[]
B_yaku=[]

for i in range(1,A+1):
    if A % i == 0:
        A_yaku.append(i)

for j in range(1,B+1):
    if B % j == 0:
        B_yaku.append(j)

A_B_and_set = set(A_yaku) & set(B_yaku)
A_B_and_list = list(A_B_and_set)

ans_list=sorted(A_B_and_list,reverse=True)

ans=ans_list[K-1]
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <cmath>
using namespace std;
int main(void){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  if(abs(b-a)<=d && abs(b-c)<=d)cout<<"Yes"<<endl;
  else if(abs(c-a)<=d)cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define INF 1000000005
#define MOD 1000000007
#define EPS 1e-10
#define rep(i,n) for(int i=0;i<n;++i)

using namespace std;

typedef pair<int,int>P;

const int MAX_N = 101;
const int MAX_V = 205;

struct edge
{
	int to,cap,rev;
};

vector<edge> G[MAX_V];
int level[MAX_V];
int iter[MAX_V];
char c[MAX_N][MAX_N];
int h,w;

void add_edge(int from,int to,int cap)
{
	G[from].push_back((edge){to,cap,G[to].size()});
	G[to].push_back((edge){from,0,G[from].size()-1});
}

void bfs(int s)
{
	memset(level,-1,sizeof(level));
	queue<int> que;
	level[s] = 0;
	que.push(s);
	while(!que.empty()){
		int v = que.front();
		que.pop();
		rep(i,G[v].size()){
			edge &e = G[v][i];
			if(e.cap > 0 && level[e.to] < 0){
				level[e.to] = level[v] + 1;
				que.push(e.to);
			}
		}
	}
}

int dfs(int v,int t,int f)
{
	if(v==t){
		return f;
	}
	for(int &i = iter[v];i<G[v].size();i++){
		edge &e = G[v][i];
		if(e.cap > 0 && level[v] < level[e.to]){
			int d = dfs(e.to,t,min(f,e.cap));
			if(d>0){
				e.cap -= d;
				G[e.to][e.rev].cap += d;
				return d;
			}
		}
	}
	return 0;
}

int max_flow(int s,int t)
{
	int flow = 0;
	for(;;){
		bfs(s);
		if(level[t]<0){
			return flow;
		}
		memset(iter,0,sizeof(iter));
		int f;
		while((f=dfs(s,t,INF)) > 0){
			flow += f;
		}
	}
}

int main()
{
	scanf("%d%d",&h,&w);
	rep(i,h){
		char hoge;
		scanf("%c",&hoge);
		rep(j,w){
			scanf("%c",&c[i][j]);
			if(c[i][j] == 'S'){
				add_edge(0,i+1,INF);
				add_edge(0,h+j+1,INF);
			}
			if(c[i][j] == 'T'){
				add_edge(i+1,h+w+2,INF);
				add_edge(h+j+1,h+w+2,INF);
			}
			if(c[i][j] == 'o'){
				add_edge(i+1,h+j+1,1);
				add_edge(h+j+1,i+1,1);
			}
		}
	}
	int res = max_flow(0,h+w+2);
	if(res >= INF){
		printf("-1\n");
	}else{
		printf("%d\n",res);
	}
	return 0;
}

Measured memory_bytes: 896
// #include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <climits>
#include <string>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <ctime>
#include <cassert>
#include <fstream>
#include <stack>
#include <random>
#include <atcoder/string>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

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

template<typename T>
void vdeb(std::vector<T> &da) {
    for (int i = 0;i < da.size();i++) {
        if (i == da.size() - 1) std::cout << da[i];
        else std::cout << da[i] << ' ';
    }
    std::cout << '\n';
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
    for (int i = 0;i < da.size();i++) {
        std::cout << i << ' ';
        vdeb(da[i]);
    }
    std::cout << '\n';
}

using namespace std;
namespace ac = atcoder;

int main() {
    string s; cin >> s;
    ll n = s.size();
    ll ans = n*(n+1)/2;
    vector<int> lcp = ac::lcp_array(s, ac::suffix_array(s));
    rip(i,n-1,0) ans -= lcp[i];
    cout << ans << endl;
}

Measured memory_bytes: 15668
# include<iostream>
# include<string>

using namespace std;

int main(void){
  int cnt=0;
  string str;
  cin >> str;
  for(int i=0; i<3; ++i){
    if(str[i] == '1')
      cnt++;
  }

  cout << cnt << '\n';
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#pragma GCC optimize("Ofast")
//*********************************************DO IT NOW****************************************************************
#include<bits/stdc++.h> 
#include<random>
#define int long long   
#define pp pair<int,int> 
#define ss second 
#define ff first 
#define pb push_back
#define mod 1000000007
#define pi 3.14159265359
#define mk(arr,n,type)  type *arr=new type[n];
#define sl s1.length();
#define yes cout<< "YES"<<endl
#define no  cout<< "NO"<<endl
#define all(v) (v).begin(),(v).end()
#define s(v)   sort(v,v+n)
#define  mt mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define read(a,n) for(int i=0;i<n;i++)cin>>a[i]
#define print(a,n) for(int i=0;i<n;i++)cout<<a[i]<<" "
using namespace std;
//**********************************************DO IT NOW***************************************************************
void fastio()
{  
  #ifndef ONLINE_JUDGE
  freopen("INPUT.txt","r",stdin);
  freopen("OUTPUT.txt","w",stdout); 
  #endif
  ios_base :: sync_with_stdio(false); 
  cin.tie(NULL) ; 
  cout.tie(NULL);
}
int dp[101][1001],ans1=1e9,dp1[1000001];
int num[10];
int a[1000000];
signed main()
{   
    fastio();
    int t=1;
   // cin>>t;
    while(t--)
    {
        int n;
        cin>>n;
        double x=n/3.0;
        double ans=(x*x*x);
        cout<<fixed<<setprecision(6)<<ans;
    }
}
// 🍪 🍪 🍪


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

void solve(){
  LL n, k; cin >> n >> k;
  LL a[n]; for (int i = 0; i < n; i++) cin >> a[i];

  sort(a, a + n);
  LL ans = 0;
  for (int i = 0; i < n - k; i++) ans += a[i];
  cout << ans << endl;
}

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

  solve();

  return 0;
}


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

ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
int memo[1000000];
int res(int n) {
  if(n == 0) return 0;
  if(memo[n] != -1) return memo[n];
  int ans = n;
  for(int i = 1; i <= n; i *= 6) {
    ans = min(ans, res(n - i) + 1);
  }

  for(int i = 1; i <= n; i *= 9) {
    ans = min(ans, res(n - i) + 1);
  }

  return memo[n] = ans;
}

int main() {
  
  int N; 
  cin >> N;
  vector<int> dp(1000000);
  for(int i = 0; i < N + 1; i++) {
    dp[i] = N;
  }
  dp[0] = 0;
  for(int n = 1; n <= N; n++) {
    for(int i = 1; i <= n; i *= 6) {
      dp[n] = min(dp[n], dp[n - i] + 1);
    }
    for(int j = 1; j <= n; j *= 9) {
      dp[n] = min(dp[n], dp[n - j] + 1);
    } 
  }

  cout << dp[N];
  
  return 0;
}

Measured memory_bytes: 4096
import math

n = int(input())
a = list(map(int, input().split()))

L = [0] * (n+1)
R = [0] * (n+1)
for i in range(n):
  if L[i] == 0:
    L[i+1] = a[i]
  else:
    L[i+1] = math.gcd(L[i], a[i])
  
  #print(n, i, n-i-1)
  if R[n-i] == 0:
    R[n-i-1] = a[n-i-1]
  else:
    R[n-i-1] = math.gcd(R[n-i], a[n-i-1])
M = [0] * (n+1)
for i in range(n):
  M[i] = math.gcd(L[i], R[i+1])
print(max(M))

Measured memory_bytes: 86364
# -*- coding: utf-8 -*-
from sys import stdin
from collections import Counter
import numpy as np

s_in = lambda: stdin.readline()[:-1]  # s = s_in()
d_in = lambda: int(stdin.readline())  # N = d_in()
ds_in = lambda: list(map(int, stdin.readline().split()))  # List = ds_in()


N, K = ds_in()
t_list = []
d_list = []
for _ in range(N):
    t, d = ds_in()
    t_list.append(t)
    d_list.append(d)
np_t = np.array(t_list)  # sushi kind
np_d = np.array(d_list)  # sushi value

sort_idx = np.argsort(np_d)[::-1][:K]  # top K value sushi
top_sushi = np_t[sort_idx]
top_score = np_d[sort_idx]
kind = len(set(top_sushi))
point = top_score.sum() + kind**2  # temp max point
point_list = [point]
sushi_counter = Counter(top_sushi)

sushi_set = {k: [] for k in set(t_list)}
for i, j in zip(t_list, d_list):
    sushi_set[i].append(j)
max_sushi = {k: max(sushi_set[k]) for k in set(t_list)}

for s in set(top_sushi):
    max_sushi.pop(s)  # temp max point
max_values = list(max_sushi.values())
max_values.sort(reverse=True)
if len(max_values) > 0:
    for sushi, score in zip(top_sushi[::-1], top_score[::-1]):
        if sushi_counter[sushi] > 1:
            sushi_counter[sushi] -= 1
            kind += 1
            point = point - score + max_values.pop(0) + 2*kind - 1
            point_list.append(point)
            if len(max_values) == 0:
                break

print(max(point_list))

Measured memory_bytes: 62432
/* * * * * * * * * * * **
*                      *
*	   saurabh8522	   *
*	  I will handle	   *
*		   IT.		   *
*                      *
* * * * * * * * * * * **/
#include<bits/stdc++.h>
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define FastRead ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define ld long double
#define zero(a) memset((a),0,sizeof((a)))
#define one(a) memset((a),1,sizeof((a)))
#define minus(a) memset((a),-1,sizeof((a)))
#define all(g) g.begin(),g.end()
#define ppb pop_back
using namespace std;
typedef long long int ll;
#define MOD 1000000007
ll extgcd(ll a,ll b,ll& x,ll& y){if(b==0){x=1;y=0;return a;}else{int g=extgcd(b,a%b,y,x);y-=a/b*x;return g;}}
ll modpow(ll a,ll b) {ll res=1;a%=MOD;for(;b;b>>=1){if(b&1)res=res*a%MOD;a=a*a%MOD;}return res;}
ll numdigit(ll n){return floor(log10(n)) + 1;}
bool isPowerTwo (ll x) { return x && (!(x&(x-1))); } 
ll dp[101][100001];
ll find(vector<ll>&v,vector<ll>&w,ll pos,ll W){
	if(pos>=v.size()) return 0;
	ll &ans=dp[pos][W];
	if(ans!=-1) return ans;
	ans=0;
	ans=find(v,w,pos+1,W);
	if(w[pos]<=W){
		ans=max(ans,v[pos]+find(v,w,pos+1,W-w[pos]));
	}
	return ans;
}
int  main(){
	FastRead;
	ll t=1;
	// cin>>t;
	while(t--){
		ll n,W;
		cin>>n>>W;
		vector<ll>v(n),w(n);
		for(int i=0;i<n;i++){
			cin>>w[i]>>v[i];
		}
		for(int i=0;i<n;i++){
			for(int j=0;j<=W;j++){
				dp[i][j]=-1;
			}
		}
		cout<<find(v,w,0,W)<<endl;
	}
}

Measured memory_bytes: 78336
import scala.io.{StdIn => in}

object Main extends App {
  val Array(n, m, x, y) = in.readLine.split(" ").map(_.toInt)
  val xi = in.readLine.split(" ").map(_.toInt)
  val yi = in.readLine.split(" ").map(_.toInt)

  val xy = (xi ++ yi).sorted

  val res = (xy).filter(z => x < z && z <= y).exists(z => {
    var res = true
    for {
      i <- xi
      j <- yi
      } if(!(i < z) || !(z <= j)) res = false
    // if(res) println(z)
    res
  })

  val ans = if(res) "No War" else "War"
  println(ans)
}

Measured memory_bytes: 27200
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0;i < (int)(n);i++)
#define rep2(i, s, n) for (int i = s; i < (int)(n);i++)
#define ALL(vec)  (vec).begin(),(vec).end()
#define lli long long int
#define pi 3.1415926535897932384626433832795
#define MAX_INF 9223372036854775807
#define MIN_INF 9223372036854775807+1
#define sosuu 1000000007

int main(){
  lli mini, N;
  mini =MAX_INF;
  cin >> N;
  lli T[5];
  rep(i, 5){
  cin >> T[i];
    mini = min(T[i], mini);
  }
  if(N%mini==0){
  cout << N / mini+4 << endl;
    return 0;
  }
  cout << N / mini+5 << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a, b;
  cin >> a >> b;
  double c = (a + b) / 2.0 / 0.1;
  int d = c;
  if (d % 10 >= 5) {
  cout << (a + b) / 2 + 1 << endl;
  }
  else {
    cout << (a + b) / 2 << endl;
  }
}

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


int main()
{	
	int n,t[100005],ans=0;
	cin>>n;
	for(int i=0;i<n;i++)
	{
		cin>>t[i];
	}
	for(int i=0;i<n-1;i++)
	{
		int k=i,cnt=0;
		while(t[k]>=t[k+1])
		{
			k++;
			cnt++;
			if(k==n-1)break;
		}
		if(cnt)i=k-1;
		ans=max(ans,cnt);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 640
#pragma GCC optimize("Ofast")
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define rep2(i,s,f) for(int i=s;i<f;i++)
#define INF 1000000000000000000
#define MOD 1000000007
typedef pair<int, int> P;

bool prime(int n) {
	for (int i = 2; i <= sqrt(n); i++) {
		if (n % i == 0)return false;
	}
	return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int mod_pow(int n, int p, int m) {
	if (p == 0) return 1;
	if (p % 2 == 0) {
		int t = mod_pow(n, p / 2, m);
		return (t * t) % m;
	}
	return n * mod_pow(n, p - 1, m) % m;
}
int extGCD(int a, int b, int& x, int& y) {
	if (b == 0) {
		x = 1;
		y = 0;
		return a;
	}
	long long d = extGCD(b, a % b, y, x);
	y -= a / b * x;
	return d;
}
int modinv(int a, int m) {
	int b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}
int digit(int x) {
	int cnt = 0;
	while (x > 0) {
		cnt += x % 10;
		x /= 10;
	}
	return cnt;
}
int read() {
	int tmp;
	cin >> tmp;
	return tmp;
}
int xor128() {
	static int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	int t = (x xor (x << 11));
	x = y; y = z; z = w;
	return (w = (w xor (w >> 19)) xor (t xor (t >> 8)));
}
map<int, int> factaring(int x) {
	map<int, int>ans;
	int now = 2;
	while (now * now <= x) {
		if (x % now == 0) {
			x /= now;
			ans[now]++;
		}
		else now++;
	}
	if (x != 1) ans[x]++;
	return ans;
}
int comb(int n, int k) {
	k = min(k, n - k);
	int x = 1, y = 1;
	rep(i, k) {
		y *= i + 1;
		y %= MOD;
	}
	for (int i = n - k + 1; i <= n; i++) {
		x *= i;
		x %= MOD;
	}
	return x * modinv(y, MOD) % MOD;
}

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

	int n;
	cin >> n;
	vector<string>vec[15];
	rep(i, n) {
		if (i == 0) vec[0].push_back("a");
		else {
			rep(j, vec[i - 1].size()) {
				char ma = 'a';
				rep(k, vec[i - 1][j].size()) {
					ma = max(ma, vec[i - 1][j][k]);
				}
				for (char c = 'a'; c <= ma + 1; c++) {
					string now = vec[i - 1][j] + c;
					vec[i].push_back(now);
				}
			}
		}
	}
	rep(i, vec[n - 1].size()) {
		cout << vec[n - 1][i] << endl;
	}

	return 0;
}


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

#define rep(i,n) for(ll i = 0; i < n; i++)
#define per(i,n) for(ll i = n-1; i >= 0; i--)
#define REP(i,n) for(ll i = 1; i < n; i++)
#define PER(i,n) for(ll i = n; i >= 1; i--)
#define sz(x) int(x.size())
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define YesorNo(a) printf(a ? "Yes\n" : "No\n")
#define endl '\n'
#define fi first
#define se second
using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vii = vector<vi>;
using vl = vector<ll>;
using vll = vector<vl>;
using vs = vector<string>;
using vb = vector<bool>;
using vc = vector<char>;
using vcc = vector<vc>;
using vP = vector<P>;
using vPP = vector<vP>;
using vPl = vector<Pl>;
const int dx[] = {0,1,0,-1,1,1,-1,-1};
const int dy[] = {1,0,-1,0,1,-1,-1,1};
const int inf = (1<<30)-1;
const ll infll = (1LL<<62)-1;
ll ceil(const ll &a, const ll &b){return ((a)+(b)-1)/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; }



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

  int n, m;
  cin >> n >> m;
  vii job(m);
  rep(i,n) {
    int a, b;
    cin >> a >> b;
    if(a > m) continue;
    job[m-a].push_back(b);
  }
  priority_queue<int> q;
  ll ans = 0;
  per(i,m) {
    for(int x : job[i]) q.push(x);
    if(!sz(q)) continue;
    ans += q.top(); q.pop();
  }
  cout << ans << endl;
}

Measured memory_bytes: 5632
while True:
    n,p = map(int, input().split())
    if n==0: break

    holding = [0]*n
    ctr = 0
    wan = p
    for _ in range(1000000):
        if wan != 0:
            holding[ctr] += 1
            wan -= 1
            if wan == 0 and holding[ctr] == p:
                print(ctr)
                break
        else:
            wan = holding[ctr]
            holding[ctr] = 0
        ctr += 1
        if ctr >= n: ctr -= n

Measured memory_bytes: 7628