akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<stdlib.h>

using namespace std;

typedef struct UndecidedDatas{
  int a;
  int b;
  int c;
  struct UndecidedDatas *next;
} Data;

int main(){
  int numa, numb, numc;
  int a, b, c, k; //kには検査結果を入れる
  int numdata;
  int n;
  int *state;
  Data *firstnode,  *thisnode, *newnode;
  int count = 0;
  int thisa, thisb, thisc;
  int flag =0;
  while(1){
    cin >>numa >>numb >>numc;
    numdata = numa + numb + numc;
    if(numdata == 0) break;

    state = (int*)malloc(sizeof(int)*(numdata+1));

    for(int i = 0; i<(numdata+1); i++){
      state[i] = 2;
    }

    firstnode =(Data*)malloc(sizeof(Data));
    firstnode->a = 0;
    firstnode->b = 0;
    firstnode->c = 0;
    firstnode->next = NULL;
    thisnode = firstnode;
  
    cin >> n;

    //決定できるものはデータ読み込み時に決定し、他のものは一端リストに保留する
    for(int i = 0; i<n ; i++){
      cin >> a >> b >> c >> k;
      if(k == 0){
	newnode = (Data*)malloc(sizeof(Data));
	newnode->a = a;
	newnode->b = b;
	newnode->c = c;
	newnode->next = NULL;
	thisnode->next = newnode;
	thisnode = thisnode->next;
	count ++;
      } else {
	state[a] = 1;
	state[b] = 1;
	state[c] = 1;
      }
    }

    //  cout <<"count ="<< count <<endl;
    if(count >0)
      {
	while(1){
	  flag = 0;
	  thisnode = firstnode->next;
	  for(int i =0; i<count; i++){
	    thisa = thisnode->a;
	    thisb = thisnode->b;
	    thisc = thisnode->c;
	  
	    if(state[thisa] == 1 && state[thisb] == 1) {
	      if(state[thisc] != 0){
		state[thisc] =0;
		flag = 1;
	      }
	    } else if(state[thisb] == 1 && state[thisc] == 1) {
	      if(state[thisa] != 0){
		state[thisa] =0;
		flag = 1;
	      }
	    } else if(state[thisc] == 1 && state[thisa] == 1) {
	      if(state[thisb] != 0){
		state[thisb] =0;
		flag = 1;
	      }
	    }
	    if(thisnode->next == NULL) break;
	    thisnode = thisnode->next;
	  }
	  if(flag == 0) break;
	}
      }
  
    for(int i = 1; i<numdata+1; i++){
      cout << state[i] <<endl;
    }
  }
  return 0;
}
      
  


      
    
    
  

Measured memory_bytes: 1232
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxx = 1e5 + 7;
const int Inf = 1 << 30;
const ll INF = 1ll << 60;
#define mst(x) memset(x, 0, sizeof(x))
priority_queue <int> qua;
int x;

int main() {
	cin >> x;
	if(x == 3 || x == 5 || x == 7) puts("YES");
	else puts("NO");
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
int main(void){
	int n;
	long *l;
	int x = 0;
	scanf("%d", &n);
	l = (long *)malloc(sizeof(long) * n);
	for(int i=0; i<n; i++){
		scanf("%ld", &l[i]);
	}
	if(n <= 2){
		printf("%d\n", x);
		return 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[i]+l[j]>l[k] && l[i]+l[k]>l[j] && l[j]+l[k]>l[i]){
					if(l[i]!=l[j] && l[i]!=l[k] && l[j]!=l[k]){
						x++;
					}
				}
			}
		}
	}
	printf("%d\n", x);
	return 0;
}


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

using namespace std;


//repetition
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define euc_dis(x, y) sqrt(x*x + y*y)

#define MOD 1e9+7
#define sp ' '


using ll = long long;


ll mod(ll a, ll b){return (a%b+b)%b;}
ll gcd(ll a, ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b){return a*b/gcd(a,b);}
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void Judge(bool b){b?Yes():No();}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void JUDGE(bool b){b?YES():NO();}
ll powMod(ll b, ll e, ll m){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2) + (y1-y2)*(y1-y2));}

template<typename T>
void ppp(T n){cout << n << endl;}

int main(){

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

    int dp[100001];
    fill_n(dp, 100001, 1e9);

    int n;
    cin >> n;

    vector<int> h(n);
    rep(i, n){
        cin >> h[i];
    }
    dp[0] = 0;
    dp[1] = abs(h[1] - h[0]);
    for(int i = 2; i < n; ++i){
        dp[i] = min(dp[i-1]+abs(h[i-1]-h[i]), dp[i-2]+abs(h[i-2]-h[i]));
    }

    ppp(dp[n-1]);

    return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//输入
		int n = sc.nextInt();
		final int MAX = 200000;
		int[] arr = new int[MAX];
		for(int i=0;i<n;i++)
		{
			arr[i]=sc.nextInt();
		}
		
		int maxv = -2000000000;
		int minv = arr[0];
		
		for(int i=1;i<n;i++)
		{
			maxv = Math.max(maxv, arr[i] - minv);
			minv = Math.min(minv, arr[i]);
		}
		
		System.out.println(maxv);
	}
}



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

