akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
struct edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<int>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define res resize
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
 
typedef long long ll;
typedef pair<int,int> P;
//typedef long long T;
const int INF = 2000000000;
const ll INF64 = 922337203685477580ll;
const ll MOD = 1000000007ll;
const dou pi=3.141592653589793;

int main(){
    int n,m,x;
    std::cin >> n>>m>>x;
    VEC(int,a,m);
    int d=ub(all(a),x)-a.begin();
    std::cout << min(d,m-d) << std::endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){ 

	int p, N;

	vector<vector<int>> card(3);
	for (int i = 0; i < 3; i++) {
		for (int j = 0; j < 3; j++) {
			cin >> p;
			card.at(i).push_back(p);
		}
	}

	cin >> N;
	vector<int> vec(0);
	int q;

	for (int i = 0; i < N; i++) {
		cin >> q;
		vec.push_back(q);
	}

	for (int i = 0; i < N; i++) {
		for (int j = 0; j < 3; j++) {
			for (int k = 0; k < 3; k++) {
				if (card.at(j).at(k) == vec.at(i)) {
					card.at(j).at(k) = 0;
				}
			}
		}
	}

	bool flag = false;

	for (int i = 0; i < 3; i++) {

		if (!card.at(i).at(0) && !card.at(i).at(1) && !card.at(i).at(2)) {
			flag = true;
			break;
		}

		if (!card.at(0).at(i) && !card.at(1).at(i) && !card.at(2).at(i)) {
			flag = true;
			break;
		}
	}

	if (!card.at(0).at(2) && !card.at(1).at(1) && !card.at(2).at(0))
		flag = true;

	if (!card.at(0).at(0) && !card.at(1).at(1) && !card.at(2).at(2))
		flag = true;

	if (flag == true)
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}

Measured memory_bytes: 256
n = int(input())
As = list(map(int,input().split()))
kplsAk = [As[i]+i+1 for i in range(n)]
dic ={}
ans = 0

for i in range(n):
    key1 = i+1-As[i]
    key2 = As[i]+i+1
    if key1 in dic:
        ans +=dic[key1]
    if  key2 not in dic:
        dic[key2] = 1
    else:
        dic[key2] += 1

print(ans)



Measured memory_bytes: 48144
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashMap;
import java.util.Map;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) throws IOException {
		new Main().solve();
	}

	private void solve() throws IOException {
		try {
			solveA();
			// solveB();
			// solveC();
			// solveD();
			// solveE();
			// solveF();
		} finally {
			if (in != null) {
				in.close();
			}
			if (out != null) {
				out.flush();
				out.close();
			}
		}

	}

	private void solveA() {
		int numX = nextInt();
		int numY = nextInt();

		Map<Integer, Integer> wk = new HashMap<Integer, Integer>();
		wk.put(1, 1);
		wk.put(3, 1);
		wk.put(5, 1);
		wk.put(7, 1);
		wk.put(8, 1);
		wk.put(10, 1);
		wk.put(12, 1);
		wk.put(4, 2);
		wk.put(6, 2);
		wk.put(9, 2);
		wk.put(11, 2);
		wk.put(2, 3);
		out.println(wk.get(numX) == wk.get(numY) ? "Yes" : "No");
	}

	private void solveB() {
		int numN = nextInt();

		out.println("");
	}

	private void solveC() {
		int numN = nextInt();

		out.println("");
	}

	private void solveD() {
		int numN = nextInt();

		out.println("");
	}

	private void solveE() {
		int numN = nextInt();

		out.println("");
	}

	private void solveF() {
		int numN = nextInt();

		out.println("");
	}

	private final PrintWriter out = new PrintWriter(System.out);
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

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

	private int readByte() {
		if (hasNextByte())
			return buffer[ptr++];
		else
			return -1;
	}

	private static boolean isPrintableChar(int c) {
		return 33 <= c && c <= 126;
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr]))
			ptr++;
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

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

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

	public long nextLong() {
		if (!hasNext())
			throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		int b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) {
			throw new NumberFormatException();
		}
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}
}

Measured memory_bytes: 20308
#include <stdio.h>
#include <vector>
#include <queue>
using namespace std;
const int MAX_V=100000;
const int INF=1000000000;
int V,E;
struct edge {int to, cost;};
typedef pair<int,int> P;
vector<edge> G[MAX_V];
int d[MAX_V];
void dijkstra(int s){
  priority_queue<P,vector<P>,greater<P> >que;
  fill(d,d+V,INF);
  d[s]=0;
  que.push(P(0,s));

  while(!que.empty()){
    P p=que.top();
    que.pop();
    int v=p.second;
    if(d[v] < p.first)continue;
    for(int i=0;i < G[v].size();i++){
      edge e=G[v][i];
      if(d[e.to] > d[v]+e.cost){
	d[e.to] = d[v] + e.cost;
	que.push(P(d[e.to],e.to));
      }
    }
  }
}
int main(){
  int r;
  int s,t,c;
  scanf("%d %d %d",&V,&E,&r);
  for(int i=0;i<E;i++){
    scanf("%d %d %d",&s,&t,&c);
    edge e;
    e.to=t;e.cost=c;
    G[s].push_back(e);
  }
  dijkstra(r);
  for(int i=0;i<V;i++){
    if(d[i]==INF)printf("INF\n");
    else printf("%d\n",d[i]);
  }
  return 0;
}

Measured memory_bytes: 12596
N,M=[int(i) for i in input().split()]
AC,WA=[False]*N,[0]*N
ans_WA=0
for i in range(M):
    p,s=input().split()
    p=int(p)-1
    if AC[p]==False:
        if s=="AC":
            AC[p]=True
            ans_WA+=WA[p]
        if s=="WA":
            WA[p]+=1
    else:
        continue

