akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define ll long long int
#define INF 1000000007
#define llINF 1000000000000000007
#define v(i) vector<i>
#define vv(i) vector<vector<i>>
// cin.eof() 入力個数の問題
// int num = atoi(string.c_str()); 文字列の整数変換
int keta(ll n){int ans=0;while(n>0){n /= 10; ans++;}return ans;}
ll _pow(ll a,ll b){ll ans = 1;rep(i,b){ ans *= a;}return ans;}

int main() {
string s; cin>>s;
int count = 0;
//s += "#";
int flag = 2;
rep(i,s.size()-1){
//cout<<"s[i] =="<< s[i]<<" s[i+1] == "<<s[i+1];
  if(flag == 0){
      flag += 1;
  //  cout<<" "<<1<<endl;
     
  }else if(flag == 1){
      flag = 2;
      count++;
   //      cout<<" "<<1.5<<endl;
  }
      else if(s[i] != s[i+1]){
      count++;
  //    cout<<" "<<2<<endl;
  }else if(s[i] == s[i+1]){
      count++;
      flag = 0;
  //       cout<<" "<<3<<endl;
  }
}
if(flag == 0 && s[s.size()-2] == s[s.size()-1]) count--;


cout<<count+1<<endl;
    return 0;
}


Measured memory_bytes: 3708
#include <iostream>
#include <fstream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <cctype>
#include <bits/stdc++.h>
#include <queue>

using namespace std;
// for loop
#define F(i, L, R) for(long i = L; i < R; i++)
#define FE(i, L, R) for(long i = L; i <= R; i++)
// for (reversed)
#define FR(i, L, R) for(long i = L; i > R; i--)
#define FRE(i, L, R) for(long i = L; i >= R; i--)

// data types
#define Int long
#define ul unsigned long
#define ll long long
#define ull unsigned long long
#define ui unsigned int
#define us unsigned shoft

// vectors
typedef vector<int> vi;
typedef vector<long> vl;
typedef vector<long long> vll;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef pair<int, int> ii;
#define ALL(c) (c).begin(),(c).end()
#define last(vec) vec.size()-1
#define lastEle(vec) vec[last(vec)]
#define pb push_back
#define InputV(a, n) F(i,0,n){long l; cin >> l; a.pb(l);}

// debug
#define DBG(vari) cerr<<#vari<<" = "<<(vari)<<endl;
#define printA(a, L, R) FE(i, L, R) cout << a[i] << (i==R?'\n':' ')
#define printAF(a, L) printA(a, 0, L-1)
#define printV(a) printA(a, 0, a.size()-1)

// utils
#define char2int(c) (c-'0')
#define bit(x, i) (x&(1<<i))
#define space ' '
#define PI 3.14159265358979323

void printM(vector<vector<long> > &vec, long height, long width){
    F(i, 0, height){
        F(j, 0, width){
            cout << vec[i][j] << space;
        }
        cout << endl;
    }
}

ll flo(ull a, ull b, ull x){
    ull first = a*x;
    first = first/b;
    ull second = x/b;
    second = second * a;
    ll hoge = first  - second;
    return hoge;
}

#define TST 0
int main() {
#if TST==1
    ifstream in ("input.txt");
    cin.rdbuf(in.rdbuf());
#endif
    ull a,b,n;
    cin >> a >> b >> n;
    ll ans = -1 * a - 1;
    ull first;
    ull second;
    ull x;
    if(n >= b){
        ull mo = n%b;
        x = n - mo -1;
        ans = max(ans, flo(a, b, x));
        //long l = x % a;
        //for(long i = x; i > 0 && i % a != l;i = i - b ){
        //    ans = max(ans,flo(a, b, i) );
        //}
    }
    //while(b*k -1 < n){
    //    //x = b*k - 1;
    //    //first =  a*x/b;
    //    //second = x/b;
    //    //second = second * a;
    //    //ans = max(ans, first-second); 
    //    k++;
    //}
    //if(k > 1){
    //x = b*(k-1) -1;
    //first = a*x/b;
    //second = x/b;
    //second = second * a;
    //ans = max(ans, first- second);
    //}
    ans = max(ans, flo(a, b, n));
    cout << ans << endl;

#if TST==1

#endif
}


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

int main(void){
    int n,m;
    cin >> n >> m;
    
    vector<vector<int>> v(n);
    for(int i = 0;i < m;i++){
        int a,b;
        cin >> a >> b;
        v[a-1].push_back(b-1);
        v[b-1].push_back(a-1);
    }
    
    for(int i = 0;i < n;i++){
        cout << v[i].size() << endl;
    }
}

Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <set>
#include <map>

using namespace std;

int main()
{
    int l, a, b, c, d;
    int n=0;
    cin >> l >> a >> b >> c >> d;
    while(a>0||b>0)
    {
        a -= c;
        b -= d;
        ++n;
    }
    cout << l-n << endl;
}

Measured memory_bytes: 1164
N = int(input())
A = list(map(int, input().split()))
sumA = sum(A)
K = 10**9+7
ans = 0
diag = 0
for i in range(N):
  diag += A[i]*A[i]
  ans += (A[i]*sumA)
ans = (ans - diag) // 2
ans %= K
print(ans)

Measured memory_bytes: 94208
n,m,k = map(int,input().split())
arr0 = list(map(int,input().split()))
arr1 = list(map(int,input().split()))
acc0 = [0]

for i in range(n):
  acc0.append(acc0[-1] + arr0[i])
acc1 = [0]
for i in range(m):
  acc1.append(acc1[-1] + arr1[i])
ans = 0
j = m
for i in range(n+1):
  if acc0[i] > k:
    break
  while acc1[j] > k - acc0[i] and j > 0:
    j -= 1
  ans = max(ans, i + j)

print(ans)

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