int main(){
    int h, w, k; cin >> h >> w >> k;
    vector<string> s(h); for (auto i = 0; i < h; i++) cin >> s[i];
    vector<vector<int>> ans(h, vector<int>(w, 0));
    int cnt = 1; // k個数え上げる用
    int prev = -1; int last = -1;
    for (auto i = 0; i < h; i++) {
        vector<int> tmp;
        for (auto j = 0; j < w; j++) if(s[i][j] == '#') tmp.push_back(j);
        // 横一列分切れる場合
        if(tmp.size() == 1) {
            for (auto j = 0; j < w; j++) ans[i][j] = cnt;
            cnt++; prev = i;
        } else if(tmp.size() > 1) {
            int l = 1; tmp.push_back(w);
            for (auto j = 0; j < w; j++) {
                if(tmp[l] > j) ans[i][j] = cnt;
                else l++, cnt++, ans[i][j] = cnt;
            }
            cnt++; prev = i;
        } else {
            if(prev != -1) ans[i] = ans[prev];
            else last = i;
        }
    }

    if(last != -1) for (auto i = last; i >= 0; i--) ans[i] = ans[last + 1];
    for (auto i = 0; i < h; i++) {
        for (auto j = 0; j < w; j++) cout << ans[i][j] << " ";
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 4176
//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
//~ #pragma GCC optimize("O3")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define pb push_back
#define SZ(x) ((int)(x).size())
#define ALL(x) x.begin(),x.end()
#define all(x) x.begin(),x.end()
#define fi first
#define se second
#define _upgrade ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define erase_duplicates(x) sort(all(x)); (x).resize(distance((x).begin(), unique(all(x))));


using namespace std;
using namespace __gnu_pbds;
template<typename T>
using ordered_set = tree<
T,
null_type,
less<T>,
rb_tree_tag,
tree_order_statistics_node_update>;

//X.find_by_order(k); - zwraca iterator na k-ty element (numeracja od zerowego)
//X.order_of_key(k); - zwraca liczbę elementów ostro mniejszych niż k

typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<LL> VLL;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef long double LD;
typedef pair<LD,LD> PLD;
typedef vector<LD> VLD;
typedef vector<PLD> VPLD;

template<class TH> void _dbg(const char *sdbg, TH h){ cerr<<sdbg<<" = "<<h<<endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
  while(*sdbg!=',')cerr<<*sdbg++;
  cerr<<" = "<<h<<", "; _dbg(sdbg+1, a...);
}

#ifdef LOCAL
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define dbg(...)
#define cerr if(0)cout
#endif

const int maxn = (1e6)+7;
const int maxk = 20;
const int inf = (1e9)+7;
const LL LLinf = ((LL)1e18)+7LL;
const LD eps = 1e-9;
const LL mod = 1e9+7;

// ***************************** CODE ***************************** //

int main()
{
	_upgrade
  int n;
  cin>>n;
  VLL V;
  LL res = 0LL;
  for(int i = 1;i <= n;i++)
  {
    LL a, b;
    cin>>a>>b;
    V.pb(a + b);
    res -= b;
  }
  sort(all(V));
  reverse(all(V));
  for(int i = 0;i < SZ(V);i++)
  {
    if(!(i & 1))
      res += V[i];
  }
  cout<<res;

	return 0;
}


Measured memory_bytes: 1400
n, s = gets.split.map(&:to_i)
a = gets.split.map(&:to_i).sort

M = 998244353
R2 = 499122177

dp = Array.new(s, 0)
dp[0] = 1
n.times {dp[0] = dp[0] * 2 % M}

ans = 0
a.each do |i|
    break if i > s
    ans = (ans + dp[s - i] * R2) % M
    (s-i-1).downto(0) {|j| dp[i+j] = (dp[i+j] + dp[j] * R2) % M}
end
p ans

Measured memory_bytes: 14392
#include <bits/stdc++.h>
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; }
template<class T> inline bool change(T& a, T b) { if (a != b) { a = b; return 1; } return 0; }
using namespace std;
typedef long long ll;

int c[100];
int s[1000][100];
int t[100];
int last[100];

int d,n;

void calc(){
    ll hpn=0;
    for(int i=1;i<=d;i++){
        hpn+=s[i][t[i]];
        last[t[i]]=i;
        for(int j=1;j<=n;j++){
            hpn-=c[j]*(i-last[j]);
        }
        cout << max(1000000+hpn,0LL) << endl;
    }
    
}

void solve(){
    //方針:それぞれの日に関して(得る得点)-(失う得点)を最大化する
    for(int i=1;i<=d;i++){
        //hpn+=s[i][t[i]];
        //last[t[i]]=i;
        int maxt,maxsc=-10000000;
        for(int j=1;j<=n;j++){
            if(chmax(maxsc,s[i][j]+c[j]*(i-last[j]))) maxt=j;
        }
        t[i]=maxt;
    }
    
}

void input(){
    cin >> d;
    n=26;
    for(int i=1;i<=n;i++) cin >> c[i];
    for(int i=1;i<=d;i++)
        for(int j=1;j<=n;j++){cin >> s[i][j];}    
    //for(int i=1;i<=d;i++) cin >> t[i];
    //cout << calc() << endl;
}

void puts(){
    for(int i=1;i<=d;i++) cout << t[i] << endl;
}

int main(){
    input();
    solve();
    //calc();
    puts();
    return 0;
}

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

#define int long long
struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;
const int MOD = 1e9 + 7;
using intpair = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define ceiv(a, b) ((int)((a) + (b) - 1)/(int)(b))

int x;
inline int f(int n){
    if(n < 0) return 0;
    return n/x + 1;
}

signed main() {
    int a, b;
    cin >> a >> b >> x;
    cout << f(b) - f(a-1) << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;
int main() {
  int n, k;
  cin >> n >> k;
  vector<int> p(n);
  int m = 0, max_val = 0;
  for (int i = 0; i < n; ++i) {
    cin >> p.at(i);
    m += p.at(i); 
    if (i > k - 2) {
      if (m > max_val) {
        max_val = m;
      }
      m -= p.at(i - k + 1);
    }
  }
  cout << setprecision(10) << (max_val + k) / 2.0 << endl;
  return 0;
}

Measured memory_bytes: 1024
num  = int(input())
#prime number counter
ans = 0
prime_check = [1]*1000100
count = 2
while num>1:
    if prime_check[count]==1: #countが素数だった場合
        tmp = 0
        while num % count == 0: #numの因数にcountが何個含まれているか
            num/= count
            tmp += 1
        tmp2 =1
        while tmp>=tmp2: #ansに加える
            ans += 1
            tmp -= tmp2
            tmp2 += 1
        tmp = count
        while tmp*count<=1e6:
            prime_check[tmp*count] = 0
            tmp += 1
    count += 1
    if(count>1e6):
        num = 0
        ans += 1
print(ans)

Measured memory_bytes: 16728
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 510000;
ll dy[8] = {0,1,0,-1,1,-1,1,-1};
ll dx[8] = {1,0,-1,0,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << "\n";}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << "\n";
}
const int mod = 1e9 + 7;
//const int mod = 998244353;

int main(){
	while(1){
		string s;
		getline(cin,s);
		if(s==".") break;
		stack<char> st;
		rep(i,s.size()){
			if(s[i]=='(') st.push(')');
			if(s[i]=='[') st.push(']');
			if(s[i]==')' || s[i]==']'){
				if(!st.empty() && st.top()==s[i]) st.pop();
				else{
					st.push('@');
					break;
				}
			}
		}
		if(st.empty()) puts("yes");
		else puts("no");
	}
}


Measured memory_bytes: 3156
use std::io::prelude::*;

fn main() {
    let stdin = std::io::stdin();
    let mut reader = std::io::BufReader::new(stdin.lock());
    let mut s = String::new();
    reader.read_line(&mut s).unwrap();
    let _: usize = s.trim().parse().unwrap();

    let mut s = String::new();
    reader.read_line(&mut s).unwrap();
    let mut a = [0; 100000];

    for i in s.split_whitespace().map(|x| x.parse::<usize>().unwrap()) {
        a[i] += 1;
    }
    
    let mut max = 0;

    for i in 1..99999 {
        if a[i - 1] + a[i] + a[i + 1] > max {
            max = a[i - 1] + a[i] + a[i + 1];
        }
    }
    println!("{}", max);
}


Measured memory_bytes: 4732
#include <bits/stdc++.h>
using namespace std;
using i64 = int64_t;
class UnionFindTree {
  private:
    vector<int> par;   // 親
    vector<int> depth; // 木の深さ

  public:
    // n要素で初期化
    UnionFindTree(int n) {
        for (int i = 0; i < n; i++) {
            par.push_back(i);
            depth.push_back(0);
        }
    }

    // 木の根を求める
    int find(int x) {
        if (par[x] == x) {
            return x;
        } else {
            return par[x] = find(par[x]);
        }
    }

    // xとyの属する集合を併合
    void unite(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y)
            return;

        if (depth[x] < depth[y]) {
            par[x] = y;
        } else {
            par[y] = x;
            if (depth[x] == depth[y])
                depth[x]++;
        }
    }

    // xとyが同じ集合に属するか否か
    bool same(int x, int y) { return find(x) == find(y); }
};
int main(){
    i64 n, m;
    cin >> n >> m;
    UnionFindTree uft(n+1);
    for(int i=0;i<m;++i){
        int x, y, z;
        cin >> x >> y >> z;
        uft.unite(x, y);
    }
    set<int> st;
    for(int i=1;i<=n;++i){
        st.insert(uft.find(i));
    }
    cout << st.size() << endl;
}