ans_AC=sum(AC)
print(ans_AC,ans_WA)

Measured memory_bytes: 4596
#include <bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 
#define ordered_set tree < pairs ,  null_type , greater<pairs>,  rb_tree_tag ,  tree_order_statistics_node_update > 
#define ll long long
#define lld long double
#define vc vector<ll>
const ll MOD=(1e9 +7);
typedef pair<ll,ll>pairs;
ll power(ll a, ll b){ll res=1;a=a%MOD;while(b>0){if(b&1){res=(res*a)%MOD;b--;}a=(a*a)%MOD;b>>=1;}
    return res;}

int main() {
	// your code goes here
	std::ios::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	ll t,n,i,j,k,c,f;
	cin>>n;
	vector<pairs>a(n+1);
	vc sum(n+1),diff(n+1);
	ll summx=-2*MOD,summn=2*MOD,diffmx=-2*MOD,diffmn=2*MOD;
	for(i=1;i<=n;i++)cin>>a[i].first>>a[i].second;
	for(i=1;i<=n;i++)
	{
	    sum[i]=a[i].first+a[i].second;
	    summx=max(summx,sum[i]);summn=min(summn,sum[i]);
	    diff[i]=a[i].first-a[i].second;
	    diffmx=max(diffmx,diff[i]);diffmn=min(diffmn,diff[i]);
	}
	cout<<max(summx-summn,diffmx-diffmn);
	return 0;
}


Measured memory_bytes: 9516
/*
我的心脏怦怦跳，监管者就在附近
*/
#include<bits/stdc++.h>
#include<string>
#include<iostream>
#include<cmath>
#include<set>
#include<stack>
#include<queue>
#include<unistd.h>
#include<stdio.h>
#include<cstring>
#define random(a,b) (rand()%(b-a+1)+a)
using namespace std;
int a[10001];
int main()
{
	int n,i,j,k;
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a[i];
	}
	int minn=100000;
	for(i=0;i<n;i++)
	{
		int g=0,s=0;
		for(j=0;j<i;j++)
		{
			g+=a[j];
		}
		for(k=n-1;k>=i;k--)
		{
			s+=a[k];
		}
		if(abs(g-s)<minn) minn=abs(g-s);
	}
	cout<<minn;
	return 0;
}

Measured memory_bytes: 256
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>

using namespace std;

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

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define F0R(i, a) FOR(i,0,a)
#define ROF(i, a, b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i, a) ROF(i,0,a)
#define trav(a, x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

#define mp make_pair
#define pb push_back
#define f first
#define s second

const int MOD = 1e9 + 7; // 998244353; // = (119<<23)+1
const int MX = 2e5 + 5;

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

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

mt19937 rng((uint32_t) chrono::steady_clock::now().time_since_epoch().count());


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template<typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template<typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

template<typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &vec) {
    for (T &element: vec) {
        is >> element;
    }
    return is;
}

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

template<class X, class Y>
std::ostream &operator<<(std::ostream &os, std::pair<X, Y> const &p) {
    return os << p.first << " " << p.second;
}

