akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <sstream>
#include <iomanip>
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vi vector <ll> 
#define qu queue <ll>
#define min_3(a,b,c) min(a,min(b,c))
#define max_3(a,b,c) max(a,max(b,c))
#define nout(ans) cout << (ans) << "\n"
#define sout(ans) cout << (ans) << " "
using namespace std;

/*
Decimal Places: cout << fixed << setprecision(n) << ans << endl

String to integer:
stringstream dark(s);
int x = 0; dark >> x;
*/

bool compare(const pair<int, int>&i, const pair<int, int>&j)
{
    return i.second < j.second;
}


void solve()
{
    int n; cin >> n;
    int hon[5] = {2,4,5,7,9};
    int pon[4] = {0,1,6,8};
    int bon[1] = {3};
    int k = n%10;
    string ans;
    for (int i=0; i<5; i++) if (hon[i]==k) ans = "hon";
    for (int i=0; i<4; i++) if (pon[i]==k) ans = "pon";
    for (int i=0; i<1; i++) if (bon[i]==k) ans = "bon";
    nout(ans);
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    int t = 1;
    //cin >> t;
    for (int i=1; i<=t; i++)
    {
        solve();
    }
    return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <fstream>
#include <cstdio>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>
#include <string.h>
#include <string>
#include <math.h>
#include <iomanip>
using namespace std;

#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define pb push_back

typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;

const int mod = 1e9 + 7;
const int mod2 = 998244353;

void fact_init(int n);
ll exp(ll taban, ll us, ll md);
ll ebob(ll a, ll b);
ll ekok(ll a, ll b);
ll komb(ll a, ll b);

vector<ll> fact;
vector<ll> inv_fact;
void fact_init(int n){
    fact.resize(n+5);
    inv_fact.resize(n+5);
    fact[0] = inv_fact[0] = 1;
    for(int i = 1; i <= n; i++){
        fact[i] = (fact[i-1] * i) % mod;
        inv_fact[i] = exp(fact[i], mod-2, mod);
    }
}
ll exp(ll taban, ll us, ll md) {
    ll carpan = taban % md;
    if(carpan == 0) return 0;
    ll temp = us;
    ll res = 1;
    while(temp){
        if(temp % 2) res = (res*carpan) % md;
        temp /= 2;
        carpan = (carpan*carpan) % md;
    }
    return res;
}
 
ll ebob(ll a, ll b){
    if(!a)return b;
    return ebob(b%a, a);
}

ll ekok(ll a, ll b){
    return (a*b)/ebob(a, b);
}

ll komb(ll a, ll b){
    if(a < b) return 0;
    return fact[a] * (inv_fact[a-b] * inv_fact[b] % mod) % mod;
}

const int N = 1e6 + 5;

int main(){
    ios::sync_with_stdio(false); cin.tie(NULL);
    string s; cin>>s;
	int res = 0;
	int cnt = 0;
	for(auto x : s){
		if(x == 'R') cnt++;
		else{
			res = max(res, cnt);
			cnt = 0;
		}
	}
	res = max(res, cnt);
	cout<<res;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
typedef long long int ll;
#define pb push_back
#define mp make_pair
#define fi first
#define se second
using namespace std;

int main()
{


	ll n;
	cin >> n;
	ll h[n];
	for (ll i = 0; i < n; i++)
	{
		cin >> h[i];
	}
	ll ans[n] = {0};
	ans[1] = abs(h[1] - h[0]);
	for (ll i = 2; i < n; i++)
	{
		ans[i] = min((ans[i - 2] + abs(h[i] - h[i - 2])) , (ans[i - 1] + abs(h[i] - h[i - 1])) );
	}
	cout << ans[n - 1];

}


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

using pii = pair<int, int>;
#define x first
#define y second

const int N = 200005;

int n;
vector<int> e[N];

pii f(int x, int y){
	pii r(0, x);
	for(int i : e[x]){
		if(i == y) continue;
		pii t = f(i, x);
		r = max(r, pii(t.x + 1, t.y));
	}
	return r;
}

int main(){
	scanf("%d", &n);
	for(int i = 0; i < n - 1; i++){
		int x, y;
		scanf("%d%d", &x, &y);
		e[x].push_back(y);
		e[y].push_back(x);
	}
	int t = f(f(1, 0).y, 0).x;
	if(t % 3 == 1) puts("Second");
	else puts("First");
}

Measured memory_bytes: 23680
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
typedef long long int ll;
const int N=1e5+6;
int w[N],v[N];
ll dp[101][N];
ll knp(int n,int c){
	if(dp[n][c]!=-1) {
		return dp[n][c];
	}
	ll ans=0;
	if(n==0||c==0) {
		return 0;
	}
	if(w[n]>c) {
		ans=knp(n-1,c);
	}
	else{
		ll ans1=knp(n-1,c);
		ll ans2=v[n]+knp(n-1,c-w[n]);
		ans= max(ans1,ans2);
	}
	return dp[n][c]=ans;
}
int main()
{

	ios_base:: sync_with_stdio(false); cin.tie(0);
	int n,we; cin>>n>>we;
	memset(dp,-1,sizeof dp);
	for(int i=1; i<=n; i++) {
		cin>>w[i]>>v[i];
	}

	cout<<knp(n,we)<<endl;

	return 0;
}


Measured memory_bytes: 79232
#include <bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define ll long long
#define li long
#define pb push_back
#define mem(arr,x) memset(arr,x,sizeof(arr))

ll n,a[401],prefix[401];
ll dp[401][401];

ll minCost(ll left,ll right)
{
  if(left>=right)
    return 0;
  if(dp[left][right]!=-1)
    return dp[left][right];

  ll mini=1e18+1,idx,temp=0;
  for(idx=left;idx<right;idx++)
  {
    temp=minCost(left,idx)+minCost(idx+1,right)+(prefix[right]-prefix[left-1]);
    mini=min(mini,temp);
  }
  return dp[left][right]=mini;
}

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin>>n;
    for(ll i=0;i<n;i++)
    {
      cin>>a[i];
      if(i==0)
        prefix[i]=a[i];
      else
        prefix[i]=prefix[i-1]+a[i];
    }
    mem(dp,-1);
    cout<<minCost(0,n-1);
    return 0;
}

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

long long int factorial(long long int n, long long int res){
    if (n == 1) return res;
    return factorial(n-1, res * n);
}

int main(){
    long long int n;
    cin >> n;
    cout << factorial(n, 1) << endl;;
    return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define FOR(i,x,y) for(int i=x;i<y;i++)
using namespace std;
int main(){
  vector<char> edi;
  char c;
  while(cin >> c){
    if(c == '0' or c == '1')edi.push_back(c);
    else if(edi.size())edi.pop_back();
  }
  for(auto x:edi)cout << x;
  cout << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define ALL(a) (a).begin(),(a).end()
 
int main(){
    int n, m, a, b;
    cin >> n >> m >> a >> b;
    vector<int> x(n), y(m);
    rep(i, n)cin >> x[i];
    rep(i, m)cin >> y[i];

    x.push_back(a);
    y.push_back(b);
    sort(ALL(x));
    sort(ALL(y));

    if(x[n] >= y[0])cout << "War";
    else cout << "No War";

}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

#define DEBUG(x) cout << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<pair<T, T> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n, m;
	cin >> n >> m;

	vector<int> days(n);
	int hangout = n;
	for (int i = 0; i < n; ++i) {
		cin >> days[i];
		hangout -= days[i];
		if (hangout < 0) {
			cout << "-1\n";
			return 0;
		}
	}

	cout << hangout << "\n";

	return 0;

}

Measured memory_bytes: 7140
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedHashMap;
import java.util.Map;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
		int inputInt = 0;
		int index = 0;
		Map<String, Integer> map = new LinkedHashMap<>();
		while((inputInt = Integer.parseInt(input.readLine())) != 0) {
			map.put("Case " + (++index) + ": ", inputInt);
		}
		for (Map.Entry<String, Integer> entry : map.entrySet()) {
			System.out.println(entry.getKey() + entry.getValue());
		}
	}

}