Measured memory_bytes: 5748
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/hash_policy.hpp>
#define orz return printf("-1\n"),0;
#define qwq return printf("%lld\n",l),0;
#define f(i,a,b) for(register int i=(a);i<=(b);i=-(~i))
#define rf(i,a,b) for(register int i=(a);i>=(b);i=~(-i))
using namespace std;
using namespace __gnu_pbds;
const int neko=100010;
int n,m,a[neko],fac[neko],ifac[neko],inv[neko],ans,mod=1e9+7;
typedef long long ll;
int ADD(int x,int y){return (x+=y)>=mod?x-mod:x;}
int spow(int m,int n)
{
	int b=1;
	for(;n;n>>=1,m=1ll*m*m%mod)if(n&1)b=1ll*b*m%mod;
	return b;
}
int C(int n,int m)
{
	if(n<m)return 0;
	return 1ll*fac[n]*ifac[m]%mod*ifac[n-m]%mod;
}
void mathinit(int maxn)
{
	fac[0]=ifac[0]=1;
	f(i,1,maxn)fac[i]=1ll*fac[i-1]*i%mod;
	ifac[maxn]=spow(fac[maxn],mod-2);
	rf(i,maxn-1,1)ifac[i]=1ll*ifac[i+1]*(i+1)%mod;
}
int main()
{
	scanf("%d",&n);
	mathinit(n+5);
	f(i,1,n)scanf("%d",&a[i]);
	f(i,2,n)inv[i]=ADD(inv[i-1],spow(i,mod-2));
	f(i,1,n)
		ans=ADD(ans,1ll*fac[n]*a[i]%mod*inv[n-i+1]%mod);
	f(i,1,n)
	  ans=ADD(ans,1ll*fac[n]*a[i]%mod*inv[i]%mod);
	f(i,1,n)ans=ADD(ans,1ll*fac[n]*a[i]%mod);
	return printf("%d\n",ADD(ans,mod)),0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define pb push_back
#define mp make_pair
#define ff first
#define ar array
#define ss second
#define ll long long int
#define mem(x) memset(x,0,sizeof(x))
#define setbits(x)  __builtin_popcount(x)
#define ull unsigned long long int
#define all(c) (c).begin(),(c).end()
#define debug(x) cout<<#x<<" :: "<<x<<endl;
#define debug2(x,y) cout<<#x<<" :: "<<x<<"\t"<<#y<<" :: "<<y<<endl;
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define db double
#define endl "\n"
#define  fbo(x) find_by_order(x)
#define  ook(x) order_of_key(x)
 
using namespace __gnu_pbds;
using namespace std;
typedef vector< int > vi;
typedef vector< vi > vvi;
typedef pair<ll,ll > iil;
typedef pair<ll,int> li;
typedef pair<int,int> ii;
typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os1;
typedef tree<int, null_type, greater<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    os2;

inline void fast()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
}
const ll pi=31;
const ll MOD[2] = {1187278649, 1149736019};//for double hashing
const ll mod=(ll)(1e9)+7;
ll pmod(ll x,ll n){
  ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
}
ll pMod(ll x,ll n,ll mod)
{ ll r=1;
  while(n>0)
  {
    if(n&1LL)
      r=(r*x)%mod;
    x=(x*x)%mod;
    n=n/2;
    n%=mod;
  }
  return r;
 
}
 
//think recursively also;