template<class Ch, class Tr, class Container>
std::basic_ostream<Ch, Tr> &operator<<(std::basic_ostream<Ch, Tr> &os, Container const &x) {
    bool first = true;
    for (auto &y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class BChocolate {
public:
    void solve(std::istream &in, std::ostream &out) {
        int n;
        in >> n;
        int d, x;
        in >> d >> x;
        vi A(n);
        in >> A;
        int res = x;
        trav(x, A) {
            res += (d + x - 1) / x;
        }
        out << res << '\n';
    }

    void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
    BChocolate solver;
    solver.setup();
    std::istream &in(std::cin);
    std::ostream &out(std::cout);
    in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
    solver.solve(in, out);
    return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define lowbit(i) ((i)&-(i)) 

using namespace std;

int n,bit[100100];

void add(int i,int x)
{
	while(i<=n)
	{
		bit[i]+=x;
		i+=lowbit(i);
	}
}

int sum(int x)
{
	int s=0;
	while(x>0)
	{
		s+=bit[x];
		x-=lowbit(x);
	}
	return s;
}

int main()
{
	int q;
	scanf("%d%d",&n,&q);
	n++;
	memset(bit,0,sizeof(bit));
	for(int i=0;i<q;i++)
	{
		int com;
		scanf("%d",&com);
		if(com==0)
		{
			int x,y,s;
			scanf("%d%d%d",&x,&y,&s);
			add(x,s);
			add(y+1,-s);
		}
		else
		{
			int x;
			scanf("%d",&x);
			printf("%d\n",sum(x));
		}
	}
	return 0;
}

Measured memory_bytes: 3580
#include<iostream>
#include<cstdio>
#include<cmath>
#include<algorithm>
#define ll long long
using namespace std;
ll n,m,ans;
void f()
{
    if((m/2)<n) 
    {
        ans=m/2;
        return;
    }
    ans=n;
    m=m-n*2;
    ans+=m/4;
}
int main()
{
    scanf("%lld%lld",&n,&m);
    f();
    printf("%lld",ans);
    return 0;
}

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

using namespace std;

#define MOD 1000000007

int main() {
  int N;
  
  cin >> N;
  
  if (N == 1) {
    cout << 0 << endl;
    
    return 0;
  }
  
  long long all = 1, not_either = 1, not09 = 1;
  
  for (int i = 0; i < N; i++) {
    all			= (all * 10) % MOD;
    not_either	= (not_either * 9) % MOD;
    not09		= (not09 * 8) % MOD;
  }
  
  long long ans = (all - 2 * not_either + not09) % MOD;
  
  if (ans < 0) {
    ans += MOD;
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 3672
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;

#define REP(i,n) for(long long i = 0; i < (n); i++)
#define FOR(i, m, n) for(long long i = (m);i < (n); ++i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SPEED cin.tie(0);ios::sync_with_stdio(false);

template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQR = priority_queue<T,vector<T>,greater<T>>;

constexpr long long MOD = (long long)1e9 + 7;
constexpr long long MOD2 = 998244353;
constexpr long long HIGHINF = (long long)1e18;
constexpr long long LOWINF = (long long)1e15;
constexpr long double PI = 3.1415926535897932384626433;

template <class T> vector<T> multivector(size_t N,T init){return vector<T>(N,init);}
template <class... T> auto multivector(size_t N,T... t){return vector<decltype(multivector(t...))>(N,multivector(t...));}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template <class T, class U>ostream &operator<<(ostream &o, const map<T, U>&obj) {o << "{"; for (auto &x : obj) o << " {" << x.first << " : " << x.second << "}" << ","; o << " }"; return o;}
template <class T>ostream &operator<<(ostream &o, const set<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const multiset<T>&obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr) o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
template <class T>ostream &operator<<(ostream &o, const vector<T>&obj) {o << "{"; for (int i = 0; i < (int)obj.size(); ++i)o << (i > 0 ? ", " : "") << obj[i]; o << "}"; return o;}
template <class T, class U>ostream &operator<<(ostream &o, const pair<T, U>&obj) {o << "{" << obj.first << ", " << obj.second << "}"; return o;}
template <template <class tmp>  class T, class U> ostream &operator<<(ostream &o, const T<U> &obj) {o << "{"; for (auto itr = obj.begin(); itr != obj.end(); ++itr)o << (itr != obj.begin() ? ", " : "") << *itr; o << "}"; return o;}
void print(void) {cout << endl;}
template <class Head> void print(Head&& head) {cout << head;print();}
template <class Head, class... Tail> void print(Head&& head, Tail&&... tail) {cout << head << " ";print(forward<Tail>(tail)...);}
template <class T> void chmax(T& a, const T b){a=max(a,b);}
template <class T> void chmin(T& a, const T b){a=min(a,b);}
void YN(bool flg) {cout << (flg ? "YES" : "NO") << endl;}
void Yn(bool flg) {cout << (flg ? "Yes" : "No") << endl;}
void yn(bool flg) {cout << (flg ? "yes" : "no") << endl;}

int main() {
	int N; cin >> N;
	for(int i = 1; i <= 50000; ++i){
		int X = i*1.08;
		if(X==N){
			cout << i << endl;
			return 0;
		}
	}
	cout << ":(" << endl;
}


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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;

int main() {
    int N;
    cin >> N;
    vector<int> dp(N + 1, 100000);
    dp[0] = 0;
    rep(i, N) {
        chmin(dp[i + 1], dp[i] + 1);
        for (int j = 6; i + j <= N; j *= 6) chmin(dp[i + j], dp[i] + 1);
        for (int j = 9; i + j <= N; j *= 9) chmin(dp[i + j], dp[i] + 1);
    }

    cout << dp[N] << endl;
}


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

#define ll long long
#define pb push_back

using namespace std;

int main()
{
    int a, b, c, d;

    cin >> a >> b >> c >> d;

    int x = ceil(c / (b * 1.0));
    int y = ceil(a / (d * 1.0));

    //cout << x << y;

    x <= y ? cout << "Yes\n" : cout << "No\n";

    return 0;
}



Measured memory_bytes: 3636
#include<bits/stdc++.h>
#include <math.h>
#include <algorithm>
#include <functional>
#include<iostream>
#include <string>
using namespace std;
typedef long long ll;
#define pb pushback
#define fr(i,n) for(int i=0;i<n;i++)
#define fro(i,j,n) for(int i=j;i<n;i++)
#define ifr(i,n) for(int i=n-1;i>=0;i--)


int main() {
    int k,n;
	cin >> k>>n;
    int x=0;
  	int a[n];
    fr(i,n){
      cin >>a[i];
    }
    fr(i,n-1){
      if(a[i+1]-a[i]>x)x=a[i+1]-a[i];
    }
    if(x<a[0]-a[n-1]+k)x=a[0]-a[n-1]+k;
      cout << k-x << endl;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define vi vector<int>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define pi 3.141592653589793238
#define eb emplace_back
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define zip(i,a,b) for(int i=a;i<b;i++)
#define rzip(i,a,b) for(int i=a;i>=b;i--)
#define ll unsigned int
#define test int t;cin>>t; while(t--)
#define um unordered_map
#define en '\n'
#define us unordered_set
typedef pair<int, int>     pii;
typedef pair<char, int>    pci;
typedef pair<char, char>   pcc;
typedef vector<pii>       vii;
typedef long double ld;
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(),v.rend()
#define sz(x) (int)x.size()
#define INF (1e18+5)
#define inf (1e9+5)
#define mod 1000000007


void __print(int x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
// You should only debug a pair of simple data types. For example,
// the debug won't work if one of pair's elements is collection type
// (std::vector, std::map, std::set...).
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif


// bool check_prime(int n)  return whether a number is prime or not O(sqrt(N));
// int BE(int x,int n,int m)  return x^n%m; O(logN);
// void sieve()  from number 1-1000001 saare prime store kar lega  in bool is_prime[1000001] array
// vector<int> z_array(string s)  return vector which is Z-array of string s;
// vector<int> lps(string s)      return vector which is lps array of string s;
// int power(int x,int n) return x^n; O(logN);
// using_ordered_set (template for using ordered set , replace first 2 lines of this page with this code..);
const int gf = 1e6 + 9;

int32_t main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	if (fopen("input.txt", "r"))
	{
		freopen ("input.txt" , "r" , stdin);
		freopen ("output.txt" , "w" , stdout);
	}
#endif
	//_______________________________-code starts-_______________________________________________

	int k;
	cin >> k;
	int n = 50;
	int mi;
	mi = k / n;
	int a[n];
	zip(i, 0, n)a[i] = mi;
	zip(i, 0, k % n)a[i]++;
	cout << 50 << en;
	zip(i, 0, 50)
	{
		cout << n - 1 + a[i]*(n + 1) - k << " ";
	}
	cout << en;




	return 0;
}




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

using ll=long long;
const ll INF=1LL<<60;
const ll MOD=1e9+7;

ll modpow(ll a, ll n, ll mod){
    long long res=1;
    while(n>0){
        if(n & 1) res=res*a%mod;
        a=a*a%mod;
        n>>=1;
    }
    return res;
}

ll modinv(ll a, ll mod){
    return modpow(a, mod-2, mod);
}

ll comb(ll n, ll k, ll mod){
    ll res=1;
    for(ll i=0; i<k; i++){
        res=res*(n-i)%mod*modinv(i+1, mod)%mod;
    }
    return res;
}

int main(){
    ll n, a, b; cin >> n >> a >> b;
    ll ans=modpow(2LL, n, MOD)-1-comb(n, a, MOD)-comb(n, b, MOD);
    ans%=MOD;
    if(ans < 0) ans=MOD+ans;
    cout << ans << endl;
    return 0;
}

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

int main() {
char b;
  cin >> b;
  if (b=='A'){
    cout << "T" << endl;
  }else  if (b=='T'){
    cout << "A" << endl;
  }else  if (b=='C'){
    cout << "G" << endl;
  }else  if (b=='G'){
    cout << "C" << endl;
  }
  
    
  
}


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

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

	int pow = 1;
	double ans = 0;
	for (int i = n; i > 0; i--) {
		while (pow * i < k) {
			pow *= 2;
		}
		ans += 1.0 / pow;
	}
  ans /= n;
  cout << setprecision(12);
	cout << ans << endl;

}

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

#define N 3000
#define max(a,b) (a>b?a:b)
#define min(a,b) (a>b?b:a)

typedef pair<int,int> P;

int main() {
	int n, x, y, ans;
	set<P> v;
	while(1) {
		cin >> n;
		if(!n) break;
		v.clear();
		for(int i=0; i<n; ++i) {
			cin >> x >> y;
			v.insert(P(x,y));
		}
		ans = 0;
		set<P>::iterator it, it2;
		for(it=v.begin(); it!=v.end(); ++it) {
			for(it2=it,++it2; it2!=v.end(); ++it2) {
				int vx = (*it2).first-(*it).first, vy = (*it2).second-(*it).second;
				if(vx*vx+vy*vy<=ans) continue;
				if(v.find(P((*it).first+vy, (*it).second-vx))!=v.end() &&
					v.find(P((*it).first+vx+vy, (*it).second+vy-vx))!=v.end()) {
					ans = vx*vx+vy*vy;
				}
			}
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 1336
#include <bits/stdc++.h>
#define lowbit(a) ((a)&(-(a)))
using namespace std;

int n;
int a[25];

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

Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int a[10],k;

	scanf("%d",&a[0]);
	scanf("%d",&a[1]);
	scanf("%d",&a[2]);
	scanf("%d",&a[3]);
	scanf("%d",&a[4]);
	scanf("%d",&k);

	for(int i=0;i<5;i++){
		for(int j=1;j<5;j++){
			if(a[j]-a[i] > k){
				printf(":(\n");
				return 0;
			}
		}
	}
	printf("Yay!\n");
	return 0;
}

Measured memory_bytes: 128
var
	sum,a,b,c,k:int64;
begin
	sum:=0;
	readln(a,b,c,k);
    if k>a then begin	
    	sum:=sum+a;
        k:=k-a-b;
        if k>0 then sum:=sum-k;    
  	end
    else sum:=sum+k;
    writeln(sum);
end.

Measured memory_bytes: 1368
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

unordered_map<int, int> cntA, cntB;

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int N, V; cin >> N >> V;
	vector<int> a(N); rep(i, 0, N) { cin >> a[i]; }
	vector<int> b(N); rep(i, 0, N) { cin >> b[i]; }
	vector<int> c(N); rep(i, 0, N) { cin >> c[i]; }
	vector<int> d(N); rep(i, 0, N) { cin >> d[i]; }
	vector<int>	A, B;
	rep(i, 0, N)rep(j, 0, N) {
		A.emplace_back(a[i] + b[j]);
		B.emplace_back(c[i] + d[j]);
	}
	sort(all(A));
	sort(all(B));
	rep(i, 0, A.size()) {
		cntA[A[i]]++;
		cntB[B[i]]++;
	}
	A.erase(unique(A.begin(), A.end()), A.end());
	int ans = 0;
	rep(i, 0, A.size()) {
		ans += cntA[A[i]] * cntB[V - A[i]];
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 137272
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    long N = sc.nextLong();

    int min = Integer.MAX_VALUE;
    for (int i = 1; (long)i*i <= N; i++) {
      if (N%i == 0) {
        min = Math.min(min, F(i, N/i));
      }
    }

    System.out.println(min);
  }
  
  private static int F(long a, long b) {
    return Math.max(digit(a), digit(b));
  }
  
  private static int digit(long n) {
    int ret = 0;
    while (n != 0) {
      n /= 10;
      ret++;
    }
    return ret;
  }
}

Measured memory_bytes: 21844
macro_rules! check {
    ($b:expr) => {
        if !$b {
            println!("-1");
            return;
        }
    };
}

const ALL1: u64 = u64::max_value();

fn main() {
    proconio::input! {
        n: usize,
        s: [u8; n],
        t: [u8; n],
        u: [u64; n],
        v: [u64; n],
    }
    let s: Vec<_> = s.iter().map(|&i| i == 1).collect(); // is OR?
    let t: Vec<_> = t.iter().map(|&i| i == 1).collect(); // is OR?
    let mut mat = vec![vec![0; n]; n]; // 確定した bit だけ立てる
    for i in 0..n {
        for j in 0..n {
            // OR, AND に関わらず同じ値だったとき
            mat[i][j] = u[i] & v[j];
            // "AND が 1" である場合
            if !s[i] {
                mat[i][j] |= u[i];
            }
            if !t[j] {
                mat[i][j] |= v[j];
            }
            // "OR が 0" の場合には、未確定 = 立っていない ことを確認
            check!(!s[i] || mat[i][j] & !u[i] == 0);
            check!(!t[j] || mat[i][j] & !v[j] == 0);
        }
    }
    // "AND が 0" の場合には、未確定の場所が残っていることを確認
    for i in 0..n {
        let row_and = mat[i].iter().fold(ALL1, |a, &b| a & b);
        check!(s[i] || row_and & !u[i] == 0);
    }
    for j in 0..n {
        check!(t[j] || (0..n).map(|i| mat[i][j]).fold(ALL1, |a, b| a & b) & !v[j] == 0)
    }
    // "OR が 1" を満たすようにする
    for i in 0..n {
        if !s[i] {
            continue; // AND は見ない
        }
        // "OR が 0" であるか、既に "OR が 1" を達成している場合
        let mut ok = !u[i] | (0..n).map(|j| mat[i][j]).fold(0, |a, b| a | b);
        for j in 0..n {
            // "OR が 0" の列は変更できない
            // "OR が 1" の列は変更する必要がない（26行目で解消済）
            if t[j] {
                continue;
            }
            // 要変更 箇所を変更する
            mat[i][j] |= !ok;
            // 変更がまずかった = "AND が 0" が崩れたらもとに戻す
            mat[i][j] &= v[j] | !(0..n).map(|i| mat[i][j]).fold(ALL1, |a, b| a & b);
            // 無事変更が完了した部分を、解消済みとする。
            ok |= mat[i][j];
        }
        check!(ok == ALL1)
    }
    for j in 0..n {
        if !t[j] {
            continue;
        }
        let mut ok = !v[j] | (0..n).map(|i| mat[i][j]).fold(0, |a, b| a | b);
        for i in 0..n {
            if s[i] {
                continue;
            }
            mat[i][j] |= &!ok;
            mat[i][j] &= u[i] | !(0..n).map(|j| mat[i][j]).fold(ALL1, |a, b| a & b);
            ok |= mat[i][j];
        }
        check!(ok == ALL1)
    }
    for i in 0..n {
        println!(
            "{}",
            mat[i]
                .iter()
                .map(|&x| x.to_string())
                .collect::<Vec<_>>()
                .join(" ")
        );
    }
}


Measured memory_bytes: 7520
import java.util.HashMap;
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[] a = new int[n+1];

		for (int i = 1; i < n+1; i++) {
			a[i] = Integer.parseInt(sc.next());
		}

		int b = 1;
		int ans = -1;
		HashMap<Integer, Integer> map = new HashMap<Integer, Integer>();
		map.put(1, 1);

		for (int i = 1; i < n + 1; i++) {
			b = a[b];

			if (b == 2) {
				ans = i;
				break;
			}

			if (map.containsKey(b)) {
				break;
			}
		}

		System.out.println(ans);
	}

}


Measured memory_bytes: 51960
// -*- coding: utf-8 -*-
//import java.awt.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;

public class Main {
  public static void main(String[] args) {
    InputStream inputStream;
    if (args.length > 0 && args[0].equals("devTesting")) {
      try {
        inputStream = new FileInputStream(args[1]);
      } catch(FileNotFoundException e) {
        throw new RuntimeException(e);
      }
    } else {
      inputStream = System.in;
    }
    OutputStream outputStream = System.out;
    InputReader in = new InputReader(inputStream);
    PrintWriter out = new PrintWriter(outputStream);
    TaskB solver = new TaskB();
    solver.solve(1, in, out);
    out.close();
  }
  
  static class TaskB {    
    int n;
    int[] p;
    
    void solve(int testNumber, InputReader in, PrintWriter out) {
      n = in.nextInt();
      p = new int[n + 1];
      for (int i = 1; i <= n; ++i)
        p[i] = in.nextInt();
      int[] r = new int[n + 1];
      for (int i = 1; i <= n; ++i)
        r[p[i]] = i;
      int[] a = new int[n + 1], b = new int[n + 1];
      for (int i = 1; i <= n; ++i) {
        a[i] = 21000 * i;
        b[i] = 21000 * (n - i) + r[i];
      }
      for (int i = 1; i <= n; ++i) {
        if (i > 0)
          out.print(' ');
        out.print(a[i]);
      }
      out.println();
      for (int i = 1; i <= n; ++i) {
        if (i > 0)
          out.print(' ');
        out.print(b[i]);
      }
      out.println();
    }
    
  }
      
  static class InputReader {
    public BufferedReader reader;
    public StringTokenizer tokenizer;

    public InputReader(InputStream stream) {
      reader = new BufferedReader(new InputStreamReader(stream));
      tokenizer = null;
    }

    public String next() {
      while (tokenizer == null || !tokenizer.hasMoreTokens()) {
        try {
          tokenizer = new StringTokenizer(reader.readLine());
        } catch (IOException e) {
          throw new RuntimeException(e);
        }
      }
      return tokenizer.nextToken();
    }
    
    public String nextLine() {
      try {
        return reader.readLine();
      } catch(IOException e) {
        throw new RuntimeException(e);
      }
    }

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

    public long nextLong() {
      return Long.parseLong(next());
    }
    
    public double nextDouble() {
      return Double.parseDouble(next());
    }

    public boolean hasInput() {
      try {
        if (tokenizer != null && tokenizer.hasMoreTokens()) {
          return true;
        }
        reader.mark(1);
        int ch = reader.read();
        if (ch != -1) {
          reader.reset();
          return true;
        }
        return false;
      } catch(IOException e) {
        throw new RuntimeException(e);
      }
    }
    
  }
}


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

//定数
const long long MOD1=1000000007;
const long long MOD2=998244353;
const long double PI=3.1415926535897932;
const long long MAXLL=9223372036854775807;
const long long INF=2305843009213693951;
const long long dx[]={0,1,0,-1,1,-1,1,-1};
const long long dy[]={1,0,-1,0,1,1,-1,-1};

//型名省略
#define ll long long
#define ull unsigned long long
#define ld long double
#define uld unsigned long double
#define pll pair<long long,long long>
#define tll(n) array<long long,(int)(n)>
#define pcc pair<char,char>
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define vp vector<pair<long long,long long>>
#define vt(n) vector<array<long long,(int)(n)>>
#define umap unordered_map
#define uset unordered_set
#define Lqueue priority_queue<long long>
#define Squeue priority_queue<long long,vector<long long>,greater<long long>>
#define Fi first
#define Se second
#define mp make_pair
#define eb emplace_back

//マクロ
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define rbf(a,x) for(auto& a:x)
#define rep(i,n) for(long long i=0;i<(long long)(n);i++)
#define rep2(i,s,n) for(long long i=(s);i<(long long)(n);i++)
#define Maxe(x) *max_element((x).begin(),(x).end())
#define Mine(x) *min_element((x).begin(),(x).end())
#define Size(x) ((long long)(x).size())
#define lin(s) getline(cin,(s))

//MAX,MIN
template<class T,class U> auto max(T a,U b){return a>b?a:b;}
template<class T,class U> auto min(T a,U b){return a<b?a:b;}

//最大公約数,最小公倍数
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a,long long b){return a/gcd(a,b)*b;}

//累乗
template<typename t>
constexpr t mypow(t a,long long b){
    if(b==0)return 1;
    if(a==0)return 0;
    t x=1;
    while(b>0){
        if(b&1LL)x*=a;
        a*=a;
        b>>=1LL;
        }
    return x;
}
#define pow mypow

//chmin,chmax
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;}

//組み合わせ O(r)
template<typename t>
constexpr t nCr(t n,long long r){
    if(r==0)return 1;
    if(n==0)return 0;
    if(n<r)return 0;
    t x=1;
    for(long long i=1;i<=r;i++){
        x*=n-i+1;
        x/=i;
    }
    return x;
}

//main関数
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll a,b,k;
    cin>>a>>b>>k;
    cout<<max(a-k,0);
    k-=a;
    chmax(k,0LL);
    b=max(b-k,0);
    cout<<" "<<b<<endl;
}

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

int main() {
  char a, b, c, d;
  string r;
  cin >> a >> b >> c >> d;
  
  if((a==b && c==d && a!=c) || (a==c && b==d && a!=b) || (a==d && b==c && a!=b))
    r = "Yes";
  else
    r = "No";
  
  cout << r << endl;
}

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

typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define INF (1 << 30)
#define REP(i, m, n) for(int i = (int)m; i < (int)n; ++i)
#define rep(i, n) REP(i, 0, n)


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

    int n, a, b; cin >> n >> a >> b;
    cout << (abs(a-b)&1 ? "Borys" : "Alice") << '\n';
    return 0;
}

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

