akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
#include <queue>
#include <cassert>
#include <numeric>
using namespace std;
typedef long long ll;
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> istream &operator>>(istream &is, vector<T> &v){ for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
    REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
    REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
//#define int ll

const int md = 1000000007;
const int INF = 1<<30;

void yesno(bool x){
    if(x) cout << "Yes" << endl;
    else cout << "No" << endl;
}

int main(){
    int n,a,b,c,d; cin >> n >> a >> b >> c >> d;
    string s; cin >> s;

    bool ans = true;
    rep(i,a-1,max(c-2,d-2)){
        if(s[i] == '#' and s[i+1] == '#') ans = false;
    }

    if(c < d){
        yesno(ans);
    }else{
        bool tmp = false;
        rep(i,b-2,d-1){
            if(s[i] == '.' and s[i+1] == '.' and s[i+2] == '.') tmp = true;
        }

        yesno(tmp and ans);
    }
}


Measured memory_bytes: 640
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int n, a[200000];
int main() {
  map<int, ll> m;
  ll ans = 0LL;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    if (m.find(i - a[i]) != m.end()) {
      ans += m[i - a[i]];
    }
    if (m.find(i + a[i]) != m.end()) {
      m[i + a[i]]++;
    } else {
      m.insert({i + a[i], 1LL});
    }
  }
  cout << ans << endl;
}

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

#define dump(...) do{print_vars(cout<<"# "<<#__VA_ARGS__<<'=',__VA_ARGS__);cout<<endl;}while(0)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define all(c) begin(c),end(c)
#define mp make_pair
#define mt make_tuple

using uint=unsigned;
using ll=long long;
using ull=unsigned long long;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vd=vector<double>;
using vvd=vector<vd>;
using vs=vector<string>;

template<typename T,typename U>bool chmin(T& a,const U& b){return a>b?(a=b,1):0;}
template<typename T,typename U>bool chmax(T& a,const U& b){return a<b?(a=b,1):0;}

void print_vars(ostream&){}
template<typename Car,typename... Cdr>
void print_vars(ostream& os,const Car& car,const Cdr&... cdr){
	print_vars(os<<car<<(sizeof...(cdr)?",":""),cdr...);
}

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}

template<int I,typename Tuple>
void print_tuple(ostream&,const Tuple&){}
template<int I,typename Car,typename... Cdr,typename Tuple>
void print_tuple(ostream& os,const Tuple& t){
	os<<get<I>(t)<<(sizeof...(Cdr)?",":"");
	print_tuple<I+1,Cdr...>(os,t);
}
template<typename... Args>
ostream& operator<<(ostream& os,const tuple<Args...>& t){
	print_tuple<0,Args...>(os<<'(',t);
	return os<<')';
}

template<typename Ch,typename Tr,typename C>
basic_ostream<Ch,Tr>& operator<<(basic_ostream<Ch,Tr>& os,const C& c){
	os<<'[';
	for(auto i=begin(c);i!=end(c);++i)
		os<<(i==begin(c)?"":" ")<<*i;
	return os<<']';
}

constexpr int INF=1e9;
constexpr int MOD=1e9+7;
constexpr double EPS=1e-9;

struct UnionFind{
	vi data;
	UnionFind(int n):data(n,-1){}
	int Find(int i){
		return data[i]<0?i:(data[i]=Find(data[i]));
	}
	bool Unite(int a,int b){
		a=Find(a),b=Find(b);
		if(a==b) return false;
		if(-data[a]<-data[b]) swap(a,b);
		data[a]+=data[b];
		data[b]=a;
		return true;
	}
	int Size(int i){
		return -data[Find(i)];
	}
};

int main()
{
	#ifndef _GLIBCXX_DEBUG
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	constexpr char endl='\n';
	#endif

	for(int n,m;cin>>n>>m&&n|m;){
		vi ps(n),xs(m),ys(m);
		rep(i,n) cin>>ps[i],ps[i]--;
		rep(i,m) cin>>xs[i]>>ys[i],xs[i]--,ys[i]--;

		UnionFind uf(n);
		rep(i,m) uf.Unite(xs[i],ys[i]);

		int res=0;
		{
			map<int,vi> f;
			rep(i,n) f[uf.Find(i)].push_back(i);
			for(auto _:f){
				const vi& is=_.second;
				vi qs;
				for(int i:is)
					qs.push_back(ps[i]);
				sort(all(qs));
				vi rs;
				set_intersection(all(qs),all(is),back_inserter(rs));
				res+=rs.size();
			}
		}
		cout<<res<<endl;
	}
}


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

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;
// const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;


template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

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 T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int64 N, M;
  cin >> N >> M;
  vector< int64 > A(N);
  cin >> A;

  int64 sum = accumulate(begin(A), end(A), 0LL);
  int64 ret = 0;
  for(auto &a : A) {
    ret += a * 4 * M >= sum;
  }
  if(ret >= M) cout << "Yes\n";
  else cout << "No\n";
}




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

const int INF = 2e9;