void solve()
{ 
 ll n;
 cin>>n;
 ll a[n+1],sum=0;
 for(int i=1;i<=n;i++)
 {
   cin>>a[i];
   sum+=a[i];
 }
 ll ans=0;
 for(int i=1;i<=n;i++)
 {
  sum-=a[i];
  ans=ans+(a[i]*(sum%mod))%mod;
  ans%=mod;
 }
 cout<<ans;

}
int main()
{
  fast();
   // int t;
   // cin>>t;
   // for(int casee=1;casee<=t;casee++)
  {//cout<<"Case #"<<casee<<": ";
    solve();
  }
 
 
 
}

Measured memory_bytes: 5184
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>

typedef long long ll;
using namespace std;

int main()
{
    int n;
    ll x[100], y[100], cx, cy, H;
    ll h[100], tmp1,tmp2;
    cin >> n;

    for(int i=0; i<n; i++){
        cin >> x[i] >> y[i] >> h[i];

    }
 
    for(ll i=0; i<=100; i++){
        for(ll j=0; j<=100; j++){
            for(int k=0; k<n; k++){
                if(h[k] > 0){
                    H = h[k] + abs(x[k]-i) + abs(y[k]-j);
                    break;
                }
            }
            bool check = true;
            for (ll k=0;k<n;k++) {
                if (max(H-abs(x[k]-i)-abs(y[k]-j),(ll)0)!=h[k]) {check=false;break;}
            }
            if (check) {
                cout << i << ' ' << j << ' ' << H << endl;
                return 0;
                }
        }
    }
}


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

using namespace std;

typedef vector<int> Vi;
typedef vector<bool> Vb;
typedef pair<int,int> Pii;

#define pb push_back

const int MAXN = 105;

int lastAns[MAXN];
bool rmv[MAXN];
int arr[MAXN],asz;
int trv[MAXN];

template<class T>
void showV(vector<T> &v)
{
    if(v.size())
    {
        cout<<v[0];
        for(int i=1;i<v.size();i++)
            cout<<" "<<v[i];
        cout<<endl;
    }
}

template<class T>
void showA(T *a,int n)
{
    for(int i=0;i<n;i++)
        cout<<a[i]<<" ";
    cout<<endl;
}
bool DFS(int tsz)
{
    if(tsz==asz)
    {
        memcpy(lastAns,trv,asz*sizeof(int));
        return true;
    }
    //showA(rmv,asz);

    int usefull = 0;trv[tsz] = INT_MAX;
    for(int i=0; i<asz; i++)
    {
        if(rmv[i])
            continue;
        else
            usefull++;
        if(arr[i]==usefull)
            trv[tsz] = i;
    }
    if(trv[tsz]==INT_MAX)
        return false;
    rmv[trv[tsz]] = true;
    trv[tsz] = arr[trv[tsz]];
    //cout<<"Choose "<<trv[tsz]<<endl;
    return DFS(tsz+1);
}

void init()
{
    memset(rmv,false,sizeof rmv);
}
int main()
{
    while(cin>>asz)
    {
        init();
        for(int i=0;i<asz;i++)
            scanf("%d",&arr[i]);
        if(DFS(0))
        {
            for(int i=asz-1; i>=0; i--)
                cout<<trv[i]<<endl;
        }
        else
            cout<<"-1"<<endl;
    }
    return 0;
}


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

#define int long long

int32_t main() {
  int n; cin >> n;
  int a[n];
  for(int i = 0; i < n; ++i) cin >>a[i];
  int ans = 0;
  for(int i = 1; i < n; ++i) {
    if(a[i] < a[i - 1]) {
      ans += a[i - 1] - a[i];
      a[i] = a[i - 1];
    }
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 5184
import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in); 
        int n = sc.nextInt();
        String S = sc.next();

        String tmp = S.substring(0, n/2) + S.substring(0, n/2);
        if(tmp.equals(S) && n%2 == 0)
            System.out.println("Yes");
        else System.out.println("No");
    }
}

Measured memory_bytes: 23892
#!/usr/bin/env python3
import sys

YES = "YES"  # type: str
NO = "NO"  # type: str


def solve(N: int, A: "List[int]"):
    if len(set(A))==len(A):
        print(YES)
    else:
        print(NO)
    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


Measured memory_bytes: 39512
#include<bits/stdc++.h>
//ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
//clock_t start=clock();clock_t end=clock();cout<<(double)(end-start)/CLOCKS_PER_SEC<<endl;
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef unsigned int ui;
typedef pair<int,int> pii;
typedef pair<pii,int> ppii;
typedef pair<int,pii> pipi;
typedef pair<ll,ll> pll;
typedef pair<pll,ll> ppll;
typedef pair<ll,pll> plpl;
typedef pair<pii,pii> pippi;
typedef tuple<ll,ll,ll> tl;
typedef pair<double,double> pdd;
typedef vector<vector<ll>> mat;
ll mod=1000000007;
ll mod2=998244353;
ll mod3=1000003;
ll mod4=998244853;
ll mod5=1000000009;
ll inf=1LL<<62;
int iinf=1<<30;
double pi=3.141592653589793238462643383279L;
double eps=1e-8;
#define rep(i,m,n) for(int i=m;i<n;i++)
#define rrep(i,n,m) for(ll i=n;i>=m;i--)
#define srep(itr,st) for(auto itr=st.begin();itr!=st.end();itr++)
#define mrep(itr,mp) for(auto& itr:mp)
#define Max(a,b) a=max(a,b)
#define Min(a,b) a=min(a,b)
int dh[4]={1,-1,0,0};
int dw[4]={0,0,1,-1};
int ddh[8]={-1,-1,-1,0,0,1,1,1};
int ddw[8]={-1,0,1,-1,1,-1,0,1};
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};
#define umh unordered_map<ll,ll,custom_hash>
ll gcd(ll a,ll b){
    if(a<b)swap(a,b);
    if(b==0)return a;
    if(a%b==0)return b;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll c=gcd(a,b);
    return a*b/c;
}
ll Pow(ll n,ll k){
    if(k<0)return 0;
    ll ret=1;
    ll now=n;
    while(k>0){
        if(k&1)ret*=now;
        now*=now;
        k/=2;
    }
    return ret;
}
ll beki(ll n,ll k,ll md){
  ll ret=1;
  ll now=n;
    now%=md;
  while(k>0){
    if(k%2==1){
      ret*=now;
      ret%=md;
    }
    now*=now;
    now%=md;
    k/=2;
  }
  return ret;
}
ll gyaku(ll n,ll md){
  return beki(n,md-2,md);
}
ll popcount(ll n){
    ll ret=0;
    ll u=n;
    while(u>0){
        ret+=u%2;
        u/=2;
        
    }
    return ret;
}


