akhauriyash/Code-Regression huggingface dataset:
/*
author: Apoorv Singh
*/
 
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
 
typedef vector <long long> vi;
typedef pair <long long, long long> pii;
#define pb push_back   
#define all(c) c.begin(), c.end()
#define For(i, a, b) for (long long i = a; i < b; ++i)
#define Forr(i, a, b) for (long long i = a; i > b; --i)
#define um unordered_map
#define F first
#define S second
#define int long long
#define inf LLONG_MAX
#define endl "\n"
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize ("O3")
#pragma GCC optimize ("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define _CRT_SECURE_NO_WARNINGS

#define TRACE
#ifndef ONLINE_JUDGE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
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...);
}
#else
#define trace(...)
#endif

template <class X>
void printarr(X arr[], int n) {
	for (int i = 0; i < n; ++i)
		cout << arr[i] << ' ';
	cout << endl;
}

template <typename X> ostream& operator << (ostream& x,const vector<X>& v){ for (X a : v) x << a << ' '; return x;} 
template <typename X, typename Y> ostream& operator << (ostream& x, const vector< pair<X, Y> >& v) {for (pair <X, Y> it : v) x << it.first << ' ' << it.second << endl; return x;} 
template <typename T, typename S> ostream& operator << (ostream& os, const map<T, S>& v) { for (pair <T, S> it : v) os << it.first << " => " << it.second << endl; return os; }
 
template <class T, class cmp = less<T>> using ordered_set = tree<T, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
 
int modulo = 1e9 + 7;

int fpow(int a, int n) {
	int ans = 1;
	while (n) {
		if (n&1) ans = (ans*a)%modulo;
		a = (a*a)%modulo; n = n >> 1;
	}
	return ans;
}

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int a; string s;
	cin >> a >> s;
	if (a < 3200) cout << "red";
	else cout << s;
	return 0;
}

Measured memory_bytes: 256
// 参考
// https://techracho.bpsinc.jp/jhonda/2019_08_05/78537