int main()
{
	string s;
	cin >> s;
	if (s[0] == s[1] && s[1] == s[2])
		cout << "Yes" << endl;
	else if (s[1] == s[2] && s[2] == s[3])
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string.h>

int main() {
	std::string s;
	std::cin >> s;
	if ((s[0] == s[1] && s[2] == s[3] && s[0] != s[2]) ||
		(s[0] == s[2] && s[1] == s[3] && s[0] != s[1]) ||
		(s[0] == s[3] && s[1] == s[2] && s[0] != s[1])) {
		std::cout << "Yes" << '\n';
	}
	else {
		std::cout << "No" << '\n';
	}
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
template <typename T> using posteriority_queue = priority_queue<T, vector<T>, greater<T> >;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
// const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
template <typename T> void unique(vector<T> &a) { a.erase(unique(ALL(a)), a.end()); }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

template <typename T>
vector<int> z_algorithm(const T &s) {
  int n = s.size();
  vector<int> res(n);
  res[0] = n;
  int j = 0;
  for (int i = 1; i < n;) {
    while (i + j < n && s[j] == s[i + j]) ++j;
    res[i] = j;
    if (j == 0) {
      ++i;
      continue;
    }
    int k = 1;
    while (i + k < n && k + res[k] < j) {
      res[i + k] = res[k];
      ++k;
    }
    i += k;
    j -= k;
  }
  return res;
}

int main() {
  int n; cin >> n;
  vector<int> a(n), b(n);
  REP(i, n) cin >> a[i];
  REP(i, n) cin >> b[i];
  vector<bool> ans(n, true);
  REP(bit, 30) {
    vector<bool> ok(n, false);
    vector<int> z(n * 3);
    REP(i, n) z[i] = b[i] >> bit & 1;
    REP(i, n) z[n + i] = z[n * 2 + i] = a[i] >> bit & 1;
    REP(_, 2) {
      vector<int> v = z_algorithm(z);
      REP(i, n) if (v[n + i] >= n) ok[i] = true;
      FOR(i, n, n * 3) z[i] ^= 1;
    }
    REP(i, n) if (!ok[i]) ans[i] = false;
  }
  REP(i, n) if (ans[i]) cout << i << ' ' << (a[i] ^ b[0]) << '\n';
  return 0;
}


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

int main(){
	long long int n;
  	scanf("%lld",&n);
    
    long long int ans  = (n*(n+1))/2;  	
    long long int a= n/3,b =n/5,c = n/15;
    a = 3*(a*(a+1))/2;
    b = 5*(b*(b+1))/2;
    c = 15*(c*(c+1))/2;
 
  	ans = ans - a -b +c;
  	printf("%lld",ans);
  	puts("");
}

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

#define vi vector<int>
#define p pair<int, int>
#define REP(i, n) for(int i = 0;i < n; i++)
#define FOR(i, m, n) for(int i = m;i < n; i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define BR cout << endl;
#define INF  2000000000

int a[6], sum = 0;

int main(){
    long long int a = 2, b = 1, c = 0, n;
    cin >> n;
    if(n == 0){
        cout << 2 << endl;
        return 0;
    }
    if(n == 1){
        cout << 1 << endl;
        return 0;
    }
    REP(i, n - 1){
        c = a + b;
        a = b;
        b = c;
    }
    cout << c << endl;
    return 0;
}


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

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

		byte[]	codes= reader.readLine().getBytes();

		for(int i = 0; i < codes.length; i++){
			codes[i] += (0x41 <= codes[i] && codes[i] <= 0x5a) ? 0x20 :
						(0x61 <= codes[i] && codes[i] <= 0x7a) ? -0x20: 0;
		}

		System.out.println(new String(codes));
	}
}

Measured memory_bytes: 9352
/**
 * author:    Ziel
 * created:   16.04.2020 14:40:31
**/

// ~zaletaet~

//#pragma GCC optimize("Ofast")
//#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>

#define fi first
#define se second
#define sz(x) int(x.size())
#define all(x) x.begin(), x.end()
#define pb push_back

using namespace std;

using ll = long long;
using ull = unsigned long long;
// using big = __int128_t; // -10^38...10^38
typedef pair<int,int> ii;
typedef pair<ll,ll> pll;

const ll N = 1e5 + 123, MOD = 1e9 + 7, oo = 1e9 + 9, INF = 1e18 + 9;
const double EPS = 1e-9, PI = acos(-1); // 3.14159265358979323846
const int dx[] = {1, -1, 0, 0, 1, 1, -1, -1}, dy[] = {0, 0, 1, -1, 1, -1, -1, 1};

main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
	
	int n;
	cin >> n;
	
	vector<ii> a(n);
	for (int i = 0; i < n; i++) cin >> a[i].fi >> a[i].se;
	
	sort(all(a), [&](ii a, ii b){
		if (a.se == b.se) a.fi < b.fi;
		return a.se < b.se;
	});
	
	int cur = 0;
	for (int i = 0; i < n; i++) {
		cur += a[i].fi;
		if (cur > a[i].se) return !(cout << "No");
	}
	
	cout << "Yes";
	
	return 0;
}



Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

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

    cout << (a * b % 2 == 1 ? "Yes" : "No") << endl;

    return 0;
}

Measured memory_bytes: 768
#include<bits/stdc++.h>
using namespace std;
#define MAXN	500005
#define INF	1e18
template <typename T> void read(T &x) {
	x = 0; int f = 1;
	char c = getchar();
	for (; !isdigit(c); c = getchar()) if (c == '-') f = -f;
	for (; isdigit(c); c = getchar()) x = x * 10 + c - '0';
	x *= f;
}
int x, y, z, n, q[MAXN];
int a[MAXN], b[MAXN], c[MAXN];
long long pre[MAXN], succ[MAXN];
priority_queue <int> Heap;
bool cmp(int x, int y) {
	return a[x] - b[x] < a[y] - b[y];
}
long long solve() {
	sort(q + 1, q + n + 1, cmp);
	long long now = 0;
	for (int i = 1; i <= n; i++) {
		if (i <= y) {
			Heap.push(-b[q[i]]);
			now += b[q[i]];
		} else {
			Heap.push(-b[q[i]]);
			now += b[q[i]];
			now += Heap.top();
			Heap.pop();
		}
		if (i >= y) pre[i] = now;
		else pre[i] = -INF;
	}
	if (y == 0) pre[0] = 0;
	else pre[0] = -INF;
	now = 0;
	while (!Heap.empty())
		Heap.pop();
	for (int i = n; i >= 1; i--) {
		int j = n - i + 1;
		if (j <= x) {
			Heap.push(-a[q[i]]);
			now += a[q[i]];
		} else {
			Heap.push(-a[q[i]]);
			now += a[q[i]];
			now += Heap.top();
			Heap.pop();
		}
		if (j >= x) succ[i] = now;
		else succ[i] = -INF;
	}
	if (x == 0) succ[n + 1] = 0;
	else succ[n + 1] = -INF;
	long long ans = -INF;
	for (int i = 0; i <= n; i++)
		ans = max(ans, pre[i] + succ[i + 1]);
	return ans;
}
int main() {
	read(x), read(y), read(z);
	n = x + y + z;
	long long ans = 0;
	for (int i = 1; i <= n; i++) {
		read(a[i]), read(b[i]), read(c[i]);
		a[i] -= c[i]; b[i] -= c[i];
		ans += c[i]; q[i] = i;
	}
	cout << ans + solve() << endl;
	return 0;
}