int main(){
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    ll a;cin>>a;
    string b;cin>>b;
    ll bb=0;
    ll now=100;
    rep(i,0,b.size()){
        if(b[i]=='.')continue;
        bb+=now*(b[i]-'0');
        now/=10;
    }
    a*=bb;
    a/=100;
    cout<<a<<endl;
}



Measured memory_bytes: 3620
#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(ll)n;i++)
#define rep1(i,n) for(ll i=1;i<(ll)n;i++)
#define repf(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define repr(i,a,b) for(ll i=(ll)a;i<(ll)b;i--)
#define Fi fiest
#define Se second
const ll MAX = 1000000;
const char ENDL = '\n';

ll ans = 100000000000;

ll abc (ll a,ll b) {
	ans = 0;
	while (1) {
		a /= 10;
		b /= 10;
		ans++;
		if (a == 0 && b == 0)
			break;
	}
	return ans;
}

int main() {
	ll N, a, b;
	cin >> N;

	rep1(i, N+1) {
		a = i;
		b = N / i;
		if (a > b) break;
		if (N%i == 0)
			ans = min(ans, abc(a, b));
	}

	cout << ans << ENDL;
	return 0;
}

Measured memory_bytes: 256
k,n = map(int,input().split())
a = list(map(int,input().split()))
cnt = []
for i in range(n-1):
  if i == 0:
    cnt.append(a[-1]-a[0])
  else:
    cnt.append(k - (a[i+1] - a[i]))
print(min(cnt))

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

int main() {
  string s;
  cin>>s;
  rep(i, 3) {
    if (s[i] == '1') s[i]='9';
    else if (s[i] == '9') s[i]='1';
  }
  cout<<s<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long 
using namespace std;
 
int32_t main()
{
	int a,b;
	cin>>a>>b;

	int limit = max(100LL*a,100LL*b);

	bool f=1;
	for (int i=1;i<=limit;i++){

		int x = floor((double)i*(double)0.08);
		int y = floor((double)i*(double)0.1);

		if (x==a && y==b){
			cout<<i<<'\n';
			f=0;
			break;
		}

	}

	if (f){
		cout<<"-1\n";
	}


}


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

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

  sort(a.begin(), a.end());
  sort(b.begin(), b.end());
  sort(c.begin(), c.end());
  int a_to_b[n];
  for (int i = 0; i < n; i++) {a_to_b[i] = 0;}
  for (int i = 0; i < n; i++) {
    // a[i]について、二分探索をする
    int left = -1;
    int right = n;
    int middle = (left + right) / 2;  
    while (left < right - 1) {
      middle = (left + right) / 2;
      if (a[i] < b[middle]) {
        right = middle;  
      }    
      else {
        left = middle;  
      }
    }
    a_to_b[right]++;
  }
  int b_to_c[n];
  for (int i = 0; i < n; i++) {
    b_to_c[i] = 0;
  }
  long long ans = 0;
  for (int i = 0; i < n; i++) {
    // a[i]について、二分探索をする
    if (i != 0) {
      a_to_b[i] += a_to_b[i - 1];  
    }
    int left = -1;
    int right = n;
    int middle = (left + right) / 2;  
    while (left < right - 1) {
      middle = (left + right) / 2;
      if (b[i] < c[middle]) {
        right = middle;  
      }    
      else {
        left = middle;  
      }
    }
    ans = ans + (n - right) * a_to_b[i];
  }
  cout << ans << endl;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
template <typename T> 
using lim = numeric_limits<T>;
template <typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using indexed_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
    int n, k;
    cin >> n >> k;
    int snuke[n+1];
    memset(snuke, 0, sizeof snuke);
    for (int i = 0; i < k; i++){
        int d; cin >> d;
        for (int j = 0; j < d; j++){
            int x; cin >> x;
            snuke[x]++;
        }
    }

    int ans = 0;
    for (int i = 1; i <= n; i++)
        if (snuke[i] == 0) ans++;

    cout << ans << "\n";

}

Measured memory_bytes: 3644
import sys
 
def main():
  a,b,c = map(lambda x: int(x), input().split())
  k = int(input())
 
  for _ in range(k):
      if b <= a:
          b = 2 * b
          continue
      if c <= b:
          c = 2 * c
          continue
      print('Yes')
      return
 
  if (a < b) & (b < c):
      print('Yes')
      return
  print('No')
 
if __name__ == '__main__':
    main()

Measured memory_bytes: 9188
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define cinf(n,x) for(int i=0;i<(n);i++)cin>>x[i];
#define ft first
#define sc second
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(),(v).end()
#define LB(a,x) lb(all(a),x)-a.begin()
#define UB(a,x) ub(all(a),x)-a.begin()
#define mod 1000000007
//#define mod 998244353
#define FS fixed<<setprecision(15)
using namespace std;
typedef long long ll;
const double pi=3.141592653589793;
template<class T> using V=vector<T>;
using Graph = vector<vector<int>>;
using P=pair<ll,ll>;
typedef unsigned long long ull;
typedef long double ldouble;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline void out(T a){ cout << a << '\n'; }
void YN(bool ok){if(ok) cout << "Yes" << endl; else cout << "No" << endl;}
//void YN(bool ok){if(ok) cout << "YES" << endl; else cout << "NO" << endl;}


const ll INF=1e18;
const int mx=200005;
//abc178c