Measured memory_bytes: 34960
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}
template<class A,size_t N,class T>void Fill(A(&a)[N],const T&v){fill((T*)a,(T*)(a+N),v);}

const int MOD = 1e9+7; //998244353;

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m=MOD){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m=MOD){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
//V<ll>Fac,Rac;void setF(int n,int m=MOD){Fac=Rac=V<ll>(++n);Fac[0]=1;FOR(i,1,n)Fac[i]=Fac[i-1]*i%m;Rac[n-1]=modInv(Fac[n-1],m);FORR(i,n-1,1)Rac[i-1]=Rac[i]*i%m;}
//ll comb(int a,int b,int m=MOD){return a<b||b<0?0:Fac[a]*Rac[b]%m*Rac[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
const int N = 1e5;
int n;
string s;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n >> s;
  int c=0, ans=0;
  FOR(i, 0, n) c += s[i]=='R';
  FOR(i, 0, c) ans += s[i]=='W';
  cout << ans << endl;
}

Measured memory_bytes: 3748
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
    ll n; cin>>n;
    ll a[n],i;
    for(i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    
    ll ans=a[n-1],k=n-2,m=0;
    for(i=n-3;i>=0;i--)
    {
      if(m<2) { ans+=a[k]; m++; }
      else { ans+=a[--k]; m=1; }
    }
    
    cout<<ans;
    return 0;
}

Measured memory_bytes: 5100
import java.util.*;

public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    // 前からだと分解できるかわからないので、後ろから分解してみる
    String[] divideArr = {"maerd", "remaerd", "esare", "resare"};
    StringBuilder reverseStr = new StringBuilder(sc.next()).reverse();
    int length = reverseStr.length();

    for (int i = 0; i < length;) {
      boolean isDivided = false;
      for (String s : divideArr) {
        // ぶんかいできたら、分解した次の文字から繰り返す
        if (reverseStr.indexOf(s) == 0) {
          i += s.length();
          reverseStr.delete(0, s.length());
          isDivided = true;
          break;
        }
      }
      if (!isDivided) {
        System.out.println("NO"); // 分解できなかったらおわり
        return;
      }
    }

    System.out.println("YES");
  }
}


Measured memory_bytes: 27284
//#include <tourist>
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;
const int INF = 1e9;
const ll LINF = ll(1e18) + 1;
const int MOD = 1000000007;
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()
#define debug(v)          \
    cout << #v << ":";    \
    for (auto x : v)      \
    {                     \
        cout << x << ' '; \
    }                     \
    cout << endl;
template <class T>
bool chmax(T &a, const T &b)
{
    if (a < b)
    {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T &a, const T &b)
{
    if (b < a)
    {
        a = b;
        return 1;
    }
    return 0;
}
//cout<<fixed<<setprecision(15);有効数字15桁
//-std=c++14
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
string s;
vector<int> a;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> s;
    map<char,int>m;
    for (int i = 0; i <s.size(); i++)
    {
        m[s[i]]++;
    }
    for(char c='a';c<='z';c++){
        if(m[c]==0){
            s+=c;
            break;
        }
        if(c=='z'){
            map<char,int>m1;
            char temp=s[s.size()-1];
            m1[s[s.size()-1]]++;
            for (int i =s.size()-2; i >=0; i--)
                {
                    m1[s[i]]++;
                    if(temp>s[i]){
                        s[i]++;
                        while(m1[s[i]]==0){
                            s[i]++;
                        }
                        cout<<s.substr(0,i+1)<<"\n";
                        return 0;
                    }
                    temp=s[i];
                }
            return cout<<-1<<"\n",0;
        }
    }
    cout << s<< "\n";
}