Measured memory_bytes: 13816
h,n = map(lambda x:int(x),input().split())
a_list = list(map(lambda x:int(x),input().split()))

def sum(list):
    s = 0
    for i in range(len(list)):
        s = s+ list[i]
    return s


summ = sum(a_list)



if summ >= h:
    print("Yes")
else:
    print("No")

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

struct UnionFind {
  vector<int> par;
  vector<int> rank;
  vector<int> siz;
  UnionFind(int n=1) {
    init(n);
  }
  void init(int n=1) {
    par.resize(n); rank.resize(n); siz.resize(n);
    for (int i=0; i<n; i++) par[i]=i, rank[i]=0;
    for (int i=0; i<n; i++) siz[i]=1;
  }
  int root(int x) {
    if (par[x] == x) return x;
    else {
      int r = root(par[x]);
      return par[x] = r;
    }
  }
  bool issame(int x, int y) {
    return root(x) == root(y);
  }
  bool merge(int x, int y) {
    x = root(x); y = root(y);
    if (x == y) return false;
    if (siz[x] < siz[y]) swap(x, y);
    if (rank[x] == rank[y]) rank[x]++;
    par[y] = x;
    siz[x] += siz[y];
    return true;
  }
  int size(int x) {
    return siz[root(x)];
  }
};

int main()
{
  ll n; cin >> n;
  ll m; cin >> m;
  ll k; cin >> k;
  UnionFind uf(n);
  vector<vector<int>> fol(n);
  for (int i=0; i<m; i++){
    int a, b; cin>>a>>b; a--; b--;
    uf.merge(a,b);
    fol[a].push_back(b);
    fol[b].push_back(a);
  }
  vector<vector<int>> blo(n);
  for (int i=0; i<k; i++){
    int c, d; cin>>c>>d; c--; d--;
    blo[c].push_back(d);
    blo[d].push_back(c);
  }
  rep(i, n) {
    int tmp = uf.size(i);
    tmp--;
    tmp -= (int)(fol[i].size());
    for (auto v:blo[i]) {
      if (uf.issame(i, v)) tmp--;
    }
    if (i>0) cout << " ";
    cout << tmp;
  }
  cout << endl;

  return 0;
}


Measured memory_bytes: 13048
#include <bits/stdc++.h>
       
using namespace std;
typedef long long ll;
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; }