int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    ll ans=1;
    rep(i,n) ans=ans*10LL%mod;
    ll cnt=1;
    ll s=1;
    rep(i,n) cnt=cnt*9LL%mod;
    rep(i,n) s=s*8LL%mod;
    ans-=2*cnt;
    ans+=s;
    while(ans<0) ans+=mod;
    out(ans);
}
//ペナルティ出しても焦らない　ACできると信じろ！！！
//どうしてもわからないときはサンプルで実験　何か見えてくるかも
//頭で考えてダメなら紙におこせ！！
/*
V,P(大文字)使用不可
乗算などの際にオーバーフローに注意せよ！
(適切にmodをとれ　にぶたんで途中で切り上げろ)
制約をよく読め！
{
    ・全探索できるなら全探索しろ
    ・異常な制約ならそこに注目
}
stringの計算量(扱い)注意
コーナー注意！(特に数値が小さいものについては要検証)
N行出力のときは'¥n'
グリッド上では行先が範囲内におさまるかif文で確認(RE注意)
if文ではちゃんと比較演算子==を使え('='でもエラー出ない)
配列(vector)の大きさが0か1以上かで場合分けせよ(RE注意)
(vector<int> a(m)でm==0というものはできない)
modはなるべく最後に取れ！
doubleを扱うときには(abs)ではなく'fabs'!!!
*/

Measured memory_bytes: 3636
#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int maxn=100000+10;
ll a[maxn],b[maxn],c[maxn];
ll sum; 
int main(){
	ll n;cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=0;i<n;i++) cin>>b[i];
	for(int i=0;i<n;i++) cin>>c[i];
	ll a1=0,b1=0,c1=0;
	sort(a,a+n);
	sort(b,b+n);
	sort(c,c+n);
	for(int i=0;i<n;i++){
		b1=b[i];
		while(a[a1]<b1&&a1<n)a1++;
		while(c[c1]<=b1&&c1<n)c1++;
		sum+=a1*(n-c1);
	}
	cout<<sum;
	return 0;
}

Measured memory_bytes: 2560
s = input()
k = int(input())
import sys


if s.count(s[0]) == len(s):
  print((len(s) * k) // 2)
  sys.exit()

c_c = 0
c_e = 0
counter = 1

for i in range(-1, -len(s)-1, -1):
#  print(counter)
  if s[0] == s[i]:
    counter += 1
  else:
    break
if counter % 2 == 0:
  c_e = 1
#print(c_e)
#print()

for i in range(len(s) - 1):
  if s[i] != s[i+1]:
    counter = 1
  else:
    counter += 1
    if counter % 2 == 0:
      c_c += 1
#  print(s[i+1], counter, c_c)

counter = 1
c_f = 0
for i in range(len(s) - 1):
  if s[i] != s[i+1]:
    counter = 1
  else:
    counter += 1
    if counter % 2 == 0:
      c_f += 1
#  print(c_f)
#  print()

ans = (c_c + c_e) * (k-1) + c_f
print(ans)

Measured memory_bytes: 38256
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,d,e,k;
  cin >> a >> b >> c >> d >> e >> k;
  if(e-a>k){
    cout << ":(" << endl;
  }
  else{
    cout << "Yay!" << endl;
  }
}

Measured memory_bytes: 3572
#include <bits/stdc++.h>
//↓✟MLE魔、TLE魔✟
#define int long long
//↑✟MLE魔、TLE魔✟
#define rep(i,n) for(int i=0;i<n;++i)
using namespace std;
int gcd(int a,int b){
    if(a%b==0)return b;
    else return gcd(b,a%b);
}
int lcm(int a,int b){
    return a*b/gcd(a,b);
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
signed main(){
    bool n=false,S=false,e=false,w=false;
    string s;
    cin>>s;
    rep(i,s.size()){
        if(s[i]=='N')n=true;
        else if(s[i]=='S')S=true;
        else if(s[i]=='E')e=true;
        else w=true;
    }
    if((n&&S&&e&&w)||(n&&S&&!(e||w))||(!(n||S)&&e&&w))cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}

Measured memory_bytes: 256
use std::io;
use std::cmp::min;

fn procon_read<T: std::str::FromStr>() ->  Vec<T> {
	let mut buf = String::new();
	io::stdin().read_line(&mut buf).expect("");
	let iter = buf.split_whitespace();
	let mut v: Vec<T> = Vec::new();
	for i in iter {
		v.push(i.parse().ok().unwrap());
	}
	v
}

fn main() {
	let v:Vec<i32> = procon_read();
	let a = v[0];
	let v:Vec<i32> = procon_read();
	let b = v[0];
	let v:Vec<i32> = procon_read();
	let c = v[0];
	let v:Vec<i32> = procon_read();
	let d = v[0];
	let train = min(a, b);
	let bus = min(c, d);
	println!("{}", train+bus);
}

Measured memory_bytes: 4352
#include<iostream>
#include<cstring>
using namespace std;
int main()
{
	char ch[100005];
	int a[30];
	while(cin>>ch)
	{
		memset(a,0,sizeof a);
		int len=strlen(ch);
		for(int i=0;i<len;i++)
		{
			int k=ch[i]-'a';
		//	cout<<k<<endl;
			a[k]=1;
		}
		int i;
		for(i=0;i<=25;i++)
		{
		//	cout<<a[i]<<endl;
			if(!a[i])
			{
				cout<<char(i+'a')<<endl;
				break;
			}	
		}
		if(i==26)cout<<"None"<<endl;
	}
	return 0;
}

Measured memory_bytes: 384
package main

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

var r=bufio.NewReader(os.Stdin)

func main(){
  var a int 
    for i :=1;i<10001;i++{
        fmt.Fscan(r ,&a)
      if a==0{
        break
      }
        fmt.Print("Case ")
        fmt.Print(i)
        fmt.Print(": ")
        fmt.Printf("%d\n",a)
    }
}


Measured memory_bytes: 1380
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<queue>
#include<stack>
#include<set>
#include<algorithm>
#include<utility>
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const int INF = 1001001001;

ll pow_mod(ll x, ll y) {
	ll res = 1;
	for (ll i = 0; i < y; i++) res = res * x % mod;
	return res;
}

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

int min_len(int i, int j, int x, int y) {
	int res = min({ abs(j - i),abs(x - i) + 1 + abs(j - y),abs(y - i) + 1 + abs(j - x) });
	return res;
}
int main() {
	int n, x, y;
	cin >> n >> x >> y;
	vector<int> cnt(n);
	for (int i = 1; i < n; i++) {
		for (int j = i + 1; j < n + 1; j++) {
			cnt[min_len(i, j, x, y)]++;
		}
	}
	for (int i = 1; i < n; i++) {
		cout << cnt[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 3588
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let n:u32=read();
    let a:u32=read();
    let b:u32=read();
    let ans = (0..n + 1)
    .filter(|x| {
        let sum = x.to_string()
        .chars()
        .map(|c| (c as u8 - b'0') as u32)
        .sum::<u32>();
        a <= sum && sum <= b
    })
    .sum::<u32>();
    println!("{}", ans);
}

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

bool ifnp[50001];

void set(){
    ifnp[0] = ifnp[1] = 1;
    for(int n = 2; n*n < 50000; n++){
        if( !ifnp[n] ){
            int j = n*n;
            while( j <= 50000 ){
                ifnp[j] = 1;
                j += n;
            }
        }
    }
}

int main(){
    int m;
    set();
    while( true ){
        cin >> m;
        if( !m ) break;
        if( m%2 ){
            cout << !ifnp[m-2] << endl;
        }else{
            int a = 0;
            for(int i = 2; i <= m/2; i++){
                a += ( !ifnp[i] && !ifnp[m-i] );
            }
            cout << a << endl;
        }
    }
    return 0;
}

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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int> H(n);
  for (int &h : H) {
    cin >> h;
  }
  --H[0];
  for (int i = 1; i < n; ++i) {
    if (H[i] - 1 >= H[i - 1]) {
      --H[i];
    }
  }
  cout << (is_sorted(H.begin(), H.end()) ? "Yes" : "No") << endl;
  return 0;
}


Measured memory_bytes: 640
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        int cl = 0;
        int ti;
        for (int i=0; i<n; i++) {
            ti = sc.nextInt();
            if ( ti < a || ti >= b ) {
                cl++;
            }
        }
        System.out.println(cl);
    }
}