int main(){
    int n;
    cin >> n;
    n %= 1000;
    if(n == 0) cout << 0 << endl;
    else cout << 1000 - n << endl;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
using namespace std;
int main() {
	int n;
	cin >> n;
	int k;
	cin >> k;
	int ans = 0;
	vector <int> h(n);
	for (int i = 0; i < n; i++) {
		cin >> h[i];
		if (h[i] >= k) ans++;
	}
	cout << ans;
}

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

#define int             long long int
#define ld              long double
#define ff              first
#define ss              second
#define mp              make_pair
#define pb              push_back
#define endl            "\n"

#define si              set <int>
#define vi              vector <int>
#define pii             pair <int, int>
#define vpii            vector <pii>
#define mii             map <int, int>
#define que_max         priority_queue <int>
#define que_min         priority_queue <int, vi, greater<int>>

#define loop(i,s,e)     for(int i=s;i<e;i++)
#define rloop(i,e,s)    for(int i=e;i>=s;i--)
#define mset(a,f)       memset(a,f,sizeof(a))


#define M               1000000007
#define sz(x)           ((int) x.size())
#define all(p)          p.begin(), p.end()

#define bug(...)        __f (#__VA_ARGS__, __VA_ARGS__)
#define print(a)        for (auto x : a) cout << x << " "; cout << endl
#define Print(a,x,y)    for (int i=x; i<y; i++) cout<< a[i]<< " "; cout << endl

const int inf = INT_MAX;
const long long INF = LLONG_MAX;

inline int power(int a, int b)
{
	int x = 1;
	while (b)
	{
		if (b & 1) x *= a;
		a *= a;
		b >>= 1;
	}
	return x;
}

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
	const char* comma = strchr (names + 1, ',');
	cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

const int N = 3e5 + 7;
vector <vi > adj(N);

bool vis[N];
//0-->white
int dp[100005][2];
int n;
int go(int src, int color)
{
	vis[src] = true;
	int &ans = dp[src][color];
	if (ans != -1) return ans;
	int res1 = 1;
	for (auto x : adj[src])
	{
		if (!vis[x])
		{
			int ways = go(x, 0);


			res1 = (res1 * ways) % M;
			//vis[x] = false;

		}
	}
	int res2 = 0;
	if (color == 0)
	{
		res2 = 1;
		for (auto x : adj[src])
		{
			if (!vis[x])
			{
				int ways = go(x, 1);


				res2 = (res2 * ways) % M;

			}
		}

	}
	//bug(res1, res2);
	vis[src] = false;
	return ans = (res1 + res2) % M;
}

void solve()
{
	cin >> n;
	adj.resize(n + 1);

	loop(i, 0, n - 1)
	{
		int u, v;
		cin >> u >> v;
		adj[u].pb(v);
		adj[v].pb(u);
	}
	mset(dp, -1);
	mset(vis, false);
	cout << go(1, 0) << endl;
	/*loop(i, 1, n + 1)
	{
		loop(j, 0, 2)
		cout << dp[i][j] << " ";
		cout << endl;
	}*/

	return;

}

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

	cout << setprecision(9) << fixed;

	int t = 1;
	//cin >> t;
	while (t--)
	{
		solve();
	}


	return 0;
}


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

int main()
{
	string s;
	int k = 0;

	cin >> s;

	for (int i = 0; i < 3; i++) {
		if (s[i] == 'o') {
			k++;
		}
	}

	cout << 700 + 100 * k << endl;

	return 0;
}

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

#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }
struct SegmentTree {
	int n;
	vector<int>d, lazy;
	SegmentTree(int m) {
		for (n = 1; n < m; n <<= 1);
		d.assign(2 * n, 0);
		lazy.assign(2 * n, 0);
	}
	void eval(int k, int l, int r) {
		if (lazy[k] != 0) {
			d[k] += lazy[k];
			if (r - l > 1) {
				lazy[2 * k] += lazy[k] / 2;
				lazy[2 * k + 1] += lazy[k] / 2;
			}
			lazy[k] = 0;
		}
	}
	void add(int a, int b, int x, int k = 1, int l = 0, int r = -1) {
		if (r == -1)r = n;
		eval(k, l, r);
		if (r <= a || b <= l)return;
		if (a <= l&&r <= b) {
			lazy[k] += (r - l)*x;
			eval(k, l, r);
			return;
		}
		else {
			add(a, b, x, 2 * k, l, (l + r) / 2);
			add(a, b, x, 2 * k + 1, (l + r) / 2, r);
			d[k] = d[2 * k] + d[2 * k + 1];
		}
	}
	int getsum(int a, int b, int k = 1, int l = 0, int r = -1) {
		if (r == -1)r = n;
		eval(k, l, r);
		if (r <= a || b <= l)return 0;
		if (a <= l&&r <= b) return d[k];
		else return getsum(a, b, 2 * k, l, (l + r) / 2) + getsum(a, b, 2 * k + 1, (l + r) / 2, r);
	}
};
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n, q; cin >> n >> q;
	SegmentTree seg(n);
	rep(i, 0, q) {
		int com; cin >> com;
		if (com) {
			int s, t; cin >> s >> t;
			cout << seg.getsum(s - 1, t) << endl;
		}
		else {
			int s, t, x; cin >> s >> t >> x;
			seg.add(s - 1, t, x);
		}
	}
	return 0;
}

Measured memory_bytes: 7012
import java.util.*;

public class Main {

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

        if (n % k == 0)
            System.out.println(0);
        else
            System.out.println(1);
    }

}


Measured memory_bytes: 21844
use std::fmt::{Debug, Display};
use std::io::{self, Read};
use std::str::{self, FromStr};

fn main() {
    let stdin = io::stdin();
    let mut sc = Scanner::new(stdin.lock().bytes());
    let n = sc.next();
    println!("{}", solve(sc.next(), sc.vec(n)));
}


fn solve(k: usize, l: Vec<u32>) -> u32 {
    let mut l = l;
    l.sort();
    l.into_iter().rev().take(k).sum()
}


struct Scanner<R: Read> {
    buf: Vec<u8>,
    bytes: io::Bytes<R>,
}

#[allow(dead_code)]
impl<R: Read> Scanner<R> {
    fn new(bytes: io::Bytes<R>) -> Self {
        Scanner {
            buf: Vec::with_capacity(256),
            bytes: bytes,
        }
    }

    fn next<T: FromStr>(&mut self) -> T
        where <T as FromStr>::Err: Debug
    {
        self.buf.clear();
        let mut c = self.bytes.next().unwrap().unwrap();
        while c == ' ' as u8 || c == '\n' as u8 {
            c = self.bytes.next().unwrap().unwrap();
        }
        while !(c == ' ' as u8 || c == '\n' as u8) {
            self.buf.push(c);
            c = self.bytes.next().unwrap().unwrap();
        }
        str::from_utf8(&self.buf).unwrap().parse().unwrap()
    }