int main() {
  int N, P;
  cin >> N >> P;
  string S;
  cin >> S;

  reverse((S).begin(), (S).end());
  if (P == 2 || P == 5) {
    ll ans = 0;
    for (int i = 0; i < (int)(N); ++i) if ((S[i] - '0') % P == 0) ans += N - i;
    cout << ans << endl;
    return 0;
  }

  vector<ll> T(N + 1, 0);
  ll r = 1;
  for (int i = 0; i < (int)(N); ++i) {
    T[i + 1] = T[i] + r * (S[i] - '0');
    T[i + 1] %= P;
    r *= 10;
    r %= P;
  }

  ll ans = 0;
  map<ll, ll> C;
  for (int i = 0; i < (int)(N + 1); ++i) {
    ans += C[T[i]];
    ++C[T[i]];
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 2564
#include<bits/stdc++.h>
using namespace std;
int n,a[10011],b[10011];
int gcd(int x,int y){return !y?x:gcd(y,x%y);}
bool prime(int x)
{
	for(int i=2;i*i<=x;i++)
		if(x%i==0)return 0;
	return x!=1;
}
int main()
{
	cin>>n;
	int g=0;
	for(int i=n;i>=0;i--)cin>>a[i],g=gcd(g,abs(a[i]));
	set<int> s;
	for(int i=2;i*i<=g;i++)
		if(g%i==0)
		{
			s.insert(i);
			while(g%i==0)g/=i;
		}
	if(g>1)s.insert(g);
	for(int i=2;i<=n;i++)
		if(prime(i)&&a[0]%i==0)
		{
			for(int j=0;j<=n;j++)b[j]=(a[j]%i+i)%i;
			for(int j=n,k=n-i+1;k;j--,k--)b[k]=(b[j]+b[k])%i,b[j]=0;
			bool f=1;
			for(int j=n;j>=0;j--)
				if(b[j]%i){f=0;break;}
			if(f)s.insert(i);
		}
	for(int i:s)cout<<i<<'\n';
}


Measured memory_bytes: 384
#include <iostream>
#include <utility>
#include <map>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <array>
#include <math.h>
#include <numeric>
#include <sstream>
#include <queue>
typedef long long ll;
using namespace std;
int main(int argc, char const *argv[]) {
    int n;
    cin >> n;
    vector<int> p(n);
    for (int i = 0; i < n; ++i) {
        cin >> p[i];
    }
    sort(p.begin(), p.end());
    ll ans = 0;
    for (int i = 0; i < n-1; ++i) {
        ans += p[i];
    }
    ans += p[n-1]/2;
    cout << ans << std::endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
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; }

const ll mod = 1000000007;

map<ll, ll> prime_factor(ll n){
	map<ll, ll> res;
	for(ll i = 2; i*i <= n; i++){
		while(n%i == 0){
			res[i]++;
			n /= i;
		}
	}
	if(n != 1) res[n] = 1;
	return res;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    map<ll, ll> mp;
    for(int i = 1; i <= n; ++i){
        for(auto p : prime_factor(i)){
            mp[p.first] += p.second;
        }
    }
    ll ans = 1;
    for(auto p : mp){
        if(p.first == 1) continue;
        ans = (ans * (p.second + 1)) % mod;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
import java.util.Scanner;
import java.util.stream.Collectors;

public class Main {
    public static void main(String[] args){
        PrintWriter out = new PrintWriter(System.out);
        Scanner sc = new Scanner(System.in);
        Task task = new Task();
        task.solve(sc, out);
        out.flush();
        sc.close();
    }
    static class Task{
        public void solve(Scanner sc, PrintWriter out){
            int N = nint(sc);
            int M = nint(sc);
            List<Integer[]> warList = new ArrayList<>();
            for (int i=0; i<M; i++){
                int a = nint(sc);
                int b = nint(sc);
                Integer[] ab = {a, b};
                warList.add(ab);
            }
            warList =  warList.stream()
                    .sorted(Comparator.comparing(x -> x[1]))
                    .collect(Collectors.toList());

            int removeBridge = 0;
            int result = 0;
            for (int i =0; i<warList.size(); i++){
                int a = warList.get(i)[0];
                int b = warList.get(i)[1];
                if (i==0){
                    removeBridge = b - 1;
                    result ++;
                }else if(a > removeBridge){
                    removeBridge = b-1;
                    result ++;
                }
            }
            out.println(result);
        }
    }

    static int nint(Scanner sc){
        return Integer.parseInt(sc.next());
    }
    static long nlong(Scanner sc){
        return Long.parseLong(sc.next());
    }
    static double ndouble(Scanner sc){
        return Double.parseDouble(sc.next());
    }
    static float nfloat(Scanner sc){
        return Float.parseFloat(sc.next());
    }
    static String nstr(Scanner sc){
        return  String.valueOf(sc.next());
    }
    static long[] longLine(Scanner sc, int size){
        long[] lLine = new long[size];
        for (int i = 0; i < size; i++) {
            lLine[i] = nlong(sc);
        }
        return lLine;
    }
    static int[] intLine(Scanner sc, int size){
        int[] iLine = new int[size];
        for (int i = 0; i < size; i++) {
            iLine[i] = nint(sc);
        }
        return iLine;
    }
    static String[] strLine(Scanner sc, int size){
        String[] strLine = new String[size];
        for (int i = 0; i < size; i++) {
            strLine[i] = nstr(sc);
        }
        return strLine;
    }
}

Measured memory_bytes: 67008
#include<iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;
ll BASE_NUM =  1000000007;
int main()
{
    // 整数の入力
    ll N;
    map<ll,ll> data;
    cin >> N;
    for (int i = 0;i< N;i++){
        ll a;
        cin >> a;
        data[a] = i + 1;
    }

    for(auto p:data){
        cout << p.second << " ";
    }

    cout << endl;
    return 0;
}

Measured memory_bytes: 7040
var
  k,i,h,j:longint;
  s1,s2,t:ansistring;
begin
  readln(s1);
  readln(s2);
  k:=1;
  while k<=length(s1)+length(s2) do
  begin
    if odd(k) then inc(i) else inc(j);
    if odd(k) then t:=t+s1[i] else t:=t+s2[j];
    inc(k);
  end;
  writeln(t);
end.

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n=0,ac=0,wa=0,tle=0,re=0;
	string s;
	cin>>n;
	for (int i=0;i<n;++i){
		cin>>s;
		if (s=="AC"){
			++ac;
		}
		else if (s=="WA"){
			++wa;
		}
		else if (s=="TLE"){
			++tle;
		}
		else if (s=="RE"){
			++re;
		}
	}
	printf("AC x %d\nWA x %d\nTLE x %d\nRE x %d\n",ac,wa,tle,re);
	return 0;
}

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

using namespace std;

const int N=1e5+10;
struct node
{
    int id,f;
    char re[5];
}a[N];
int b[N];

bool cmp(node a,node b)
{
    if(a.id<b.id) return true;
    else if(a.id>b.id) return false;
    else
    {
        if(a.f<b.f) return true;
        else return false;
    }
}

int main()
{
    int n,m,i,num=0,ans=0,sum=0;
    cin >> n >> m;
    for(i=0; i<m; i++)
    {
        scanf("%d",&a[i].id);
        scanf(" %s",a[i].re);
        a[i].f=i+1;
    }
    sort(a,a+m,cmp);
    for(i=0; i<m; i++)
    {
        if(a[i].id==a[i+1].id&&i!=m-1)
        {
            if(strcmp(a[i].re,"WA")==0&&b[a[i].id]==0) num++;
            else if(strcmp(a[i].re,"AC")==0&&b[a[i].id]==0)
            {
                b[a[i].id]=1;
                ans++;
                sum+=num;
                num=0;
            }
            else continue;
        }
        else if(b[a[i].id]==0&&strcmp(a[i].re,"AC")==0)
        {
            b[a[i].id]=1;
            ans++;
            sum+=num;
            num=0;
        }
        else num=0;
    }
    cout << ans << " " << sum << endl;
    return 0;
}

Measured memory_bytes: 2176
import sys
import collections
ns = lambda: sys.stdin.readline().rstrip()
ni = lambda: int(ns())
nm = lambda: map(int, sys.stdin.readline().split())
nl = lambda: list(nm())
nsl = lambda: map(str, sys.stdin.readline().split())

n = ni()
h = nl()
ans = 0
for i in range(n):
    f = 0
    for j in range(0, i):
        if h[j] > h[i]:
            f = 1
    if f == 0:
        ans += 1
print(ans)


Measured memory_bytes: 3316
A = [0] * (10**4+1)
N = gets.to_i
1.upto(99) {|x|
  l = x*x
  1.upto(99) {|y|
    m = (x+y)*y + l
    1.upto(99) {|z|
      n = (x+y+z)*z + m
      A[n] += 1  if A[n]
} } }
puts A[1,N]

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

int main(){
	int N,max=0,min=1000,tmp;
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> tmp;
		if(max<=tmp)max=tmp;
		if(min>=tmp)min=tmp;
	}
	cout << max-min << endl;

	return 0;
}

Measured memory_bytes: 256
/**************************************
 * Au: Hany01
 * Prob: agc028b
 * Date: Oct 14th, 2018
 * Email: hany01@foxmail.com
**************************************/

#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef long double LD;
typedef pair<int, int> PII;
typedef vector<int> VI;
#define File(a) freopen(a".in", "r", stdin), freopen(a".out", "w", stdout)
#define Rep(i, j) for (register int i = 0, i##_end_ = j; i < i##_end_; ++ i)
#define For(i, j ,k) for (register int i = (j), i##_end_ = (k); i <= i##_end_; ++ i)
#define Fordown(i, j, k) for (register int i = (j), i##_end_ = (k); i >= i##_end_; -- i)
#define Set(a, b) memset(a, b, sizeof(a))
#define Cpy(a, b) memcpy(a, b, sizeof(a))
#define SZ(a) ((int)(a.size()))
#define ALL(a) a.begin(), a.end()
#define PB(a) push_back(a)
#define MP(a, b) make_pair(a, b)
#define X first
#define Y second
#define INF (0x3f3f3f3f)
#define INF1 (2139062143)
#define y1 wozenmezhemecaia 
#ifdef hany01
#define debug(...) fprintf(stderr, __VA_ARGS__)
#else
#define debug(...)
#endif

template<typename T> inline bool chkmax(T &a, T b) { return a < b ? a = b, 1 : 0; }
template<typename T> inline bool chkmin(T &a, T b) { return b < a ? a = b, 1 : 0; }
template<typename T> inline T read() {
    register char c_; register T _, __;
    for (_ = 0, __ = 1, c_ = getchar(); !isdigit(c_); c_ = getchar()) if (c_ == '-')  __ = -1;
    for ( ; isdigit(c_); c_ = getchar()) _ = (_ << 1) + (_ << 3) + (c_ ^ 48);
    return _ * __;
}
//EOT


const int maxn = 1e5 + 5, MOD = 1e9 + 7;

inline int fpm(int a, int b = MOD - 2) {
    register int ans = 1;
    for ( ; b; b >>= 1, a = (LL)a * a % MOD)
        if (b & 1) ans = (LL)ans * a % MOD;
    return ans;
}

inline int inc(int x, int y) { return (x += y) >= MOD ? x - MOD : x; }

int main()
{
#ifdef hany01
    File("agc028b");
#endif

    static int n = read<int>(), pre[maxn], fac = 1, ans;

    For(i, 1, n) pre[i] = inc(pre[i - 1], fpm(i)), fac = (LL)fac * i % MOD;
    For(i, 1, n) ans = inc(ans, read<LL>() * inc(inc(pre[i], pre[n - i + 1]), MOD - 1) % MOD);
    printf("%lld\n", (LL)ans * fac % MOD);

    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iomanip>
#include <map>
#include <set>
using namespace std;


void solve(){
  int n, m; cin >> n;
  map<string, int> mp;
  for(int i = 0; i < n; i++){
    string s; cin >> s;
    mp[s]++;
  }
  cin >> m;
  for(int i = 0; i < m; i++){
    string s; cin >> s;
    mp[s]--;
  }
  int ans = 0;
  for(auto itr = mp.begin(); itr != mp.end(); itr++){
    //cout << itr->first << " " << itr->second << endl;
    ans = max(itr->second, ans);
  }
  cout << ans << endl;
  return;
}

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


Measured memory_bytes: 256
/* ************************************************************************** */
/*                                                                            */
/*                                                        :::      ::::::::   */
/*   A.cpp                                              :+:      :+:    :+:   */
/*                                                    +:+ +:+         +:+     */
/*   By: kotaro666 <kotaro0726@gmail.com>           +#+  +:+       +#+        */
/*                                                +#+#+#+#+#+   +#+           */
/*   Created: 2020/03/01 18:12:38 by kotaro666         #+#    #+#             */
/*   Updated: 2020/03/01 21:02:03 by kotaro666        ###   ########.fr       */
/*                                                                            */
/* ************************************************************************** */

#include <bits/stdc++.h>
using namespace std;

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

    int ans;
    if (N % 2 == 0)
        ans = N / 2;
    else
        ans = N / 2 + 1;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<bitset>
#include<sstream>
#include<list>
#include<climits>

using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define nrep(i,i0,n) for(int i=(i0);i<(int)(n);++i)
typedef vector<int> vi; typedef pair<int,int> pii; typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vii;
typedef long long ll;


int main(){
	int n;cin>>n;
	string s;cin>>s;
	int f=0;
	nrep(i,1,n){
		if(s[i]=='E')f++;
	}
	int ret=f;
	nrep(i,1,n){
		if(s[i-1]=='W')f++;
		if(s[i]=='E')f--;
		ret=min(ret,f);
	}
	cout<<ret<<endl;
	return 0;
}



Measured memory_bytes: 900
/*Read the problem carefully before starting to work on it*/
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
//#include <ext/pb_ds/assoc_container.hpp> 
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

//ll ncr(ll n,ll r){ll ans=1;r=min(r,n-r);for (int i=1;i<=r;i++){ans*=(n-r+i);ans/=i;}return ans;}

#define pb push_back
#define eb emplace_back
#define mp(x,y) make_pair(x,y)
#define mod 1000000007

double PI=3.1415926535897932384626;

//template<typename T> T power(T x,T y,ll m=mod){T ans=1;while(y>0){if(y&1LL) ans=(ans*x)%m;y>>=1LL;x=(x*x)%m;}return ans%m;}

#define bip(n) __builtin_popcount(n)//no of ones bit in binary!!
#define bictz(n) __builtin_ctz(n)//no of trailing zeroes in binary!!
#define biclz(n) __builtin_clz(n)//no of leading zeroes in binary!!
#define bffs(n) __builtin_ffs(n)//index of first one bit!!

typedef pair<int, int> ii;
typedef tuple<int, int, int> iii;

typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<ld> vd;
typedef vector<ll> vl;

//#define fi1 ifstream fin("input.txt")
//#define of1 ofstream fout("output.txt")
//typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update> ost;

#define fi first
#define se second

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	ll a,b;
	cin>>a>>b;
	if(a>=13)
		cout<<b;
	else if(a>=6 && a<=12)
		cout<<b/2;
	else if(a<=5)
		cout<<0;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<fstream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<set>
using namespace std;
int main() {
  long long n;
  cin >> n;
  for(long long i = 1; i < 3501; i++) for(long long j = 1; j < 3501; j++) {
    long long ue = n * i * j;
    long long shita = 4 * i * j - i * n - j * n;
    if(shita > 0 && ue % shita == 0) {
      cout << i << " " << j << " " << ue / shita << endl;
      return 0;
    }
  }
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int time = 0;
        ArrayList<Integer> List = new ArrayList<>();
        ArrayList<Integer> List_r = new ArrayList<>();
        for(int i=0;i<5;i++){
            int num = sc.nextInt();
            if(num%10==0) time+=num;
            else {
                List.add(num);
                List_r.add(num%10);
            }

        }

        while(List.size()!=0){
            int num = Collections.max(List_r);
            int num2 = List_r.indexOf(num);
            if(num==0) time+= List.get(num2);
            else{
                if(List.size()!=1)time+= List.get(num2)+(10-num);
                else time+= List.get(num2);
            }
            List.remove(num2);
            List_r.remove(List_r.indexOf(num));
        }
        System.out.println(time);
    }
}


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

string S;

bool solve() {
  if (S[0] != 'A') return false;
  int cnt = 0;
  for (int i = 1; i < S.length(); ++i) {
    if (2 <= i && i < S.length() - 1 && S[i] == 'C') {
      ++cnt;
    } else {
      if (S[i] < 'a' || 'z' < S[i]) return false;
    }
    if (cnt > 1) return false;
  }
  return (cnt == 1);
}

int main() {
  cin >> S;
  cout << ( (solve()) ? "AC" : "WA"  ) << endl;
  return 0;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS

#include<iostream>
#include<functional>
#include<algorithm>
#include<stack>
#include<queue>
#include<iomanip>
#include<set>
#include<map>
#include<utility>
#include<string>
#include<vector>

using namespace std;

#define LL long long
const int dx[4] = { 1,-1,0,0 };
const int dy[4] = { 0,0,1,-1 };
bool OOA(int x, int y, int H, int W) { return (0 <= x && x<H) && (0 <= y && y<W); }

int n,ans=0;
pair<int,int>p[52];
map<pair<int,int>,int>d;
int main(){
	cin>>n;
	for(int i=0;i<n;i++){
		int x,y;
		cin>>x>>y;
		p[i]={x,y};
	}
	for(int i=0;i<n;i++)for(int j=0;j<n;j++){
		if(i==j)continue;
		int dx=p[i].first-p[j].first,
			dy=p[i].second-p[j].second;
		if(d.count({dx,dy})==0)d[{dx,dy}]=1;
		else d[{dx,dy}]++;
	}
	for(auto it=d.begin();it!=d.end();it++)ans=max(ans,it->second);
	cout<<n-ans<<endl;
	return 0;
}


Measured memory_bytes: 384
package main

import "fmt"

func main() {
	var n, x int
	fmt.Scan(&n, &x)
	ls := make([]int, n)
	for i := range ls {
		fmt.Scan(&ls[i])
	}

	sum := 0
	ans := 1
	for _, l := range ls {
		sum += l
		if sum <= x {
			ans++
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dx[]={1,0,-1,0,1,1,-1,-1},dy[]={0,-1,0,1,1,-1,-1,1};

int main(){
    int n,m; cin>>n>>m;
    int imos[100010]={};
    rep(i,m){
        int l,r; cin>>l>>r;
        imos[l]++;
        imos[r+1]--;
    }
    rep(i,100005) imos[i+1]+=imos[i];
    int ans=0;
    for(int i=1;i<=n;i++){
        if(imos[i]==m) ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
#define inf (1LL<<61)
#define MOD 1000000007
const ll N=2e5+5;
template<typename T> T gcd(T a,T b) { if(a==0) return b; return gcd(b%a,a); }
template<typename T> T pow(T a,T b, long long m){T ans=1; while(b>0){ if(b%2==1) ans=(ans*a)%m; b/=2; a=(a*a)%m; } return ans%m; }
ll n,k;

ll h[100005];
ll cache[100005];
ll dp(ll i)
{
    if(i>n)
        return inf;
    if(i==n)
        return 0;
    ll &ans=cache[i];
    if(ans!=-1)
        return ans;
    ans=inf;
    for(ll j=1;j<=k;j++)
    {
        ans=min(ans,dp(i+j)+abs(h[i+j]-h[i]));
    }
    
    return ans;
}
int main()
{
    IOS;
    cin>>n>>k;
    for(ll i=1;i<=n;i++)
        cin>>h[i];
    
    memset(cache,-1,sizeof(cache));
    
    ll ans=dp(1);
    cout<<ans<<endl;
    
    return 0;
}

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

int main(){
  int n;
  cin >> n;
  vector<vector<int>> a(2, vector<int>(n));

  for(int i=0; i<n; i++){
    cin >> a.at(0).at(i);
  }
  for(int i=0; i<n; i++){
    cin >> a.at(1).at(i);
  }

  vector<int> candy(n, 0);
  for(int i=0; i<n; i++){
    for(int j=0; j<=i; j++) candy.at(i)+=a.at(0).at(j);
    for(int j=i; j<n; j++) candy.at(i)+=a.at(1).at(j);
  }

  sort(candy.begin(), candy.end());
  cout << candy.at(n-1) << endl;
}


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

int main(){
    int n;
    cin >> n;
    vector <string> w(n);
    bool ans = true;
    for(int i=0;i<n;i++){
        cin >> w[i];
    }    
    for(int i=0;i<n-1;i++){
        if(w[i+1][0] !=w[i][w[i].size()-1]){
            cout << "No" << endl;
            return 0;
        }
    }
    sort(w.begin(),w.end());
    for(int i=0;i<n-1;i++){
        if(w[i].size()!=w[i+1].size()){
            continue;
        }
        for(int j=0;j<w[i].size();j++){
            if(w[i][j] !=w[i+1][j]){
                break;
            }
            if(j == w[i].size()-1){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cassert>
#include <typeinfo>
#include <vector>
#include <stack>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#include <random>
#include <complex>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<P,int> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-7;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

const ll MAX=1e10;

vl SieveEratos(int n,map<ll,ll>& m){
	vl a(n+1,1),b;
	for(ll i=2;i<=n;i++) if(a[i]){
		if(i*i*i<=MAX) b.push_back(i);
		m[i*i]=i;
		for(int j=i;j<=n;j+=i) a[j]=0;
	}
	return b;
}

int n;
vl a;

int main(){
	cin>>n;
	set<ll> st;
	map<ll,ll> m,m1,m2;
	a=SieveEratos(1e5,m);
	int res=0,S=a.size(),B=1;
	for(int i=0;i<n;i++){
		ll A,Norm=1,Pair=1;
		cin>>A;
		for(int j=0;j<S;j++){
			int cnt=0,p=a[j];
			while(A%p==0){
				A/=p;
				cnt++;
			}
			cnt%=3;
			if(cnt==1){
				Norm*=p;
				Pair*=p*p;
			}
			if(cnt==2){
				Norm*=p*p;
				Pair*=p;
			}
		}
		Norm*=A;
		if(Norm==1){
			res+=2*B;
			B=0;
			continue;
		}
		st.insert(Norm);
		m1[Norm]++;
		if(m.find(A)!=m.end()) Pair*=m[A];
		else if(A<1000000) Pair*=A*A;
		else{
			res++;
			continue;
		}
		st.insert(Pair);
		m2[Pair]++;
	}
	for(auto i=st.begin();i!=st.end();i++) res+=max(m1[*i],m2[*i]);
	cout<<res/2<<endl;
}

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

int main() {
  int h,n,a,b;
  cin >> h >> n;
  vector<vector<int>> c(n+1,vector<int>(h+1,1e9));
  for(int i=0;i<n+1;i++) c[i][0] = 0;
  for(int i=1;i<n+1;i++){
    cin >> a >> b;
    for(int j=0;j<h+1;j++) c[i][j] = min(c[i-1][j],(j<a ? 0 : c[i][j-a])+b);
  }
  cout << c[n][h] << endl;
}


Measured memory_bytes: 39424
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <tuple>
#include <map>
#include <queue>
#include <math.h>
#include <set>
#include <stack>
#include <deque>
#include <bitset>
using namespace std;

int main()
{
	string n;
	cin >> n;
	cout << "ABC" << n << endl;
}


Measured memory_bytes: 256
#include<algorithm>
#include<cstring>
#include<cctype>
#include<cstdio>
#define rep(i,x,y) for(int i=x; i<=y; ++i)

using namespace std;
const int N=500005;
int n,L,head,tail;
struct data
{
	int x;
	double y;

	void operator += (data &t)
	{
		x+=t.x,y+=t.y;
	}

	void operator -= (data &t)
	{
		x-=t.x,y-=t.y;
	}

	void change(int t)
	{
		y=y/x*t,x=t;
	}
} q[N<<1],nw,tmp;

int getint()
{
	char ch;
	while(!isdigit(ch=getchar()));
	int x=ch-48;
	while(isdigit(ch=getchar())) x=x*10+ch-48;
	return x;
}

bool cmp(data a,data b)
{
	return a.y/a.x<b.y/b.x;
}

int main()
{
	n=getint(),L=getint();
	head=n,tail=n-1;
	rep(i,1,n)
	{
		tmp.y=getint(),tmp.x=getint();
		tmp.y*=tmp.x;
		while(nw.x>L-tmp.x)
		{
			if(nw.x-q[tail].x>=L-tmp.x) nw-=q[tail--];
			else
			{
				nw-=q[tail],q[tail].change(L-tmp.x-nw.x);
				nw+=q[tail];
				break;
			}
		}
		while(head<=tail && cmp(tmp,q[head])) nw-=q[head],tmp+=q[head++];
		q[--head]=tmp,nw+=tmp;
		printf("%.10lf\n",nw.y/L);
	}
	return 0;
}

Measured memory_bytes: 18560
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int n=sc.nextInt();
		
			int a[]=new int[n];
			for(int i=0;i<n;i++) {
				a[i]=sc.nextInt();
			}
			if(n<=2) {
				System.out.println(0);
			}else {
				int count=0;
				for(int i=0;i<n;i++) {
				for(int j=i+1;j<n;j++) {
					for(int k=j+1;k<n;k++) {
						if(a[i]!=a[j]&&a[j]!=a[k]&&a[i]!=a[k]&&a[i]+a[j]>a[k]&&a[j]+a[k]>a[i]&&a[k]+a[i]>a[j]) {
						
					
							count++;
						}
					}
				}
			}
				
			System.out.println(count);
				
			
			}
		}
}






Measured memory_bytes: 36884
#include <stdio.h>

int main(void) {
  double a;
  while(scanf("%lf", &a) != EOF) {
    if(a > 91.00) printf("heavy\n");
    else if(a > 81.00) printf("light heavy\n");
    else if(a > 75.00) printf("middle\n");
    else if(a > 69.00) printf("light middle\n");
    else if(a > 64.00) printf("welter\n");
    else if(a > 60.00) printf("light welter\n");
    else if(a > 57.00) printf("light\n");
    else if(a > 54.00) printf("feather\n");
    else if(a > 51.00) printf("bantam\n");
    else if(a > 48.00) printf("fly\n");
    else printf("light fly\n");
  }
  return 0;
}


Measured memory_bytes: 2596
#include <iostream>
#include <cstdio>
#include <fstream>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <limits.h>
#include <math.h>
#include <functional>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <float.h>
#include <random>

#define repeat(i,n) for (int i = 0; (i) < (n); ++ (i))
#define debug(x) cerr << #x << ": " << x << '\n'
#define debugArray(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge] << '\n'
#define debugArrayP(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge].first<< " " << x[hoge].second << '\n'

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef vector<int> vint;
typedef vector<ll> vll;
const int INF = 1e9;
const ll MOD = 998244353;

int N;
vector<vint> g;
Pii dfs(int v,int p){
  Pii ret={0,v};
  for(int u:g[v])if(u!=p){
    Pii a = dfs(u,v);
    if(ret.first<a.first+1){
      ret = {a.first+1,a.second};
    }
  }
  return ret;
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin>>N;
  g.resize(N);
  repeat(i,N-1){
    int a,b;cin>>a>> b;a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  Pii x=dfs(0,-1);
  x=dfs(x.second,-1);
  cout<<(x.first%3==1? "Second":"First")<<endl;
  return 0;
}


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

typedef struct{
  char s[12];
  int p;
  int h;

}set;

int cmp( const void *p, const void *q ) {
  int n = strcmp(*(const char **)p, *(const char **)q);
    if( n == 0 )  n = ((set*)p)->p - ((set*)q)->p;
return n;
}

int st_cmp(const void *a, const void *b)
{
  int n;
  n= strcmp(((set *)a)->s, ((set *)b)->s);
  if(n==0) n=((set*)b)->p - ((set*)a)->p;
  return n;
}

int main(){
  int n;
  int i;


  scanf("%d",&n);
  set x[n];
  for(i=0;i<n;i++){
    scanf("%s",x[i].s);
    scanf("%d",&x[i].p);
  }

  for(i=0;i<n;i++){
    x[i].h=i+1;
  }

  qsort(x,sizeof(x)/sizeof(set),sizeof(set),st_cmp);


  for(i=0;i<n;i++){

    printf("%d\n",x[i].h);
  }



  return 0;
}


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

string S;

int main() {
    cin >> S;

    bool f = false;
    for (int i = 0; i < S.length(); i++) {
        if (S[i] == 'C') {
            for (int j = i+1; j < S.length(); j++) {
                if (S[j] == 'F') {
                    f = true;
                    break;
                }
            }
        }
        if (f) break;
    }

    cout << (f ? "Yes" : "No") << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
    int n;cin>>n;
    int a[n];
    for (int i = 0;i<n;i++){
        cin>>a[i];
    }
    int x = 0;int ans = 10000000;
    for (int i =-100;i<101;i++){
        x=0;
        for (int j = 0;j<n;j++){
            x+=(i-a[j])*(i-a[j]);
        }
        ans=min(x,ans);
    }
    cout<<ans;
    
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cmath>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
#include <functional>
using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define repn(i,x) for(int i=1;i<=x;i++)

typedef long long ll;
const ll INF = 1e17;
const ll MOD = 998244353;
const ll MAX = 1000000;

ll max(ll a, ll b) {
	if (a > b) { return a; }
	return b;
}

ll min(ll a, ll b) {
	if (a > b) { return b; }
	return a;
}

//gcd,lcm,べき,二進展開
//組み合わせ、mod計算
//最短路問題、bit、union find

///////////////////////////



	
int main() {

	ll N, K;
	cin >> N >> K;
	string s;
	cin >> s;
	s[K - 1] += 'a' - 'A';
	cout << s;

	system("PAUSE");


}

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

int main(){
	string sa;
	cin>>sa;
	int a=sa.size();
	for(int i=0;i<a;i++){
		sa[i]-=3;
		if(sa[i]<65){
			sa[i]+=26;
			}
		}
		cout<<sa<<endl;
		return 0;
	}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

ll dp[105][100005];

void Main() {
    int N, K;
    cin >> N >> K;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];

    dp[0][0] = 1;

    rep(i, N) {
        vector<ll> acc(K + 2, 0);
        rep(k, K + 1) {
            acc[k + 1] += acc[k] + dp[i][k];
        }
        ll a = A[i];
        rep(j, K + 1) {
            int x = max(0LL, j - a);
            dp[i + 1][j] += acc[j + 1] - acc[x];
            dp[i + 1][j] %= MOD;
        }
    }
    cout << dp[N][K] % MOD << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 80124
import heapq

def main():
    N = int(input())
    A = [int(_) for _ in input().split()]

    L, R, p = [], [], A[:N]
    L.append(sum(p))
    heapq.heapify(p)

    for i in range(N, 2*N):
        heapq.heappush(p, A[i])
        x = heapq.heappop(p)
        L.append(L[i-N]+A[i]-x)

    A = [-a for a in A[::-1]]
    q = A[:N]
    R.append(sum(q))
    heapq.heapify(q)

    for i in range(N, 2*N):
        heapq.heappush(q, A[i])
        x = heapq.heappop(q)
        R.append(R[i-N]+A[i]-x)
    R = [-a for a in R[::-1]]

    ret = -10 ** 20
    for x, y in zip(L, R):
        ret = max(ret, x- y)
    print(ret)

    return

if __name__ == '__main__':
    main()


Measured memory_bytes: 38148
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = Integer.parseInt(sc.next());
		int x = Integer.parseInt(sc.next());
		int[] l = new int[n];
		for (int i = 0; i < n; i++) {
			l[i] = Integer.parseInt(sc.next());
		}
		int pos = 0;

		List<Integer> boundPos = new ArrayList<>();
		boundPos.add(0);
		for (int i = 0; i < n; i++) {
			pos += l[i];
			boundPos.add(pos);
		}

		System.out.println(boundPos.stream().filter(i -> i <= x).count());

	}

}


Measured memory_bytes: 29012
import numpy as np
h, w = list(map(int, input().split()))
a = [list(map(int, input().split())) for i in range(h)]

ans = []
for i in range(h):
    for j in range(w):
        if i == h-1 and j == w-1:
            continue
        if a[i][j]%2 == 0:
            continue
        else:
            if j < w-1 and a[i][j+1]%2 == 1:
                a[i][j] -= 1
                a[i][j+1] += 1
                ans.append([i+1, j+1, i+1, j+2])
                continue
            elif i < h-1 and a[i+1][j]%2 == 1:
                a[i][j] -= 1
                a[i+1][j] += 1
                ans.append([i+1, j+1, i+2, j+1])
                continue
            if j < w-1:
                a[i][j] -= 1
                a[i][j+1] += 1
                ans.append([i+1, j+1, i+1, j+2])
                continue
            elif i < h-1:
                a[i][j] -= 1
                a[i+1][j] += 1
                ans.append([i+1, j+1, i+2, j+1])
                continue

# for i in range(h): print(a[i])
print(len(ans))
for i in range(len(ans)):
    print(' '.join(list(map(str, ans[i]))))


Measured memory_bytes: 38680