Measured memory_bytes: 256
#include <string.h>
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
// #include <unordered_map>
// #include <unordered_set>
#include <utility>
#include <vector>

#define pb push_back
#define mp make_pair

#ifdef ONLINE_JUDGE
#define link relink
#endif

using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef long double ld;

inline void EnableFileIO(const string& fileName, bool local = 0) {
  if (fileName.empty()) return;
  if (local) {
    freopen((fileName + ".in").c_str(), "r", stdin);
    freopen((fileName + ".out").c_str(), "w", stdout);
    return;
  }
#ifdef ONLINE_JUDGE
  freopen((fileName + ".in").c_str(), "r", stdin);
  freopen((fileName + ".out").c_str(), "w", stdout);
#endif
}

const int INF = (1 << 30) - 1;
const LL LINF = (1LL << 61) - 1;
const double EPS = 1e-10, PI = acos(-1);

LL n;

int main() {
  // srand((int)time(0));
  // printf("Hello, world!\n");
  // EnableFileIO("");

  cin >> n;
  for (LL i = 0; i <= n; i++) {
    if (i * (i + 1) / 2 >= n) {
      cout << i << endl;
      break;
    }
  }

  return 0;
}


Measured memory_bytes: 256
# coding: utf-8
# Your code here!

N, M, Q = map(int, input().split(" "))
L = []
R = []
p = []
q = []

for i in range(M):
    _L, _R = map(int, input().split(" "))
    L.append(_L)
    R.append(_R)
    
for i in range(Q):
    _p, _q = map(int, input().split(" "))
    p.append(_p)
    q.append(_q)
    
def buildSumTable(N, L, R):
    ret = [[0 for i in range(N+1)] for i in range(N+1)]
    for i in range(M):
        ret[L[i]][R[i]] += 1
    for i in range(1, N+1):
        for j in range(1, N+1):
            ret[i][j] += ret[i-1][j]
            ret[i][j] += ret[i][j-1]
            ret[i][j] -= ret[i-1][j-1]
    return ret

def getSumRange(table, p, q):
    return table[q][q] - table[q][p-1] - table[p-1][q] + table[p-1][p-1] 

sumTable = buildSumTable(N, L, R)

for i in range(Q):
    ans = getSumRange(sumTable, p[i], q[i])
    print(ans)

Measured memory_bytes: 27764
using System;
using System.Collections.Generic;
using System.Linq;
public class Test
{
   
    public static void Main()
    {

        var num = int.Parse(Console.ReadLine());
        Console.Write(LuckyNumber(num));
    }
   
    static string LuckyNumber(int n)
    {
        while(n>0)
        {
            var digit = n % 10;
            if (digit == 7)
                return "Yes";
            n = n / 10;
        }

        return "No";

    }
}


Measured memory_bytes: 17408
#include<iostream>
#include<iomanip>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main(){
    int d,e;
    while(cin>>d>>e){
        if(d==0&&e==0){
            break;
        }
        double m=1000;
        for(int i=0;i<d;i++){
            if(abs(sqrt(i*i+(d-i)*(d-i))-e)<m){
                m=abs(sqrt(i*i+(d-i)*(d-i))-e);
            }
        }
        cout<<setprecision(10)<<m<<endl;
    }
    
    
    return 0;
}

Measured memory_bytes: 3148
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long

using namespace std;

const ull MOD = 1000000007;

int main() {
	ull H, W;
	cin >> H >> W;

	vector <string> a(H, "");
	for (int ii = 0; ii < H; ++ii){
		cin >> a[ii];
	}

	vector<vector<ull>> dp(H+1, vector <ull> (W+1, 0));
	dp[0][1] = 1;
	for (int row = 0; row < H; ++row){
		for (int col = 0; col < W; ++col){
			if (a[row][col] == '#'){
				dp[row+1][col+1] = 0;
			} else {
				dp[row+1][col+1] = (dp[row][col+1] + dp[row+1][col]) % MOD;
			}
		}
	}

	cout << dp[H][W] << endl;

	return 0;
}


Measured memory_bytes: 9216
#include<cstdio>
#include<cmath>
#include<climits>
#include<algorithm>
#include<sstream>
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<unordered_set>
#include<unordered_map>
#include<set>
#include<map>
#include<list>

using namespace std;

#define in(s) cin >> s
#define out(s) cout << s << endl
#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define ll long long
#define MOD 1000000007

#define IMIN INT_MIN;
#define IMAX INT_MAX;


int gcd(int a, int b){
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int main(){
    int K;
    cin >> K;
    ll ans = 0;
    rep(i, K) {
        rep(j, K) {
            rep(k, K) {
                ans += gcd(gcd(i+1, j+1), k+1);
            }
        }
    }
    cout << ans << endl;


	return 0;
}


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

using lnt = long long;
using Real = long double;

#define ALL(obj) (obj).begin(),(obj).end()
#define RALL(obj) (obj).rbegin(),(obj).rend()
#define REP(i, n) for(lnt i=0;i<(n);++i)
#define RANGE(i, a, b) for(lnt i=(a);i<(b);++i)
#define RREP(i, n) for(lnt i=(n)-1;i>= 0;--i)

#define endl '\n'
#define pb push_back
#define eb emplace_back
#define pque priority_queue
#define umap unordered_map
#define uset unordered_set
#define dcout cout<<fixed<<setprecision(20)
#define summon_tourist cin.tie(0);ios::sync_with_stdio(false)

constexpr int dx[]={1,0,-1,0,1,1,-1,-1}, dy[]={0,-1,0,1,1,-1,1,-1};
constexpr Real eps = 1e-9; const Real pi = acos(-1);
constexpr lnt BIG = INT_MAX/10, BBIG = LLONG_MAX/10;
constexpr lnt MOD = 1e9+7;

template<typename T> inline T GCD(T a,T b){T c;while(b!=0){c=a%b;a=b;b=c;}return a;}
template<typename T> inline T LCM(T a,T b){T c=GCD(a,b);a/=c;return a*b;}
template<typename T> inline T nCr(T a,T b){T i,r=1;for(i=1;i<=b;i++){r*=(a+1-i);r/=i;}return r;}
template<typename T> inline T nHr(T a,T b){return nCr(a+b-1,b);}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}