int keta(int n){
    int re=0;
    while(n>0){
        re=re+n%10;
        n=n/10;
    }
    return re;
}

int main(){
    int n,f;
    cin>>n;
    f=keta(n);
    if(n%f==0){
        cout<<"Yes"<<endl;
        }else{
        cout<<"No"<<endl;
        }
    }


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std ;
int a[100005],dp[100005];
int main()
{

    int n,i,j,k;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>a[i];
    }
    dp[1]=0;
    dp[2]=dp[1]+abs(a[2]-a[1]);
    for(i=3;i<=n;i++)
    {
        dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]),dp[i-2]+abs(a[i]-a[i-2]));
    }
    cout<<dp[n];
    return 0;
}


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

using namespace std;

const double PI = 3.141592653589;
#define fastio ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define pb push_back
#define mp make_pair
#define int long long
#define ll long long
#define ll long long
#define all(c) (c).begin(),(c).end()
#define M 1000000007
#define INF LLONG_MAX
#define pr(...) dbs(#__VA_ARGS__, __VA_ARGS__)
template <class T> void dbs(string str, T t) {cerr << str << " : " << t << "\n";}
template <class T, class... S> void dbs(string str, T t, S... s) {int idx = str.find(','); cerr << str.substr(0, idx) << " : " << t << ", "; dbs(str.substr(idx + 1), s...);}
template <class S, class T>ostream& operator <<(ostream& os, const pair<S, T>& p) {return os << "(" << p.first << ", " << p.second << ")";}
template <class T>ostream& operator <<(ostream& os, const vector<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T>ostream& operator <<(ostream& os, const set<T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class S, class T>ostream& operator <<(ostream& os, const map<S, T>& p) {os << "[ "; for (auto& it : p) os << it << " "; return os << "]";}
template <class T> void prc(T a, T b) {cerr << "["; for (T i = a; i != b; ++i) {if (i != a) cerr << ", "; cerr << *i;} cerr << "]\n";}
// Use pr(a,b,c,d,e) or cerr<<anything or prc(v.begin(),v.end()) or prc(v,v+n)
//  


int32_t main()
{
    fastio;
    //freopen("file.in", "r", stdin);
    //freopen("file.out", "w", stdout);
    int n, k;
    cin >> n >> k;
    vector<int> v(n);
    for(int i=0;i<n;i++)
    {
    	cin >> v[i];
    	v[i]--;
    }
    int curr = 0, cstart = -1, ln = -1, count = 0;
    vector<int> vis(2*n, -1), steps(2*n);
    while(vis[curr] == -1)
    {
    	// pr(count, curr);
    	steps[count] = curr;
    	vis[curr] = count++;
    	curr = v[curr];
    }
    ln = count - vis[curr];
    cstart = vis[curr];
    if(k < cstart)
    {
    	cout << steps[k] + 1 << "\n";
    }
    else
    {
    	k -= cstart;
    	k %= ln;
    	cout << steps[cstart + k] + 1  << "\n";
    }
    
    return 0;
}



Measured memory_bytes: 11120
N = int(input())    # N泊
K = int(input())    # 最初のK泊までは1泊当たりX円
X = int(input())
Y = int(input())    # K+1泊目以降は1泊当たりY円

if N - K > 0:
    total = (K * X) + ((N - K) * Y)
else:
    total = N * X

print(total)


Measured memory_bytes: 9156
#include <iostream>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <math.h>
using namespace std;

int main() {
	double r;
	cin >> r;

	cout << fixed <<setprecision(6) << M_PI * r * r << " " << 2 * M_PI * r << endl;
}

Measured memory_bytes: 1288
#include <iostream>

int main(int argc, char const* argv[])
{
	int m, f, r;

	while(std::cin >> m >> f >> r)
	{
		if (m == -1 && f == -1 && r == -1)
			break;

		int sum = m + f;
		if(m == -1 || f == -1)
			std::cout << "F" << std::endl;
		else if (sum >= 80)
			std::cout << "A" << std::endl;
		else if (sum >= 65 && sum < 80)
			std::cout << "B" << std::endl;
		else if (sum >= 50 && sum < 65)
			std::cout << "C" << std::endl;
		else if (sum >= 30 && sum < 50)
		{
			if(r >= 50)
				std::cout << "C" << std::endl;
			else
				std::cout << "D" << std::endl;
		}
		else if (sum < 30)
			std::cout << "F" << std::endl;
	}

	return 0;
}

Measured memory_bytes: 1156
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
signed main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    double x;
    while(cin >> x)
    {
        if(x > 91) cout << "heavy" << endl;
        else if(x > 81) cout << "light heavy" << endl;
        else if(x > 75) cout << "middle" << endl;
        else if(x > 69) cout << "light middle" << endl;
        else if(x > 64) cout << "welter" << endl;
        else if(x > 60) cout << "light welter" << endl;
        else if(x > 57) cout << "light" << endl;
        else if(x > 54) cout << "feather" << endl;
        else if(x > 51) cout << "bantam" << endl;
        else if(x > 48) cout << "fly" << endl;
        else cout << "light fly" << endl;
    }
    return 0;
}




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

int main(){
  int n;
  cin>>n;
  vector<tuple<string,int,int>> p(n);
  for(int i=0; i<n; i++){
    string s; int t;
    cin>>s>>t;
    p[i]=make_tuple(s,100-t,i+1);
  }
  sort(p.begin(),p.end());
  for(int i=0; i<n; i++){
    cout<<get<2>(p[i])<<endl;
  }
}

Measured memory_bytes: 256
import math
import fractions
import collections
import itertools
from collections import deque
N,K=map(int,input().split())
cnt=0
p=10**9+7
for i in range(K,N+2):
    cnt=(cnt+((N-i+1)*i)+1)%p
    #print(((N-i+1)*i)+1)
print(cnt)



Measured memory_bytes: 77460
<?php
class Scanner {
    private $arr = [];
    private $count = 0;
    private $pointer = 0;
    public function next() {
        if($this->pointer >= $this->count) {
            $str = trim(fgets(STDIN));
            $this->arr = explode(' ', $str);
            $this->count = count($this->arr);
            $this->pointer = 0;
        }
        $result = $this->arr[$this->pointer];
        $this->pointer++;
        return $result;
    }
    public function hasNext() {
        return $this->pointer < $this->count;
    }
    public function nextInt() {
        return (int)$this->next();
    }
    public function nextDouble() {
        return (double)$this->next();
    }
}
function be_able_to_reach($from, $to)
{
  $time = $to[0] - $from[0];
  $distance = abs($to[1] - $from[1]) + abs($to[2] - $from[2]);
  #var_dump($time,$distance);
  if($distance > $time) return false;
  if($distance % 2 == 0 && $time % 2 == 0) return true;
  if($distance % 2 == 1 && $time % 2 == 1) return true;
  return false;
}

$scan = new Scanner();
$A = $scan->nextInt();
$B = $scan->nextInt();
$cost = 0;
if($A >= 13) $cost = $B;
elseif($A >= 6) $cost = $B/2;
else $cost = 0;
print($cost);


Measured memory_bytes: 4604
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>
#include <map>
#include <queue>

using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

int main() {

    ll N;
    cin >> N;
    ll out = 0;
    rep(i,N){
        ll n = N/(i+1);
        out += (i+1+(i+1)*n)*n/2;
    }
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 3660
K,N = map(int, input().split())
A = list(map(int, input().split()))
length_list=[]

for i in range(len(A)-1):
    length = A[i+1] - A[i]
    length_list.append(length)
last = K - sum(length_list)
length_list.append(last)

ans = K - max(length_list)
print(ans)

Measured memory_bytes: 26420
#include<iostream>
#include<stdio.h>
using namespace std;

int main(){
    
    int a,b;
    
    cin>>a>>b;
    
    int r,d;
    double f;
    
    d=a/b;
    r=a%b;
    f=(double)a/(double)b;
    
    printf("%d %d %.5f\n",a/b,a%b,f);
}


Measured memory_bytes: 3212
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<cctype>
#define ld long double
#define ll long long int
#define ull unsigned long long int
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;}
const long long INF=1LL<<60;
//set<int>::iterator it;

int main(void){
	ios::sync_with_stdio(false); cin.tie(0);
	
	
	int a,b; 
	cin>>a>>b;
	int x=pow(100,a);
	if(b==100)b++;
	cout<<x*b<<endl;
	
	
	
	
	return 0;
}

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

int N,T;
int c[110],t[110];

int main(){
    cin >> N >> T;
    REP(i,N) cin >> c[i] >> t[i];

    int ans = 100000000;
    REP(i,N){
        if(t[i]<=T) ans = min(ans,c[i]);
    }
    
    if(ans==100000000) cout << "TLE" << endl;
    else cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 256
import re
import sys
S = input()
flg = 0
upperReg = re.compile(r'^[A-Z]+$')

def isupper(s):
    return upperReg.match(s) is not None

if S[0] != "A":
    print("WA")
    sys.exit()
if isupper(S[1]) == True:
    print("WA")
    sys.exit()

for j in range(2,len(S)):
    if isupper(S[j]) == True:
        if flg == 1:
            print("WA")
            sys.exit()
        else:
            if S[j] == "C":
                if len(S) == 4:
                    if j != 2:
                        print("WA")
                        sys.exit()
                    flg = 1
                else:
                    if 2 <= j <= len(S) - 2:
                        flg = 1

                    else:
                        print("WA")
                        sys.exit()

if flg != 1:
    print("WA")
    sys.exit()

print("AC")

Measured memory_bytes: 3316
#include <iostream>
#include <algorithm>
#include <string>
#include <math.h>
#include<iomanip>
using namespace std;
typedef long long ll;
int main(void){
    long double p = M_PI;
    long double a,b,c,d,h,m;
    cin >> a >> b >> h >> m;
    c = a*cos(p/180.0 * (30.0*(h+m/60.0))) - b*cos(p/180.0 * (6.0*m));
    d = a*sin(p/180.0 * (30.0*(h+m/60.0))) - b*sin(p/180.0 * (6.0*m));
    long double ans = pow(c*c+d*d,0.5);
    cout << fixed << setprecision(15) << ans << endl;
}


Measured memory_bytes: 4168
# coding: utf-8
import sys
#from operator import itemgetter
sysread = sys.stdin.buffer.readline
read = sys.stdin.buffer.read
#from heapq import heappop, heappush
#from collections import defaultdict
sys.setrecursionlimit(10**7)
#import math
#from itertools import product, accumulate, combinations, product
#import bisect
#import numpy as np
#from copy import deepcopy
#from collections import deque
#from decimal import Decimal
#from numba import jit

INF = 1 << 50
def run():
    N = int(input())
    S = input()
    position = 0
    l = 0
    r = 0
    for s in S:
        if s == '(':
            position += 1
        else:
            position -= 1
        if position < 0:
            l += abs(position)
            position = 0
    r += position

    print(l * '(' + S + r * ')')

if __name__ == "__main__":
    run()


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

namespace AtCorder
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            if(s.EndsWith("s"))
            {
                Console.WriteLine(s + "es");
            }
            else
            {
                Console.WriteLine(s + "s");
            }
        }
    }
}

