akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC087A
{
    class Program
    {
        static void Main(string[] args)
        {

            int x, a, b, c;

            x = int.Parse(Console.ReadLine());
            a = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());

            c = (x - a) % b;

            Console.WriteLine(c);

            Console.ReadKey();

        }
    }
}


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

#define pb push_back
#define all(a) (a).begin(), (a).end()

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

int main() {
    ios::sync_with_stdio(false);cin.tie(nullptr);
    int n; cin >> n;
    vector<int> p(n);
    for (int i = 0; i < n; ++i) cin >> p[i];
    int ans = 1, c = p[0];
    for (int i = 1; i < n; ++i) {
        c = min(c, p[i]);
        if (c == p[i])
            ++ans;
    }
    cout << ans << "\n";
}

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

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

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

int main() {

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

	int n;
	cin >> n;

	vector<int> c(n), s(n), f(n);
	for (int i = 0; i < n - 1; ++i) {
		cin >> c[i] >> s[i] >> f[i];
	}

	for (int i = 0; i < n; ++i) {
		int time = s[i] + c[i];
		for (int j = i + 1; j < n - 1; ++j) {
			if (time < s[j]) {
				time = s[j];
			} else {
				if (time % f[j]) {
					time += (f[j] - time % f[j]);
				}
			}

			time += c[j];
		}

		cout << time << "\n";
	}

	return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define INF 1e9
#define llINF 1e18
#define MOD 1000000007
#define pb push_back
#define mp make_pair 
#define F first
#define S second
#define ll long long
#define ull unsigned long long
#define vi vector<ll>
#define vvi vector<vi>
#define BITLE(n) (1LL<<(n))
#define BITCNT(n) (__builtin_popcountll(n))
#define SUBS(s,f,t) ((s).substr((f)-1,(t)-(f)+1))
#define ALL(a) (a).begin(),(a).end()
using namespace std;
struct Grid{ll x,y,t;};
struct Edge{ll to,cost;};
struct Graph{vector<vector<Edge>>E;int V;
  const ll Inf = llINF;const int MAX_V=201010;vector<ll>d;
  Graph(int n):E(n){d.resize(MAX_V);E.resize(n);V=n;}
  void init(){for(int i=0;i<MAX_V;i++)d[i]=Inf;}
  void add_edge(ll from,ll to,ll cost){E[from].pb({to,cost});}
};
ll rui[222222];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n;cin>>n;
  vector<pair<ll,ll>>pll(n);
  set<ll>se;
  map<ll,ll>MP;
  for(int i=0;i<n;i++){
    cin>>pll[i].F>>pll[i].S;
    se.insert(pll[i].F);
    se.insert(pll[i].S);
  }
  ll cnt=1;
  for(auto a:se){
    MP[a]=cnt;
    cnt++;
  }
  for(int i=0;i<n;i++){
    rui[MP[pll[i].F]]++;
    rui[MP[pll[i].S]]--;
  }
  ll now=0;
  ll ans=0;
  for(int i=0;i<222222;i++){
    now+=rui[i];
    ans=max(ans,now);
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 27916
#include <bits/stdc++.h>
 
const double pi = 3.141592653589793238462643383279;
 
 
using namespace std;
//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<long long, long long> PLL;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
 
 
//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
 
 
//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007
 
 
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()
 
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
const double EPS = 1E-10;
 
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)


//ここから編集

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int N, K; cin >> N >> K;

  vector<int> A(N+1);
  REP(i,N) cin >> A[i];

  for(int i=0; i<K; i++){
    vector<int> B(N+1, 0);

    for(int j=0; j<N; j++){
      B[max(0, j-A[j])]++;
      B[min(N+1, j+A[j]+1)]--;
    }

    for(int j=0; j<=N; j++){
      B[j+1] += B[j];
      A[j] = B[j];
    }
    bool f = true;
    for(int j=0; j<N; j++){
      if(A[j] != N) f = false;
    }
    if(f) break;
  }
  for(int i=0; i<N; i++){
    if(i) cout << " ";
    cout << A[i];
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 4824
#include <stdio.h>

int main()
{
    int n;
    long p;
    scanf("%d", &n);
    p = 1;
    for (int i=1; i<=n; i++) {
        p = (p * i) % (1000000000 + 7);
    }
    printf("%ld\n", p);

    return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
int n, k, h[100005];
long long dp[100005];
int main(){
	scanf("%d%d", &n, &k);
	for (int i=1;i<=n;i++){
		scanf("%d", &h[i]);
	}
	
	h[0] = 0;
	dp[0] = 0;	dp[1] = 0;
	for (int i=2;i<=n;i++){
		dp[i] = -1;
		
		for (int j=1;j<=k && j<i;j++){
			if (dp[i-j] + abs(h[i]-h[i-j]) < dp[i] || dp[i] == -1){
				dp[i] = dp[i-j] + abs(h[i]-h[i-j]);
			}
		}
	}
	
	printf("%lld\n", dp[n]);
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
#define mk make_pair
#define fs first
#define sc second
using namespace std;
typedef long long ll;
typedef long double ld;
int a[100010];
int main(){
  ll n, k;
  while(cin>>n>>k){
    ll ans=0, cnt=0;
    ll cnt1=0, cnt2=0;
    if(k==2){
        cnt1=n/2;
        cnt2=n-cnt1;
        ans=cnt1*(cnt1)*(cnt1);
        ans+=cnt2*(cnt2)*(cnt2);
//        ans+=cnt2*(cnt2-1)*(cnt2-2);
//        ans+=cnt1*(cnt1-1)*3;
//        ans+=cnt1;
//        ans+=cnt2*(cnt2-1)*3;
//        ans+=cnt2;
        cout<<ans<<endl;
        continue;
    }
    for(ll i=1; i<=n; ++i){
        if(i%k==0)
            ++cnt1;
        else if((i*2)%k==0)
            ++cnt2;
    }
    ans=(cnt1)*(cnt1)*(cnt1);
    ans+=(cnt2)*(cnt2)*(cnt2);
//    ans+=cnt1*cnt2*cnt2*3;
    cout<<ans<<endl;
  }
  return 0;
}




Measured memory_bytes: 256
#include<iostream>
using namespace std;
typedef long long ll;
ll A[100005];

int main(){
  ll n,k; cin >> n >> k;
  for(int i=0;i<n;i++){
    ll a,b; cin >> a >> b;
    A[a] += b;
  }
  ll sum = 0;
  int j = 0;
  while(sum<k){
    j++;
    sum += A[j];
  }
  cout << j << endl;
  return 0;
}
  

Measured memory_bytes: 1024
#include <iostream>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <climits>
#include <tuple>
#include <queue>
//#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define MT make_tuple
 

vector<int> m,M,br; 

int MOD = 1e9 + 7;
 
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0); 
	int n, m;

	cin >> n;
	vector<int> v(n);
	for (auto &i: v){
		cin >> i;
	}

	sort(v.begin(), v.end());
	int c = 0, sol = 0;
	for (int i = 0; i < n; i++){
		//cout << v[i]<<endl;
		for (int j = i + 1 ; j < n; j++){
			for (int z = j + 1;z < n; z++){
				if (v[i] != v[j] && v[i] != v[z] && v[j] != v[z]){
					if (v[i] + v[j] > v[z]){
						sol ++;
					}
				}
			}
		}
	}
	cout << sol<<endl;
    return 0;
}

Measured memory_bytes: 3196
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <iomanip>
#include <map>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())

//const int MOD = 1000000007;
//const int INF = 1<<30;
using namespace std;

string yn(bool x){
    return x ? "Yes" : "No";
}

int digitSum(int x){
    int sum = 0;
    while(x>0){
        sum += x%10;
        x /=10;
    }
    return sum;
}

int main(){
    int n; cin >> n;
    int sn = digitSum(n);
    
    bool ans = 0;
    if(n%sn == 0) ans = true;
    
    cout << yn(ans) << endl;
}







Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=998244353 ;

        
    
int main(){
  int n; cin >> n; ll a[n];
  rep(i, n) cin >> a[i];
  vector<ll> ki, gu;
  ll kiki=0, gugu=0;
  rep(i, n){
    if(i%2 && a[i]>0){
      ki.push_back(i); kiki+=a[i];
    }
    if(i%2==0 && a[i]>0){
      gu.push_back(i); gugu+=a[i];
    }
  }
  int last = n;
  if(gugu>kiki){
    swap(kiki, gugu); swap(ki, gu);
  }
  vector<int> ans;
  if(kiki==0 && gugu==0){
    ll ma = -longinf; int mai;
    rep(i, n){
      if(a[i]>ma){
        ma=a[i]; mai=i;
      }
    }
    cout << ma << endl;
    cout << n-1 << endl;
    for(int i=n; i>mai+1; i--){
      cout << i << endl;
    }
    for(int i=1; i<=mai; i++){
      cout << 1 << endl;
    }
    return 0;
  }
  if(kiki>=gugu){
    cout << kiki << endl;
    int last = ki[ki.size()-1]+1; int now = n;
    for(int i=now; i>last; i--){
      ans.push_back(i);
    }
    for(int i=1; i<=ki[0]; i++){
      ans.push_back(1);
    }
    rep(i, ki.size()-1){
      for(int j=(ki[i+1]-ki[i])/2; j>0; j--){
        ans.push_back(j+1);
      }
    }
  }
  cout << ans.size() << endl;
  for(auto k: ans){
    cout << k << endl;
  }
}


Measured memory_bytes: 3612
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
int main() {
    int n, a; cin >> n >> a;
    n %= 500;
    if (a >= n) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    
}



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

int N;

void dfs(string s, char mx){
    if(s.length()==N){
        cout << s << endl;
    } else {
        for (char i = 'a'; i <= mx; i++)
        {
            if(i==mx) dfs(s+i, mx+1);
            else dfs(s+i, mx);
        }
    }
}

int main() {
    cin >> N;
    dfs("", 'a');
}

Measured memory_bytes: 1536
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

var abc [200][200]int

func main() {
	fp := os.Stdin
	if len(os.Args) > 1 {
		fp, _ = os.Open(os.Args[1])
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(os.Stdout)

	n := getNextInt(scanner)
	m := getNextInt(scanner)
	r := getNextInt(scanner)

	rr := make([]int, r)
	for i := 0; i < r; i++ {
		rr[i] = getNextInt(scanner) - 1
	}

	for ir := 0; ir < n; ir++ {
		for il := 0; il < n; il++ {
			if il == ir {
				continue
			}
			abc[il][ir] = int(1e9 + 1)
		}
	}
	for i := 0; i < m; i++ {
		a := getNextInt(scanner) - 1
		b := getNextInt(scanner) - 1
		c := getNextInt(scanner)
		abc[a][b] = c
		abc[b][a] = c
	}
	ans := solve(n, m, r, rr)

	fmt.Fprintln(writer, ans)

	writer.Flush()
}

func solve(n, m, r int, rr []int) int {
	ans := 0
	for im := 0; im < n; im++ {
		for ir := 0; ir < n; ir++ {
			for il := 0; il < n; il++ {
				if abc[il][ir] > abc[il][im]+abc[im][ir] {
					abc[il][ir] = abc[il][im] + abc[im][ir]
				}
			}
		}
	}

	ans = rec(uint64(0), r, rr)

	return ans
}

func rec(path uint64, r int, rr []int) int {
	mask := uint64(0x1f)
	ans := 0
	n := len(rr)
	if r == 0 {
		for i := 0; i < n-1; i++ {
			if ((path >> uint(5*i)) & mask) == 0 {
				continue
			}
			if ((path >> uint(5*(i+1))) & mask) == 0 {
				continue
			}
			ans += abc[rr[((path>>uint(5*i))&mask)-1]][rr[((path>>uint(5*(i+1)))&mask)-1]]
		}
		return ans
	}

	min := int(1e9 + 1)
	for i := 0; i < n; i++ {
		if ((path >> uint(5*i)) & mask) > 0 {
			continue
		}
		a := rec(path|(uint64(r)<<uint(5*i)), r-1, rr)
		if min > a {
			min = a
		}
	}
	ans = min

	return ans
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll N=2e5+5,mod=1e9+7;
ll fct[N],inv[N],invfct[N];
void init(){
    fct[0]=fct[1]=1;
	inv[1]=1;
	invfct[0]=invfct[1]=1;
	for(ll i=2;i<N;i++){
		fct[i]=i*fct[i-1]%mod;
		inv[i]=ll(mod-inv[mod%i])*(mod/i)%mod;
		invfct[i]=ll(inv[i])*invfct[i-1]%mod;
	}
}
ll ncr(ll n,ll r){
    if(n<0 || r<0 || n-r<0)return 0;
    ll ans = fct[n]*invfct[r];
    ans%=mod;
    ans = ans * invfct[n-r];
    ans%=mod;
    return ans;
}
int main(){
    ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    init();
    ll h,w,a,b;cin>>h>>w>>a>>b;
    ll ans = ncr(h+w-2,h-1);
    for(ll i=1;i<=b;i++){
        ll tmp = ncr(h-a-1 + i-1 , i-1 )*ncr(a-1+w-i,a-1);
        tmp%=mod;
        ans = ans - tmp + mod;
        ans%=mod;
    }
    cout<<ans;
}




Measured memory_bytes: 4992
#[allow(unused_imports)]
use proconio::{
    fastout, input,
    marker::{Bytes, Chars, Isize1, Usize1},
};
#[allow(unused_imports)]
use rand::prelude::*;

#[allow(unused_macros)]
macro_rules! echo {
    ($($e:expr),+) => ( { $(println!("{}", $e))+ } );
}

#[allow(unused)]
fn calc(i: usize, day: usize, s: &Vec<Vec<isize>>, c: &Vec<isize>, last: &mut Vec<usize>) -> isize {
    last[i] = day;
    let up = s[day - 1][i];
    let mut down = 0;

    for j in 0..26 {
        down += (day - last[j]) as isize * c[j];
    }

    up - down
}

fn calc_all(contests: &Vec<usize>, s: &Vec<Vec<isize>>, c: &Vec<isize>) -> isize {
    let mut last = vec![0; 26];
    let mut score = 0;

    for (day, &i) in contests.iter().enumerate() {
        score += calc(i, day + 1, s, c, &mut last);
    }

    score
}

fn main() {
    input! {
        d: usize,
        c: [isize; 26],
        s: [[isize; 26]; d],
    }

    let now = std::time::SystemTime::now();

    let mut last = vec![0; 26];
    let mut score = 0;
    let mut contests = vec![];

    // greedy
    for day in 1..=d {
        let mut max = std::isize::MIN;
        let mut best_i = 0;
        for i in 0..26 {
            let tmp = last[i];
            let score = calc(i, day, &s, &c, &mut last);
            if score > max {
                max = score;
                best_i = i;
            }
            last[i] = tmp;
        }
        score += calc(best_i, day, &s, &c, &mut last);
        last[best_i] = day;
        contests.push(best_i);
    }

    let seed = [13; 32];
    let mut rng: rand::rngs::StdRng = rand::SeedableRng::from_seed(seed);

    while std::time::SystemTime::now().duration_since(now).unwrap()
        < std::time::Duration::new(1, 900)
    {
        if rng.gen_bool(0.5) {
            let day1 = rng.gen_range(1, d);
            let day2 = rng.gen_range(day1, std::cmp::min(day1 + 16, d));
            contests.swap(day1 - 1, day2 - 1);
            let new_score = calc_all(&contests, &s, &c);

            if new_score > score {
                score = new_score;
            } else {
                contests.swap(day1 - 1, day2 - 1);
            }
        } else {
            let contest = rng.gen_range(0, 26);
            let day = rng.gen_range(1, d + 1);
            let tmp = contests[day - 1];

            contests[day - 1] = contest;
            let new_score = calc_all(&contests, &s, &c);

            if new_score > score {
                score = new_score;
            } else {
                contests[day - 1] = tmp;
            }
        }
    }

    for e in contests {
        echo!(e + 1);
    }
    // dbg!(score);
}


Measured memory_bytes: 2324
#include <bits/stdc++.h>
#define fin ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define ii pair<int,int>
#define F first
#define S second
#define pb push_back
#define pf push_front
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fore(i,a,b) for(int i = a;i < b; i+= 1)
#define forr(i,a) for(int i = a; i >= 0; i--)
#define fori(i,m) for(auto i = m.begin(); i != m.end(); i++) 
#define w(t) while(t--)
#define sz(s) int(s.size())
#define cls(a,car) memset(a,car,sizeof (a))
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ii> vii;
const int N = 1 * 1e5 + 5;
const ll mod = 1e9 + 7;
const int INF = INT_MAX;
const ll INFCAD  = ll(INT_MAX) * 2 + 1;
const double E = 1e-9;
// fflush(stdout)
// cout << flush
int main(){
    //freopen("in","r",stdin);
    //freopen("out","w",stdout);
    map<string, int> m;
    int n;
    string s;
    cin >> n;
    w(n){
        cin >> s;
        m[s]++;
    }
    int m1;
    cin >> m1;
    w(m1){
        cin >> s;
        m[s]--;
    }
    int ans = 0;
    fori(i, m)
        ans = max(ans, i->S);
    cout << ans << '\n';
    return 0;
}   

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

int main(void)
{
    int A, B, C;
    cin >> A >> B >> C;

    int K;
    cin >> K;

    string isSuc = "No";

    for (int i = 0; i < K + 1; i++)
    {
        if ((B > A) && (C > B))
        {
            isSuc = "Yes";
            break;
        }
        else if (C <= B)
        {
            C = C * 2;
        }
        else if (B <= A)
        {
            B = B * 2;
        }
    }

    cout << isSuc << "\n";
}


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

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

int main() {
    string s;cin>>s;
    int n = s.size();
    
    int a[4];
    rep(i,4)a[i]=0;
    rep(i,n){
        if(s[i]=='N')++a[0];
        if(s[i]=='S')++a[1];
        if(s[i]=='E')++a[2];
        if(s[i]=='W')++a[3];
    }
    int ans = 0;
    if(a[0] > 0 && a[1] == 0)ans=1;
    if(a[1] > 0 && a[0] == 0)ans=1;
    if(a[2] > 0 && a[3] == 0)ans=1;
    if(a[3] > 0 && a[2] == 0)ans=1;

    if(ans==1)cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
	return 0;
}

Measured memory_bytes: 3640
#include <map>
#include <set>
#include <list>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>

using namespace std;

#define INF (1 << 30)
#define INFL (1LL << 62)
#define MOD7 1000000007
#define MOD9 1000000009
#define EPS 1e-10

using ll = long long;
using ull = unsigned long long;

int main() {
    int n;
    double a, sum = 0;
    cin >> n;
    while (n--) {
        cin >> a;
        sum += 1 / a;
    }
    cout << fixed << setprecision(10);
    cout << 1 / sum << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <climits>
#include <random>
#include <iomanip>

using namespace std;
using P = pair<long, long>;

typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

#define fillInt(xs, x)        \
  for (int i = 0; i < (x); i++) \
    scanf("%d", &xs[i]);
#define fillLong(xs, x)       \
  for (int i = 0; i < (x); i++) \
    scanf("%ld", &xs[i]);
#define fillString(xs, x)       \
  for (int i = 0; i < (x); i++) \
    cin >> xs[i];
#define sortv(xs) sort(xs.begin(), xs.end())
#define sortvinv(xs) sort(xs.begin(), xs.end(), std::greater<long>())
#define lbv(xs, x) lower_bound(xs.begin(), xs.end(), x) - xs.begin()
#define ubv(xs, x) upper_bound(xs.begin(), xs.end(), x) - xs.begin()
#define bs(xs, x) binary_search(xs.begin(), xs.end(), x)
#define index_of(as, x) \
  distance(as.begin(), lower_bound(as.begin(), as.end(), x))

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

const int mod = 1000000007;

int b[1005][1005];

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

  int h, w;
  cin >> h >> w;

  int n;
  cin >> n;

  vector<int> a(n);
  fillInt(a, n);

  int hw = h*w;
  int cnt = 0;
  int j = 0;
  int go = 1;
  int c = 0;
  int cCnt = 0;

  rep(i, h) {
    rep(k, w) {
      b[i][j] = c+1;
      j+=go;
      cCnt++;
      if (cCnt == a[c]) {
        c++;
        cCnt = 0;
      }
    }
    go = -go;
    j+=go;
  }

  rep(i, h) {
    rep(j, w) {
      cout << b[i][j] << " ";
    }
    cout << endl;
  }
}


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

int main() {
    int n, q; cin >> n >> q;
    vector<int> c(n);
    for(auto& x : c) cin >> x;
    sort(begin(c), end(c));
    const int max_c = *max_element(begin(c), end(c));

    for(int i = 0; i < q; ++i) {
        int y; cin >> y;
        int ans = 0;
        for(int j = y; j <= max_c + y; j += y) {
            auto it = lower_bound(begin(c), end(c), j);
            if(it != begin(c)) {
                ans = max(ans, *prev(it) % y);
            }
        }
        cout << ans << endl;
    }
}



Measured memory_bytes: 3856
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

class Solver {
    Scanner sc = new Scanner();

    public void Solve() {
        var S = sc.next();
        var ans = Abs(753 - int.Parse(S.Substring(0, 3)));
        for (int i = 1; i <= S.Length - 3; i++) {
            ans = Min(ans, Abs(753 - int.Parse(S.Substring(i, 3))));
        }
        WriteLine(ans);
    }
}

class Scanner {
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner() {
        s = new string[0];
        i = 0;
    }

    public string next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt() {
        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0) {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong() {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0) {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble() {
        return double.Parse(next());
    }

    public double[] ArrayDouble(int N, double add = 0) {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Program {
    static void Main(string[] args) {
        Solver s = new Solver();
        s.Solve();
    }
}


Measured memory_bytes: 11220
#include <bits/stdc++.h>
#include <string.h>
#include <cmath>
#define ll long long int
#define pb push_back
#define f(i,n) for(ll i=0;i<n;i++)
#define f1(i,n) for(ll i=1;i<n;i++)
#define PI 3.14159265358979323846
double tick(){static clock_t oldt,newt=clock();double diff=1.0*(newt-oldt)/CLOCKS_PER_SEC;oldt=newt;return diff;}

using namespace std;

void solve(){
long double a,b;
cin>>a>>b;
a*=b;;
ll c=(ll)a;
cout<<c<<endl;
	//cout<<tick()<<endl;	
}

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
//	ll t;
// 	cin>>t;
// 	while(t--)
	    solve();
	return 0;
}

Measured memory_bytes: 3748
#include<bits/stdc++.h>
#include<boost/variant.hpp>
using namespace std;
typedef long long ll;
typedef vector<boost::variant<bool, ll, int, string, double, char*, const char*>> any;
template<typename T> inline void pr(const vector<T> &xs){
	for(int i=0; i<xs.size()-1; i++) cout<<xs[i]<<" ";
	(xs.empty()?cout:(cout<<xs[xs.size()-1]))<<endl;
}
template<typename T> inline void debug(const vector<T> &xs){
#ifdef DEBUG
	pr(xs);
#endif
}

int main(){
	string S;
	cin >> S;
	if(S=="Sunny") cout << "Cloudy" << endl;
	else if(S=="Cloudy") cout << "Rainy" << endl;
	else cout << "Sunny" << endl;

	return 0;
}


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

int main() {
    int N;
    cin >> N;
    vector<ll> L(87);

    L.at(0) = 2;
    L.at(1) = 1;
    for (int i = 2; i <= N; i++) {
        L.at(i) = L.at(i - 1) + L.at(i - 2);
    }

    cout << L.at(N) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>

int solve(int x);
 int m[6] = {100,101,102,103,104,105};

int main()
{
  int X;
  int ans;
 
  scanf("%d",&X);
  
  ans = solve(X);
  
  printf("%d\n",ans);
  
  return 0;
}

int solve(int x)
{
  int a = 0;
  int b;
  
  if(x == 0){
    return 1;
  }
  else if((a < x)&&(x >= 100)){
    b = (x - a)%105;
    switch(b){
    case 0:
      return solve(x - 105);
      break;
    case 104:
      return solve(x - 104);
      break;
    case 103:
      return solve(x - 103);
      break;
    case 102:
      return solve(x - 102);
      break;
    case 101:
      return solve(x - 101);
      break;
    default:
      return solve(x - 100);
    }
	
  }
  else{
    return 0;
  }

}


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

#define watch(x) cout << (#x) << " is " << (x) << endl
#define fr(i,n) for(int i=0; i<n; i++)
#define rep(i, st, en) for(int i=st; i<=en; i++)
#define repn(i, st, en) for(int i=st; i>=en; i--)
#define sq(a) (a*a)
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
ll mod = 1e9+7;


ll solve(){
    ll n, k;
    cin>>n>>k;
    ll a[n+1];
    rep(i, 1, n) cin>>a[i];

    bool vis[n+1] = {0};
    ll st = 1;
    ll sz = 0;
    ll lv = 1;  /// last visited
    while(!vis[st]){
        vis[st] = 1;
        lv = st;
        st = a[st];
        sz++;
    }

    st = 1;
    while(st != lv){
        st = a[st];
        k--;
        sz--;
        if(!k) return st;
    }
    k--;


    lv = a[lv];

    sz = 0;
    st = a[lv];
    while(st != lv){
        st = a[st];
        sz++;
    }
    sz++;

    // watch(sz);

    ll z = k%sz;

    st = lv;
    ll prev = st;
    rep(i, 1, z){
        st = a[st];
    }

    return st;
}

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

    ll t = 1;
    //  cin>>t;
    while(t--){
        cout<<solve();
    }

    return 0;
}



Measured memory_bytes: 5400
#include <cstdio>

int main() {
	char str[110][110];
	int n, m;
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; ++i)
		scanf("%s", str[i]);
	for (int i = 0; i < n; ++i)
		puts(str[i]), puts(str[i]);
	return 0;
}


Measured memory_bytes: 1656
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();

int main() {
    int n; cin >> n;
    vector<vector<ll>> e(n, vector<ll>(n, 0));
    vector<vector<bool>> bye(n, vector<bool>(n, false));
    for(int i = 0; i < n; i++) {
        for(int j = 0; j < n; j++) {
            cin >> e[i][j];
        }
    }
	// bellman-ford
    for(int k = 0; k < n; k++) {
        for(int i = 0; i < n; i++) {
            for(int j = i+1; j < n; j++) {
                if (i == k || j == k) continue;
                if (e[i][k] + e[k][j] < e[i][j]) {
                    cout << -1 << endl;
                    return 0;
                }
                if (e[i][k] + e[k][j] == e[i][j]) {
                    bye[i][j] = true;
                    // cout << "k = " << k << endl;
                    // cout << i << ", " << j << ", bye" << endl;
                }
            }
        }
    }
    ll ans = 0;
    for(int i = 0; i < n; i++) {
        for(int j = i+1; j < n; j++)
            if (bye[i][j] == false) {
                ans += e[i][j];
            }

    }
    cout << ans << endl;
    return 0;
}




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

vector<pair<ll, int>> factorize(ll n)
{
  vector<pair<ll, int>> ans;
  for (ll i = 2; i * i <= n; i++)
  {
    if (n % i != 0)
      continue;
    ans.emplace_back(i, 0);
    while (n % i == 0){
      n /= i;
      ans.back().second++;
    }
  }
  if (n != 1)
    ans.emplace_back(n, 1);
  return ans;
}

int main()
{
  ll n;
  cin >> n;
  auto prime = factorize(n);
  int ans = 0;
  for (auto p : prime)
  {
    int i = 1;
    while (p.second >= i)
    {
      ans++;
      p.second -= i;
      i++;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3584
#include<bits/stdc++.h>
#include<bitset>
#include<random>
#include<time.h>

using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(int i=st; i<ed; i++)
#define repn(i, st, ed) for(int i=st; i<=ed; i++)
#define repb(i, ed, st) for(int i=ed; i>=st; i--)

typedef long long ll;
typedef unsigned long long int llt;
typedef long double ld;

const long double PI  =3.141592653589793238463;
const int N = 5e5 + 10;
const ll INF = 1LL << 60;

template<class T> void chmax(T &a,T b) { if (a<b) a=b;}
template<class T> void chmin(T &a,T b) { if (a>b) a=b;}



// Main Code

int main()
{
  int n;
  int a;
  cin>>n>>a;
  cout<<(n*n - a)<<endl;
}


Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;

int main() {
    int n;
    ll l;
    cin >> n >> l;
    vi a(n);
    rep(i, n) {
        cin >> a[i];
    }

    int nn = -1;
    rep(i, n-1) {
        if(a[i] + a[i+1] >= l) {
            nn = i;
            break;
        }
    } 
    if(nn == -1) {
        cout << "Impossible" << endl;
        return 0;
    }

    cout << "Possible" << endl;

    rep(i, nn) {
        cout << i+1 << endl;
    }    
    int j = n-2;
    while(j != nn) {
        cout << j--+1 << endl;
    }
    cout << nn+1 << endl;
}

Measured memory_bytes: 1280
#include <iostream>
#include <cstdio>
using namespace std;
int n, b;
char a[105];
string ans = "Yes";
int main()
{
    cin>> n >> a;
    if (n%2 == 0) {
       b = n/2;
    } else {
        cout << "No";
        return 0;
    }
    for (int i=0; i<b; i++) {
        if (a[i] != a[b+i]) {
            ans = "No";
            break;
        }
    }
    cout << ans;
    return 0;
}


Measured memory_bytes: 256
class Reader:
    def __init__(self, r, c):
        self.r = r
        self.c = c
        self.buf = [0 for _ in range(c+1)]

    def __call__(self, s):
        total = 0
        for i, v in enumerate(map(int, s.split())):
            self.buf[i] += v
            total += v
        self.buf[-1] += total
        return " ".join((s, str(total)))

    def __str__(self):
        return " ".join(map(str, self.buf))

r, c = list(map(int, input().split()))
reader = Reader(r, c)

for _ in range(r):
    print(reader(input()))
print(reader)

Measured memory_bytes: 7752
#include<cstdio>
#include<iostream>
#include<algorithm>
#include<cstring>
#include<queue>
#include<vector>
#define inf 0x3f3f3f3f
using namespace std;
typedef long long LL;
const int maxn = 1e3+6;
const int mod = 1e9+7;
char G[maxn][maxn];
int dp[maxn][maxn];
bool vis[maxn][maxn];
int n,m;

struct node{
	int x,y;
};

bool check(int x, int y){
	if(G[x][y] != '#' && 0 <= x && x < n && 0 <= y && y < m) return true;
	else return false;
}

int main(){
	dp[0][0] = 1;
	scanf("%d %d",&n,&m);
	for(int i = 0; i < n; i++) scanf("%s",G[i]);
	int ans = 0;
	queue<node>q;
	q.push((node){0,0});
	while(!q.empty()){
		node now = q.front(); q.pop();
		if(check(now.x+1,now.y)){
			dp[now.x+1][now.y] += dp[now.x][now.y] % mod;
			if(!vis[now.x+1][now.y]){
				q.push((node){now.x+1,now.y});
				vis[now.x+1][now.y] = 1;
			}
		}
		if(check(now.x,now.y+1)){
			dp[now.x][now.y+1] += dp[now.x][now.y] % mod;
			if(!vis[now.x][now.y+1]){
				q.push((node){now.x,now.y+1});
				vis[now.x][now.y+1] = 1;
			}
		}
	}
	printf("%d",dp[n-1][m-1] % mod);
}

Measured memory_bytes: 6144
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <string.h>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

int main()
{
ll n;
string s,ans;
cin >> n>>s;
ll red=0;

rep(i,n){
    if(s[i]=='R')red++;
}

if(red>n-red)ans="Yes";
else ans="No";

cout << ans<< endl;
return 0;
}





Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>

#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())

using namespace std;
typedef long long ll;

int main(int argc, const char * argv[]) {
    
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n;
    cin >> n;
    
    vector<int> b(n-1);
    rep(i, n-1) cin >> b[i];
    
    int cnt = 0;
    
    rep(i, n)
    {
        if (i == 0)
        {
            cnt += b[0];
        }
        else if (i == n-1)
        {
            cnt += b[n-2];
        }
        else
        {
            cnt += min (b[i-1], b[i]);
        }
        
    }
    
    cout << cnt << endl;
    
    return 0;
}

Measured memory_bytes: 504
S=input()
A1=[]
L=len(S)
A1.append(S[0])

for i in range(1,L):
    if len(A1)>=1 and A1[-1]=="S" and S[i]=="T":
        A1.pop(-1)
    else:
        A1.append(S[i])

print(len(A1))

Measured memory_bytes: 5092
#include<iostream>
using namespace std;
int main()
{
    int n = 0;
    string s1;
    int count = 0;
    cin >> n >> s1;
    for (int i = 0; i < n; i++)
    {
        if (s1[i] == 'A')
        {
            if (i + 1 < n && s1[i+1] == 'B')
            {
                if (i + 2 < n && s1[i + 2] == 'C')
                {
                    count++;
                }
            }
        }
    }
    cout << count;
    return 0;
}

Measured memory_bytes: 256
#入力部
C= 998244353
N,M,K=map(int,input().split())

#定義部
U=max(N+1,K)
F=[0]*U
G=[0]*U

F[0]=1
for i in range(1,U):
    F[i]=(F[i-1]*i)%C

G[i]=pow(F[-1],C-2,C)

for j in range(U-2,-1,-1):
    G[j]=(G[j+1]*(j+1))%C

def nCr(n,r):
    if r<0 or n<r:
        return 0
    else:
        return (F[n]*G[r]*G[n-r])

#メイン部
S=0
for k in range(0,K+1):
    S=(S+M*pow(M-1,N-k-1,C)*nCr(N-1,k))%C
    
print(S%C)


Measured memory_bytes: 74220
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<n; ++i)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = int64_t;
using ld = long double;
using P = pair<int, int>;
using vs = vector<string>;
using vi = vector<int>;
using vvi = vector<vi>;
template<class T> using PQ = priority_queue<T>;
template<class T> using PQG = priority_queue<T, vector<T>, greater<T> >;
const int INF = 100010001;
const ll LINF = (ll)INF*INF*10;
template<typename T1, typename T2>
inline bool chmax(T1 &a, T2 b) {return a < b && (a = b, true);}
template<typename T1, typename T2>
inline bool chmin(T1 &a, T2 b) {return a > b && (a = b, true);}
template<typename T1, typename T2>
istream &operator>>(istream &is, pair<T1, T2> &p) { return is >> p.first >> p.second;}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) { return os << p.first << ' ' << p.second;}



//head

int ans;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  vi a(n);
  rep(i, n) cin >> a[i];

  rep(i, n) rep(j, i) rep(k, j) {
    int u[] = {a[i], a[j], a[k]};
    sort(u, u+3);
    if(u[0] == u[1] or u[1] == u[2]) continue;
    if(u[0] + u[1] > u[2]) ans++;
  }

  cout << ans << endl;
}

Measured memory_bytes: 3644
#include <stdio.h>
#include <string.h>
int main()
{
	int h,w,i,j;
	char c[310][300];
	scanf("%d %d",&h,&w);
	getchar();
	for(i=1;i<=h;i++){
		scanf("%s",&c[i]);
	}
	for(i=1;i<=h;i++){
			puts(c[i]);
			puts(c[i]);
	}
	return 0;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define ll long long int
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
static const ll MAX = 1000000000000000;
static const int NIL = -1;
using namespace std;
const long double EPS = 0.0000000001;
const long double PI = (acos(-1));
const int MOD = 1000000007;

int main() {
  ll n;
  ll power = 1;
  cin >> n;
  rep(i, n) power = (power * (i + 1)) % MOD;
  cout << power << endl;
}


Measured memory_bytes: 3556
N,C = map(int,input().split())

slis = [0] * (10 ** 5 + 1)
tlis = [0] * (10 ** 5 + 1)

ans = 0

cs = []
ct = []
for i in range(31):
    cs.append([0] * (10 ** 5 + 1))
    ct.append([0] * (10 ** 5 + 1))

for i in range(N):

    s,t,c = map(int,input().split())

    if ct[c][s] > 0:
        ct[c][s] -= 1
    else:
        cs[c][s] += 1

    if cs[c][t] > 0:
        cs[c][t] -= 1
    else:
        ct[c][t] += 1

for i in range(31):

    for j in range(10 ** 5 + 1):

        slis[j] += cs[i][j]
        tlis[j] += ct[i][j]

now = 0
for i in range(10 ** 5):

    i += 1
    now += slis[i]
    now -= tlis[i-1]
    ans = max(ans,now)

print (ans)


Measured memory_bytes: 55284
#include<iostream>
#include<vector>
#include<climits>
using namespace std;

long m = 1000000007;

long mul(long a, long b) {
	return ((a % m) * (b % m)) % m;
}

long pow(long a, long b) {
	if (b==0) {
		return 1;
	} else if (b==1) {
		return a % m;
	} else if (b%2==0) {
		long tmp = pow(a, b/2)%m;
		return mul(tmp, tmp)%m;
	} else {
		long tmp = pow(a, b/2)%m;
		return mul(mul(tmp, tmp), a)%m;
	}
}

long divi(long a, long b) {
	return mul(a, pow(b, m-2))%m;
}

long combi(long a, long b) {
	long big, small;
	if (b>(a-b)) {
		big = b;
		small = (a-b);
	} else {
		big = (a-b);
		small = b;
	}
	
	long child=1;
	for(long i=a; i>big; i--) {
		child = mul(child, i);
	}
	long mother=1;
	for(long i=small; i>0; i--) {
		mother = mul(mother, i);
	}
	
	return divi(child, mother);
}

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

	
	long ret;
	if(a==b) {
		ret = ((pow(2, n) - 1) - combi(n, a)) % m;	
	} else {
		ret = ((pow(2, n) - 1) - combi(n, a) - combi(n, b)) % m;
	}
	if(ret<0) ret+=m;
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
using namespace std;
int main()
{
long long n,x,min,maxn=-999999999999999;
cin>>n;
cin>>x;
min=x;
for(int i=1;i<n;i++)
{
	cin>>x;
		maxn=max(maxn,x-min);
	if(x<min)
	min=x;
}
cout<<maxn<<endl;
   return 0;
}


Measured memory_bytes: 3088
#include "bits/stdc++.h"

using namespace std;

#define rep(loop, N) for (int loop = 0; loop < N; loop++)

struct Node {
	Node* parent = NULL;
	vector<Node*> child;
	long long value = 0;
};
struct Edge {
	int parent = 0;
	int child = 0;
	bool operator <(const Edge& right) const { return parent < right.parent; }
};
struct Tree {
	vector<Node> node;
	Tree(int, vector<Edge>);
};
Tree::Tree(int nodeNum, vector<Edge> edge) {
	node.resize(nodeNum);
	for (Edge& it : edge) {
		node[it.child].parent = &node[it.parent];
		node[it.parent].child.push_back(&node[it.child]);
	}
}

map<long long, int> factorization(long long N) {
	map<long long, int> re;
	while (true) {
		if (N % 2 == 0) {
			N /= 2;
			re[2]++;
			if (N == 1) break;
		}
		else {
			break;
		}
	}
	for (int loop = 3; (long long)loop * (long long)loop <= N; loop += 2) {
		if (N % loop == 0) {
			N /= loop;
			re[loop]++;
			loop -= 2;
			if (N == 1) break;
		}
	}
	if (N > 1) re[N]++;
	return re;
}
long long gcd(long long num1, long long num2) {
	return num2 == 0 ? num1 : gcd(num2, num1 % num2);
}

struct Memo {
	long long fact = 0;
	long long fact_inv = 0;
	long long inv = 0;
};
class Combination1 {
private:
	long long m_module = 1000000007;
	vector<struct Memo> memo;
public:
	long long calculate(int, int);
	Combination1(int, long long);
};
long long Combination1::calculate(int n, int k) {
	return ((memo[n].fact * memo[k].fact_inv) % m_module * memo[n - k].fact_inv) % m_module;
}
Combination1::Combination1(int memo_max, long long module = 1000000007) {
	m_module = module;
	memo.push_back({ 1,1,0 });
	memo.push_back({ 1,1,1 });
	for (int loop = 2; loop <= memo_max; loop++) {
		struct Memo temp;
		temp.fact = (memo[loop - 1].fact * loop) % m_module;
		temp.inv = m_module - (memo[m_module % loop].inv * int(m_module / loop)) % m_module;
		temp.fact_inv = (memo[loop - 1].fact_inv * temp.inv) % m_module;
		memo.push_back(temp);
	}
}

class Combination2 {
private:
	int size = 0;
	bool add(int);
public:
	vector<int> sequence;
	bool next_combination(void);
	Combination2(int, int);
};
bool Combination2::add(int index) {
	if (index == (int)sequence.size() - 1 && sequence[index] == size - 1
		|| index < (int)sequence.size() - 1 && sequence[index] == sequence[index + 1] - 1) {
		if (index == 0) {
			return false;
		}
		else {
			bool re = add(index - 1);
			sequence[index] = sequence[index - 1] + 1;
			return re;
		}
	}
	else {
		sequence[index]++;
		return true;
	}
}
bool Combination2::next_combination(void) {
	return (sequence.size() == 0) ? false : add(sequence.size() - 1);
}
Combination2::Combination2(int n, int r) {
	size = n;
	for (int loop = 0; loop < r; loop++) sequence.push_back(loop);
	return;
}

void A_Dodecagon(void) {

	int r; cin >> r;
	cout << 3 * r * r << endl;
	return;
}

int main(void) {

	cout << fixed << setprecision(15);

	A_Dodecagon();
	return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define FOR(i,a,b) for(int i =(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define REPS(i,n) for(int i=1;i<=(n);i++)
#define RREPS(i,n) for(int i=(n);i>0;i--)
#define mp make_pair
#define pb(a) push_back(a)
typedef long long ll;

int main(){
  int N;
  cin >> N;
  vector<int> p(N+1);
  REPS(i,N) cin >> p[i];
  int ans = 0;
  REPS(i,N){
    if(p[i] == i){
      ans++;
      if(i < N) swap(p[i],p[i+1]);
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 640
s = list(input())
n = int(len(s))

s0 = list(reversed(s))
s1 = list(reversed(s[:(n-1)//2]))
s2 = list(reversed(s[(n+1)//2:]))
if s == s0 and s[:(n-1)//2] == s1 and  s[(n+1)//2:] == s2:
    print('Yes')

else:
    print('No')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define f(i,a,b) for(int i=a;i<b;i++)
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
int ketasuu(int x){
  int n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}


ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

int main(){
  int n;
  cin>>n;
  vi p(n);
  rep(i,n) cin>>p[i];
  vi m(n);
  m[0]= p[0];
  rep(i,n-1) m[i+1] =min(m[i],p[i+1]);
  int ans =1;
  rep(i,n-1) if(m[i]>p[i+1]) ans++;
  cout<<ans<<endl;
}




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

using namespace std;

int main(int argc, char *argv[]) {
  int n;
  cin >> n;
  deque<int> a;
  for (int i = 0; i < n; i++) {
    int t;
    cin >> t;
    if (i & 1) {
      a.push_front(t);
    } else {
      a.push_back(t);
    }
  }
  if (n & 1) {
    reverse(a.begin(), a.end());
  }
  for (auto x : a) {
    cout << x << " ";
  }
  return 0;
}


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

bool isin(int y, int x, int H, int W){
    if(x<0 || y<0 || x>=W || y>=H){
        return false;
    }
    return true;
}

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

    vector<vector<char> > map;

    for(int i=0;i<H;i++){
        vector<char> temp_map;
        for(int j=0;j<W;j++){
            char temp;
            cin >> temp;
            temp_map.push_back(temp);
        }
        map.push_back(temp_map);
    }

    char dx[4] = {1,-1,0,0};
    char dy[4] = {0,0,1,-1};
    bool ans = true;
    for(int y=0;y<H;y++){
        for(int x=0;x<W;x++){
            if(map[y][x]=='#'){
                bool flag = false;
                for(int k=0;k<4;k++){
                    if(isin(y+dy[k], x+dx[k], H, W) && map[y+dy[k]][x+dx[k]]=='#'){
                        flag = true;
                        break;
                    }
                }
                if(!flag){
                    ans = false;
                    y = H;
                    x = W;
                }
            }
        }
    }

    if(ans){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
    return 0;
}


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

int main() {
    ll n;cin >> n;
    ll a[n],b[n],c[n];
    rep(i,n)cin >> a[i];
    rep(i,n)cin >> b[i];
    rep(i,n)cin >> c[i];
    
    
    map<ll,ll>mp;
    rep(i,n)mp[b[i]]++;
    sort(a,a+n),
    sort(b,b+n);
    sort(c,c+n,greater<int>());
    
    ll alina = 0;
    for(auto p : mp){
        if(p.second < 1)continue;
        
        ll OK = n,NG = -1;
        while(abs(OK-NG) > 1){
            ll mid = (OK+NG)/2;
            if(a[mid] >= p.first)OK = mid;
            else NG = mid;
        }
        ll ok = n,ng = -1;
        while(abs(ok-ng) > 1){
            ll mid = (ok+ng)/2;
            if(c[mid] <= p.first)ok = mid;
            else ng = mid;
        }
        
        alina += ok*OK*p.second;
    }
    
    cout << alina << endl;
}

Measured memory_bytes: 12204
#include <bits/stdc++.h>
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define pb push_back
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;

const ll P = 1000000007;
int gcd(int a, int b) { return b != 0 ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }

int main()
{
  cout << fixed << setprecision(10);
  int A,B,C;
  cin >> A >> B >> C;
  if(A+B>=C)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 256