// Input macro
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! stdin {
    () => {{
        use std::io::Read;
        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }};
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

// Test Code
macro_rules! test {
    ($($input:expr => $output:expr),* $(,)*) => {
        #[test]
        fn solve_test() {
            $(
                assert_eq!(solve($input), $output);
            )*
        }
    };
}

test! {
r"21
" => r"27",

r"12
" => r"36"
}

use std::cmp;
use std::collections::HashSet;
use std::f32::MAX;

fn main() {
    println!("{}", solve(&stdin!()));
}

fn solve(src: &str) -> String {
    input! {
        source = src,
        a: i32,
        b: i32,
        c: i32,
        d: i32
    }

    if a + b == c + d {
        "Balanced".to_string()
    } else if a + b > c + d {
        "Left".to_string()
    } else {
        "Right".to_string()
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
int main(){
    int k,t;
    cin>>k>>t;
    
    int max_a=-1;
    rep(i,0,t){
        int a;
        cin>>a;
        max_a=max(max_a,a);
    }
    
    cout<<max(0,max_a-(k-max_a)-1)<<endl;
}



Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(){
    char S[100000];
    int i,j,N;
    
    scanf("%d",&N);
    scanf("%s",S);
    
    int len = strlen(S);
    
    for(i = 0; i < N-1; i++){
        if(S[i] == S[i+1]){
            len--;
        }
    }
    printf("%d\n",len);
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> pi;
#define f first
#define s second
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);
const int maxn = 100010;
const int INF = INT_MAX/2;

int L, R, d;

int32_t main(){
	FAST
	cin >> L >> R >> d;
	int ans = 0;
	for (int i  = L; i <= R; i++) {
		if (i % d == 0) ans++;
	}
	cout << ans;
	
	

}









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

int main() {
	// your code goes here
	int n;
	cin>>n;
	vector<vector<int>>arr(n);
	for(int i=0;i<n;i++)
	{
		int a,b,c;
		cin>>a>>b>>c;
		arr[i].push_back(a);
		arr[i].push_back(b);
		arr[i].push_back(c);
	}
	vector<vector<int>>dp(n,vector<int>(3,0));
	dp[0][0]=arr[0][0];
	dp[0][1]=arr[0][1];
	dp[0][2]=arr[0][2];
	for(int i=0;i<n-1;i++)
	{
		for(int j=0;j<3;j++)
		{
			for(int k=0;k<3;k++)
			{
				if(j!=k)
				dp[i+1][j]=max(arr[i+1][j]+dp[i][k],dp[i+1][j]);
			}
		}
	}
	/*for(int j=0;j<n;j++)
		{
			for(int k=0;k<3;k++)
			{
	          cout<<dp[j][k]<<" ";
			}
			cout<<"\n";
		}*/
	int maximum=*max_element(dp[n-1].begin(),dp[n-1].end());
	cout<<maximum<<"\n";
	
	
	return 0;
}

Measured memory_bytes: 14328
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <cstring>
#include <map>
#include <queue>
#include <cmath>
#include <complex> // complex<double> a(1.2 , 2.3);// real(): 1.2, imag()2.3
using namespace std;

#define MOD 1000000007
#define ll long long
#define ld long double
#define FOR(i,a,b) for(ll i=(ll)a;i<(ll)b;i++)
#define rep(i,n) FOR(i,0,n)
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rmsame(a) sort(all(a)),a.erase(unique(all(a)), a.end())
#define rmvector(a,b) rep(i,a.size())rep(j,b.size())if(a[i]==b[j]){a.erase(a.begin()+i);i--;break;}
template<typename X> bool exist(vector<X> vec, X item){return find(all(vec), item)!=vec.end();}
ll gcd(ll a, ll b){if(b==0)return a;return gcd(b,a%b);}
ll lcm(ll a, ll b){return a/gcd(a,b)*b;}





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


  string s ; cin >> s;
  ll ans = 0;

  string str = "";
  rep(i,s.size()){
    str+=s[i] ;
    if(i != (s.size()-1)) str += " ";
  }

  rep(i,pow(2,s.size()-1)){
    ll time = i;
    rep(j,s.size()-1){
      if(time%2==1)str[j*2+1] = '+';
      else str[j*2+1] = ' ';
      time /= 2;
    }
    ll now = 0;
    ll ret = 0;
    cerr << str << endl;
    rep(j,str.size()){
      if(str[j] >= '0' && str[j] <= '9')
	now += (str[j]-'0');
      else if(str[j] == ' ') now *= 10;
      else if(str[j] == '+') {
	ret += now;
	now = 0;
      }
    }
    ans += (ret + now);
    
  }
  cout << ans << endl;
  
  //cout << fixed << setprecision(16) << ans << endl;
  return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <algorithm>
#include <numeric>
#include <utility>
#include <random>
#include <chrono>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>

using namespace std;

using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PIL = pair<int, LL>;
using PLL = pair<LL, LL>;
// const int mod = 1e9 + 7;
// const int mod = 998244353;

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
}

inline void work() {
    int a, b, c, k;
    cin >> a >> b >> c >> k;
    // c > b > a
    while (k) {
        if (b <= a) {
            b *= 2;
            k--;
        }
        else if (c <= b) {
            c *= 2;
            k--;
        }
        else break;
    }
    if (c > b && b > a) cout << "Yes" << endl;
    else cout << "No" << endl;
}

int main() {
    // freopen(".txt", "r", stdin);
    quickread();
    work();
    return 0;
}

Measured memory_bytes: 3648
import sys
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

r,g,b,n = na()
ans=0
for i in range(n//r+1):
    a = n-r*i
    for j in range(a//g+1):
        if (a-g*j)%b == 0:
            ans+=1

print(ans)


Measured memory_bytes: 3060
//#pragma GCC target("avx2")
//#pragma GCC optimize("O3")
 
//#include <x86intrin.h>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <string>
#include <bitset> 
#include <vector>
#include <cmath>
#include <deque>
#include <queue>
#include <iomanip>
#include <stack>
#include <map>
#include <set>
//#include <ordered_set>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
 
//using namespace __gnu_pbds;
using namespace std;
 
//template<typename T> using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
     
#define F first
#define S second           
#define lb lower_bound               
#define ub upper_bound
#define pb push_back
#define pf push_front    
#define ppb pop_back
#define mp make_pair                                     
#define bpp __builtin_popcountll                                                                                        
#define sqr(x) ((x) * (x)) 
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define in insert
#define ppf pop_front
#define endl '\n'
//#define int long long
 
typedef unsigned long long ull;
typedef long long ll;
typedef long double ld;
typedef pair <int, int> pii;
 
const int mod = (int)1e9 + 7;
const int N = (int)3e5 + 123;
const ll inf = (ll)1e18 + 1;
 
const double pi = acos (-1.0);
const double eps = 1e-9;                  
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};

ll n, s;

ll f (ll a, ll b) {
   if (a == 0) return 0;
   return f (a / b, b) + (a % b);
}

inline void boost () {
   ios_base :: sync_with_stdio (0);
   cin.tie (0), cout.tie (0);
}
 
inline void Solve () {
   cin >> n >> s;
   if (n == s) cout << n + 1, exit (0);
   for (ll i = 2; i * i <= n; i ++) {
      if (f (n, i) == s)
         cout << i, exit (0);
   }
   for (ll i = 1; i * i <= n - s; i ++) {
      if ((n - s) % i == 0) {
         if (f (n, i + 1) == s)
            cout << i + 1, exit (0);
      }
   }
   for (ll i = sqrtl (n - s); i >= 1; i --) {
      if ((n - s) % i == 0) {
         if (f (n, (n - s) / i + 1) == s)
            cout << (n - s) / i + 1, exit (0);
      }
   }
   cout << -1;
}               
 
signed main () {                                       
  // #ifdef QWERTY
  //    freopen("input", "r", stdin);
  // #endif
// freopen (".in", "r", stdin);    
// freopen (".out", "w", stdout);              
   boost ();
   int tt = 1;
   //cin >> tt;   
   while (tt --) {
      Solve ();
   }                                               
   return 0;      
}                   

Measured memory_bytes: 3680
// inputに入力データ全体が入る
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    input = input.split("\n");
    tmp0 = input[0].split(" ");
    // tmp1 = input[1].split(" ");

    S = input[0]

    S = S.split("").sort().join("")
    if(S[0] === S[1] && S[2] === S[3] && S[1] !== S[2])
    {
      console.log("Yes")
    }else{
      console.log("No")
    }

}
  //*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
// Main("AAAA\n");

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


int main(){
    int ans = 99999999;
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i = 0; i < N; i++) cin >> a[i];
    for (int i = -100; i <= 100; i++) {
        int sum = 0;
        for (int j = 0; j < N; j++) {
            sum += (i - a[j]) * (i - a[j]);
        }
        ans = min(ans, sum);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
	int n;
	cin >> n;
	
	long long ans = 0;
	
	for(int i = 1; i < n; i++){
		int a = i;
		int b = (n-1)/i;
		ans += b;
	}
	cout << ans << endl;
}

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

#define rep(i,l,r) for(int i=(l);i<(r);i++)
#define pb push_back
#define fi first
#define se second

using ll = long long;
using G = vector<vector<int>>;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const ll MOD = 1000000007;

ll GCD(ll x, ll y){
	return y ? GCD(y, x%y) : x;	
}

int main() {
	int l; cin >> l;
	double ans = l*l*l/27.0;
	printf("%.7f\n", ans);
	return 0;
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
#define Fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int  long long int
typedef vector<int>Vl;
typedef pair<int,int>pii;
typedef vector<pii>Vll;
typedef vector<pair<int,pii> >Vlll;
typedef priority_queue<int>PQL;
typedef map<int,int>M;
#define S second
#define F first
#define mp make_pair
#define ms(x,y) memset(x,y,sizeof(x))
#define pb push_back
#define sl(n) cin>>n
#define pl(n) cout<<n
const int mod=1e9+7;
const int sze=1e5+2;
long double esp=1e-10;
long double inf= (int)(1000000000000000000);
void solve()
{
  int n;
  sl(n);
  Vl arr(n);
  for(int i=0;i<n;i++){
	  sl(arr[i]);
	  if(arr[i]==0){
		  cout<<"0"<<endl;
		  return;
	  }
  }
  long double res=arr[0];
  if((res-inf)>esp){
	  cout<<"-1"<<endl;
	  return;
  }
  long double half=1e9;
  for(int i=1;i<n;i++){
	 if(res>half && arr[i]>half){
		 cout<<"-1"<<endl;
		 return;
	 }
    res=res*arr[i];
      if((res-inf)>esp){
	  cout<<"-1"<<endl;
	  return;
  }
  }
  cout<<fixed<<setprecision(0)<<res<<endl;
}
 
signed main(){
   int test=1;
   //sl(test);
   while(test--){
      solve();
 
   }
  return 0;
}


Measured memory_bytes: 4048
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> //required
#include <ext/pb_ds/tree_policy.hpp> //required
// iteration and input/output stream
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define printarr(x) rep(i,0,x.size()) cout<<x[i]<<" "; cout<<endl;

#define tr(cont,it) \
for(decltype(cont.begin()) it = cont.begin(); it!= cont.end() ; it++)

using namespace std;

#define tc() int tcase; cin >> tcase ; rep(tc,1,tcase+1)
//STL shortcuts
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define F first
#define S second
#define MP make_pair

// Error detection
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl

typedef long long int ll; // 64 bit integer
typedef unsigned long long int  ull; // 64 bit unsigned integer
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef pair<int,ll> pill;

inline void smax(int &x , int y) { x = max(x , y) ; }
inline void smin(int &x , int y) { x = min(x , y) ; }

#define MOD 1000000007
#define inf 4000000000000000000LL
#define SYNC std::ios::sync_with_stdio(false);  cin.tie(NULL);

ll gcd(ll a,ll b){ return ((b==0)? a:gcd(b,a%b) ); }


int main()
{
    SYNC
    int n;
    cin>>n;
    vi v(n);
    rep(i,0,n)
    cin>>v[i];

    int ind = 0;
    int prev = v[0];
    int ans =0;
    rep(i,1,n)
    {
        if(v[i] <= prev )
        {
            ans = max(ans,i-ind);
        }
        else
        {
            ind = i;
        }
        prev = v[i];
    }
    cout<<ans;
}


Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
//#define revstr(s) reverse(s.begin(),s.end())
typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-11;
const ld pi = acos(-1.0);
typedef pair<ll, ll> LP;
typedef pair<ld, ld> LDP;
typedef unsigned long long ul;
string s, t; int n, m;
bool used[4002][4002];
P ans[4002][4002];
P nex[4002][4002];
P dfs(int i, int j) {
	if (used[i][j])return ans[i][j];
	used[i][j] = true;
	if (i >= n && j >= m) {
		nex[i][j] = { -1,-1 };
		if (i != n + 1 || j != m + 1)return ans[i][j] = {0,1};
		else return ans[i][j] = { 0,0 };
	}
	P res;
	int ni = i, nj = j;
	//次を0にする場合
	while (ni < n&&s[ni] == '1')ni++;
	while (nj < m&&t[nj] == '1')nj++;
	P res1 = dfs(min(ni + 1, n + 1), min(nj + 1, m + 1));
	int mi = ni, mj = nj;
	//次を1にする場合
	ni = i; nj = j;
	while (ni < n&&s[ni] == '0')ni++;
	while (nj < m&&t[nj] == '0')nj++;
	P res2 = dfs(min(ni + 1, n + 1), min(nj + 1, m + 1));
	if (res1.second <= res2.second) {
		res = { 0,res1.second + 1 };
		nex[i][j] = { min(mi + 1, n + 1), min(mj + 1, m + 1) };
	}
	else if (res1.second > res2.second) {
		res = { 1,res2.second + 1 };
		nex[i][j] = { min(ni + 1, n + 1), min(nj + 1, m + 1) };
	}
	return ans[i][j] = res;
}
string out;
int main() {
	cin >> s >> t; n = s.length(); m = t.length();
	dfs(0, 0);
	P now = { 0,0 };
	while (now.first >=0&& now.second>=0) {
		if(ans[now.first][now.second].second)out.push_back(ans[now.first][now.second].first + '0');
		now = nex[now.first][now.second];
		//cout << now.first << " " << now.second << endl;
	}
	cout << out << endl;
	return 0;
}



Measured memory_bytes: 179020
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<int>> light(M, vector<int>());
    rep(i, M) {
        int k;
        cin >> k;
        rep(j, k) {
            int a;
            cin >> a;
            a--;
            light[i].pb(a);
        }
    }
    vector<int> p(M);
    rep(i, M) cin >> p[i];
    int res = 0;
    for(int bit = 0; bit < (1 << N); bit++) {
        vector<bool> swc(N);
        rep(i, N) {
            if(bit & (1 << i))
                swc[i] = 1;
        }
        int flag = 1;
        rep(i, M) {
            int num = 0;
            for(int x : light[i]) {
                if(swc[x])
                    num++;
            }
            if(num % 2 != p[i])
                flag = 0;
        }
        if(flag)
            res++;
    }
    cout << res << endl;
    return 0;
}

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

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

int main() {
    int N, R;
    cin >> N >> R;
    if (N < 10) R += 100 * (10 - N);
    cout << R << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

constexpr int mod = 998244353;
int ModPow(int x, int y) {
    if (y == 0) return 1;
    long long a = ModPow(x, y / 2);
    if (y & 1) return a * a % mod * x % mod;
    else return a * a % mod;
}


int main() {
    int N;
    cin >> N;
    vector<int> D(N);
    rep(i, N) cin >> D[i];
    
    vector<int> cnt(N, 0);
    rep(i, N) ++cnt[D[i]];
    if (D[0] != 0) {
        cout << 0 << endl;
        return 0;
    }
    if (cnt[0] == 0 != cnt[0] >= 2) {
        cout << 0 << endl;
        return 0;
    }
    REP(i, N) {
        if (cnt[i] >= 1 && cnt[i - 1] == 0) {
            cout << 0 << endl;
            return 0;
        }
    }
    long long ans = 1;
    REP(i, N) {
        if (cnt[i] == 0) break;
        ans *= ModPow(cnt[i - 1], cnt[i]);
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1024
N = gets.chomp.to_i
X = gets.chomp
X_10 = X.to_i(2)

p = X.count('1')
p_p = p + 1
p_m = p - 1
amari_p = X_10 % p_p
amari_m = p_m == 0 ? 0 : X_10 % p_m

N.times do |i|
  if X_10[N-1-i] == 0
    amari = (amari_p + 2.pow(N - 1 - i, p_p)) % p_p
  else
    if p_m == 0
      puts 0
      next
    end
    amari = (amari_m - 2.pow(N - 1 - i, p_m)) % p_m
  end
  count = 1

  while amari != 0 do
    amari = amari % amari.to_s(2).count('1')
    count = count + 1
  end

  puts count
end

Measured memory_bytes: 14668
n,y = list(map(int,input().split()))
tmp = False

for i in range(0,n+1):
    for j in range(0,n+1-i):
        if tmp == True:
            break
        k = n-i-j
        if 10000 * i + 5000 * j + 1000 * k == y:
            print(i,j,k)
            tmp = True
            
if tmp == False:
    print(-1,-1,-1)

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define pb push_back
#define pf push_front
#define mod 1000000007
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;
typedef vector<string> vs;
const double pi = acos(-1.0);

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

template<class T>
inline bool chmax(T& a, T b){if(a<b){a=b;return true;} return false;}

template<class T>
inline bool chmin(T& a, T b){if(a>b){a=b;return true;} return false;}

ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

int main()
{
	ll n;
	cin >> n;
	ll h=n/3600;
	ll m=(n%3600)/60;
	ll s=n%3600%60;
	cout << h << ":" << m << ":" << s << endl;
	return 0;
}


Measured memory_bytes: 3112
#include<iostream>

using namespace std;

int main(){
    int A, B, K;
    int s, min;
    cin >> A >> B >> K;
    
    if(A >= B) min = B;
    else min = A;

    int i, k;
    k = K;
    for(i=min; i>0; i--){
        if(A % i == 0 && B % i == 0){
            k--;
            s = i;
        }
        if(k == 0) break;
    }

    cout << s << endl;
    return 0;
}

Measured memory_bytes: 256
n = int(input())
a = [0] * n
b = [0] * n
amax = 1
bmin = 9999999990
for i in range(n):
    a[i],b[i] = list(map(int,input().split()))
amax = max(a)
bmin = min(b)
ans = amax +bmin

print(ans)


Measured memory_bytes: 10996
import sys
input = sys.stdin.readline
from collections import deque

N, Q = map(int, input().split())
G = [[] for _ in range(N)]
for i in range(N-1):
    a, b = map(int, input().split())
    a, b = a-1, b-1
    G[a].append(b)
    G[b].append(a)
point = [0]*N
for _ in range(Q):
    p, x = map(int, input().split())
    point[p-1] += x
q = deque([[0, -1, point[0]]])
done = [-1]*N
while q:
    cur, fr, p = q.popleft()
    done[cur] = p
    for nex in G[cur]:
        if nex == fr: continue
        q.append([nex, cur, p+point[nex]])
ans = []
for i in range(N):
    ans.append(done[i])
print(*ans)


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

using namespace std;

vector<int> primes(int x){
	vector<int> res;
	vector<bool> bo(x+1);
	for(int i=2;i<=x;i++){
		if(bo[i]) continue;
		res.push_back(i);
		for(int j=1;i*j<=x;j++) bo[i*j]=true;
	}
	return res;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	int x;
	cin >> x;
	vector<int> prs=primes(1010101);
	for(int i=0;i<prs.size();i++){
		if(prs[i]>=x){
			cout << prs[i] << "\n";
			return 0;
		}
	}
	return 0;
}

Measured memory_bytes: 1020
#include<stdio.h>
 
int main(){
  
  char S[200000];
   char T[200000];
  while(scanf("%s",S)==0);
  while(scanf("%s",T)==0);
  
  int i,N=0;
  
  for(i=0;T[i]!='\0';i++){
    if(S[i]!=T[i]){
      N++;  
    }
    
  }
  
  printf("%d",N);
  
 return 0; 
}

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

int main()
{
  int x;
  cin >> x;
  
  if(x >= 1800){
    cout << 1 << endl;
  }else if(x >= 1600){
    cout << 2 << endl;
  }else if(x >= 1400){
    cout << 3 << endl;
  }else if(x >= 1200){
    cout << 4 << endl;
  }else if(x >= 1000){
    cout << 5 << endl;
  }else if(x >= 800){
    cout << 6 << endl;
  }else if(x >= 600){
    cout << 7 << endl;
  }else if(x >= 400){
    cout << 8 << endl;
  }
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
    int N;
    std::vector<int> W;
    std::cin >> N;
    for(int i=0; i<N; i++){
        int temp;
        std::cin >> temp;
        W.push_back(temp);
    }
    int S1=0;
    for(int i=0; i<N; i++){
        S1+=W[i];
    }
    int judge=S1;
    int S2=0;
    for(int i=0; i<N; i++){
        if(abs(S1-S2) < judge){
            judge=abs(S1-S2);
        }
        S1-=W[i];
        S2+=W[i];
    }

std::cout << judge << std::endl;
    return 0;
}

Measured memory_bytes: 256
n, m, x = map(int, input().split())
inp=[]

# 入力をすべて受け取る
for i in range(n):
  tmp = list(map(int, input().split()))
  inp.append(tmp)

# bit全探索を行うための箱づくり
sum = 0
min = 10**10
for i in range(2**n):
  tmp = [0]*m
  flg = 0
  
  # ある買う買わないのケースに対して、フラグが立ってたらスキルポイントを増やす
  for j in range(n):
    if ((i >> j) & 1):  # 順に右にシフトさせ最下位bitのチェックを行う
      sum += inp[j][0]
      for k in range(1,m+1):
        #print(n,j, k, tmp, inp)
        tmp[k-1] += inp[j][k]
  for ii, k in enumerate(tmp):
    if k < x: # x未満ならflgをたててNGとする
      flg = 1
      break
  #print(tmp, flg)
  if sum < min and flg == 0: min = sum
  sum = 0
  
if min == 10**10: min = -1
print(min)

Measured memory_bytes: 9148
import heapq, copy
n, k = map(int, input().split())
v = list(map(int, input().split()))
ans = -10 ** 10
for a in range(k + 1):
    for b in range(k - a + 1):
        if a + b > min(k, n):
            break
        # print(a, b)
        have = v[:a] + v[n-b:]
        # print(have)

        tmp = sum(have)
        ans = max(ans, tmp)

        have.sort()

        c = k - a - b

        for item in have:
            if c <= 0:
                break
            c -= 1
            if item >= 0:
                break

            tmp -= item
        ans = max(ans, tmp)

print(ans)

Measured memory_bytes: 74648
#include <bits/stdc++.h>
#define sg(i) ((i) + 2 * n)

typedef std::pair <int, int> pr;
const int N = 20054;

int n, Estd;
int l[N], r[N], lp[N], rp[N], F[N];
pr D[N];

inline void down(int &x, const int y) {x > y ? x = y : 0;}

namespace Graph {
	const int N = 500054, M = 1000054;

	struct edge {
		int u, v;
		edge (int u0 = 0, int v0 = 0) : u(u0), v(v0) {}
	} e[M];

	int V, E = 0;
	int first[N], next[M];
	int cnt = 0, id[N], low[N];
	int stc = 0, stack[N], top[N];
	bool in_stack[N];

	inline void addedge(int u, int v) {e[++E] = edge(u, v), next[E] = first[u], first[u] = E;}
	inline void deledge(int end) {for (; E > end; --E) first[e[E].u] = next[E];}

	void dfs(int x) {
		int i, y; id[x] = low[x] = ++cnt, in_stack[x] = true, stack[stc++] = x;
		for (i = first[x]; i; i = next[i])
			if (!id[y = e[i].v])
				dfs(y), down(low[x], low[y]);
			else if (in_stack[y])
				down(low[x], id[y]);
		if (id[x] == low[x])
			for (y = 0; y != x; y = stack[--stc], in_stack[y] = false, top[y] = x);
	}

	inline bool _2_SAT() {
		int i, u, v; cnt = stc = 0;
		memset(id, 0, (V + 1) << 2);
		for (i = 1; i <= V; ++i) if (!id[i]) dfs(i);
		for (i = 1; i <= n; ++i)
			if ((u = Graph::top[i]) == (v = Graph::top[i + n])) return false;
		return true;
	}
}

namespace ST {
	struct node {int lc, rc;} x[N * 2];
	int cnt = 0, leaf[N];

	int build(int L, int R) {
		int id = ++cnt;
		if (L == R) return leaf[L] = id;
		int M = (L + R - 1) >> 1;
		x[id].lc = build(L, M), x[id].rc = build(M + 1, R);
		Graph::addedge(sg(id), sg(x[id].lc)), Graph::addedge(sg(id), sg(x[id].rc));
		return id;
	}

	void locate(int id, int L, int R, int ql, int qr, int vertex) {
		if (qr < L || R < ql || qr < ql) return;
		if (ql <= L && R <= qr) return Graph::addedge(vertex, sg(id));
		int M = (L + R - 1) >> 1;
		if (ql <= M) locate(x[id].lc, L, M, ql, qr, vertex);
		if (qr > M) locate(x[id].rc, M + 1, R, ql, qr, vertex);
	}
}

inline int LB(int val) {return std::lower_bound(D, D + 2 * n, pr(val, INT_MIN)) - D - 1;}
inline int UB(int val) {return std::lower_bound(D, D + 2 * n, pr(val, INT_MAX)) - D;}

inline bool check(int v) {
	Graph::deledge(Estd);
	for (int i = 0; i < n; ++i)
		ST::locate(1, 0, 2 * n - 1, UB(l[i] - v), lp[i] - 1, i + 1),
		ST::locate(1, 0, 2 * n - 1, lp[i] + 1, LB(l[i] + v), i + 1),
		ST::locate(1, 0, 2 * n - 1, UB(r[i] - v), rp[i] - 1, i + n + 1),
		ST::locate(1, 0, 2 * n - 1, rp[i] + 1, LB(r[i] + v), i + n + 1);
	return Graph::_2_SAT();
}

int main() {
	int i, L = 0, R, M;
	scanf("%d", &n);
	for (i = 0; i < n; ++i) {
		scanf("%d%d", l + i, r + i);
		if (l[i] > r[i]) std::swap(l[i], r[i]);
		D[i] = pr(l[i], i), D[i + n] = pr(r[i], i + n);
	}
	std::sort(D, D + 2 * n);
	for (i = 0; i < 2 * n; ++i) F[D[i].second] = i;
	for (i = 0; i < n; ++i) lp[i] = F[i], rp[i] = F[i + n];
	ST::build(0, 2 * n - 1), assert(ST::cnt = 4 * n - 1);
	for (i = 0; i < n; ++i)
		Graph::addedge(sg(ST::leaf[lp[i]]), i + n + 1),
		Graph::addedge(sg(ST::leaf[rp[i]]), i + 1);
	Estd = Graph::E, Graph::V = 6 * n - 1;
	for (R = std::max(r[1] - *l, *r - l[1]); L < R; check(M = (L + R + 1) / 2) ? L = M : (R = M - 1));
	printf("%d\n", L);
	return 0;
}

Measured memory_bytes: 24064
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

#define REP(i,s,n) for(int i=(int)(s);i<(int)(n);i++)
#define DEBUGP(val) cerr << #val << "=" << val << "\n"

using namespace std;
typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PI;
const ll mod = 1e9 + 7;



int main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int k;
  cin >> k;
  VL a(k);
  REP(i, 0, k) {
    cin >> a[i];
  }
  ll l = 2, r = 2;
  for (int i = k - 1; i >= 0; --i) {
    ll nl = (l + a[i] - 1) / a[i] * a[i];
    ll nr = (r / a[i] + 1) * a[i] - 1;
    if (nl > nr) {
      cout << -1 << endl;
      return 0;
    }
    l = nl;
    r = nr;
  }
  cout << l << " " << r << endl;
}


Measured memory_bytes: 1024
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <algorithm>
#include <utility>
#include <deque>
#include <stack>
#include <bitset>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
#define rep(i,n) for (int i=0;i<n;++i)
#define REP(i,n) for (int i=1;i<=n;++i)
#define all(x) x.begin(),x.end()
#define mp make_pair
#define pb push_back
#define pf push_front
#define F first
#define S second
#define read(x) scanf("%d",&x)
typedef bitset<1000005> bs;
int n,k;
string s[2005];
char S[1000005];
int Len=0;
bool can[2005][10005];
int len[2005],idx[2005];
bs segtree[64];
bs state;
inline int getBest(){
	int u=1;
	while(u<32){
		if ((state&segtree[u*2]).none()) u=u*2+1;
		else u*=2;
	}
	return (char)(u-32+'a');
}
int main(){
	//ios::sync_with_stdio(false);
	cin>>n>>k;
	for (int i=1;i<=n;++i) cin>>s[i];
	for (int i=1;i<=n;++i) len[i]=s[i].size();
	for (int i=1;i<=n;++i) if (len[i]>k) return 1;
	can[n][k]=1;
	for (int i=n;i>=1;--i){
		for (int j=k;j>=len[i];--j) if (can[i][j]) can[i-1][j]=can[i-1][j-len[i]]=1;
	}
	for (int i=1;i<=n;++i){
		for (int j=0;j<len[i];++j){
			S[Len+j]=s[i][j];
		}
		idx[i]=Len;//beginning pos
		Len+=len[i];
	}
	for (int i=0;i<64;++i) segtree[i].reset();
	for (int i=0;i<Len;++i) segtree[S[i]-'a'+32].set(i);
	for (int i=31;i>0;--i) segtree[i]=segtree[i<<1]|segtree[i<<1|1];
	state.reset();
	state.set(0);
	for (int i=0;i<k;++i){// alrady got i chars
		for (int j=1;j<n;++j) if (state[idx[j]]) state.set(idx[j+1]);
		for (int j=1;j<=n;++j) if (i+len[j]>k||!can[j][i+len[j]]) state.reset(idx[j]);
		char nxt=getBest();
		cout<<nxt;
		state&=segtree[nxt-'a'+32];
		state<<=1;// move on
	}
	cout<<endl;
	return 0; 
}

Measured memory_bytes: 30208
import sys
N = int(input())
L = list(map(int,input().split()))
for i in range(N-1,0,-1):
    if L[i-1] > L[i]:
        if L[i-1] - 1>L[i]:
            print('No')
            sys.exit(0)
        L[i-1]-=1
print('Yes')

Measured memory_bytes: 14396
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <utility>
#include <cstring>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <cassert>
using namespace std;
using ll = long long;
const int INF = 1<<30;
const int MOD = 1e9 + 7;
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m; cin >> n >> m;
    vector<int> a(n), b(m);
    for(int i = 0; i < n; i++) cin >> a[i];
    for(int i = 0; i < m; i++) cin >> b[i];
    ll sum = 0;
    for(int i = 0; i < m; i++) sum += b[i];
    ll ans = 0;
    for(int i = 0; i < n; i++) ans += a[i] * sum;
    cout << ans << endl;
    return 0;
}




Measured memory_bytes: 3596
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;


public class A
{
	public static void Main()
	{
		string[] args = Console.ReadLine().Split(' ');
		int A = Int32.Parse(args[0]);
		int B = Int32.Parse(args[1]);
		Console.WriteLine(Math.Max(A+B, Math.Max(A-B, A*B)));
	}
}





Measured memory_bytes: 11092
use std::io::*;
use std::str::FromStr;

fn main() {
    let h: usize = read();
    let w: usize = read();
    let mut a: Vec<Vec<char>> = (0..h).map(|_| read::<String>().chars().collect()).collect();

    let mut x = 0;
    let mut y = 0;
    let mut check = true;
    loop {
        let po1 = x < w - 1 && a[y][x + 1] == '#';
        let po2 = y < h - 1 && a[y + 1][x] == '#';
        if (po1 && po2) || (x > 0 && a[y][x - 1] == '#') || (y > 0 && a[y - 1][x] == '#') {
            check = false;
            break;
        }
        a[y][x] = '.';
        if x == w - 1 && y == h - 1 {
            break;
        }
        if po1 {
            x += 1;
        }
        if po2 {
            y += 1;
        }
    }
    println!("{}", if check { "Possible" } else { "Impossible" });
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}


Measured memory_bytes: 4352
N,K = gets.chomp.split.map(&:to_i)

k_max = [N-1, K].min

ans = 0
MOD = 10**9 + 7

def pow(base,exponent)
  raise ArgumentError if exponent < 0
  # 指数が0の時は結果は1です
  return 1 if exponent==0
  # 結果が出る変数を用意
  result = 1
  # 指数が1なら終了
  while exponent != 1 do
    # 指数が奇数の時、その時の底はここでresultに掛けてしまい、指数を一つ減らす
    if exponent.odd? then
      result *= base
      exponent -= 1
    end
    # 指数を2で割る
    exponent /= 2
    # 底の2乗を新たな底とする
    base *= base
    base = base % MOD
    # 繰り返す
  end
  result *= base
  # 結果を返す
  return result % MOD
end

def set_fac(n)
  1.upto(n) do |i|
    @fac[i] = @fac[i-1] * i % MOD
  end

  # 最も大きいのは最後のやつ
  # mod pにおけるaの逆元はa^(p-2)つまり mod pの状況で bで割ってから pのあまりというのはb^(p-2)をかけるのに等しい
  @rfac[-1] = pow(@fac[-1], MOD - 2) % MOD
  (n-1).downto(0) do |i|
    @rfac[i] = @rfac[i+1] * (i+1) % MOD
  end
end

@fac = Array.new(N+1, 1)
@rfac = Array.new(N+1)

set_fac(N)

0.upto(k_max) do |i|
  a = @fac[N] * @rfac[N-i] * @rfac[i] % MOD
  b = @fac[N-1] * @rfac[N-i-1] * @rfac[i] % MOD
  ans += a * b % MOD
end

puts ans % MOD


Measured memory_bytes: 6908
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;  
#define pb push_back
#define F first
#define S second
#define ppp pair<ll,pair<ll,ll>>
#define pp pair<ll,ll>
#define all(x) (x).begin(),(x).end()
#define pi 3.14159265358
#define MOD 998244353



int main()
{

    // #ifndef ONLINE_JUDGE
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout); 
    // freopen("error.txt", "w", stderr); 
    // #endif
    
     ios_base::sync_with_stdio(false);
     cin.tie(NULL);

     
   	 ll a,b,c;

   	 cin>>a>>b>>c;
   	 swap(a,b);
   	 swap(a,c);

   	 cout<<a<<" "<<b<<" "<<c;

}



Measured memory_bytes: 256
#pragma target("avx")
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef unordered_map<ll, ll> U_MAP;
typedef priority_queue<ll> pq;
typedef priority_queue<ll, vector<ll>, greater<ll>> rpq;
const int INF = 1e9, MOD = 1e9 + 7, ohara = 1e6 + 10;
const ll LINF = 1e18;

#define rep(i, n) for (ll(i) = 0; (i) < (int)(n); (i)++)
#define rrep(i, a, b) for (ll i = (a); i < (b); i++)
#define rrrep(i, a, b) for (ll i = (a); i >= (b); i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout << (x) << endl
#define doublecout(a) cout << fixed << setprecision(15) << a << endl;
#define fi first
#define se second
#define m_p make_pair
#define p_b push_back
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
template <typename A>
string to_string(A v) {
  bool first = true;
  string res = "{";
  for (const auto& x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H);
  debug_out(T...);
}
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)

//------ Believe yourself as a genius!!!!!! ------

int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
// int dy[]={-1,0,1,-1,1,-1,0,1};int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"), s;
ll n, cnt, ans, a[ohara], b, c, d, tmp, m, h, w, x, y, sum, k, q;
U_MAP mp;

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

  cin >> n;
  rep(i, n) {
    cin >> a[i];
    mp[a[i]]++;
  }
  sort(a, a + n);
  reverse(a, a + n);
  rep(i, n) {
    if (mp[a[i]] >= 2) {
      mp[a[i]] -= 2;
      if (b == 0)
        b = a[i];
      else {
        c = a[i];
        break;
      }
    }
  }
  Cout(b * c);
  return 0;
}