Measured memory_bytes: 20820
import java.util.Scanner;

public class Main {
 public static void main(String[] args) {
  // 標準入力からデータを読み込む準備
  Scanner sc = new Scanner(System.in);
  // 2つの文字の固まりを整数値と想定して読み込む
  int a = sc.nextInt();
  int b = sc.nextInt();
  if (a < b) {
   System.out.println("a < b");
   } else if (a>b){
   System.out.println("a > b");
   }else{
   System.out.println("a == b");
   }
  }
 }


Measured memory_bytes: 26420
#include<iostream>
#include<vector>
#include<queue>
#include<algorithm>
using namespace std;
int main() {
    int n, k; cin >> n >> k;
    vector<pair<int, int> > v;
    for (int i = 0; i < n; ++i) {
        int oisisa, syurui; cin >> syurui >> oisisa;
        v.push_back({oisisa, syurui});
    }
    //その種類取ったか
    vector<bool> check(n + 1, false); //最大でも全種類バラバラでしょう
    //まず美味しさを上から
    sort(v.begin(), v.end());
    reverse(v.begin(), v.end());
    priority_queue<int> unused; //大きい順
    priority_queue<int, vector<int>, greater<int> > used; //greaterだけでど小さい順 小さいのから篩に掛けます
    long long score = 0;
    int cnt = 0; //何種類？
    for (int i = 0; i < n; ++i) {
        int oisisa = v[i].first;
        int syurui = v[i].second;
        if (check[syurui] == 0) { //その種類まだ取ってないよ
            check[syurui] = 1;
            if (i < k) { //美味しさ順にとります!
                score += oisisa + 2 * cnt + 1; // n^2 - (n - 1)^2 = 2(n - 1) + 1
                cnt++;
            } else { //種類増やしたら点高くなるか後で確かめまする
                unused.push(oisisa);
            }
        } else { //もう取った種類
            if (i < k) {
                score += oisisa;
                used.push(oisisa); //待って減らすとき種類減ったらどうすんの
            }
        }
    }
    long long ans = score;
    while (!used.empty() && !unused.empty()) {
        int uused = used.top(); //小さいの
        used.pop();
        int uunused = unused.top(); //大きいの
        unused.pop();
        score += uunused - uused + 2 * cnt + 1;
        cnt++;
        ans = max(ans, score);
    }
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 1524
#include <iostream>
#include <complex>
#include <cmath>
using namespace std;
typedef complex<double> xy_t;
double dot_product(xy_t a, xy_t b) { return (conj(a) * b).real(); }
double cross_product(xy_t a, xy_t b) { return (conj(a) * b).imag(); }
xy_t projection(xy_t p, xy_t b) { return b * dot_product(p, b) / norm(b); }
int main()
{
	int n;
	double x, y;
	xy_t points[4];
	cin >> n;
	while (n--)
	{
		for (int i = 0; i < 4; i++)
		{
			cin >> x >> y;
			points[i] = xy_t(x, y);
		}
		double area = cross_product(points[1] - points[0], points[3] - points[2]);
		if (abs(area) < 1e-11)
		{
			cout << "YES" << endl;
		}
		else
		{
			cout << "NO" << endl;
		}
	}
}


Measured memory_bytes: 3168
import java.awt.geom.Line2D;
import java.awt.geom.Point2D;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main implements Runnable{
	int N,M,X,Y;
	int[] px,py;
	double[] min;
	boolean[] used;
	public void solve() {
		N = nextInt();
		M = nextInt();
		X = nextInt();
		Y = nextInt();
		px = new int[N+1];
		py = new int[N+1];
		px[0] = X;
		py[0] = Y;
		for(int i = 1;i <= N;i++){
			px[i] = nextInt();
			py[i] = nextInt();
		}

		double ans = 0.0;
		used = new boolean[N+1];
		min = new double[N+1];

		int minInd1 = 1;
		for(int i = 1;i <= N;i++){
			double dis = Point2D.distance(px[0], py[0], px[i], py[i]);
			min[i] = dis;
			if(dis < min[minInd1]){
				minInd1 = i;
			}
		}

		Line2D.Double line = new Line2D.Double(px[0],py[0],px[minInd1],py[minInd1]);
		used[minInd1] = true;
		used[0] = true;
		ans += min[minInd1];

		for(int i = 0;i < M-1;i++){

			for(int j = 0;j <= N;j++){
				if(used[j])continue;
				min[j] = Math.min(min[j],line.ptSegDist(px[j], py[j]));
			}

			int minInd2 = -1;
			for(int j = 0;j <= N;j++){
				if(used[j])continue;
				if(minInd2 == -1)minInd2 = j;
				else if(min[j] < min[minInd2]){
					minInd2 = j;
				}
			}

			double minDis3 = Double.MAX_VALUE;
			int minInd3 = -1;
			for(int j = 0;j <= N;j++){
				if(used[j]){
					double dis = Point2D.distance(px[minInd2], py[minInd2], px[j], py[j]);
					if(dis  < minDis3){
						minDis3 = dis;
						minInd3 = j;
					}
				}
			}
			ans += minDis3;
			used[minInd2] = true;
			line.setLine(px[minInd2], py[minInd2], px[minInd3], py[minInd3]);
		}

		out.println(ans);
	}

	public static void main(String[] args) {
		new Thread(null,new Main(),"",32 * 1024 * 1024).start();
	}

	/* Input */
	private static final InputStream in = System.in;
	private static final PrintWriter out = new PrintWriter(System.out);
	private final byte[] buffer = new byte[2048];
	private int p = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (p < buflen)
			return true;
		p = 0;
		try {
			buflen = in.read(buffer);
		} catch (IOException e) {
			e.printStackTrace();
		}
		if (buflen <= 0)
			return false;
		return true;
	}

	public boolean hasNext() {
		while (hasNextByte() && !isPrint(buffer[p])) {
			p++;
		}
		return hasNextByte();
	}

	private boolean isPrint(int ch) {
		if (ch >= '!' && ch <= '~')
			return true;
		return false;
	}

	private int nextByte() {
		if (!hasNextByte())
			return -1;
		return buffer[p++];
	}

	public String next() {
		if (!hasNext())
			throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		int b = -1;
		while (isPrint((b = nextByte()))) {
			sb.appendCodePoint(b);
		}
		return sb.toString();
	}

	public int nextInt() {
		return Integer.parseInt(next());
	}

	public long nextLong() {
		return Long.parseLong(next());
	}

	public double nextDouble() {
		return Double.parseDouble(next());
	}

	@Override
	public void run() {
		out.flush();
		new Main().solve();
		out.close();

	}
}