using pint = pair<int, int>; using plnt = pair<lnt, lnt>;
using vint = vector<int>; using vlnt = vector<lnt>;

int main(){
    summon_tourist;

    int a,b,c; cin >> a >> b >> c;
    cout << c << ' ' << a << ' ' << b << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <algorithm>
#include <fstream>
#include <iomanip>
#include <vector>
#include <bitset>
#include <stack>
#include <queue>
#include <set>
#include <map>

using namespace std;

int n,m;

string s[505];

int main()
{
	ios::sync_with_stdio(0);
	cin >> n >> m;
	for (int i = 0;i < n;i++)
		cin >> s[i];
	for (int i = 0;i < n;i++,putchar('\n'))
		for (int j = 0;j < m;j++)
		{
			if (s[i][j] == '#')
				putchar('#');
			else if (!j || ((~i & 1 ) && j < m - 1))
				putchar('#');
			else
				putchar('.');
		}
	for (int i = 0;i < n;i++,putchar('\n'))
		for (int j = 0;j < m;j++)
		{
			if (s[i][j] == '#')
				putchar('#');
			else if (j == m - 1 || ((i & 1) && j > 0))
				putchar('#');
			else
				putchar('.');
		}
	return 0;
}

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

using namespace std;

typedef long long int ll;
const int INF = 1<<30;
const long long LINF = 1LL<<60;
const long long MOD = (long long)1e9 + 7;

bool check(vector<vector<int>> a){
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++){
            if(a[i][j] == 0){
                if(j == 2){
                    return true;
                }
            }else{
                break;
            }
        }
    }
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++){
            if(a[j][i] == 0){
                if(j == 2){
                    return true;
                }
            }else{
                break;
            }
        }
    }
    for(int i = 0; i < 3; i++){
        if(a[i][i] == 0){
            if(i == 2){
                return true;
            }
        }else{
            break;
        }
    }
    for(int i = 0; i < 3; i++){
        if(a[i][2 - i] == 0){
            if(i == 2){
                return true;
            }
        }else{
            break;
        }
    }
    return false;
}