Measured memory_bytes: 5156
n,x,y=map(int,input().split())
l=[0 for i in range(n-1)]
#print(l)
length=0
for i in range(1,n):
  for j in range(i+1,n+1):
    length=min(abs(j-i)-1,abs(y-j)+abs(x-i),abs(y-j)+abs(x-i))
    #print(i,j,length)
    l[length]+=1
for i in l:
  print(i)

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

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

		List<String> list = new ArrayList<>();
		for (int i = x - k + 1; i < x + k; i++) {
			list.add(String.valueOf(i));
		}
		System.out.println(String.join(" ", list));
	}
}


Measured memory_bytes: 23764
#include <cstdio>
#include <algorithm>
using namespace std;

int n,h,m,ans;

int main()
{
    scanf("%d",&n);
    while (n--)
    {
        scanf("%d",&h);
        if (h>=m)
        {
            m=h;
            ans++;
        }
    }
    printf("%d",ans);
    getchar(); getchar();
    return 0;
}

Measured memory_bytes: 128
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	A1 := make([]int, 0, N)
	A2 := make([]int, 0, N)
	var tmp int
	for i := 0; i < N; i++ {
		fmt.Scan(&tmp)
		A1 = append(A1, tmp)
	}
	for i := 0; i < N; i++ {
		fmt.Scan(&tmp)
		A2 = append(A2, tmp)
	}

	a1sum := 0
	a1sums := make([]int, N)
	for i := 0; i < N; i++ {
		a1sum += A1[i]
		a1sums[i] = a1sum
	}
	a2sum := 0
	a2sums := make([]int, N)
	for i := N - 1; i >= 0; i-- {
		a2sum += A2[i]
		a2sums[i] = a2sum
	}
	max := 0
	tmpMax := 0
	for i := 0; i < N; i++ {
		tmpMax = a1sums[i] + a2sums[i]
		if max < tmpMax {
			max = tmpMax
		}
	}
	fmt.Println(max)
}


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