Measured memory_bytes: 31264
N,M = [int(i) for i in input().split()]
A = list(range(N+1))
for _ in range(M):
  a,b = [int(i) for i in input().split()]
  while A[a] != a:
    a = A[a]
  while A[b] != b:
    b = A[b]
  a,b = [max(a,b),min(a,b)]
  A[a] = b
for i in range(N+1):
  n = A[i]
  while n != A[n]:
    n = A[n]
  A[i] = n
L = [0]*(N+1)
for a in A:
  L[a] += 1
print(max(L))

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

int main(void) {
    int k, x;
    cin >> k >> x;

    for (int i = x - k + 1; i <= x + k - 1; i ++) {
        cout << i << ' ';
    }
    cout << '\n';
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define OUT(x) cout << (x) << endl;
#define OUTA(a, n) \
    REP(i, n) { cout << (a[i]) << (i == n - 1 ? "\n" : " "); }
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) \
    SORT(a);     \
    reverse(a.begin(), a.end())
const ll INF = 1e18;
const ll MOD = 1e9 + 7;

ll N, M;

int main()
{
    cin >> N >> M;
    if (N == M)
    {
        OUT("Yes");
    }
    else
    {
        OUT("No");
    }
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace a
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int ans = 0;
            for (int i = 1; i <= n; i++)
            {
                ans += i;
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 2648
#include "bits/stdc++.h"
using namespace std;

#define int long long
#define PB push_back
#define PPB pop_back
typedef pair<int, int> pii;
typedef pair<double, double> pdd;

static const int INF = 1LL << 61;
static const int MOD = 100000;

int dp[55][3005];

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

    int n, m, s;
    while (cin >> n >> m >> s, n) {
        fill(dp[0], dp[55], 0);
        dp[0][0] = 1;

        for (int i = 1; i <= m; ++i) {
            for (int j = n * n; 0 < j; --j) {
                for (int k = i; k <= s; ++k) {
                    dp[j][k] += dp[j - 1][k - i];
                    dp[j][k] %= MOD;
                }
            }
        }

        cout << dp[n * n][s] << endl;
    }
}

Measured memory_bytes: 2480
#include <bits/stdc++.h>
using namespace std;
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;
}
void print() { cout << "\n"; }
template <class T> void print(const T &x) { cout << x << "\n"; }
template <class T, class... Args> void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
template <class T> void printVector(const vector<T> &v) {
    for(const T &x : v) {
        cout << x << " ";
    }
    cout << "\n";
}
using ll = long long;

#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
const double PI = acos(-1);
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

//-------------------------------------

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    string s;
    cin >> n >> k >> s;
    int LR = 0, RL = 0;
    int ans = 0;
    for(int i = 0; i < n - 1; i++) {
        if(s[i] == s[i + 1]) {
            ans++;
        } else if(s[i] == 'L' && s[i + 1] == 'R') {
            LR++;
        } else if(s[i] == 'R' && s[i + 1] == 'L') {
            RL++;
        }
    }
    int mn = min(LR, RL);
    if(k <= mn) {
        ans += 2 * k;
    } else {
        ans = n - 1;
    }
    print(ans);
}

Measured memory_bytes: 512
using System;
namespace Answer {
  class Program {
    public static void Main(string[] args) {
      var N = int.Parse(Console.ReadLine());
      var digitNum = N.ToString().Length;
      var ans = 0;
      int init, last;
      var digit = 1;
      var lessThanN = true;
      while (lessThanN) {
        init = (int)Math.Pow(10, digit - 1);
        last = (int)Math.Pow(10, digit) - 1;
        if (init > N) break;
        if (last >= N) {
          lessThanN = false;
          last = N;
        }
        ans += (int)last - (int)init + 1;
        digit += 2;
      }
      Console.WriteLine(ans);
    }
  }
}
        
        
        
      


Measured memory_bytes: 13140