int main(){
    vector<vector<int>> a(3, vector<int>(3));
    for(int i = 0; i < 3; i++){
        for(int j = 0; j < 3; j++){
            cin >> a[i][j];
        }
    }
    int n;
    cin >> n;
    for(int i = 0; i < n; i++){
        int b;
        cin >> b;
        for(int i = 0; i < 3; i++){
            for(int j = 0; j < 3; j++){
                if(a[i][j] == b){
                    a[i][j] = 0;
                }
            }
        }
    }
    bool f = check(a);
    cout << (f? "Yes": "No") << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int  long long 
#define speedrap ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
int be(int a,int b,int mod) {if(b == 0) return 1; if(b%2 == 1) return (a*be(a,b-1,mod))%mod; else return (be(a,b/2,mod)*be(a,b/2,mod))%mod;}
const int mod = 998244353;
#define PI 3.1415926535
#define pf push_front
#define pb push_back
#define bitcount __builtin_popcount
#define sc(a) scanf("%d", &a);
#define sz(s) (int)s.size()
#define eb emplace_back
#define pf push_front
const int siz = 2*(1e6 + 1);
const int logi = 21;
const double epsilon = 1e-6;
int fact[siz];
int ifact[siz];
int bit[siz];
bool cmp(const int &a,const int &b)
{
  return (abs(a-b)>1);
}

bool ispalin(string s)
{
	string k = s;
	reverse(k.begin(),k.end());
	if(k == s)
	{
		return true;
	}

	return false;
}


signed main()
{
	// #ifndef ONLINE_JUDGE2 
	// freopen("in.txt","r",stdin);
	// freopen("output.txt","w",stdout);
	// #endif
	speedrap
	string s;
	cin>>s;
	int n = s.length();
	string u = "";
	for(int i = 0 ; i < (n-1)/2 ; i++)
	{
		u.push_back(s[i]);
	}

	string v = "";
	for(int i = (n+3)/2 - 1 ; i < n ; i++)
	{
		v.push_back(s[i]);
	}

	if(ispalin(s) and ispalin(u) and ispalin(v))
	{
		cout<<"Yes\n";
	}
	else
	{
		cout<<"No\n";
	}
}

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

const int INF = 1001001001;

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

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

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

void read(int &x) {
    x=0;int f=1;char ch=getchar();
    for(;!isdigit(ch);ch=getchar()) if(ch=='-') f=-f;
    for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';x*=f;
}
 
void print(int x) {
    if(x<0) putchar('-'),x=-x;
    if(!x) return ;print(x/10),putchar(x%10+48);
}
void write(int x) {if(!x) putchar('0');else print(x);putchar('\n');}

#define lf double
#define ll long long
#define pb push_back
#define iter vector<int > :: iterator 

const int maxn = 2e5+10;
const int inf = 1e9;
const lf eps = 1e-8;
const int mod = 1e9+7;

int add(int x,int y) {return x+y>mod?x+y-mod:x+y;}
int del(int x,int y) {return x-y<0?x-y+mod:x-y;}
int mul(int x,int y) {return 1ll*x*y-1ll*x*y/mod*mod;}

int n,x,y,mn[maxn],fac[maxn],ifac[maxn],inv[maxn],mn1=1e9,mn2=1e9;
vector<int > v[maxn];

int main() {
    read(n),read(y),read(x);
    fac[0]=ifac[0]=inv[0]=inv[1]=1;
    for(int i=2;i<=n;i++) inv[i]=mul(mod-mod/i,inv[mod%i]);
    for(int i=1;i<=n;i++) fac[i]=mul(fac[i-1],i);
    for(int i=1;i<=n;i++) ifac[i]=mul(ifac[i-1],inv[i]);
    for(int i=1,a,b;i<=n;i++) read(a),read(b),v[a].pb(b);
    for(int i=1;i<=n;i++)
	if(v[i].size()) {
	    sort(v[i].begin(),v[i].end()),mn[i]=*v[i].begin();
	    mn2=min(mn2,mn[i]);
	    if(mn2<mn1) swap(mn1,mn2);
	}
    //for(int i=1;i<=n;i++) printf("mn[%d] :: %d\n",i,mn[i]);
    //printf("mnn :: %d\n",mnn);
    int ans=1,tot=0;
    for(int i=1;i<=n;i++) {
	if(!v[i].size()) continue;
	iter it=v[i].end();it--;int p,mm=mn[i]==mn1?mn2:mn1;
	if(it==v[i].begin()) {tot+=v[i][0]+mm<=x;continue;}
	while((*it)+mm>x&&(*it)+mn[i]>y) {it--;if(it==v[i].begin()) break;}
	if(mm+mn[i]<=x) p=it-v[i].begin()+1,tot+=p,ans=mul(ans,ifac[p]);
	//printf("solve :: %d %d %d %d\n",i,p,(int)(*it),tot);
    }
    write(mul(ans,fac[tot]));
    return 0;
}


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

int main(){
    int N, K;
    cin >> N >> K;
    vector<int> A(N);
    int M = 0;
    for(int i = 0;i < N;i++){
        cin >> A[i];
        M = max(M, A[i]);
    }
    int d = A[0];
    for(int i = 0;i < N;i++){
        int a = d;
        int b = A[i];
        while(true){
            if(!(a%b))  break;
            int tmp = b;
            b = a%b;
            a = tmp;
        }
        d = b;
    }
    if((K <= M-d && !(K%d)) || K == M)  cout << "POSSIBLE" << endl;
    else    cout << "IMPOSSIBLE" << endl;
}

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

using P = pair<int,int>;

int main() {
    int H, W, n;
    cin >> H >> W >> n;
    vector<P> v, at;
    for (int i=0; i<n; i++) {
        int a,b;
        cin >> a >> b;
        --a; --b;
        v.push_back(make_pair(a,b));
        for(int i=0; i<3; i++) {
            for(int j=0; j<3; j++) {
                if ( a-i>=0 && b-j>=0 && a-i<H-2 && b-j<W-2 )
                    at.push_back(make_pair(a-i,b-j));
            }
        }
    }
    sort(v.begin(), v.end());
    sort(at.begin(), at.end());
    at.resize(unique(at.begin(), at.end())-at.begin());
    
    vector<long long> ans(10);
    ans[0]=(long long)(H-2)*(W-2)-(long long) at.size();
    for (auto p:at) {
        int x=p.first, y=p.second;
        int cnt=0;
        for(int i=0; i<3; i++) {
            for(int j=0; j<3; j++) {
                int xx=x+i, yy=y+j;
                auto q=P(xx,yy);
                auto it=lower_bound(v.begin(), v.end(), q);
                if ( it==v.end() ) continue;
                if ( *it==q ) cnt++;
            }
        }
        ans[cnt]++;
    }

    for (int i=0; i<10; i++) {
        cout << ans[i] << '\n';
    }

    return 0;
}


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

int main() {
  int N;
  cin>>N;
  
  int even=0;
  int odd=0;
  
  if(N%2==0){
    even=N/2;
    odd=N/2;
  }
  else{
    even=N/2;
    odd=N-even;
  }
  
  int ans=even*odd;
  cout<<ans<<endl;
}


Measured memory_bytes: 256
int main(int argc, const char * argv[]) {
    
    int width, height, x, y, r;
    
    scanf("%d %d %d %d %d", &width, &height, &x, &y, &r);
    
    if (r<=x && x+r<=width && r<=y && r+y <= height) {
        printf("Yes\n");
    }else{
        printf("No\n");
    }
    return 0;
}


Measured memory_bytes: 2048
k = int(input())

listA=[1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(listA[k-1])

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
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; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;
int main()
{
    int A, B;
    cin >> A >> B;
    vector<int> check(3, 0);
    check[A - 1] = 1;
    check[B - 1] = 1;

    rep(i, 3) {
        if (check[i] == 0) {
            cout << i + 1 << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
#n = int(input())
#l = list(map(int, input().split()))

'''
A=[]
B=[]
for i in range():
    a, b = map(int, input().split())
    A.append(a)
    B.append(b)'''

l = list(map(int, input().split()))

cnt =1
while l[0]>=l[1]:
    l[0]/=l[1]
    cnt +=1
print(cnt)

Measured memory_bytes: 2940
#include<iostream>
using namespace std;
int main(){
  int N,T; cin >> N >> T;
  int cost=9999;
  for(int i=0;i<N;i++){
    int c,t; cin >> c >> t;
    if(t>T)continue;
    else{
      if(c<=cost) cost=c;
    }
  }
  if(cost<9999) cout << cost << endl;
  else cout << "TLE" << endl;
  return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please


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


	int N;
	cin >> N;
	ll K;
	cin >> K;

	int sei[200000], fu[200000];
	int seik = 0, fuk = 0;
	int zero = 0;
	rep(i, N) {
		int a;
		cin >> a;
		if (a > 0) sei[seik++] = a;
		else if (a < 0) fu[fuk++] = -a;
		else zero++;
	}
	sort(sei, sei + seik);
	sort(fu, fu + fuk);
	ll k0 = ll(seik) * fuk + ll(zero) * (zero - 1) / 2 + ll(zero) * (N - zero);

	ll L = -1000000000000000001, R = 1000000000000000000;
	while (L + 1 < R) {
		ll M = (L + R) / 2;
		ll k = 0;
		if (M >= 0) {
			k += k0;
			int i = 1;
			while (i < seik) {
				if (ll(sei[i]) * sei[i - 1] > M) break;
				k += i;
				i++;
			}
			int j = i - 1;
			while (i < seik) {
				while (j >= 1 && ll(sei[i]) * sei[j - 1] > M) j--;
				k += j;
				i++;
			}
			i = 1;
			while (i < fuk) {
				if (ll(fu[i]) * fu[i - 1] > M) break;
				k += i;
				i++;
			}
			j = i - 1;
			while (i < fuk) {
				while (j >= 1 && ll(fu[i]) * fu[j - 1] > M) j--;
				k += j;
				i++;
			}
		}
		else {
			int j = 0;
			rep(i, seik) {
				while (j < fuk && ll(sei[i]) * fu[fuk - j - 1] >= -M) j++;
				k += j;
			}
		}
		if (k >= K) R = M;
		else L = M;
	}

	co(R);

	Would you please return 0;
}

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

int main(){
	bool ok=false;
	string s;
	cin >> s;
	for(int i=0;i<s.size();i++){
		if(s[i]=='a'||s[i]=='i'||s[i]=='u'||s[i]=='e'||s[i]=='o') ok=true;
	}
	cout << (ok?"vowel":"consonant") << endl;
	return 0;
}

Measured memory_bytes: 256
#!/usr/bin/ruby
$c=0
def merge(a,left,mid,right)
	n1=mid-left
	n2=right-mid
	l=a[left,n1]
	r=a[mid,n2]
	l<<999999999
	r<<999999999
	i=0
	j=0
	left.step(right-1){|k|
		$c+=1
		if l[i]<=r[j]
			a[k]=l[i]
			i=i+1
		else
			a[k]=r[j]
			j=j+1
		end
	}
end

def mergesort(a,left,right)
	if left+1<right
		mid=(left+right)/2
		mergesort(a,left,mid)
		mergesort(a,mid,right)
		merge(a,left,mid,right)
	end
end

n=gets.to_i
a=gets.split.map(&:to_i)
mergesort(a,0,a.length)
puts a*' '
p $c

Measured memory_bytes: 169464
a,b,c,d=map(int,input().split());x=c-a;y=d-b
print("R"*x+"U"*y+"L"*x+"D"*(y+1)+"R"*(x+1)+"U"*(y+1)+"LU"+"L"*(x+1)+"D"*(y+1)+"R")

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>

using namespace std;

#define rep(i,a,b) for(int i=a;i<b;++i)
typedef long long ll;
/////////////////////

int const N = (1 << 18);
ll const INF = 1e18;

int n;
ll t, x[N], e;
ll t1[N], t2[N];

void remin(ll &a, ll b){ a = min(a, b); }

void push(int v, ll *t){
	remin(t[v*2+1], t[v]);
	remin(t[v*2+2], t[v]);
}

void upd(int v, int tl, int tr, int l, int r, ll val, ll *t){
	if(tl > r || tr < l) return;
	if(l <= tl && tr <= r){
		remin(t[v], val);
		return;
	}
	push(v, t);
	int tm = (tl+tr)/2;
	upd(v*2+1, tl, tm, l, r, val, t);
	upd(v*2+2, tm+1, tr, l, r, val, t);
}

ll get(int v, int tl, int tr, int p, ll *t){
	if(tl == tr){
		return t[v];
	}else{
		push(v, t);
		int tm = (tl+tr)/2;
		if(p <= tm) return get(v*2+1, tl, tm, p, t);
		else return get(v*2+2, tm+1, tr, p, t);
	}
}

void build(int v, int tl, int tr, ll *t, bool flag){
	t[v] = INF;
	if(tl == tr){
		t[v] = INF;
		if(flag && tl == 0){
			t[v] = 0;
		}
	}else{
		int tm = (tl+tr)/2;
		build(v*2+1, tl, tm, t, flag);
		build(v*2+2, tm+1, tr, t, flag);
	}
}

ll getVal(int id){
	ll ret = get(0, 0, n-1, id, t1) + x[id];
	if(id > 0){
		remin(ret, get(0, 0, n-1, id, t2) + x[id] + 2LL * x[id-1]);
	}
	return ret;
}

int getPos(int l, ll xi){
	int r = n;
	while(r-l>1){
		int m = (l+r)/2;
		ll val = (x[m] - xi) * 2;
		if(val <= t) l = m;
		else r = m;
	}
	return l;
}

void solve(){
	cin >> n >> e >> t;
	rep(i, 0, n) cin >> x[i];
	x[n] = e;	
	n += 1;
	build(0, 0, n-1, t1, true);
	build(0, 0, n-1, t2, false);

	rep(i, 0, n){
		ll cur = getVal(i);
		int pos = getPos(i-1, x[i]);
		//cout << i << " " << cur << endl;
		upd(0, 0, n-1, i+1, min(n-1, pos+1), cur + t - x[i], t1);
		upd(0, 0, n-1, pos+2, n-1, cur - 3 * x[i], t2);
	}

	ll ans = getVal(n - 1);
	cout << ans << endl;
}

int main(){
#ifdef _DEBUG
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	
	solve();


	return 0;
}

Measured memory_bytes: 6400
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define ld long double
#define MAX 1e6

vector<ll> nc(MAX, 0);

void findnc() {
    nc[2] = 1;
    for (ll i = 3; i < MAX; i++) {
        nc[i] = ((i) * (i - 1)) / (ll)2;
    }
}

int main() {
    ll n;
    cin >> n;
    vector<ll> a(n);
    map<ll, ll> mp;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        mp[a[i]]++;
    }
    findnc();
    ll temp = 0;
    map<ll, ll>::iterator itr = mp.begin();
    while (itr != mp.end()) {
        temp += nc[itr->second];
        itr++;
    }
    for (ll i = 0; i < n; i++) {
        cout << temp - (mp[a[i]] - 1) << endl;
    }

    return 0;
}


Measured memory_bytes: 20560
#include <algorithm>
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <map>
#include <set>
#include <cmath>
#include <limits>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <iterator>
#include <functional>

using namespace std;

typedef unsigned                    ui;
typedef int                         si;
typedef long                        sl;
typedef long long                   ll;
typedef unsigned long long          ull;

#ifdef LOCALHOST
std::ifstream in("input.txt", std::ifstream::in);
#endif // LOCALHOST

#ifdef LOCALHOST
#define is in
#else
#define is cin
#endif // LOCALHOST

ll mod = 1e9 + 7;

int main(int argc, char *argv[])
{
    std::ios_base::sync_with_stdio(false);

    ll n, m;
    cin >> n >> m;

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

    vector<vector<ll>> dp(n, vector<ll>(m, 0));
    for (int i = 0; i < n; ++i) {
        if (grid[i][0] == '#') {
            break;
        }

        dp[i][0] = 1;
    }

    for (int j = 0; j < m; ++j) {
        if (grid[0][j] == '#') {
            break;
        }

        dp[0][j] = 1;
    }

    for (int i = 1; i < n; ++i) {
        for (int j = 1; j < m; ++j) {
            dp[i][j] = 0;
            if (grid[i][j - 1] != '#') {
                dp[i][j] += dp[i][j - 1];
            }
            if (grid[i - 1][j] != '#') {
                dp[i][j] += dp[i - 1][j];
            }

            dp[i][j] %= mod;
        }
    }

    cout << dp[n - 1][m - 1] << endl;

    return 0;
}


Measured memory_bytes: 9216
import itertools

while(True):
  n, x = map(int, input().split())
  if (n==0)and(x==0):
    break
  count=0
  
  h=[ int(i+1) for i in range(n)]
  lh = list(itertools.combinations(h, 3))
  
  for i in lh:
    if (i[0]+i[1]+i[2]) == x:
      count += 1
  print(count)


Measured memory_bytes: 31432
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
using namespace __gnu_pbds;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define fbo find_by_order
#define ook order_of_key

typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<int> vi;
typedef long double ld; 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0);
	int cnt = 0;
	int n, a, b; cin>>n>>a>>b;
	for(int i = 0; i < n; i++)
	{
		int x; cin >> x;
		if(!(x >= a && x < b)) cnt++;
	}
	cout<<cnt<<'\n';
}


Measured memory_bytes: 256
n,m = map(int, input().split())

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(reverse=True)
  return divisors

numbers = make_divisors(m)
for i in range(len(numbers)):
  if numbers[i] <= m/n:
    print(numbers[i])
    break

Measured memory_bytes: 9324
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <algorithm>
#include <bitset>
#include <complex>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#include <cassert>
#include <functional>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

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

template<typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main() {
  int N, K, A[SIZE];

  scanf("%d%d", &N, &K);

  for (int i=0; i<N; i++)
    scanf("%d", A+i);

  sort(A, A+N, greater<int>());

  ll ans = 0;

  for (int i=K; i<N; i++) {
    ans += A[i];
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
#include<math.h>
#include <bits/stdc++.h>
#include <algorithm>
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define ll long long int
#define py printf("Yes\n")
#define pn printf("No\n")
#define in cin>>
using namespace std;
int INF = 1001001001;

int main()
{
    string s;
    in s;
    bool flag=true;

    for(int i=0;i<s.size();i++)
    {
        for(int j=i+1;j<s.size();j++)
        {
            if(s[i]==s[j])flag=false;
        }
    }
    if(flag==true)cout<<"yes"<<endl;
    else cout<<"no"<<endl;
}


Measured memory_bytes: 256
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 100000000

x = I()
root = int((2 * x) ** 0.5)
if x * 2 <= root * (root + 1):
    print(root)
else:
    print(root + 1)

Measured memory_bytes: 41584
#include "bits/stdc++.h"
#define fi first
#define se second
#define all(x) x.begin(), x.end()
using namespace std;
using ull = unsigned long long;
using ll = long long;
constexpr int I_INF = INT_MAX;
constexpr ll L_INF = LLONG_MAX;

struct __INIT {
    __INIT() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(15);
    }
} __init;

int main() {
    int N, M;
    cin >> N >> M;
    vector<pair<ll,int>> Cnt(N + M);
    for(int i = 0; i < N; i++){
        cin >> Cnt[i].fi;
        Cnt[i].se = 1;
    }
    for(int i = N; i < N + M; i++){
        cin >> Cnt[i].se >> Cnt[i].fi;
    }
    sort(all(Cnt), greater<>());
    vector<ll> Ans(N);
    int push_n = 0;
    for(auto p : Cnt){
        for(int i = 0; i < p.se; i++){
            Ans.push_back(p.fi);
            push_n++;
            if(push_n == N) goto finish;
        }
    }
    finish:
    ull sum = 0;
    for(ll a : Ans) sum += a;
    cout << sum << endl;
}

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

int main()
{
  	int l,r,d;
  int count = 0;
	cin >> l >> r >> d;
  
  	for (int i=l; i <= r; ++i) {
      if ( i >= d && i % d == 0 ){
        count++;
      }
    }
  
  	cout << count;
    return 0;
}

Measured memory_bytes: 3584
from bisect import bisect_right

n = int(input())
a = [int(input()) for _ in range(n)]

b = []

ans = 1
b.append(a[n-1])

for i in range(n-2, -1, -1):
    if a[i] >= b[-1]:
        b.append(a[i])
    else:
        x = bisect_right(b,a[i])
        b[x] = a[i]
        x -= 1
        while x >= 0:
            if b[x] > b[x+1]:
                b[x],b[x+1] = b[x+1],b[x]
                x -= 1
            else:
                break
    #print(b)

print(len(b))



Measured memory_bytes: 55896
#include <bits/stdc++.h>
typedef long long int ll;

using namespace std;

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

   vector<ll> L(N);


   for(int i=0;i<N;i++){
       cin >>L[i];

   }


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

   int count=0;

   for(int i=0;i<N-2;i++){


       for(int j=i+1;j<N-1;j++){


           for(int k=j+1;k<N;k++){

               if(L[k]<(L[i]+L[j])){


                   if((L[k]-L[j])*(L[j]-L[i])>0){
                        count++;
                   }

                  
                
               }
           }
       }
   }


   cout <<count << endl;





    return 0;



}

Measured memory_bytes: 3628
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>

using namespace std;

#define X first
#define Y second
#define mp make_pair
#define pb push_back
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <int, ll> pil;

const int INF=0x3f3f3f3f;
const int N=2e5+5;

int n, m, off=1;
vector <pil> poc[N];
vector <pil> kraj[N];
ll tour[3*N], prop[3*N];

void propag(int pos, int lo, int hi) {
    if (prop[pos]==0) return;
    if (pos<off) {
        prop[pos*2]+=prop[pos];
        prop[pos*2+1]+=prop[pos];
        tour[pos]=max(tour[pos*2], tour[pos*2+1])+prop[pos];
    }
}

void update(int pos, int lo, int hi, int a, int b, ll value) {
    //printf("pos == %d, lo == %d, hi == %d, prop[pos]==%lld\n", pos, lo, hi, prop[pos]);
    if (lo>=a && hi<=b) {
        prop[pos]+=value;
        tour[pos]+=value;
        //propag(pos, lo, hi);
        //printf("pos == %d, lo == %d, hi == %d, prop[pos]==%lld, prop[l] == %lld, prop[r] == %lld\n", pos, lo, hi, prop[pos], prop[pos*2], prop[pos*2+1]);
        //printf("tour[pos] == %lld, tour[l] == %lld, tour[r] == %lld\n", tour[pos], tour[pos*2], tour[pos*2+1]);
        return;
    }
    if (hi<=a || lo>=b) return;
    int mid=(lo+hi)/2;
    update(pos*2, lo, mid, a, b, value);
    update(pos*2+1, mid, hi, a, b, value);
    tour[pos]=max(tour[pos*2], tour[pos*2+1])+prop[pos];
}

ll query(int pos, int lo, int hi, int a, int b) {
    //printf("pos == %d, lo == %d, hi == %d, tour[pos] == %d, prop[pos] == %d\n", pos, lo, hi, tour[pos], prop[pos]);
    //propag(pos, lo, hi);
    //printf("tour[pos] == %d, prop[pos] == %d\n", tour[pos], prop[pos]);
    if (lo>=a && hi<=b) return tour[pos];
    if (lo>=b || hi<=a) return -(ll)INF*(ll)INF;
    int mid=(lo+hi)/2;
    return max(query(pos*2, lo, mid, a, b), query(pos*2+1, mid, hi, a, b))+prop[pos];
}

void load() {
    scanf("%d %d", &n, &m);
    while (off<=n) off*=2;
    for (int i=0; i<m; ++i) {
        int l, r; ll a;
        scanf("%d %d %lld", &l, &r, &a);
        poc[l].pb(mp(r, a));
        kraj[r].pb(mp(l, a));
    }
}

void solve() {
    /*for (int i=2*off-1; i>0; --i) {
        tour[i]=0;
        if (i==off) tour[i]=0;
        if (i<off) tour[i]=max(tour[i*2], tour[i*2+1]);
    }*/
    ll sol=0;
    for (int i=1; i<=n; ++i) {
        for (pil p:poc[i]) {
            update(1, 0, off, 0, i, p.Y);
            //printf("updejtam [%d, %d] na %d\n", 0, i, p.Y);
            //system("pause");
        }
        ll res=query(1, 0, off, 0, i);
        //printf("i == %d, res == %lld\n", i, res);
        //system("pause");
        sol=max(sol, res);
        update(1, 0, off, i, i+1, res);
        for (pil p:kraj[i]) update(1, 0, off, 0, p.X, -p.Y);
    }
    printf("%lld\n", sol);
}

int main() {
    load();
    solve();
    return 0;
}


Measured memory_bytes: 30976
#include "iostream"
#include <stdio.h>
#include <algorithm>
#include <stdlib.h>
#include <string>
#include <cctype>
#include <stack>
#include <vector>
#include <list>
#include <queue>
using namespace std;
using ll=long long;
#define mod  1000000007

int main(int argc, char const *argv[]) {
  int a,b,n;

  std::cin >> n >> a >> b;
  if(n*a<b) std::cout << n*a << '\n';
  else std::cout << b << '\n';
  return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys
from math import ceil

def solve(D: int, G: int, p: "List[int]", c: "List[int]"):
    answer = 1000
    ## どの問題を全部解くか全探索
    for i in range(2**D):
        tmpans = 0
        score = 0
        com_problem = []

        for j in range(D):
            if i & 1<<j:
                score += p[j]*100*(j+1)+c[j]
                tmpans += p[j]
                com_problem.append(j)
        if score >= G:
            answer = min(answer,tmpans)
        else:

            for probrem_index in range(D-1,-1,-1):
                if probrem_index in com_problem:
                    continue

                if (G-score)>100*(probrem_index+1)*(p[probrem_index]-1):
                    break
                else:
                    tmpans += ceil((G-score) / (100*(probrem_index+1)))
                    answer = min(answer,tmpans)
                    break

    print(answer)

    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    D = int(next(tokens))  # type: int
    G = int(next(tokens))  # type: int
    p = [int()] * (D)  # type: "List[int]"
    c = [int()] * (D)  # type: "List[int]"
    for i in range(D):
        p[i] = int(next(tokens))
        c[i] = int(next(tokens))
    solve(D, G, p, c)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064