int main() {
  int a, b, c, x;
  std::cin >> a >> b >> c >> x;

  int count = 0;

  for (int i = 0; i <= a; i++) {
    for (int j = 0; j <= b; j++) {
      for (int k = 0; k <= c; k++) {
        if (500 * i + 100 * j + 50 * k == x) {
          count++;
        }
      }
    }
  }

  std::cout << count << std::endl;
  return 0;
}


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

using namespace std;

int main () {
  string S, T;
  cin >> S >> T;
  int length = S.length();
  unordered_map<char, char> map;
  unordered_map<char, char> revmap;
  for (int i = 0; i < length; i++) {
    if (map[S[i]]) {
      if (map[S[i]] != T[i]) {
        cout << "No" << endl;
        return 0;
      }
    }
    if (revmap[T[i]]) {
      if (revmap[T[i]] != S[i]) {
        cout << "No" << endl;
        return 0;
      }
    }
    map[S[i]] = T[i];
    revmap[T[i]] = S[i];
  }
  cout << "Yes" << endl;
}


Measured memory_bytes: 776
A=int(input())
B=int(input())
C=int(input())
X=int(input())

cnt=0
for i in range(A+1):
  for j in range(B+1):
    S=500*i+100*j
    if S>X:
      break
    #print(i,j,(X-S)/50)
    if (X-S)%50==0 and (X-S)/50<=C:
      cnt +=1