Measured memory_bytes: 26204
#include <bits/stdc++.h>
#define REP(i,n) for(i=0; i<n; i++)
#define IREP(i,n) for(i=n-1; i>=0; i--)
#define X first
#define Y second;
using namespace std;

struct R {
	int t, c, p;
	R() {
		c = 0;
		p = 0;
	}
	bool operator<(const R& another) const {
		if(c != another.c) return c > another.c;
		if(p != another.p) return p < another.p;
		return t < another.t; 
	}
};

int main() {
	int T,P,R,i,j,t,p,ti;
	string m;
	while(cin >> T >> P >> R, T!=0 || P!=0 || R!=0) {
		int a[T][P];
		REP(i,T) REP(j,P) a[i][j] = 0;
		struct R r[T];
		REP(i,T) {
			r[i].t = i+1;
			r[i].c = 0;
			r[i].p = 0;
		}
		REP(i,R) {
			cin >> t >> p >> ti >> m;
			t--;
			p--;
			if(a[t][p]==-1) continue;
			if(m=="WRONG") a[t][p]++;
			else if(m=="CORRECT") {
				r[t].c++;
				r[t].p += 1200*a[t][p] + ti;
				a[t][p] = -1;
			}
		}
		sort(&r[0], &r[T]);
		REP(i,T) {
			cout << r[i].t << ' ' << r[i].c << ' ' << r[i].p << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1212
#include <bits/stdc++.h>
#include <boost/integer/common_factor_rt.hpp>
using namespace std;
using ll=long long;

int main() {
  int n;
  cin >> n;
  vector<ll> a(n);
  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  ll ans=boost::integer::gcd_range(a.begin(), a.end()).first;
  cout << ans << endl;
}



Measured memory_bytes: 3976