akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define ALL(v) (v.begin(),v.end())
#define COUT(x) cout<<(x)<<endl

int main(){
    int n,l;
    cin >> n >> l;
    string s[n];
    REP(i,n){
        string t;
        cin >> t;
        s[i] = t;
    }
    sort(s,s+n);
    REP(i,n){
        cout << s[i];
    }
    cout << endl;
    return 0;
}  

Measured memory_bytes: 256
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <functional>
#include <sstream>
#include <iostream>
#include <iomanip>
#define _USE_MATH_DEFINES
#include <cmath>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cfloat>
#include <cmath>
#include <ctime>
#include <cassert>
#include <cctype>
#include <cstdio>
#include <cassert>
using namespace std;

#define EPS 1e-12
#define ull unsigned long long
#define ll long long
#define VI vector<ll>
#define PII pair<ll, ll> 
#define VVI vector<vector<ll> >
#define VVVI vector<vector<vector<ll>>>
#define VVVVI vector<vector<vector<vector<ll>>>>
#define REP(i,n) for(ll i=0,_n=(n);(i)<(ll)_n;++i)
#define REPR(i,n) for(ll i=(ll)(n)-1;0<=(i);--i)
#define RANGE(i,a,b) for(ll i=(ll)a,_b=(ll)(b);(i)<_b;++i)
#define RANGER(i,a,b) for(ll i=(ll)(b)-1,_a=(ll)(a);(_a)<=i;--i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define ALLR(c) (c).rbegin(), (c).rend()
#define PB push_back
#define MP(a, b) make_pair(a, b)
#define POPCOUNT __builtin_popcount
#define POPCOUNTLL __builtin_popcountll
#define CLEAR(table, v) memset(table, v, sizeof(table));
#define UNIFORM_DOUBLE(a, b) (((b-a)*(double)rand()/RAND_MAX)+a) // [a, b) 
#define UNIFORM_LL(a, b) (ll)UNIFORM_DOUBLE(a, b) // [a, b) 
#define IN(v, lo, hi) ((lo)<=(v) && (v)<(hi))
#define DD(v) cout<<#v<<": "<<v<<endl
#define FI first
#define SE second
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const map<T0, T1>& v) { for( typename map<T0, T1>::const_iterator p = v.begin(); p!=v.end(); p++ ){os << p->first << ": " << p->second << " ";} return os; }
template <typename T0, typename T1> std::ostream& operator<<(std::ostream& os, const pair<T0, T1>& v) { os << v.first << ": " << v.second << " "; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<T>& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << " "; } return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const set<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const deque<T>& v) { vector<T> tmp(v.begin(), v.end()); os << tmp; return os; }
template <typename T> std::ostream& operator<<(std::ostream& os, const vector<vector<T> >& v) { for( int i = 0; i < (int)v.size(); i++ ) { os << v[i] << endl; } return os; }
template<typename T>void maxUpdate(T& a, T b) {a = max(a, b);}
template<typename T>void minUpdate(T& a, T b) {a = min(a, b);}
string YN(bool v) { return v ? "Yes":"No"; }
void uniq(VI& es) { sort(ALL(es)); es.erase(unique(ALL(es)), es.end()); }

#define INF (1LL<<60)

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	string s,t;
	while(cin>>s>>t) {
		string ans;
		if(s.size()>t.size()) ans="GREATER";
		else if(s.size()<t.size()) ans="LESS";
		else {
			ans="EQUAL";
			REP(i, s.size()) {
				if(s[i]>t[i]) {ans="GREATER";break;}
				else if(s[i]<t[i]) {ans="LESS";break;}
			}
		}
		cout<<ans<<endl;
	}
	
	return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG //test only

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

// macro
#define rep(i,n) for(i=0;i<n;i++)
#define ll long long
#define all(v) v.begin(), v.end()

// code starts
int main()
{
  int h,w;
  cin >> h >> w;
  vector<vector<int>> a(h,vector<int>(w));
  vector<vector<int>> b(h,vector<int>(w));
  int i,j,k;
  rep(i,h)rep(j,w) cin >> a[i][j];
  rep(i,h)rep(j,w) cin >> b[i][j];
  bool dp[h][w][(h+w-1)*80*2+1];
  int base = (h+w-1)*80;
  rep(i,h)rep(j,w)rep(k,(h+w-1)*80*2+1)
  {
    dp[i][j][k] = false;
  }
  dp[0][0][base+a[0][0]-b[0][0]] = true;
  dp[0][0][base+b[0][0]-a[0][0]] = true;
  rep(i,h)rep(j,w)rep(k,(h+w-1)*80*2+1)
  {
    if(dp[i][j][k])
    {
      if(j+1 < w)
      {
        dp[i][j+1][k+a[i][j+1]-b[i][j+1]] = true;
        dp[i][j+1][k+b[i][j+1]-a[i][j+1]] = true;
      }
      if(i+1 < h)
      {
        dp[i+1][j][k+a[i+1][j]-b[i+1][j]] = true;
        dp[i+1][j][k+b[i+1][j]-a[i+1][j]] = true;
      }
    }
  }
  int ans = 123456789;
  rep(k,(h+w-1)*80*2+1)
  {
    if(dp[h-1][w-1][k])
    {
      ans=min(ans,abs(k-base));
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 159360
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<list>
#include<set>
#include<string>
using namespace std;
int gcd(int a, int b) {
	int c = a % b;
	while (c != 0) {
		a = b;
		b = c;
		c = a % b;
	}
	return b;
}
struct UnionFind {
	vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

	UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
		for (int i = 0; i < N; i++) par[i] = i;
	}

	int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
		if (par[x] == x) return x;
		return par[x] = root(par[x]);
	}

	void unite(int x, int y) { // xとyの木を併合
		int rx = root(x); //xの根をrx
		int ry = root(y); //yの根をry
		if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
		par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
	}

	bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
		int rx = root(x);
		int ry = root(y);
		return rx == ry;
	}
};
typedef long long ll;