print(cnt)

Measured memory_bytes: 3064
N = int(input())
A = list(map(int,input().split()))
B = []
for i in range(3*N-1,-1,-1):
    B.append(A[i]*-1)
"""
前半をできるだけおおきく、後半をできるだけ小さくする。
前半はpriority queにぶっこんでいって、最小値を除去していく
"""
import heapq
frontSum = sum(A[:N])
frontQue = A[:N]
heapq.heapify(frontQue)
front = [frontSum]
for i in range(N,2*N):
    frontSum += A[i]
    heapq.heappush(frontQue,A[i])
    frontSum -= heapq.heappop(frontQue)
    front.append(frontSum)

backSum = sum(B[:N])
backQue = B[:N]
heapq.heapify(backQue)
back = [backSum*-1]
for i in range(N,2*N):
    backSum += B[i]
    heapq.heappush(backQue,B[i])
    backSum -= heapq.heappop(backQue)
    back.append(backSum*-1)
back = back[::-1]

candi = []
for i in range(len(front)):
    candi.append(front[i]-back[i])
print(max(candi))


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

int main() {
	int n, a, b;
	cin >> n >> a >> b;
	int x = a*n;
	int w = x;
	int g = w;
	int juan = 0;
	if(g < b) juan = 1;
	cout << ((juan == 1) ? g : b) << '\n';
	
	return 0;
}

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