    fn vec<T: FromStr>(&mut self, n: usize) -> Vec<T>
        where <T as FromStr>::Err: Debug
    {
        (0..n).map(|_| self.next()).collect()
    }

    fn pairs<A: FromStr, B: FromStr>(&mut self, n: usize) -> Vec<(A, B)>
        where <A as FromStr>::Err: Debug,
              <B as FromStr>::Err: Debug
    {
        (0..n).map(|_| (self.next(), self.next())).collect()
    }

    fn trios<A: FromStr, B: FromStr, C: FromStr>(&mut self, n: usize) -> Vec<(A, B, C)>
        where <A as FromStr>::Err: Debug,
              <B as FromStr>::Err: Debug,
              <C as FromStr>::Err: Debug
    {
        (0..n)
            .map(|_| (self.next(), self.next(), self.next()))
            .collect()
    }

    fn mat<T: FromStr>(&mut self, m: usize, n: usize) -> Vec<Vec<T>>
        where <T as FromStr>::Err: Debug
    {
        (0..n).map(|_| self.vec(m)).collect()
    }
}


#[allow(dead_code)]
fn print_foreach<T: Display>(answer: &[T]) {
    for x in answer {
        println!("{}", x);
    }
}


#[allow(dead_code)]
fn print_yn(answer: bool, yes: &str, no: &str) {
    println!("{}", if answer { yes } else { no });
}


#[allow(dead_code)]
fn print_or<T: Display>(answer: &Option<T>, or: &T) {
    match *answer {
        Some(ref x) => println!("{}", x),
        None => println!("{}", or),
    }
}


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

const char nl = '\n';

void solve() {
	int n;
	cin >> n;
	cout << (1000-n%1000)%1000 << nl;
}
 
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	// int t;
	// cin >> t;
	// while(t--) {
	// 	solve();
	// }
	solve();
}


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

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> llVEC;
typedef vector<P> PVEC;
typedef priority_queue<P,PVEC,greater<P> > PQ;
typedef priority_queue<ll, llVEC, greater<ll> > llPQ;

#define rep(i,a,n) for(ll i = a;i < n;i++)
#define rrep(i,a,n) for(ll i = n-1; i >= a;i--)
#define LINF (ll)1e18
#define INF (int)1e9
#define fs first
#define sc second

template<typename T>
ll sz(vector<T> &vec){ return (ll)vec.size(); }
template<typename T>
ll sz(priority_queue<T, vector<T>> &pq) {return (ll)pq.size(); }
template<typename T>
ll sz(priority_queue<T, vector<T>, greater<T>> &pq) {return (ll)pq.size(); }
ll sz(string &s) {return (ll)s.size(); } 
ll gcd(ll a,ll b){ return ((!b) ?a :gcd(b, a%b)); }
ll lcm(ll a,ll b){ return a / gcd(a,b) * b; }
bool checkindex(ll i,ll n){ return (i < n && i >= 0); }
ll dx[4] = {1,0,-1,0},dy[4] = {0,1,0,-1};

int main(){
    ll k;
    cin >> k;
    string s = "ACL";
    rep(i,0,k) cout << s;
    cout << endl;
    return 0;
}



Measured memory_bytes: 3628
#DivRem number
N  = int(input())
ans = 0
def divisor(N):
    div_lst = [N] if N != 1 else []
    for n in range(2, int(N ** 0.5 + 1)):
        if N % n == 0:
            if  n == N // n:
                div_lst.append(n)
            else:
                div_lst.append(n)
                div_lst.append(N // n)

    return div_lst

div_lst = divisor(N)
for m in div_lst:
    m = m - 1
    if N // m == N % m:
        ans += m
print(ans)
        

Measured memory_bytes: 38896
#pragma GCC optimize ("-O3")
#include <bits/stdc++.h>
#include <complex>
#include <queue>
#include <set>
#include <unordered_set>
#include <list>
#include <chrono>
#include <random>
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <stack>
#include <iomanip>
#include <fstream>
 
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> p32;
typedef pair<ll,ll> p64;
typedef pair<double,double> pdd;
typedef vector<ll> v64;
typedef vector<int> v32;
typedef vector<vector<int> > vv32;
typedef vector<vector<ll> > vv64;
typedef vector<vector<p64> > vvp64;
typedef vector<p64> vp64;
typedef vector<p32> vp32;
ll MOD = 998244353;
#define forn(i,e) for(ll i = 0; i < e; i++)
#define forsn(i,s,e) for(ll i = s; i < e; i++)
#define rforn(i,s) for(ll i = s; i >= 0; i--)
#define rforsn(i,s,e) for(ll i = s; i >= e; i--)
#define ln "\n"
#define dbg(x) cout<<#x<<" = "<<x<<ln
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// #define INF 1e18
#define fast_cin() ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())

void solve()
{
    ll n,s;
    cin>>n>>s;
    v64 val(n);
    forn(i, n)
    {
        cin>>val[i];
    }
    ll dp[3030][3030];
    forn(i, n)
    {
        forsn(j, 1, s+1)
        {
            
            dp[i][j] = 0;
            if(i > 0) dp[i][j] += dp[i-1][j];
            dp[i][j] %= MOD;
            if(j-val[i] > 0)
            {
                if(i > 0) dp[i][j] += dp[i-1][j-val[i]];
                dp[i][j] %= MOD;
            }
            if(j-val[i] == 0) dp[i][j] += i+1;
            dp[i][j] %= MOD;
        }
    }
    ll ans = 0;
    ans += ((dp[0][s]*n)%MOD);
    ans %= MOD;
    forsn(i, 1, n)
    {
        ll tp = dp[i][s]-dp[i-1][s];
        tp %= MOD;
        if(tp < 0) tp += MOD;
        ans += ((tp*(n-i))%MOD);
        ans %= MOD;
        if(ans < 0) ans += MOD;
    }
    cout<<ans<<ln;
}
 
int main() {
    fast_cin();
    ll t=1;
    // cin>>t;
    while (t--)
    {
        solve();
    }
    return 0;
}
// BITMASK:
// 1)When some constraint is of the order of 15-20, think of bitmask DP.
// 2)When some constraint is around 40, try out meet in the middle
// 3) See Strings,palindromes,prefix,suffix etc -> KMP,Z algo

Measured memory_bytes: 71680
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0; i<(n); i++)
#define int long long
#define double long double
#define mod 1000000007
#define F first
#define S second
#define P pair<long long,long long>
#define all(a) a.begin(),a.end()
#define INF 5000000000000000
#define endl '\n'
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