const ll M = 1000000007;

vector<ll> fac(300001); //n!(mod M)
vector<ll> ifac(300001); //k!^{M-2} (mod M)

ll mpow(ll x, ll n) {
	ll ans = 1;
	while (n != 0) {
		if (n & 1) ans = ans * x % M;
		x = x * x % M;
		n = n >> 1;
	}
	return ans;
}
ll comb(ll a, ll b) {
	if (a == 0 && b == 0)return 1;
	if (a < b || a < 0)return 0;
	ll tmp = ifac[a - b] * ifac[b] % M;
	return tmp * fac[a] % M;
}

int main() {
	int x;
	cin >> x;
	if (x < 1200)
		cout << "ABC" << endl;
	else
		cout << "ARC" << endl;
}

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

int main()
{
  const int bus_stop[] = { 0, 1, 2, 3, 4, 5,
                           6, 7, 8, 9 ,
                           5, 4, 3, 2, 1,
                         };
  int n;
  cin >> n;
  for (int dataset = 0; dataset<n; dataset++)
  {
    int from,to;
    cin >> from >> to;
    if ( 1 <= from && from <= 5 && to < from )
    {
      for (int i=from; i > to; i--)
      {
        cout << i << ' ' << flush;
      }
      cout << to << endl;
    }
    else
    {
      for (int i=from; bus_stop[i] != to; ( i == 14)? i=0 : i++)
      {
        cout << bus_stop[i] << ' ';
      }
      cout << to << endl;
    }
  }
}

Measured memory_bytes: 1160
main(){
	int n,u,d,h,p;
	scanf("%*d");
	for(;~scanf("%d",&n);){
		u=d=0;
		scanf("%d",&p);
		for(;--n;){
			scanf("%d",&h);
			if(h-p>u)
				u=h-p;
			if(h-p<d)
				d=h-p;
			p=h;
		}
		printf("%d %d\n",u,-d);
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;

#define EPS 1e-10

static const int COUNTER_CLOCKWISE = 1;
static const int CLOCKWISE = -1;
static const int ONLINE_BACK = 2;
static const int ONLINE_FRONT = -2;
static const int ON_SEGMENT = 0;

typedef double Type;

int sign(Type x)
{
    return x<-EPS?-1:(x>EPS?1:0);
}

struct Point
{
    Type x,y;
    Point(Type x,Type y):x(x),y(y) {}
    Point() {}
    void read()
    {
        scanf("%lf %lf",&x,&y);
    }
    bool operator==(const Point& p) const
    {
        return sign(x-p.x)==0&&sign(y-p.y)==0;
    }
    Point operator-(const Point& p) const
    {
        return Point(x-p.x,y-p.y);
    }
    Point operator*(const Type t) const
    {
        return Point(t*x,t*y);
    }
    Point operator+(const Point & p) const
    {
        return Point(x+p.x,y+p.y);
    }
    bool operator<(const Point& p) const
    {
        return sign(x-p.x)==0?sign(y-p.y)<0:sign(x-p.x)<0;
    }
};

ostream& operator<<(ostream& out,Point p)
{
    out<<p.x<<" "<<p.y;
    return out;
}

typedef Point Vector;

struct Line
{
    Point a,b;
    Line() {}
    Line(Point a,Point b):a(a),b(b) {}
};

typedef Line SegMent;

//叉?
Type Cross(Vector a,Vector b)
{
    return a.x*b.y-a.y*b.x;
}

//点?
Type Dot(Vector a,Vector b)
{
    return a.x*b.x+a.y*b.y;
}

//?度
Type Length(Vector v)
{
    return sqrt(v.x*v.x+v.y*v.y);
}

int ccw(Point p0,Point p1,Point p2)
{
    Vector a=p1-p0;
    Vector b=p2-p0;
    if(Cross(a,b)>EPS)
        return COUNTER_CLOCKWISE;
    if(Cross(b,a)>EPS)
        return CLOCKWISE;
    if(Dot(a,b)<-EPS)
        return ONLINE_BACK;
    if(Length(a)<Length(b))
        return ONLINE_FRONT;
    if(Length(a)>Length(b))
        return ON_SEGMENT;
}

bool intersect(SegMent s1,SegMent s2)
{
    if(ccw(s1.a,s1.b,s2.a)*ccw(s1.a,s1.b,s2.b)<=0 && ccw(s2.a,s2.b,s1.a)*ccw(s2.a,s2.b,s1.b)<=0)
        return true;
    return false;
}

int main()
{
    int q;
    scanf("%d",&q);
    while(q--)
    {
        SegMent s1,s2;
        s1.a.read();
        s1.b.read();
        s2.a.read();
        s2.b.read();
        if(intersect(s1,s2))
            puts("1");
        else
            puts("0");
    }
    return 0;
}

Measured memory_bytes: 3212
import java.util.*;
import java.lang.*;


public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] a = new int[m];
		int[] b = new int[m];
		int[] city = new int[n];
		for (int i = 0; i < m; i++) {
			a[i] = sc.nextInt();
			b[i] = sc.nextInt();
			city[a[i] - 1]++;
			city[b[i] - 1]++;
		}
		for (int i = 0; i < n; i++) {
			System.out.println(city[i]);
		}
	}
}