int main() {
	for (;;) {
		string str;
		std::cin >> str;
		if (str.compare("0") == 0) break;

		int ans = 0;
		for (int i = 0; i < (int)str.size(); ++i) {
			ans += (int)str[i] - 48;
		}

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


Measured memory_bytes: 3188
n, m= gets.chomp.split.map(&:to_i)

d = gets.chomp.split.map(&:to_i)

res = 0

(0..m-1).each do |i|
	res += (d[i]+1)*0.5
end

mx = res

(m..n-1).each do |i|
	res = res+(d[i]+1)*0.5-(d[i-m]+1)*0.5
	mx = [mx, res].max
end

puts mx

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

int main()
{
	int N,K,C;
	string S;
	cin >> N >> K >> C;
	cin >> S;
	int idx = 0, cnt = 0;
	while(cnt < K)
	{
		if (S[idx] == 'o')
		{
			d1.push_back(idx);
			idx += C;
			cnt++;
		}
		idx++;
	}
	idx = N-1, cnt = 0;
	while(cnt < K)
	{
		if (S[idx] == 'o')
		{
			d2.push_back(idx);
			idx -= C;
			cnt++;
		}
		idx--;
	}
	reverse(d2.begin(),d2.end());
	rep(i,K)
	{
		if (d1[i] == d2[i]) cout << d1[i]+1 << endl;
	}
	return 0;
}

Measured memory_bytes: 3448
#include <stdio.h>

int main()
{
	int i, N;
	long long sum = 0;
	scanf("%d", &N);
	for (i = 1; i <= N; i++) {
		if (i % 3 != 0 && i % 5 != 0) sum += i;
	}
	printf("%lld\n", sum);
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1716
#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<ld> v(n);
	for(auto &x : v){
		cin>>x;
	}
	sort(v.rbegin(), v.rend());
	while(v.size() >= 2){
		ld x = v.back(); v.pop_back();
		ld y = v.back(); v.pop_back();
		v.push_back((x + y)/2);
	}
	cout<<v[0]<<endl;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> ii;;
const int maxn = 2e5 + 5;


int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);	
	int n , k;
	cin >> k >> n;
	for(int i = n - k + 1 ; i <= n + k - 1 ; ++i)cout << i << " ";
}


Measured memory_bytes: 256