signed main(){
    int n; cin>>n;
    if(n%2==0)cout<<n<<endl;
    else cout<<n*2<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define fu(i,r,t) for(int i=r;i<=t;i++)
#define fd(i,r,t) for(int i=r;i>=t;i--)
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int long long
#define endl '\n'
using namespace std;
const int INF=1e17+5;
const int maxn=1e5+5;
int n,m,a[maxn],b[maxn],ans,sum;
set<int>T;
int32_t main()
{
    IOS;
    cin>>n;
    fu(i,1,n)
    {
        cin>>a[i];
    }
    fu(i,2,n-1)
    {
        if(a[i]>min(a[i-1],a[i+1]) && a[i]<max(a[i-1],a[i+1]))ans++;
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vector<int>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
#define endl "\n"

constexpr int MOD = 1000000007;
const int INF = 1 << 30;
const int MAX = 100010;

lint dp[MAX][2];

int main() {
    string s;
    cin >> s;
    int n = s.size();

    dp[0][0] = 1;

    rep(i, n) {
        int ni = i+1;
        int nd = s[i] - '0';
        rep(j, 2) {
            if (j) {
                dp[ni][j] += dp[i][j] * 3;
                dp[ni][j] %= MOD;
            }
            else {
                if (nd == 1) {
                    dp[ni][0] += dp[i][j] * 2;
                    dp[ni][0] %= MOD;
                    dp[ni][1] += dp[i][j];
                    dp[ni][1] %= MOD;
                }
                else {
                    dp[ni][j] += dp[i][j];
                    dp[ni][j] %= MOD;
                }
            }
        }
    }
    
    lint res = dp[n][0] + dp[n][1];
    res %= MOD;

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

Measured memory_bytes: 2048
#include <bits/stdc++.h>
using namespace std;
using lli=long long int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using vi=vector<int>;  using vs=vector<string>; using gi=greater<int>;
#define soao(c) sort((c).begin(),(c).end()) //昇順
#define sodo(c) sort((c).begin(),(c).end(),gi()) //降順
#define rev(c) reverse((c).begin(), (c).end())

int main() {
  int a,b,c,d; cin>>a>>b>>c>>d;
  int A,C;
  if(a%d==0) A=a/d;
  else A=(a/d)+1;
 
  if(c%b==0) C=c/b;
  else C=(c/b)+1;
  
  if(A>=C) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

Measured memory_bytes: 3636
import sys,math,collections,itertools
input = sys.stdin.readline

H,W=list(map(int,input().split()))
s = [input().rstrip() for _ in range(H)]
memo = [[0]*W for _ in range(H)]
memo[0][0]=1
q = collections.deque([[0,0]])
while q:
    h,w = q.popleft()
    if h>0 and s[h-1][w]=='.' and memo[h-1][w]==0:
        q.append([h-1,w])
        memo[h-1][w] = memo[h][w] +1
    if h<H-1 and s[h+1][w]=='.' and memo[h+1][w]==0:
        q.append([h+1,w])
        memo[h+1][w] = memo[h][w] +1
    if w>0 and s[h][w-1]=='.' and memo[h][w-1]==0:
        q.append([h,w-1])
        memo[h][w-1] = memo[h][w] +1
    if w<W-1 and s[h][w+1]=='.' and memo[h][w+1]==0:
        q.append([h,w+1])
        memo[h][w+1] = memo[h][w] +1
if memo[H-1][W-1] == 0:
    print(-1)
else:
    cnt = 0
    for i in range(H):
        cnt += s[i].count('#')
    print(H*W-cnt-memo[H-1][W-1])


Measured memory_bytes: 9396
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int count=0;
  cin >>N;
  vector<int>masu(N);
  for(int i=0;i<N;i++){
    cin >> masu.at(i);
  }
  for(int k=0;k<N;k++){
    if(k%2==0){
      if(masu.at(k)%2==1){
        count++;
      }
    }
  }
  cout << count;
}

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

struct Node {
  int key;
  struct Node *right, *left, *parent;
};
typedef struct Node Node;

Node *root, *NIL;

Node * treeMinimum(Node *x) {
  while(x->left != NIL)
    x = x->left;
  return x;
}

Node * find(Node *u, int k) {
  while(u != NIL && k != u->key) {
    if(k < u->key) u = u->left;
    else u = u->right;
  }
  return u;
}

Node * treeSuccessor(Node *x) {
  if(x->right != NIL) return treeMinimum(x->right);
  Node *y = x->parent;
  while(y != NIL && x == y->right) {
    x = y;
    y = y->parent;
  }
  return y;
}

void treeDelete(Node *z) {
  Node *y; 
  Node *x; 

  if(z->left == NIL || z->right == NIL) y = z;
  else y = treeSuccessor(z);

  if(y->left != NIL) {
    x = y->left;
  } else {
    x = y->right;
  }

  if(x != NIL) {
    x->parent = y->parent;
  }

  if(y->parent == NIL) {
    root = x;
  } else {
    if(y == y->parent->left) {
      y->parent->left = x;
    } else {
      y->parent->right = x;
    }
  }

  if(y != z) {
    z->key = y->key;
  }
}

void insert(int k) {
  Node *y = NIL;
  Node *x = root;
  Node *z;
  
  z = (Node *)malloc(sizeof(Node));
  z->key   = k;
  z->left  = NIL;
  z->right = NIL;
  
  while(x != NIL) {
    y = x;
    if(z->key < x->key) {
      x = x->left;
    } else {
      x = x->right;
    }
  }
  
  z->parent = y;
  if(y == NIL) {
    root = z;
  } else {
    if( z->key < y->key) {
      y->left = z;
    } else {
      y->right = z;
    }
  }
}

void inorder(Node *u) {
  if(u == NIL) return;
  inorder(u->left);
  printf(" %d",u->key);
  inorder(u->right);
}

void preorder(Node *u) {
  if(u == NIL) return;
  printf(" %d",u->key);
  preorder(u->left);
  preorder(u->right);
}
  
int main(void) {
  int n, i, x;
  char com[16];
  scanf("%d",&n);
  
  for(i=0;i<n;i++) {
    scanf("%s",com);
    if(!strcmp(com,"find")) {
      scanf("%d",&x);
      Node *t = find(root,x);
      if(t != NIL) printf("yes\n");
      else printf("no\n");
    } else if(!strcmp(com,"insert")) {
      scanf("%d",&x);
      insert(x);
    } else if(!strcmp(com,"print")) {
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    } else if(!strcmp(com,"delete")) {
      scanf("%d",&x);
      treeDelete(find(root,x));
    }
  }

  return 0;
}


Measured memory_bytes: 20456
N, M = map(int, input().split())
PY = [tuple(map(int, input().split())) for i in range(M)]

py_map = {}
x = 1
prep = 0
for p, y in sorted(PY):
    if prep == p:
        x += 1
    else:
        x = 1
    py_map[(p,y)] = str(p).zfill(6) + str(x).zfill(6)
    prep = p

for p, y in PY:
    print(py_map[(p, y)])

Measured memory_bytes: 86616
def gcd(a,b)
  bigger = [a,b].max
  smaller = [a,b].min
  while(true)
    t = smaller
    smaller = bigger % smaller
    bigger = t
    return bigger if smaller == 0
  end
end

n = gets.chomp.to_i
sum = 0
answer_arr = []
(1..n).each do |i|
  (1..n).each do |j|
    answer_arr << gcd(i,j)
  end
end
(1..n).each do |i|
  (1..n).each do |j|
    (1..n).each do |k|
      sum += answer_arr[(answer_arr[(i - 1) * n + j - 1] - 1) * n + k - 1]
    end
  end
end
puts sum

Measured memory_bytes: 14784
#include <bits/stdc++.h>
#define rep(i, n) for(ll i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
const double PI=acos(-1);

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

int main(){
    ll n, k; cin >> n >> k;
    vector<ll> m(k, 0);
    for(ll i = 1; i <= n; ++i) m[i%k]++;
    ll ans = 0;
    rep(i, k){
        ll b = (k - i) % k;
        ll c = (k - i) % k;
        if((b+c)%k != 0) continue;
        ans += m[i] * m[b] * m[c];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4728
class UnionFind(object):
    def __init__(self, n=1):
        self.par = [i for i in range(n)]
        self.rank = [0 for _ in range(n)]

    def find(self, x):
        if self.par[x] == x:
            return x
        else:
            self.par[x] = self.find(self.par[x])
            return self.par[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x != y:
            if self.rank[x] < self.rank[y]:
                x, y = y, x
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1
            self.par[y] = x

    def is_same(self, x, y):
        return self.find(x) == self.find(y)
    
n,m=map(int, input().split())
uf1=UnionFind(n)
for i in range(m):
    a,b,c=map(int, input().split())
    uf1.union(a-1,b-1)
for i in range(n):
    uf1.find(i)
print(len(set(uf1.par)))

Measured memory_bytes: 13992
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.TreeSet;

import javax.print.attribute.standard.MediaSize.Other;
import javax.xml.bind.ParseConversionEvent;

public class Main {

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);

		final int n = sc.nextInt();
		boolean broken = false;
		int un_closed = 0;
		for(int i = 0; i < n; i++){
			final boolean open = sc.next().toCharArray()[0] == '(';
			final int num = sc.nextInt();
			
			if(broken){
				continue;
			}
			
			if(open){
				un_closed += num;
			}else{
				un_closed -= num;
				if(un_closed < 0){
					broken = true;
				}
			}
		}
		
		if(broken || un_closed > 0){
			System.out.println("NO");
		}else{
			System.out.println("YES");
		}
		
	}

}

Measured memory_bytes: 24916
N = int(input())
AC=0
WA=0
TLE=0
RE=0
for i in range(N):
  a = input()
  if a == 'AC':
    AC += 1
  elif a == 'WA':
    WA += 1
  elif a == 'TLE':
    TLE += 1
  else:
    RE += 1
    
print('AC x {0}\nWA x {1}\nTLE x {2}\nRE x {3}'.format(AC,WA,TLE,RE))

Measured memory_bytes: 9168
#include <bits/stdc++.h>
#include <math.h>
#include <cstdlib> //絶対値 abs()
using namespace std;


int main(){

	string w;
	cin >> w;

	sort(w.begin(),w.end());
	char c = w[0];
	int cnt = 0;

	for(int i=0;i<w.size();i++){

		if(w[i]!=c){

			if(cnt%2==0){
				cnt = 1;
				c = w[i];
			}

			else{
				cout << "No" << endl;
				return 0;
			}
		}

		else{
			cnt++;
		}
	}
	if(cnt%2!=0){
		cout << "No" << endl;
	}

	else{

	cout << "Yes" << endl;
}

}

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

using namespace std;

const int N = 100005;

vector<int> g[N];
int dp[N];
bool flag = false;

void dfs(int u, int fa) {
  dp[u] = 0;
  int sum = 0;
  for (auto v : g[u]) {
    if (v != fa) {
      dfs(v, u);
      if (dp[v] == 0) {
        sum++;
      }
    }
  }
  if (sum == 0) {
    dp[u] = 0;
  } else if (sum == 1) {
    dp[u] = 1;
  } else {
    flag = true;
  }
}

int main(int argc, const char *argv[]) {
  int n;
  cin >> n;
  for (int i = 0; i < n - 1; i++) {
    int u, v;
    cin >> u >> v;
    g[u].push_back(v);
    g[v].push_back(u);
  }
  dfs(1, 0);
  flag |= (dp[1] == 0);
  puts(flag ? "First" : "Second");
  return 0;
}


Measured memory_bytes: 6272
#include <iostream>
#include <vector>
#include <numeric>
#include <cassert>
#include <algorithm>
using namespace std;

int main() {
	int r;
	
	cin >> r;
	
	if(r < 1200){
		cout << "ABC";
	}
	else if(r < 2800){
		cout << "ARC";
	}
	else {
		cout << "AGC";
	}
	
	return 0;

}


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

int main(){
	string S, T;
	cin >> S >> T;

	string res = "zzzzz";
	bool unrestrorable = true;
	if(S.size()<T.size()){
		cout << "UNRESTORABLE" << endl;
		return 0;
	}
	for(int i=S.size()-T.size();i>-1;i--){
		dump(i)
		bool flag = true;
		REP(j, T.size()){
			dump(S[i+j])
			dump(T[j])
			if(S[i+j]!=T[j] && S[i+j]!='?'){
				flag = false;
			}
		}
		if(!flag) continue;
		unrestrorable = false;
		string R = S;
		REP(j, T.size()) R[i+j] = T[j];
		REP(j, R.size()) if(R[j]=='?') R[j] = 'a';
		res = min(R, res);
	}
	if(unrestrorable){
		cout << "UNRESTORABLE" << endl;
		return 0;
	}
	cout << res << endl;
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>

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

long min(long a, long b){
  if(a < b) return a;
  else return b;
}

int sort(const void *a, const void *b){
  return *(int*)a -*(int*)b;
}

int main(){

  int n;
  long long int k;
  scanf("%d%lld",&n,&k);

  long long int num[100001] = {0};
  for(int i = 0; i < n; ++i){
    int a,b;
    scanf("%d%d",&a,&b);
    num[a] += b;
  }

  int ans = 0;
  for(int i = 1; i <= 100000; ++i){
    k = k-num[i];
    if( k <= 0 ){
      printf("%d",i);
      return 0;
    }
  }

  return 0;

}


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

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

    int n, m;
    cin >> n >> m;

    vector<int> a(n);
    int sum = 0;
    rep(i, n) {
        cin >> a[i];
        sum += a[i];
    }

    int cnt = 0;
    rep(i, n){
        if(4*a[i]*m >= sum) ++cnt;
    }
    
    if(cnt>=m) puts("Yes");
    else puts("No");


    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <math.h>
#include <string.h>
#include <iomanip>
#include <locale>
using namespace std;
#define FORN(i,m,n) for(int i=m; i<(n); i++)
#define PRINTVEC(v) FORN(i,0,v.size()) cout<<v[i]<<" "; cout<<endl
#define PRINTMAT(m) FORN(j,0,m.size()) {PRINTVEC(m[j]);}
#define p_b(x) push_back(x)
#define m_p(a,b) make_pair(a,b)
typedef long long ll;

int main(){
  ios_base::sync_with_stdio(false); cin.tie(NULL);
  string s,t;
  cin>>s>>t;
  vector<vector<int> > v(27);
  FORN(i,0,s.size()) v[s[i] - 'a'].p_b(i);
  ll ans = 0, cur = -1;
  FORN(i,0,t.size()){
    int x = t[i] - 'a', pos;
    if(v[x].empty()){
      cout<<-1<<endl;
      return 0;
    }
    pos = upper_bound(v[x].begin(),v[x].end(),cur) - v[x].begin();
    if(pos == v[x].size()){
      pos = 0;
      ans++;
    }
    cur = v[x][pos];
  }
  ans = ans * s.size() + cur + 1;
  cout<<ans<<endl;
}

Measured memory_bytes: 1228
#include<iostream>
#include<array>
#include<vector>
typedef unsigned long long  ull;
using namespace std;


ull cycle[200001];

ull teleporter(ull n, ull k, vector<ull> a) {

  for(ull i =0;i<n;i++) {
    a[i] = a[i] - 1;
  }

  ull count = 0;
  ull cur = 0;
  while(true) {
    cur = a[cur];
    count++;
    if(cur == 0) {
      break;
    }
    if(cycle[cur] != 0) {
      break;
    }
    cycle[cur] = count;
  }
  // loop point is cur.
  ull loop_size = count - cycle[cur];
  //cout << " loop size " << loop_size << endl;
  //cout << " loop point " << cur << endl;

  ull p = 0;
  while(k > 0 && p != cur) {
    p = a[p];
    k--;
  }
  if(k == 0) {
    return p + 1;
  }

  k %= loop_size;

  while(k > 0) {
    p = a[p];
    k--;
  }
  return p + 1;
}

int main() {
  ull n, k;
  cin >> n;
  cin >> k;
  vector<ull> a(n);
  for(ull i=0;i<n;i++) {
    cin >> a[i];
  }
  cout << teleporter(n, k, a);
}

Measured memory_bytes: 8036
#include<bits/stdc++.h> 
//#define <- プログラムの文字列を置換する
//typedef <- 新しい型に名前を付けるためのキーワード

using namespace std;

#define MAX_N 1

typedef long long ll;

const double PI = 3.141592653589793;
const long long MOD = 1e9 + 7;
const long long INF = 1e15;
const int INF_INT = 1e9;


int main(){
    string s;
    string t;
    cin >> s >> t;
    string temp = t.substr(0,s.length());
    if(s == temp) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3628
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		String[] str=(new Scanner(System.in).nextLine().split(" "));
		int a=Integer.parseInt(str[0]);
		int b=Integer.parseInt(str[1]);
		int r=0;
		while((a-1)*r+1<b) {
			r++;
		}
		System.out.println(r);
	}
}

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

int main()
{
    string s; cin >> s;

    if (s == "Sunny")  cout << "Cloudy" << endl;
    else if (s == "Cloudy")  cout << "Rainy" << endl;
    else if (s == "Rainy")  cout << "Sunny" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<array>
#include<map>

using namespace std;

int main(){
  for(int H,W;cin>>H>>W,H;){
    map<array<int,20>,int> m[21][21];
    m[0][0][array<int,20>()]=1;
    for(int i=0;i<H;i++){
      for(int j=0;j<W;j++){
	for(auto e:m[i][j]){
	  auto v=e.first;
	  auto d=e.second;
	  if(j&&v[j-1]==2){
	    v[j]=3;
	    m[i][j+1][v]+=d;
	  }else if(i&&v[j]==0){
	    v[j]=1;
	    m[i][j+1][v]+=d;
	  }else if(i==0||v[j]==3||j==0||v[j-1]==1){
	    if(i+1<H){
	      auto nv=v;
	      nv[j]=0;
	      m[i][j+1][nv]+=d;
	    }
	    if(j+1<W&&(i==0||v[j+1]!=0)){
	      auto nv=v;
	      nv[j]=2;
	      m[i][j+1][nv]+=d;
	    }
	  }
	}
	m[i][j].clear();
      }
      m[i+1][0]=m[i][W];
    }
    int a=0;
    for(auto e:m[H][0]){
      a+=e.second;
    }
    cout<<a<<endl;
  }
}

Measured memory_bytes: 43176
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <cmath>

using namespace std;
#define PI 3.1415926535897932384626433832795
#define MOD (1000000007)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repc(i, s, n) for (int i = (s); i <= (n); i++)
#define rrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define rrepc(i, s, n) for (int i = (s); i >= (n); i--)
#define swap(a, b, type) { type _tmp = a; a = b; b = _tmp; }
typedef long long ll;
typedef unsigned long long ull;

int main()
{
	int N, cnt, ans = 0;

	cin >> N;

	for (int i = 1; i <= N; i += 2) {
		cnt = 0;

		repc(j, 1, i) {
			if (i % j == 0) cnt++;
		}

		if (cnt == 8) ans++;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

int main() {
  int N, H, W;
  cin >> N >> H >> W;
  int ans = 0;
  for (int i = 0; i < N; ++i) {
    int A, B;
    cin >> A >> B;
    if (A >= H && B >= W) ++ans;
  }
  cout << ans << endl;
  return 0;
}

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

#define rep(i, N) for (ll i = 0; i < N; i++)
#define rep1(i, N) for (ll i = 1; i <= N; i++)
#define MOD (int)1e9+7;

using ll = long long;
using namespace std;

int main() {
    int N;
    cin >> N;
    int cnt[(int)1e5+3] = {0};
    int ans = 0;

    rep(i, N) {
        int a;
        cin >> a;
        if(a > N) ans++;
        else cnt[a]++;
    }
    
    rep1(i, N) {
        if(cnt[i] > i) ans += cnt[i] - i;
        else if(cnt[i] < i) ans += cnt[i];
    }

    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 640
#!/usr/bin/env python3
import sys
import numpy as np


def solve(N: int):
    F = 110
    p = [0] * (F**3)
    for x in range(1,F):
        for y in range(1,F):
            for z in range(1,F):
                p[x*x+y*y+z*z+x*y+y*z+z*x] += 1

    for i in range(1,(N+1)):
        print(p[i])
    return


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

if __name__ == '__main__':
    main()


Measured memory_bytes: 37312
#include<stdio.h>
int main(void){
    int x,y;
    int i;
    for(i=0;;i++){
    scanf("%d%d",&x,&y);
    if(x==0&&y==0)break;
    if(x>=y)printf("%d %d\n",y,x);
    else if(x<y)printf("%d %d\n",x,y);
    }
    return 0;
}


Measured memory_bytes: 2064
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <algorithm>
#include <iomanip> //cout << fixed << setprecision(12) << ans << endl;
using namespace std;
 
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = (int)(n-1); i >= 0; i--)
#define loop(i, l, r) for(int i = l; i < r; i++)
#define rloop(i, l, r) for(int i = l; i >= 0; i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vec_i;
typedef pair<int,int> pair_ii;
typedef pair<ull,ull> pair_ull;
 
const int dx[4] = {0, 0, 1, -1};
const int dy[4] = {1, -1, 0, 0};
const int INF = 1e9;
const int MOD = 1e9+7;
 
int main()
{
	string s,t;
	cin >> s >> t;
	int ans = 0;
	rep(i,3){
		if(s[i] == t[i]) ans++;
	}
	cout << ans << endl;
}

Measured memory_bytes: 764
#include <cmath>
#include <vector>
#include <iostream>
#include <limits>
#include <iostream>
#include <vector>
#include <cassert>
#include <complex>
#include <cstdio>
#include <cstring>
#include <map>
#include <cmath>
#include <set>
#include <algorithm>
#include <queue>

using namespace std;
typedef long long Long;

int main(){

	Long N,M,O;
	cin >> N >> M >> O;
	if(N%2 == 0 || M%2 == 0 || O%2 == 0){
		cout << 0 << endl;
	}else if(N >= M && N >= O){
		cout << M*O << endl;
	}else if(M >= N && M >= O){
		cout << N*O << endl;
	}else{
		cout << M*N << endl;
	}
	
	
}


/*



 */


Measured memory_bytes: 256
N, A = map(int, input().split())
*X, = map(int, input().split())
MAX = max(max(X), A) * N
X = [x - A for x in X]

dp = {i: {j: 0 for j in range(2*MAX+1)} for i in range(N+1)}
dp[0][MAX] = 1
for i in range(1, N+1):
    for j in range(2*MAX+1):
        t = j - X[i-1]
        dp[i][j] = dp[i-1][j] + (dp[i-1][t] if 0 <= t <= 2*MAX else 0)
print(dp[N][MAX]-1)

Measured memory_bytes: 21356
#include <iostream>

using namespace std;

int main() {
	bool f[30] = {0};
	int n;

	while (scanf("%d", &n) != EOF)
		f[n-1] = true;

	for (int i = 0; i < 30; ++i)
		if (!f[i])
			cout << (i + 1) << endl;
}

Measured memory_bytes: 0
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <string>

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

using namespace std;

int inputValue(){
    int a;
    cin >> a;
    return a;
};

void inputArray(int * p, int a){
    rep(i, a){
        cin >> p[i];
    }
};

void inputVector(vector<int> * p, int a){
    rep(i, a){
        int input;
        cin >> input;
        p -> push_back(input);
    }
}

template <typename T>
void output(T a, int precision) {
    if(precision > 0){
        cout << setprecision(precision)  << a << "\n";
    }
    else{
        cout << a << "\n";
    }
}

int main(int argc, const char * argv[]) {
    
    // source code
    int n;
    cin >> n;
    if(n<=999)
        cout << "ABC" << endl;
    if(n>999)
        cout << "ABD" << endl;


    return 0;
}

Measured memory_bytes: 384
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

typedef unsigned long ul;
typedef long long ll;
typedef pair<ul, ul> P;
map<int, int> dp;
#define REP(i, n) for (int i = 0; i < n; i++)

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  string S;
  cin >> S;
  char target = 'A';
  int ans = 0;
  while (target != 'Z'+1) {
    auto cnt = count(S.cbegin(), S.cend(), target);
    if (cnt == 2) ++ans;
    target += 1;
  }
  if (ans == 2) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;

#define F            first
#define S            second
#define pb(x)        push_back(x)
#define mp(a,b)      make_pair(a,b)
#define mt(a,b,c)    make_tuple(a,b,c)
#define sz           size()
#define all(A)       A.begin(), A.end()
#define mem(a, b)    memset(a, b, sizeof(a))   // all elements of A are b=0 or b=-1 else don't work
#define f0(i,b)      for(ll i=0;i<(b);i++)
#define f1(i,b)      for(ll i=1;i<=(b);i++)
#define f2(i,a,b)    for(ll i=(a);i<=(b);i++)
#define f3(i,b,a)    for(ll i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(ll i=(a);i!=(b);i+=(c))

#define mod          10000007
#define PI           acos(-1.0)
#define MAX3(a,b,c)  max(a,max(b,c))

#define whilee(i,t)  while(i!=t)
#define  sl(a)       scanf("%lld",&a)
#define  pl(a)       printf("%lld\n",a)

//x = 1e18 means 10^18
//for(auto it =A.begin(); it!=A.end(); it++)
//sort(A.begin(),A.end()); //sort(A, +n, greater<int>());
//binary_search(A.begin(),A.end(),x);
//reverse(A.begin(), A.end());
//cout << *max_element(A.begin(), A.end());
//cout << *min_element(A.begin(), A.end());
//count(A.begin(), A.end(), X); //counts the occurrences of X
//distance(A.begin(),A.end());  //distance between first to last element
//accumulate(A.begin(), A.end(), 0); //add
//next_permutation(A.begin(), A.end());
//prev_permutation(A.begin(), A.end());
//swap(S[0], T[0]);

//scanf("%lld",&x);
//printf("%lld\n",x);
//printf("%I64d\n", a);
//while (scanf("%lld %lld", &a, &b) == 2)
//printf("Case %lld: %lld\n", t++, a);

// int dx[] = {1,-1,0,0} , dy[] = {0,0,1,-1};  // 4 Direction
// int dx[] = {1,-1,0,0,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1,1,-1};  // 8 Direction
// int dx[] = {1,-1,1,-1,2,2,-2,-2} , dy[] = {2,2,-2,-2,1,-1,1,-1};  // Knight Direction
// int dx[] = {2,-2,1,1,-1,-1} , dy[] = {0,0,1,-1,1,-1};  // Hexagonal Direction

//vector <ll> A;
//deque <ll> A;
//queue <ll> A;
//stack <ll> A;
//list <int> A;
//set <ll> A;
//map <ll,ll> A;
//unordered_map <ll, ll> A;
//pair <ll,ll> A ;
//tuple <ll, ll, ll> A;
//vector <pair <ll,ll>> A ;
//bitset<32> bset1;
//bool ok = true;
//char ch;
//string S, T, U;

ll i=0, j=0, k=0, a, b, c, d, e, f, g, h, l, m, n, o, p, q, r, s, t=1, u, v, w, x, y, z, maxx=INT_MIN, minn=INT_MAX, ans=0, sum=0, cnt=0;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);//NULL
    cout.tie(nullptr);//NULL

    cin>>a>>b;
    if(a>b*2)
    {
        cout<<a-(b*2)<<endl;
    }
    else cout<<0<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>

using namespace std;

int main() {
	int N, M, C;
	cin >> N >> M >> C;

	vector<vector<int>> A(N, vector<int>(M, 0));
	vector<int> B(M, 0);
	for (int i = 0; i < M; i++) {
		cin >> B[i];
	}
	for (int i = 0; i < N; i++) {
		for (int j = 0; j < M; j++) {
			cin >> A[i][j];
		}
	}

	int ans = 0;
	for (int i = 0; i < N; i++) {
		int val = 0;
		for (int j = 0; j < M; j++) {
			val += A[i][j] * B[j];
		}
		if (val + C > 0) {
			ans++;
		}
	}

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


Measured memory_bytes: 256
from functools import reduce
from fractions import gcd
import math
import bisect
import itertools
import sys
sys.setrecursionlimit(10**7)
input = sys.stdin.readline
INF = float("inf")


def main():
    S = input()[:-1].split()
    print(S[1] + S[0])


if __name__ == '__main__':
    main()

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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	int n; cin>>n;
	vector<int> h(n);
	for(auto &x : h){
		cin>>x;
	}
	int prev = 0;
	for(int i = 0; i < n; i++){
		if(prev < h[i]){
			h[i]--;
		}else if(prev > h[i]){
			cout<<"No"<<endl;
			exit(0);
		}
		prev = h[i];
	}
	cout<<"Yes"<<endl;

	return 0;
}

Measured memory_bytes: 640