Measured memory_bytes: 21844
#include<stdio.h>
#include<string.h>

int main(void)
{
    int n,i,j;
    int taro=0;
    int hana=0;
    char t[101],h[101];
 
    scanf("%d",&n);
    for(i=0;i<n;i++)
    {
        scanf("%s %s",&t,&h);
        j=strcmp(t,h);

        if(j>0)taro+=3;
        else if(j<0)hana+=3;
        else 
        {
        taro++;hana++;
        }
    }
    printf("%d %d\n",taro,hana);
    return 0;
}

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

const ll MAX = 200000;
const ll INF = 1001001001;
const ll MOD = 1000000007;
const double PI=3.1415926535897932;

ll N, ans=0, tmp=0;
vector<ll> A;
string S;

signed main(){
    cin >> N;
    for(int i=0;i<N;i++) {
        ll a;
        cin >> a;
        A.push_back(a);
        tmp += a;
    }
    for(int i=0;i<N;i++) {
        tmp -= A[i];
        ll num = tmp%MOD;
        if(num<0) num += MOD; 
        ans += A[i]*num;
        ans %= MOD;
        if(ans<0) ans += MOD; 
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5304
#![allow(non_snake_case)]
#![allow(unused_imports)]
 
use proconio::{input, fastout};
use proconio::marker::*;
use whiteread::parse_line;
use std::collections::*;

#[derive(Debug)]
struct Graph {
    maze: Vec<Vec<usize>>,
    queue: VecDeque<usize>,
    prev: Vec<i64>,
}

impl Graph {
    fn new(maze: Vec<Vec<usize>>, N: usize) -> Graph {
        Graph {
            maze: maze,
            queue: VecDeque::new(),
            prev: vec![-1; N],
        }
    }

    fn bfs(&mut self, start: usize) {
        self.prev[start] = 0;
        self.queue.push_back(start);

        while !self.queue.is_empty() {
            let next_start = self.queue.pop_front().unwrap();
            for i in self.maze[next_start as usize].iter().map(|x| *x) {
                if self.prev[i] != -1 {continue;}
                self.prev[i] = next_start as i64;
                self.queue.push_back(i);
            }
        }
    }
}

#[fastout]
fn main() {
    input!{
        N: usize,
        M: usize,
        ab: [[usize; 2]; M],
    }

    let mut maze: Vec<Vec<usize>> = vec![vec![]; N];

    for i in 0..M {
        // dbg!(&maze);
        maze[ab[i][0] - 1].push(ab[i][1] - 1);
        maze[ab[i][1] - 1].push(ab[i][0] - 1);
    }

    let mut graph = Graph::new(maze, N);
    
    graph.bfs(0);

    println!("Yes");
    println!("{}", graph.prev[1..N].iter().map(|x| (x+1).to_string()).collect::<Vec<String>>().join("\n"))
}


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

int main() {
	ios::sync_with_stdio(0), cin.tie(0);
	string s; cin >> s;
	if (s.find('7') != -1)
		cout << "Yes" << endl;
	else cout << "No" << endl;
}


Measured memory_bytes: 3612
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef vector<ll> vec;
typedef vector<vec> vec2;
typedef map<ll,ll> MPll;
typedef set<ll> setl;

const ll INF = 1ll << 60;
const ld EPS = 1e-10;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};

//for文
#define FOR(i,a,b) for(ll i = (ll)a;i < (ll)b;i++)
#define FORE(i,a,b) for(ll i = (ll) a;i <= (ll) b;i++ )
#define REP(i,size_of_array)  for(ll i =(ll)0;i<size_of_array;i++)
#define REPE(i,size_of_array)  for(ll i =(ll)0;i<=size_of_array;i++)
#define REPR(i,size_of_array)  for(ll i =(ll)size_of_array;i>=0;i--)
#define FOREACH(it, vec) for (auto it = vec.begin(); it != vec.end(); it++)

//ソート
#define ALL(vec) (vec).begin(),(vec).end()
#define SORT(vec) sort(ALL(vec))
#define SORTA(arr) sort(arr,arr + (sizeof(arr) / sizeof(ll)))
#define INVSORT(vec) sort((vec).rbegin(),(vec).rend())
#define REV(vec) reverse(ALL(vec))
#define REVA(arr) reverse(arr,arr + (sizeof(arr) / sizeof(ll)))
#define INVSORTA(arr) sort(arr,arr + (sizeof(arr) / sizeof(ll))),REVA(arr)

//最大値最小値
#define MAX(vec) *max_element(ALL(vec))
#define UNIQ(vec) SORT(vec);vec.erase(unique(ALL(vec)),vec.end())
#define MIN(vec) *min_element(ALL(vec))

//出力
#define printl(a) cout << a << "\n"
#define print(a) cout << a
#define OUT(a) printf("%lld",a)
#define OUTA(array) REP(i,sizeof(array)/sizeof(ll)) printf("%lld\n",array[i])
#define OUTV(vec) REP(i,vec.size()) printf("%lld\n",vec[i])
#define SP printf(" ")

//入力
#define IN(x) scanf("%lld",&x)
#define INV(vec) REP(i,vec.size()) scanf("%lld",&vec[i])
#define INA(array) REP(i,sizeof(array)/sizeof(ll)) scanf("%lld",array + i)
#define INS(x) cin >> x

//型
#define P pair<ll,ll>
#define vp vector<P>
#define F first
#define S second

//その他
#define PB push_back
#define MP make_pair
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,-1,sizeof(a))
#define INFI(a) memset(a,INF,sizeof(a))
#define MEM(a,b) memset(a,(b),sizeof(a))

//関数
template<class T> inline void amax(T &a,const T &b) { if(a < b) a = b; }
template<class T> inline void amin(T &a,const T &b) { if(a > b) a = b; }

//特殊
//#define int ll

//#define DEBUG

#ifdef DEBUG
#define debug(x) cerr << #x << ":" << x<<"\n"
    #define  debugV(V) REP(i,V.size()){cerr << i << ":" << V[i]<<endl;}
    #define  debugA(A) REP(i,sizeof(A)/sizeof(ll)){cerr << i << ":" << V[i]<<endl;}
#else
#define debug(x)
#define debugV(x)
#define debugA(x)
#endif

signed main(){

    ll A;IN(A);
    ll Pi;IN(Pi);

    Pi += A*3;
    OUT(ll(Pi / 2));

}

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

int main() {
  long N, A, B;
  long t=0;
  cin >> N >> A;
  for (int i=0; i<4; i++) {
	cin >> B;
    A = min(A, B);
  }
  t=(N+A-1)/A+4;
  cout << t << endl;
  return 0;
}


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

int main() {
  int n;
  cin >> n;
  vector<int> t(n);
  int total = 0;
  for(int i=0;i<n;i++) {
    cin >> t[i];
    total += t[i];
  }
  int m;
  cin >> m;
  vector<pair<int, int>> drink(m);
  for(int i=0;i<m;i++) {
    cin >> drink[i].first >> drink[i].second;
    int time = t[drink[i].first-1];
    cout << total - time + drink[i].second << endl;
  }
}

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

const bool DEBUG = false;

int main(int argc, char const *argv[]) {
  int N;
  cin >> N;
  vector<int> L(N);
  for (int i = 0; i < N; i++) {
    cin >> L[i];
  }
  sort(L.begin(), L.end(), greater<int>());
  if (DEBUG) {
    for (int i = 0; i < N; i++) {
      cout << L[i] << ", ";
    }
  }
  if (DEBUG) cout << endl;

  int a, b, c;
  int total = 0;
  for (int i = 0; i < N; i++) {
    for (int j = (i + 1); j < N; j++) {
      int k = j + 1;
      while ((k < N) && (L[i] < L[j] + L[k])) {
        total += 1;
        k += 1;
      }
    }
  }
  cout << total << endl;

  return 0;
}

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

def kai(a):
    ans = 1
    for i in range(1,a+1):
        ans *= i
    return ans
    
for i in range(1,k+1):
    if(n-k+1<i):
        print(0)
        continue
    kusan=(kai(n-k+1))//kai(i)//kai(n-k-i+1)%mod
    haibun=(kai(k-1)//kai(k-i)//kai(i-1))%mod
    print((kusan*haibun)%mod)
    

Measured memory_bytes: 3316
#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

int main() {
	int n = ri();
	std::string s;
	std::cin >> s;
	int64_t res = 0;
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < i; j++) {
			if (s[i] == s[j]) continue;
			for (int k = 0; k < j; k++) if (j - k != i - j && s[k] != s[i] && s[k] != s[j]) res++;
		}
	}
	printf("%" PRId64 "\n", res);
	return 0;
}


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

int main(){
    int n;
    cin >> n;
    vector<int> v(n);
    bool flag = true;
    for(int i=0; i<n; i++) cin >> v[i];
    int ans = 0;
    while(flag){
        for(int i=0; i<n; i++){
            if(v[i] % 2 == 1) flag = false;
            v[i] /= 2;
        }
        ans += flag;
    }
    cout << ans << endl;
    return 0;
}

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define copy(from, to) copy(from.begin(), from.end(), back_inserter(to));
#define sort(a) sort(a.begin(), a.end())

typedef long long ll;
using namespace std;

template<class T>
void load(vector<T> &v, int n) {
  for (int i = 0; i < n; ++i) {
    T t;
    cin >> t;
    v.push_back(t);
  }
}

int main() {
  double t, x;
  cin >> t >> x;
  cout << t / x << endl;
}

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

bool dfs(vector<vector<long long> > &adj, vector<long long> &used, long long node, long long color){

    used[node] = color;
    //cout << node << " " << color << endl;
    for(auto to : adj[node]){

        //同色なら
        if(used[to] == color) return false;
        else if(used[to] == 0){
            //見訪問なら
            long long nextcolor = color + 1;
            if(nextcolor == 3) nextcolor = 1;
            if(!dfs(adj, used, to, nextcolor)) return false;
        }
    }

    return true;
}

int main(){

    long long n, m; cin >> n >> m;
    vector<vector<long long> > adj(n);
    for(long long i = 0; i < m; i++){
        long long a, b; cin >> a >> b;
        a--;
        b--;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }

    vector<long long> used(n, false);
    if(dfs(adj, used, 0, 1)){
        long long B = 0;
        long long R = 0;
        for(auto color : used){
            color == 1 ? B++ : R++;
        }

        cout << B * R - m << endl;
    }
    else cout << (n * (n - 1) / 2) - m << endl;
    return 0;
}

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

#define ll long long

using namespace std;

ll n, ans = 1e18;

int main () {
    cin >> n;
    for (int i = 1;i <= sqrt (n);i ++) {
        if (n % i == 0) {
            ans = min (ans, i - 1 + n / i - 1);
        }
    }cout << ans;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <x86intrin.h>
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define V vector
template <typename T> bool chmin(T &a, const T &b) {if(a > b){a = b; return true;} return false;}
template <typename T> bool chmax(T &a, const T &b) {if(a < b){a = b; return true;} return false;}
template<typename A, size_t N, typename T> void Fill (A (&array)[N], const T & val) {fill ((T*)array, (T*)(array+N), val);}
V<int> dx = {-1, 1,  0, 0, -1, -1,  1, 1};
V<int> dy = { 0, 0, -1, 1, -1,  1, -1, 1};

int main () {
    int x; cin >> x;
    cout << 1-x << endl;

    return 0;
}

Measured memory_bytes: 3628
#include <iostream>
using namespace std;
int main(void){
   
   int h, w, i, j;
   
   while(1){
       cin >> h >> w;
       if(h == 0 && w == 0){
           break;
       }
       else{
           for(i = 0; i < h; i++){
               for(j = 0; j < w; j++){
                   cout << "#";
               }
            cout << endl;
           }
       }
    cout << endl;
   }
}



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

int main()
{
    float a,b;
    int b2=int(b);
    cin>>b;
    if(b2&1)a=ceil(b/2)+1;
    else a=ceil(b/2);
    printf("%0.10f", a/b);
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
template <class T> T ceil(T a, T b) {
    return (a + b - 1) / b;
}
template <class T> T round(T a, T b) {
    return (a + b / 2) / b;
}
template <class T> T gcd(T a, T b) {
    return b ? gcd(b, a % b) : a;
}
template <class T> T lcm(T a, T b) {
    return a * b / gcd(a, b);
}
template <class T> bool amax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T &a, const T &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

int cnt[1005] = {};
void prime(int n) {
    int a = 2;
    while (n >= a * a) {
        if (n % a == 0) {
            cnt[a]++;
            n /= a;
        } else {
            a++;
        }
    }
    cnt[n]++;
}

// main
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    const int MOD = 1e9 + 7;
    int N;
    cin >> N;
    N++;
    FOR(i, 1, N, 1) {
        prime(i);
    }
    ll res = 1;
    FOR(i, 2, 1005, 1) {
        if (cnt[i] == 0) {
            continue;
        }
        res = res * (cnt[i] + 1) % MOD;
    }
    cout << res << endl;
    return 0;
}


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

int main()
{
    int K,N;
    int A[200000];
    int dis = 0;
    int a,b,c;

    cin >> K >> N;
    
    for(int i=0;i<N;i++){
        cin >> A[i];
    }
    
    a = 0;
    b = 0;
    c = 0;
    int x,y;
    x = 0;
    y = 0;
    for(int i=0;i<N;i++){
        if(i==0){
            a = K-A[N-1] + A[0];
            b = A[i+1]-A[i];
        }
        else if(i==N-1){
            a = A[i]-A[i-1];
            b = K - A[i] + A[0];
        }else{
            a = A[i]-A[i-1];
            b = A[i+1]-A[i];
        }
        c = abs(a-b);
        if(dis < max(a,b)){
            dis = max(a,b);
            x = a;
            y = b;
        }
    }
    
    dis = K - dis;
    
    cout << dis;
    

    
    return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;
using Graph = vector<vector<ll>>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 3.1415926535897932;
const ll INF = LLONG_MAX;
/****** define constant end ********/
/****** define variable start ******/
ll n;
vpll a;
/******* define variable end *******/
int solve() {
	cin >> n;
	a.resize(n);
	REP(i, n){
		ll tmp;
		cin >> tmp;
		a[i] = make_pair(tmp, i+1);
	}
	sort(a.begin(), a.end());
	reverse(a.begin(), a.end());
	vll dp(n+1, vl(n+1));
	REP(i, n+1){
		REP(j, n+1){
			dp[i][j] = -INF;
		}
	}

	dp[0][0] = 0;
	REP(i, n){
		REP(j, n){
			dp[i+1][j+1] = max(dp[i+1][j+1], dp[i][j] + a[i].first * abs(n - j - a[i].second));
			dp[i+1][j] = max(dp[i+1][j], dp[i][j] + a[i].first * abs(1 + (i-j) - a[i].second));
		}
	}
	ll ans = 0;
	REP(i, n+1){
		ans = max(ans, dp[n][i]);
	}
	cout << ans << endl;
	return 0;
}

int main() {
	// clock_t start = clock();
	cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int end_solve = solve();
	/*
	clock_t end = clock();
	const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
	1000.0; printf("time %lf[ms]\n", time);
	*/

	return end_solve;
}


Measured memory_bytes: 34612
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };

struct UnionFind {
	vector<int> v;
	UnionFind(int n) : v(n)  { for (int i = 0; i < n; i++) v[i] = i; }
	int  find(int x)         { return v[x] == x ? x : v[x] = find(v[x]); }
	void unite(int x, int y) { v[find(x)] = find(y); }
};

int main() {
	int n;
	cin >> n;
	string s;
	REP(i, n) {
		int a;
		cin >> a;
		s += to_string(a);
	}
	REP(i,100000) {
		if (s.find(to_string(i)) == string::npos) {
			cout << i << endl;
			break;
		}
	}
}

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

int descending_compare(const void *a, const void *b){
    if (*(int*)a > *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}

int ascending_compare(const void *a, const void *b){
    if (*(int*)a < *(int*)b){
        return -1;
    }else if (*(int*)a == *(int*)b){
        return 0;
    }else{
        return 1;
    }
}


int lower_bound(int *a, int n, int key){
    int left, mid, right;
    left = 0, right = n;
    mid = (left + right)/2;
    while ((left+1 != mid || mid+1 != right) && mid != left){
        if (key > a[mid]){
            left = mid;
        }else{
            right = mid+1;
        }
        mid = (left + right)/2;
    }
    if (a[left] >= key)return left;
    if (a[mid] >= key)return mid;
    if (a[right] >= key)return right;
    return n;
}

//greatest common divisor
unsigned long  gcd(unsigned long x, unsigned long y){
    if (y == 0){ 
        return x;
    }else if (x > y){
        return gcd(y, x % y);
    }else{
        return gcd(x, y % x);
    }
}



long long factorial(int x){
    long long rtn = 1;
    int i;
    for (i = x; i > 1; i--){
        rtn = (rtn*i);
    }
    return rtn;
}
int edge[15][15] = {0};
int v[15] = {0};
int cnt = 0;
int n, m;

int dfs(int now){
    int flag = 1;
    for (int i = 1; i <= n; i++){
        if (v[i] != 1){
            flag = 0;
        }
    }
    if (flag == 1){
        cnt++;
        return 0;
    }
    for (int i = 1; i <= n; i++){
        if (edge[now][i] == 1 && v[i] != 1){
            v[i] = 1;
            dfs(i);
            v[i] = 0;
        }
    }
    return 0;
}
int dp[401][401] = {0};
int a[40];
int b[40];
int c[40];



int main(void){
    int n, ma, mb;
    int min = 1000000000;
    scanf("%d %d %d", &n, &ma, &mb);
    for (int i = 0; i < n; i++){
        scanf("%d %d %d", &a[i], &b[i], &c[i]);
    }
    dp[0][0] = 1;
    for (int k = 0; k < n; k++){
        for (int i = 400; i >= 0; i--){
            for (int j = 400; j >= 0; j--){
                if (i-a[k] > -1 && j-b[k] > -1 && dp[i-a[k]][j-b[k]] > 0){
                    if (dp[i][j] == 0 ||  c[k] + dp[i-a[k]][j-b[k]] < dp[i][j]){
                        dp[i][j] = c[k] + dp[i-a[k]][j-b[k]];
                    }
                }
            }
        }
    }
    for (int i = 1; i < 401; i++){
        for (int j = 1; j < 401; j++){
            if (dp[i][j] > 0 && i * mb == j * ma){
                if (dp[i][j] < min){
                    min = dp[i][j];
                }
            }
        }
    }
    if (min == 1000000000){
        printf("-1\n");
        return 0;
    }
    printf("%d\n", min-1);



    return 0;

}


Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>

using namespace std;

int main(){
   int n,a;
   cin>>n>>a;
   if(n%500<=a)cout<<"Yes"<<endl;
   else cout<<"No"<<endl;

   
   
}

Measured memory_bytes: 888
#include<bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
int dx[]={1,-1,1,-1,1,-1,0,0};
int dy[]={0,0,1,1,-1,-1,1,-1};
int main(){
    int w,h,a[101][101]={},ans=0;
    map<char,int>m;
    m['x']=8;
    m['o']=2;
    cin>>h>>w;
    string s[h];
    r(i,h)cin>>s[i];
    r(i,h)r(j,w)
        if(s[i][j]!='-'){
            a[i][j]=1;
            r(k,m[s[i][j]]){
                int y=i+dy[k];
                int x=j+dx[k];
                if(y<0||y>=h||x<0||x>=w)continue;
                a[y][x]=1;
            }
        }
    r(i,h)r(j,w)if(i&&!a[i][j])ans++;
    cout<<ans<<endl;
}

Measured memory_bytes: 3244
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cstdlib>
using namespace std;
#define N 5050
#define mod 1000000007
typedef long long ll;
int head[N],to[N<<1],nxt[N<<1],cnt,n,siz[N];
ll f[N][N],tmp[N],g[N];
inline void add(int u,int v) {
	to[++cnt]=v; nxt[cnt]=head[u]; head[u]=cnt;
}
void upd(ll &x,ll y) {
	x=x+y; if(x>=mod) x-=mod;
}
void dfs(int x,int y) {
	int i,j,k;
	siz[x]=1; f[x][1]=1;
	for(i=head[x];i;i=nxt[i]) {
		if(to[i]!=y) {
			dfs(to[i],x);
			for(j=0;j<=siz[x];j++) tmp[j]=f[x][j],f[x][j]=0;
			for(j=0;j<=siz[x];j++) {
				for(k=0;k<=siz[to[i]];k++) {
					upd(f[x][j+k],tmp[j]*f[to[i]][k]%mod);
				}
			}
			siz[x]+=siz[to[i]];
		}
	}
	for(k=siz[x];k>=1;k--) {
		if(k%2==0) {
			upd(f[x][0],(mod-1)*f[x][k]%mod*g[k>>1]%mod);
		}
	}
}
int main() {
	scanf("%d",&n);
	int i,x,y;
	for(i=1;i<n;i++) {
		scanf("%d%d",&x,&y); add(x,y); add(y,x);
	}
	for(g[0]=1,i=1;i<=n/2;i++) {
		g[i]=(2*i-1)*g[i-1]%mod;
	}
	dfs(1,0);
	printf("%lld\n",(mod-1)*f[1][0]%mod);
}

Measured memory_bytes: 198400
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.*;
public class Main {
    public static void main(String[]args) {
        FastScanner sc=new FastScanner();
        System.out.println(sc.nextInt()*2*Math.PI);
    }
}

//高速入力コピペ
class FastScanner {
    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 (Exception 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;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    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();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}


Measured memory_bytes: 33220
import copy
h,w,K=map(int,input().split())
c=[list(input()) for i in range(h)]
b=[]
for i in range(2**(h+w)):
  b.append(format(i,'0'+str(h+w)+'b'))
ans=0
for i in range(len(b)):
  l=copy.deepcopy(c)
  for j in range(h+w):
    if j<h:
      if b[i][j]=='1':
        for k in range(w):
          l[j][k]='x'
    else:
      if b[i][j]=='1':
        for k in range(h):
          l[k][j-h]='x'
  ct=0
  for j in range(h):
    for k in range(w):
      if l[j][k]=='#':
        ct+=1
  if ct==K:
    ans+=1
print(ans)

Measured memory_bytes: 72384
#include <cstdio>
#include <vector>
static const int MAXN = 100005;

int n;
std::vector<int> e[MAXN];

int f[MAXN];

void dfs(int u, int p = -1)
{
    f[u] = 0;
    for (int v : e[u]) if (v != p) {
        dfs(v, u);
        f[u] ^= (f[v] + 1);
    }
}

int main()
{
    scanf("%d", &n);
    for (int i = 0, u, v; i < n - 1; ++i) {
        scanf("%d%d", &u, &v); --u, --v;
        e[u].push_back(v);
        e[v].push_back(u);
    }

    dfs(0);
    puts(f[0] == 0 ? "Bob" : "Alice");

    return 0;
}


Measured memory_bytes: 12288
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<iomanip>
#include<cmath>


#define REP(i,n) for (int i = 0; (i) < (n); ++ (i))
#define FOR(i,n) for (int i = 1; (i) <= (n); ++ (i))
#define dump(x)  cout << #x << " = " << (x) << endl;
#define pb push_back
#define int long long
//#define lint long long

const int INF = 1e18;
const int MOD = 1e9+7;
//const lint LINF = 1e18;
const double eps = 0.000000001;//もとの値の10^(-16)まで

using namespace std;

//typedef pair<int, int> P;
//priority_queue< P, vector<P>, greater<P> > q;//ダイクストラの時、greaterで小さい順

signed main(){
  int a,b;
  cin >> a >> b;
  cout << max((int)0, a-b-b) << endl;
  return 0;
}


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

using namespace std;

int main() {
  long long q, h, s, d;
  cin >> q >> h >> s >> d;
  
  long long n;
  cin >> n;
  
  long long f = min(h, q * 2);
  long long one = min(s, f * 2);
  long long two = min(d, one * 2);
  
  long long n_two = n / 2;
  long long ans = n % 2 == 0? n_two * two: n_two * two + one;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#define mod 1000000007
typedef long long int lli;
using namespace std;
bool pal(string s,lli start,lli end)
{
	bool flag=true;
	for(lli i=0;i<end-start+1;i++)
	{
//		cout<<s[start + i]<<" "<<s[end - i-1]<<endl;
		if((s[start + i] == '\0') || (s[end - i-1] == '\0'))
			continue;
		if(s[start + i] == s[end - i - 1])
			continue;
		else
		{
			flag=false;
			break;
		}
	}
	return flag;
}
int main()
{
	ios_base::sync_with_stdio(false); 
	std::cin.tie(NULL);
	std::cout.tie(NULL);
	string s;
	bool f1,f2,f3;
	getline(cin,s); 
	lli len=s.length();
	f1 = pal(s,0,len);
	f2 = pal(s,0,(len-1)/2);
	f3 = pal(s,(((len+3)/2)-1),len);
	if(f1 && f2 && f3)
	{
		cout<<"Yes"<<endl;
	}
	else
		cout<<"No"<<endl;
	return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<queue>
#include<climits>
#include<cmath>
#include<sstream>
#include<iomanip>
#include <map>
#include <stack>
 
const int cc = pow( 10, 9 );
 
bool sort_pair( std::pair< char, int > origin, std::pair< char, int > another )
{
    return origin.first < another.first;
}
 
int main()
{
    int a,b,c,d;
    std::cin>> a;
    std::cin>> b;
    std::cin>> c;
 
    std::vector< std::pair< int64_t, int64_t > > list;
    d = 1;

   if( c == cc )
   {
       d = -1;
   }

    for( int64_t i = 0; i < a; i++ )
    {
        if( i < b )
        {
            std::cout<< c;
        }
        else
        {
            std::cout<< c + d;
        }
        
        std::cout<< " ";
    }
}


Measured memory_bytes: 1280
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.stream.Stream;
import java.util.Collection;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.util.ArrayList;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BKagamiMochi solver = new BKagamiMochi();
        solver.solve(1, in, out);
        out.close();
    }

    static class BKagamiMochi {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            int n = in.nextInt();
            ArrayList<Integer> dList = new ArrayList<>();
            while (in.hasNext()) {
                dList.add(in.nextInt());
            }
            out.println((int) dList.stream().distinct().count());
        }

    }

    static class Scanner {
        private final InputStream in;
        private final byte[] buffer;
        private int ptr;
        private int buflen;

        public Scanner(InputStream in) {
            this.in = in;
            this.buffer = new byte[1024];
            this.ptr = 0;
            this.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 byte readByte() {
            if (hasNextByte()) return buffer[ptr++];
            return -1;
        }

        private boolean isPrintableChar(byte c) {
            return '!' <= c && c <= '~';
        }

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

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

        public int nextInt() {
            if (!hasNext()) throw new NoSuchElementException();
            int n = 0;
            boolean minus = false;
            byte 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: 26580
#include <bits/stdc++.h>
using namespace std ;

#define co(x) cout << x << endl ;

int main ()
{
    int num1 , num2 , maxm , sum = 0 , cro = 1 , mai = 0 ;

    cin >> num1 >> num2 ;

    sum = num1 + num2 ;
    cro = num1 * num2 ;
    mai = num1 - num2 ;
    maxm = max ({sum , cro , mai}) ;

    if (maxm == sum)
    {
        co (sum)
    }
    else if (maxm == cro )
    {
        co (cro)
    }
    else if (maxm == mai )
    {
        co (mai)
    }

    return 0 ;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <limits>
#include <vector>
#include <map>
#include <cmath>
#include <limits>
#define ll long long int
#define rep(i,n) for(int i = 0;i < n;i++)
#define pb push_back
#define mp make_pair

using namespace std;

int main(){
    
    int h,w;
    cin >> h >> w;
    ll MOD = 1e9 + 7;
    ll dp[h][w];
    rep(i,h)
        rep(j,w)
            dp[i][j] = 0;
    dp[0][0] = 1;
    vector<string> a(h);
    rep(i,h) cin >> a[i];

    for(int i = 0;i < h;i++){
        for(int j = 0;j < w;j++){
            if(i == 0&&j == 0){
                continue;
            }
            else if(i == 0){
                if(a[i][j] == '.'){
                    dp[i][j] += dp[i][j-1];
                    dp[i][j] = (dp[i][j]+MOD)%MOD;
                }
                else{
                    dp[i][j] = 0;
                }
            }
            else if(j == 0){
                if(a[i][j] == '.'){
                    dp[i][j] += dp[i-1][j];
                    dp[i][j] = (dp[i][j]+MOD)%MOD;
                }
                else{
                    dp[i][j] = 0;
                }
            }
            else{
                if(a[i][j] == '.'){
                    dp[i][j] += (dp[i-1][j] + dp[i][j-1]);
                    dp[i][j] = (dp[i][j]+MOD)%MOD;
                }
                else{
                    dp[i][j] = 0;
                }
            }
        }
    }
    /*rep(i,h){
        rep(j,w){
            cout << dp[i][j] << " ";
        }
        cout << endl;
    }*/

    cout << dp[h-1][w-1]%MOD << endl;
    
    return 0;
}

Measured memory_bytes: 9088
/*
title:

url:
*/

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <functional>
#include <queue>
#include <limits>
#include <string>
#include <utility>
#include <cstring>
#include <map>
#include <cmath>
#include <iterator>

using namespace std;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define INF 1000000007

typedef pair<int, int> pint;
typedef long long ll;

int main()
{
    string a, b;
    cin >> a >> b;
    if (a > b)
    {
        cout << ">" << endl;
    }
    else if (a < b)
    {
        cout << "<" << endl;
    }
    else
    {
        cout << "=" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

std::vector<bool> IsPrime;

void sieve(size_t max){
    if(max+1 > IsPrime.size()){     // resizeで要素数が減らないように
        IsPrime.resize(max+1,true); // IsPrimeに必要な要素数を確保
    } 
    IsPrime[0] = false; // 0は素数ではない
    IsPrime[1] = false; // 1は素数ではない

    for(size_t i=2; i*i<=max; ++i) // 0からsqrt(max)まで調べる
        if(IsPrime[i]) // iが素数ならば
            for(size_t j=2; i*j<=max; ++j) // (max以下の)iの倍数は
                IsPrime[i*j] = false;      // 素数ではない
} 

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
 
    ll n, P; cin >> n >> P;
    if(n == 1LL){
        cout << P << endl;
        return 0;
    }

    int m = (int)sqrt(P) + 12;
    sieve(m);

    ll res = 1LL;
    rep(i, 2, m){
        if(not IsPrime[i]) continue;

        int cnt = 0;
        ll Q = P;
        while(Q % (ll)i == 0LL){
            Q /= (ll)i;
            cnt++;
        }
        int num = (ll)cnt / n;
        if(num > 0) res *= pow(i, num);
        // cerr << res << endl;
    }

    cout << res << endl;
    
    return 0;
}

Measured memory_bytes: 384
#include <iostream>
#include <cmath>

using namespace std;

int main(){
    int n, t, a;
    cin >> n >> t >> a;
    double min_diff;
    int res;
    {
        int h1;
        cin >> h1;
        min_diff=abs(a-(t-h1*0.006));
        res=0;
    }
    for(int i=1; i<n; ++i){
        int h;
        cin >> h;
        double d=abs(a-(t-h*0.006));
        if(d<min_diff){
            min_diff=d;
            res=i;
        }
    }
    cout << res+1 << 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++)
#define all(v) (v).begin(),(v).end()
using ll = long long;
using P = pair<int, int>;
const int MOD = 1e9+7;

int main(){
    int n;
    cin >> n;
    ll ans = 1;
    for (int i=1; i<=n; i++) {
        ans *= i;
        ans %= MOD;
    }
    cout << ans << endl;
    return 0;
}

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

int main(){
	while (true) {
		int x,y,s;
		cin>>x>>y>>s;

		if(x==0&&y==0&&s==0) break;

		int tmax=-1;

		for (int a=1;a<=s-1;a++){
			int ax=a*(100+x)/100;
			int ay=a*(100+y)/100;

			for(int b=1;b<=s-1;b++){
				int bx =b*(100+x)/100;
				int by =b*(100+y)/100;

				if(ax+bx==s){
					tmax=max(tmax,ay+by);
				}
				else if(ax+bx>s){
					break;
				}
			}
		}
		cout<<tmax<<endl;
	}
	return 0;
}



Measured memory_bytes: 3064